@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.
Files changed (86) hide show
  1. package/dist/assets/icons/chevron-up.svg +6 -0
  2. package/dist/components/accordion/index.d.ts +6 -0
  3. package/dist/components/accordion/index.js +12 -0
  4. package/dist/components/accordion/tab.d.ts +4 -0
  5. package/dist/components/accordion/tab.js +35 -0
  6. package/dist/components/button/_.d.ts +2 -0
  7. package/dist/components/button/_.js +10 -0
  8. package/dist/components/button/copy.d.ts +6 -0
  9. package/dist/components/button/copy.js +16 -0
  10. package/dist/components/button/normal.d.ts +11 -0
  11. package/dist/components/button/normal.js +48 -0
  12. package/dist/components/date/_.d.ts +1 -0
  13. package/dist/components/date/_.js +8 -0
  14. package/dist/components/date/time-ago.d.ts +7 -0
  15. package/dist/components/date/time-ago.js +13 -0
  16. package/dist/components/dropdown/normal.d.ts +10 -0
  17. package/dist/components/dropdown/normal.js +22 -0
  18. package/dist/components/fade/_.d.ts +1 -0
  19. package/dist/components/fade/_.js +8 -0
  20. package/dist/components/fade/circle.d.ts +10 -0
  21. package/dist/components/fade/circle.js +8 -0
  22. package/dist/components/heading/_.d.ts +2 -0
  23. package/dist/components/heading/_.js +10 -0
  24. package/dist/components/heading/normal.d.ts +24 -0
  25. package/dist/components/heading/normal.js +26 -0
  26. package/dist/components/heading/page.d.ts +25 -0
  27. package/dist/components/heading/page.js +26 -0
  28. package/dist/components/index.d.ts +20 -0
  29. package/dist/components/index.js +46 -0
  30. package/dist/components/information/_.d.ts +1 -0
  31. package/dist/components/information/_.js +8 -0
  32. package/dist/components/information/card.d.ts +7 -0
  33. package/dist/components/information/card.js +20 -0
  34. package/dist/components/layout/_.d.ts +2 -0
  35. package/dist/components/layout/_.js +10 -0
  36. package/dist/components/layout/absolute.d.ts +9 -0
  37. package/dist/components/layout/absolute.js +12 -0
  38. package/dist/components/layout/fade.d.ts +7 -0
  39. package/dist/components/layout/fade.js +20 -0
  40. package/dist/components/layout/flex.d.ts +17 -0
  41. package/dist/components/layout/flex.js +49 -0
  42. package/dist/components/layout/footer.d.ts +15 -0
  43. package/dist/components/layout/footer.js +13 -0
  44. package/dist/components/layout/media-row.d.ts +15 -0
  45. package/dist/components/layout/media-row.js +11 -0
  46. package/dist/components/layout/rnd.d.ts +10 -0
  47. package/dist/components/layout/rnd.js +32 -0
  48. package/dist/components/layout/scroll-box.d.ts +14 -0
  49. package/dist/components/layout/scroll-box.js +11 -0
  50. package/dist/components/layout/section.d.ts +15 -0
  51. package/dist/components/layout/section.js +19 -0
  52. package/dist/components/layout/separator.d.ts +3 -0
  53. package/dist/components/layout/separator.js +8 -0
  54. package/dist/components/link/_.d.ts +1 -0
  55. package/dist/components/link/_.js +8 -0
  56. package/dist/components/link/tab.d.ts +22 -0
  57. package/dist/components/link/tab.js +30 -0
  58. package/dist/components/list/index.d.ts +2 -0
  59. package/dist/components/list/index.js +10 -0
  60. package/dist/components/list/item.d.ts +9 -0
  61. package/dist/components/list/item.js +9 -0
  62. package/dist/components/list/search-bar.d.ts +14 -0
  63. package/dist/components/list/search-bar.js +33 -0
  64. package/dist/components/list/variants/bullet.d.ts +9 -0
  65. package/dist/components/list/variants/bullet.js +21 -0
  66. package/dist/components/list/variants/number.d.ts +10 -0
  67. package/dist/components/list/variants/number.js +23 -0
  68. package/dist/components/pagination/index.d.ts +9 -0
  69. package/dist/components/pagination/index.js +21 -0
  70. package/dist/components/progress/_.d.ts +1 -0
  71. package/dist/components/progress/_.js +8 -0
  72. package/dist/components/progress/bar.d.ts +4 -0
  73. package/dist/components/progress/bar.js +12 -0
  74. package/dist/components/table/_.d.ts +1 -0
  75. package/dist/components/table/_.js +8 -0
  76. package/dist/components/table/normal.d.ts +7 -0
  77. package/dist/components/table/normal.js +20 -0
  78. package/dist/components/text/_.d.ts +2 -0
  79. package/dist/components/text/_.js +10 -0
  80. package/dist/components/text/badge.d.ts +18 -0
  81. package/dist/components/text/badge.js +42 -0
  82. package/dist/components/text/input.d.ts +39 -0
  83. package/dist/components/text/input.js +50 -0
  84. package/dist/index.d.ts +1 -1
  85. package/dist/index.js +1 -1
  86. package/package.json +2 -1
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RowBox = RowBox;
4
+ exports.ColumnBox = ColumnBox;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const style_1 = require("@bouko/style");
7
+ const tailwind_variants_1 = require("tailwind-variants");
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
+ function RowBox({ style, children, onHover, onLeave, ...opts }) {
16
+ if (!children)
17
+ return null;
18
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(row(opts), style), onMouseEnter: onHover, onMouseLeave: onLeave, children: children }));
19
+ }
20
+ function ColumnBox({ style, children, onHover, onLeave, ...opts }) {
21
+ if (!children)
22
+ return null;
23
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(column(opts), style), onMouseEnter: onHover, onMouseLeave: onLeave, children: children }));
24
+ }
25
+ /**
26
+ * Styling variants for flex options.
27
+ *
28
+ * @param {boolean} centerX - center children horizontally
29
+ * @param {boolean} centerY - center children vertically
30
+ * @param {boolean} center - center children on both axis
31
+ **/
32
+ const row = (0, tailwind_variants_1.tv)({
33
+ base: "flex",
34
+ variants: {
35
+ centerX: { true: "justify-center" },
36
+ centerY: { true: "items-center" },
37
+ center: { true: "items-center justify-center" },
38
+ equal: { true: "[&>*]:flex-1 [&>*]:shrink-0" }
39
+ }
40
+ });
41
+ const column = (0, tailwind_variants_1.tv)({
42
+ base: "flex flex-col",
43
+ variants: {
44
+ centerX: { true: "items-center" },
45
+ centerY: { true: "justify-center" },
46
+ center: { true: "items-center justify-center" },
47
+ equal: { true: "[&>*]:flex-1" }
48
+ }
49
+ });
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from "react";
2
+ /**
3
+ * Page Footer component.
4
+ *
5
+ * Meant to be rendered at the bottom of pages that need
6
+ * a footer. Provides controls for refreshing the page contents,
7
+ * navigating the paginated results, and other actions.
8
+ **/
9
+ type Props = {
10
+ Left: ReactNode;
11
+ Center: ReactNode;
12
+ Right?: ReactNode;
13
+ };
14
+ export declare const Footer: ({ Left, Center, Right }: Props) => import("react").JSX.Element;
15
+ export default Footer;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Footer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const flex_1 = require("./flex");
6
+ const style_1 = require("@bouko/style");
7
+ const Footer = ({ Left, Center, Right }) => ((0, jsx_runtime_1.jsxs)(flex_1.RowBox, { style: style, equal: true, children: [(0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: "justify-start items-center", children: Left }), (0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: "justify-center items-center", children: Center }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-end items-center", children: Right })] }));
8
+ exports.Footer = Footer;
9
+ const style = (0, style_1.css)({
10
+ layout: "justify-between items-center w-full gap-4 p-3 border",
11
+ color: "bg-background-light border-border-dark"
12
+ });
13
+ exports.default = exports.Footer;
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from "react";
2
+ type MediaRowProps = {
3
+ media: string;
4
+ title: string;
5
+ subtitle?: ReactNode;
6
+ badge?: string;
7
+ styles?: {
8
+ container?: string;
9
+ media?: string;
10
+ title?: string;
11
+ subtitle?: string;
12
+ };
13
+ };
14
+ export declare const MediaRow: ({ media, title, subtitle, badge, styles, }: MediaRowProps) => import("react").JSX.Element;
15
+ export {};
@@ -0,0 +1,11 @@
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.MediaRow = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const flex_1 = require("./flex");
9
+ const badge_1 = __importDefault(require("../text/badge"));
10
+ const MediaRow = ({ media, title, subtitle, badge, styles = {}, }) => ((0, jsx_runtime_1.jsxs)(flex_1.RowBox, { style: `items-center gap-3 ${styles.container ?? ""}`, children: [(0, jsx_runtime_1.jsx)("img", { src: media, className: "size-10 w-10 h-10 border border-border rounded", alt: title }), (0, jsx_runtime_1.jsxs)(flex_1.ColumnBox, { style: "gap-px min-w-0", children: [(0, jsx_runtime_1.jsxs)(flex_1.RowBox, { style: "items-center gap-2 min-w-0", children: [(0, jsx_runtime_1.jsx)("span", { className: `text-primary text-sm font-semibold truncate ${styles.title ?? ""}`, children: title }), badge && (0, jsx_runtime_1.jsx)(badge_1.default, { size: "xs", children: badge })] }), subtitle && ((0, jsx_runtime_1.jsx)("span", { className: `text-xs text-primary-dark ${styles.subtitle}`, children: subtitle }))] })] }));
11
+ exports.MediaRow = MediaRow;
@@ -0,0 +1,10 @@
1
+ type Props = {
2
+ style?: string;
3
+ min: number;
4
+ max: number;
5
+ minWidth?: number;
6
+ update: (min: number, size: number) => void;
7
+ children: React.ReactNode;
8
+ };
9
+ export default function RnD({ style, min, max, minWidth, update, children }: Props): import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.default = RnD;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_rnd_1 = require("react-rnd");
7
+ const style_1 = require("@bouko/style");
8
+ function RnD({ style, min, max, minWidth, update, children }) {
9
+ const gapSize = max - min;
10
+ const handleResize = (x, width) => {
11
+ update(x, width);
12
+ };
13
+ const handleDrag = (x) => {
14
+ update(x, gapSize);
15
+ };
16
+ return ((0, jsx_runtime_1.jsx)(react_rnd_1.Rnd, { ...opts(min, max, minWidth), className: (0, style_1.cn)("flex! justify-center items-center overflow-hidden", style), size: { width: gapSize, height: "100%" }, position: { x: min, y: 0 }, onResize: (e, dir, ref, d, pos) => handleResize(pos.x, ref.offsetWidth), onDragStop: (e, d) => handleDrag(d.x), children: children }));
17
+ }
18
+ const opts = (min, max, minWidth) => ({
19
+ bounds: "parent",
20
+ axis: "x",
21
+ minWidth: minWidth || 30,
22
+ default: {
23
+ x: min,
24
+ y: 0,
25
+ width: max - min,
26
+ height: "100%"
27
+ },
28
+ enableResizing: {
29
+ left: true,
30
+ right: true
31
+ }
32
+ });
@@ -0,0 +1,14 @@
1
+ import { Dispatch, SetStateAction } from "react";
2
+ type RowProps<T> = {
3
+ data: T;
4
+ hovered: boolean;
5
+ setHovered: Dispatch<SetStateAction<number | null>>;
6
+ index: number;
7
+ };
8
+ type Props<T> = {
9
+ style?: string;
10
+ items: T[];
11
+ element: React.ComponentType<RowProps<T>>;
12
+ };
13
+ export declare function ScrollBox<T>({ style, items, element: Row }: Props<T>): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScrollBox = ScrollBox;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const style_1 = require("@bouko/style");
7
+ const flex_1 = require("./flex");
8
+ function ScrollBox({ style, items, element: Row }) {
9
+ const [hoveredIndex, setHoveredIndex] = (0, react_1.useState)(null);
10
+ return ((0, jsx_runtime_1.jsx)(flex_1.ColumnBox, { style: (0, style_1.cn)("grow gap-1 w-full overflow-y-auto", style), children: items.map((x, i) => ((0, jsx_runtime_1.jsx)(Row, { data: x, hovered: hoveredIndex === i, setHovered: setHoveredIndex, index: i }, i))) }));
11
+ }
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from "react";
2
+ /**
3
+ * Settings Section Component.
4
+ *
5
+ * Generic layout wrapper used to group related settings or content
6
+ * under a titled section with a visual separator for consistency.
7
+ *
8
+ * @param {string} title - The section title displayed at top.
9
+ * @param {ReactNode} content - Rendered below the separator.
10
+ **/
11
+ declare const Section: ({ title, content }: {
12
+ title: string;
13
+ content: ReactNode;
14
+ }) => import("react").JSX.Element;
15
+ export default Section;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const flex_1 = require("./flex");
5
+ /**
6
+ * Settings Section Component.
7
+ *
8
+ * Generic layout wrapper used to group related settings or content
9
+ * under a titled section with a visual separator for consistency.
10
+ *
11
+ * @param {string} title - The section title displayed at top.
12
+ * @param {ReactNode} content - Rendered below the separator.
13
+ **/
14
+ const Section = ({ title, content }) => ((0, jsx_runtime_1.jsxs)(flex_1.ColumnBox, { style: styles.container, children: [title, (0, jsx_runtime_1.jsx)("hr", { className: styles.separator }), content] }));
15
+ const styles = {
16
+ container: "gap-2 items-start text-primary",
17
+ separator: "mb-2 w-full text-border-dark"
18
+ };
19
+ exports.default = Section;
@@ -0,0 +1,3 @@
1
+ export default function Separator({ style }: {
2
+ style?: string;
3
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = Separator;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const style_1 = require("@bouko/style");
6
+ function Separator({ style }) {
7
+ return (0, jsx_runtime_1.jsx)("hr", { className: (0, style_1.cn)("w-full text-border-dark", style) });
8
+ }
@@ -0,0 +1 @@
1
+ export { default as NavTab } from "./tab";
@@ -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.NavTab = void 0;
7
+ var tab_1 = require("./tab");
8
+ Object.defineProperty(exports, "NavTab", { enumerable: true, get: function () { return __importDefault(tab_1).default; } });
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Tab Navigation Component.
3
+ *
4
+ * A `TabItem` wrapper that integrates with React Router.
5
+ * Derives active state from the current URL and renders a
6
+ * navigable tab using a router `<Link>`.
7
+ *
8
+ * Behavior:
9
+ * - Builds a route from the provided `id` (/[id]).
10
+ * - Marks tab as active when the pathname includes that route.
11
+ * - Delegates all visual rendering to `TabItem`.
12
+ * - Nested routes keep the parent tab active.
13
+ *
14
+ * @param id - Route identifier used to construct the URL.
15
+ * @param props - Remaining `NavItem` props forwarded to `TabItem`.
16
+ **/
17
+ declare const NavTab: ({ id, ...props }: Omit<NavItem, "isActive">) => import("react").JSX.Element;
18
+ type NavItem = {
19
+ id: string;
20
+ isActive: boolean;
21
+ };
22
+ export default NavTab;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_router_dom_1 = require("react-router-dom");
5
+ /**
6
+ * Tab Navigation Component.
7
+ *
8
+ * A `TabItem` wrapper that integrates with React Router.
9
+ * Derives active state from the current URL and renders a
10
+ * navigable tab using a router `<Link>`.
11
+ *
12
+ * Behavior:
13
+ * - Builds a route from the provided `id` (/[id]).
14
+ * - Marks tab as active when the pathname includes that route.
15
+ * - Delegates all visual rendering to `TabItem`.
16
+ * - Nested routes keep the parent tab active.
17
+ *
18
+ * @param id - Route identifier used to construct the URL.
19
+ * @param props - Remaining `NavItem` props forwarded to `TabItem`.
20
+ **/
21
+ const NavTab = ({ id, ...props }) => {
22
+ const location = (0, react_router_dom_1.useLocation)();
23
+ const route = "/" + id;
24
+ const isActive = location.pathname.includes(route);
25
+ return ((0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { to: route, children: (0, jsx_runtime_1.jsx)(Base, { isActive: isActive, ...props }) }));
26
+ };
27
+ function Base({ isActive }) {
28
+ return ((0, jsx_runtime_1.jsx)("div", { children: isActive }));
29
+ }
30
+ exports.default = NavTab;
@@ -0,0 +1,2 @@
1
+ export { default as BulletList } from "./variants/bullet";
2
+ export { default as NumberList } from "./variants/number";
@@ -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.NumberList = exports.BulletList = void 0;
7
+ var bullet_1 = require("./variants/bullet");
8
+ Object.defineProperty(exports, "BulletList", { enumerable: true, get: function () { return __importDefault(bullet_1).default; } });
9
+ var number_1 = require("./variants/number");
10
+ Object.defineProperty(exports, "NumberList", { enumerable: true, get: function () { return __importDefault(number_1).default; } });
@@ -0,0 +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.Element;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = Item;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const style_1 = require("@bouko/style");
6
+ ;
7
+ function Item({ marker, content, centerMarker, index }) {
8
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.cn)("flex items-start text-sm", centerMarker && "items-center"), children: [marker, content] }, index));
9
+ }
@@ -0,0 +1,14 @@
1
+ type Props<T> = {
2
+ style?: Styles;
3
+ placeholder?: string;
4
+ trigger?: React.ReactNode;
5
+ submit: (query: string) => void;
6
+ oops?: (x: string) => void;
7
+ };
8
+ type Styles = {
9
+ container?: string;
10
+ input?: string;
11
+ trigger?: string;
12
+ };
13
+ export declare function SearchBar<T>({ style, placeholder, trigger, submit, oops }: Props<T>): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,33 @@
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.SearchBar = SearchBar;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const react_1 = require("react");
10
+ const input_1 = __importDefault(require("../text/input"));
11
+ const fade_1 = __importDefault(require("../layout/fade"));
12
+ const flex_1 = require("../layout/flex");
13
+ const normal_1 = __importDefault(require("../button/normal"));
14
+ const style_1 = require("@bouko/style");
15
+ function SearchBar({ style = {}, placeholder, trigger, submit, oops = console.log }) {
16
+ const [query, setQuery] = (0, react_1.useState)("");
17
+ const styles = (0, style_1.mergeStyles)(base, style);
18
+ const search = async () => {
19
+ if (query === "")
20
+ return;
21
+ try {
22
+ await submit(query);
23
+ }
24
+ catch (err) {
25
+ oops(err.message);
26
+ }
27
+ };
28
+ return ((0, jsx_runtime_1.jsxs)(flex_1.RowBox, { style: styles.container, children: [(0, jsx_runtime_1.jsx)(fade_1.default, { style: "grow", gradient: "from-slate-950", children: (0, jsx_runtime_1.jsx)(input_1.default, { variant: "ghost", style: styles.input, placeholder: placeholder, value: query, update: setQuery, onEnter: search }) }), trigger && ((0, jsx_runtime_1.jsx)(normal_1.default, { variant: "ghost", style: style?.trigger, action: search, disabled: query === "", children: trigger }))] }));
29
+ }
30
+ const base = {
31
+ container: "items-center gap-3 sm:gap-5 w-xl max-w-full pl-4 sm:pl-5 pr-2 sm:pr-4 py-2 sm:py-3 bg-slate-950 border border-border rounded-md",
32
+ input: "text-base sm:text-lg tracking-wide"
33
+ };
@@ -0,0 +1,9 @@
1
+ import React, { 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): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,21 @@
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.default = BulletList;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const item_1 = __importDefault(require("../item"));
10
+ const style_1 = require("@bouko/style");
11
+ ;
12
+ function BulletList({ style, title, items, centerMarker }) {
13
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.cn)(styles.base, style), children: [!!title && (0, jsx_runtime_1.jsx)("span", { className: styles.title, children: title }), (0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(styles.base, style, !!title && "ml-2"), children: items.map((x, i) => ((0, jsx_runtime_1.jsx)(item_1.default, { marker: (0, jsx_runtime_1.jsx)(Marker, {}), content: x, index: i, centerMarker: centerMarker }, i))) })] }, title));
14
+ }
15
+ function Marker() {
16
+ return ((0, jsx_runtime_1.jsx)("span", { className: "mr-3 text-accent", children: "\u2022" }));
17
+ }
18
+ const styles = {
19
+ base: "flex flex-col gap-1 w-full",
20
+ title: "mb-1 text-base"
21
+ };
@@ -0,0 +1,10 @@
1
+ import React, { type ReactNode } from "react";
2
+ interface Props {
3
+ style?: string;
4
+ marker?: string;
5
+ title?: string;
6
+ items: ReactNode[];
7
+ centerMarker?: boolean;
8
+ }
9
+ export default function NumberList({ style, marker, title, items, centerMarker }: Props): React.JSX.Element;
10
+ export {};
@@ -0,0 +1,23 @@
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.default = NumberList;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const item_1 = __importDefault(require("../item"));
10
+ const style_1 = require("@bouko/style");
11
+ ;
12
+ function NumberList({ style, marker, title, items, centerMarker }) {
13
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, style_1.cn)(styles.base, style), children: [!!title && (0, jsx_runtime_1.jsx)("span", { className: styles.title, children: title }), (0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(styles.base, style, !!title && "ml-2"), children: items.map((x, i) => ((0, jsx_runtime_1.jsx)(item_1.default, { marker: (0, jsx_runtime_1.jsx)(Marker, { style: marker, x: i + 1 }), content: x, index: i, centerMarker: centerMarker }, i))) }, "content")] }, "list"));
14
+ }
15
+ function Marker({ style, x }) {
16
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(styles.marker, style), children: (0, jsx_runtime_1.jsx)("span", { className: styles.label, children: x }) }));
17
+ }
18
+ const styles = {
19
+ base: "flex flex-col gap-6 w-full text-primary-dark",
20
+ title: "mb-1 text-base text-primary",
21
+ marker: "flex justify-center items-center mt-1 mr-6 min-w-7 w-7 aspect-square bg-radial-[at_50%_75%] from-accent-light to-accent to-accent-dark to-90% border border-accent-darker rounded-full shadow-glow-soft",
22
+ label: "font-bold text-background-lighter select-none"
23
+ };
@@ -0,0 +1,9 @@
1
+ type Props = {
2
+ style?: string;
3
+ page: number;
4
+ prev: () => void;
5
+ next: () => void;
6
+ totalPages: number;
7
+ };
8
+ export default function Pagination({ style, page, prev, next, totalPages }: Props): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,21 @@
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 = Pagination;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const chevron_left_svg_1 = __importDefault(require("../../assets/icons/chevron-left.svg"));
9
+ const chevron_right_svg_1 = __importDefault(require("../../assets/icons/chevron-right.svg"));
10
+ const flex_1 = require("../layout/flex");
11
+ const normal_1 = require("../button/normal");
12
+ const style_1 = require("@bouko/style");
13
+ function Pagination({ style, page, prev, next, totalPages = 99 }) {
14
+ const canPrev = page > 1;
15
+ const canNext = totalPages > 0 ? page < totalPages : true;
16
+ return ((0, jsx_runtime_1.jsxs)(flex_1.RowBox, { style: (0, style_1.cn)(s.container, style), children: [(0, jsx_runtime_1.jsx)(normal_1.Button, { size: "xs", style: "rounded-none rounded-l-sm", action: prev, disabled: !canPrev, children: (0, jsx_runtime_1.jsx)(chevron_left_svg_1.default, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-px justify-center items-center w-11 h-6 px-2 bg-border-dark/20 border-y border-border-dark text-xs font-medium", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-primary", children: page }), "/", (0, jsx_runtime_1.jsx)("span", { className: "text-primary-darker", children: totalPages || 99 })] }), (0, jsx_runtime_1.jsx)(normal_1.Button, { size: "xs", style: "rounded-none rounded-r-sm", action: next, disabled: !canNext, children: (0, jsx_runtime_1.jsx)(chevron_right_svg_1.default, {}) })] }));
17
+ }
18
+ const s = {
19
+ container: "justify-center items-center text-primary-darker select-none",
20
+ subcontainer: "gap-2",
21
+ };
@@ -0,0 +1 @@
1
+ export { default as ProgressBar } from "./bar";
@@ -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.ProgressBar = void 0;
7
+ var bar_1 = require("./bar");
8
+ Object.defineProperty(exports, "ProgressBar", { enumerable: true, get: function () { return __importDefault(bar_1).default; } });
@@ -0,0 +1,4 @@
1
+ export default function ProgressBar({ value, style }: {
2
+ value: number;
3
+ style?: string;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = ProgressBar;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const style_1 = require("@bouko/style");
6
+ function ProgressBar({ value, style }) {
7
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(s.container, style), children: (0, jsx_runtime_1.jsx)("div", { className: s.filled, style: { width: (value * 100) + "%" } }) }));
8
+ }
9
+ const s = {
10
+ container: "flex grow h-1 rounded-full bg-surface overflow-hidden",
11
+ filled: "h-full bg-accent"
12
+ };
@@ -0,0 +1 @@
1
+ export { default as Table } from "./normal";
@@ -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.Table = void 0;
7
+ var normal_1 = require("./normal");
8
+ Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return __importDefault(normal_1).default; } });
@@ -0,0 +1,7 @@
1
+ type CellValue = string | number | null | undefined;
2
+ type Props<T> = {
3
+ columns: string[];
4
+ items: T[];
5
+ };
6
+ export default function Table<T extends Record<string, CellValue>>({ columns, items }: Props<T>): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.default = Table;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const flex_1 = require("../layout/flex");
7
+ const _1 = require("../button/_");
8
+ const ts_1 = require("@bouko/ts");
9
+ const style_1 = require("@bouko/style");
10
+ function Table({ columns, items }) {
11
+ return ((0, jsx_runtime_1.jsxs)(flex_1.ColumnBox, { style: s.table, children: [(0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: s.header, children: columns.map((x, i) => ((0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: (0, style_1.cn)(s.columnLabel, i === 0 ? "justify-start" : i === columns.length - 1 ? "justify-end" : "justify-center"), children: x }, i))) }), (0, jsx_runtime_1.jsx)(flex_1.ColumnBox, { style: s.rows, children: items.map((x, i) => ((0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: (0, style_1.cn)(s.row, i % 2 === 0 && "bg-surface", i === 0 ? "border-none" : i === items.length - 1 ? "border-none" : "border-b"), children: columns.map((key, j) => ((0, jsx_runtime_1.jsxs)(flex_1.RowBox, { style: (0, style_1.cn)(s.cell, j === 0 ? "justify-start" : j === columns.length - 1 ? "justify-end" : "justify-center"), children: [key === "id" ? (0, ts_1.shortenStr)(x[key]) : (x[key] ?? "N/A"), key === "id" && (0, jsx_runtime_1.jsx)(_1.CopyButton, { style: "text-primary-dark", value: (x["id"] || "N/A").toString() })] }, j))) }, i))) })] }));
12
+ }
13
+ const s = {
14
+ table: "grow w-full border border-border rounded-md overflow-hidden",
15
+ header: "w-full px-4 py-3 bg-background-light border-b border-border",
16
+ columnLabel: "flex-1 uppercase text-primary-dark font-light text-sm",
17
+ rows: "grow overflow-y-auto no-scrollbar",
18
+ row: "w-full px-4 py-4 border-b border-border",
19
+ cell: "flex-1 items-center gap-2"
20
+ };
@@ -0,0 +1,2 @@
1
+ export { default as Badge } from "./badge";
2
+ export { default as Input } from "./input";
@@ -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.Input = exports.Badge = void 0;
7
+ var badge_1 = require("./badge");
8
+ Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return __importDefault(badge_1).default; } });
9
+ var input_1 = require("./input");
10
+ Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return __importDefault(input_1).default; } });
@@ -0,0 +1,18 @@
1
+ import type { Component } from "../../utils";
2
+ type Props = Component & {
3
+ color?: string;
4
+ icon?: React.ReactNode;
5
+ size?: "xs" | "sm" | "md";
6
+ };
7
+ /**
8
+ * Color-themed badge component.
9
+ *
10
+ * To use a CSS variable it must exist and be passed in the
11
+ * form `--variable-name`. Any other format may cause unexpected
12
+ * results. CSS variables use 'color-mix' which is not supported in
13
+ * some old browsers such as Safari 15.3 and Internet Explorer.
14
+ *
15
+ * @param {string} color - Color of badge. (optional, default = accent)
16
+ **/
17
+ export declare function Badge({ style, color, size, icon, children }: Props): import("react").JSX.Element | null;
18
+ export default Badge;