@bouku/core 0.2.2 → 0.2.4

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 (139) hide show
  1. package/dist/components/button/_.d.ts +1 -0
  2. package/dist/components/button/_.js +3 -1
  3. package/dist/components/button/actions.d.ts +14 -0
  4. package/dist/components/button/actions.js +8 -0
  5. package/dist/components/container/_.d.ts +1 -1
  6. package/dist/components/container/_.js +2 -2
  7. package/dist/utils/hooks/state.d.ts +6 -1
  8. package/dist/utils/hooks/state.js +35 -6
  9. package/dist/utils/types/element.d.ts +5 -0
  10. package/package.json +7 -2
  11. package/dist/assets/styles/button.css +0 -76
  12. package/dist/components/accordion/index.d.ts +0 -6
  13. package/dist/components/accordion/index.js +0 -12
  14. package/dist/components/accordion/tab.d.ts +0 -4
  15. package/dist/components/accordion/tab.js +0 -35
  16. package/dist/components/dropdown/normal.d.ts +0 -10
  17. package/dist/components/dropdown/normal.js +0 -22
  18. package/dist/components/fade/_.d.ts +0 -1
  19. package/dist/components/fade/_.js +0 -8
  20. package/dist/components/fade/circle.d.ts +0 -10
  21. package/dist/components/fade/circle.js +0 -8
  22. package/dist/components/heading/_.d.ts +0 -2
  23. package/dist/components/heading/_.js +0 -10
  24. package/dist/components/heading/normal.d.ts +0 -24
  25. package/dist/components/heading/normal.js +0 -26
  26. package/dist/components/heading/page.d.ts +0 -25
  27. package/dist/components/heading/page.js +0 -26
  28. package/dist/components/information/_.d.ts +0 -1
  29. package/dist/components/information/_.js +0 -8
  30. package/dist/components/information/card.d.ts +0 -8
  31. package/dist/components/information/card.js +0 -22
  32. package/dist/components/layout/absolute.d.ts +0 -9
  33. package/dist/components/layout/absolute.js +0 -12
  34. package/dist/components/layout/fade.d.ts +0 -7
  35. package/dist/components/layout/fade.js +0 -20
  36. package/dist/components/layout/flex.d.ts +0 -17
  37. package/dist/components/layout/flex.js +0 -49
  38. package/dist/components/layout/media-row.d.ts +0 -15
  39. package/dist/components/layout/media-row.js +0 -11
  40. package/dist/components/layout/rnd.d.ts +0 -10
  41. package/dist/components/layout/rnd.js +0 -32
  42. package/dist/components/layout/scroll-box.d.ts +0 -14
  43. package/dist/components/layout/scroll-box.js +0 -11
  44. package/dist/components/pagination/index.d.ts +0 -9
  45. package/dist/components/pagination/index.js +0 -21
  46. package/dist/components/progress/_.d.ts +0 -1
  47. package/dist/components/progress/_.js +0 -8
  48. package/dist/components/progress/bar.d.ts +0 -4
  49. package/dist/components/progress/bar.js +0 -12
  50. package/dist/components/table/_.d.ts +0 -1
  51. package/dist/components/table/_.js +0 -8
  52. package/dist/components/table/header.d.ts +0 -10
  53. package/dist/components/table/header.js +0 -20
  54. package/dist/components/table/index.d.ts +0 -15
  55. package/dist/components/table/index.js +0 -37
  56. package/dist/components/table/normal.d.ts +0 -7
  57. package/dist/components/table/normal.js +0 -20
  58. package/dist/components/table/row.d.ts +0 -22
  59. package/dist/components/table/row.js +0 -40
  60. package/dist/components/table/sorter.d.ts +0 -10
  61. package/dist/components/table/sorter.js +0 -53
  62. package/dist/ui/button/_.d.ts +0 -2
  63. package/dist/ui/button/_.js +0 -10
  64. package/dist/ui/button/copy.d.ts +0 -6
  65. package/dist/ui/button/copy.js +0 -16
  66. package/dist/ui/button/normal.d.ts +0 -11
  67. package/dist/ui/button/normal.js +0 -48
  68. package/dist/ui/date/_.d.ts +0 -1
  69. package/dist/ui/date/_.js +0 -8
  70. package/dist/ui/date/time-ago.d.ts +0 -7
  71. package/dist/ui/date/time-ago.js +0 -13
  72. package/dist/ui/dropdown/normal.d.ts +0 -10
  73. package/dist/ui/dropdown/normal.js +0 -22
  74. package/dist/ui/fade/_.d.ts +0 -1
  75. package/dist/ui/fade/_.js +0 -8
  76. package/dist/ui/fade/circle.d.ts +0 -10
  77. package/dist/ui/fade/circle.js +0 -8
  78. package/dist/ui/heading/_.d.ts +0 -2
  79. package/dist/ui/heading/_.js +0 -10
  80. package/dist/ui/heading/normal.d.ts +0 -24
  81. package/dist/ui/heading/normal.js +0 -26
  82. package/dist/ui/heading/page.d.ts +0 -25
  83. package/dist/ui/heading/page.js +0 -26
  84. package/dist/ui/index.d.ts +0 -19
  85. package/dist/ui/index.js +0 -45
  86. package/dist/ui/information/_.d.ts +0 -1
  87. package/dist/ui/information/_.js +0 -8
  88. package/dist/ui/information/card.d.ts +0 -7
  89. package/dist/ui/information/card.js +0 -20
  90. package/dist/ui/layout/_.d.ts +0 -2
  91. package/dist/ui/layout/_.js +0 -10
  92. package/dist/ui/layout/absolute.d.ts +0 -9
  93. package/dist/ui/layout/absolute.js +0 -12
  94. package/dist/ui/layout/fade.d.ts +0 -7
  95. package/dist/ui/layout/fade.js +0 -20
  96. package/dist/ui/layout/flex.d.ts +0 -17
  97. package/dist/ui/layout/flex.js +0 -49
  98. package/dist/ui/layout/footer.d.ts +0 -15
  99. package/dist/ui/layout/footer.js +0 -13
  100. package/dist/ui/layout/media-row.d.ts +0 -15
  101. package/dist/ui/layout/media-row.js +0 -11
  102. package/dist/ui/layout/rnd.d.ts +0 -10
  103. package/dist/ui/layout/rnd.js +0 -32
  104. package/dist/ui/layout/scroll-box.d.ts +0 -14
  105. package/dist/ui/layout/scroll-box.js +0 -11
  106. package/dist/ui/layout/section.d.ts +0 -15
  107. package/dist/ui/layout/section.js +0 -19
  108. package/dist/ui/layout/separator.d.ts +0 -3
  109. package/dist/ui/layout/separator.js +0 -8
  110. package/dist/ui/link/_.d.ts +0 -1
  111. package/dist/ui/link/_.js +0 -8
  112. package/dist/ui/link/tab.d.ts +0 -22
  113. package/dist/ui/link/tab.js +0 -30
  114. package/dist/ui/list/index.d.ts +0 -2
  115. package/dist/ui/list/index.js +0 -10
  116. package/dist/ui/list/item.d.ts +0 -9
  117. package/dist/ui/list/item.js +0 -9
  118. package/dist/ui/list/search-bar.d.ts +0 -14
  119. package/dist/ui/list/search-bar.js +0 -33
  120. package/dist/ui/list/variants/bullet.d.ts +0 -9
  121. package/dist/ui/list/variants/bullet.js +0 -21
  122. package/dist/ui/list/variants/number.d.ts +0 -10
  123. package/dist/ui/list/variants/number.js +0 -23
  124. package/dist/ui/pagination/index.d.ts +0 -9
  125. package/dist/ui/pagination/index.js +0 -21
  126. package/dist/ui/progress/_.d.ts +0 -1
  127. package/dist/ui/progress/_.js +0 -8
  128. package/dist/ui/progress/bar.d.ts +0 -4
  129. package/dist/ui/progress/bar.js +0 -12
  130. package/dist/ui/table/_.d.ts +0 -1
  131. package/dist/ui/table/_.js +0 -8
  132. package/dist/ui/table/normal.d.ts +0 -7
  133. package/dist/ui/table/normal.js +0 -20
  134. package/dist/ui/text/_.d.ts +0 -2
  135. package/dist/ui/text/_.js +0 -10
  136. package/dist/ui/text/badge.d.ts +0 -18
  137. package/dist/ui/text/badge.js +0 -42
  138. package/dist/ui/text/input.d.ts +0 -39
  139. package/dist/ui/text/input.js +0 -50
