@upbound/monarch-blocks 0.8.3 → 0.10.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/data-table.d.ts +2 -1
- package/dist/data-table.js +11 -5
- package/dist/data-table.js.map +1 -1
- package/dist/graph.js +9 -4
- package/dist/graph.js.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3736,13 +3736,14 @@ function RowActions({
|
|
|
3736
3736
|
] });
|
|
3737
3737
|
}
|
|
3738
3738
|
function RowActionItem({
|
|
3739
|
+
variant = "default",
|
|
3739
3740
|
disabled,
|
|
3740
3741
|
className,
|
|
3741
3742
|
tooltip,
|
|
3742
3743
|
children,
|
|
3743
3744
|
onClick
|
|
3744
3745
|
}) {
|
|
3745
|
-
const item = /* @__PURE__ */ jsx9(DropdownMenuItem3, { disabled, className, onClick, children });
|
|
3746
|
+
const item = /* @__PURE__ */ jsx9(DropdownMenuItem3, { variant, disabled, className, onClick, children });
|
|
3746
3747
|
if (!tooltip) return item;
|
|
3747
3748
|
return /* @__PURE__ */ jsxs7(Tooltip4, { children: [
|
|
3748
3749
|
/* @__PURE__ */ jsx9(TooltipTrigger3, { asChild: true, children: /* @__PURE__ */ jsx9("span", { className: "block", children: item }) }),
|
|
@@ -4473,16 +4474,21 @@ var defaultNoFilterFoundConfig = {
|
|
|
4473
4474
|
header: "No matching results",
|
|
4474
4475
|
subheader: "Try adjusting your search or filters."
|
|
4475
4476
|
};
|
|
4477
|
+
function mergeConfig(defaults, custom) {
|
|
4478
|
+
if (!custom) return defaults;
|
|
4479
|
+
const provided = Object.fromEntries(Object.entries(custom).filter(([, value]) => value !== void 0));
|
|
4480
|
+
return __spreadValues(__spreadValues({}, defaults), provided);
|
|
4481
|
+
}
|
|
4476
4482
|
function DataTableEmptyView({
|
|
4477
4483
|
emptyView,
|
|
4478
4484
|
tableState,
|
|
4479
4485
|
filterCount,
|
|
4480
4486
|
resetFilters
|
|
4481
4487
|
}) {
|
|
4482
|
-
var _a, _b, _c, _d
|
|
4488
|
+
var _a, _b, _c, _d;
|
|
4483
4489
|
const isFilteredEmpty = tableState === "empty" && filterCount > 0;
|
|
4484
|
-
const config = tableState === "error" ? (
|
|
4485
|
-
const wrapperClassName = tableState === "error" ? (
|
|
4490
|
+
const config = tableState === "error" ? mergeConfig(defaultErrorConfig, emptyView == null ? void 0 : emptyView.error) : tableState === "empty" ? isFilteredEmpty ? mergeConfig(defaultNoFilterFoundConfig, emptyView == null ? void 0 : emptyView.filter) : mergeConfig(defaultEmptyConfig, emptyView == null ? void 0 : emptyView.empty) : null;
|
|
4491
|
+
const wrapperClassName = tableState === "error" ? (_c = (_a = emptyView == null ? void 0 : emptyView.error) == null ? void 0 : _a.wrapperClassName) != null ? _c : (_b = emptyView == null ? void 0 : emptyView.empty) == null ? void 0 : _b.wrapperClassName : config == null ? void 0 : config.wrapperClassName;
|
|
4486
4492
|
const defaultAction = isFilteredEmpty && !(config == null ? void 0 : config.action) ? /* @__PURE__ */ jsxs8(Button5, { variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
4487
4493
|
/* @__PURE__ */ jsx10(Icon6, { name: "xmark" }),
|
|
4488
4494
|
"Clear filters"
|
|
@@ -4495,7 +4501,7 @@ function DataTableEmptyView({
|
|
|
4495
4501
|
] }),
|
|
4496
4502
|
(config.details || config.action || defaultAction) && /* @__PURE__ */ jsxs8(EmptyContent, { children: [
|
|
4497
4503
|
config.details && /* @__PURE__ */ jsx10(Alert, { children: /* @__PURE__ */ jsx10(AlertDescription, { children: config.details }) }),
|
|
4498
|
-
(
|
|
4504
|
+
(_d = config.action) != null ? _d : defaultAction
|
|
4499
4505
|
] })
|
|
4500
4506
|
] }) });
|
|
4501
4507
|
}
|