@bouko/react 2.3.6 → 2.3.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/animate/configs.d.ts +136 -136
- package/dist/components/animate/configs.js +62 -62
- package/dist/components/animate/index.d.ts +12 -12
- package/dist/components/animate/index.js +7 -7
- package/dist/components/attachment.d.ts +2 -2
- package/dist/components/attachment.js +18 -19
- package/dist/components/button/load.d.ts +10 -10
- package/dist/components/button/load.js +35 -35
- package/dist/components/button.d.ts +10 -10
- package/dist/components/button.js +22 -22
- package/dist/components/carousel/index.d.ts +7 -7
- package/dist/components/carousel/index.js +15 -15
- package/dist/components/checkbox.d.ts +8 -8
- package/dist/components/checkbox.js +13 -13
- package/dist/components/dropdown/normal.d.ts +10 -10
- package/dist/components/dropdown/normal.js +19 -19
- package/dist/components/fade-carousel.d.ts +4 -4
- package/dist/components/fade-carousel.js +14 -14
- package/dist/components/field.d.ts +10 -10
- package/dist/components/field.js +10 -10
- package/dist/components/form/footer.js +2 -2
- package/dist/components/form/types.d.ts +38 -38
- package/dist/components/form/types.js +1 -1
- package/dist/components/heading/normal.d.ts +29 -29
- package/dist/components/heading/normal.js +22 -22
- package/dist/components/heading/page.d.ts +1 -1
- package/dist/components/heading/page.js +5 -5
- package/dist/components/index.d.ts +11 -12
- package/dist/components/index.js +11 -12
- package/dist/components/input.d.ts +11 -11
- package/dist/components/input.js +6 -6
- package/dist/components/layout/fade.d.ts +6 -6
- package/dist/components/layout/fade.js +14 -14
- package/dist/components/layout/flex.d.ts +16 -16
- package/dist/components/layout/flex.js +42 -40
- package/dist/components/layout/heading.d.ts +1 -3
- package/dist/components/layout/heading.js +2 -2
- package/dist/components/layout/separator.d.ts +3 -3
- package/dist/components/layout/separator.js +5 -5
- package/dist/components/list/index.d.ts +2 -2
- package/dist/components/list/index.js +2 -2
- package/dist/components/list/item.d.ts +9 -9
- package/dist/components/list/item.js +7 -7
- package/dist/components/list/variants/bullet.d.ts +9 -9
- package/dist/components/list/variants/bullet.js +16 -16
- package/dist/components/list/variants/number.d.ts +10 -10
- package/dist/components/list/variants/number.js +18 -18
- package/dist/components/multiple-choice.d.ts +2 -2
- package/dist/components/multiple-choice.js +12 -13
- package/dist/components/search-bar.d.ts +12 -12
- package/dist/components/search-bar.js +14 -14
- package/dist/components/select.d.ts +6 -6
- package/dist/components/select.js +24 -25
- package/dist/components/text/badge.d.ts +11 -11
- package/dist/components/text/badge.js +18 -17
- package/dist/components/textarea.d.ts +7 -7
- package/dist/components/textarea.js +11 -11
- package/dist/components/upload/file.d.ts +8 -8
- package/dist/components/upload/file.js +15 -15
- package/dist/core/format.d.ts +3 -3
- package/dist/core/format.js +34 -34
- package/dist/core/functions.d.ts +13 -13
- package/dist/core/functions.js +79 -79
- package/dist/core/types.d.ts +11 -11
- package/dist/core/types.js +2 -2
- package/dist/hooks/audio/sound.d.ts +1 -0
- package/dist/hooks/audio/sound.js +6 -0
- package/dist/hooks/clock/interval.d.ts +1 -1
- package/dist/hooks/clock/interval.js +20 -20
- package/dist/hooks/element/container.d.ts +5 -4
- package/dist/hooks/element/container.js +7 -7
- package/dist/hooks/element/resize.d.ts +1 -1
- package/dist/hooks/element/resize.js +12 -12
- package/dist/hooks/index.d.ts +4 -3
- package/dist/hooks/index.js +4 -3
- package/dist/index.d.ts +14 -14
- package/dist/index.js +14 -14
- package/package.json +5 -31
- package/dist/assets/icons/check copy.svg +0 -6
- package/dist/assets/icons/check-circle copy.svg +0 -6
- package/dist/assets/icons/chevron copy.svg +0 -6
- package/dist/assets/icons/paperclip copy.svg +0 -6
- package/dist/assets/icons/spinner copy.svg +0 -6
- package/dist/assets/icons/x-circle copy.svg +0 -6
- 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/components/form/fields.d.ts +0 -16
- package/dist/components/form/fields.js +0 -21
- package/dist/components/form/loaders.d.ts +0 -3
- package/dist/components/form/loaders.js +0 -11
- package/dist/components/form/test-next.d.ts +0 -1
- package/dist/components/form/test-next.js +0 -6
- package/dist/components/search/index.d.ts +0 -6
- package/dist/components/search/index.js +0 -12
- package/dist/hooks/color.d.ts +0 -7
- package/dist/hooks/color.js +0 -8
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Field, Option } from "./types";
|
|
2
|
-
export type FormBuilderField<T = unknown> = (Omit<Field<T>, "value" | "update"> & {
|
|
3
|
-
id: string;
|
|
4
|
-
element: string;
|
|
5
|
-
rows?: number;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
options?: Option[];
|
|
8
|
-
})[][];
|
|
9
|
-
type Props<T> = {
|
|
10
|
-
id?: string;
|
|
11
|
-
fields: FormBuilderField<T>;
|
|
12
|
-
data: T;
|
|
13
|
-
setField: (x: string, y: unknown) => void;
|
|
14
|
-
};
|
|
15
|
-
export default function Fields<T>({ fields, data, setField }: Props<T>): Promise<import("react/jsx-runtime").JSX.Element[]>;
|
|
16
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { RowBox } from "../layout/flex";
|
|
3
|
-
import Input from "../input";
|
|
4
|
-
import Select from "../select";
|
|
5
|
-
import TextArea from "../textarea";
|
|
6
|
-
import MultipleChoice from "../multiple-choice";
|
|
7
|
-
import Attachment from "../attachment";
|
|
8
|
-
export default async function Fields({ fields, data, setField }) {
|
|
9
|
-
return fields.map((row, i) => (_jsx(RowBox, { style: "w-full gap-5 overflow-hidden", children: row.map(({ element, id, rows, label, placeholder, disabled, options, required, note }) => {
|
|
10
|
-
if (element === "input")
|
|
11
|
-
return (_jsx(Input, { id: id, styles: { container: "flex-1" }, label: label, placeholder: placeholder, value: data[id], update: x => setField(id, x), disabled: disabled, note: note, required: required }, id));
|
|
12
|
-
else if (element === "select")
|
|
13
|
-
return (_jsx(Select, { id: id, label: label, placeholder: placeholder, options: options || [], value: data[id], update: x => setField(id, x), note: note, required: required }, id));
|
|
14
|
-
else if (element === "textarea")
|
|
15
|
-
return (_jsx(TextArea, { id: id, label: label, placeholder: placeholder, rows: rows, value: data[id], update: x => setField(id, x), note: note, required: required }, id));
|
|
16
|
-
else if (element === "multiple-choice")
|
|
17
|
-
return (_jsx(MultipleChoice, { id: id, label: label, options: options || [], value: data[id], update: x => setField(id, x), note: note, required: required }, id));
|
|
18
|
-
else if (element === "attachment")
|
|
19
|
-
return (_jsx(Attachment, { id: id, label: label, value: data[id], update: x => setField(id, x), note: note, required: required }, id));
|
|
20
|
-
}) }, i)));
|
|
21
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { promises as fs } from "fs";
|
|
3
|
-
export async function loadJson(name) {
|
|
4
|
-
const file = await fs.readFile(process.cwd() + "/assets/" + name + ".json", "utf-8");
|
|
5
|
-
return JSON.parse(file);
|
|
6
|
-
}
|
|
7
|
-
export async function loadForm(name) {
|
|
8
|
-
if (!name)
|
|
9
|
-
throw new Error("Form not found");
|
|
10
|
-
return loadJson(`forms/${name}`);
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function loadJson<T>(name: string): Promise<T>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { RowBox } from "../flex";
|
|
5
|
-
import { Button } from "../button";
|
|
6
|
-
export default function SearchBar({ placeholder, action }) {
|
|
7
|
-
const [query, search] = useState("");
|
|
8
|
-
return (_jsxs(RowBox, { style: styles.container, children: [_jsxs("div", { className: "relative grow", children: [_jsx("input", { className: "w-full outline-none lowercase text-lg placeholder-slate-500 tracking-wide", placeholder: placeholder, value: query, onChange: (e) => search(e.target.value), onKeyUp: (e) => e.key === "Enter" ? action(query) : null }), _jsx("div", { className: "absolute top-0 right-0 w-12 h-full bg-gradient-to-l from-slate-950" })] }), _jsx(Button, { size: "sm", style: "gap-[0.4rem] font-extrabold py-1 px-3 font-mono", onClick: () => action(query), children: "GO" })] }));
|
|
9
|
-
}
|
|
10
|
-
const styles = {
|
|
11
|
-
container: "items-center gap-6 w-xl pl-5 pr-4 py-3 bg-slate-950 border border-border rounded-md"
|
|
12
|
-
};
|
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
|
-
}
|