@@ -10,3 +10,4 @@
10
10
  export { default as Button } from "./normal";
11
11
  export { default as CopyButton } from "./copy";
12
12
  export { default as FileUploader } from "./upload";
13
+ export { default as Actions } from "./actions";
@@ -12,11 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.FileUploader = exports.CopyButton = exports.Button = void 0;
15
+ exports.Actions = exports.FileUploader = exports.CopyButton = exports.Button = void 0;
16
16
  var normal_1 = require("./normal");
17
17
  Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return __importDefault(normal_1).default; } });
18
18
  var copy_1 = require("./copy");
19
19
  Object.defineProperty(exports, "CopyButton", { enumerable: true, get: function () { return __importDefault(copy_1).default; } });
20
20
  var upload_1 = require("./upload");
21
21
  Object.defineProperty(exports, "FileUploader", { enumerable: true, get: function () { return __importDefault(upload_1).default; } });
22
+ var actions_1 = require("./actions");
23
+ Object.defineProperty(exports, "Actions", { enumerable: true, get: function () { return __importDefault(actions_1).default; } });
22
24
  //
@@ -0,0 +1,14 @@
1
+ import { type ButtonProps } from "./normal";
2
+ type Props = {
3
+ style?: string;
4
+ size?: ButtonProps["size"];
5
+ items: Item[];
6
+ };
7
+ type Item = {
8
+ variant?: ButtonProps["variant"];
9
+ icon?: React.ReactNode;
10
+ action?: () => void;
11
+ children?: React.ReactNode;
12
+ };
13
+ declare const Actions: ({ style, size, items }: Props) => import("react").JSX.Element;
14
+ export default Actions;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const flex_1 = require("../container/flex");
5
+ const normal_1 = require("./normal");
6
+ const utils_1 = require("../../utils");
7
+ const Actions = ({ style, size = "md", items }) => ((0, jsx_runtime_1.jsx)(flex_1.RowBox, { style: (0, utils_1.cn)("gap-2 items-center", style), children: items.map(({ variant, icon, action, children }, i) => ((0, jsx_runtime_1.jsx)(normal_1.Button, { size: size, variant: variant, icon: icon, action: action, children: children }, i))) }));
8
+ exports.default = Actions;
@@ -1,5 +1,5 @@
1
1
  export { default as AbsoluteBox } from "./absolute";
