@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/data-table.d.ts
CHANGED
|
@@ -52,7 +52,8 @@ declare function RowActions({ align, children, contentClassName, }: {
|
|
|
52
52
|
children: React$1.ReactNode;
|
|
53
53
|
contentClassName?: string;
|
|
54
54
|
}): React$1.JSX.Element;
|
|
55
|
-
declare function RowActionItem({ disabled, className, tooltip, children, onClick, }: {
|
|
55
|
+
declare function RowActionItem({ variant, disabled, className, tooltip, children, onClick, }: {
|
|
56
|
+
variant?: 'default' | 'destructive';
|
|
56
57
|
disabled?: boolean;
|
|
57
58
|
className?: string;
|
|
58
59
|
tooltip?: string;
|
package/dist/data-table.js
CHANGED
|
@@ -603,13 +603,14 @@ function RowActions({
|
|
|
603
603
|
] });
|
|
604
604
|
}
|
|
605
605
|
function RowActionItem({
|
|
606
|
+
variant = "default",
|
|
606
607
|
disabled,
|
|
607
608
|
className,
|
|
608
609
|
tooltip,
|
|
609
610
|
children,
|
|
610
611
|
onClick
|
|
611
612
|
}) {
|
|
612
|
-
const item = /* @__PURE__ */ jsx4(DropdownMenuItem2, { disabled, className, onClick, children });
|
|
613
|
+
const item = /* @__PURE__ */ jsx4(DropdownMenuItem2, { variant, disabled, className, onClick, children });
|
|
613
614
|
if (!tooltip) return item;
|
|
614
615
|
return /* @__PURE__ */ jsxs3(Tooltip, { children: [
|
|
615
616
|
/* @__PURE__ */ jsx4(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx4("span", { className: "block", children: item }) }),
|
|
@@ -3006,16 +3007,21 @@ var defaultNoFilterFoundConfig = {
|
|
|
3006
3007
|
header: "No matching results",
|
|
3007
3008
|
subheader: "Try adjusting your search or filters."
|
|
3008
3009
|
};
|
|
3010
|
+
function mergeConfig(defaults, custom) {
|
|
3011
|
+
if (!custom) return defaults;
|
|
3012
|
+
const provided = Object.fromEntries(Object.entries(custom).filter(([, value]) => value !== void 0));
|
|
3013
|
+
return __spreadValues(__spreadValues({}, defaults), provided);
|
|
3014
|
+
}
|
|
3009
3015
|
function DataTableEmptyView({
|
|
3010
3016
|
emptyView,
|
|
3011
3017
|
tableState,
|
|
3012
3018
|
filterCount,
|
|
3013
3019
|
resetFilters
|
|
3014
3020
|
}) {
|
|
3015
|
-
var _a, _b, _c, _d
|
|
3021
|
+
var _a, _b, _c, _d;
|
|
3016
3022
|
const isFilteredEmpty = tableState === "empty" && filterCount > 0;
|
|
3017
|
-
const config = tableState === "error" ? (
|
|
3018
|
-
const wrapperClassName = tableState === "error" ? (
|
|
3023
|
+
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;
|
|
3024
|
+
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;
|
|
3019
3025
|
const defaultAction = isFilteredEmpty && !(config == null ? void 0 : config.action) ? /* @__PURE__ */ jsxs5(Button4, { variant: "outline", size: "sm", onClick: resetFilters, children: [
|
|
3020
3026
|
/* @__PURE__ */ jsx6(Icon4, { name: "xmark" }),
|
|
3021
3027
|
"Clear filters"
|
|
@@ -3028,7 +3034,7 @@ function DataTableEmptyView({
|
|
|
3028
3034
|
] }),
|
|
3029
3035
|
(config.details || config.action || defaultAction) && /* @__PURE__ */ jsxs5(EmptyContent, { children: [
|
|
3030
3036
|
config.details && /* @__PURE__ */ jsx6(Alert, { children: /* @__PURE__ */ jsx6(AlertDescription, { children: config.details }) }),
|
|
3031
|
-
(
|
|
3037
|
+
(_d = config.action) != null ? _d : defaultAction
|
|
3032
3038
|
] })
|
|
3033
3039
|
] }) });
|
|
3034
3040
|
}
|