@trops/dash-core 0.1.460 → 0.1.462
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 +317 -247
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +317 -247
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6888,6 +6888,11 @@ var useRegistrySearch = function useRegistrySearch() {
|
|
|
6888
6888
|
search: search,
|
|
6889
6889
|
installPackage: installPackage,
|
|
6890
6890
|
retry: retry,
|
|
6891
|
+
// refetch is an alias of retry, exposed under the name the
|
|
6892
|
+
// Wizard's sign-in flow uses to re-fetch the registry once
|
|
6893
|
+
// the user signs in (so private results show up without a
|
|
6894
|
+
// manual reload).
|
|
6895
|
+
refetch: retry,
|
|
6891
6896
|
showAllPackages: showAllPackages,
|
|
6892
6897
|
setShowAllPackages: setShowAllPackages,
|
|
6893
6898
|
appCapabilities: appCapabilities
|
|
@@ -6996,7 +7001,27 @@ var WizardDiscoverStep = function WizardDiscoverStep(_ref) {
|
|
|
6996
7001
|
isLoading = _useRegistrySearch.isLoading,
|
|
6997
7002
|
error = _useRegistrySearch.error,
|
|
6998
7003
|
searchQuery = _useRegistrySearch.searchQuery,
|
|
6999
|
-
setSearchQuery = _useRegistrySearch.setSearchQuery
|
|
7004
|
+
setSearchQuery = _useRegistrySearch.setSearchQuery,
|
|
7005
|
+
refetch = _useRegistrySearch.refetch;
|
|
7006
|
+
|
|
7007
|
+
// --- Registry auth (device-code OAuth) ---
|
|
7008
|
+
// Surfaces a sign-in CTA when the user isn't authenticated so they
|
|
7009
|
+
// see private dashboards/widgets they have access to. After
|
|
7010
|
+
// successful auth, `refetch` re-runs the registry search so the
|
|
7011
|
+
// results refresh automatically — no manual reload needed.
|
|
7012
|
+
var _useRegistryAuth = useRegistryAuth(),
|
|
7013
|
+
isAuthenticated = _useRegistryAuth.isAuthenticated,
|
|
7014
|
+
isAuthenticating = _useRegistryAuth.isAuthenticating,
|
|
7015
|
+
authError = _useRegistryAuth.authError,
|
|
7016
|
+
checkAuth = _useRegistryAuth.checkAuth,
|
|
7017
|
+
initiateAuth = _useRegistryAuth.initiateAuth,
|
|
7018
|
+
cancelAuth = _useRegistryAuth.cancelAuth;
|
|
7019
|
+
React.useEffect(function () {
|
|
7020
|
+
checkAuth();
|
|
7021
|
+
}, [checkAuth]);
|
|
7022
|
+
var handleSignIn = React.useCallback(function () {
|
|
7023
|
+
initiateAuth(refetch);
|
|
7024
|
+
}, [initiateAuth, refetch]);
|
|
7000
7025
|
|
|
7001
7026
|
// Sync search query from wizard state on mount
|
|
7002
7027
|
React.useEffect(function () {
|
|
@@ -7121,226 +7146,263 @@ var WizardDiscoverStep = function WizardDiscoverStep(_ref) {
|
|
|
7121
7146
|
};
|
|
7122
7147
|
var sectionLabelClass = "text-xs font-semibold text-gray-400 uppercase tracking-wide px-3 mb-1";
|
|
7123
7148
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7124
|
-
className: "flex flex-
|
|
7125
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("
|
|
7126
|
-
className: "flex-
|
|
7127
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
className: sectionLabelClass,
|
|
7131
|
-
children: "TYPE"
|
|
7132
|
-
}), TYPE_OPTIONS.map(function (opt) {
|
|
7133
|
-
var active = typeFilter === opt.key;
|
|
7134
|
-
var showBadge = opt.key === "widgets" && state.selectedWidgets.length > 0;
|
|
7135
|
-
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
7136
|
-
type: "button",
|
|
7137
|
-
onClick: function onClick() {
|
|
7138
|
-
return setTypeFilter(opt.key);
|
|
7139
|
-
},
|
|
7140
|
-
className: rowClass(active),
|
|
7141
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7142
|
-
children: opt.label
|
|
7143
|
-
}), showBadge && /*#__PURE__*/jsxRuntime.jsx(DashReact.Tag3, {
|
|
7144
|
-
text: "".concat(state.selectedWidgets.length, " selected")
|
|
7145
|
-
})]
|
|
7146
|
-
}, opt.key);
|
|
7147
|
-
})]
|
|
7149
|
+
className: "flex flex-col gap-4",
|
|
7150
|
+
children: [!isAuthenticated && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7151
|
+
className: "flex items-center gap-3 px-4 py-2 rounded-lg bg-gray-800 text-gray-300",
|
|
7152
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7153
|
+
icon: "circle-info",
|
|
7154
|
+
className: "text-blue-400 text-sm flex-shrink-0"
|
|
7148
7155
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7149
|
-
className: "flex flex-col",
|
|
7156
|
+
className: "flex-1 min-w-0 flex flex-col",
|
|
7150
7157
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7151
|
-
className:
|
|
7152
|
-
children: "
|
|
7153
|
-
}),
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
type: "button",
|
|
7157
|
-
onClick: function onClick() {
|
|
7158
|
-
return handleToggleCategory(tag);
|
|
7159
|
-
},
|
|
7160
|
-
className: "".concat(rowClass(active), " capitalize"),
|
|
7161
|
-
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7162
|
-
children: tag
|
|
7163
|
-
})
|
|
7164
|
-
}, tag);
|
|
7158
|
+
className: "text-sm text-gray-200",
|
|
7159
|
+
children: "Sign in to registry"
|
|
7160
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7161
|
+
className: "text-xs text-gray-400",
|
|
7162
|
+
children: "See dashboards and widgets you have access to"
|
|
7165
7163
|
})]
|
|
7166
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
7167
|
-
|
|
7164
|
+
}), !isAuthenticating ? /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7165
|
+
type: "button",
|
|
7166
|
+
onClick: handleSignIn,
|
|
7167
|
+
className: "flex-shrink-0 text-xs py-1.5 px-3 rounded bg-blue-600 text-white hover:bg-blue-500 transition-colors",
|
|
7168
|
+
children: "Sign in"
|
|
7169
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7170
|
+
className: "flex items-center gap-2 flex-shrink-0",
|
|
7168
7171
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7169
|
-
className:
|
|
7170
|
-
children: "
|
|
7171
|
-
}),
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
return handleToggleProvider(prov.key);
|
|
7177
|
-
},
|
|
7178
|
-
className: rowClass(active),
|
|
7179
|
-
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7180
|
-
children: prov.name
|
|
7181
|
-
})
|
|
7182
|
-
}, prov.key);
|
|
7172
|
+
className: "text-xs text-gray-400",
|
|
7173
|
+
children: "Waiting for browser\u2026"
|
|
7174
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7175
|
+
type: "button",
|
|
7176
|
+
onClick: cancelAuth,
|
|
7177
|
+
className: "text-xs text-gray-400 hover:text-gray-200 underline",
|
|
7178
|
+
children: "Cancel"
|
|
7183
7179
|
})]
|
|
7180
|
+
}), authError && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7181
|
+
className: "flex-shrink-0 text-xs text-red-400",
|
|
7182
|
+
children: authError
|
|
7184
7183
|
})]
|
|
7185
7184
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7186
|
-
className: "flex
|
|
7187
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("
|
|
7188
|
-
className: "flex
|
|
7189
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
7190
|
-
className: "flex-
|
|
7191
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
children: showDashboards ? "".concat(visibleDashboards.length, " dashboard").concat(visibleDashboards.length === 1 ? "" : "s") : "".concat(visibleWidgets.length, " widget").concat(visibleWidgets.length === 1 ? "" : "s")
|
|
7210
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7211
|
-
className: "flex flex-col gap-6",
|
|
7212
|
-
children: isLoading ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7213
|
-
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-400",
|
|
7214
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7215
|
-
icon: "spinner",
|
|
7216
|
-
spin: true,
|
|
7217
|
-
fixedWidth: true
|
|
7218
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7219
|
-
children: "Searching registry..."
|
|
7185
|
+
className: "flex flex-row gap-4",
|
|
7186
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("aside", {
|
|
7187
|
+
className: "flex-shrink-0 w-56 flex flex-col gap-4 sticky top-0 self-start",
|
|
7188
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7189
|
+
className: "flex flex-col",
|
|
7190
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7191
|
+
className: sectionLabelClass,
|
|
7192
|
+
children: "TYPE"
|
|
7193
|
+
}), TYPE_OPTIONS.map(function (opt) {
|
|
7194
|
+
var active = typeFilter === opt.key;
|
|
7195
|
+
var showBadge = opt.key === "widgets" && state.selectedWidgets.length > 0;
|
|
7196
|
+
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
7197
|
+
type: "button",
|
|
7198
|
+
onClick: function onClick() {
|
|
7199
|
+
return setTypeFilter(opt.key);
|
|
7200
|
+
},
|
|
7201
|
+
className: rowClass(active),
|
|
7202
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7203
|
+
children: opt.label
|
|
7204
|
+
}), showBadge && /*#__PURE__*/jsxRuntime.jsx(DashReact.Tag3, {
|
|
7205
|
+
text: "".concat(state.selectedWidgets.length, " selected")
|
|
7206
|
+
})]
|
|
7207
|
+
}, opt.key);
|
|
7220
7208
|
})]
|
|
7221
|
-
})
|
|
7222
|
-
className: "flex
|
|
7223
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
}),
|
|
7227
|
-
|
|
7209
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7210
|
+
className: "flex flex-col",
|
|
7211
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7212
|
+
className: sectionLabelClass,
|
|
7213
|
+
children: "CATEGORIES"
|
|
7214
|
+
}), DASHBOARD_TAGS$1.map(function (tag) {
|
|
7215
|
+
var active = filters.categories.includes(tag);
|
|
7216
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7217
|
+
type: "button",
|
|
7218
|
+
onClick: function onClick() {
|
|
7219
|
+
return handleToggleCategory(tag);
|
|
7220
|
+
},
|
|
7221
|
+
className: "".concat(rowClass(active), " capitalize"),
|
|
7222
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7223
|
+
children: tag
|
|
7224
|
+
})
|
|
7225
|
+
}, tag);
|
|
7228
7226
|
})]
|
|
7229
|
-
})
|
|
7230
|
-
className: "flex flex-col
|
|
7231
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
}),
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7227
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7228
|
+
className: "flex flex-col",
|
|
7229
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7230
|
+
className: sectionLabelClass,
|
|
7231
|
+
children: "PROVIDERS"
|
|
7232
|
+
}), KNOWN_PROVIDERS.map(function (prov) {
|
|
7233
|
+
var active = filters.providers.includes(prov.key);
|
|
7234
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7235
|
+
type: "button",
|
|
7236
|
+
onClick: function onClick() {
|
|
7237
|
+
return handleToggleProvider(prov.key);
|
|
7238
|
+
},
|
|
7239
|
+
className: rowClass(active),
|
|
7240
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7241
|
+
children: prov.name
|
|
7242
|
+
})
|
|
7243
|
+
}, prov.key);
|
|
7239
7244
|
})]
|
|
7240
|
-
})
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7245
|
+
})]
|
|
7246
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7247
|
+
className: "flex-1 min-w-0 flex flex-col gap-4",
|
|
7248
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7249
|
+
className: "flex items-center gap-3",
|
|
7250
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7251
|
+
className: "flex-1",
|
|
7252
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
7253
|
+
value: searchQuery,
|
|
7254
|
+
onChange: handleSearchChange,
|
|
7255
|
+
placeholder: "Search registry..."
|
|
7256
|
+
})
|
|
7257
|
+
}), hasSelection && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
7258
|
+
onClick: handleClearSelection,
|
|
7259
|
+
title: "Clear Selection",
|
|
7260
|
+
textSize: "text-xs",
|
|
7261
|
+
padding: "py-1 px-3",
|
|
7262
|
+
backgroundColor: "bg-gray-700",
|
|
7263
|
+
textColor: "text-gray-400",
|
|
7264
|
+
hoverTextColor: "hover:text-white",
|
|
7265
|
+
hoverBackgroundColor: "hover:bg-gray-600",
|
|
7266
|
+
icon: "xmark"
|
|
7267
|
+
})]
|
|
7268
|
+
}), !isLoading && !error && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7269
|
+
className: "text-xs text-gray-500 px-1",
|
|
7270
|
+
children: showDashboards ? "".concat(visibleDashboards.length, " dashboard").concat(visibleDashboards.length === 1 ? "" : "s") : "".concat(visibleWidgets.length, " widget").concat(visibleWidgets.length === 1 ? "" : "s")
|
|
7271
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7272
|
+
className: "flex flex-col gap-6",
|
|
7273
|
+
children: isLoading ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7274
|
+
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-400",
|
|
7275
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7276
|
+
icon: "spinner",
|
|
7277
|
+
spin: true,
|
|
7278
|
+
fixedWidth: true
|
|
7279
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7280
|
+
children: "Searching registry..."
|
|
7281
|
+
})]
|
|
7282
|
+
}) : error ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7283
|
+
className: "flex items-center gap-2 text-red-400 py-4",
|
|
7284
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7285
|
+
icon: "circle-exclamation",
|
|
7286
|
+
fixedWidth: true
|
|
7287
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7288
|
+
children: error
|
|
7289
|
+
})]
|
|
7290
|
+
}) : !hasResults ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7291
|
+
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-500",
|
|
7292
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7293
|
+
icon: "magnifying-glass",
|
|
7294
|
+
fixedWidth: true
|
|
7295
|
+
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
7296
|
+
children: "No results match your search."
|
|
7297
|
+
}), hasActiveFilters && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
7298
|
+
className: "text-xs text-gray-600",
|
|
7299
|
+
children: "Try removing some filters to see more results."
|
|
7300
|
+
})]
|
|
7301
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7302
|
+
children: [showDashboards && visibleDashboards.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7303
|
+
className: "flex flex-col gap-3",
|
|
7304
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7305
|
+
className: "grid grid-cols-3 gap-3",
|
|
7306
|
+
children: visibleDashboards.map(function (dash) {
|
|
7307
|
+
var isSelected = state.selectedDashboard && state.selectedDashboard.name === dash.name;
|
|
7308
|
+
var widgetCount = (dash.widgets || []).length;
|
|
7309
|
+
var providerTags = (dash.providers || []).map(function (p) {
|
|
7310
|
+
return p.name || p.type;
|
|
7311
|
+
}).filter(Boolean);
|
|
7312
|
+
return /*#__PURE__*/jsxRuntime.jsxs(DashReact.Card2, {
|
|
7313
|
+
hover: true,
|
|
7314
|
+
selected: isSelected,
|
|
7315
|
+
padding: "p-5",
|
|
7316
|
+
rounded: "rounded-lg",
|
|
7317
|
+
className: "hover:shadow-lg",
|
|
7318
|
+
onClick: function onClick() {
|
|
7319
|
+
return handleSelectDashboard(dash);
|
|
7320
|
+
},
|
|
7262
7321
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7263
|
-
className: "
|
|
7264
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
7265
|
-
className: "
|
|
7266
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7322
|
+
className: "flex flex-col items-center text-center gap-2",
|
|
7323
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7324
|
+
className: "relative",
|
|
7325
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7326
|
+
className: "text-2xl",
|
|
7327
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7328
|
+
icon: resolveIcon(dash.icon || "grid-2"),
|
|
7329
|
+
fixedWidth: true,
|
|
7330
|
+
className: "text-gray-400"
|
|
7331
|
+
})
|
|
7332
|
+
}), isSelected && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7333
|
+
icon: "circle-check",
|
|
7334
|
+
className: "absolute -top-1 -right-3 text-blue-400 text-xs"
|
|
7335
|
+
})]
|
|
7336
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7337
|
+
className: "text-sm font-semibold text-gray-200",
|
|
7338
|
+
children: dash.displayName || dash.name
|
|
7339
|
+
})]
|
|
7340
|
+
}), dash.description && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
7341
|
+
className: "text-xs text-gray-400 mt-2 line-clamp-2 text-center",
|
|
7342
|
+
children: dash.description
|
|
7343
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7344
|
+
className: "flex items-center justify-between mt-3 pt-2 border-t border-gray-700/50",
|
|
7345
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7346
|
+
className: "text-xs text-gray-500",
|
|
7347
|
+
children: [widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
7348
|
+
}), providerTags.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7349
|
+
className: "flex flex-wrap gap-1 justify-end",
|
|
7350
|
+
children: providerTags.slice(0, 3).map(function (tag) {
|
|
7351
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7352
|
+
className: "text-xs px-1.5 py-0.5 rounded bg-gray-800 text-gray-400",
|
|
7353
|
+
children: tag
|
|
7354
|
+
}, tag);
|
|
7270
7355
|
})
|
|
7271
|
-
}), isSelected && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7272
|
-
icon: "circle-check",
|
|
7273
|
-
className: "absolute -top-1 -right-3 text-blue-400 text-xs"
|
|
7274
7356
|
})]
|
|
7275
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7276
|
-
className: "text-sm font-semibold text-gray-200",
|
|
7277
|
-
children: dash.displayName || dash.name
|
|
7278
|
-
})]
|
|
7279
|
-
}), dash.description && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
7280
|
-
className: "text-xs text-gray-400 mt-2 line-clamp-2 text-center",
|
|
7281
|
-
children: dash.description
|
|
7282
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7283
|
-
className: "flex items-center justify-between mt-3 pt-2 border-t border-gray-700/50",
|
|
7284
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7285
|
-
className: "text-xs text-gray-500",
|
|
7286
|
-
children: [widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
7287
|
-
}), providerTags.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7288
|
-
className: "flex flex-wrap gap-1 justify-end",
|
|
7289
|
-
children: providerTags.slice(0, 3).map(function (tag) {
|
|
7290
|
-
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7291
|
-
className: "text-xs px-1.5 py-0.5 rounded bg-gray-800 text-gray-400",
|
|
7292
|
-
children: tag
|
|
7293
|
-
}, tag);
|
|
7294
|
-
})
|
|
7295
7357
|
})]
|
|
7296
|
-
})
|
|
7297
|
-
}
|
|
7358
|
+
}, dash.name);
|
|
7359
|
+
})
|
|
7298
7360
|
})
|
|
7299
|
-
})
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7313
|
-
|
|
7314
|
-
},
|
|
7315
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7316
|
-
className: "flex items-start justify-between gap-2",
|
|
7361
|
+
}), showWidgets && visibleWidgets.length > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7362
|
+
className: "flex flex-col gap-3",
|
|
7363
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7364
|
+
className: "grid grid-cols-3 gap-3",
|
|
7365
|
+
children: visibleWidgets.map(function (widget) {
|
|
7366
|
+
var checked = isWidgetSelected(widget);
|
|
7367
|
+
return /*#__PURE__*/jsxRuntime.jsxs(DashReact.Card2, {
|
|
7368
|
+
hover: true,
|
|
7369
|
+
selected: checked,
|
|
7370
|
+
padding: "p-4",
|
|
7371
|
+
rounded: "rounded-lg",
|
|
7372
|
+
className: "hover:shadow-lg flex flex-col",
|
|
7373
|
+
onClick: function onClick() {
|
|
7374
|
+
return handleToggleWidget(widget);
|
|
7375
|
+
},
|
|
7317
7376
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7318
|
-
className: "flex items-
|
|
7319
|
-
children: [
|
|
7320
|
-
|
|
7377
|
+
className: "flex items-start justify-between gap-2",
|
|
7378
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7379
|
+
className: "flex items-center gap-1.5",
|
|
7380
|
+
children: [widget.icon && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7381
|
+
icon: resolveIcon(widget.icon),
|
|
7382
|
+
fixedWidth: true,
|
|
7383
|
+
className: "text-gray-400 text-sm"
|
|
7384
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7385
|
+
className: "text-sm font-medium text-gray-200 truncate",
|
|
7386
|
+
children: widget.name
|
|
7387
|
+
})]
|
|
7388
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7389
|
+
icon: checked ? "square-check" : "square",
|
|
7321
7390
|
fixedWidth: true,
|
|
7322
|
-
className: "text-
|
|
7323
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7324
|
-
className: "text-sm font-medium text-gray-200 truncate",
|
|
7325
|
-
children: widget.name
|
|
7391
|
+
className: checked ? "text-blue-400 flex-shrink-0" : "text-gray-500 flex-shrink-0"
|
|
7326
7392
|
})]
|
|
7327
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7393
|
+
}), widget.description && /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
7394
|
+
className: "text-xs text-gray-400 line-clamp-2 mt-1.5 flex-1",
|
|
7395
|
+
children: widget.description
|
|
7396
|
+
}), widget.packageDisplayName && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7397
|
+
className: "text-xs text-gray-500 mt-2 pt-1.5 border-t border-gray-700/50 truncate",
|
|
7398
|
+
children: widget.packageDisplayName
|
|
7331
7399
|
})]
|
|
7332
|
-
}
|
|
7333
|
-
|
|
7334
|
-
children: widget.description
|
|
7335
|
-
}), widget.packageDisplayName && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7336
|
-
className: "text-xs text-gray-500 mt-2 pt-1.5 border-t border-gray-700/50 truncate",
|
|
7337
|
-
children: widget.packageDisplayName
|
|
7338
|
-
})]
|
|
7339
|
-
}, widget.key);
|
|
7400
|
+
}, widget.key);
|
|
7401
|
+
})
|
|
7340
7402
|
})
|
|
7341
|
-
})
|
|
7342
|
-
})
|
|
7343
|
-
})
|
|
7403
|
+
})]
|
|
7404
|
+
})
|
|
7405
|
+
})]
|
|
7344
7406
|
})]
|
|
7345
7407
|
})]
|
|
7346
7408
|
});
|
|
@@ -7946,6 +8008,54 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
7946
8008
|
children: [/*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
7947
8009
|
className: "text-lg font-semibold text-gray-200",
|
|
7948
8010
|
children: "Customize your dashboard"
|
|
8011
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8012
|
+
className: "rounded-lg border border-gray-700/50 bg-gray-800/50 p-4 flex flex-col gap-2",
|
|
8013
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8014
|
+
className: "text-sm font-semibold text-gray-300",
|
|
8015
|
+
children: "Summary"
|
|
8016
|
+
}), state.customization.name.trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8017
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8018
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8019
|
+
icon: "clone",
|
|
8020
|
+
className: "text-blue-400"
|
|
8021
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8022
|
+
children: state.customization.name.trim()
|
|
8023
|
+
})]
|
|
8024
|
+
}), selectedFolder && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8025
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8026
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8027
|
+
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
8028
|
+
className: "text-blue-400"
|
|
8029
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8030
|
+
children: selectedFolder.name
|
|
8031
|
+
})]
|
|
8032
|
+
}), selectedTheme && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8033
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8034
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8035
|
+
icon: "palette",
|
|
8036
|
+
className: "text-blue-400"
|
|
8037
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8038
|
+
children: selectedTheme.name || state.customization.theme
|
|
8039
|
+
}), state.customization.theme === appThemeKey && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8040
|
+
className: "text-xs text-gray-500",
|
|
8041
|
+
children: "(default)"
|
|
8042
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8043
|
+
className: "flex flex-row space-x-1 ml-2",
|
|
8044
|
+
children: [selectedTheme.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8045
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.primary, "-500")
|
|
8046
|
+
}), selectedTheme.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8047
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.secondary, "-500")
|
|
8048
|
+
})]
|
|
8049
|
+
})]
|
|
8050
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8051
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8052
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8053
|
+
icon: isPrebuilt ? "box" : "grid-2",
|
|
8054
|
+
className: "text-blue-400"
|
|
8055
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8056
|
+
children: isPrebuilt ? ((_state$selectedDashbo = state.selectedDashboard) === null || _state$selectedDashbo === void 0 ? void 0 : _state$selectedDashbo.displayName) || ((_state$selectedDashbo2 = state.selectedDashboard) === null || _state$selectedDashbo2 === void 0 ? void 0 : _state$selectedDashbo2.name) || "Pre-built dashboard" : "".concat(state.selectedWidgets.length, " widget").concat(state.selectedWidgets.length !== 1 ? "s" : "")
|
|
8057
|
+
})]
|
|
8058
|
+
})]
|
|
7949
8059
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7950
8060
|
className: "flex items-center gap-2 mb-2",
|
|
7951
8061
|
children: SUB_STEPS.map(function (s, i) {
|
|
@@ -8196,51 +8306,6 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
8196
8306
|
})]
|
|
8197
8307
|
})]
|
|
8198
8308
|
})]
|
|
8199
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8200
|
-
className: "rounded-lg border border-gray-700/50 bg-gray-800/50 p-4 flex flex-col gap-2",
|
|
8201
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8202
|
-
className: "text-sm font-semibold text-gray-300",
|
|
8203
|
-
children: "Summary"
|
|
8204
|
-
}), state.customization.name.trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8205
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8206
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8207
|
-
icon: "clone",
|
|
8208
|
-
className: "text-blue-400"
|
|
8209
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8210
|
-
children: state.customization.name.trim()
|
|
8211
|
-
})]
|
|
8212
|
-
}), selectedFolder && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8213
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8214
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8215
|
-
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
8216
|
-
className: "text-blue-400"
|
|
8217
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8218
|
-
children: selectedFolder.name
|
|
8219
|
-
})]
|
|
8220
|
-
}), selectedTheme && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8221
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8222
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8223
|
-
icon: "palette",
|
|
8224
|
-
className: "text-blue-400"
|
|
8225
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8226
|
-
children: selectedTheme.name || state.customization.theme
|
|
8227
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8228
|
-
className: "flex flex-row space-x-1 ml-2",
|
|
8229
|
-
children: [selectedTheme.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8230
|
-
className: "w-3 h-3 rounded bg-".concat(selectedTheme.primary, "-500")
|
|
8231
|
-
}), selectedTheme.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8232
|
-
className: "w-3 h-3 rounded bg-".concat(selectedTheme.secondary, "-500")
|
|
8233
|
-
})]
|
|
8234
|
-
})]
|
|
8235
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8236
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8237
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
8238
|
-
icon: isPrebuilt ? "box" : "grid-2",
|
|
8239
|
-
className: "text-blue-400"
|
|
8240
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8241
|
-
children: isPrebuilt ? ((_state$selectedDashbo = state.selectedDashboard) === null || _state$selectedDashbo === void 0 ? void 0 : _state$selectedDashbo.displayName) || ((_state$selectedDashbo2 = state.selectedDashboard) === null || _state$selectedDashbo2 === void 0 ? void 0 : _state$selectedDashbo2.name) || "Pre-built dashboard" : "".concat(state.selectedWidgets.length, " widget").concat(state.selectedWidgets.length !== 1 ? "s" : "")
|
|
8242
|
-
})]
|
|
8243
|
-
})]
|
|
8244
8309
|
}), authNeeded && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8245
8310
|
className: "flex flex-col gap-3",
|
|
8246
8311
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -8439,7 +8504,12 @@ function getCanProceed(state) {
|
|
|
8439
8504
|
case 0:
|
|
8440
8505
|
return state.selectedDashboard !== null || state.selectedWidgets.length > 0;
|
|
8441
8506
|
case 1:
|
|
8442
|
-
|
|
8507
|
+
// Create can fire only when the user has both a name and a theme.
|
|
8508
|
+
// The wizard auto-defaults theme to the user's active app theme,
|
|
8509
|
+
// so this gate is mostly belt-and-suspenders — but it locks the
|
|
8510
|
+
// contract so a future refactor that drops the auto-default
|
|
8511
|
+
// can't quietly let the Create button enable on name alone.
|
|
8512
|
+
return state.customization.name.trim().length > 0 && !!state.customization.theme;
|
|
8443
8513
|
default:
|
|
8444
8514
|
return false;
|
|
8445
8515
|
}
|