mogh_ui 0.1.0
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/color.cjs +62 -0
- package/dist/color.cjs.map +1 -0
- package/dist/color.d.cts +5 -0
- package/dist/color.d.ts +5 -0
- package/dist/color.js +37 -0
- package/dist/color.js.map +1 -0
- package/dist/components/back-button.cjs +43 -0
- package/dist/components/back-button.cjs.map +1 -0
- package/dist/components/back-button.d.cts +9 -0
- package/dist/components/back-button.d.ts +9 -0
- package/dist/components/back-button.js +19 -0
- package/dist/components/back-button.js.map +1 -0
- package/dist/components/config/confirm.cjs +191 -0
- package/dist/components/config/confirm.cjs.map +1 -0
- package/dist/components/config/confirm.d.cts +20 -0
- package/dist/components/config/confirm.d.ts +20 -0
- package/dist/components/config/confirm.js +167 -0
- package/dist/components/config/confirm.js.map +1 -0
- package/dist/components/config/group.cjs +102 -0
- package/dist/components/config/group.cjs.map +1 -0
- package/dist/components/config/group.d.cts +11 -0
- package/dist/components/config/group.d.ts +11 -0
- package/dist/components/config/group.js +78 -0
- package/dist/components/config/group.js.map +1 -0
- package/dist/components/config/index.cjs +237 -0
- package/dist/components/config/index.cjs.map +1 -0
- package/dist/components/config/index.d.cts +62 -0
- package/dist/components/config/index.d.ts +62 -0
- package/dist/components/config/index.js +217 -0
- package/dist/components/config/index.js.map +1 -0
- package/dist/components/config/item.cjs +139 -0
- package/dist/components/config/item.cjs.map +1 -0
- package/dist/components/config/item.d.cts +45 -0
- package/dist/components/config/item.d.ts +45 -0
- package/dist/components/config/item.js +119 -0
- package/dist/components/config/item.js.map +1 -0
- package/dist/components/config/layout.cjs +44 -0
- package/dist/components/config/layout.cjs.map +1 -0
- package/dist/components/config/layout.d.cts +11 -0
- package/dist/components/config/layout.d.ts +11 -0
- package/dist/components/config/layout.js +20 -0
- package/dist/components/config/layout.js.map +1 -0
- package/dist/components/config/unsaved-changes.cjs +47 -0
- package/dist/components/config/unsaved-changes.cjs.map +1 -0
- package/dist/components/config/unsaved-changes.d.cts +7 -0
- package/dist/components/config/unsaved-changes.d.ts +7 -0
- package/dist/components/config/unsaved-changes.js +23 -0
- package/dist/components/config/unsaved-changes.js.map +1 -0
- package/dist/components/confirm-button.cjs +85 -0
- package/dist/components/confirm-button.cjs.map +1 -0
- package/dist/components/confirm-button.d.cts +23 -0
- package/dist/components/confirm-button.d.ts +23 -0
- package/dist/components/confirm-button.js +69 -0
- package/dist/components/confirm-button.js.map +1 -0
- package/dist/components/confirm-icon.cjs +70 -0
- package/dist/components/confirm-icon.cjs.map +1 -0
- package/dist/components/confirm-icon.d.cts +20 -0
- package/dist/components/confirm-icon.d.ts +20 -0
- package/dist/components/confirm-icon.js +54 -0
- package/dist/components/confirm-icon.js.map +1 -0
- package/dist/components/confirm-modal.cjs +146 -0
- package/dist/components/confirm-modal.cjs.map +1 -0
- package/dist/components/confirm-modal.d.cts +25 -0
- package/dist/components/confirm-modal.d.ts +25 -0
- package/dist/components/confirm-modal.js +130 -0
- package/dist/components/confirm-modal.js.map +1 -0
- package/dist/components/copy-button.cjs +68 -0
- package/dist/components/copy-button.cjs.map +1 -0
- package/dist/components/copy-button.d.cts +15 -0
- package/dist/components/copy-button.d.ts +15 -0
- package/dist/components/copy-button.js +46 -0
- package/dist/components/copy-button.js.map +1 -0
- package/dist/components/copy-text.cjs +63 -0
- package/dist/components/copy-text.cjs.map +1 -0
- package/dist/components/copy-text.d.cts +11 -0
- package/dist/components/copy-text.d.ts +11 -0
- package/dist/components/copy-text.js +39 -0
- package/dist/components/copy-text.js.map +1 -0
- package/dist/components/create-modal.cjs +100 -0
- package/dist/components/create-modal.cjs.map +1 -0
- package/dist/components/create-modal.d.cts +18 -0
- package/dist/components/create-modal.d.ts +18 -0
- package/dist/components/create-modal.js +82 -0
- package/dist/components/create-modal.js.map +1 -0
- package/dist/components/data-table.cjs +240 -0
- package/dist/components/data-table.cjs.map +1 -0
- package/dist/components/data-table.d.cts +36 -0
- package/dist/components/data-table.d.ts +36 -0
- package/dist/components/data-table.js +233 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/divided-children/index.cjs +53 -0
- package/dist/components/divided-children/index.cjs.map +1 -0
- package/dist/components/divided-children/index.d.cts +15 -0
- package/dist/components/divided-children/index.d.ts +15 -0
- package/dist/components/divided-children/index.js +19 -0
- package/dist/components/divided-children/index.js.map +1 -0
- package/dist/components/divided-children/index.module.scss +4 -0
- package/dist/components/enable-switch.cjs +67 -0
- package/dist/components/enable-switch.cjs.map +1 -0
- package/dist/components/enable-switch.d.cts +12 -0
- package/dist/components/enable-switch.d.ts +12 -0
- package/dist/components/enable-switch.js +43 -0
- package/dist/components/enable-switch.js.map +1 -0
- package/dist/components/entity-header.cjs +137 -0
- package/dist/components/entity-header.cjs.map +1 -0
- package/dist/components/entity-header.d.cts +20 -0
- package/dist/components/entity-header.d.ts +20 -0
- package/dist/components/entity-header.js +113 -0
- package/dist/components/entity-header.js.map +1 -0
- package/dist/components/entity-page.cjs +45 -0
- package/dist/components/entity-page.cjs.map +1 -0
- package/dist/components/entity-page.d.cts +11 -0
- package/dist/components/entity-page.d.ts +11 -0
- package/dist/components/entity-page.js +21 -0
- package/dist/components/entity-page.js.map +1 -0
- package/dist/components/fancy-card/index.cjs +52 -0
- package/dist/components/fancy-card/index.cjs.map +1 -0
- package/dist/components/fancy-card/index.d.cts +17 -0
- package/dist/components/fancy-card/index.d.ts +17 -0
- package/dist/components/fancy-card/index.js +18 -0
- package/dist/components/fancy-card/index.js.map +1 -0
- package/dist/components/fancy-card/index.module.scss +13 -0
- package/dist/components/hover-error.cjs +60 -0
- package/dist/components/hover-error.cjs.map +1 -0
- package/dist/components/hover-error.d.cts +9 -0
- package/dist/components/hover-error.d.ts +9 -0
- package/dist/components/hover-error.js +36 -0
- package/dist/components/hover-error.js.map +1 -0
- package/dist/components/info-card.cjs +44 -0
- package/dist/components/info-card.cjs.map +1 -0
- package/dist/components/info-card.d.cts +21 -0
- package/dist/components/info-card.d.ts +21 -0
- package/dist/components/info-card.js +25 -0
- package/dist/components/info-card.js.map +1 -0
- package/dist/components/input-list.cjs +68 -0
- package/dist/components/input-list.cjs.map +1 -0
- package/dist/components/input-list.d.cts +14 -0
- package/dist/components/input-list.d.ts +14 -0
- package/dist/components/input-list.js +44 -0
- package/dist/components/input-list.js.map +1 -0
- package/dist/components/labelled-switch.cjs +68 -0
- package/dist/components/labelled-switch.cjs.map +1 -0
- package/dist/components/labelled-switch.d.cts +14 -0
- package/dist/components/labelled-switch.d.ts +14 -0
- package/dist/components/labelled-switch.js +48 -0
- package/dist/components/labelled-switch.js.map +1 -0
- package/dist/components/labels-group.cjs +44 -0
- package/dist/components/labels-group.cjs.map +1 -0
- package/dist/components/labels-group.d.cts +10 -0
- package/dist/components/labels-group.d.ts +10 -0
- package/dist/components/labels-group.js +20 -0
- package/dist/components/labels-group.js.map +1 -0
- package/dist/components/loading-screen.cjs +37 -0
- package/dist/components/loading-screen.cjs.map +1 -0
- package/dist/components/loading-screen.d.cts +8 -0
- package/dist/components/loading-screen.d.ts +8 -0
- package/dist/components/loading-screen.js +13 -0
- package/dist/components/loading-screen.js.map +1 -0
- package/dist/components/mobile-friendly-tabs.cjs +141 -0
- package/dist/components/mobile-friendly-tabs.cjs.map +1 -0
- package/dist/components/mobile-friendly-tabs.d.cts +43 -0
- package/dist/components/mobile-friendly-tabs.d.ts +43 -0
- package/dist/components/mobile-friendly-tabs.js +120 -0
- package/dist/components/mobile-friendly-tabs.js.map +1 -0
- package/dist/components/monaco/index.cjs +244 -0
- package/dist/components/monaco/index.cjs.map +1 -0
- package/dist/components/monaco/index.d.cts +32 -0
- package/dist/components/monaco/index.d.ts +32 -0
- package/dist/components/monaco/index.js +208 -0
- package/dist/components/monaco/index.js.map +1 -0
- package/dist/components/monaco/index.scss +3 -0
- package/dist/components/monaco/init.cjs +73 -0
- package/dist/components/monaco/init.cjs.map +1 -0
- package/dist/components/monaco/init.d.cts +2 -0
- package/dist/components/monaco/init.d.ts +2 -0
- package/dist/components/monaco/init.js +49 -0
- package/dist/components/monaco/init.js.map +1 -0
- package/dist/components/monaco/syntax/fancy_toml.cjs +241 -0
- package/dist/components/monaco/syntax/fancy_toml.cjs.map +1 -0
- package/dist/components/monaco/syntax/fancy_toml.d.cts +2 -0
- package/dist/components/monaco/syntax/fancy_toml.d.ts +2 -0
- package/dist/components/monaco/syntax/fancy_toml.js +218 -0
- package/dist/components/monaco/syntax/fancy_toml.js.map +1 -0
- package/dist/components/monaco/syntax/key_value.cjs +107 -0
- package/dist/components/monaco/syntax/key_value.cjs.map +1 -0
- package/dist/components/monaco/syntax/key_value.d.cts +2 -0
- package/dist/components/monaco/syntax/key_value.d.ts +2 -0
- package/dist/components/monaco/syntax/key_value.js +84 -0
- package/dist/components/monaco/syntax/key_value.js.map +1 -0
- package/dist/components/monaco/syntax/shell.cjs +246 -0
- package/dist/components/monaco/syntax/shell.cjs.map +1 -0
- package/dist/components/monaco/syntax/shell.d.cts +2 -0
- package/dist/components/monaco/syntax/shell.d.ts +2 -0
- package/dist/components/monaco/syntax/shell.js +223 -0
- package/dist/components/monaco/syntax/shell.js.map +1 -0
- package/dist/components/monaco/syntax/string_list.cjs +75 -0
- package/dist/components/monaco/syntax/string_list.cjs.map +1 -0
- package/dist/components/monaco/syntax/string_list.d.cts +2 -0
- package/dist/components/monaco/syntax/string_list.d.ts +2 -0
- package/dist/components/monaco/syntax/string_list.js +52 -0
- package/dist/components/monaco/syntax/string_list.js.map +1 -0
- package/dist/components/monaco/syntax/toml.cjs +157 -0
- package/dist/components/monaco/syntax/toml.cjs.map +1 -0
- package/dist/components/monaco/syntax/toml.d.cts +2 -0
- package/dist/components/monaco/syntax/toml.d.ts +2 -0
- package/dist/components/monaco/syntax/toml.js +134 -0
- package/dist/components/monaco/syntax/toml.js.map +1 -0
- package/dist/components/monaco/syntax/yaml.cjs +250 -0
- package/dist/components/monaco/syntax/yaml.cjs.map +1 -0
- package/dist/components/monaco/syntax/yaml.d.cts +2 -0
- package/dist/components/monaco/syntax/yaml.d.ts +2 -0
- package/dist/components/monaco/syntax/yaml.js +227 -0
- package/dist/components/monaco/syntax/yaml.js.map +1 -0
- package/dist/components/monaco/theme.cjs +721 -0
- package/dist/components/monaco/theme.cjs.map +1 -0
- package/dist/components/monaco/theme.d.cts +2 -0
- package/dist/components/monaco/theme.d.ts +2 -0
- package/dist/components/monaco/theme.js +698 -0
- package/dist/components/monaco/theme.js.map +1 -0
- package/dist/components/page-guard.cjs +44 -0
- package/dist/components/page-guard.cjs.map +1 -0
- package/dist/components/page-guard.d.cts +13 -0
- package/dist/components/page-guard.d.ts +13 -0
- package/dist/components/page-guard.js +20 -0
- package/dist/components/page-guard.js.map +1 -0
- package/dist/components/page.cjs +81 -0
- package/dist/components/page.cjs.map +1 -0
- package/dist/components/page.d.cts +31 -0
- package/dist/components/page.d.ts +31 -0
- package/dist/components/page.js +63 -0
- package/dist/components/page.js.map +1 -0
- package/dist/components/search-input.cjs +51 -0
- package/dist/components/search-input.cjs.map +1 -0
- package/dist/components/search-input.d.cts +9 -0
- package/dist/components/search-input.d.ts +9 -0
- package/dist/components/search-input.js +27 -0
- package/dist/components/search-input.js.map +1 -0
- package/dist/components/section.cjs +100 -0
- package/dist/components/section.cjs.map +1 -0
- package/dist/components/section.d.cts +33 -0
- package/dist/components/section.d.ts +33 -0
- package/dist/components/section.js +83 -0
- package/dist/components/section.js.map +1 -0
- package/dist/components/shared-text-update.cjs +83 -0
- package/dist/components/shared-text-update.cjs.map +1 -0
- package/dist/components/shared-text-update.d.cts +20 -0
- package/dist/components/shared-text-update.d.ts +20 -0
- package/dist/components/shared-text-update.js +65 -0
- package/dist/components/shared-text-update.js.map +1 -0
- package/dist/components/show-hide-button.cjs +48 -0
- package/dist/components/show-hide-button.cjs.map +1 -0
- package/dist/components/show-hide-button.d.cts +8 -0
- package/dist/components/show-hide-button.d.ts +8 -0
- package/dist/components/show-hide-button.js +24 -0
- package/dist/components/show-hide-button.js.map +1 -0
- package/dist/components/stat-bar.cjs +68 -0
- package/dist/components/stat-bar.cjs.map +1 -0
- package/dist/components/stat-bar.d.cts +15 -0
- package/dist/components/stat-bar.d.ts +15 -0
- package/dist/components/stat-bar.js +44 -0
- package/dist/components/stat-bar.js.map +1 -0
- package/dist/components/stat-cell.cjs +72 -0
- package/dist/components/stat-cell.cjs.map +1 -0
- package/dist/components/stat-cell.d.cts +17 -0
- package/dist/components/stat-cell.d.ts +17 -0
- package/dist/components/stat-cell.js +54 -0
- package/dist/components/stat-cell.js.map +1 -0
- package/dist/components/status-badge.cjs +63 -0
- package/dist/components/status-badge.cjs.map +1 -0
- package/dist/components/status-badge.d.cts +20 -0
- package/dist/components/status-badge.d.ts +20 -0
- package/dist/components/status-badge.js +39 -0
- package/dist/components/status-badge.js.map +1 -0
- package/dist/components/tabbed-page.cjs +64 -0
- package/dist/components/tabbed-page.cjs.map +1 -0
- package/dist/components/tabbed-page.d.cts +18 -0
- package/dist/components/tabbed-page.d.ts +18 -0
- package/dist/components/tabbed-page.js +40 -0
- package/dist/components/tabbed-page.js.map +1 -0
- package/dist/components/table-skeleton.cjs +36 -0
- package/dist/components/table-skeleton.cjs.map +1 -0
- package/dist/components/table-skeleton.d.cts +8 -0
- package/dist/components/table-skeleton.d.ts +8 -0
- package/dist/components/table-skeleton.js +12 -0
- package/dist/components/table-skeleton.js.map +1 -0
- package/dist/components/text-update-modal.cjs +102 -0
- package/dist/components/text-update-modal.cjs.map +1 -0
- package/dist/components/text-update-modal.d.cts +19 -0
- package/dist/components/text-update-modal.d.ts +19 -0
- package/dist/components/text-update-modal.js +85 -0
- package/dist/components/text-update-modal.js.map +1 -0
- package/dist/components/theme-toggle.cjs +73 -0
- package/dist/components/theme-toggle.cjs.map +1 -0
- package/dist/components/theme-toggle.d.cts +5 -0
- package/dist/components/theme-toggle.d.ts +5 -0
- package/dist/components/theme-toggle.js +54 -0
- package/dist/components/theme-toggle.js.map +1 -0
- package/dist/formatting.cjs +124 -0
- package/dist/formatting.cjs.map +1 -0
- package/dist/formatting.d.cts +14 -0
- package/dist/formatting.d.ts +14 -0
- package/dist/formatting.js +89 -0
- package/dist/formatting.js.map +1 -0
- package/dist/hooks.cjs +117 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.cts +30 -0
- package/dist/hooks.d.ts +30 -0
- package/dist/hooks.js +88 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.cjs +99 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +47 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/index.scss +81 -0
- package/dist/theme.cjs +332 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +15 -0
- package/dist/theme.d.ts +15 -0
- package/dist/theme.js +330 -0
- package/dist/theme.js.map +1 -0
- package/dist/theme.scss +76 -0
- package/dist/utils.cjs +48 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +15 -0
- package/dist/utils.d.ts +15 -0
- package/dist/utils.js +24 -0
- package/dist/utils.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var stat_cell_exports = {};
|
|
20
|
+
__export(stat_cell_exports, {
|
|
21
|
+
StatCell: () => StatCell
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(stat_cell_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_color = require("../color");
|
|
26
|
+
var import_core = require("@mantine/core");
|
|
27
|
+
var import_lucide_react = require("lucide-react");
|
|
28
|
+
function StatCell({
|
|
29
|
+
value,
|
|
30
|
+
intent,
|
|
31
|
+
textProps,
|
|
32
|
+
barProps,
|
|
33
|
+
info,
|
|
34
|
+
infoPosition = "left-start",
|
|
35
|
+
infoDisabled,
|
|
36
|
+
...groupProps
|
|
37
|
+
}) {
|
|
38
|
+
const ProgressComponent = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
import_core.Progress,
|
|
40
|
+
{
|
|
41
|
+
value: value ?? 0,
|
|
42
|
+
color: (0, import_color.hexColorByIntention)(intent),
|
|
43
|
+
w: 200,
|
|
44
|
+
size: "xl",
|
|
45
|
+
...barProps
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Group, { gap: "xs", justify: "space-between", wrap: "nowrap", ...groupProps, children: [
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_core.Text,
|
|
51
|
+
{
|
|
52
|
+
w: 64,
|
|
53
|
+
c: value === void 0 ? "dimmed" : void 0,
|
|
54
|
+
...textProps,
|
|
55
|
+
children: value === void 0 ? "N/A" : value.toFixed(1) + "%"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
!info && ProgressComponent,
|
|
59
|
+
info && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.HoverCard, { position: infoPosition, disabled: infoDisabled, children: [
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.HoverCard.Target, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Group, { gap: "xs", wrap: "nowrap", children: [
|
|
61
|
+
ProgressComponent,
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ActionIcon, { variant: "subtle", disabled: infoDisabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Info, { size: "1rem" }) })
|
|
63
|
+
] }) }),
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.HoverCard.Dropdown, { children: info })
|
|
65
|
+
] })
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
+
0 && (module.exports = {
|
|
70
|
+
StatCell
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=stat-cell.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/stat-cell.tsx"],"sourcesContent":["import { ColorIntention, hexColorByIntention } from \"../color\";\nimport {\n ActionIcon,\n FloatingPosition,\n Group,\n GroupProps,\n HoverCard,\n Progress,\n ProgressProps,\n Text,\n TextProps,\n} from \"@mantine/core\";\nimport { ReactNode } from \"react\";\nimport { Info } from \"lucide-react\";\n\nexport interface StatCellProps extends GroupProps {\n value: number | undefined;\n intent: ColorIntention;\n textProps?: TextProps;\n barProps?: ProgressProps;\n info?: ReactNode;\n infoPosition?: FloatingPosition;\n infoDisabled?: boolean;\n}\n\nexport function StatCell({\n value,\n intent,\n textProps,\n barProps,\n info,\n infoPosition = \"left-start\",\n infoDisabled,\n ...groupProps\n}: StatCellProps) {\n const ProgressComponent = (\n <Progress\n value={value ?? 0}\n color={hexColorByIntention(intent)}\n w={200}\n size=\"xl\"\n {...barProps}\n />\n );\n return (\n <Group gap=\"xs\" justify=\"space-between\" wrap=\"nowrap\" {...groupProps}>\n <Text\n w={64}\n c={value === undefined ? \"dimmed\" : undefined}\n {...textProps}\n >\n {value === undefined ? \"N/A\" : value.toFixed(1) + \"%\"}\n </Text>\n {!info && ProgressComponent}\n {info && (\n <HoverCard position={infoPosition} disabled={infoDisabled}>\n <HoverCard.Target>\n <Group gap=\"xs\" wrap=\"nowrap\">\n {ProgressComponent}\n <ActionIcon variant=\"subtle\" disabled={infoDisabled}>\n <Info size=\"1rem\" />\n </ActionIcon>\n </Group>\n </HoverCard.Target>\n <HoverCard.Dropdown>{info}</HoverCard.Dropdown>\n </HoverCard>\n )}\n </Group>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCI;AApCJ,mBAAoD;AACpD,kBAUO;AAEP,0BAAqB;AAYd,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,QAAM,oBACJ;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,SAAS;AAAA,MAChB,WAAO,kCAAoB,MAAM;AAAA,MACjC,GAAG;AAAA,MACH,MAAK;AAAA,MACJ,GAAG;AAAA;AAAA,EACN;AAEF,SACE,6CAAC,qBAAM,KAAI,MAAK,SAAQ,iBAAgB,MAAK,UAAU,GAAG,YACxD;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,GAAG;AAAA,QACH,GAAG,UAAU,SAAY,WAAW;AAAA,QACnC,GAAG;AAAA,QAEH,oBAAU,SAAY,QAAQ,MAAM,QAAQ,CAAC,IAAI;AAAA;AAAA,IACpD;AAAA,IACC,CAAC,QAAQ;AAAA,IACT,QACC,6CAAC,yBAAU,UAAU,cAAc,UAAU,cAC3C;AAAA,kDAAC,sBAAU,QAAV,EACC,uDAAC,qBAAM,KAAI,MAAK,MAAK,UAClB;AAAA;AAAA,QACD,4CAAC,0BAAW,SAAQ,UAAS,UAAU,cACrC,sDAAC,4BAAK,MAAK,QAAO,GACpB;AAAA,SACF,GACF;AAAA,MACA,4CAAC,sBAAU,UAAV,EAAoB,gBAAK;AAAA,OAC5B;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ColorIntention } from '../color.cjs';
|
|
3
|
+
import { GroupProps, TextProps, ProgressProps, FloatingPosition } from '@mantine/core';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
interface StatCellProps extends GroupProps {
|
|
7
|
+
value: number | undefined;
|
|
8
|
+
intent: ColorIntention;
|
|
9
|
+
textProps?: TextProps;
|
|
10
|
+
barProps?: ProgressProps;
|
|
11
|
+
info?: ReactNode;
|
|
12
|
+
infoPosition?: FloatingPosition;
|
|
13
|
+
infoDisabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function StatCell({ value, intent, textProps, barProps, info, infoPosition, infoDisabled, ...groupProps }: StatCellProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { StatCell, type StatCellProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ColorIntention } from '../color.js';
|
|
3
|
+
import { GroupProps, TextProps, ProgressProps, FloatingPosition } from '@mantine/core';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
interface StatCellProps extends GroupProps {
|
|
7
|
+
value: number | undefined;
|
|
8
|
+
intent: ColorIntention;
|
|
9
|
+
textProps?: TextProps;
|
|
10
|
+
barProps?: ProgressProps;
|
|
11
|
+
info?: ReactNode;
|
|
12
|
+
infoPosition?: FloatingPosition;
|
|
13
|
+
infoDisabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function StatCell({ value, intent, textProps, barProps, info, infoPosition, infoDisabled, ...groupProps }: StatCellProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { StatCell, type StatCellProps };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { hexColorByIntention } from "../color";
|
|
3
|
+
import {
|
|
4
|
+
ActionIcon,
|
|
5
|
+
Group,
|
|
6
|
+
HoverCard,
|
|
7
|
+
Progress,
|
|
8
|
+
Text
|
|
9
|
+
} from "@mantine/core";
|
|
10
|
+
import { Info } from "lucide-react";
|
|
11
|
+
function StatCell({
|
|
12
|
+
value,
|
|
13
|
+
intent,
|
|
14
|
+
textProps,
|
|
15
|
+
barProps,
|
|
16
|
+
info,
|
|
17
|
+
infoPosition = "left-start",
|
|
18
|
+
infoDisabled,
|
|
19
|
+
...groupProps
|
|
20
|
+
}) {
|
|
21
|
+
const ProgressComponent = /* @__PURE__ */ jsx(
|
|
22
|
+
Progress,
|
|
23
|
+
{
|
|
24
|
+
value: value ?? 0,
|
|
25
|
+
color: hexColorByIntention(intent),
|
|
26
|
+
w: 200,
|
|
27
|
+
size: "xl",
|
|
28
|
+
...barProps
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
return /* @__PURE__ */ jsxs(Group, { gap: "xs", justify: "space-between", wrap: "nowrap", ...groupProps, children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
Text,
|
|
34
|
+
{
|
|
35
|
+
w: 64,
|
|
36
|
+
c: value === void 0 ? "dimmed" : void 0,
|
|
37
|
+
...textProps,
|
|
38
|
+
children: value === void 0 ? "N/A" : value.toFixed(1) + "%"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
!info && ProgressComponent,
|
|
42
|
+
info && /* @__PURE__ */ jsxs(HoverCard, { position: infoPosition, disabled: infoDisabled, children: [
|
|
43
|
+
/* @__PURE__ */ jsx(HoverCard.Target, { children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
|
|
44
|
+
ProgressComponent,
|
|
45
|
+
/* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", disabled: infoDisabled, children: /* @__PURE__ */ jsx(Info, { size: "1rem" }) })
|
|
46
|
+
] }) }),
|
|
47
|
+
/* @__PURE__ */ jsx(HoverCard.Dropdown, { children: info })
|
|
48
|
+
] })
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
StatCell
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=stat-cell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/stat-cell.tsx"],"sourcesContent":["import { ColorIntention, hexColorByIntention } from \"../color\";\nimport {\n ActionIcon,\n FloatingPosition,\n Group,\n GroupProps,\n HoverCard,\n Progress,\n ProgressProps,\n Text,\n TextProps,\n} from \"@mantine/core\";\nimport { ReactNode } from \"react\";\nimport { Info } from \"lucide-react\";\n\nexport interface StatCellProps extends GroupProps {\n value: number | undefined;\n intent: ColorIntention;\n textProps?: TextProps;\n barProps?: ProgressProps;\n info?: ReactNode;\n infoPosition?: FloatingPosition;\n infoDisabled?: boolean;\n}\n\nexport function StatCell({\n value,\n intent,\n textProps,\n barProps,\n info,\n infoPosition = \"left-start\",\n infoDisabled,\n ...groupProps\n}: StatCellProps) {\n const ProgressComponent = (\n <Progress\n value={value ?? 0}\n color={hexColorByIntention(intent)}\n w={200}\n size=\"xl\"\n {...barProps}\n />\n );\n return (\n <Group gap=\"xs\" justify=\"space-between\" wrap=\"nowrap\" {...groupProps}>\n <Text\n w={64}\n c={value === undefined ? \"dimmed\" : undefined}\n {...textProps}\n >\n {value === undefined ? \"N/A\" : value.toFixed(1) + \"%\"}\n </Text>\n {!info && ProgressComponent}\n {info && (\n <HoverCard position={infoPosition} disabled={infoDisabled}>\n <HoverCard.Target>\n <Group gap=\"xs\" wrap=\"nowrap\">\n {ProgressComponent}\n <ActionIcon variant=\"subtle\" disabled={infoDisabled}>\n <Info size=\"1rem\" />\n </ActionIcon>\n </Group>\n </HoverCard.Target>\n <HoverCard.Dropdown>{info}</HoverCard.Dropdown>\n </HoverCard>\n )}\n </Group>\n );\n}\n"],"mappings":"AAoCI,cAqBQ,YArBR;AApCJ,SAAyB,2BAA2B;AACpD;AAAA,EACE;AAAA,EAEA;AAAA,EAEA;AAAA,EACA;AAAA,EAEA;AAAA,OAEK;AAEP,SAAS,YAAY;AAYd,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,QAAM,oBACJ;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,SAAS;AAAA,MAChB,OAAO,oBAAoB,MAAM;AAAA,MACjC,GAAG;AAAA,MACH,MAAK;AAAA,MACJ,GAAG;AAAA;AAAA,EACN;AAEF,SACE,qBAAC,SAAM,KAAI,MAAK,SAAQ,iBAAgB,MAAK,UAAU,GAAG,YACxD;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,GAAG;AAAA,QACH,GAAG,UAAU,SAAY,WAAW;AAAA,QACnC,GAAG;AAAA,QAEH,oBAAU,SAAY,QAAQ,MAAM,QAAQ,CAAC,IAAI;AAAA;AAAA,IACpD;AAAA,IACC,CAAC,QAAQ;AAAA,IACT,QACC,qBAAC,aAAU,UAAU,cAAc,UAAU,cAC3C;AAAA,0BAAC,UAAU,QAAV,EACC,+BAAC,SAAM,KAAI,MAAK,MAAK,UAClB;AAAA;AAAA,QACD,oBAAC,cAAW,SAAQ,UAAS,UAAU,cACrC,8BAAC,QAAK,MAAK,QAAO,GACpB;AAAA,SACF,GACF;AAAA,MACA,oBAAC,UAAU,UAAV,EAAoB,gBAAK;AAAA,OAC5B;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var status_badge_exports = {};
|
|
20
|
+
__export(status_badge_exports, {
|
|
21
|
+
StatusBadge: () => StatusBadge
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(status_badge_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_core = require("@mantine/core");
|
|
27
|
+
var import_color = require("../color");
|
|
28
|
+
var import_formatting = require("../formatting");
|
|
29
|
+
const StatusBadge = (0, import_core.createPolymorphicComponent)(
|
|
30
|
+
(0, import_react.forwardRef)(
|
|
31
|
+
({ text: _text, intent, ...props }, ref) => {
|
|
32
|
+
if (!_text) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const text = (0, import_formatting.fmtSnakeCaseToUpperSpaceCase)(
|
|
36
|
+
(0, import_formatting.fmtUpperCamelcase)(_text)
|
|
37
|
+
).toUpperCase();
|
|
38
|
+
const _background = (0, import_color.hexColorByIntention)(intent);
|
|
39
|
+
const background = _background ? _background + "25" : void 0;
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_core.Text,
|
|
42
|
+
{
|
|
43
|
+
fz: { base: "xs", md: "sm" },
|
|
44
|
+
bdrs: "md",
|
|
45
|
+
w: "fit-content",
|
|
46
|
+
c: intent,
|
|
47
|
+
bg: background,
|
|
48
|
+
px: "0.5rem",
|
|
49
|
+
py: "0.2rem",
|
|
50
|
+
lts: "0.025em",
|
|
51
|
+
...props,
|
|
52
|
+
ref,
|
|
53
|
+
children: text
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
StatusBadge
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=status-badge.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/status-badge.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Text, TextProps, createPolymorphicComponent } from \"@mantine/core\";\nimport { ColorIntention, hexColorByIntention } from \"../color\";\nimport { fmtUpperCamelcase, fmtSnakeCaseToUpperSpaceCase } from \"../formatting\";\n\n// https://mantine.dev/guides/polymorphic/#create-your-own-polymorphic-components\n\ninterface StatusBadgeProps extends TextProps {\n text: string | undefined;\n intent: ColorIntention;\n}\n\nexport const StatusBadge = createPolymorphicComponent<\"div\", StatusBadgeProps>(\n forwardRef<HTMLDivElement, StatusBadgeProps>(\n ({ text: _text, intent, ...props }, ref) => {\n if (!_text) {\n return null;\n }\n\n const text = fmtSnakeCaseToUpperSpaceCase(\n fmtUpperCamelcase(_text),\n ).toUpperCase();\n const _background = hexColorByIntention(intent);\n const background = _background ? _background + \"25\" : undefined;\n\n return (\n <Text\n fz={{ base: \"xs\", md: \"sm\" }}\n bdrs=\"md\"\n w=\"fit-content\"\n c={intent}\n bg={background}\n px=\"0.5rem\"\n py=\"0.2rem\"\n lts=\"0.025em\"\n {...props}\n ref={ref}\n >\n {text}\n </Text>\n );\n },\n ),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BQ;AA1BR,mBAA2B;AAC3B,kBAA4D;AAC5D,mBAAoD;AACpD,wBAAgE;AASzD,MAAM,kBAAc;AAAA,MACzB;AAAA,IACE,CAAC,EAAE,MAAM,OAAO,QAAQ,GAAG,MAAM,GAAG,QAAQ;AAC1C,UAAI,CAAC,OAAO;AACV,eAAO;AAAA,MACT;AAEA,YAAM,WAAO;AAAA,YACX,qCAAkB,KAAK;AAAA,MACzB,EAAE,YAAY;AACd,YAAM,kBAAc,kCAAoB,MAAM;AAC9C,YAAM,aAAa,cAAc,cAAc,OAAO;AAEtD,aACE;AAAA,QAAC;AAAA;AAAA,UACC,IAAI,EAAE,MAAM,MAAM,IAAI,KAAK;AAAA,UAC3B,MAAK;AAAA,UACL,GAAE;AAAA,UACF,GAAG;AAAA,UACH,IAAI;AAAA,UACJ,IAAG;AAAA,UACH,IAAG;AAAA,UACH,KAAI;AAAA,UACH,GAAG;AAAA,UACJ;AAAA,UAEC;AAAA;AAAA,MACH;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as _mantine_core from '@mantine/core';
|
|
3
|
+
import { TextProps } from '@mantine/core';
|
|
4
|
+
import { ColorIntention } from '../color.cjs';
|
|
5
|
+
|
|
6
|
+
interface StatusBadgeProps extends TextProps {
|
|
7
|
+
text: string | undefined;
|
|
8
|
+
intent: ColorIntention;
|
|
9
|
+
}
|
|
10
|
+
declare const StatusBadge: (<C = "div">(props: _mantine_core.PolymorphicComponentProps<C, StatusBadgeProps>) => React.ReactElement) & Omit<react.FunctionComponent<(StatusBadgeProps & {
|
|
11
|
+
component?: any;
|
|
12
|
+
} & Omit<any, "component" | keyof StatusBadgeProps> & {
|
|
13
|
+
ref?: any;
|
|
14
|
+
renderRoot?: (props: any) => any;
|
|
15
|
+
}) | (StatusBadgeProps & {
|
|
16
|
+
component: React.ElementType;
|
|
17
|
+
renderRoot?: (props: Record<string, any>) => any;
|
|
18
|
+
})>, never> & Record<string, never>;
|
|
19
|
+
|
|
20
|
+
export { StatusBadge };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as _mantine_core from '@mantine/core';
|
|
3
|
+
import { TextProps } from '@mantine/core';
|
|
4
|
+
import { ColorIntention } from '../color.js';
|
|
5
|
+
|
|
6
|
+
interface StatusBadgeProps extends TextProps {
|
|
7
|
+
text: string | undefined;
|
|
8
|
+
intent: ColorIntention;
|
|
9
|
+
}
|
|
10
|
+
declare const StatusBadge: (<C = "div">(props: _mantine_core.PolymorphicComponentProps<C, StatusBadgeProps>) => React.ReactElement) & Omit<react.FunctionComponent<(StatusBadgeProps & {
|
|
11
|
+
component?: any;
|
|
12
|
+
} & Omit<any, "component" | keyof StatusBadgeProps> & {
|
|
13
|
+
ref?: any;
|
|
14
|
+
renderRoot?: (props: any) => any;
|
|
15
|
+
}) | (StatusBadgeProps & {
|
|
16
|
+
component: React.ElementType;
|
|
17
|
+
renderRoot?: (props: Record<string, any>) => any;
|
|
18
|
+
})>, never> & Record<string, never>;
|
|
19
|
+
|
|
20
|
+
export { StatusBadge };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Text, createPolymorphicComponent } from "@mantine/core";
|
|
4
|
+
import { hexColorByIntention } from "../color";
|
|
5
|
+
import { fmtUpperCamelcase, fmtSnakeCaseToUpperSpaceCase } from "../formatting";
|
|
6
|
+
const StatusBadge = createPolymorphicComponent(
|
|
7
|
+
forwardRef(
|
|
8
|
+
({ text: _text, intent, ...props }, ref) => {
|
|
9
|
+
if (!_text) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const text = fmtSnakeCaseToUpperSpaceCase(
|
|
13
|
+
fmtUpperCamelcase(_text)
|
|
14
|
+
).toUpperCase();
|
|
15
|
+
const _background = hexColorByIntention(intent);
|
|
16
|
+
const background = _background ? _background + "25" : void 0;
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
Text,
|
|
19
|
+
{
|
|
20
|
+
fz: { base: "xs", md: "sm" },
|
|
21
|
+
bdrs: "md",
|
|
22
|
+
w: "fit-content",
|
|
23
|
+
c: intent,
|
|
24
|
+
bg: background,
|
|
25
|
+
px: "0.5rem",
|
|
26
|
+
py: "0.2rem",
|
|
27
|
+
lts: "0.025em",
|
|
28
|
+
...props,
|
|
29
|
+
ref,
|
|
30
|
+
children: text
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
export {
|
|
37
|
+
StatusBadge
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=status-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/status-badge.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Text, TextProps, createPolymorphicComponent } from \"@mantine/core\";\nimport { ColorIntention, hexColorByIntention } from \"../color\";\nimport { fmtUpperCamelcase, fmtSnakeCaseToUpperSpaceCase } from \"../formatting\";\n\n// https://mantine.dev/guides/polymorphic/#create-your-own-polymorphic-components\n\ninterface StatusBadgeProps extends TextProps {\n text: string | undefined;\n intent: ColorIntention;\n}\n\nexport const StatusBadge = createPolymorphicComponent<\"div\", StatusBadgeProps>(\n forwardRef<HTMLDivElement, StatusBadgeProps>(\n ({ text: _text, intent, ...props }, ref) => {\n if (!_text) {\n return null;\n }\n\n const text = fmtSnakeCaseToUpperSpaceCase(\n fmtUpperCamelcase(_text),\n ).toUpperCase();\n const _background = hexColorByIntention(intent);\n const background = _background ? _background + \"25\" : undefined;\n\n return (\n <Text\n fz={{ base: \"xs\", md: \"sm\" }}\n bdrs=\"md\"\n w=\"fit-content\"\n c={intent}\n bg={background}\n px=\"0.5rem\"\n py=\"0.2rem\"\n lts=\"0.025em\"\n {...props}\n ref={ref}\n >\n {text}\n </Text>\n );\n },\n ),\n);\n"],"mappings":"AA0BQ;AA1BR,SAAS,kBAAkB;AAC3B,SAAS,MAAiB,kCAAkC;AAC5D,SAAyB,2BAA2B;AACpD,SAAS,mBAAmB,oCAAoC;AASzD,MAAM,cAAc;AAAA,EACzB;AAAA,IACE,CAAC,EAAE,MAAM,OAAO,QAAQ,GAAG,MAAM,GAAG,QAAQ;AAC1C,UAAI,CAAC,OAAO;AACV,eAAO;AAAA,MACT;AAEA,YAAM,OAAO;AAAA,QACX,kBAAkB,KAAK;AAAA,MACzB,EAAE,YAAY;AACd,YAAM,cAAc,oBAAoB,MAAM;AAC9C,YAAM,aAAa,cAAc,cAAc,OAAO;AAEtD,aACE;AAAA,QAAC;AAAA;AAAA,UACC,IAAI,EAAE,MAAM,MAAM,IAAI,KAAK;AAAA,UAC3B,MAAK;AAAA,UACL,GAAE;AAAA,UACF,GAAG;AAAA,UACH,IAAI;AAAA,UACJ,IAAG;AAAA,UACH,IAAG;AAAA,UACH,KAAI;AAAA,UACH,GAAG;AAAA,UACJ;AAAA,UAEC;AAAA;AAAA,MACH;AAAA,IAEJ;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var tabbed_page_exports = {};
|
|
20
|
+
__export(tabbed_page_exports, {
|
|
21
|
+
TabbedPage: () => TabbedPage
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(tabbed_page_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_core = require("@mantine/core");
|
|
26
|
+
var import_hooks = require("@mantine/hooks");
|
|
27
|
+
var import_page = require("./page");
|
|
28
|
+
var import_lucide_react = require("lucide-react");
|
|
29
|
+
function TabbedPage({
|
|
30
|
+
storageKey,
|
|
31
|
+
tabs
|
|
32
|
+
}) {
|
|
33
|
+
const defaultTab = tabs[0]?.tab;
|
|
34
|
+
const [selectedTab, setSelectedTab] = (0, import_hooks.useLocalStorage)({
|
|
35
|
+
key: storageKey,
|
|
36
|
+
defaultValue: defaultTab
|
|
37
|
+
});
|
|
38
|
+
const Content = tabs.find((tab) => tab.tab === selectedTab)?.content ?? (() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Center, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CircleQuestionMark, { size: 22 }) }));
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
import_core.Tabs,
|
|
41
|
+
{
|
|
42
|
+
value: selectedTab,
|
|
43
|
+
onChange: (tab) => setSelectedTab(tab ?? defaultTab),
|
|
44
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
import_page.Page,
|
|
46
|
+
{
|
|
47
|
+
customTitle: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Tabs.List, { children: tabs.map(({ tab, icon }) => {
|
|
48
|
+
const Icon = icon ?? import_lucide_react.CircleQuestionMark;
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Tabs.Tab, { value: tab, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Group, { opacity: tab === selectedTab ? 1 : 0.6, children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: 20 }),
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Text, { fz: "h3", children: tab })
|
|
52
|
+
] }) }, tab);
|
|
53
|
+
}) }),
|
|
54
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content, {})
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
TabbedPage
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=tabbed-page.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/tabbed-page.tsx"],"sourcesContent":["import { Center, Group, Tabs, Text } from \"@mantine/core\";\nimport { useLocalStorage } from \"@mantine/hooks\";\nimport { FC } from \"react\";\nimport { Page } from \"./page\";\nimport { CircleQuestionMark } from \"lucide-react\";\n\nexport type TabbedPageItem<Tab extends string> = {\n tab: Tab;\n icon?: FC<{ size?: string | number }>;\n content?: FC;\n};\n\nexport type TabbedPageProps<Tab extends string> = {\n /** Store current tab on localStorage */\n storageKey: string;\n tabs: TabbedPageItem<Tab>[];\n};\n\nexport function TabbedPage<Tab extends string>({\n storageKey,\n tabs,\n}: TabbedPageProps<Tab>) {\n const defaultTab = tabs[0]?.tab;\n const [selectedTab, setSelectedTab] = useLocalStorage<Tab>({\n key: storageKey,\n defaultValue: defaultTab,\n });\n const Content =\n tabs.find((tab) => tab.tab === selectedTab)?.content ??\n (() => (\n <Center>\n <CircleQuestionMark size={22} />\n </Center>\n ));\n return (\n <Tabs\n value={selectedTab}\n onChange={(tab) => setSelectedTab((tab as Tab) ?? defaultTab)}\n >\n <Page\n customTitle={\n <Tabs.List>\n {tabs.map(({ tab, icon }) => {\n const Icon = icon ?? CircleQuestionMark;\n return (\n <Tabs.Tab key={tab} value={tab}>\n <Group opacity={tab === selectedTab ? 1 : 0.6}>\n <Icon size={20} />\n <Text fz=\"h3\">{tab}</Text>\n </Group>\n </Tabs.Tab>\n );\n })}\n </Tabs.List>\n }\n >\n <Content />\n </Page>\n </Tabs>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BQ;AA/BR,kBAA0C;AAC1C,mBAAgC;AAEhC,kBAAqB;AACrB,0BAAmC;AAc5B,SAAS,WAA+B;AAAA,EAC7C;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,aAAa,KAAK,CAAC,GAAG;AAC5B,QAAM,CAAC,aAAa,cAAc,QAAI,8BAAqB;AAAA,IACzD,KAAK;AAAA,IACL,cAAc;AAAA,EAChB,CAAC;AACD,QAAM,UACJ,KAAK,KAAK,CAAC,QAAQ,IAAI,QAAQ,WAAW,GAAG,YAC5C,MACC,4CAAC,sBACC,sDAAC,0CAAmB,MAAM,IAAI,GAChC;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP,UAAU,CAAC,QAAQ,eAAgB,OAAe,UAAU;AAAA,MAE5D;AAAA,QAAC;AAAA;AAAA,UACC,aACE,4CAAC,iBAAK,MAAL,EACE,eAAK,IAAI,CAAC,EAAE,KAAK,KAAK,MAAM;AAC3B,kBAAM,OAAO,QAAQ;AACrB,mBACE,4CAAC,iBAAK,KAAL,EAAmB,OAAO,KACzB,uDAAC,qBAAM,SAAS,QAAQ,cAAc,IAAI,KACxC;AAAA,0DAAC,QAAK,MAAM,IAAI;AAAA,cAChB,4CAAC,oBAAK,IAAG,MAAM,eAAI;AAAA,eACrB,KAJa,GAKf;AAAA,UAEJ,CAAC,GACH;AAAA,UAGF,sDAAC,WAAQ;AAAA;AAAA,MACX;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
|
|
4
|
+
type TabbedPageItem<Tab extends string> = {
|
|
5
|
+
tab: Tab;
|
|
6
|
+
icon?: FC<{
|
|
7
|
+
size?: string | number;
|
|
8
|
+
}>;
|
|
9
|
+
content?: FC;
|
|
10
|
+
};
|
|
11
|
+
type TabbedPageProps<Tab extends string> = {
|
|
12
|
+
/** Store current tab on localStorage */
|
|
13
|
+
storageKey: string;
|
|
14
|
+
tabs: TabbedPageItem<Tab>[];
|
|
15
|
+
};
|
|
16
|
+
declare function TabbedPage<Tab extends string>({ storageKey, tabs, }: TabbedPageProps<Tab>): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { TabbedPage, type TabbedPageItem, type TabbedPageProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
|
|
4
|
+
type TabbedPageItem<Tab extends string> = {
|
|
5
|
+
tab: Tab;
|
|
6
|
+
icon?: FC<{
|
|
7
|
+
size?: string | number;
|
|
8
|
+
}>;
|
|
9
|
+
content?: FC;
|
|
10
|
+
};
|
|
11
|
+
type TabbedPageProps<Tab extends string> = {
|
|
12
|
+
/** Store current tab on localStorage */
|
|
13
|
+
storageKey: string;
|
|
14
|
+
tabs: TabbedPageItem<Tab>[];
|
|
15
|
+
};
|
|
16
|
+
declare function TabbedPage<Tab extends string>({ storageKey, tabs, }: TabbedPageProps<Tab>): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { TabbedPage, type TabbedPageItem, type TabbedPageProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Center, Group, Tabs, Text } from "@mantine/core";
|
|
3
|
+
import { useLocalStorage } from "@mantine/hooks";
|
|
4
|
+
import { Page } from "./page";
|
|
5
|
+
import { CircleQuestionMark } from "lucide-react";
|
|
6
|
+
function TabbedPage({
|
|
7
|
+
storageKey,
|
|
8
|
+
tabs
|
|
9
|
+
}) {
|
|
10
|
+
const defaultTab = tabs[0]?.tab;
|
|
11
|
+
const [selectedTab, setSelectedTab] = useLocalStorage({
|
|
12
|
+
key: storageKey,
|
|
13
|
+
defaultValue: defaultTab
|
|
14
|
+
});
|
|
15
|
+
const Content = tabs.find((tab) => tab.tab === selectedTab)?.content ?? (() => /* @__PURE__ */ jsx(Center, { children: /* @__PURE__ */ jsx(CircleQuestionMark, { size: 22 }) }));
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
Tabs,
|
|
18
|
+
{
|
|
19
|
+
value: selectedTab,
|
|
20
|
+
onChange: (tab) => setSelectedTab(tab ?? defaultTab),
|
|
21
|
+
children: /* @__PURE__ */ jsx(
|
|
22
|
+
Page,
|
|
23
|
+
{
|
|
24
|
+
customTitle: /* @__PURE__ */ jsx(Tabs.List, { children: tabs.map(({ tab, icon }) => {
|
|
25
|
+
const Icon = icon ?? CircleQuestionMark;
|
|
26
|
+
return /* @__PURE__ */ jsx(Tabs.Tab, { value: tab, children: /* @__PURE__ */ jsxs(Group, { opacity: tab === selectedTab ? 1 : 0.6, children: [
|
|
27
|
+
/* @__PURE__ */ jsx(Icon, { size: 20 }),
|
|
28
|
+
/* @__PURE__ */ jsx(Text, { fz: "h3", children: tab })
|
|
29
|
+
] }) }, tab);
|
|
30
|
+
}) }),
|
|
31
|
+
children: /* @__PURE__ */ jsx(Content, {})
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
TabbedPage
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=tabbed-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/tabbed-page.tsx"],"sourcesContent":["import { Center, Group, Tabs, Text } from \"@mantine/core\";\nimport { useLocalStorage } from \"@mantine/hooks\";\nimport { FC } from \"react\";\nimport { Page } from \"./page\";\nimport { CircleQuestionMark } from \"lucide-react\";\n\nexport type TabbedPageItem<Tab extends string> = {\n tab: Tab;\n icon?: FC<{ size?: string | number }>;\n content?: FC;\n};\n\nexport type TabbedPageProps<Tab extends string> = {\n /** Store current tab on localStorage */\n storageKey: string;\n tabs: TabbedPageItem<Tab>[];\n};\n\nexport function TabbedPage<Tab extends string>({\n storageKey,\n tabs,\n}: TabbedPageProps<Tab>) {\n const defaultTab = tabs[0]?.tab;\n const [selectedTab, setSelectedTab] = useLocalStorage<Tab>({\n key: storageKey,\n defaultValue: defaultTab,\n });\n const Content =\n tabs.find((tab) => tab.tab === selectedTab)?.content ??\n (() => (\n <Center>\n <CircleQuestionMark size={22} />\n </Center>\n ));\n return (\n <Tabs\n value={selectedTab}\n onChange={(tab) => setSelectedTab((tab as Tab) ?? defaultTab)}\n >\n <Page\n customTitle={\n <Tabs.List>\n {tabs.map(({ tab, icon }) => {\n const Icon = icon ?? CircleQuestionMark;\n return (\n <Tabs.Tab key={tab} value={tab}>\n <Group opacity={tab === selectedTab ? 1 : 0.6}>\n <Icon size={20} />\n <Text fz=\"h3\">{tab}</Text>\n </Group>\n </Tabs.Tab>\n );\n })}\n </Tabs.List>\n }\n >\n <Content />\n </Page>\n </Tabs>\n );\n}\n"],"mappings":"AA+BQ,cAeU,YAfV;AA/BR,SAAS,QAAQ,OAAO,MAAM,YAAY;AAC1C,SAAS,uBAAuB;AAEhC,SAAS,YAAY;AACrB,SAAS,0BAA0B;AAc5B,SAAS,WAA+B;AAAA,EAC7C;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,aAAa,KAAK,CAAC,GAAG;AAC5B,QAAM,CAAC,aAAa,cAAc,IAAI,gBAAqB;AAAA,IACzD,KAAK;AAAA,IACL,cAAc;AAAA,EAChB,CAAC;AACD,QAAM,UACJ,KAAK,KAAK,CAAC,QAAQ,IAAI,QAAQ,WAAW,GAAG,YAC5C,MACC,oBAAC,UACC,8BAAC,sBAAmB,MAAM,IAAI,GAChC;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP,UAAU,CAAC,QAAQ,eAAgB,OAAe,UAAU;AAAA,MAE5D;AAAA,QAAC;AAAA;AAAA,UACC,aACE,oBAAC,KAAK,MAAL,EACE,eAAK,IAAI,CAAC,EAAE,KAAK,KAAK,MAAM;AAC3B,kBAAM,OAAO,QAAQ;AACrB,mBACE,oBAAC,KAAK,KAAL,EAAmB,OAAO,KACzB,+BAAC,SAAM,SAAS,QAAQ,cAAc,IAAI,KACxC;AAAA,kCAAC,QAAK,MAAM,IAAI;AAAA,cAChB,oBAAC,QAAK,IAAG,MAAM,eAAI;AAAA,eACrB,KAJa,GAKf;AAAA,UAEJ,CAAC,GACH;AAAA,UAGF,8BAAC,WAAQ;AAAA;AAAA,MACX;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var table_skeleton_exports = {};
|
|
20
|
+
__export(table_skeleton_exports, {
|
|
21
|
+
TableSkeleton: () => TableSkeleton
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(table_skeleton_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_core = require("@mantine/core");
|
|
26
|
+
function TableSkeleton({
|
|
27
|
+
rows = 6,
|
|
28
|
+
rowHeight = "3.5vh"
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Stack, { gap: "xs", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Skeleton, { height: rowHeight }, i)) });
|
|
31
|
+
}
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
TableSkeleton
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=table-skeleton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/table-skeleton.tsx"],"sourcesContent":["import { Skeleton, Stack } from \"@mantine/core\";\n\nexport function TableSkeleton({\n rows = 6,\n rowHeight = \"3.5vh\",\n}: {\n rows?: number;\n rowHeight?: string | number;\n}) {\n return (\n <Stack gap=\"xs\">\n {Array.from({ length: rows }).map((_, i) => (\n <Skeleton key={i} height={rowHeight} />\n ))}\n </Stack>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYQ;AAZR,kBAAgC;AAEzB,SAAS,cAAc;AAAA,EAC5B,OAAO;AAAA,EACP,YAAY;AACd,GAGG;AACD,SACE,4CAAC,qBAAM,KAAI,MACR,gBAAM,KAAK,EAAE,QAAQ,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,MACpC,4CAAC,wBAAiB,QAAQ,aAAX,CAAsB,CACtC,GACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton, Stack } from "@mantine/core";
|
|
3
|
+
function TableSkeleton({
|
|
4
|
+
rows = 6,
|
|
5
|
+
rowHeight = "3.5vh"
|
|
6
|
+
}) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Stack, { gap: "xs", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { height: rowHeight }, i)) });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
TableSkeleton
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=table-skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/table-skeleton.tsx"],"sourcesContent":["import { Skeleton, Stack } from \"@mantine/core\";\n\nexport function TableSkeleton({\n rows = 6,\n rowHeight = \"3.5vh\",\n}: {\n rows?: number;\n rowHeight?: string | number;\n}) {\n return (\n <Stack gap=\"xs\">\n {Array.from({ length: rows }).map((_, i) => (\n <Skeleton key={i} height={rowHeight} />\n ))}\n </Stack>\n );\n}\n"],"mappings":"AAYQ;AAZR,SAAS,UAAU,aAAa;AAEzB,SAAS,cAAc;AAAA,EAC5B,OAAO;AAAA,EACP,YAAY;AACd,GAGG;AACD,SACE,oBAAC,SAAM,KAAI,MACR,gBAAM,KAAK,EAAE,QAAQ,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,MACpC,oBAAC,YAAiB,QAAQ,aAAX,CAAsB,CACtC,GACH;AAEJ;","names":[]}
|