2
2
  export { default as FadeBox } from "./fade";
3
- export { default as Rnd } from "./rnd";
3
+ export { default as RnD } from "./rnd";
4
4
  export { default as ScrollBox } from "./scroll";
5
5
  export * from "./flex";
@@ -17,13 +17,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.ScrollBox = exports.Rnd = exports.FadeBox = exports.AbsoluteBox = void 0;
20
+ exports.ScrollBox = exports.RnD = exports.FadeBox = exports.AbsoluteBox = void 0;
21
21
  var absolute_1 = require("./absolute");
22
22
  Object.defineProperty(exports, "AbsoluteBox", { enumerable: true, get: function () { return __importDefault(absolute_1).default; } });
23
23
  var fade_1 = require("./fade");
24
24
  Object.defineProperty(exports, "FadeBox", { enumerable: true, get: function () { return __importDefault(fade_1).default; } });
25
25
  var rnd_1 = require("./rnd");
26
- Object.defineProperty(exports, "Rnd", { enumerable: true, get: function () { return __importDefault(rnd_1).default; } });
26
+ Object.defineProperty(exports, "RnD", { enumerable: true, get: function () { return __importDefault(rnd_1).default; } });
27
27
  var scroll_1 = require("./scroll");
28
28
  Object.defineProperty(exports, "ScrollBox", { enumerable: true, get: function () { return __importDefault(scroll_1).default; } });
29
29
  __exportStar(require("./flex"), exports);
