@bouku/core 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
1
  type Props = {
2
+ style?: string;
2
3
  label: string;
3
4
  value?: string | number | null;
4
5
  units?: string;
5
6
  note?: string;
6
7
  };
7
- export declare const Card: ({ label, value, units, note }: Props) => import("react").JSX.Element;
8
- export default Card;
8
+ export declare const CalloutCard: ({ style, label, value, units, note }: Props) => import("react").JSX.Element;
9
+ export default CalloutCard;
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Card = void 0;
3
+ exports.CalloutCard = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const flex_1 = require("../container/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;
5
+ const _1 = require("../container/_");
6
+ const utils_1 = require("../../utils");
7
+ const CalloutCard = ({ style, label, value, units, note }) => ((0, jsx_runtime_1.jsxs)(_1.ColumnBox, { style: (0, utils_1.cn)(s.card, style), 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 })] }));
8
+ exports.CalloutCard = CalloutCard;
8
9
  const formatValue = (x) => {
9
10
  if (!x)
10
11
  return "N/A";
@@ -14,9 +15,9 @@ const formatValue = (x) => {
14
15
  return x.toLocaleString("en-US");
15
16
  };
16
17
  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"
18
+ card: "gap-1 flex-1 p-4 bg-surface border border-border rounded-md shadow hover:brightness-120 duration-200",
19
+ label: "text-sm font-mono text-primary-dark uppercase whitespace-nowrap",
20
+ value: "text-4xl font-bold whitespace-nowrap",
21
+ note: "text-xs text-primary-dark whitespace-nowrap"
21
22
  };
22
- exports.default = exports.Card;
23
+ exports.default = exports.CalloutCard;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
- const flex_1 = require("../container/flex");
4
+ const _1 = require("../container/_");
5
5
  const separator_1 = require("./separator");
6
- const style_1 = require("../../utils/functions/style");
6
+ const utils_1 = require("../../utils");
7
7
  /**
8
8
  * Layout Section Component.
9
9
  *
@@ -14,9 +14,11 @@ const style_1 = require("../../utils/functions/style");
14
14
  * @param title - The section title displayed at top.
15
15
  * @param content - Element(s) rendered below the separator.
16
16
  **/
17
- const Section = ({ style, title, children }) => ((0, jsx_runtime_1.jsxs)(flex_1.ColumnBox, { style: s.container, children: [(0, jsx_runtime_1.jsx)("span", { className: s.title, children: title }), (0, jsx_runtime_1.jsx)(separator_1.Separator, { style: "mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: (0, style_1.cn)(s.content, style), children: children })] }));
17
+ const Section = ({ style, title, children }) => ((0, jsx_runtime_1.jsxs)(_1.ColumnBox, { style: s.container, children: [(0, jsx_runtime_1.jsxs)(_1.RowBox, { style: s.header, children: [(0, jsx_runtime_1.jsx)("div", { className: s.marker }), (0, jsx_runtime_1.jsx)("span", { className: s.title, children: title })] }), (0, jsx_runtime_1.jsx)(separator_1.Separator, { style: "mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)(s.content, style), children: children })] }));
18
18
  const s = {
19
- container: "gap-3 w-full",
19
+ container: "relative gap-3 w-full",
20
+ header: "gap-3 items-center",
21
+ marker: "w-1 h-5 rounded bg-linear-to-t from-background to-accent",
20
22
  title: "text-xl font-bold text-primary",
21
23
  content: "w-full"
22
24
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouku/core",
4
- "version": "0.2.5",
4
+ "version": "0.2.7",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",