@trops/dash-core 0.1.459 → 0.1.460
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/index.esm.js +274 -259
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +241 -217
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
2
2
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import * as DashReact from '@trops/dash-react';
|
|
5
|
-
import { isObject, ThemeContext, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, FontAwesomeIcon, Tag, Modal, Button3, Button2, Paragraph, Sidebar, Panel, Stepper,
|
|
5
|
+
import { isObject, ThemeContext, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, FontAwesomeIcon, Tag, Modal, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, colorTypes, getCSSStyleForClassname, Panel2, Heading2, SubHeading, Paragraph2, Paragraph3, MenuItem, Tag2, ButtonIcon3, DashPanel, colorNames, shades, themeVariants, Tabs3, DataList, Checkbox, StatCard, Card, Tabs, Accordion, Alert, Toast, ProgressBar, Toggle, Breadcrumbs, Tabs2, Accordion2, Alert2, Toast2, ProgressBar2, Toggle2, Breadcrumbs2, Accordion3, Alert3, Toast3, ProgressBar3, Toggle3, Breadcrumbs3, ThemeFromUrlPane, TextArea, CodeEditorInline, Icon2, AlgoliaSearchBox, CommandPalette, useSidebar, EmptyState, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
|
|
6
6
|
export * from '@trops/dash-react';
|
|
7
7
|
export { ThemeContext } from '@trops/dash-react';
|
|
8
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
@@ -6946,12 +6946,19 @@ var KNOWN_PROVIDERS = [{
|
|
|
6946
6946
|
/**
|
|
6947
6947
|
* WizardDiscoverStep
|
|
6948
6948
|
*
|
|
6949
|
-
* Step 0 of the Dashboard Wizard.
|
|
6950
|
-
*
|
|
6951
|
-
*
|
|
6949
|
+
* Step 0 of the Dashboard Wizard. Two-column layout mirroring the
|
|
6950
|
+
* dash-registry homepage: a left filter sidebar (TYPE / CATEGORIES /
|
|
6951
|
+
* PROVIDERS as vertical lists) and a right content pane with the
|
|
6952
|
+
* search input + result grid.
|
|
6952
6953
|
*
|
|
6953
|
-
* -
|
|
6954
|
-
*
|
|
6954
|
+
* - TYPE filter (single-select): All / Dashboards / Widgets. Replaces
|
|
6955
|
+
* the previous tab bar so the right pane is a single result surface.
|
|
6956
|
+
* - CATEGORIES + PROVIDERS (multi-select): preserves the existing
|
|
6957
|
+
* wizard filter shape (`filters.categories[]`, `filters.providers[]`).
|
|
6958
|
+
*
|
|
6959
|
+
* Selecting a dashboard sets path = "prebuilt" and clears widget
|
|
6960
|
+
* selections. Selecting widgets sets path = "custom" and clears the
|
|
6961
|
+
* dashboard selection.
|
|
6955
6962
|
*
|
|
6956
6963
|
* @param {Object} props
|
|
6957
6964
|
* @param {Object} props.state - Wizard state from useWizardState
|
|
@@ -7034,7 +7041,7 @@ var WizardDiscoverStep = function WizardDiscoverStep(_ref) {
|
|
|
7034
7041
|
});
|
|
7035
7042
|
}, [state.selectedWidgets]);
|
|
7036
7043
|
|
|
7037
|
-
// --- Filter
|
|
7044
|
+
// --- Filter handlers ---
|
|
7038
7045
|
var handleToggleCategory = useCallback(function (cat) {
|
|
7039
7046
|
return dispatch({
|
|
7040
7047
|
type: "TOGGLE_FILTER_CATEGORY",
|
|
@@ -7048,13 +7055,26 @@ var WizardDiscoverStep = function WizardDiscoverStep(_ref) {
|
|
|
7048
7055
|
});
|
|
7049
7056
|
}, [dispatch]);
|
|
7050
7057
|
|
|
7051
|
-
//
|
|
7058
|
+
// TYPE filter — replaces the old tab bar. Binary because the
|
|
7059
|
+
// wizard's data model is mutually exclusive: selecting a dashboard
|
|
7060
|
+
// clears widgets and sets path="prebuilt"; selecting a widget
|
|
7061
|
+
// clears the dashboard and sets path="custom". An "All" view would
|
|
7062
|
+
// imply you can browse both freely when in reality the first click
|
|
7063
|
+
// commits you to one of two paths. Defaulting to "dashboards" since
|
|
7064
|
+
// pre-built is the simpler, more common starting point.
|
|
7052
7065
|
var _useState = useState("dashboards"),
|
|
7053
7066
|
_useState2 = _slicedToArray(_useState, 2),
|
|
7054
|
-
|
|
7055
|
-
|
|
7067
|
+
typeFilter = _useState2[0],
|
|
7068
|
+
setTypeFilter = _useState2[1];
|
|
7069
|
+
var TYPE_OPTIONS = [{
|
|
7070
|
+
key: "dashboards",
|
|
7071
|
+
label: "Dashboards"
|
|
7072
|
+
}, {
|
|
7073
|
+
key: "widgets",
|
|
7074
|
+
label: "Widgets"
|
|
7075
|
+
}];
|
|
7056
7076
|
|
|
7057
|
-
// Clear
|
|
7077
|
+
// Clear-selection handler
|
|
7058
7078
|
var hasSelection = state.selectedDashboard !== null || state.selectedWidgets.length > 0;
|
|
7059
7079
|
var handleClearSelection = useCallback(function () {
|
|
7060
7080
|
dispatch({
|
|
@@ -7070,236 +7090,240 @@ var WizardDiscoverStep = function WizardDiscoverStep(_ref) {
|
|
|
7070
7090
|
payload: null
|
|
7071
7091
|
});
|
|
7072
7092
|
}, [dispatch]);
|
|
7073
|
-
var
|
|
7093
|
+
var showDashboards = typeFilter === "dashboards";
|
|
7094
|
+
var showWidgets = typeFilter === "widgets";
|
|
7095
|
+
var visibleDashboards = showDashboards ? filteredDashboards : [];
|
|
7096
|
+
var visibleWidgets = showWidgets ? filteredWidgets : [];
|
|
7097
|
+
var hasResults = visibleDashboards.length > 0 || visibleWidgets.length > 0;
|
|
7074
7098
|
var hasActiveFilters = filters.categories.length > 0 || filters.providers.length > 0;
|
|
7099
|
+
|
|
7100
|
+
// Shared row class for sidebar list items.
|
|
7101
|
+
var rowClass = function rowClass(active) {
|
|
7102
|
+
return "text-sm py-1.5 px-3 rounded text-left transition-colors flex items-center justify-between ".concat(active ? "bg-blue-900 text-blue-200" : "text-gray-400 hover:bg-gray-800 hover:text-gray-200");
|
|
7103
|
+
};
|
|
7104
|
+
var sectionLabelClass = "text-xs font-semibold text-gray-400 uppercase tracking-wide px-3 mb-1";
|
|
7075
7105
|
return /*#__PURE__*/jsxs("div", {
|
|
7076
|
-
className: "flex flex-
|
|
7077
|
-
children: [/*#__PURE__*/
|
|
7078
|
-
|
|
7079
|
-
onChange: handleSearchChange,
|
|
7080
|
-
placeholder: "Search registry..."
|
|
7081
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
7082
|
-
className: "flex flex-col gap-3",
|
|
7106
|
+
className: "flex flex-row gap-4",
|
|
7107
|
+
children: [/*#__PURE__*/jsxs("aside", {
|
|
7108
|
+
className: "flex-shrink-0 w-56 flex flex-col gap-4 overflow-y-auto",
|
|
7083
7109
|
children: [/*#__PURE__*/jsxs("div", {
|
|
7084
|
-
className: "flex flex-col
|
|
7110
|
+
className: "flex flex-col",
|
|
7085
7111
|
children: [/*#__PURE__*/jsx("span", {
|
|
7086
|
-
className:
|
|
7087
|
-
children: "
|
|
7088
|
-
}),
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7112
|
+
className: sectionLabelClass,
|
|
7113
|
+
children: "TYPE"
|
|
7114
|
+
}), TYPE_OPTIONS.map(function (opt) {
|
|
7115
|
+
var active = typeFilter === opt.key;
|
|
7116
|
+
var showBadge = opt.key === "widgets" && state.selectedWidgets.length > 0;
|
|
7117
|
+
return /*#__PURE__*/jsxs("button", {
|
|
7118
|
+
type: "button",
|
|
7119
|
+
onClick: function onClick() {
|
|
7120
|
+
return setTypeFilter(opt.key);
|
|
7121
|
+
},
|
|
7122
|
+
className: rowClass(active),
|
|
7123
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
7124
|
+
children: opt.label
|
|
7125
|
+
}), showBadge && /*#__PURE__*/jsx(Tag3, {
|
|
7126
|
+
text: "".concat(state.selectedWidgets.length, " selected")
|
|
7127
|
+
})]
|
|
7128
|
+
}, opt.key);
|
|
7099
7129
|
})]
|
|
7100
7130
|
}), /*#__PURE__*/jsxs("div", {
|
|
7101
|
-
className: "flex flex-col
|
|
7131
|
+
className: "flex flex-col",
|
|
7102
7132
|
children: [/*#__PURE__*/jsx("span", {
|
|
7103
|
-
className:
|
|
7104
|
-
children: "
|
|
7105
|
-
}),
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7133
|
+
className: sectionLabelClass,
|
|
7134
|
+
children: "CATEGORIES"
|
|
7135
|
+
}), DASHBOARD_TAGS$1.map(function (tag) {
|
|
7136
|
+
var active = filters.categories.includes(tag);
|
|
7137
|
+
return /*#__PURE__*/jsx("button", {
|
|
7138
|
+
type: "button",
|
|
7139
|
+
onClick: function onClick() {
|
|
7140
|
+
return handleToggleCategory(tag);
|
|
7141
|
+
},
|
|
7142
|
+
className: "".concat(rowClass(active), " capitalize"),
|
|
7143
|
+
children: /*#__PURE__*/jsx("span", {
|
|
7144
|
+
children: tag
|
|
7145
|
+
})
|
|
7146
|
+
}, tag);
|
|
7116
7147
|
})]
|
|
7117
|
-
})
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
onClick: function onClick() {
|
|
7133
|
-
return setActiveTab("widgets");
|
|
7134
|
-
},
|
|
7135
|
-
children: ["Widgets (", filteredWidgets.length, ")", state.selectedWidgets.length > 0 && /*#__PURE__*/jsx("span", {
|
|
7136
|
-
className: "ml-1.5",
|
|
7137
|
-
children: /*#__PURE__*/jsx(Tag3, {
|
|
7138
|
-
text: "".concat(state.selectedWidgets.length, " selected")
|
|
7148
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7149
|
+
className: "flex flex-col",
|
|
7150
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
7151
|
+
className: sectionLabelClass,
|
|
7152
|
+
children: "PROVIDERS"
|
|
7153
|
+
}), KNOWN_PROVIDERS.map(function (prov) {
|
|
7154
|
+
var active = filters.providers.includes(prov.key);
|
|
7155
|
+
return /*#__PURE__*/jsx("button", {
|
|
7156
|
+
type: "button",
|
|
7157
|
+
onClick: function onClick() {
|
|
7158
|
+
return handleToggleProvider(prov.key);
|
|
7159
|
+
},
|
|
7160
|
+
className: rowClass(active),
|
|
7161
|
+
children: /*#__PURE__*/jsx("span", {
|
|
7162
|
+
children: prov.name
|
|
7139
7163
|
})
|
|
7140
|
-
})
|
|
7164
|
+
}, prov.key);
|
|
7141
7165
|
})]
|
|
7142
|
-
}), hasSelection && /*#__PURE__*/jsx(Button, {
|
|
7143
|
-
onClick: handleClearSelection,
|
|
7144
|
-
title: "Clear Selection",
|
|
7145
|
-
textSize: "text-xs",
|
|
7146
|
-
padding: "py-1 px-3",
|
|
7147
|
-
backgroundColor: "bg-gray-700",
|
|
7148
|
-
textColor: "text-gray-400",
|
|
7149
|
-
hoverTextColor: "hover:text-white",
|
|
7150
|
-
hoverBackgroundColor: "hover:bg-gray-600",
|
|
7151
|
-
icon: "xmark"
|
|
7152
7166
|
})]
|
|
7153
|
-
}), /*#__PURE__*/
|
|
7154
|
-
className: "flex flex-col gap-
|
|
7155
|
-
children:
|
|
7156
|
-
className: "flex
|
|
7157
|
-
children: [/*#__PURE__*/jsx(
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
})]
|
|
7164
|
-
}) : error ? /*#__PURE__*/jsxs("div", {
|
|
7165
|
-
className: "flex items-center gap-2 text-red-400 py-4",
|
|
7166
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7167
|
-
icon: "circle-exclamation",
|
|
7168
|
-
fixedWidth: true
|
|
7169
|
-
}), /*#__PURE__*/jsx("span", {
|
|
7170
|
-
children: error
|
|
7171
|
-
})]
|
|
7172
|
-
}) : !hasResults ? /*#__PURE__*/jsxs("div", {
|
|
7173
|
-
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-500",
|
|
7174
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7175
|
-
icon: "magnifying-glass",
|
|
7176
|
-
fixedWidth: true
|
|
7177
|
-
}), /*#__PURE__*/jsx("p", {
|
|
7178
|
-
children: "No results match your search."
|
|
7179
|
-
}), hasActiveFilters && /*#__PURE__*/jsx("p", {
|
|
7180
|
-
className: "text-xs text-gray-600",
|
|
7181
|
-
children: "Try removing some filters to see more results."
|
|
7182
|
-
})]
|
|
7183
|
-
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
7184
|
-
children: [activeTab === "dashboards" && filteredDashboards.length > 0 && /*#__PURE__*/jsx("div", {
|
|
7185
|
-
className: "flex flex-col gap-3",
|
|
7186
|
-
children: /*#__PURE__*/jsx("div", {
|
|
7187
|
-
className: "grid grid-cols-3 gap-3",
|
|
7188
|
-
children: filteredDashboards.map(function (dash) {
|
|
7189
|
-
var isSelected = state.selectedDashboard && state.selectedDashboard.name === dash.name;
|
|
7190
|
-
var widgetCount = (dash.widgets || []).length;
|
|
7191
|
-
var providerTags = (dash.providers || []).map(function (p) {
|
|
7192
|
-
return p.name || p.type;
|
|
7193
|
-
}).filter(Boolean);
|
|
7194
|
-
return /*#__PURE__*/jsxs(Card2, {
|
|
7195
|
-
hover: true,
|
|
7196
|
-
selected: isSelected,
|
|
7197
|
-
padding: "p-5",
|
|
7198
|
-
rounded: "rounded-lg",
|
|
7199
|
-
className: "hover:shadow-lg",
|
|
7200
|
-
onClick: function onClick() {
|
|
7201
|
-
return handleSelectDashboard(dash);
|
|
7202
|
-
},
|
|
7203
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
7204
|
-
className: "flex flex-col items-center text-center gap-2",
|
|
7205
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
7206
|
-
className: "relative",
|
|
7207
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
7208
|
-
className: "text-2xl",
|
|
7209
|
-
children: /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7210
|
-
icon: resolveIcon(dash.icon || "grid-2"),
|
|
7211
|
-
fixedWidth: true,
|
|
7212
|
-
className: "text-gray-400"
|
|
7213
|
-
})
|
|
7214
|
-
}), isSelected && /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7215
|
-
icon: "circle-check",
|
|
7216
|
-
className: "absolute -top-1 -right-3 text-blue-400 text-xs"
|
|
7217
|
-
})]
|
|
7218
|
-
}), /*#__PURE__*/jsx("span", {
|
|
7219
|
-
className: "text-sm font-semibold text-gray-200",
|
|
7220
|
-
children: dash.displayName || dash.name
|
|
7221
|
-
})]
|
|
7222
|
-
}), dash.description && /*#__PURE__*/jsx("p", {
|
|
7223
|
-
className: "text-xs text-gray-400 mt-2 line-clamp-2 text-center",
|
|
7224
|
-
children: dash.description
|
|
7225
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
7226
|
-
className: "flex items-center justify-between mt-3 pt-2 border-t border-gray-700/50",
|
|
7227
|
-
children: [/*#__PURE__*/jsxs("span", {
|
|
7228
|
-
className: "text-xs text-gray-500",
|
|
7229
|
-
children: [widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
7230
|
-
}), providerTags.length > 0 && /*#__PURE__*/jsx("div", {
|
|
7231
|
-
className: "flex flex-wrap gap-1 justify-end",
|
|
7232
|
-
children: providerTags.slice(0, 3).map(function (tag) {
|
|
7233
|
-
return /*#__PURE__*/jsx("span", {
|
|
7234
|
-
className: "text-xs px-1.5 py-0.5 rounded bg-gray-800 text-gray-400",
|
|
7235
|
-
children: tag
|
|
7236
|
-
}, tag);
|
|
7237
|
-
})
|
|
7238
|
-
})]
|
|
7239
|
-
})]
|
|
7240
|
-
}, dash.name);
|
|
7241
|
-
})
|
|
7167
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7168
|
+
className: "flex-1 min-w-0 flex flex-col gap-4",
|
|
7169
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
7170
|
+
className: "flex items-center gap-3",
|
|
7171
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
7172
|
+
className: "flex-1",
|
|
7173
|
+
children: /*#__PURE__*/jsx(InputText, {
|
|
7174
|
+
value: searchQuery,
|
|
7175
|
+
onChange: handleSearchChange,
|
|
7176
|
+
placeholder: "Search registry..."
|
|
7242
7177
|
})
|
|
7243
|
-
}),
|
|
7178
|
+
}), hasSelection && /*#__PURE__*/jsx(Button, {
|
|
7179
|
+
onClick: handleClearSelection,
|
|
7180
|
+
title: "Clear Selection",
|
|
7181
|
+
textSize: "text-xs",
|
|
7182
|
+
padding: "py-1 px-3",
|
|
7183
|
+
backgroundColor: "bg-gray-700",
|
|
7184
|
+
textColor: "text-gray-400",
|
|
7185
|
+
hoverTextColor: "hover:text-white",
|
|
7186
|
+
hoverBackgroundColor: "hover:bg-gray-600",
|
|
7187
|
+
icon: "xmark"
|
|
7188
|
+
})]
|
|
7189
|
+
}), !isLoading && !error && /*#__PURE__*/jsx("div", {
|
|
7190
|
+
className: "text-xs text-gray-500 px-1",
|
|
7191
|
+
children: showDashboards ? "".concat(visibleDashboards.length, " dashboard").concat(visibleDashboards.length === 1 ? "" : "s") : "".concat(visibleWidgets.length, " widget").concat(visibleWidgets.length === 1 ? "" : "s")
|
|
7192
|
+
}), /*#__PURE__*/jsx("div", {
|
|
7193
|
+
className: "flex flex-col gap-6",
|
|
7194
|
+
children: isLoading ? /*#__PURE__*/jsxs("div", {
|
|
7195
|
+
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-400",
|
|
7196
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7197
|
+
icon: "spinner",
|
|
7198
|
+
spin: true,
|
|
7199
|
+
fixedWidth: true
|
|
7200
|
+
}), /*#__PURE__*/jsx("span", {
|
|
7201
|
+
children: "Searching registry..."
|
|
7202
|
+
})]
|
|
7203
|
+
}) : error ? /*#__PURE__*/jsxs("div", {
|
|
7204
|
+
className: "flex items-center gap-2 text-red-400 py-4",
|
|
7205
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7206
|
+
icon: "circle-exclamation",
|
|
7207
|
+
fixedWidth: true
|
|
7208
|
+
}), /*#__PURE__*/jsx("span", {
|
|
7209
|
+
children: error
|
|
7210
|
+
})]
|
|
7211
|
+
}) : !hasResults ? /*#__PURE__*/jsxs("div", {
|
|
7244
7212
|
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-500",
|
|
7245
7213
|
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7246
|
-
icon: "
|
|
7214
|
+
icon: "magnifying-glass",
|
|
7247
7215
|
fixedWidth: true
|
|
7248
7216
|
}), /*#__PURE__*/jsx("p", {
|
|
7249
|
-
children: "No
|
|
7217
|
+
children: "No results match your search."
|
|
7218
|
+
}), hasActiveFilters && /*#__PURE__*/jsx("p", {
|
|
7219
|
+
className: "text-xs text-gray-600",
|
|
7220
|
+
children: "Try removing some filters to see more results."
|
|
7250
7221
|
})]
|
|
7251
|
-
})
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
className: "
|
|
7222
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
7223
|
+
children: [showDashboards && visibleDashboards.length > 0 && /*#__PURE__*/jsx("div", {
|
|
7224
|
+
className: "flex flex-col gap-3",
|
|
7225
|
+
children: /*#__PURE__*/jsx("div", {
|
|
7226
|
+
className: "grid grid-cols-3 gap-3",
|
|
7227
|
+
children: visibleDashboards.map(function (dash) {
|
|
7228
|
+
var isSelected = state.selectedDashboard && state.selectedDashboard.name === dash.name;
|
|
7229
|
+
var widgetCount = (dash.widgets || []).length;
|
|
7230
|
+
var providerTags = (dash.providers || []).map(function (p) {
|
|
7231
|
+
return p.name || p.type;
|
|
7232
|
+
}).filter(Boolean);
|
|
7233
|
+
return /*#__PURE__*/jsxs(Card2, {
|
|
7234
|
+
hover: true,
|
|
7235
|
+
selected: isSelected,
|
|
7236
|
+
padding: "p-5",
|
|
7237
|
+
rounded: "rounded-lg",
|
|
7238
|
+
className: "hover:shadow-lg",
|
|
7239
|
+
onClick: function onClick() {
|
|
7240
|
+
return handleSelectDashboard(dash);
|
|
7241
|
+
},
|
|
7268
7242
|
children: [/*#__PURE__*/jsxs("div", {
|
|
7269
|
-
className: "flex items-center gap-
|
|
7270
|
-
children: [
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7243
|
+
className: "flex flex-col items-center text-center gap-2",
|
|
7244
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
7245
|
+
className: "relative",
|
|
7246
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
7247
|
+
className: "text-2xl",
|
|
7248
|
+
children: /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7249
|
+
icon: resolveIcon(dash.icon || "grid-2"),
|
|
7250
|
+
fixedWidth: true,
|
|
7251
|
+
className: "text-gray-400"
|
|
7252
|
+
})
|
|
7253
|
+
}), isSelected && /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7254
|
+
icon: "circle-check",
|
|
7255
|
+
className: "absolute -top-1 -right-3 text-blue-400 text-xs"
|
|
7256
|
+
})]
|
|
7274
7257
|
}), /*#__PURE__*/jsx("span", {
|
|
7275
|
-
className: "text-sm font-
|
|
7276
|
-
children:
|
|
7258
|
+
className: "text-sm font-semibold text-gray-200",
|
|
7259
|
+
children: dash.displayName || dash.name
|
|
7260
|
+
})]
|
|
7261
|
+
}), dash.description && /*#__PURE__*/jsx("p", {
|
|
7262
|
+
className: "text-xs text-gray-400 mt-2 line-clamp-2 text-center",
|
|
7263
|
+
children: dash.description
|
|
7264
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7265
|
+
className: "flex items-center justify-between mt-3 pt-2 border-t border-gray-700/50",
|
|
7266
|
+
children: [/*#__PURE__*/jsxs("span", {
|
|
7267
|
+
className: "text-xs text-gray-500",
|
|
7268
|
+
children: [widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
7269
|
+
}), providerTags.length > 0 && /*#__PURE__*/jsx("div", {
|
|
7270
|
+
className: "flex flex-wrap gap-1 justify-end",
|
|
7271
|
+
children: providerTags.slice(0, 3).map(function (tag) {
|
|
7272
|
+
return /*#__PURE__*/jsx("span", {
|
|
7273
|
+
className: "text-xs px-1.5 py-0.5 rounded bg-gray-800 text-gray-400",
|
|
7274
|
+
children: tag
|
|
7275
|
+
}, tag);
|
|
7276
|
+
})
|
|
7277
7277
|
})]
|
|
7278
|
-
}), /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7279
|
-
icon: checked ? "square-check" : "square",
|
|
7280
|
-
fixedWidth: true,
|
|
7281
|
-
className: checked ? "text-blue-400 flex-shrink-0" : "text-gray-500 flex-shrink-0"
|
|
7282
7278
|
})]
|
|
7283
|
-
}
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7279
|
+
}, dash.name);
|
|
7280
|
+
})
|
|
7281
|
+
})
|
|
7282
|
+
}), showWidgets && visibleWidgets.length > 0 && /*#__PURE__*/jsx("div", {
|
|
7283
|
+
className: "flex flex-col gap-3",
|
|
7284
|
+
children: /*#__PURE__*/jsx("div", {
|
|
7285
|
+
className: "grid grid-cols-3 gap-3",
|
|
7286
|
+
children: visibleWidgets.map(function (widget) {
|
|
7287
|
+
var checked = isWidgetSelected(widget);
|
|
7288
|
+
return /*#__PURE__*/jsxs(Card2, {
|
|
7289
|
+
hover: true,
|
|
7290
|
+
selected: checked,
|
|
7291
|
+
padding: "p-4",
|
|
7292
|
+
rounded: "rounded-lg",
|
|
7293
|
+
className: "hover:shadow-lg flex flex-col",
|
|
7294
|
+
onClick: function onClick() {
|
|
7295
|
+
return handleToggleWidget(widget);
|
|
7296
|
+
},
|
|
7297
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
7298
|
+
className: "flex items-start justify-between gap-2",
|
|
7299
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
7300
|
+
className: "flex items-center gap-1.5",
|
|
7301
|
+
children: [widget.icon && /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7302
|
+
icon: resolveIcon(widget.icon),
|
|
7303
|
+
fixedWidth: true,
|
|
7304
|
+
className: "text-gray-400 text-sm"
|
|
7305
|
+
}), /*#__PURE__*/jsx("span", {
|
|
7306
|
+
className: "text-sm font-medium text-gray-200 truncate",
|
|
7307
|
+
children: widget.name
|
|
7308
|
+
})]
|
|
7309
|
+
}), /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7310
|
+
icon: checked ? "square-check" : "square",
|
|
7311
|
+
fixedWidth: true,
|
|
7312
|
+
className: checked ? "text-blue-400 flex-shrink-0" : "text-gray-500 flex-shrink-0"
|
|
7313
|
+
})]
|
|
7314
|
+
}), widget.description && /*#__PURE__*/jsx("p", {
|
|
7315
|
+
className: "text-xs text-gray-400 line-clamp-2 mt-1.5 flex-1",
|
|
7316
|
+
children: widget.description
|
|
7317
|
+
}), widget.packageDisplayName && /*#__PURE__*/jsx("span", {
|
|
7318
|
+
className: "text-xs text-gray-500 mt-2 pt-1.5 border-t border-gray-700/50 truncate",
|
|
7319
|
+
children: widget.packageDisplayName
|
|
7320
|
+
})]
|
|
7321
|
+
}, widget.key);
|
|
7322
|
+
})
|
|
7291
7323
|
})
|
|
7292
|
-
})
|
|
7293
|
-
}), activeTab === "widgets" && filteredWidgets.length === 0 && /*#__PURE__*/jsxs("div", {
|
|
7294
|
-
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-500",
|
|
7295
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7296
|
-
icon: "puzzle-piece",
|
|
7297
|
-
fixedWidth: true
|
|
7298
|
-
}), /*#__PURE__*/jsx("p", {
|
|
7299
|
-
children: "No widgets match your search."
|
|
7300
7324
|
})]
|
|
7301
|
-
})
|
|
7302
|
-
})
|
|
7325
|
+
})
|
|
7326
|
+
})]
|
|
7303
7327
|
})]
|
|
7304
7328
|
});
|
|
7305
7329
|
};
|
|
@@ -9294,7 +9318,7 @@ hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBu
|
|
|
9294
9318
|
var hasPropertyDescriptors_1 = hasPropertyDescriptors;
|
|
9295
9319
|
|
|
9296
9320
|
var keys = objectKeys$2;
|
|
9297
|
-
var hasSymbols$
|
|
9321
|
+
var hasSymbols$5 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
|
9298
9322
|
|
|
9299
9323
|
var toStr$4 = Object.prototype.toString;
|
|
9300
9324
|
var concat = Array.prototype.concat;
|
|
@@ -9327,7 +9351,7 @@ var defineProperty$1 = function (object, name, value, predicate) {
|
|
|
9327
9351
|
var defineProperties$1 = function (object, map) {
|
|
9328
9352
|
var predicates = arguments.length > 2 ? arguments[2] : {};
|
|
9329
9353
|
var props = keys(map);
|
|
9330
|
-
if (hasSymbols$
|
|
9354
|
+
if (hasSymbols$5) {
|
|
9331
9355
|
props = concat.call(props, Object.getOwnPropertySymbols(map));
|
|
9332
9356
|
}
|
|
9333
9357
|
for (var i = 0; i < props.length; i += 1) {
|
|
@@ -9393,11 +9417,11 @@ var sign$1 = function sign(number) {
|
|
|
9393
9417
|
};
|
|
9394
9418
|
|
|
9395
9419
|
var shams$1;
|
|
9396
|
-
var hasRequiredShams
|
|
9420
|
+
var hasRequiredShams;
|
|
9397
9421
|
|
|
9398
|
-
function requireShams
|
|
9399
|
-
if (hasRequiredShams
|
|
9400
|
-
hasRequiredShams
|
|
9422
|
+
function requireShams () {
|
|
9423
|
+
if (hasRequiredShams) return shams$1;
|
|
9424
|
+
hasRequiredShams = 1;
|
|
9401
9425
|
|
|
9402
9426
|
/** @type {import('./shams')} */
|
|
9403
9427
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
@@ -9446,10 +9470,10 @@ function requireShams$1 () {
|
|
|
9446
9470
|
}
|
|
9447
9471
|
|
|
9448
9472
|
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
9449
|
-
var hasSymbolSham = requireShams
|
|
9473
|
+
var hasSymbolSham = requireShams();
|
|
9450
9474
|
|
|
9451
9475
|
/** @type {import('.')} */
|
|
9452
|
-
var hasSymbols$
|
|
9476
|
+
var hasSymbols$4 = function hasNativeSymbols() {
|
|
9453
9477
|
if (typeof origSymbol !== 'function') { return false; }
|
|
9454
9478
|
if (typeof Symbol !== 'function') { return false; }
|
|
9455
9479
|
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
|
@@ -9753,7 +9777,7 @@ var ThrowTypeError = $gOPD$1
|
|
|
9753
9777
|
}())
|
|
9754
9778
|
: throwTypeError;
|
|
9755
9779
|
|
|
9756
|
-
var hasSymbols$
|
|
9780
|
+
var hasSymbols$3 = hasSymbols$4();
|
|
9757
9781
|
|
|
9758
9782
|
var getProto$2 = getProto$3;
|
|
9759
9783
|
var $ObjectGPO = requireObject_getPrototypeOf();
|
|
@@ -9771,7 +9795,7 @@ var INTRINSICS = {
|
|
|
9771
9795
|
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
9772
9796
|
'%Array%': Array,
|
|
9773
9797
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
9774
|
-
'%ArrayIteratorPrototype%': hasSymbols$
|
|
9798
|
+
'%ArrayIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2([][Symbol.iterator]()) : undefined$1,
|
|
9775
9799
|
'%AsyncFromSyncIteratorPrototype%': undefined$1,
|
|
9776
9800
|
'%AsyncFunction%': needsEval,
|
|
9777
9801
|
'%AsyncGenerator%': needsEval,
|
|
@@ -9802,10 +9826,10 @@ var INTRINSICS = {
|
|
|
9802
9826
|
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
|
|
9803
9827
|
'%isFinite%': isFinite,
|
|
9804
9828
|
'%isNaN%': isNaN,
|
|
9805
|
-
'%IteratorPrototype%': hasSymbols$
|
|
9829
|
+
'%IteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(getProto$2([][Symbol.iterator]())) : undefined$1,
|
|
9806
9830
|
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
|
|
9807
9831
|
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
9808
|
-
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$
|
|
9832
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Map()[Symbol.iterator]()),
|
|
9809
9833
|
'%Math%': Math,
|
|
9810
9834
|
'%Number%': Number,
|
|
9811
9835
|
'%Object%': $Object$2,
|
|
@@ -9819,11 +9843,11 @@ var INTRINSICS = {
|
|
|
9819
9843
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
9820
9844
|
'%RegExp%': RegExp,
|
|
9821
9845
|
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
9822
|
-
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$
|
|
9846
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$2 ? undefined$1 : getProto$2(new Set()[Symbol.iterator]()),
|
|
9823
9847
|
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
|
|
9824
9848
|
'%String%': String,
|
|
9825
|
-
'%StringIteratorPrototype%': hasSymbols$
|
|
9826
|
-
'%Symbol%': hasSymbols$
|
|
9849
|
+
'%StringIteratorPrototype%': hasSymbols$3 && getProto$2 ? getProto$2(''[Symbol.iterator]()) : undefined$1,
|
|
9850
|
+
'%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
|
|
9827
9851
|
'%SyntaxError%': $SyntaxError$1,
|
|
9828
9852
|
'%ThrowTypeError%': ThrowTypeError,
|
|
9829
9853
|
'%TypedArray%': TypedArray,
|
|
@@ -10176,12 +10200,12 @@ var callBound$i = function callBoundIntrinsic(name, allowMissing) {
|
|
|
10176
10200
|
|
|
10177
10201
|
// modified from https://github.com/es-shims/es6-shim
|
|
10178
10202
|
var objectKeys$1 = objectKeys$2;
|
|
10179
|
-
var hasSymbols$
|
|
10203
|
+
var hasSymbols$2 = requireShams()();
|
|
10180
10204
|
var callBound$h = callBound$i;
|
|
10181
10205
|
var $Object$1 = esObjectAtoms;
|
|
10182
10206
|
var $push = callBound$h('Array.prototype.push');
|
|
10183
10207
|
var $propIsEnumerable = callBound$h('Object.prototype.propertyIsEnumerable');
|
|
10184
|
-
var originalGetSymbols = hasSymbols$
|
|
10208
|
+
var originalGetSymbols = hasSymbols$2 ? $Object$1.getOwnPropertySymbols : null;
|
|
10185
10209
|
|
|
10186
10210
|
// eslint-disable-next-line no-unused-vars
|
|
10187
10211
|
var implementation$8 = function assign(target, source1) {
|
|
@@ -10195,7 +10219,7 @@ var implementation$8 = function assign(target, source1) {
|
|
|
10195
10219
|
|
|
10196
10220
|
// step 3.a.ii:
|
|
10197
10221
|
var keys = objectKeys$1(from);
|
|
10198
|
-
var getSymbols = hasSymbols$
|
|
10222
|
+
var getSymbols = hasSymbols$2 && ($Object$1.getOwnPropertySymbols || originalGetSymbols);
|
|
10199
10223
|
if (getSymbols) {
|
|
10200
10224
|
var syms = getSymbols(from);
|
|
10201
10225
|
for (var j = 0; j < syms.length; ++j) {
|
|
@@ -10492,23 +10516,14 @@ var regexp_prototype_flags = flagsBound;
|
|
|
10492
10516
|
|
|
10493
10517
|
var esGetIterator = {exports: {}};
|
|
10494
10518
|
|
|
10495
|
-
var
|
|
10496
|
-
var hasRequiredShams;
|
|
10497
|
-
|
|
10498
|
-
function requireShams () {
|
|
10499
|
-
if (hasRequiredShams) return shams;
|
|
10500
|
-
hasRequiredShams = 1;
|
|
10501
|
-
|
|
10502
|
-
var hasSymbols = requireShams$1();
|
|
10519
|
+
var hasSymbols$1 = requireShams();
|
|
10503
10520
|
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
return shams;
|
|
10509
|
-
}
|
|
10521
|
+
/** @type {import('.')} */
|
|
10522
|
+
var shams = function hasToStringTagShams() {
|
|
10523
|
+
return hasSymbols$1() && !!Symbol.toStringTag;
|
|
10524
|
+
};
|
|
10510
10525
|
|
|
10511
|
-
var hasToStringTag$7 =
|
|
10526
|
+
var hasToStringTag$7 = shams();
|
|
10512
10527
|
var callBound$f = callBound$i;
|
|
10513
10528
|
|
|
10514
10529
|
var $toString$7 = callBound$f('Object.prototype.toString');
|
|
@@ -11545,7 +11560,7 @@ var tryStringObject = function tryStringObject(value) {
|
|
|
11545
11560
|
/** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
|
|
11546
11561
|
var $toString$6 = callBound$c('Object.prototype.toString');
|
|
11547
11562
|
var strClass = '[object String]';
|
|
11548
|
-
var hasToStringTag$6 =
|
|
11563
|
+
var hasToStringTag$6 = shams();
|
|
11549
11564
|
|
|
11550
11565
|
/** @type {import('.')} */
|
|
11551
11566
|
var isString$2 = function isString(value) {
|
|
@@ -11661,7 +11676,7 @@ var isSet$2 = exported$1 || function isSet(x) {
|
|
|
11661
11676
|
var isArguments$1 = isArguments$2;
|
|
11662
11677
|
var getStopIterationIterator = stopIterationIterator;
|
|
11663
11678
|
|
|
11664
|
-
if (hasSymbols$
|
|
11679
|
+
if (hasSymbols$4() || requireShams()()) {
|
|
11665
11680
|
var $iterator = Symbol.iterator;
|
|
11666
11681
|
// Symbol is available natively or shammed
|
|
11667
11682
|
// natively:
|
|
@@ -11950,7 +11965,7 @@ var tryDateObject = function tryDateGetDayCall(value) {
|
|
|
11950
11965
|
/** @type {(value: unknown) => string} */
|
|
11951
11966
|
var toStr$2 = callBound$9('Object.prototype.toString');
|
|
11952
11967
|
var dateClass = '[object Date]';
|
|
11953
|
-
var hasToStringTag$5 =
|
|
11968
|
+
var hasToStringTag$5 = shams();
|
|
11954
11969
|
|
|
11955
11970
|
/** @type {import('.')} */
|
|
11956
11971
|
var isDateObject = function isDateObject(value) {
|
|
@@ -11961,7 +11976,7 @@ var isDateObject = function isDateObject(value) {
|
|
|
11961
11976
|
};
|
|
11962
11977
|
|
|
11963
11978
|
var callBound$8 = callBound$i;
|
|
11964
|
-
var hasToStringTag$4 =
|
|
11979
|
+
var hasToStringTag$4 = shams();
|
|
11965
11980
|
var hasOwn = hasown;
|
|
11966
11981
|
var gOPD$1 = gopd$1;
|
|
11967
11982
|
|
|
@@ -12066,7 +12081,7 @@ var tryNumberObject = function tryNumberObject(value) {
|
|
|
12066
12081
|
};
|
|
12067
12082
|
var $toString$3 = callBound$6('Object.prototype.toString');
|
|
12068
12083
|
var numClass = '[object Number]';
|
|
12069
|
-
var hasToStringTag$3 =
|
|
12084
|
+
var hasToStringTag$3 = shams();
|
|
12070
12085
|
|
|
12071
12086
|
/** @type {import('.')} */
|
|
12072
12087
|
var isNumberObject = function isNumberObject(value) {
|
|
@@ -12093,7 +12108,7 @@ var tryBooleanObject = function booleanBrandCheck(value) {
|
|
|
12093
12108
|
}
|
|
12094
12109
|
};
|
|
12095
12110
|
var boolClass = '[object Boolean]';
|
|
12096
|
-
var hasToStringTag$2 =
|
|
12111
|
+
var hasToStringTag$2 = shams();
|
|
12097
12112
|
|
|
12098
12113
|
/** @type {import('.')} */
|
|
12099
12114
|
var isBooleanObject = function isBoolean(value) {
|
|
@@ -12135,7 +12150,7 @@ function requireSafeRegexTest () {
|
|
|
12135
12150
|
|
|
12136
12151
|
var callBound$4 = callBound$i;
|
|
12137
12152
|
var $toString$1 = callBound$4('Object.prototype.toString');
|
|
12138
|
-
var hasSymbols = hasSymbols$
|
|
12153
|
+
var hasSymbols = hasSymbols$4();
|
|
12139
12154
|
var safeRegexTest = requireSafeRegexTest();
|
|
12140
12155
|
|
|
12141
12156
|
if (hasSymbols) {
|
|
@@ -12581,7 +12596,7 @@ var gOPD = gopd$1;
|
|
|
12581
12596
|
var getProto = getProto$3;
|
|
12582
12597
|
|
|
12583
12598
|
var $toString = callBound$2('Object.prototype.toString');
|
|
12584
|
-
var hasToStringTag =
|
|
12599
|
+
var hasToStringTag = shams();
|
|
12585
12600
|
|
|
12586
12601
|
var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
|
|
12587
12602
|
var typedArrays = availableTypedArrays();
|