@@ -1,4 +1,9 @@
1
- export declare function useValue<T>(getValue: () => Promise<T>): T | null;
1
+ interface GetValueOptions<T> {
2
+ fetcher: () => Promise<T>;
3
+ callback?: () => void;
4
+ interval?: number;
5
+ }
6
+ export declare function useValue<T>({ fetcher, callback, interval }: GetValueOptions<T>): readonly [T | null | undefined, boolean];
2
7
  export declare function useList<T extends {
3
8
  id?: string;
4
9
  }>(initial?: T[]): {
@@ -4,13 +4,42 @@ exports.useValue = useValue;
4
4
  exports.useList = useList;
5
5
  exports.useMap = useMap;
6
6
  const react_1 = require("react");
7
- function useValue(getValue) {
8
- const [value, setValue] = (0, react_1.useState)(null);
7
+ function useValue({ fetcher, callback, interval }) {
8
+ const [value, setValue] = (0, react_1.useState)();
9
+ const [isLoading, setLoading] = (0, react_1.useState)(true);
10
+ const fetchValue = async (showLoading = false) => {
11
+ if (showLoading)
12
+ setLoading(true);
13
+ try {
14
+ console.log("fetching");
15
+ const result = await fetcher();
16
+ const nextValue = result ?? null;
17
+ setValue(current => Object.is(current, nextValue)
18
+ ? current
19
+ : nextValue);
20
+ }
21
+ catch (err) {
22
+ console.error(err);
23
+ }
24
+ finally {
25
+ if (showLoading)
26
+ setLoading(false);
27
+ }
28
+ };
29
+ (0, react_1.useEffect)(() => {
30
+ fetchValue(true);
31
+ }, []);
32
+ (0, react_1.useEffect)(() => {
33
+ if (!interval || value)
34
+ return;
35
+ const id = setInterval(() => fetchValue(), interval * 1000);
36
+ return () => clearInterval(id);
37
+ }, [interval, value]);
9
38
  (0, react_1.useEffect)(() => {
10
- if (!value)
11
- getValue().then(setValue);
12
- }, [value]);
13
- return value;
39
+ if (value && callback)
40
+ callback();
41
+ }, [value, callback]);
42
+ return [value, isLoading];
14
43
  }
