@bouko/react 2.5.6 → 2.5.7
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/assets/icons/check copy.svg +6 -0
- package/dist/assets/icons/check-circle copy.svg +6 -0
- package/dist/assets/icons/chevron copy.svg +6 -0
- package/dist/assets/icons/paperclip copy.svg +6 -0
- package/dist/assets/icons/spinner copy.svg +6 -0
- package/dist/assets/icons/x-circle copy.svg +6 -0
- package/dist/colors/core.d.ts +10 -0
- package/dist/colors/core.js +25 -0
- package/dist/colors/index.d.ts +26 -0
- package/dist/colors/index.js +43 -0
- package/dist/colors/types.d.ts +11 -0
- package/dist/colors/types.js +7 -0
- package/dist/components/animate/configs.d.ts +136 -136
- package/dist/components/animate/configs.js +62 -62
- package/dist/components/animate/index.d.ts +54 -54
- package/dist/components/animate/index.js +33 -33
- package/dist/components/attachment.d.ts +2 -2
- package/dist/components/attachment.js +18 -18
- package/dist/components/badge.d.ts +5 -0
- package/dist/components/badge.js +4 -0
- package/dist/components/button/ghost.d.ts +7 -7
- package/dist/components/button/ghost.js +8 -8
- package/dist/components/button/icon.d.ts +9 -9
- package/dist/components/button/icon.js +19 -19
- package/dist/components/button/load.d.ts +10 -11
- package/dist/components/button/load.js +35 -35
- package/dist/components/button/normal.d.ts +11 -11
- package/dist/components/button/normal.js +39 -39
- package/dist/components/button.d.ts +10 -10
- package/dist/components/button.js +22 -22
- package/dist/components/carousel/index.d.ts +11 -11
- package/dist/components/carousel/index.js +19 -19
- 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/flex.d.ts +16 -0
- package/dist/components/flex.js +8 -0
- package/dist/components/form/fields.d.ts +16 -0
- package/dist/components/form/fields.js +21 -0
- package/dist/components/form/footer.js +2 -2
- package/dist/components/form/functions.d.ts +1 -1
- package/dist/components/form/functions.js +28 -28
- package/dist/components/form/loaders.d.ts +3 -0
- package/dist/components/form/loaders.js +11 -0
- package/dist/components/form/test-next.d.ts +1 -0
- package/dist/components/form/test-next.js +6 -0
- 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 +25 -25
- package/dist/components/heading/page.js +23 -23
- package/dist/components/index.d.ts +13 -13
- package/dist/components/index.js +13 -13
- package/dist/components/input.d.ts +37 -37
- package/dist/components/input.js +40 -40
- package/dist/components/layout/fade.d.ts +7 -7
- package/dist/components/layout/fade.js +15 -15
- package/dist/components/layout/flex.d.ts +16 -16
- package/dist/components/layout/flex.js +42 -42
- package/dist/components/layout/heading.d.ts +3 -1
- 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 -12
- package/dist/components/search/index.d.ts +6 -0
- package/dist/components/search/index.js +12 -0
- package/dist/components/search-bar.d.ts +13 -14
- package/dist/components/search-bar.js +22 -22
- package/dist/components/select.d.ts +6 -6
- package/dist/components/select.js +24 -24
- package/dist/components/text/badge.d.ts +16 -16
- package/dist/components/text/badge.js +28 -28
- 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 +23 -23
- package/dist/components/waveform/index.d.ts +8 -8
- package/dist/components/waveform/index.js +11 -11
- package/dist/components/waveform/patterns.d.ts +1 -1
- package/dist/components/waveform/patterns.js +27 -27
- package/dist/core/classes.d.ts +0 -0
- package/dist/core/classes.js +1 -0
- 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 +15 -15
- package/dist/core/types.js +2 -2
- package/dist/core/variants.d.ts +5 -0
- package/dist/core/variants.js +6 -0
- package/dist/format/index.d.ts +2 -0
- package/dist/format/index.js +33 -0
- package/dist/hooks/audio/sound.d.ts +1 -1
- package/dist/hooks/audio/sound.js +6 -6
- package/dist/hooks/clock/interval.d.ts +8 -8
- package/dist/hooks/clock/interval.js +25 -25
- package/dist/hooks/color.d.ts +7 -0
- package/dist/hooks/color.js +8 -0
- package/dist/hooks/element/container.d.ts +4 -5
- 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 -4
- package/dist/hooks/index.js +4 -4
- package/dist/index.d.ts +14 -14
- package/dist/index.js +14 -14
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
style?: Styles;
|
|
4
|
-
badge?: string;
|
|
5
|
-
icon?: ReactNode;
|
|
6
|
-
title: string;
|
|
7
|
-
subtitle?: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
container?: string;
|
|
11
|
-
badge?: string;
|
|
12
|
-
title?: string;
|
|
13
|
-
subtitle?: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Text heading with badge, title, subtitle.
|
|
17
|
-
*
|
|
18
|
-
* @param {Styles} style - Additional styles. (optional)
|
|
19
|
-
* @param {string} badge - Little note above the title. (optional)
|
|
20
|
-
* @param {ReactNode} icon - Component displayed left of title. (optional)
|
|
21
|
-
* @param {string} title - Main title content.
|
|
22
|
-
* @param {string} subtitle - Subtitle content. (optional)
|
|
23
|
-
**/
|
|
24
|
-
export default function PageHeading({ style, badge, icon, title, subtitle }: Props): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export {};
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
style?: Styles;
|
|
4
|
+
badge?: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
title: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
};
|
|
9
|
+
type Styles = {
|
|
10
|
+
container?: string;
|
|
11
|
+
badge?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Text heading with badge, title, subtitle.
|
|
17
|
+
*
|
|
18
|
+
* @param {Styles} style - Additional styles. (optional)
|
|
19
|
+
* @param {string} badge - Little note above the title. (optional)
|
|
20
|
+
* @param {ReactNode} icon - Component displayed left of title. (optional)
|
|
21
|
+
* @param {string} title - Main title content.
|
|
22
|
+
* @param {string} subtitle - Subtitle content. (optional)
|
|
23
|
+
**/
|
|
24
|
+
export default function PageHeading({ style, badge, icon, title, subtitle }: Props): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { mergeStyles } from "@bouko/style";
|
|
3
|
-
import { RowBox, ColumnBox } from "../layout/flex";
|
|
4
|
-
import { Badge } from "../text/badge";
|
|
5
|
-
/**
|
|
6
|
-
* Text heading with badge, title, subtitle.
|
|
7
|
-
*
|
|
8
|
-
* @param {Styles} style - Additional styles. (optional)
|
|
9
|
-
* @param {string} badge - Little note above the title. (optional)
|
|
10
|
-
* @param {ReactNode} icon - Component displayed left of title. (optional)
|
|
11
|
-
* @param {string} title - Main title content.
|
|
12
|
-
* @param {string} subtitle - Subtitle content. (optional)
|
|
13
|
-
**/
|
|
14
|
-
export default function PageHeading({ style = {}, badge, icon, title, subtitle }) {
|
|
15
|
-
const styles = mergeStyles(base, style);
|
|
16
|
-
return (_jsxs(ColumnBox, { style: styles.container, children: [_jsx(Badge, { style: styles.badge, children: badge }
|
|
17
|
-
}
|
|
18
|
-
const base = {
|
|
19
|
-
container: "w-full items-center font-mono",
|
|
20
|
-
badge: "mb-2",
|
|
21
|
-
title: "items-center gap-2 mb-3 text-4xl sm:text-5xl 2xl:text-6xl text-center font-bold text-primary",
|
|
22
|
-
subtitle: "items-center gap-2 text-sm sm:text-base 2xl:text-lg text-center text-primary-light dark:text-primary-dark"
|
|
23
|
-
};
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { mergeStyles } from "@bouko/style";
|
|
3
|
+
import { RowBox, ColumnBox } from "../layout/flex";
|
|
4
|
+
import { Badge } from "../text/badge";
|
|
5
|
+
/**
|
|
6
|
+
* Text heading with badge, title, subtitle.
|
|
7
|
+
*
|
|
8
|
+
* @param {Styles} style - Additional styles. (optional)
|
|
9
|
+
* @param {string} badge - Little note above the title. (optional)
|
|
10
|
+
* @param {ReactNode} icon - Component displayed left of title. (optional)
|
|
11
|
+
* @param {string} title - Main title content.
|
|
12
|
+
* @param {string} subtitle - Subtitle content. (optional)
|
|
13
|
+
**/
|
|
14
|
+
export default function PageHeading({ style = {}, badge, icon, title, subtitle }) {
|
|
15
|
+
const styles = mergeStyles(base, style);
|
|
16
|
+
return (_jsxs(ColumnBox, { style: styles.container, children: [_jsx(Badge, { style: styles.badge, children: badge }), _jsxs(RowBox, { style: styles.title, children: [icon, title] }), _jsx(RowBox, { style: styles.subtitle, children: subtitle })] }));
|
|
17
|
+
}
|
|
18
|
+
const base = {
|
|
19
|
+
container: "w-full items-center font-mono",
|
|
20
|
+
badge: "mb-2",
|
|
21
|
+
title: "items-center gap-2 mb-3 text-4xl sm:text-5xl 2xl:text-6xl text-center font-bold text-primary",
|
|
22
|
+
subtitle: "items-center gap-2 text-sm sm:text-base 2xl:text-lg text-center text-primary-light dark:text-primary-dark"
|
|
23
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { default as Separator } from "./layout/separator";
|
|
2
|
-
export { default as FadeBox } from "./layout/fade";
|
|
3
|
-
export { default as Heading } from "./heading/normal";
|
|
4
|
-
export { default as PageHeading } from "./heading/page";
|
|
5
|
-
export * from "./layout/flex";
|
|
6
|
-
export { default as Button } from "./button/normal";
|
|
7
|
-
export { default as IconButton } from "./button/icon";
|
|
8
|
-
export { default as Badge } from "./text/badge";
|
|
9
|
-
export { default as Dropdown } from "./dropdown/normal";
|
|
10
|
-
export { default as FileUploader } from "./upload/file";
|
|
11
|
-
export * from "./animate";
|
|
12
|
-
export * from "./list";
|
|
13
|
-
export * from "./carousel";
|
|
1
|
+
export { default as Separator } from "./layout/separator";
|
|
2
|
+
export { default as FadeBox } from "./layout/fade";
|
|
3
|
+
export { default as Heading } from "./heading/normal";
|
|
4
|
+
export { default as PageHeading } from "./heading/page";
|
|
5
|
+
export * from "./layout/flex";
|
|
6
|
+
export { default as Button } from "./button/normal";
|
|
7
|
+
export { default as IconButton } from "./button/icon";
|
|
8
|
+
export { default as Badge } from "./text/badge";
|
|
9
|
+
export { default as Dropdown } from "./dropdown/normal";
|
|
10
|
+
export { default as FileUploader } from "./upload/file";
|
|
11
|
+
export * from "./animate";
|
|
12
|
+
export * from "./list";
|
|
13
|
+
export * from "./carousel";
|
package/dist/components/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { default as Separator } from "./layout/separator";
|
|
2
|
-
export { default as FadeBox } from "./layout/fade";
|
|
3
|
-
export { default as Heading } from "./heading/normal";
|
|
4
|
-
export { default as PageHeading } from "./heading/page";
|
|
5
|
-
export * from "./layout/flex";
|
|
6
|
-
export { default as Button } from "./button/normal";
|
|
7
|
-
export { default as IconButton } from "./button/icon";
|
|
8
|
-
export { default as Badge } from "./text/badge";
|
|
9
|
-
export { default as Dropdown } from "./dropdown/normal";
|
|
10
|
-
export { default as FileUploader } from "./upload/file";
|
|
11
|
-
export * from "./animate";
|
|
12
|
-
export * from "./list";
|
|
13
|
-
export * from "./carousel";
|
|
1
|
+
export { default as Separator } from "./layout/separator";
|
|
2
|
+
export { default as FadeBox } from "./layout/fade";
|
|
3
|
+
export { default as Heading } from "./heading/normal";
|
|
4
|
+
export { default as PageHeading } from "./heading/page";
|
|
5
|
+
export * from "./layout/flex";
|
|
6
|
+
export { default as Button } from "./button/normal";
|
|
7
|
+
export { default as IconButton } from "./button/icon";
|
|
8
|
+
export { default as Badge } from "./text/badge";
|
|
9
|
+
export { default as Dropdown } from "./dropdown/normal";
|
|
10
|
+
export { default as FileUploader } from "./upload/file";
|
|
11
|
+
export * from "./animate";
|
|
12
|
+
export * from "./list";
|
|
13
|
+
export * from "./carousel";
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
id?: string;
|
|
4
|
-
label?: string;
|
|
5
|
-
style?: string;
|
|
6
|
-
value?: T;
|
|
7
|
-
update: (x: T) => void;
|
|
8
|
-
required?: boolean;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
note?: ReactNode;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
variant?: Variant;
|
|
15
|
-
style?: string;
|
|
16
|
-
placeholder?: string;
|
|
17
|
-
onEnter?: (x: string) => void;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Text field component.
|
|
21
|
-
*
|
|
22
|
-
* Wraps the native `input` element with custom styling and validation.
|
|
23
|
-
* It displays an optional label and note, and can be marked as required.
|
|
24
|
-
* Optional callback for when the user presses `Enter` key.
|
|
25
|
-
* The value is controlled externally via props, usually `useState`.
|
|
26
|
-
*
|
|
27
|
-
* Variants:
|
|
28
|
-
* - `normal`: Standard input with primary color scheme.
|
|
29
|
-
* - `ghost`: Transparent for injecting input inside other component.
|
|
30
|
-
*
|
|
31
|
-
* @param {Variant} variant - Visual style variant. (optional, default = normal)
|
|
32
|
-
* @param {string} style - Additional class names for styling. (optional)
|
|
33
|
-
* @param {string} placeholder - Placeholder text for the input. (optional)
|
|
34
|
-
* @param {Function} onEnter - Callback when `Enter` key is pressed. (optional)
|
|
35
|
-
**/
|
|
36
|
-
export default function Input({ variant, style, value, update, onEnter, disabled, placeholder, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export {};
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type FieldProps<T> = {
|
|
3
|
+
id?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
value?: T;
|
|
7
|
+
update: (x: T) => void;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
note?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
type Variant = "normal" | "ghost";
|
|
13
|
+
type Props = Omit<FieldProps<string>, "id"> & {
|
|
14
|
+
variant?: Variant;
|
|
15
|
+
style?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
onEnter?: (x: string) => void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Text field component.
|
|
21
|
+
*
|
|
22
|
+
* Wraps the native `input` element with custom styling and validation.
|
|
23
|
+
* It displays an optional label and note, and can be marked as required.
|
|
24
|
+
* Optional callback for when the user presses `Enter` key.
|
|
25
|
+
* The value is controlled externally via props, usually `useState`.
|
|
26
|
+
*
|
|
27
|
+
* Variants:
|
|
28
|
+
* - `normal`: Standard input with primary color scheme.
|
|
29
|
+
* - `ghost`: Transparent for injecting input inside other component.
|
|
30
|
+
*
|
|
31
|
+
* @param {Variant} variant - Visual style variant. (optional, default = normal)
|
|
32
|
+
* @param {string} style - Additional class names for styling. (optional)
|
|
33
|
+
* @param {string} placeholder - Placeholder text for the input. (optional)
|
|
34
|
+
* @param {Function} onEnter - Callback when `Enter` key is pressed. (optional)
|
|
35
|
+
**/
|
|
36
|
+
export default function Input({ variant, style, value, update, onEnter, disabled, placeholder, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export {};
|
package/dist/components/input.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn, tv } from "@bouko/style";
|
|
3
|
-
function Field({ style, label, required = true, note, children }) {
|
|
4
|
-
return (_jsxs("div", { className: cn(fieldStyles.container, style), children: [label && _jsxs("span", { className: fieldStyles.label, children: [label, " ", !required ? _jsx("span", { className: "italic text-slate-400", children: "(optional)" }
|
|
5
|
-
}
|
|
6
|
-
const fieldStyles = {
|
|
7
|
-
container: "flex flex-col shrink-0 gap-1 w-full overflow-hidden",
|
|
8
|
-
label: "text-xs text-primary-dark",
|
|
9
|
-
note: "mt-1 text-xs text-slate-500 whitespace-pre-line"
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Text field component.
|
|
13
|
-
*
|
|
14
|
-
* Wraps the native `input` element with custom styling and validation.
|
|
15
|
-
* It displays an optional label and note, and can be marked as required.
|
|
16
|
-
* Optional callback for when the user presses `Enter` key.
|
|
17
|
-
* The value is controlled externally via props, usually `useState`.
|
|
18
|
-
*
|
|
19
|
-
* Variants:
|
|
20
|
-
* - `normal`: Standard input with primary color scheme.
|
|
21
|
-
* - `ghost`: Transparent for injecting input inside other component.
|
|
22
|
-
*
|
|
23
|
-
* @param {Variant} variant - Visual style variant. (optional, default = normal)
|
|
24
|
-
* @param {string} style - Additional class names for styling. (optional)
|
|
25
|
-
* @param {string} placeholder - Placeholder text for the input. (optional)
|
|
26
|
-
* @param {Function} onEnter - Callback when `Enter` key is pressed. (optional)
|
|
27
|
-
**/
|
|
28
|
-
export default function Input({ variant, style, value, update, onEnter, disabled, placeholder, ...props }) {
|
|
29
|
-
return (_jsx(Field, { ...props, children: _jsx("input", { className: cn(styles({ variant }), style), placeholder: placeholder, value: value, onChange: ({ target: { value } }) => update?.(value), onKeyUp: ({ key }) => key === "Enter" && value ? onEnter?.(value) : null, disabled: disabled }
|
|
30
|
-
}
|
|
31
|
-
const styles = tv({
|
|
32
|
-
base: "px-3 py-2 duration-200 rounded text-sm placeholder:text-primary-darker text-primary disabled:brightness-90 disabled:cursor-not-allowed",
|
|
33
|
-
defaultVariants: { variant: "normal" },
|
|
34
|
-
variants: {
|
|
35
|
-
variant: {
|
|
36
|
-
normal: "bg-input border border-outline focus:border-outline-light outline-none",
|
|
37
|
-
ghost: "p-0 bg-transparent border-none outline-none"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn, tv } from "@bouko/style";
|
|
3
|
+
function Field({ style, label, required = true, note, children }) {
|
|
4
|
+
return (_jsxs("div", { className: cn(fieldStyles.container, style), children: [label && _jsxs("span", { className: fieldStyles.label, children: [label, " ", !required ? _jsx("span", { className: "italic text-slate-400", children: "(optional)" }) : ""] }), children, note && _jsx("span", { className: fieldStyles.note, children: note })] }));
|
|
5
|
+
}
|
|
6
|
+
const fieldStyles = {
|
|
7
|
+
container: "flex flex-col shrink-0 gap-1 w-full overflow-hidden",
|
|
8
|
+
label: "text-xs text-primary-dark",
|
|
9
|
+
note: "mt-1 text-xs text-slate-500 whitespace-pre-line"
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Text field component.
|
|
13
|
+
*
|
|
14
|
+
* Wraps the native `input` element with custom styling and validation.
|
|
15
|
+
* It displays an optional label and note, and can be marked as required.
|
|
16
|
+
* Optional callback for when the user presses `Enter` key.
|
|
17
|
+
* The value is controlled externally via props, usually `useState`.
|
|
18
|
+
*
|
|
19
|
+
* Variants:
|
|
20
|
+
* - `normal`: Standard input with primary color scheme.
|
|
21
|
+
* - `ghost`: Transparent for injecting input inside other component.
|
|
22
|
+
*
|
|
23
|
+
* @param {Variant} variant - Visual style variant. (optional, default = normal)
|
|
24
|
+
* @param {string} style - Additional class names for styling. (optional)
|
|
25
|
+
* @param {string} placeholder - Placeholder text for the input. (optional)
|
|
26
|
+
* @param {Function} onEnter - Callback when `Enter` key is pressed. (optional)
|
|
27
|
+
**/
|
|
28
|
+
export default function Input({ variant, style, value, update, onEnter, disabled, placeholder, ...props }) {
|
|
29
|
+
return (_jsx(Field, { ...props, children: _jsx("input", { className: cn(styles({ variant }), style), placeholder: placeholder, value: value, onChange: ({ target: { value } }) => update?.(value), onKeyUp: ({ key }) => key === "Enter" && value ? onEnter?.(value) : null, disabled: disabled }) }));
|
|
30
|
+
}
|
|
31
|
+
const styles = tv({
|
|
32
|
+
base: "px-3 py-2 duration-200 rounded text-sm placeholder:text-primary-darker text-primary disabled:brightness-90 disabled:cursor-not-allowed",
|
|
33
|
+
defaultVariants: { variant: "normal" },
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
normal: "bg-input border border-outline focus:border-outline-light outline-none",
|
|
37
|
+
ghost: "p-0 bg-transparent border-none outline-none"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Component } from "../../core/types";
|
|
2
|
-
|
|
3
|
-
direction?: "left" | "down";
|
|
4
|
-
gradient?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function FadeBox({ style, direction, gradient, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default FadeBox;
|
|
1
|
+
import { Component } from "../../core/types";
|
|
2
|
+
type Props = Component & {
|
|
3
|
+
direction?: "left" | "down";
|
|
4
|
+
gradient?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function FadeBox({ style, direction, gradient, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default FadeBox;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn, tv } from "@bouko/style";
|
|
3
|
-
export function FadeBox({ style, direction = "left", gradient, children }) {
|
|
4
|
-
return (_jsxs("div", { className: cn("relative", style), children: [children, _jsx("div", { className: cn(styles({ direction }), gradient) }
|
|
5
|
-
}
|
|
6
|
-
const styles = tv({
|
|
7
|
-
base: "absolute from-background",
|
|
8
|
-
variants: {
|
|
9
|
-
direction: {
|
|
10
|
-
left: "top-0 right-0 w-12 h-full bg-gradient-to-l",
|
|
11
|
-
down: "top-0 left-0 w-full h-full bg-gradient-to-b"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
export default FadeBox;
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn, tv } from "@bouko/style";
|
|
3
|
+
export function FadeBox({ style, direction = "left", gradient, children }) {
|
|
4
|
+
return (_jsxs("div", { className: cn("relative", style), children: [children, _jsx("div", { className: cn(styles({ direction }), gradient) })] }));
|
|
5
|
+
}
|
|
6
|
+
const styles = tv({
|
|
7
|
+
base: "absolute from-background",
|
|
8
|
+
variants: {
|
|
9
|
+
direction: {
|
|
10
|
+
left: "top-0 right-0 w-12 h-full bg-gradient-to-l",
|
|
11
|
+
down: "top-0 left-0 w-full h-full bg-gradient-to-b"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export default FadeBox;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { Component } from "../../core/types";
|
|
2
|
-
|
|
3
|
-
center?: boolean;
|
|
4
|
-
centerX?: boolean;
|
|
5
|
-
centerY?: boolean;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Flex containers with configurable alignment and styling.
|
|
9
|
-
*
|
|
10
|
-
* @param {string} style - Additional styles for container.
|
|
11
|
-
* @param {ReactNode} children - Child elements to render inside the row.
|
|
12
|
-
* @param {Props} opts - Variant options for styling.
|
|
13
|
-
**/
|
|
14
|
-
export declare function RowBox({ style, children, ...opts }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
-
export declare function ColumnBox({ style, children, ...opts }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
-
export {};
|
|
1
|
+
import type { Component } from "../../core/types";
|
|
2
|
+
type Props = Component & {
|
|
3
|
+
center?: boolean;
|
|
4
|
+
centerX?: boolean;
|
|
5
|
+
centerY?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Flex containers with configurable alignment and styling.
|
|
9
|
+
*
|
|
10
|
+
* @param {string} style - Additional styles for container.
|
|
11
|
+
* @param {ReactNode} children - Child elements to render inside the row.
|
|
12
|
+
* @param {Props} opts - Variant options for styling.
|
|
13
|
+
**/
|
|
14
|
+
export declare function RowBox({ style, children, ...opts }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export declare function ColumnBox({ style, children, ...opts }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export {};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn, tv } from "@bouko/style";
|
|
3
|
-
/**
|
|
4
|
-
* Flex containers with configurable alignment and styling.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} style - Additional styles for container.
|
|
7
|
-
* @param {ReactNode} children - Child elements to render inside the row.
|
|
8
|
-
* @param {Props} opts - Variant options for styling.
|
|
9
|
-
**/
|
|
10
|
-
export function RowBox({ style, children, ...opts }) {
|
|
11
|
-
if (!children)
|
|
12
|
-
return null;
|
|
13
|
-
return (_jsx("div", { className: cn(row(opts), style), children: children }
|
|
14
|
-
}
|
|
15
|
-
export function ColumnBox({ style, children, ...opts }) {
|
|
16
|
-
if (!children)
|
|
17
|
-
return null;
|
|
18
|
-
return (_jsx("div", { className: cn(column(opts), style), children: children }
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Styling variants for flex options.
|
|
22
|
-
*
|
|
23
|
-
* @param {boolean} centerX - center children horizontally
|
|
24
|
-
* @param {boolean} centerY - center children vertically
|
|
25
|
-
* @param {boolean} center - center children on both axis
|
|
26
|
-
**/
|
|
27
|
-
const row = tv({
|
|
28
|
-
base: "flex",
|
|
29
|
-
variants: {
|
|
30
|
-
centerX: { true: "justify-center" },
|
|
31
|
-
centerY: { true: "items-center" },
|
|
32
|
-
center: { true: "items-center justify-center" }
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
const column = tv({
|
|
36
|
-
base: "flex flex-col",
|
|
37
|
-
variants: {
|
|
38
|
-
centerX: { true: "items-center" },
|
|
39
|
-
centerY: { true: "justify-center" },
|
|
40
|
-
center: { true: "items-center justify-center" }
|
|
41
|
-
}
|
|
42
|
-
});
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn, tv } from "@bouko/style";
|
|
3
|
+
/**
|
|
4
|
+
* Flex containers with configurable alignment and styling.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} style - Additional styles for container.
|
|
7
|
+
* @param {ReactNode} children - Child elements to render inside the row.
|
|
8
|
+
* @param {Props} opts - Variant options for styling.
|
|
9
|
+
**/
|
|
10
|
+
export function RowBox({ style, children, ...opts }) {
|
|
11
|
+
if (!children)
|
|
12
|
+
return null;
|
|
13
|
+
return (_jsx("div", { className: cn(row(opts), style), children: children }));
|
|
14
|
+
}
|
|
15
|
+
export function ColumnBox({ style, children, ...opts }) {
|
|
16
|
+
if (!children)
|
|
17
|
+
return null;
|
|
18
|
+
return (_jsx("div", { className: cn(column(opts), style), children: children }));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Styling variants for flex options.
|
|
22
|
+
*
|
|
23
|
+
* @param {boolean} centerX - center children horizontally
|
|
24
|
+
* @param {boolean} centerY - center children vertically
|
|
25
|
+
* @param {boolean} center - center children on both axis
|
|
26
|
+
**/
|
|
27
|
+
const row = tv({
|
|
28
|
+
base: "flex",
|
|
29
|
+
variants: {
|
|
30
|
+
centerX: { true: "justify-center" },
|
|
31
|
+
centerY: { true: "items-center" },
|
|
32
|
+
center: { true: "items-center justify-center" }
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const column = tv({
|
|
36
|
+
base: "flex flex-col",
|
|
37
|
+
variants: {
|
|
38
|
+
centerX: { true: "items-center" },
|
|
39
|
+
centerY: { true: "justify-center" },
|
|
40
|
+
center: { true: "items-center justify-center" }
|
|
41
|
+
}
|
|
42
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { mergeStyles } from "@bouko/style";
|
|
3
3
|
import { RowBox, ColumnBox } from "./flex";
|
|
4
|
-
import { Badge } from "../text/badge";
|
|
4
|
+
import { default as Badge } from "../text/badge";
|
|
5
5
|
/**
|
|
6
6
|
* Text heading with badge, title, subtitle.
|
|
7
7
|
*
|
|
@@ -18,5 +18,5 @@ const base = {
|
|
|
18
18
|
container: "items-center",
|
|
19
19
|
badge: "mb-2",
|
|
20
20
|
title: "items-center gap-2 text-xl sm:text-2xl 2xl:text-3xl font-bold text-primary",
|
|
21
|
-
subtitle: "items-center gap-2 max-sm:text-sm 2xl:text-lg text-
|
|
21
|
+
subtitle: "items-center gap-2 max-sm:text-sm 2xl:text-lg text-primary-light dark:text-primary-dark"
|
|
22
22
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function Separator({ style }: {
|
|
2
|
-
style?: string;
|
|
3
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export default function Separator({ style }: {
|
|
2
|
+
style?: string;
|
|
3
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "@bouko/style";
|
|
3
|
-
export default function Separator({ style }) {
|
|
4
|
-
return _jsx("hr", { className: cn("w-full text-border-dark", style) }
|
|
5
|
-
}
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@bouko/style";
|
|
3
|
+
export default function Separator({ style }) {
|
|
4
|
+
return _jsx("hr", { className: cn("w-full text-border-dark", style) });
|
|
5
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as BulletList } from "./variants/bullet";
|
|
2
|
-
export { default as NumberList } from "./variants/number";
|
|
1
|
+
export { default as BulletList } from "./variants/bullet";
|
|
2
|
+
export { default as NumberList } from "./variants/number";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as BulletList } from "./variants/bullet";
|
|
2
|
-
export { default as NumberList } from "./variants/number";
|
|
1
|
+
export { default as BulletList } from "./variants/bullet";
|
|
2
|
+
export { default as NumberList } from "./variants/number";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
interface Props {
|
|
3
|
-
marker: ReactNode;
|
|
4
|
-
content: ReactNode;
|
|
5
|
-
index: number;
|
|
6
|
-
centerMarker?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export default function Item({ marker, content, centerMarker, index }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
marker: ReactNode;
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
index: number;
|
|
6
|
+
centerMarker?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default function Item({ marker, content, centerMarker, index }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Animation } from "../animate";
|
|
3
|
-
import { cn } from "@bouko/style";
|
|
4
|
-
;
|
|
5
|
-
export default function Item({ marker, content, centerMarker, index }) {
|
|
6
|
-
return (_jsxs(Animation, { style: cn("flex items-start text-sm", centerMarker && "items-center"), children: [marker, content] }, index));
|
|
7
|
-
}
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Animation } from "../animate";
|
|
3
|
+
import { cn } from "@bouko/style";
|
|
4
|
+
;
|
|
5
|
+
export default function Item({ marker, content, centerMarker, index }) {
|
|
6
|
+
return (_jsxs(Animation, { style: cn("flex items-start text-sm", centerMarker && "items-center"), children: [marker, content] }, index));
|
|
7
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
interface Props {
|
|
3
|
-
style?: string;
|
|
4
|
-
title?: string;
|
|
5
|
-
items: ReactNode[];
|
|
6
|
-
centerMarker?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export default function BulletList({ style, title, items, centerMarker }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
style?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
items: ReactNode[];
|
|
6
|
+
centerMarker?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default function BulletList({ style, title, items, centerMarker }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import Item from "../item";
|
|
4
|
-
import { Animation } from "../../animate/";
|
|
5
|
-
import { cn } from "@bouko/style";
|
|
6
|
-
;
|
|
7
|
-
export default function BulletList({ style, title, items, centerMarker }) {
|
|
8
|
-
return (_jsxs(Animation, { style: cn(styles.base, style), children: [!!title && _jsx("span", { className: styles.title, children: title }
|
|
9
|
-
}
|
|
10
|
-
function Marker() {
|
|
11
|
-
return (_jsx("span", { className: "mr-3 text-accent", children: "\u2022" }
|
|
12
|
-
}
|
|
13
|
-
const styles = {
|
|
14
|
-
base: "flex flex-col gap-1 w-full",
|
|
15
|
-
title: "mb-1 text-base"
|
|
16
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Item from "../item";
|
|
4
|
+
import { Animation } from "../../animate/";
|
|
5
|
+
import { cn } from "@bouko/style";
|
|
6
|
+
;
|
|
7
|
+
export default function BulletList({ style, title, items, centerMarker }) {
|
|
8
|
+
return (_jsxs(Animation, { style: cn(styles.base, style), children: [!!title && _jsx("span", { className: styles.title, children: title }), _jsx(Animation, { style: cn(styles.base, style, !!title && "ml-2"), children: items.map((x, i) => (_jsx(Item, { marker: _jsx(Marker, {}), content: x, index: i, centerMarker: centerMarker }, i))) })] }, title));
|
|
9
|
+
}
|
|
10
|
+
function Marker() {
|
|
11
|
+
return (_jsx("span", { className: "mr-3 text-accent", children: "\u2022" }));
|
|
12
|
+
}
|
|
13
|
+
const styles = {
|
|
14
|
+
base: "flex flex-col gap-1 w-full",
|
|
15
|
+
title: "mb-1 text-base"
|
|
16
|
+
};
|