@bouko/react 2.0.4 → 2.0.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.
@@ -11,13 +11,6 @@ type Props = Component & {
11
11
  * @param {ReactNode} children - Child elements to render inside the row.
12
12
  * @param {Props} opts - Variant options for styling.
13
13
  **/
14
- export declare const RowBox: ({ style, children, ...opts }: Props) => import("react/jsx-runtime").JSX.Element;
15
- export declare const ColumnBox: ({ style, children, ...opts }: Props) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const RowBox: ({ style, children, ...opts }: Props) => import("react/jsx-runtime").JSX.Element | undefined;
15
+ export declare const ColumnBox: ({ style, children, ...opts }: Props) => import("react/jsx-runtime").JSX.Element | undefined;
16
16
  export {};
17
- /**
18
- * Problems
19
- *
20
- * - Perfect `Component`
21
- * - Perfect `cn`
22
- * - Perfect `tv`
23
- **/
@@ -1,4 +1,4 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn, tv } from "@bouko/style";
3
3
  /**
4
4
  * Flex containers with configurable alignment and styling.
@@ -8,14 +8,12 @@ import { cn, tv } from "@bouko/style";
8
8
  * @param {Props} opts - Variant options for styling.
9
9
  **/
10
10
  export const RowBox = ({ style, children, ...opts }) => {
11
- if (!children)
12
- return _jsx(_Fragment, {});
13
- return (_jsx("div", { className: cn(row(opts), style), children: children }));
11
+ if (children)
12
+ return (_jsx("div", { className: cn(row(opts), style), children: children }));
14
13
  };
15
14
  export const ColumnBox = ({ style, children, ...opts }) => {
16
- if (!children)
17
- return _jsx(_Fragment, {});
18
- return (_jsx("div", { className: cn(column(opts), style), children: children }));
15
+ if (children)
16
+ return (_jsx("div", { className: cn(column(opts), style), children: children }));
19
17
  };
20
18
  /**
21
19
  * Styling variants for flex options.
@@ -1,3 +1 @@
1
- import { ReactNode } from "react";
2
- export declare const rn: (...elements: ReactNode[]) => import("react/jsx-runtime").JSX.Element;
3
1
  export declare const formatText: (text: string) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Fragment } from "react";
3
2
  const delimiterConfig = [
4
3
  { delimiter: "**", render: (text, key) => _jsx("span", { className: "font-bold", children: text }, key) },
5
4
  { delimiter: "~~", render: (text, key) => _jsx("span", { className: "font-semibold", children: text }, key) },
@@ -9,7 +8,6 @@ const escapeRegex = (str) => str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
9
8
  const delimiters = delimiterConfig.map(({ delimiter }) => escapeRegex(delimiter) + ".*?" + escapeRegex(delimiter)).join("|");
10
9
  const WRAPPED_TEXT_REGEX = new RegExp(`(${delimiters})`, "g");
11
10
  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))) }));
13
11
  export const formatText = (text) => {
14
12
  const parts = text
15
13
  .split(WRAPPED_TEXT_REGEX)
@@ -1,11 +1,11 @@
1
- import { ReactNode, ReactElement } from "react";
2
- export type Renderable = ReactElement | string | null;
1
+ import { ReactNode } from "react";
2
+ /**
3
+ * Common props for React components.
4
+ *
5
+ * @property style - Tailwind class name(s) (optional)
6
+ * @property children - React children nodes (optional)
7
+ **/
3
8
  export type Component = {
4
9
  style?: string;
5
10
  children?: ReactNode;
6
11
  };
7
- export type Attachment = {
8
- filename: string;
9
- mimetype: string;
10
- data: string;
11
- };
@@ -1 +1,2 @@
1
1
  export {};
2
+ // clean
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  "name": "@bouko/react",
4
4
 
5
- "version": "2.0.4",
5
+ "version": "2.0.5",
6
6
 
7
7
  "main": "./dist/index.js",
8
8
 
@@ -36,13 +36,13 @@
36
36
 
37
37
  "dependencies": {
38
38
 
39
- "@bouko/style": "^0.1.5",
39
+ "@bouko/style": "^0.1.6",
40
40
 
41
41
  "clsx": "^2.1.1",
42
42
 
43
43
  "framer-motion": "^12.23.6",
44
44
 
45
- "tailwind-merge": "^3.3.0",
45
+ "tailwind-merge": "^3.3.1",
46
46
 
47
47
  "tailwind-variants": "^1.0.0",
48
48