@bouku/core 0.0.1 → 0.0.3
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/chevron-up.svg +6 -0
- package/dist/components/accordion/index.d.ts +6 -0
- package/dist/components/accordion/index.js +12 -0
- package/dist/components/accordion/tab.d.ts +4 -0
- package/dist/components/accordion/tab.js +35 -0
- package/dist/components/button/_.d.ts +2 -0
- package/dist/components/button/_.js +10 -0
- package/dist/components/button/copy.d.ts +6 -0
- package/dist/components/button/copy.js +16 -0
- package/dist/components/button/normal.d.ts +11 -0
- package/dist/components/button/normal.js +48 -0
- package/dist/components/date/_.d.ts +1 -0
- package/dist/components/date/_.js +8 -0
- package/dist/components/date/time-ago.d.ts +7 -0
- package/dist/components/date/time-ago.js +13 -0
- package/dist/components/dropdown/normal.d.ts +10 -0
- package/dist/components/dropdown/normal.js +22 -0
- package/dist/components/fade/_.d.ts +1 -0
- package/dist/components/fade/_.js +8 -0
- package/dist/components/fade/circle.d.ts +10 -0
- package/dist/components/fade/circle.js +8 -0
- package/dist/components/heading/_.d.ts +2 -0
- package/dist/components/heading/_.js +10 -0
- package/dist/components/heading/normal.d.ts +24 -0
- package/dist/components/heading/normal.js +26 -0
- package/dist/components/heading/page.d.ts +25 -0
- package/dist/components/heading/page.js +26 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/index.js +46 -0
- package/dist/components/information/_.d.ts +1 -0
- package/dist/components/information/_.js +8 -0
- package/dist/components/information/card.d.ts +7 -0
- package/dist/components/information/card.js +20 -0
- package/dist/components/layout/_.d.ts +2 -0
- package/dist/components/layout/_.js +10 -0
- package/dist/components/layout/absolute.d.ts +9 -0
- package/dist/components/layout/absolute.js +12 -0
- package/dist/components/layout/fade.d.ts +7 -0
- package/dist/components/layout/fade.js +20 -0
- package/dist/components/layout/flex.d.ts +17 -0
- package/dist/components/layout/flex.js +49 -0
- package/dist/components/layout/footer.d.ts +15 -0
- package/dist/components/layout/footer.js +13 -0
- package/dist/components/layout/media-row.d.ts +15 -0
- package/dist/components/layout/media-row.js +11 -0
- package/dist/components/layout/rnd.d.ts +10 -0
- package/dist/components/layout/rnd.js +32 -0
- package/dist/components/layout/scroll-box.d.ts +14 -0
- package/dist/components/layout/scroll-box.js +11 -0
- package/dist/components/layout/section.d.ts +15 -0
- package/dist/components/layout/section.js +19 -0
- package/dist/components/layout/separator.d.ts +3 -0
- package/dist/components/layout/separator.js +8 -0
- package/dist/components/link/_.d.ts +1 -0
- package/dist/components/link/_.js +8 -0
- package/dist/components/link/tab.d.ts +22 -0
- package/dist/components/link/tab.js +30 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/index.js +10 -0
- package/dist/components/list/item.d.ts +9 -0
- package/dist/components/list/item.js +9 -0
- package/dist/components/list/search-bar.d.ts +14 -0
- package/dist/components/list/search-bar.js +33 -0
- package/dist/components/list/variants/bullet.d.ts +9 -0
- package/dist/components/list/variants/bullet.js +21 -0
- package/dist/components/list/variants/number.d.ts +10 -0
- package/dist/components/list/variants/number.js +23 -0
- package/dist/components/pagination/index.d.ts +9 -0
- package/dist/components/pagination/index.js +21 -0
- package/dist/components/progress/_.d.ts +1 -0
- package/dist/components/progress/_.js +8 -0
- package/dist/components/progress/bar.d.ts +4 -0
- package/dist/components/progress/bar.js +12 -0
- package/dist/components/table/_.d.ts +1 -0
- package/dist/components/table/_.js +8 -0
- package/dist/components/table/normal.d.ts +7 -0
- package/dist/components/table/normal.js +20 -0
- package/dist/components/text/_.d.ts +2 -0
- package/dist/components/text/_.js +10 -0
- package/dist/components/text/badge.d.ts +18 -0
- package/dist/components/text/badge.js +42 -0
- package/dist/components/text/input.d.ts +39 -0
- package/dist/components/text/input.js +50 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" width="1em" height="1em">
|
|
2
|
+
<path
|
|
3
|
+
d="M297.4 169.4C309.9 156.9 330.2 156.9 342.7 169.4L534.7 361.4C547.2 373.9 547.2 394.2 534.7 406.7C522.2 419.2 501.9 419.2 489.4 406.7L320 237.3L150.6 406.6C138.1 419.1 117.8 419.1 105.3 406.6C92.8 394.1 92.8 373.8 105.3 361.3L297.3 169.3z"
|
|
4
|
+
fill="currentColor"
|
|
5
|
+
/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Accordion = Accordion;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const flex_1 = require("../layout/flex");
|
|
8
|
+
const tab_1 = require("./tab");
|
|
9
|
+
function Accordion({ items }) {
|
|
10
|
+
const [activeItem, setActiveItem] = (0, react_1.useState)(0);
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(flex_1.ColumnBox, { style: "gap-5 overflow-y-auto scrollbar-none", children: items.map(({ label, content }, i) => ((0, jsx_runtime_1.jsxs)(flex_1.ColumnBox, { style: "gap-5", children: [(0, jsx_runtime_1.jsx)("div", { onClick: () => setActiveItem(i === activeItem ? null : i), children: (0, jsx_runtime_1.jsx)(tab_1.SectionHeader, { isActive: i === activeItem, label: label }) }), i === activeItem && ((0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: "w-full", center: true, children: content }))] }, i))) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SectionHeader = SectionHeader;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const chevron_up_svg_1 = __importDefault(require("@/assets/icons/chevron-up.svg"));
|
|
10
|
+
const tailwind_variants_1 = require("tailwind-variants");
|
|
11
|
+
function SectionHeader({ isActive, label }) {
|
|
12
|
+
const s = getStyles({ isActive });
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: s.container(), children: [(0, jsx_runtime_1.jsx)("span", { className: s.label(), children: label }), (0, jsx_runtime_1.jsx)(chevron_up_svg_1.default, { className: s.chevron() })] }));
|
|
14
|
+
}
|
|
15
|
+
const getStyles = (0, tailwind_variants_1.tv)({
|
|
16
|
+
slots: {
|
|
17
|
+
container: "flex justify-between items-center gap-8 px-3 py-2 border rounded duration-200 cursor-pointer",
|
|
18
|
+
label: "font-bold",
|
|
19
|
+
chevron: "duration-200"
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
isActive: {
|
|
23
|
+
true: {
|
|
24
|
+
container: "bg-surface-light border-border-light",
|
|
25
|
+
label: "text-primary",
|
|
26
|
+
chevron: "text-accent rotate-180"
|
|
27
|
+
},
|
|
28
|
+
false: {
|
|
29
|
+
container: "bg-surface hover:bg-surface-light border-border",
|
|
30
|
+
label: "text-primary-dark",
|
|
31
|
+
chevron: "text-primary-dark"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CopyButton = exports.Button = void 0;
|
|
7
|
+
var normal_1 = require("./normal");
|
|
8
|
+
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return __importDefault(normal_1).default; } });
|
|
9
|
+
var copy_1 = require("./copy");
|
|
10
|
+
Object.defineProperty(exports, "CopyButton", { enumerable: true, get: function () { return __importDefault(copy_1).default; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = CopyButton;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const normal_1 = require("./normal");
|
|
9
|
+
const copy_svg_1 = __importDefault(require("../../assets/icons/copy.svg"));
|
|
10
|
+
function CopyButton({ value, action, children, ...props }) {
|
|
11
|
+
const submit = async () => {
|
|
12
|
+
await navigator.clipboard.writeText(value);
|
|
13
|
+
await action?.();
|
|
14
|
+
};
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(normal_1.Button, { action: submit, ...props, children: [(0, jsx_runtime_1.jsx)(copy_svg_1.default, {}), children] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Component } from "../../utils";
|
|
3
|
+
export type ButtonProps = Component & {
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
5
|
+
variant?: "surface" | "accent" | "outline" | "ghost" | "error" | "future";
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
action?: () => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function Button({ style, size, variant, icon, children, disabled, action }: ButtonProps): import("react").JSX.Element;
|
|
11
|
+
export default Button;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Button = Button;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const style_1 = require("@bouko/style");
|
|
10
|
+
const tailwind_variants_1 = require("tailwind-variants");
|
|
11
|
+
const spinner_svg_1 = __importDefault(require("../../assets/icons/spinner.svg"));
|
|
12
|
+
function Button({ style, size, variant, icon, children, disabled, action }) {
|
|
13
|
+
const [isLoading, setLoading] = (0, react_1.useState)(false);
|
|
14
|
+
const handleClick = async () => {
|
|
15
|
+
if (action) {
|
|
16
|
+
setLoading(true);
|
|
17
|
+
await action();
|
|
18
|
+
setLoading(false);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("button", { className: (0, style_1.cn)(styles({ size, variant }), style), onClick: handleClick, disabled: disabled || isLoading, children: [icon && isLoading
|
|
22
|
+
? (0, jsx_runtime_1.jsx)(spinner_svg_1.default, { className: "animate-spin" })
|
|
23
|
+
: icon, children] }));
|
|
24
|
+
}
|
|
25
|
+
const styles = (0, tailwind_variants_1.tv)({
|
|
26
|
+
base: "relative flex justify-center items-center border outline-none rounded font-semibold duration-200 cursor-pointer disabled:cursor-not-allowed hover:brightness-115",
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
size: "md",
|
|
29
|
+
variant: "surface"
|
|
30
|
+
},
|
|
31
|
+
variants: {
|
|
32
|
+
size: {
|
|
33
|
+
xs: "gap-1 px-2 py-2 text-sm rounded-full",
|
|
34
|
+
sm: "gap-2 px-3 py-2 text-xs sm:text-sm",
|
|
35
|
+
md: "gap-2 px-4 py-2 text-xs sm:text-sm",
|
|
36
|
+
lg: "gap-3 px-5 py-3 text-base sm:text-lg"
|
|
37
|
+
},
|
|
38
|
+
variant: {
|
|
39
|
+
surface: "bg-surface border-border text-primary",
|
|
40
|
+
accent: "bg-accent border-accent-dark text-background",
|
|
41
|
+
outline: "bg-transparent border-accent text-accent",
|
|
42
|
+
ghost: "bg-transparent border-transparent text-primary",
|
|
43
|
+
error: "bg-error border-error-dark text-background",
|
|
44
|
+
future: "backdrop-blur-sm test-button"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
exports.default = Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TimeAgo } from "./time-ago";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TimeAgo = void 0;
|
|
7
|
+
var time_ago_1 = require("./time-ago");
|
|
8
|
+
Object.defineProperty(exports, "TimeAgo", { enumerable: true, get: function () { return __importDefault(time_ago_1).default; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = TimeAgo;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_time_ago_1 = __importDefault(require("react-time-ago"));
|
|
9
|
+
function TimeAgo({ style, prefix, date }) {
|
|
10
|
+
if (!date)
|
|
11
|
+
return null;
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: style, children: [(0, jsx_runtime_1.jsx)("span", { className: "mr-1", children: prefix }), (0, jsx_runtime_1.jsx)(react_time_ago_1.default, { date: date, timeStyle: "mini-minute-now" })] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.default = Dropdown;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const framer_motion_1 = require("framer-motion");
|
|
8
|
+
function Dropdown({ options, children }) {
|
|
9
|
+
const [isOpen, setOpen] = (0, react_1.useState)(false);
|
|
10
|
+
const boom = (action) => {
|
|
11
|
+
action();
|
|
12
|
+
setOpen(false);
|
|
13
|
+
};
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles.container, children: [(0, jsx_runtime_1.jsx)("div", { onClick: () => setOpen(true), children: children }), (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: isOpen && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { className: styles.dropdown, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: options.map(({ label, action }, i) => ((0, jsx_runtime_1.jsx)("div", { className: "cursor-pointer duration-200 hover:brightness-115", onClick: () => boom(action), children: label }, i))) }, "dropdown")) })] }));
|
|
15
|
+
}
|
|
16
|
+
const styles = {
|
|
17
|
+
container: "relative shrink-0",
|
|
18
|
+
subcontainer: "flex flex-col gap-1 w-full",
|
|
19
|
+
label: "text-xs text-slate-600",
|
|
20
|
+
trigger: "flex justify-between items-center px-3 py-2 bg-slate-200/50 hover:bg-slate-200/80 border border-slate-300 outline-blue-500 rounded text-sm duration-200 cursor-pointer",
|
|
21
|
+
dropdown: "absolute mt-2 z-50 flex flex-col items-end justify-end gap-1 w-full bg-slate-950 rounded border border-border-dark p-3 pr-4 text-sm max-h-46 overflow-y-auto"
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CircleFade } from "./circle";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CircleFade = void 0;
|
|
7
|
+
var circle_1 = require("./circle");
|
|
8
|
+
Object.defineProperty(exports, "CircleFade", { enumerable: true, get: function () { return __importDefault(circle_1).default; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = CircleFade;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const style_1 = require("@bouko/style");
|
|
6
|
+
function CircleFade({ className, style }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)("absolute size-24 bg-radial from-background", className), style: style }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PageHeading = exports.Heading = void 0;
|
|
7
|
+
var normal_1 = require("./normal");
|
|
8
|
+
Object.defineProperty(exports, "Heading", { enumerable: true, get: function () { return __importDefault(normal_1).default; } });
|
|
9
|
+
var page_1 = require("./page");
|
|
10
|
+
Object.defineProperty(exports, "PageHeading", { enumerable: true, get: function () { return __importDefault(page_1).default; } });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
badge?: string;
|
|
4
|
+
image?: string;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
subtitle?: ReactNode;
|
|
7
|
+
style?: Styles;
|
|
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 {string} badge - Little note above the title (optional).
|
|
19
|
+
* @param {ReactNode} title - Main title content.
|
|
20
|
+
* @param {ReactNode} subtitle - Subtitle content (optional).
|
|
21
|
+
* @param {Styles} style - Additional styles (optional).
|
|
22
|
+
**/
|
|
23
|
+
export default function Heading({ badge, image, title, subtitle, style }: Props): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = Heading;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const style_1 = require("@bouko/style");
|
|
6
|
+
const flex_1 = require("../layout/flex");
|
|
7
|
+
const badge_1 = require("../text/badge");
|
|
8
|
+
/**
|
|
9
|
+
* Text heading with badge, title, subtitle.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} badge - Little note above the title (optional).
|
|
12
|
+
* @param {ReactNode} title - Main title content.
|
|
13
|
+
* @param {ReactNode} subtitle - Subtitle content (optional).
|
|
14
|
+
* @param {Styles} style - Additional styles (optional).
|
|
15
|
+
**/
|
|
16
|
+
function Heading({ badge, image, title, subtitle, style = {} }) {
|
|
17
|
+
const styles = (0, style_1.mergeStyles)(base, style);
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(flex_1.ColumnBox, { style: styles.container, children: [(0, jsx_runtime_1.jsx)(badge_1.Badge, { style: styles.badge, children: badge }), image && (0, jsx_runtime_1.jsx)("img", { className: styles.logo, src: image, alt: "Logo" }), (0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: styles.title, children: title }), (0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: styles.subtitle, children: subtitle })] }));
|
|
19
|
+
}
|
|
20
|
+
const base = {
|
|
21
|
+
container: "items-center",
|
|
22
|
+
badge: "mb-2",
|
|
23
|
+
logo: "mb-5 w-12",
|
|
24
|
+
title: "items-center gap-2 text-xl sm:text-2xl 2xl:text-3xl font-bold text-primary",
|
|
25
|
+
subtitle: "items-center gap-2 max-sm:text-sm 2xl:text-lg text-center text-primary-light dark:text-primary-dark"
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = PageHeading;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const style_1 = require("@bouko/style");
|
|
6
|
+
const flex_1 = require("../layout/flex");
|
|
7
|
+
const badge_1 = require("../text/badge");
|
|
8
|
+
/**
|
|
9
|
+
* Text heading with badge, title, subtitle.
|
|
10
|
+
*
|
|
11
|
+
* @param {Styles} style - Additional styles. (optional)
|
|
12
|
+
* @param {string} badge - Little note above the title. (optional)
|
|
13
|
+
* @param {ReactNode} icon - Component displayed left of title. (optional)
|
|
14
|
+
* @param {string} title - Main title content.
|
|
15
|
+
* @param {string} subtitle - Subtitle content. (optional)
|
|
16
|
+
**/
|
|
17
|
+
function PageHeading({ style = {}, badge, icon, title, subtitle }) {
|
|
18
|
+
const styles = (0, style_1.mergeStyles)(base, style);
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(flex_1.ColumnBox, { style: styles.container, children: [(0, jsx_runtime_1.jsx)(badge_1.Badge, { style: styles.badge, children: badge }), (0, jsx_runtime_1.jsxs)(flex_1.RowBox, { style: styles.title, children: [icon, title] }), (0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: styles.subtitle, children: subtitle })] }));
|
|
20
|
+
}
|
|
21
|
+
const base = {
|
|
22
|
+
container: "w-full items-center font-mono",
|
|
23
|
+
badge: "mb-2",
|
|
24
|
+
title: "items-center gap-2 mb-3 text-4xl sm:text-5xl 2xl:text-6xl text-center font-bold text-primary",
|
|
25
|
+
subtitle: "items-center gap-2 text-sm sm:text-base 2xl:text-lg text-center text-primary-light dark:text-primary-dark"
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./accordion";
|
|
2
|
+
export { default as Separator } from "./layout/separator";
|
|
3
|
+
export { default as FadeBox } from "./layout/fade";
|
|
4
|
+
export { default as AbsoluteBox } from "./layout/absolute";
|
|
5
|
+
export * from "./layout/flex";
|
|
6
|
+
export * from "./layout/_";
|
|
7
|
+
export * from "./heading/_";
|
|
8
|
+
export * from "./button/_";
|
|
9
|
+
export { default as Pagination } from "./pagination";
|
|
10
|
+
export { default as Section } from "./layout/section";
|
|
11
|
+
export { default as Dropdown } from "./dropdown/normal";
|
|
12
|
+
export * from "./fade/_";
|
|
13
|
+
export * from "./list";
|
|
14
|
+
export * from "./layout/media-row";
|
|
15
|
+
export * from "./layout/scroll-box";
|
|
16
|
+
export * from "./date/_";
|
|
17
|
+
export * from "./information/_";
|
|
18
|
+
export * from "./progress/_";
|
|
19
|
+
export * from "./text/_";
|
|
20
|
+
export * from "./table/_";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.Dropdown = exports.Section = exports.Pagination = exports.AbsoluteBox = exports.FadeBox = exports.Separator = void 0;
|
|
21
|
+
__exportStar(require("./accordion"), exports);
|
|
22
|
+
var separator_1 = require("./layout/separator");
|
|
23
|
+
Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return __importDefault(separator_1).default; } });
|
|
24
|
+
var fade_1 = require("./layout/fade");
|
|
25
|
+
Object.defineProperty(exports, "FadeBox", { enumerable: true, get: function () { return __importDefault(fade_1).default; } });
|
|
26
|
+
var absolute_1 = require("./layout/absolute");
|
|
27
|
+
Object.defineProperty(exports, "AbsoluteBox", { enumerable: true, get: function () { return __importDefault(absolute_1).default; } });
|
|
28
|
+
__exportStar(require("./layout/flex"), exports);
|
|
29
|
+
__exportStar(require("./layout/_"), exports);
|
|
30
|
+
__exportStar(require("./heading/_"), exports);
|
|
31
|
+
__exportStar(require("./button/_"), exports);
|
|
32
|
+
var pagination_1 = require("./pagination");
|
|
33
|
+
Object.defineProperty(exports, "Pagination", { enumerable: true, get: function () { return __importDefault(pagination_1).default; } });
|
|
34
|
+
var section_1 = require("./layout/section");
|
|
35
|
+
Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return __importDefault(section_1).default; } });
|
|
36
|
+
var normal_1 = require("./dropdown/normal");
|
|
37
|
+
Object.defineProperty(exports, "Dropdown", { enumerable: true, get: function () { return __importDefault(normal_1).default; } });
|
|
38
|
+
__exportStar(require("./fade/_"), exports);
|
|
39
|
+
__exportStar(require("./list"), exports);
|
|
40
|
+
__exportStar(require("./layout/media-row"), exports);
|
|
41
|
+
__exportStar(require("./layout/scroll-box"), exports);
|
|
42
|
+
__exportStar(require("./date/_"), exports);
|
|
43
|
+
__exportStar(require("./information/_"), exports);
|
|
44
|
+
__exportStar(require("./progress/_"), exports);
|
|
45
|
+
__exportStar(require("./text/_"), exports);
|
|
46
|
+
__exportStar(require("./table/_"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Card } from "./card";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Card = void 0;
|
|
7
|
+
var card_1 = require("./card");
|
|
8
|
+
Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return __importDefault(card_1).default; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Card = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const flex_1 = require("../layout/flex");
|
|
6
|
+
const Card = ({ label, value, note }) => ((0, jsx_runtime_1.jsxs)(flex_1.ColumnBox, { style: s.card, children: [(0, jsx_runtime_1.jsx)("span", { className: s.label, children: label }), (0, jsx_runtime_1.jsx)("span", { className: s.value, children: formatValue(value) }), (0, jsx_runtime_1.jsx)("span", { className: s.note, children: note })] }));
|
|
7
|
+
exports.Card = Card;
|
|
8
|
+
const formatValue = (x) => {
|
|
9
|
+
if (typeof x === "string")
|
|
10
|
+
return x;
|
|
11
|
+
else if (typeof x === "number")
|
|
12
|
+
return x.toLocaleString("en-US");
|
|
13
|
+
};
|
|
14
|
+
const s = {
|
|
15
|
+
card: "gap-2 flex-1 p-5 bg-surface border border-border-light rounded-md shadow hover:brightness-120 duration-200",
|
|
16
|
+
label: "text-sm font-mono tracking-wide text-primary-dark uppercase",
|
|
17
|
+
value: "text-5xl font-bold",
|
|
18
|
+
note: "text-xs text-primary-dark"
|
|
19
|
+
};
|
|
20
|
+
exports.default = exports.Card;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Footer = exports.RnD = void 0;
|
|
7
|
+
var rnd_1 = require("./rnd");
|
|
8
|
+
Object.defineProperty(exports, "RnD", { enumerable: true, get: function () { return __importDefault(rnd_1).default; } });
|
|
9
|
+
var footer_1 = require("./footer");
|
|
10
|
+
Object.defineProperty(exports, "Footer", { enumerable: true, get: function () { return __importDefault(footer_1).default; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
pos?: string;
|
|
4
|
+
style?: string;
|
|
5
|
+
ref?: RefObject<HTMLDivElement | null>;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export default function AbsoluteBox({ pos, style, ref, children }: Props): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = AbsoluteBox;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const style_1 = require("@bouko/style");
|
|
6
|
+
function AbsoluteBox({ pos, style, ref, children }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(styles.container, pos), ref: ref, children: (0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(styles.subcontainer, style), children: children }) }));
|
|
8
|
+
}
|
|
9
|
+
const styles = {
|
|
10
|
+
container: "absolute",
|
|
11
|
+
subcontainer: "relative w-full h-full"
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Component } from "../../utils/types/element";
|
|
2
|
+
type Props = Component & {
|
|
3
|
+
direction?: "up" | "left" | "down";
|
|
4
|
+
gradient?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function FadeBox({ style, direction, gradient, children }: Props): import("react").JSX.Element;
|
|
7
|
+
export default FadeBox;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FadeBox = FadeBox;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const style_1 = require("@bouko/style");
|
|
6
|
+
const tailwind_variants_1 = require("tailwind-variants");
|
|
7
|
+
function FadeBox({ style, direction = "up", gradient, children }) {
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.cn)("relative", style), children: [children, (0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(styles({ direction }), gradient) })] }));
|
|
9
|
+
}
|
|
10
|
+
const styles = (0, tailwind_variants_1.tv)({
|
|
11
|
+
base: "absolute from-background",
|
|
12
|
+
variants: {
|
|
13
|
+
direction: {
|
|
14
|
+
up: "left-0 bottom-0 w-full h-full bg-gradient-to-t",
|
|
15
|
+
left: "top-0 right-0 w-12 h-full bg-gradient-to-l",
|
|
16
|
+
down: "top-0 left-0 w-full h-full bg-gradient-to-b"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
exports.default = FadeBox;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component, Hoverable } from "../../utils";
|
|
2
|
+
type Props = Component & Hoverable & {
|
|
3
|
+
center?: boolean;
|
|
4
|
+
centerX?: boolean;
|
|
5
|
+
centerY?: boolean;
|
|
6
|
+
equal?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Flex containers with configurable alignment and styling.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} style - Additional styles for container.
|
|
12
|
+
* @param {ReactNode} children - Child elements to render inside the row.
|
|
13
|
+
* @param {Props} opts - Variant options for styling.
|
|
14
|
+
**/
|
|
15
|
+
export declare function RowBox({ style, children, onHover, onLeave, ...opts }: Props): import("react").JSX.Element | null;
|
|
16
|
+
export declare function ColumnBox({ style, children, onHover, onLeave, ...opts }: Props): import("react").JSX.Element | null;
|
|
17
|
+
export {};
|