@trops/dash-core 0.1.461 → 0.1.463
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 +383 -387
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +383 -387
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7128,262 +7128,263 @@ var WizardDiscoverStep = function WizardDiscoverStep(_ref) {
|
|
|
7128
7128
|
};
|
|
7129
7129
|
var sectionLabelClass = "text-xs font-semibold text-gray-400 uppercase tracking-wide px-3 mb-1";
|
|
7130
7130
|
return /*#__PURE__*/jsxs("div", {
|
|
7131
|
-
className: "flex flex-
|
|
7132
|
-
children: [/*#__PURE__*/jsxs("
|
|
7133
|
-
className: "flex-
|
|
7134
|
-
children: [
|
|
7135
|
-
|
|
7131
|
+
className: "flex flex-col gap-4",
|
|
7132
|
+
children: [!isAuthenticated && /*#__PURE__*/jsxs("div", {
|
|
7133
|
+
className: "flex items-center gap-3 px-4 py-2 rounded-lg bg-gray-800 text-gray-300",
|
|
7134
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7135
|
+
icon: "circle-info",
|
|
7136
|
+
className: "text-blue-400 text-sm flex-shrink-0"
|
|
7137
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7138
|
+
className: "flex-1 min-w-0 flex flex-col",
|
|
7136
7139
|
children: [/*#__PURE__*/jsx("span", {
|
|
7137
|
-
className: "text-
|
|
7140
|
+
className: "text-sm text-gray-200",
|
|
7138
7141
|
children: "Sign in to registry"
|
|
7139
7142
|
}), /*#__PURE__*/jsx("span", {
|
|
7140
7143
|
className: "text-xs text-gray-400",
|
|
7141
7144
|
children: "See dashboards and widgets you have access to"
|
|
7142
|
-
}), !isAuthenticating ? /*#__PURE__*/jsx("button", {
|
|
7143
|
-
type: "button",
|
|
7144
|
-
onClick: handleSignIn,
|
|
7145
|
-
className: "mt-1 text-xs py-1.5 px-3 rounded bg-blue-600 text-white hover:bg-blue-500 transition-colors",
|
|
7146
|
-
children: "Sign in"
|
|
7147
|
-
}) : /*#__PURE__*/jsxs("div", {
|
|
7148
|
-
className: "mt-1 flex flex-col gap-1",
|
|
7149
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
7150
|
-
className: "text-xs text-gray-400",
|
|
7151
|
-
children: "Waiting for browser\u2026"
|
|
7152
|
-
}), /*#__PURE__*/jsx("button", {
|
|
7153
|
-
type: "button",
|
|
7154
|
-
onClick: cancelAuth,
|
|
7155
|
-
className: "text-xs text-gray-400 hover:text-gray-200 underline self-start",
|
|
7156
|
-
children: "Cancel"
|
|
7157
|
-
})]
|
|
7158
|
-
}), authError && /*#__PURE__*/jsx("span", {
|
|
7159
|
-
className: "text-xs text-red-400",
|
|
7160
|
-
children: authError
|
|
7161
|
-
})]
|
|
7162
|
-
}), isAuthenticated && /*#__PURE__*/jsxs("div", {
|
|
7163
|
-
className: "flex items-center gap-2 px-3 text-xs text-gray-500",
|
|
7164
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7165
|
-
icon: "circle-check",
|
|
7166
|
-
className: "text-green-400 text-xs"
|
|
7167
|
-
}), /*#__PURE__*/jsx("span", {
|
|
7168
|
-
children: "Signed in"
|
|
7169
|
-
})]
|
|
7170
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
7171
|
-
className: "flex flex-col",
|
|
7172
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
7173
|
-
className: sectionLabelClass,
|
|
7174
|
-
children: "TYPE"
|
|
7175
|
-
}), TYPE_OPTIONS.map(function (opt) {
|
|
7176
|
-
var active = typeFilter === opt.key;
|
|
7177
|
-
var showBadge = opt.key === "widgets" && state.selectedWidgets.length > 0;
|
|
7178
|
-
return /*#__PURE__*/jsxs("button", {
|
|
7179
|
-
type: "button",
|
|
7180
|
-
onClick: function onClick() {
|
|
7181
|
-
return setTypeFilter(opt.key);
|
|
7182
|
-
},
|
|
7183
|
-
className: rowClass(active),
|
|
7184
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
7185
|
-
children: opt.label
|
|
7186
|
-
}), showBadge && /*#__PURE__*/jsx(Tag3, {
|
|
7187
|
-
text: "".concat(state.selectedWidgets.length, " selected")
|
|
7188
|
-
})]
|
|
7189
|
-
}, opt.key);
|
|
7190
|
-
})]
|
|
7191
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
7192
|
-
className: "flex flex-col",
|
|
7193
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
7194
|
-
className: sectionLabelClass,
|
|
7195
|
-
children: "CATEGORIES"
|
|
7196
|
-
}), DASHBOARD_TAGS$1.map(function (tag) {
|
|
7197
|
-
var active = filters.categories.includes(tag);
|
|
7198
|
-
return /*#__PURE__*/jsx("button", {
|
|
7199
|
-
type: "button",
|
|
7200
|
-
onClick: function onClick() {
|
|
7201
|
-
return handleToggleCategory(tag);
|
|
7202
|
-
},
|
|
7203
|
-
className: "".concat(rowClass(active), " capitalize"),
|
|
7204
|
-
children: /*#__PURE__*/jsx("span", {
|
|
7205
|
-
children: tag
|
|
7206
|
-
})
|
|
7207
|
-
}, tag);
|
|
7208
7145
|
})]
|
|
7209
|
-
}), /*#__PURE__*/
|
|
7210
|
-
|
|
7146
|
+
}), !isAuthenticating ? /*#__PURE__*/jsx("button", {
|
|
7147
|
+
type: "button",
|
|
7148
|
+
onClick: handleSignIn,
|
|
7149
|
+
className: "flex-shrink-0 text-xs py-1.5 px-3 rounded bg-blue-600 text-white hover:bg-blue-500 transition-colors",
|
|
7150
|
+
children: "Sign in"
|
|
7151
|
+
}) : /*#__PURE__*/jsxs("div", {
|
|
7152
|
+
className: "flex items-center gap-2 flex-shrink-0",
|
|
7211
7153
|
children: [/*#__PURE__*/jsx("span", {
|
|
7212
|
-
className:
|
|
7213
|
-
children: "
|
|
7214
|
-
}),
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
return handleToggleProvider(prov.key);
|
|
7220
|
-
},
|
|
7221
|
-
className: rowClass(active),
|
|
7222
|
-
children: /*#__PURE__*/jsx("span", {
|
|
7223
|
-
children: prov.name
|
|
7224
|
-
})
|
|
7225
|
-
}, prov.key);
|
|
7154
|
+
className: "text-xs text-gray-400",
|
|
7155
|
+
children: "Waiting for browser\u2026"
|
|
7156
|
+
}), /*#__PURE__*/jsx("button", {
|
|
7157
|
+
type: "button",
|
|
7158
|
+
onClick: cancelAuth,
|
|
7159
|
+
className: "text-xs text-gray-400 hover:text-gray-200 underline",
|
|
7160
|
+
children: "Cancel"
|
|
7226
7161
|
})]
|
|
7162
|
+
}), authError && /*#__PURE__*/jsx("span", {
|
|
7163
|
+
className: "flex-shrink-0 text-xs text-red-400",
|
|
7164
|
+
children: authError
|
|
7227
7165
|
})]
|
|
7228
7166
|
}), /*#__PURE__*/jsxs("div", {
|
|
7229
|
-
className: "flex
|
|
7230
|
-
children: [/*#__PURE__*/jsxs("
|
|
7231
|
-
className: "flex
|
|
7232
|
-
children: [/*#__PURE__*/
|
|
7233
|
-
className: "flex-
|
|
7234
|
-
children: /*#__PURE__*/jsx(
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
children: showDashboards ? "".concat(visibleDashboards.length, " dashboard").concat(visibleDashboards.length === 1 ? "" : "s") : "".concat(visibleWidgets.length, " widget").concat(visibleWidgets.length === 1 ? "" : "s")
|
|
7253
|
-
}), /*#__PURE__*/jsx("div", {
|
|
7254
|
-
className: "flex flex-col gap-6",
|
|
7255
|
-
children: isLoading ? /*#__PURE__*/jsxs("div", {
|
|
7256
|
-
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-400",
|
|
7257
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7258
|
-
icon: "spinner",
|
|
7259
|
-
spin: true,
|
|
7260
|
-
fixedWidth: true
|
|
7261
|
-
}), /*#__PURE__*/jsx("span", {
|
|
7262
|
-
children: "Searching registry..."
|
|
7167
|
+
className: "flex flex-row gap-4",
|
|
7168
|
+
children: [/*#__PURE__*/jsxs("aside", {
|
|
7169
|
+
className: "flex-shrink-0 w-56 flex flex-col gap-4 sticky top-0 self-start",
|
|
7170
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
7171
|
+
className: "flex flex-col",
|
|
7172
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
7173
|
+
className: sectionLabelClass,
|
|
7174
|
+
children: "TYPE"
|
|
7175
|
+
}), TYPE_OPTIONS.map(function (opt) {
|
|
7176
|
+
var active = typeFilter === opt.key;
|
|
7177
|
+
var showBadge = opt.key === "widgets" && state.selectedWidgets.length > 0;
|
|
7178
|
+
return /*#__PURE__*/jsxs("button", {
|
|
7179
|
+
type: "button",
|
|
7180
|
+
onClick: function onClick() {
|
|
7181
|
+
return setTypeFilter(opt.key);
|
|
7182
|
+
},
|
|
7183
|
+
className: rowClass(active),
|
|
7184
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
7185
|
+
children: opt.label
|
|
7186
|
+
}), showBadge && /*#__PURE__*/jsx(Tag3, {
|
|
7187
|
+
text: "".concat(state.selectedWidgets.length, " selected")
|
|
7188
|
+
})]
|
|
7189
|
+
}, opt.key);
|
|
7263
7190
|
})]
|
|
7264
|
-
})
|
|
7265
|
-
className: "flex
|
|
7266
|
-
children: [/*#__PURE__*/jsx(
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
}),
|
|
7270
|
-
|
|
7191
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7192
|
+
className: "flex flex-col",
|
|
7193
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
7194
|
+
className: sectionLabelClass,
|
|
7195
|
+
children: "CATEGORIES"
|
|
7196
|
+
}), DASHBOARD_TAGS$1.map(function (tag) {
|
|
7197
|
+
var active = filters.categories.includes(tag);
|
|
7198
|
+
return /*#__PURE__*/jsx("button", {
|
|
7199
|
+
type: "button",
|
|
7200
|
+
onClick: function onClick() {
|
|
7201
|
+
return handleToggleCategory(tag);
|
|
7202
|
+
},
|
|
7203
|
+
className: "".concat(rowClass(active), " capitalize"),
|
|
7204
|
+
children: /*#__PURE__*/jsx("span", {
|
|
7205
|
+
children: tag
|
|
7206
|
+
})
|
|
7207
|
+
}, tag);
|
|
7271
7208
|
})]
|
|
7272
|
-
})
|
|
7273
|
-
className: "flex flex-col
|
|
7274
|
-
children: [/*#__PURE__*/jsx(
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
}),
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7209
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7210
|
+
className: "flex flex-col",
|
|
7211
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
7212
|
+
className: sectionLabelClass,
|
|
7213
|
+
children: "PROVIDERS"
|
|
7214
|
+
}), KNOWN_PROVIDERS.map(function (prov) {
|
|
7215
|
+
var active = filters.providers.includes(prov.key);
|
|
7216
|
+
return /*#__PURE__*/jsx("button", {
|
|
7217
|
+
type: "button",
|
|
7218
|
+
onClick: function onClick() {
|
|
7219
|
+
return handleToggleProvider(prov.key);
|
|
7220
|
+
},
|
|
7221
|
+
className: rowClass(active),
|
|
7222
|
+
children: /*#__PURE__*/jsx("span", {
|
|
7223
|
+
children: prov.name
|
|
7224
|
+
})
|
|
7225
|
+
}, prov.key);
|
|
7282
7226
|
})]
|
|
7283
|
-
})
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7227
|
+
})]
|
|
7228
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7229
|
+
className: "flex-1 min-w-0 flex flex-col gap-4",
|
|
7230
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
7231
|
+
className: "flex items-center gap-3",
|
|
7232
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
7233
|
+
className: "flex-1",
|
|
7234
|
+
children: /*#__PURE__*/jsx(InputText, {
|
|
7235
|
+
value: searchQuery,
|
|
7236
|
+
onChange: handleSearchChange,
|
|
7237
|
+
placeholder: "Search registry..."
|
|
7238
|
+
})
|
|
7239
|
+
}), hasSelection && /*#__PURE__*/jsx(Button, {
|
|
7240
|
+
onClick: handleClearSelection,
|
|
7241
|
+
title: "Clear Selection",
|
|
7242
|
+
textSize: "text-xs",
|
|
7243
|
+
padding: "py-1 px-3",
|
|
7244
|
+
backgroundColor: "bg-gray-700",
|
|
7245
|
+
textColor: "text-gray-400",
|
|
7246
|
+
hoverTextColor: "hover:text-white",
|
|
7247
|
+
hoverBackgroundColor: "hover:bg-gray-600",
|
|
7248
|
+
icon: "xmark"
|
|
7249
|
+
})]
|
|
7250
|
+
}), !isLoading && !error && /*#__PURE__*/jsx("div", {
|
|
7251
|
+
className: "text-xs text-gray-500 px-1",
|
|
7252
|
+
children: showDashboards ? "".concat(visibleDashboards.length, " dashboard").concat(visibleDashboards.length === 1 ? "" : "s") : "".concat(visibleWidgets.length, " widget").concat(visibleWidgets.length === 1 ? "" : "s")
|
|
7253
|
+
}), /*#__PURE__*/jsx("div", {
|
|
7254
|
+
className: "flex flex-col gap-6",
|
|
7255
|
+
children: isLoading ? /*#__PURE__*/jsxs("div", {
|
|
7256
|
+
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-400",
|
|
7257
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7258
|
+
icon: "spinner",
|
|
7259
|
+
spin: true,
|
|
7260
|
+
fixedWidth: true
|
|
7261
|
+
}), /*#__PURE__*/jsx("span", {
|
|
7262
|
+
children: "Searching registry..."
|
|
7263
|
+
})]
|
|
7264
|
+
}) : error ? /*#__PURE__*/jsxs("div", {
|
|
7265
|
+
className: "flex items-center gap-2 text-red-400 py-4",
|
|
7266
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7267
|
+
icon: "circle-exclamation",
|
|
7268
|
+
fixedWidth: true
|
|
7269
|
+
}), /*#__PURE__*/jsx("span", {
|
|
7270
|
+
children: error
|
|
7271
|
+
})]
|
|
7272
|
+
}) : !hasResults ? /*#__PURE__*/jsxs("div", {
|
|
7273
|
+
className: "flex flex-col items-center justify-center gap-2 py-12 text-gray-500",
|
|
7274
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7275
|
+
icon: "magnifying-glass",
|
|
7276
|
+
fixedWidth: true
|
|
7277
|
+
}), /*#__PURE__*/jsx("p", {
|
|
7278
|
+
children: "No results match your search."
|
|
7279
|
+
}), hasActiveFilters && /*#__PURE__*/jsx("p", {
|
|
7280
|
+
className: "text-xs text-gray-600",
|
|
7281
|
+
children: "Try removing some filters to see more results."
|
|
7282
|
+
})]
|
|
7283
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
7284
|
+
children: [showDashboards && visibleDashboards.length > 0 && /*#__PURE__*/jsx("div", {
|
|
7285
|
+
className: "flex flex-col gap-3",
|
|
7286
|
+
children: /*#__PURE__*/jsx("div", {
|
|
7287
|
+
className: "grid grid-cols-3 gap-3",
|
|
7288
|
+
children: visibleDashboards.map(function (dash) {
|
|
7289
|
+
var isSelected = state.selectedDashboard && state.selectedDashboard.name === dash.name;
|
|
7290
|
+
var widgetCount = (dash.widgets || []).length;
|
|
7291
|
+
var providerTags = (dash.providers || []).map(function (p) {
|
|
7292
|
+
return p.name || p.type;
|
|
7293
|
+
}).filter(Boolean);
|
|
7294
|
+
return /*#__PURE__*/jsxs(Card2, {
|
|
7295
|
+
hover: true,
|
|
7296
|
+
selected: isSelected,
|
|
7297
|
+
padding: "p-5",
|
|
7298
|
+
rounded: "rounded-lg",
|
|
7299
|
+
className: "hover:shadow-lg",
|
|
7300
|
+
onClick: function onClick() {
|
|
7301
|
+
return handleSelectDashboard(dash);
|
|
7302
|
+
},
|
|
7305
7303
|
children: [/*#__PURE__*/jsxs("div", {
|
|
7306
|
-
className: "
|
|
7307
|
-
children: [/*#__PURE__*/
|
|
7308
|
-
className: "
|
|
7309
|
-
children: /*#__PURE__*/jsx(
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7304
|
+
className: "flex flex-col items-center text-center gap-2",
|
|
7305
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
7306
|
+
className: "relative",
|
|
7307
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
7308
|
+
className: "text-2xl",
|
|
7309
|
+
children: /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7310
|
+
icon: resolveIcon(dash.icon || "grid-2"),
|
|
7311
|
+
fixedWidth: true,
|
|
7312
|
+
className: "text-gray-400"
|
|
7313
|
+
})
|
|
7314
|
+
}), isSelected && /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7315
|
+
icon: "circle-check",
|
|
7316
|
+
className: "absolute -top-1 -right-3 text-blue-400 text-xs"
|
|
7317
|
+
})]
|
|
7318
|
+
}), /*#__PURE__*/jsx("span", {
|
|
7319
|
+
className: "text-sm font-semibold text-gray-200",
|
|
7320
|
+
children: dash.displayName || dash.name
|
|
7321
|
+
})]
|
|
7322
|
+
}), dash.description && /*#__PURE__*/jsx("p", {
|
|
7323
|
+
className: "text-xs text-gray-400 mt-2 line-clamp-2 text-center",
|
|
7324
|
+
children: dash.description
|
|
7325
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7326
|
+
className: "flex items-center justify-between mt-3 pt-2 border-t border-gray-700/50",
|
|
7327
|
+
children: [/*#__PURE__*/jsxs("span", {
|
|
7328
|
+
className: "text-xs text-gray-500",
|
|
7329
|
+
children: [widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
7330
|
+
}), providerTags.length > 0 && /*#__PURE__*/jsx("div", {
|
|
7331
|
+
className: "flex flex-wrap gap-1 justify-end",
|
|
7332
|
+
children: providerTags.slice(0, 3).map(function (tag) {
|
|
7333
|
+
return /*#__PURE__*/jsx("span", {
|
|
7334
|
+
className: "text-xs px-1.5 py-0.5 rounded bg-gray-800 text-gray-400",
|
|
7335
|
+
children: tag
|
|
7336
|
+
}, tag);
|
|
7313
7337
|
})
|
|
7314
|
-
}), isSelected && /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7315
|
-
icon: "circle-check",
|
|
7316
|
-
className: "absolute -top-1 -right-3 text-blue-400 text-xs"
|
|
7317
7338
|
})]
|
|
7318
|
-
}), /*#__PURE__*/jsx("span", {
|
|
7319
|
-
className: "text-sm font-semibold text-gray-200",
|
|
7320
|
-
children: dash.displayName || dash.name
|
|
7321
7339
|
})]
|
|
7322
|
-
}
|
|
7323
|
-
|
|
7324
|
-
children: dash.description
|
|
7325
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
7326
|
-
className: "flex items-center justify-between mt-3 pt-2 border-t border-gray-700/50",
|
|
7327
|
-
children: [/*#__PURE__*/jsxs("span", {
|
|
7328
|
-
className: "text-xs text-gray-500",
|
|
7329
|
-
children: [widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
7330
|
-
}), providerTags.length > 0 && /*#__PURE__*/jsx("div", {
|
|
7331
|
-
className: "flex flex-wrap gap-1 justify-end",
|
|
7332
|
-
children: providerTags.slice(0, 3).map(function (tag) {
|
|
7333
|
-
return /*#__PURE__*/jsx("span", {
|
|
7334
|
-
className: "text-xs px-1.5 py-0.5 rounded bg-gray-800 text-gray-400",
|
|
7335
|
-
children: tag
|
|
7336
|
-
}, tag);
|
|
7337
|
-
})
|
|
7338
|
-
})]
|
|
7339
|
-
})]
|
|
7340
|
-
}, dash.name);
|
|
7340
|
+
}, dash.name);
|
|
7341
|
+
})
|
|
7341
7342
|
})
|
|
7342
|
-
})
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
},
|
|
7358
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
7359
|
-
className: "flex items-start justify-between gap-2",
|
|
7343
|
+
}), showWidgets && visibleWidgets.length > 0 && /*#__PURE__*/jsx("div", {
|
|
7344
|
+
className: "flex flex-col gap-3",
|
|
7345
|
+
children: /*#__PURE__*/jsx("div", {
|
|
7346
|
+
className: "grid grid-cols-3 gap-3",
|
|
7347
|
+
children: visibleWidgets.map(function (widget) {
|
|
7348
|
+
var checked = isWidgetSelected(widget);
|
|
7349
|
+
return /*#__PURE__*/jsxs(Card2, {
|
|
7350
|
+
hover: true,
|
|
7351
|
+
selected: checked,
|
|
7352
|
+
padding: "p-4",
|
|
7353
|
+
rounded: "rounded-lg",
|
|
7354
|
+
className: "hover:shadow-lg flex flex-col",
|
|
7355
|
+
onClick: function onClick() {
|
|
7356
|
+
return handleToggleWidget(widget);
|
|
7357
|
+
},
|
|
7360
7358
|
children: [/*#__PURE__*/jsxs("div", {
|
|
7361
|
-
className: "flex items-
|
|
7362
|
-
children: [
|
|
7363
|
-
|
|
7359
|
+
className: "flex items-start justify-between gap-2",
|
|
7360
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
7361
|
+
className: "flex items-center gap-1.5",
|
|
7362
|
+
children: [widget.icon && /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7363
|
+
icon: resolveIcon(widget.icon),
|
|
7364
|
+
fixedWidth: true,
|
|
7365
|
+
className: "text-gray-400 text-sm"
|
|
7366
|
+
}), /*#__PURE__*/jsx("span", {
|
|
7367
|
+
className: "text-sm font-medium text-gray-200 truncate",
|
|
7368
|
+
children: widget.name
|
|
7369
|
+
})]
|
|
7370
|
+
}), /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7371
|
+
icon: checked ? "square-check" : "square",
|
|
7364
7372
|
fixedWidth: true,
|
|
7365
|
-
className: "text-
|
|
7366
|
-
}), /*#__PURE__*/jsx("span", {
|
|
7367
|
-
className: "text-sm font-medium text-gray-200 truncate",
|
|
7368
|
-
children: widget.name
|
|
7373
|
+
className: checked ? "text-blue-400 flex-shrink-0" : "text-gray-500 flex-shrink-0"
|
|
7369
7374
|
})]
|
|
7370
|
-
}), /*#__PURE__*/jsx(
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7375
|
+
}), widget.description && /*#__PURE__*/jsx("p", {
|
|
7376
|
+
className: "text-xs text-gray-400 line-clamp-2 mt-1.5 flex-1",
|
|
7377
|
+
children: widget.description
|
|
7378
|
+
}), widget.packageDisplayName && /*#__PURE__*/jsx("span", {
|
|
7379
|
+
className: "text-xs text-gray-500 mt-2 pt-1.5 border-t border-gray-700/50 truncate",
|
|
7380
|
+
children: widget.packageDisplayName
|
|
7374
7381
|
})]
|
|
7375
|
-
}
|
|
7376
|
-
|
|
7377
|
-
children: widget.description
|
|
7378
|
-
}), widget.packageDisplayName && /*#__PURE__*/jsx("span", {
|
|
7379
|
-
className: "text-xs text-gray-500 mt-2 pt-1.5 border-t border-gray-700/50 truncate",
|
|
7380
|
-
children: widget.packageDisplayName
|
|
7381
|
-
})]
|
|
7382
|
-
}, widget.key);
|
|
7382
|
+
}, widget.key);
|
|
7383
|
+
})
|
|
7383
7384
|
})
|
|
7384
|
-
})
|
|
7385
|
-
})
|
|
7386
|
-
})
|
|
7385
|
+
})]
|
|
7386
|
+
})
|
|
7387
|
+
})]
|
|
7387
7388
|
})]
|
|
7388
7389
|
})]
|
|
7389
7390
|
});
|
|
@@ -7499,11 +7500,12 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
7499
7500
|
};
|
|
7500
7501
|
}, []);
|
|
7501
7502
|
|
|
7502
|
-
//
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7503
|
+
// Cycle 2: the inner pages were promoted to top-level wizard steps
|
|
7504
|
+
// (state.step 1=Name, 2=Folder, 3=Theme, 4=Review). The internal
|
|
7505
|
+
// mini-stepper from DASH-188 is gone — the modal footer's
|
|
7506
|
+
// Next/Back drives advancement now, and the wizard's per-step
|
|
7507
|
+
// canProceed gates each transition.
|
|
7508
|
+
|
|
7507
7509
|
var isPrebuilt = state.path === "prebuilt";
|
|
7508
7510
|
|
|
7509
7511
|
// Initialize customization defaults when stepping into this step
|
|
@@ -7808,7 +7810,6 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
7808
7810
|
setIsCreatingFolder(false);
|
|
7809
7811
|
setNewFolderName("");
|
|
7810
7812
|
setNewFolderIcon(null);
|
|
7811
|
-
setSubStep(2); // Auto-advance to Theme
|
|
7812
7813
|
}, [dispatch]);
|
|
7813
7814
|
var handleThemeSelect = useCallback(function (key) {
|
|
7814
7815
|
dispatch({
|
|
@@ -7974,43 +7975,71 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
7974
7975
|
return item.id === state.customization.menuId;
|
|
7975
7976
|
});
|
|
7976
7977
|
var selectedTheme = themes && state.customization.theme ? themes[state.customization.theme] : null;
|
|
7977
|
-
var SUB_STEPS = [{
|
|
7978
|
-
label: "Name",
|
|
7979
|
-
icon: "input-text"
|
|
7980
|
-
}, {
|
|
7981
|
-
label: "Folder",
|
|
7982
|
-
icon: "folder"
|
|
7983
|
-
}, {
|
|
7984
|
-
label: "Theme",
|
|
7985
|
-
icon: "palette"
|
|
7986
|
-
}];
|
|
7987
7978
|
return /*#__PURE__*/jsxs("div", {
|
|
7988
7979
|
className: "flex flex-col gap-4",
|
|
7989
7980
|
children: [/*#__PURE__*/jsx("h3", {
|
|
7990
7981
|
className: "text-lg font-semibold text-gray-200",
|
|
7991
7982
|
children: "Customize your dashboard"
|
|
7992
|
-
}), /*#__PURE__*/
|
|
7993
|
-
className: "flex
|
|
7994
|
-
children:
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8007
|
-
|
|
7983
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
7984
|
+
className: "rounded-lg border border-gray-700/50 bg-gray-800/50 p-4 flex flex-col gap-2",
|
|
7985
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
7986
|
+
className: "text-sm font-semibold text-gray-300",
|
|
7987
|
+
children: "Summary"
|
|
7988
|
+
}), state.customization.name.trim() && /*#__PURE__*/jsxs("div", {
|
|
7989
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
7990
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7991
|
+
icon: "clone",
|
|
7992
|
+
className: "text-blue-400"
|
|
7993
|
+
}), /*#__PURE__*/jsx("span", {
|
|
7994
|
+
children: state.customization.name.trim()
|
|
7995
|
+
})]
|
|
7996
|
+
}), selectedFolder && /*#__PURE__*/jsxs("div", {
|
|
7997
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
7998
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
7999
|
+
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
8000
|
+
className: "text-blue-400"
|
|
8001
|
+
}), /*#__PURE__*/jsx("span", {
|
|
8002
|
+
children: selectedFolder.name
|
|
8003
|
+
})]
|
|
8004
|
+
}), selectedTheme && /*#__PURE__*/jsxs("div", {
|
|
8005
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8006
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
8007
|
+
icon: "palette",
|
|
8008
|
+
className: "text-blue-400"
|
|
8009
|
+
}), /*#__PURE__*/jsx("span", {
|
|
8010
|
+
children: selectedTheme.name || state.customization.theme
|
|
8011
|
+
}), state.customization.theme === appThemeKey && /*#__PURE__*/jsx("span", {
|
|
8012
|
+
className: "text-xs text-gray-500",
|
|
8013
|
+
children: "(default)"
|
|
8014
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
8015
|
+
className: "flex flex-row space-x-1 ml-2",
|
|
8016
|
+
children: [selectedTheme.primary && /*#__PURE__*/jsx("div", {
|
|
8017
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.primary, "-500")
|
|
8018
|
+
}), selectedTheme.secondary && /*#__PURE__*/jsx("div", {
|
|
8019
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.secondary, "-500")
|
|
8008
8020
|
})]
|
|
8009
|
-
}
|
|
8010
|
-
})
|
|
8021
|
+
})]
|
|
8022
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
8023
|
+
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8024
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
8025
|
+
icon: isPrebuilt ? "box" : "grid-2",
|
|
8026
|
+
className: "text-blue-400"
|
|
8027
|
+
}), /*#__PURE__*/jsx("span", {
|
|
8028
|
+
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" : "")
|
|
8029
|
+
})]
|
|
8030
|
+
})]
|
|
8031
|
+
}), error && /*#__PURE__*/jsxs("div", {
|
|
8032
|
+
className: "rounded-lg border border-red-500 bg-red-900 p-3 flex items-start gap-2",
|
|
8033
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
8034
|
+
icon: "circle-exclamation",
|
|
8035
|
+
className: "text-red-400 mt-0.5 flex-shrink-0"
|
|
8036
|
+
}), /*#__PURE__*/jsx("span", {
|
|
8037
|
+
className: "text-sm text-red-200",
|
|
8038
|
+
children: error
|
|
8039
|
+
})]
|
|
8011
8040
|
}), /*#__PURE__*/jsxs("div", {
|
|
8012
8041
|
className: "flex flex-col gap-6",
|
|
8013
|
-
children: [
|
|
8042
|
+
children: [state.step === 1 && /*#__PURE__*/jsxs("div", {
|
|
8014
8043
|
className: "flex flex-col gap-3",
|
|
8015
8044
|
children: [/*#__PURE__*/jsxs("label", {
|
|
8016
8045
|
className: "flex items-center gap-2 text-sm font-semibold text-gray-300",
|
|
@@ -8023,24 +8052,8 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
8023
8052
|
onChange: handleNameChange,
|
|
8024
8053
|
placeholder: "My Dashboard",
|
|
8025
8054
|
autoFocus: true
|
|
8026
|
-
}), /*#__PURE__*/jsx("div", {
|
|
8027
|
-
className: "flex justify-end mt-2",
|
|
8028
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
8029
|
-
onClick: function onClick() {
|
|
8030
|
-
return setSubStep(1);
|
|
8031
|
-
},
|
|
8032
|
-
title: "Next",
|
|
8033
|
-
textSize: "text-sm",
|
|
8034
|
-
padding: "py-1.5 px-4",
|
|
8035
|
-
backgroundColor: state.customization.name.trim() ? "bg-blue-600" : "bg-gray-700",
|
|
8036
|
-
textColor: state.customization.name.trim() ? "text-white" : "text-gray-500",
|
|
8037
|
-
hoverTextColor: state.customization.name.trim() ? "hover:text-white" : "hover:text-gray-500",
|
|
8038
|
-
hoverBackgroundColor: state.customization.name.trim() ? "hover:bg-blue-500" : "hover:bg-gray-700",
|
|
8039
|
-
disabled: !state.customization.name.trim(),
|
|
8040
|
-
icon: "arrow-right"
|
|
8041
|
-
})
|
|
8042
8055
|
})]
|
|
8043
|
-
}),
|
|
8056
|
+
}), state.step === 2 && /*#__PURE__*/jsxs("div", {
|
|
8044
8057
|
className: "flex flex-col gap-3",
|
|
8045
8058
|
children: [/*#__PURE__*/jsxs("label", {
|
|
8046
8059
|
className: "flex items-center gap-2 text-sm font-semibold text-gray-300",
|
|
@@ -8132,23 +8145,8 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
8132
8145
|
})
|
|
8133
8146
|
}, item.id);
|
|
8134
8147
|
})]
|
|
8135
|
-
}), /*#__PURE__*/jsx("div", {
|
|
8136
|
-
className: "flex justify-end mt-2",
|
|
8137
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
8138
|
-
onClick: function onClick() {
|
|
8139
|
-
return setSubStep(2);
|
|
8140
|
-
},
|
|
8141
|
-
title: "Next",
|
|
8142
|
-
textSize: "text-sm",
|
|
8143
|
-
padding: "py-1.5 px-4",
|
|
8144
|
-
backgroundColor: "bg-blue-600",
|
|
8145
|
-
textColor: "text-white",
|
|
8146
|
-
hoverTextColor: "hover:text-white",
|
|
8147
|
-
hoverBackgroundColor: "hover:bg-blue-500",
|
|
8148
|
-
icon: "arrow-right"
|
|
8149
|
-
})
|
|
8150
8148
|
})]
|
|
8151
|
-
}),
|
|
8149
|
+
}), state.step === 3 && /*#__PURE__*/jsxs("div", {
|
|
8152
8150
|
className: "flex flex-col gap-3",
|
|
8153
8151
|
children: [/*#__PURE__*/jsxs("label", {
|
|
8154
8152
|
className: "flex items-center gap-2 text-sm font-semibold text-gray-300",
|
|
@@ -8239,50 +8237,20 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
8239
8237
|
})]
|
|
8240
8238
|
})]
|
|
8241
8239
|
})]
|
|
8242
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
8243
|
-
className: "
|
|
8244
|
-
children: [/*#__PURE__*/
|
|
8245
|
-
className: "text-sm font-semibold text-gray-300",
|
|
8246
|
-
children: "Summary"
|
|
8247
|
-
}), state.customization.name.trim() && /*#__PURE__*/jsxs("div", {
|
|
8248
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8249
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
8250
|
-
icon: "clone",
|
|
8251
|
-
className: "text-blue-400"
|
|
8252
|
-
}), /*#__PURE__*/jsx("span", {
|
|
8253
|
-
children: state.customization.name.trim()
|
|
8254
|
-
})]
|
|
8255
|
-
}), selectedFolder && /*#__PURE__*/jsxs("div", {
|
|
8256
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8257
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
8258
|
-
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
8259
|
-
className: "text-blue-400"
|
|
8260
|
-
}), /*#__PURE__*/jsx("span", {
|
|
8261
|
-
children: selectedFolder.name
|
|
8262
|
-
})]
|
|
8263
|
-
}), selectedTheme && /*#__PURE__*/jsxs("div", {
|
|
8264
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8265
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
8266
|
-
icon: "palette",
|
|
8267
|
-
className: "text-blue-400"
|
|
8268
|
-
}), /*#__PURE__*/jsx("span", {
|
|
8269
|
-
children: selectedTheme.name || state.customization.theme
|
|
8270
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
8271
|
-
className: "flex flex-row space-x-1 ml-2",
|
|
8272
|
-
children: [selectedTheme.primary && /*#__PURE__*/jsx("div", {
|
|
8273
|
-
className: "w-3 h-3 rounded bg-".concat(selectedTheme.primary, "-500")
|
|
8274
|
-
}), selectedTheme.secondary && /*#__PURE__*/jsx("div", {
|
|
8275
|
-
className: "w-3 h-3 rounded bg-".concat(selectedTheme.secondary, "-500")
|
|
8276
|
-
})]
|
|
8277
|
-
})]
|
|
8278
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
8279
|
-
className: "flex items-center gap-2 text-sm text-gray-300",
|
|
8240
|
+
}), state.step === 4 && /*#__PURE__*/jsxs("div", {
|
|
8241
|
+
className: "flex flex-col gap-3",
|
|
8242
|
+
children: [/*#__PURE__*/jsxs("label", {
|
|
8243
|
+
className: "flex items-center gap-2 text-sm font-semibold text-gray-300",
|
|
8280
8244
|
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
8281
|
-
icon:
|
|
8282
|
-
|
|
8283
|
-
}),
|
|
8284
|
-
|
|
8285
|
-
|
|
8245
|
+
icon: "circle-check",
|
|
8246
|
+
fixedWidth: true
|
|
8247
|
+
}), "Review"]
|
|
8248
|
+
}), /*#__PURE__*/jsxs("p", {
|
|
8249
|
+
className: "text-sm text-gray-400",
|
|
8250
|
+
children: ["Confirm the dashboard details above. Click", " ", /*#__PURE__*/jsx("strong", {
|
|
8251
|
+
className: "text-gray-200",
|
|
8252
|
+
children: "Create Dashboard"
|
|
8253
|
+
}), " when you're ready \u2014 the modal footer holds the action."]
|
|
8286
8254
|
})]
|
|
8287
8255
|
}), authNeeded && /*#__PURE__*/jsxs("div", {
|
|
8288
8256
|
className: "flex flex-col gap-3",
|
|
@@ -8347,7 +8315,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
8347
8315
|
|
|
8348
8316
|
function ownKeys$U(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8349
8317
|
function _objectSpread$U(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$U(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$U(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8350
|
-
var TOTAL_STEPS =
|
|
8318
|
+
var TOTAL_STEPS = 5; // Steps 0-4: Discover, Name, Folder, Theme, Review
|
|
8351
8319
|
|
|
8352
8320
|
var initialState = {
|
|
8353
8321
|
step: 0,
|
|
@@ -8478,11 +8446,26 @@ function widgetCountToTemplate(count) {
|
|
|
8478
8446
|
return "three-by-three";
|
|
8479
8447
|
}
|
|
8480
8448
|
function getCanProceed(state) {
|
|
8449
|
+
// Step semantics (Cycle 2 restructure):
|
|
8450
|
+
// 0 = Discover (browse + select)
|
|
8451
|
+
// 1 = Name
|
|
8452
|
+
// 2 = Folder
|
|
8453
|
+
// 3 = Theme
|
|
8454
|
+
// 4 = Review (final — Create button replaces Next)
|
|
8481
8455
|
switch (state.step) {
|
|
8482
8456
|
case 0:
|
|
8483
8457
|
return state.selectedDashboard !== null || state.selectedWidgets.length > 0;
|
|
8484
8458
|
case 1:
|
|
8485
8459
|
return state.customization.name.trim().length > 0;
|
|
8460
|
+
case 2:
|
|
8461
|
+
return state.customization.menuId !== null;
|
|
8462
|
+
case 3:
|
|
8463
|
+
return !!state.customization.theme;
|
|
8464
|
+
case 4:
|
|
8465
|
+
// Review is the final step — there's no "next" beyond it. The
|
|
8466
|
+
// modal's footer swaps Next for Create on this step; the actual
|
|
8467
|
+
// gate for *firing* Create is composed there (`canCreate`).
|
|
8468
|
+
return true;
|
|
8486
8469
|
default:
|
|
8487
8470
|
return false;
|
|
8488
8471
|
}
|
|
@@ -8539,11 +8522,17 @@ var useWizardState = function useWizardState() {
|
|
|
8539
8522
|
};
|
|
8540
8523
|
|
|
8541
8524
|
var STEP_LABELS = [{
|
|
8542
|
-
label: "
|
|
8543
|
-
description: "
|
|
8525
|
+
label: "Name",
|
|
8526
|
+
description: "Pick a name"
|
|
8527
|
+
}, {
|
|
8528
|
+
label: "Folder",
|
|
8529
|
+
description: "Where it lives"
|
|
8530
|
+
}, {
|
|
8531
|
+
label: "Theme",
|
|
8532
|
+
description: "How it looks"
|
|
8544
8533
|
}, {
|
|
8545
|
-
label: "
|
|
8546
|
-
description: "
|
|
8534
|
+
label: "Review",
|
|
8535
|
+
description: "Confirm & create"
|
|
8547
8536
|
}];
|
|
8548
8537
|
|
|
8549
8538
|
/**
|
|
@@ -8599,10 +8588,17 @@ var DashboardWizardModal = function DashboardWizardModal(_ref) {
|
|
|
8599
8588
|
if (!canProceed) return;
|
|
8600
8589
|
nextStep();
|
|
8601
8590
|
}, [canProceed, nextStep]);
|
|
8602
|
-
var
|
|
8591
|
+
var isDiscover = state.step === 0;
|
|
8592
|
+
var isLastStep = state.step === 4;
|
|
8603
8593
|
var isCreating = (_createHandlerRef$cur = (_createHandlerRef$cur2 = createHandlerRef.current) === null || _createHandlerRef$cur2 === void 0 ? void 0 : _createHandlerRef$cur2.creating) !== null && _createHandlerRef$cur !== void 0 ? _createHandlerRef$cur : false;
|
|
8604
8594
|
var isCreated = !!((_createHandlerRef$cur3 = createHandlerRef.current) !== null && _createHandlerRef$cur3 !== void 0 && _createHandlerRef$cur3.createdDashboard);
|
|
8605
|
-
|
|
8595
|
+
// Create only fires when every prior step has been validated. The
|
|
8596
|
+
// Review step (canProceed=true by design) doesn't tell us whether
|
|
8597
|
+
// Name/Folder/Theme were filled, so we re-check the underlying
|
|
8598
|
+
// customization here — belt-and-suspenders for clicks that race
|
|
8599
|
+
// the stepper.
|
|
8600
|
+
var customizationComplete = state.customization.name.trim().length > 0 && state.customization.menuId !== null && !!state.customization.theme;
|
|
8601
|
+
var canCreate = customizationComplete && !isCreating;
|
|
8606
8602
|
return /*#__PURE__*/jsx(Modal, {
|
|
8607
8603
|
isOpen: open,
|
|
8608
8604
|
setIsOpen: setIsOpen,
|
|
@@ -8634,43 +8630,43 @@ var DashboardWizardModal = function DashboardWizardModal(_ref) {
|
|
|
8634
8630
|
})]
|
|
8635
8631
|
}), /*#__PURE__*/jsxs("div", {
|
|
8636
8632
|
className: "flex flex-col flex-1 min-h-0 px-6 py-4",
|
|
8637
|
-
children: [/*#__PURE__*/
|
|
8638
|
-
|
|
8639
|
-
|
|
8633
|
+
children: [isDiscover ? /*#__PURE__*/jsx("div", {
|
|
8634
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
8635
|
+
children: /*#__PURE__*/jsx(WizardDiscoverStep, {
|
|
8636
|
+
state: state,
|
|
8637
|
+
dispatch: dispatch
|
|
8638
|
+
})
|
|
8639
|
+
}) : /*#__PURE__*/jsx(Stepper, {
|
|
8640
|
+
activeStep: state.step - 1,
|
|
8641
|
+
onStepChange: function onStepChange(s) {
|
|
8642
|
+
return handleStepChange(s + 1);
|
|
8643
|
+
},
|
|
8640
8644
|
showNavigation: false,
|
|
8641
8645
|
className: "flex-1 min-h-0",
|
|
8642
|
-
children:
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
onInstallDashboard: onInstallDashboard,
|
|
8664
|
-
onOpenDashboard: function onOpenDashboard(ws) {
|
|
8665
|
-
handleClose();
|
|
8666
|
-
if (_onOpenDashboard) _onOpenDashboard(ws);
|
|
8667
|
-
if (onReloadWorkspaces) onReloadWorkspaces();
|
|
8668
|
-
},
|
|
8669
|
-
appId: appId,
|
|
8670
|
-
createHandlerRef: createHandlerRef
|
|
8646
|
+
children: STEP_LABELS.map(function (label) {
|
|
8647
|
+
return /*#__PURE__*/jsx(Stepper.Step, {
|
|
8648
|
+
label: label.label,
|
|
8649
|
+
description: label.description,
|
|
8650
|
+
children: /*#__PURE__*/jsx("div", {
|
|
8651
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
8652
|
+
children: /*#__PURE__*/jsx(WizardCustomizeStep, {
|
|
8653
|
+
state: state,
|
|
8654
|
+
dispatch: dispatch,
|
|
8655
|
+
menuItems: menuItems,
|
|
8656
|
+
onSaveMenuItem: onSaveMenuItem,
|
|
8657
|
+
onCreateWorkspace: onCreateWorkspace,
|
|
8658
|
+
onInstallDashboard: onInstallDashboard,
|
|
8659
|
+
onOpenDashboard: function onOpenDashboard(ws) {
|
|
8660
|
+
handleClose();
|
|
8661
|
+
if (_onOpenDashboard) _onOpenDashboard(ws);
|
|
8662
|
+
if (onReloadWorkspaces) onReloadWorkspaces();
|
|
8663
|
+
},
|
|
8664
|
+
appId: appId,
|
|
8665
|
+
createHandlerRef: createHandlerRef
|
|
8666
|
+
})
|
|
8671
8667
|
})
|
|
8672
|
-
})
|
|
8673
|
-
})
|
|
8668
|
+
}, label.label);
|
|
8669
|
+
})
|
|
8674
8670
|
}), !isCreated && /*#__PURE__*/jsxs("div", {
|
|
8675
8671
|
className: "flex flex-row justify-between items-center pt-4 mt-4 border-t border-gray-700/50",
|
|
8676
8672
|
children: [/*#__PURE__*/jsx(Button, {
|
|
@@ -8682,9 +8678,9 @@ var DashboardWizardModal = function DashboardWizardModal(_ref) {
|
|
|
8682
8678
|
textColor: "text-gray-300",
|
|
8683
8679
|
hoverTextColor: "hover:text-white",
|
|
8684
8680
|
hoverBackgroundColor: "hover:bg-gray-600"
|
|
8685
|
-
}), /*#__PURE__*/
|
|
8681
|
+
}), /*#__PURE__*/jsx("span", {
|
|
8686
8682
|
className: "text-xs text-gray-500",
|
|
8687
|
-
children:
|
|
8683
|
+
children: isDiscover ? "Browse" : "Step ".concat(state.step, " of ").concat(STEP_LABELS.length)
|
|
8688
8684
|
}), isLastStep ? /*#__PURE__*/jsx(Button, {
|
|
8689
8685
|
onClick: function onClick() {
|
|
8690
8686
|
var _createHandlerRef$cur4, _createHandlerRef$cur5;
|