@bouku/core 0.2.5 → 0.2.6
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
|
|
8
|
-
export default
|
|
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.
|
|
3
|
+
exports.CalloutCard = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
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-
|
|
18
|
-
label: "text-sm font-mono
|
|
19
|
-
value: "text-
|
|
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.
|
|
23
|
+
exports.default = exports.CalloutCard;
|