@bouko/react 0.5.7 → 1.5.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.
- package/dist/components/button.d.ts +0 -1
- package/dist/components/button.js +3 -5
- package/dist/components/fade-carousel.d.ts +4 -0
- package/dist/components/fade-carousel.js +14 -0
- package/dist/components/input.d.ts +1 -5
- package/dist/components/input.js +2 -3
- package/dist/core/functions.d.ts +0 -1
- package/dist/core/functions.js +0 -6
- package/package.json +2 -2
|
@@ -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
|
|
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
|
-
|
|
18
|
-
lg: "px-5 py-3 text-lg"
|
|
16
|
+
lg: "text-lg"
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
19
|
});
|
|
@@ -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,
|
|
5
|
+
export default function Input<T>({ id, style, label, required, note, update, ...props }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
6
|
export {};
|
package/dist/components/input.js
CHANGED
|
@@ -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,
|
|
6
|
-
return (_jsx(Field, { style:
|
|
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
|
}
|
package/dist/core/functions.d.ts
CHANGED
package/dist/core/functions.js
CHANGED
|
@@ -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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
|
|
3
3
|
"name": "@bouko/react",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "1.5.5",
|
|
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.
|
|
25
|
+
"framer-motion": "^12.23.6",
|
|
26
26
|
"tailwind-merge": "^3.3.0",
|
|
27
27
|
"tailwind-variants": "^1.0.0"
|
|
28
28
|
},
|