15
44
  function useList(initial = []) {
16
45
  const [items, setItems] = (0, react_1.useState)(initial);
@@ -11,6 +11,11 @@ export type Component = {
11
11
  style?: string;
12
12
  children?: ReactNode;
13
13
  };
14
+ export type Clickable = Component & {
15
+ icon?: ReactNode;
16
+ action?: () => void;
17
+ disabled?: boolean;
18
+ };
14
19
  export type Hoverable = {
15
20
  onHover?: () => void;
16
21
  onLeave?: () => void;
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
+
2
3
  "name": "@bouku/core",
3
- "version": "0.2.2",
4
+ "version": "0.2.4",
4
5
  "main": "./dist/index.js",
5
6
  "types": "./dist/index.d.ts",
6
7
  "license": "MIT",
@@ -20,9 +21,11 @@
20
21
  "./styles.css": "./dist/styles.css"
21
22
  },
22
23
  "engines": {},
24
+
23
25
  "scripts": {
24
26
  "build": "tsc"
25
27
  },
28
+
26
29
  "dependencies": {
27
30
  "clsx": "^2.1.1",
28
31
  "framer-motion": "^12.23.6",
@@ -33,6 +36,7 @@
33
36
  "tailwind-variants": "^1.0.0",
34
37
  "ts-helper-kit": "^0.0.9"
35
38
  },
39
+
36
40
  "devDependencies": {
37
41
  "@types/node": "^24.3.1",
38
42
  "@types/react": "^19.1.10",
@@ -42,4 +46,5 @@
42
46
  "react-router-dom": "^7.12.0",
43
47
  "typescript": "^5.9.2"
44
48
  }
45
- }
49
+
50
+ }
@@ -1,76 +0,0 @@
1
- .test-button::before {
2
- content: "";
3
- display: block;
4
- position: absolute;
5
- top: 0;
6
- left: 0;
7
- width: 100%;
8
- height: 100%;
9
- background:
10
- linear-gradient(
11
- 180deg,
12
- rgba(20, 60, 140, 0) 0%,
13
- rgba(20, 60, 140, .32) 100%
14
- ),
15
- rgba(60, 120, 255, .12);
16
- border-radius: inherit;
17
- box-shadow: inset 0 0 12px #7fb0ff3d;
18
- transition: .2s opacity cubic-bezier(.6, .6, 0, 1);
19
- z-index: -1;
20
- }
21
-
22
- .test-button::after {
23
- content: "";
24
- display: block;
25
- position: absolute;
26
- top: 0;
27
- left: 0;
28
- width: 100%;
29
- height: 100%;
30
- background:
31
- linear-gradient(
32
- 180deg,
33
- rgba(20, 60, 140, 0) 0%,
34
- rgba(20, 60, 140, .42) 100%
35
- ),
36
- rgba(60, 120, 255, .24);
37
- border-radius: inherit;
38
- box-shadow: inset 0 0 12px #7fb0ff70;
39
- transition: .2s opacity cubic-bezier(.6, .6, 0, 1);
40
- opacity: 0;
41
- z-index: -1;
42
- }
43
-
44
- .test-button-border {
45
- position: absolute;
46
- top: 0;
47
- left: 0;
48
- width: 100%;
49
- height: 100%;
50
- border-radius: inherit;
51
- z-index: -1;
52
- }
53
-
54
- .test-button-border::before {
55
- content: "";
56
- position: absolute;
57
- inset: 0;
58
- padding: 1px;
59
- background:
60
- linear-gradient(
61
- 180deg,
62
- rgba(180, 210, 255, .24) 0%,
63
- rgba(180, 210, 255, 0) 100%
64
- ),
65
- linear-gradient(
66
- 0deg,
67
- rgba(180, 210, 255, .32),
68
- rgba(180, 210, 255, .32)
69
- );
70
- border-radius: inherit;
71
- mask:
72
- linear-gradient(#fff 0 0) content-box,
73
- linear-gradient(#fff 0 0);
74
- mask-composite: exclude;
75
- pointer-events: none;
76
- }
@@ -1,6 +0,0 @@
1
- export default function Accordion({ items }: {
2
- items: {
3
- label: string;
4
- content: React.ReactNode;
5
- }[];
6
- }): import("react").JSX.Element;
@@ -1,12 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.default = 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
- }
@@ -1,4 +0,0 @@
1
- export declare function SectionHeader({ isActive, label }: {
2
- isActive: boolean;
3
- label: string;
4
- }): import("react").JSX.Element;
@@ -1,35 +0,0 @@
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
- });
@@ -1,10 +0,0 @@
1
- import { ReactNode } from "react";
2
- type Option = {
3
- label: ReactNode;
4
- action: () => void;
5
- };
6
- export default function Dropdown({ options, children }: {
7
- options: Option[];
8
- children: ReactNode;
9
- }): import("react").JSX.Element;
10
- export {};
@@ -1,22 +0,0 @@
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
- };
@@ -1 +0,0 @@
1
- export { default as CircleFade } from "./circle";
@@ -1,8 +0,0 @@
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; } });
@@ -1,10 +0,0 @@
1
- type Props = {
2
- className?: string;
3
- style?: {
4
- top?: string;
5
- left?: string;
6
- transform?: string;
7
- };
8
- };
9
- export default function CircleFade({ className, style }: Props): import("react").JSX.Element;
10
- export {};
@@ -1,8 +0,0 @@
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("../../utils/functions/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
- }
@@ -1,2 +0,0 @@
1
- export { default as Heading } from "./normal";
2
- export { default as PageHeading } from "./page";
@@ -1,10 +0,0 @@
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; } });
@@ -1,24 +0,0 @@
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 {};
@@ -1,26 +0,0 @@
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("../../utils/functions/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-2xl sm:text-3xl 2xl:text-4xl 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
- };
@@ -1,25 +0,0 @@
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 {};
@@ -1,26 +0,0 @@
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("../../utils/functions/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
- };
@@ -1 +0,0 @@
1
- export { default as Card } from "./card";
@@ -1,8 +0,0 @@
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; } });
@@ -1,8 +0,0 @@
1
- type Props = {
2
- label: string;
3
- value?: string | number | null;
4
- units?: string;
5
- note?: string;
6
- };
7
- export declare const Card: ({ label, value, units, note }: Props) => import("react").JSX.Element;
8
- export default Card;
@@ -1,22 +0,0 @@
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, units, 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.jsxs)("span", { className: s.value, children: [formatValue(value), " ", units] }), (0, jsx_runtime_1.jsx)("span", { className: s.note, children: note })] }));
7
- exports.Card = Card;
8
- const formatValue = (x) => {
9
- if (!x)
10
- return "N/A";
11
- if (typeof x === "string")
12
- return x;
13
- else if (typeof x === "number")
14
- return x.toLocaleString("en-US");
15
- };
16
- const s = {
17
- card: "gap-2 flex-1 p-5 bg-surface border border-border-light rounded-md shadow hover:brightness-120 duration-200",
18
- label: "text-sm font-mono tracking-wide text-primary-dark uppercase",
19
- value: "text-5xl font-bold",
20
- note: "text-xs text-primary-dark"
21
- };
22
- exports.default = exports.Card;
@@ -1,9 +0,0 @@
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 {};
@@ -1,12 +0,0 @@
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("../../utils/functions/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
- };
@@ -1,7 +0,0 @@
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;
@@ -1,20 +0,0 @@
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("../../utils/functions/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;
@@ -1,17 +0,0 @@
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 {};