@bouko/react 1.9.6 → 1.9.8
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/form/footer.js +1 -1
- package/dist/components/form/index.js +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -0
- package/dist/{react/src/components → components}/layout/flex.js +11 -3
- package/dist/components/layout/heading.d.ts +16 -4
- package/dist/components/layout/heading.js +38 -7
- package/dist/components/search-bar.js +1 -1
- package/dist/core/format.d.ts +2 -0
- package/dist/core/format.js +2 -0
- package/dist/core/types.d.ts +5 -0
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +1 -1
- package/dist/components/badge.d.ts +0 -5
- package/dist/components/badge.js +0 -4
- package/dist/components/flex.d.ts +0 -16
- package/dist/components/flex.js +0 -8
- package/dist/hooks/color.d.ts +0 -7
- package/dist/hooks/color.js +0 -8
- package/dist/next/src/components/layouts/locked.d.ts +0 -12
- package/dist/next/src/components/layouts/locked.js +0 -15
- package/dist/react/src/components/animate/configs.d.ts +0 -136
- package/dist/react/src/components/animate/configs.js +0 -62
- package/dist/react/src/components/animate/index.d.ts +0 -12
- package/dist/react/src/components/animate/index.js +0 -7
- package/dist/react/src/components/attachment.d.ts +0 -2
- package/dist/react/src/components/attachment.js +0 -19
- package/dist/react/src/components/button.d.ts +0 -10
- package/dist/react/src/components/button.js +0 -22
- package/dist/react/src/components/checkbox.d.ts +0 -8
- package/dist/react/src/components/checkbox.js +0 -13
- package/dist/react/src/components/dropdown/normal.d.ts +0 -10
- package/dist/react/src/components/dropdown/normal.js +0 -19
- package/dist/react/src/components/fade-carousel.d.ts +0 -4
- package/dist/react/src/components/fade-carousel.js +0 -14
- package/dist/react/src/components/field.d.ts +0 -10
- package/dist/react/src/components/field.js +0 -10
- package/dist/react/src/components/form/footer.d.ts +0 -9
- package/dist/react/src/components/form/footer.js +0 -17
- package/dist/react/src/components/form/functions.d.ts +0 -8
- package/dist/react/src/components/form/functions.js +0 -27
- package/dist/react/src/components/form/index.d.ts +0 -26
- package/dist/react/src/components/form/index.js +0 -37
- package/dist/react/src/components/form/types.d.ts +0 -29
- package/dist/react/src/components/form/types.js +0 -1
- package/dist/react/src/components/index.d.ts +0 -8
- package/dist/react/src/components/index.js +0 -8
- package/dist/react/src/components/input.d.ts +0 -11
- package/dist/react/src/components/input.js +0 -7
- package/dist/react/src/components/layout/heading.d.ts +0 -24
- package/dist/react/src/components/layout/heading.js +0 -45
- package/dist/react/src/components/layout/separator.d.ts +0 -3
- package/dist/react/src/components/layout/separator.js +0 -5
- package/dist/react/src/components/list/index.d.ts +0 -2
- package/dist/react/src/components/list/index.js +0 -2
- package/dist/react/src/components/list/item.d.ts +0 -9
- package/dist/react/src/components/list/item.js +0 -7
- package/dist/react/src/components/list/variants/bullet.d.ts +0 -9
- package/dist/react/src/components/list/variants/bullet.js +0 -16
- package/dist/react/src/components/list/variants/number.d.ts +0 -10
- package/dist/react/src/components/list/variants/number.js +0 -18
- package/dist/react/src/components/multiple-choice.d.ts +0 -2
- package/dist/react/src/components/multiple-choice.js +0 -13
- package/dist/react/src/components/search-bar.d.ts +0 -9
- package/dist/react/src/components/search-bar.js +0 -14
- package/dist/react/src/components/select.d.ts +0 -6
- package/dist/react/src/components/select.js +0 -24
- package/dist/react/src/components/text/badge.d.ts +0 -9
- package/dist/react/src/components/text/badge.js +0 -16
- package/dist/react/src/components/textarea.d.ts +0 -7
- package/dist/react/src/components/textarea.js +0 -12
- package/dist/react/src/components/upload/file.d.ts +0 -8
- package/dist/react/src/components/upload/file.js +0 -15
- package/dist/react/src/core/format.d.ts +0 -3
- package/dist/react/src/core/format.js +0 -34
- package/dist/react/src/core/functions.d.ts +0 -3
- package/dist/react/src/core/functions.js +0 -41
- package/dist/react/src/core/types.d.ts +0 -10
- package/dist/react/src/core/types.js +0 -1
- package/dist/react/src/hooks/element/container.d.ts +0 -4
- package/dist/react/src/hooks/element/container.js +0 -7
- package/dist/react/src/hooks/element/resize.d.ts +0 -1
- package/dist/react/src/hooks/element/resize.js +0 -12
- package/dist/react/src/hooks/index.d.ts +0 -2
- package/dist/react/src/hooks/index.js +0 -2
- package/dist/react/src/index.d.ts +0 -14
- package/dist/react/src/index.js +0 -14
- /package/dist/{react/src/components → components}/layout/flex.d.ts +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { Button } from "../button";
|
|
5
|
-
import { RowBox } from "../flex";
|
|
5
|
+
import { RowBox } from "../layout/flex";
|
|
6
6
|
import CheckCircle from "./assets/check-circle.svg";
|
|
7
7
|
import Spinner from "./assets/spinner.svg";
|
|
8
8
|
export default function FormFooter({ data, validator, submit, clear }) {
|
|
@@ -7,7 +7,7 @@ import Spinner from "../../assets/icons/spinner.svg";
|
|
|
7
7
|
import XCircle from "../../assets/icons/x-circle.svg";
|
|
8
8
|
export * from "./functions";
|
|
9
9
|
export * from "./types";
|
|
10
|
-
import { RowBox } from "../flex";
|
|
10
|
+
import { RowBox } from "../layout/flex";
|
|
11
11
|
import Input from "../input";
|
|
12
12
|
import Select from "../select";
|
|
13
13
|
import TextArea from "../textarea";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { default as Heading
|
|
1
|
+
export { default as Heading } from "./layout/heading";
|
|
2
2
|
export { default as Separator } from "./layout/separator";
|
|
3
|
+
export * from "./layout/flex";
|
|
3
4
|
export { default as Badge } from "./text/badge";
|
|
4
5
|
export { default as Dropdown } from "./dropdown/normal";
|
|
5
6
|
export { default as FileUploader } from "./upload/file";
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Heading } from "./layout/heading";
|
|
2
2
|
export { default as Separator } from "./layout/separator";
|
|
3
|
+
export * from "./layout/flex";
|
|
3
4
|
export { default as Badge } from "./text/badge";
|
|
4
5
|
export { default as Dropdown } from "./dropdown/normal";
|
|
5
6
|
export { default as FileUploader } from "./upload/file";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, 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.
|
|
@@ -7,8 +7,16 @@ import { cn, tv } from "@bouko/style";
|
|
|
7
7
|
* @param {ReactNode} children - Child elements to render inside the row.
|
|
8
8
|
* @param {Props} opts - Variant options for styling.
|
|
9
9
|
**/
|
|
10
|
-
export const RowBox = ({ style, children, ...opts }) =>
|
|
11
|
-
|
|
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 }));
|
|
14
|
+
};
|
|
15
|
+
export const ColumnBox = ({ style, children, ...opts }) => {
|
|
16
|
+
if (!children)
|
|
17
|
+
return _jsx(_Fragment, {});
|
|
18
|
+
return (_jsx("div", { className: cn(column(opts), style), children: children }));
|
|
19
|
+
};
|
|
12
20
|
/**
|
|
13
21
|
* Styling variants for flex options.
|
|
14
22
|
*
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type Options = {
|
|
3
|
+
size?: "md" | "lg";
|
|
4
|
+
align?: "left" | "center";
|
|
5
|
+
};
|
|
6
|
+
type Styles = {
|
|
4
7
|
container?: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
};
|
|
12
|
+
type Props = {
|
|
13
|
+
options?: Options;
|
|
14
|
+
styles?: Styles;
|
|
5
15
|
badge?: string;
|
|
6
16
|
icon?: ReactNode;
|
|
7
17
|
title: ReactNode;
|
|
18
|
+
size?: "md" | "lg";
|
|
8
19
|
align?: "left" | "center";
|
|
9
20
|
subtitle?: ReactNode;
|
|
10
21
|
reverse?: boolean;
|
|
11
22
|
};
|
|
12
|
-
export default function Heading({ styles,
|
|
23
|
+
export default function Heading({ styles, options, badge, icon, title, subtitle, reverse }: Props): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -1,14 +1,45 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { cn, tv } from "@bouko/style";
|
|
3
|
+
import { RowBox, ColumnBox } from "..";
|
|
4
4
|
import Badge from "../text/badge";
|
|
5
|
-
export default function Heading({ styles = {},
|
|
6
|
-
|
|
5
|
+
export default function Heading({ styles = {}, options = {}, badge, icon, title, subtitle, reverse }) {
|
|
6
|
+
const custom = test(options);
|
|
7
|
+
return (_jsxs(RowBox, { style: cn(base.container, styles.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 })] })] }));
|
|
7
8
|
}
|
|
8
9
|
const base = {
|
|
9
10
|
container: "gap-2 items-center",
|
|
10
|
-
subcontainer: "flex grow flex-col",
|
|
11
11
|
badge: "mb-2",
|
|
12
|
-
title: "flex items-center gap-2 text-lg font-bold",
|
|
13
|
-
subtitle: "font-semibold text-primary-lighter"
|
|
14
12
|
};
|
|
13
|
+
const test = tv({
|
|
14
|
+
slots: {
|
|
15
|
+
subcontainer: "grow",
|
|
16
|
+
title: "items-center gap-2 text-xl font-bold text-primary",
|
|
17
|
+
subtitle: "items-center gap-2 font-semibold text-primary-light dark:text-primary-dark"
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
size: "md",
|
|
21
|
+
align: "center"
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
md: {
|
|
26
|
+
title: "text-xl 2xl:text-2xl",
|
|
27
|
+
subtitle: "text-base 2xl:text-lg"
|
|
28
|
+
},
|
|
29
|
+
lg: {
|
|
30
|
+
subcontainer: "gap-3",
|
|
31
|
+
title: "text-5xl 2xl:text-6xl",
|
|
32
|
+
subtitle: "text-sm sm:text-base 2xl:text-lg"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
align: {
|
|
36
|
+
left: {
|
|
37
|
+
subcontainer: "items-start"
|
|
38
|
+
},
|
|
39
|
+
center: {
|
|
40
|
+
subcontainer: "items-center",
|
|
41
|
+
subtitle: "justify-center text-center"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cloneElement, useState } from "react";
|
|
4
|
-
import { RowBox } from "./flex";
|
|
4
|
+
import { RowBox } from "./layout/flex";
|
|
5
5
|
import { Button } from "./button";
|
|
6
6
|
export function SearchBar({ button, placeholder, action }) {
|
|
7
7
|
const [query, search] = useState("");
|
package/dist/core/format.d.ts
CHANGED
package/dist/core/format.js
CHANGED
|
@@ -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/dist/core/types.d.ts
CHANGED
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export { default as Attachment } from "./components/attachment";
|
|
|
6
6
|
export { default as CheckBox } from "./components/checkbox";
|
|
7
7
|
export { default as FadeCarousel } from "./components/fade-carousel";
|
|
8
8
|
export * from "./components";
|
|
9
|
-
export * from "./components/flex";
|
|
10
9
|
export * from "./components/button";
|
|
11
10
|
export * from "./components/search-bar";
|
|
12
11
|
export * from "./core/types";
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ export { default as Attachment } from "./components/attachment";
|
|
|
6
6
|
export { default as CheckBox } from "./components/checkbox";
|
|
7
7
|
export { default as FadeCarousel } from "./components/fade-carousel";
|
|
8
8
|
export * from "./components";
|
|
9
|
-
export * from "./components/flex";
|
|
10
9
|
export * from "./components/button";
|
|
11
10
|
export * from "./components/search-bar";
|
|
12
11
|
export * from "./core/types";
|
package/package.json
CHANGED
package/dist/components/badge.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export default async function Badge({ style, children }) {
|
|
3
|
-
return (_jsx("span", { className: "w-min px-3 py-1 bg-accent/20 border border-accent-dark rounded-full text-xs text-accent-dark font-semibold", children: children }));
|
|
4
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
type Props = Position & {
|
|
3
|
-
style?: string;
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
};
|
|
6
|
-
type Position = {
|
|
7
|
-
center?: boolean;
|
|
8
|
-
centerX?: boolean;
|
|
9
|
-
centerY?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare function ColumnBox({ style, center, centerX, centerY, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export declare function RowBox({ style, children }: {
|
|
13
|
-
style?: string;
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
package/dist/components/flex.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "@bouko/style";
|
|
3
|
-
export function ColumnBox({ style, center, centerX, centerY, children }) {
|
|
4
|
-
return (_jsx("div", { className: cn("flex flex-col", center && "items-center justify-center", centerX && "items-center", centerY && "justify-center", style), children: children }));
|
|
5
|
-
}
|
|
6
|
-
export function RowBox({ style, children }) {
|
|
7
|
-
return (_jsx("div", { className: cn("flex", style), children: children }));
|
|
8
|
-
}
|
package/dist/hooks/color.d.ts
DELETED
package/dist/hooks/color.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
export default function useColor({ variable, color, original }) {
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
document.documentElement.style.setProperty(`--${variable}`, color);
|
|
6
|
-
return () => document.documentElement.style.setProperty(`--${variable}`, original);
|
|
7
|
-
}, []);
|
|
8
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
type LayoutProps = {
|
|
3
|
-
company: string;
|
|
4
|
-
fonts: string[];
|
|
5
|
-
providers: ({ children }: {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}) => React.JSX.Element;
|
|
8
|
-
authorized: boolean;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
};
|
|
11
|
-
export default function LockedLayout({ company, fonts, providers, authorized, children }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// import Header from "@/components/layout/header";
|
|
3
|
-
// import Footer from "@/components/layout/footer";
|
|
4
|
-
import { cloneElement } from "react";
|
|
5
|
-
import { cn } from "@bouko/style";
|
|
6
|
-
export default function LockedLayout({ company, fonts, providers, authorized, children }) {
|
|
7
|
-
return (_jsx("html", { lang: "en", className: cn(...fonts, "scroll-smooth"), children: _jsx("body", { className: styles.body, children: cloneElement(providers({
|
|
8
|
-
children: (_jsx("main", { className: styles.container, children: _jsx("div", { className: styles.content, children: children }) }))
|
|
9
|
-
})) }) }));
|
|
10
|
-
}
|
|
11
|
-
const styles = {
|
|
12
|
-
body: "h-[100dvh] bg-background font-sans text-primary select-none sm:overflow-hidden antialiased",
|
|
13
|
-
container: "flex flex-col w-full h-full sm:overflow-hidden",
|
|
14
|
-
content: "flex grow justify-center items-start w-full sm:overflow-hidden"
|
|
15
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
export declare const animations: {
|
|
2
|
-
readonly fadeUp: {
|
|
3
|
-
readonly initial: {
|
|
4
|
-
readonly opacity: 0;
|
|
5
|
-
readonly y: 30;
|
|
6
|
-
};
|
|
7
|
-
readonly animate: {
|
|
8
|
-
readonly opacity: 1;
|
|
9
|
-
readonly y: 0;
|
|
10
|
-
readonly transition: {
|
|
11
|
-
readonly duration: 0.3;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
readonly fadeInAndOut: {
|
|
16
|
-
readonly initial: {
|
|
17
|
-
readonly opacity: 0;
|
|
18
|
-
};
|
|
19
|
-
readonly animate: {
|
|
20
|
-
readonly opacity: 1;
|
|
21
|
-
};
|
|
22
|
-
readonly exit: {
|
|
23
|
-
readonly opacity: 0;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
readonly fadeUpAndOut: {
|
|
27
|
-
readonly initial: {
|
|
28
|
-
readonly opacity: 0;
|
|
29
|
-
readonly y: 10;
|
|
30
|
-
};
|
|
31
|
-
readonly animate: {
|
|
32
|
-
readonly opacity: 1;
|
|
33
|
-
readonly y: 0;
|
|
34
|
-
};
|
|
35
|
-
readonly exit: {
|
|
36
|
-
readonly opacity: 1;
|
|
37
|
-
readonly y: -10;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
readonly fadeUpAndOutSlow: {
|
|
41
|
-
readonly initial: {
|
|
42
|
-
readonly opacity: 0;
|
|
43
|
-
readonly y: "-100%";
|
|
44
|
-
};
|
|
45
|
-
readonly animate: {
|
|
46
|
-
readonly opacity: 1;
|
|
47
|
-
readonly y: 0;
|
|
48
|
-
readonly transition: {
|
|
49
|
-
readonly duration: 0.2;
|
|
50
|
-
readonly ease: "easeInOut";
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
readonly exit: {
|
|
54
|
-
readonly opacity: 0;
|
|
55
|
-
readonly y: "100%";
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
readonly fadeLeft: {
|
|
59
|
-
readonly initial: {
|
|
60
|
-
readonly x: -50;
|
|
61
|
-
readonly opacity: 0;
|
|
62
|
-
};
|
|
63
|
-
readonly animate: {
|
|
64
|
-
readonly x: 0;
|
|
65
|
-
readonly opacity: 1;
|
|
66
|
-
};
|
|
67
|
-
readonly exit: {
|
|
68
|
-
readonly x: 50;
|
|
69
|
-
readonly opacity: 0;
|
|
70
|
-
};
|
|
71
|
-
readonly transition: {
|
|
72
|
-
readonly duration: 0.4;
|
|
73
|
-
readonly ease: "easeOut";
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
readonly growUpAndOut: {
|
|
77
|
-
readonly initial: {
|
|
78
|
-
readonly opacity: 0;
|
|
79
|
-
readonly height: 0;
|
|
80
|
-
};
|
|
81
|
-
readonly animate: {
|
|
82
|
-
readonly opacity: 1;
|
|
83
|
-
readonly height: "auto";
|
|
84
|
-
};
|
|
85
|
-
readonly exit: {
|
|
86
|
-
readonly opacity: 0;
|
|
87
|
-
readonly height: 0;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
readonly fadeStagger: {
|
|
91
|
-
readonly initial: {
|
|
92
|
-
readonly opacity: 0;
|
|
93
|
-
};
|
|
94
|
-
readonly animate: {
|
|
95
|
-
readonly opacity: 1;
|
|
96
|
-
readonly transition: {
|
|
97
|
-
readonly staggerChildren: 0.2;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
readonly fadeList: {
|
|
102
|
-
readonly hidden: {
|
|
103
|
-
readonly opacity: 0;
|
|
104
|
-
readonly x: -10;
|
|
105
|
-
readonly y: 5;
|
|
106
|
-
};
|
|
107
|
-
readonly visible: {
|
|
108
|
-
readonly opacity: 1;
|
|
109
|
-
readonly x: 0;
|
|
110
|
-
readonly y: 0;
|
|
111
|
-
readonly transition: {
|
|
112
|
-
readonly type: "spring";
|
|
113
|
-
readonly stiffness: 350;
|
|
114
|
-
readonly damping: 25;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
readonly popUp: {
|
|
119
|
-
readonly initial: {
|
|
120
|
-
readonly opacity: 0;
|
|
121
|
-
readonly scale: 0.9;
|
|
122
|
-
};
|
|
123
|
-
readonly animate: {
|
|
124
|
-
readonly opacity: 1;
|
|
125
|
-
readonly scale: 1;
|
|
126
|
-
};
|
|
127
|
-
readonly exit: {
|
|
128
|
-
readonly opacity: 0;
|
|
129
|
-
readonly scale: 0.9;
|
|
130
|
-
};
|
|
131
|
-
readonly transition: {
|
|
132
|
-
readonly duration: 0.2;
|
|
133
|
-
readonly ease: readonly [0.23, 1, 0.32, 1];
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export const animations = {
|
|
2
|
-
"fadeUp": {
|
|
3
|
-
"initial": { "opacity": 0, "y": 30 },
|
|
4
|
-
"animate": {
|
|
5
|
-
"opacity": 1,
|
|
6
|
-
"y": 0,
|
|
7
|
-
"transition": { "duration": 0.3 }
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"fadeInAndOut": {
|
|
11
|
-
"initial": { "opacity": 0 },
|
|
12
|
-
"animate": { "opacity": 1 },
|
|
13
|
-
"exit": { "opacity": 0 }
|
|
14
|
-
},
|
|
15
|
-
"fadeUpAndOut": {
|
|
16
|
-
"initial": { "opacity": 0, "y": 10 },
|
|
17
|
-
"animate": { "opacity": 1, "y": 0 },
|
|
18
|
-
"exit": { "opacity": 1, "y": -10 }
|
|
19
|
-
},
|
|
20
|
-
"fadeUpAndOutSlow": {
|
|
21
|
-
"initial": { "opacity": 0, "y": "-100%" },
|
|
22
|
-
"animate": { "opacity": 1, "y": 0,
|
|
23
|
-
"transition": { "duration": 0.2, "ease": "easeInOut" }
|
|
24
|
-
},
|
|
25
|
-
"exit": { "opacity": 0, "y": "100%" }
|
|
26
|
-
},
|
|
27
|
-
"fadeLeft": {
|
|
28
|
-
"initial": { "x": -50, "opacity": 0 },
|
|
29
|
-
"animate": { "x": 0, "opacity": 1 },
|
|
30
|
-
"exit": { "x": 50, "opacity": 0 },
|
|
31
|
-
"transition": { "duration": 0.4, "ease": "easeOut" }
|
|
32
|
-
},
|
|
33
|
-
"growUpAndOut": {
|
|
34
|
-
"initial": { "opacity": 0, "height": 0 },
|
|
35
|
-
"animate": { "opacity": 1, "height": "auto" },
|
|
36
|
-
"exit": { "opacity": 0, "height": 0 }
|
|
37
|
-
},
|
|
38
|
-
"fadeStagger": {
|
|
39
|
-
"initial": { "opacity": 0 },
|
|
40
|
-
"animate": {
|
|
41
|
-
"opacity": 1,
|
|
42
|
-
"transition": { "staggerChildren": 0.2 }
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"fadeList": {
|
|
46
|
-
"hidden": { "opacity": 0, "x": -10, "y": 5 },
|
|
47
|
-
"visible": {
|
|
48
|
-
"opacity": 1, "x": 0, "y": 0,
|
|
49
|
-
"transition": {
|
|
50
|
-
"type": "spring",
|
|
51
|
-
"stiffness": 350,
|
|
52
|
-
"damping": 25
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"popUp": {
|
|
57
|
-
"initial": { "opacity": 0, "scale": 0.9 },
|
|
58
|
-
"animate": { "opacity": 1, "scale": 1 },
|
|
59
|
-
"exit": { "opacity": 0, "scale": 0.9 },
|
|
60
|
-
"transition": { "duration": 0.2, "ease": [0.23, 1, 0.32, 1] }
|
|
61
|
-
}
|
|
62
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { animations } from "./configs";
|
|
3
|
-
type Props = {
|
|
4
|
-
style?: string;
|
|
5
|
-
variant?: keyof typeof animations;
|
|
6
|
-
inherit?: boolean;
|
|
7
|
-
layout?: boolean;
|
|
8
|
-
ref?: React.RefObject<HTMLDivElement | null>;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
};
|
|
11
|
-
export declare function Animation({ style, variant, inherit, layout, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { motion } from "framer-motion";
|
|
4
|
-
import { animations } from "./configs";
|
|
5
|
-
export function Animation({ style, variant = "fadeInAndOut", inherit, layout, children }) {
|
|
6
|
-
return (_jsx(motion.div, { className: style, variants: animations[variant], initial: inherit ? undefined : "initial", animate: inherit ? undefined : "animate", exit: inherit ? undefined : "exit", layout: layout, children: children }));
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import PaperClip from "../assets/icons/paperclip.svg";
|
|
4
|
-
import { setField } from "./form";
|
|
5
|
-
import { cn } from "@bouko/style";
|
|
6
|
-
export default function Attachment({ id, style, label, value, update, required = true, note }) {
|
|
7
|
-
const ref = useRef(null);
|
|
8
|
-
const handleFileChange = (e) => {
|
|
9
|
-
if (e.target.files)
|
|
10
|
-
setField(update, id, [e.target.files[0]]);
|
|
11
|
-
};
|
|
12
|
-
return (_jsxs("div", { className: cn(styles.container, style), children: [label && _jsxs("span", { className: styles.label, children: [label, " ", !required ? _jsx("span", { className: "italic text-slate-400", children: "(optional)" }) : ""] }), _jsxs("div", { onClick: () => ref.current?.click(), className: "flex flex-col justify-center items-center py-3 gap-1 w-full cursor-pointer duration-200 hover:bg-slate-200/40 rounded border-2 border-slate-300 border-dashed", children: [!value || value.length === 0 && (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex gap-2 items-center font-semibold text-sm", children: [_jsx(PaperClip, {}), "Drag and drop files, paste screenshots, or"] }), _jsx("span", { className: "text-xs text-slate-500", children: "browse" }), _jsx("input", { type: "file", className: "hidden", onChange: handleFileChange, ref: ref })] })), value && value.length > 0 && value.map((x, i) => (_jsx("span", { className: "text-xs text-slate-500", children: x.name }, i)))] }), note && _jsx("span", { className: styles.note, children: note })] }));
|
|
13
|
-
}
|
|
14
|
-
const styles = {
|
|
15
|
-
container: "flex flex-col gap-2 w-full shrink-0 overflow-hidden",
|
|
16
|
-
label: "text-xs text-slate-600",
|
|
17
|
-
input: "px-3 py-2 bg-slate-200/50 border border-slate-300 outline-blue-500 rounded text-sm",
|
|
18
|
-
note: "mt-1 text-xs text-slate-500"
|
|
19
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export type ButtonProps = {
|
|
3
|
-
variant?: "primary" | "outline" | "ghost";
|
|
4
|
-
size?: "xs" | "sm" | "md" | "lg";
|
|
5
|
-
style?: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
export declare function Button({ size, variant, style, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn, tv } from "@bouko/style";
|
|
3
|
-
export function Button({ size, variant, style, ...props }) {
|
|
4
|
-
return (_jsx("button", { className: cn(styles({ variant, size }), style), ...props }));
|
|
5
|
-
}
|
|
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" },
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
primary: "bg-primary hover:bg-primary-dark border-primary-dark",
|
|
12
|
-
outline: "!bg-transparent border-accent hover:border-accent-dark text-primary",
|
|
13
|
-
ghost: "!bg-transparent border-transparent text-accent hover:text-accent-dark"
|
|
14
|
-
},
|
|
15
|
-
size: {
|
|
16
|
-
xs: "px-3 py-1 text-xs",
|
|
17
|
-
sm: "px-4 py-2 text-xs sm:text-sm",
|
|
18
|
-
md: "px-4 py-2",
|
|
19
|
-
lg: "px-5 py-3 text-lg"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Check from "../assets/icons/check.svg";
|
|
3
|
-
import { cn } from "@bouko/style";
|
|
4
|
-
export default function Checkbox({ style, label, value, update }) {
|
|
5
|
-
const isChecked = !!value;
|
|
6
|
-
return (_jsxs("div", { className: cn(styles.container, style), children: [_jsx("div", { className: cn(styles.box, isChecked && "bg-accent"), onClick: () => update(!isChecked), children: isChecked && _jsx(Check, { className: styles.check }) }), _jsx("span", { className: styles.label, children: label })] }));
|
|
7
|
-
}
|
|
8
|
-
const styles = {
|
|
9
|
-
container: "flex gap-3 items-center",
|
|
10
|
-
box: "flex justify-center items-center size-4 min-w-4 hover:bg-accent border rounded border-border-light duration-200 cursor-pointer",
|
|
11
|
-
check: "size-2 text-background",
|
|
12
|
-
label: "text-xs text-primary-dark"
|
|
13
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
type Option = {
|
|
3
|
-
label: ReactNode;
|
|
4
|
-
action: () => void;
|
|
5
|
-
};
|
|
6
|
-
export default function Dropdown({ options, children }: {
|
|
7
|
-
options: Option[];
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|