@bouko/react 0.5.7 → 1.5.6

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.
@@ -4,7 +4,6 @@ export type ButtonProps = {
4
4
  size?: "sm" | "md" | "lg";
5
5
  style?: string;
6
6
  onClick?: () => void;
7
- disabled?: boolean;
8
7
  children: ReactNode;
9
8
  };
10
9
  export declare function Button({ variant, style, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -4,18 +4,16 @@ export function Button({ variant, style, ...props }) {
4
4
  return (_jsx("button", { className: cn(styles({ variant }), style), ...props }));
5
5
  }
6
6
  const styles = tv({
7
- base: "flex items-center gap-2 bg-accent hover:bg-accent-dark border border-accent-dark rounded font-semibold text-background-light duration-200 cursor-pointer disabled:cursor-not-allowed",
8
- defaultVariants: { size: "md" },
7
+ base: "flex items-center gap-2 px-4 py-2 bg-accent hover:bg-accent-dark border border-accent-dark rounded font-semibold text-background-light duration-200 cursor-pointer",
9
8
  variants: {
10
9
  variant: {
11
10
  primary: "bg-primary hover:bg-primary-dark border-primary-dark",
12
- outline: "!bg-transparent border-accent hover:border-accent-dark text-primary",
11
+ outline: "!bg-transparent border-2 border-accent hover:border-accent-dark text-primary",
13
12
  ghost: "!bg-transparent border-transparent text-accent hover:text-accent-dark"
14
13
  },
15
14
  size: {
16
15
  sm: "px-3 py-1 text-sm",
17
- md: "px-4 py-2",
18
- lg: "px-5 py-3 text-lg"
16
+ lg: "text-lg"
19
17
  }
20
18
  }
21
19
  });
@@ -0,0 +1,4 @@
1
+ import { type ReactNode } from "react";
2
+ export default function FadeCarousel({ items }: {
3
+ items: ReactNode[];
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useState, useEffect } from "react";
4
+ import { AnimatePresence, motion } from "framer-motion";
5
+ export default function FadeCarousel({ items }) {
6
+ const [index, setIndex] = useState(0);
7
+ useEffect(() => {
8
+ const interval = setInterval(() => {
9
+ setIndex((prev) => (prev + 1) % items.length);
10
+ }, 2000);
11
+ return () => clearInterval(interval);
12
+ }, []);
13
+ return (_jsx(AnimatePresence, { mode: "wait", children: _jsx(motion.div, { className: "absolute", transition: { duration: 0.5 }, initial: { opacity: 0, y: 5 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -5 }, children: items[index] }, index) }));
14
+ }
@@ -1,10 +1,6 @@
1
1
  import { type Field as FieldProps } from "@bouko/form";
2
2
  type Props<T> = FieldProps<T> & {
3
3
  placeholder?: string;
4
- styles?: {
5
- container?: string;
6
- input?: string;
7
- };
8
4
  };
9
- export default function Input<T>({ id, styles, style, label, required, note, update, ...props }: Props<T>): import("react/jsx-runtime").JSX.Element;
5
+ export default function Input<T>({ id, style, label, required, note, update, ...props }: Props<T>): import("react/jsx-runtime").JSX.Element;
10
6
  export {};
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Field from "./field";
3
- import { cn } from "@bouko/style";
4
3
  import { setField } from "@bouko/form";
5
- export default function Input({ id, styles, style, label, required = true, note, update, ...props }) {
6
- return (_jsx(Field, { style: styles?.container, label: label, required: required, note: note, children: _jsx("input", { className: cn("px-3 py-2 bg-input border border-outline duration-200 focus:border-outline-light outline-none rounded text-sm", styles?.input), onChange: ({ target: { value } }) => setField(update, id, value), ...props }) }));
4
+ export default function Input({ id, style, label, required = true, note, update, ...props }) {
5
+ return (_jsx(Field, { style: style, label: label, required: required, note: note, children: _jsx("input", { className: "px-3 py-2 bg-slate-200/50 border border-slate-300 outline-blue-500 rounded text-sm", onChange: ({ target: { value } }) => setField(update, id, value), ...props }) }));
7
6
  }
@@ -1,2 +1 @@
1
1
  export declare const getFileData: (files: File[]) => Promise<unknown[]>;
2
- export declare const getEnv: (key: string) => string;
@@ -13,9 +13,3 @@ export const getFileData = (files) => Promise.all(files.map((file) => {
13
13
  reader.readAsDataURL(file);
14
14
  });
15
15
  }));
16
- export const getEnv = (key) => {
17
- const value = process.env[key];
18
- if (!value)
19
- throw new Error(`Missing required env: ${key}`);
20
- return value;
21
- };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export { default as Attachment } from "./components/attachment";
6
6
  export { default as CheckBox } from "./components/checkbox";
7
7
  export { default as Heading } from "./components/heading";
8
8
  export { default as Badge } from "./components/badge";
9
+ export { default as FadeCarousel } from "./components/fade-carousel";
9
10
  export * from "./components/flex";
10
11
  export * from "./components/button";
11
12
  export * from "./core/types";
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export { default as Attachment } from "./components/attachment";
6
6
  export { default as CheckBox } from "./components/checkbox";
7
7
  export { default as Heading } from "./components/heading";
8
8
  export { default as Badge } from "./components/badge";
9
+ export { default as FadeCarousel } from "./components/fade-carousel";
9
10
  export * from "./components/flex";
10
11
  export * from "./components/button";
11
12
  export * from "./core/types";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "0.5.7",
4
+ "version": "1.5.6",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  "@bouko/form": "^0.2.1",
23
23
  "@bouko/style": "^0.1.1",
24
24
  "clsx": "^2.1.1",
25
- "framer-motion": "^12.16.0",
25
+ "framer-motion": "^12.23.6",
26
26
  "tailwind-merge": "^3.3.0",
27
27
  "tailwind-variants": "^1.0.0"
28
28
  },