@seliseblocks/genesis-os 4.3.2 → 4.3.3

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.
@@ -6743,32 +6743,82 @@ var AppSwitcher = ({ forwardedTo }) => {
6743
6743
  )
6744
6744
  ] });
6745
6745
  };
6746
- var OPTIONS = [
6747
- { value: "system", Icon: lucideReact.Monitor, label: "Auto" },
6748
- { value: "light", Icon: lucideReact.Sun, label: "Light" },
6749
- { value: "dark", Icon: lucideReact.Moon, label: "Dark" }
6750
- ];
6751
- function ThemeSwitcher() {
6746
+ var OPTIONS = {
6747
+ system: { Icon: lucideReact.Monitor, label: "Auto" },
6748
+ light: { Icon: lucideReact.Sun, label: "Light" },
6749
+ dark: { Icon: lucideReact.Moon, label: "Dark" }
6750
+ };
6751
+ var OPTION_ORDER = ["system", "light", "dark"];
6752
+ var TRIGGER_BASE_CLASSES = "relative z-50 inline-flex h-9 items-center justify-center gap-2 px-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";
6753
+ var TRIGGER_DEFAULT_TYPOGRAPHY_CLASSES = "text-sm font-medium text-muted-foreground hover:text-foreground";
6754
+ function ThemeSwitcher({
6755
+ className,
6756
+ showChevron = true
6757
+ } = {}) {
6752
6758
  const { theme, setTheme } = chunkGZSVB47D_cjs.useTheme();
6753
- return /* @__PURE__ */ jsxRuntime.jsx(
6754
- Tabs,
6755
- {
6756
- value: theme,
6757
- onValueChange: (value) => setTheme(value),
6758
- children: /* @__PURE__ */ jsxRuntime.jsx(TabsList, { className: "h-auto gap-0.5 rounded-md !bg-transparent p-0.5", children: OPTIONS.map(({ value, Icon: Icon2, label }) => /* @__PURE__ */ jsxRuntime.jsxs(
6759
- TabsTrigger,
6759
+ const { Icon: ThemeIcon, label: themeLabel } = OPTIONS[theme];
6760
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
6761
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
6762
+ "button",
6763
+ {
6764
+ type: "button",
6765
+ "aria-label": "Change theme",
6766
+ className: chunkYAF2X7W5_cjs.cn(
6767
+ TRIGGER_BASE_CLASSES,
6768
+ className ?? TRIGGER_DEFAULT_TYPOGRAPHY_CLASSES
6769
+ ),
6770
+ children: [
6771
+ /* @__PURE__ */ jsxRuntime.jsx(ThemeIcon, { className: "h-4 w-4", "aria-hidden": true }),
6772
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: themeLabel }),
6773
+ showChevron && /* @__PURE__ */ jsxRuntime.jsx(
6774
+ lucideReact.ChevronDown,
6775
+ {
6776
+ className: "h-3.5 w-3.5 text-muted-foreground",
6777
+ "aria-hidden": true
6778
+ }
6779
+ )
6780
+ ]
6781
+ }
6782
+ ) }),
6783
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "end", className: "min-w-40", children: [
6784
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { className: "px-2 py-1.5 text-xs font-medium text-muted-foreground", children: "Appearance" }),
6785
+ /* @__PURE__ */ jsxRuntime.jsx(
6786
+ DropdownMenuRadioGroup,
6760
6787
  {
6761
- value,
6762
- className: "group h-auto rounded-sm px-2 py-1 text-xs font-medium data-[state=active]:bg-[hsl(var(--primary)/0.1)] data-[state=active]:text-[hsl(var(--primary))] data-[state=inactive]:text-[hsl(var(--muted-foreground)/0.9)] data-[state=active]:shadow-sm data-[state=inactive]:hover:text-[hsl(var(--foreground)/0.9)]",
6763
- children: [
6764
- /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: 13, "aria-hidden": true }),
6765
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5 hidden group-data-[state=active]:inline", children: label })
6766
- ]
6767
- },
6768
- value
6769
- )) })
6770
- }
6771
- );
6788
+ value: theme,
6789
+ onValueChange: (value) => setTheme(value),
6790
+ children: OPTION_ORDER.map((value) => {
6791
+ const { Icon: Icon2, label } = OPTIONS[value];
6792
+ const isActive = value === theme;
6793
+ return /* @__PURE__ */ jsxRuntime.jsxs(
6794
+ DropdownMenuRadioItem,
6795
+ {
6796
+ value,
6797
+ className: chunkYAF2X7W5_cjs.cn(
6798
+ "gap-2 border border-transparent py-2 hover:border-input",
6799
+ isActive && "text-primary"
6800
+ ),
6801
+ children: [
6802
+ /* @__PURE__ */ jsxRuntime.jsx(
6803
+ Icon2,
6804
+ {
6805
+ className: chunkYAF2X7W5_cjs.cn(
6806
+ "h-4 w-4",
6807
+ isActive ? "text-foreground" : "text-muted-foreground"
6808
+ ),
6809
+ "aria-hidden": true
6810
+ }
6811
+ ),
6812
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkYAF2X7W5_cjs.cn(isActive && "text-foreground font-medium"), children: label })
6813
+ ]
6814
+ },
6815
+ value
6816
+ );
6817
+ })
6818
+ }
6819
+ )
6820
+ ] })
6821
+ ] });
6772
6822
  }
6773
6823
 
6774
6824
  // src/services/user.service.ts
@@ -7784,8 +7834,7 @@ function OidcLayout({
7784
7834
  var LoginHeader = ({
7785
7835
  docsUrl = "https://docs.seliseblocks.com/",
7786
7836
  blocksUrl = "https://seliseblocks.com",
7787
- githubUrl = "https://github.com/SELISEdigitalplatforms",
7788
- signUpUrl
7837
+ githubUrl = "https://github.com/SELISEdigitalplatforms"
7789
7838
  }) => {
7790
7839
  const {
7791
7840
  config: { appLogoUrl }
@@ -7830,8 +7879,13 @@ var LoginHeader = ({
7830
7879
  children: "GitHub"
7831
7880
  }
7832
7881
  ),
7833
- signUpUrl && /* @__PURE__ */ jsxRuntime.jsx("a", { href: signUpUrl, className: "nav-cta", children: "Sign up" }),
7834
- /* @__PURE__ */ jsxRuntime.jsx(ThemeSwitcher, {})
7882
+ /* @__PURE__ */ jsxRuntime.jsx(
7883
+ ThemeSwitcher,
7884
+ {
7885
+ className: "nav-link inline-flex items-center gap-1.5",
7886
+ showChevron: false
7887
+ }
7888
+ )
7835
7889
  ] })
7836
7890
  ] });
7837
7891
  };
@@ -8015,18 +8069,6 @@ var blocksLoginStyles = `
8015
8069
  .blocksLogin-page .nav-link:hover { color: var(--fg); text-shadow: 0 0 12px var(--accent-glow); }
8016
8070
  .blocksLogin-page .nav-link:hover::after { width: 100%; }
8017
8071
 
8018
- .blocksLogin-page .nav-cta {
8019
- font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
8020
- font-weight: 600; color: var(--accent2); text-decoration: none;
8021
- padding: 7px 16px; border-radius: 6px;
8022
- border: 1px solid rgba(0,102,178,0.35); background: rgba(0,102,178,0.06);
8023
- transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
8024
- }
8025
- .blocksLogin-page .nav-cta:hover {
8026
- background: rgba(0,102,178,0.12); border-color: var(--accent);
8027
- box-shadow: 0 0 12px rgba(0,102,178,0.12);
8028
- }
8029
-
8030
8072
  .blocksLogin-page .main {
8031
8073
  flex: 1; min-height: 0; display: grid;
8032
8074
  grid-template-columns: 1fr 400px; gap: 56px;
@@ -8343,7 +8385,6 @@ var blocksLoginStyles = `
8343
8385
  .blocksLogin-page .feature-pill { padding: 5px 10px; font-size: 0.58rem; }
8344
8386
  .blocksLogin-page .cta-row { gap: 18px; }
8345
8387
  .blocksLogin-page .cta-signup { font-size: 0.78rem; }
8346
- .blocksLogin-page .nav-cta { padding: 6px 12px; font-size: 0.62rem; }
8347
8388
  }
8348
8389
 
8349
8390
  @media (prefers-reduced-motion: reduce) {
@@ -8859,7 +8900,7 @@ var BlocksLoginPage = ({
8859
8900
  }
8860
8901
  }
8861
8902
  ),
8862
- /* @__PURE__ */ jsxRuntime.jsx(LoginHeader, { signUpUrl }),
8903
+ /* @__PURE__ */ jsxRuntime.jsx(LoginHeader, {}),
8863
8904
  /* @__PURE__ */ jsxRuntime.jsxs("main", { className: "main", children: [
8864
8905
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-left", children: [
8865
8906
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "eyebrow", children: eyebrow }),
@@ -9249,52 +9290,141 @@ function useProjectOverviewRedirect({
9249
9290
  isFetching
9250
9291
  };
9251
9292
  }
9252
- var INLINE_LIMIT = 3;
9253
- var ProjectCard = ({
9293
+ var getActionLabels = (canOpen, isShared) => {
9294
+ if (canOpen) {
9295
+ return isShared ? { accessibleLabel: "Open shared project", tooltipLabel: "Open Project" } : {
9296
+ accessibleLabel: "Configure project",
9297
+ tooltipLabel: "Configure Project"
9298
+ };
9299
+ }
9300
+ return {
9301
+ accessibleLabel: "Project access unavailable",
9302
+ tooltipLabel: "Project access unavailable"
9303
+ };
9304
+ };
9305
+ var ProjectActionButton = ({
9254
9306
  project,
9255
- projects,
9256
9307
  isShared,
9257
9308
  canOpen = true
9258
9309
  }) => {
9259
- const navigate = reactRouter.useNavigate();
9260
- const { setTenantGroup, setSelectedProject } = chunkVAKGHXK6_cjs.useProjectStore();
9310
+ const { setTenantGroup } = chunkVAKGHXK6_cjs.useProjectStore();
9261
9311
  const { handleClick, isDisabled, isFetching } = useProjectOverviewRedirect({
9262
9312
  tenantGroupId: project.tenantGroupId
9263
9313
  });
9264
- const onConfigureClick = () => {
9314
+ const isActionDisabled = !canOpen || isDisabled || isFetching;
9315
+ const { accessibleLabel, tooltipLabel } = getActionLabels(canOpen, isShared);
9316
+ const onClick = () => {
9265
9317
  setTenantGroup(project.tenantGroupId);
9266
9318
  handleClick();
9267
9319
  };
9268
- const onEnvBadgeClick = async (e, envProject) => {
9269
- e.stopPropagation();
9320
+ return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
9321
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
9322
+ Button,
9323
+ {
9324
+ size: "icon",
9325
+ "data-testid": isShared ? "project-card-open-shared" : "project-card-configure",
9326
+ variant: "ghost",
9327
+ className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
9328
+ disabled: isActionDisabled,
9329
+ onClick,
9330
+ "aria-label": accessibleLabel,
9331
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings2, { size: 16 })
9332
+ }
9333
+ ) }),
9334
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: tooltipLabel })
9335
+ ] });
9336
+ };
9337
+
9338
+ // src/pages/console/project-list-utils.ts
9339
+ var canOpenProject = (group) => !group.isShared || !group.accessPolicies || group.accessPolicies.length > 0;
9340
+ var getProjectGroupName = (group) => group.projects[0]?.name ?? "";
9341
+ var getLatestProjectUpdate = (group) => group.projects.reduce((latest, project) => {
9342
+ const timestamp = Date.parse(project.lastUpdatedDate);
9343
+ return Number.isFinite(timestamp) ? Math.max(latest, timestamp) : latest;
9344
+ }, 0);
9345
+ var getEnvironmentLabel = (environment) => environmentOptions.find((option) => option.value === environment)?.label ?? environment;
9346
+ var INLINE_LIMIT = 3;
9347
+ var ProjectEnvironments = ({ projects }) => {
9348
+ const navigate = reactRouter.useNavigate();
9349
+ const { setTenantGroup, setSelectedProject } = chunkVAKGHXK6_cjs.useProjectStore();
9350
+ const onEnvironmentClick = async (event, project) => {
9351
+ event.stopPropagation();
9270
9352
  try {
9271
- setTenantGroup(envProject.tenantGroupId);
9272
- setSelectedProject(envProject);
9273
- navigate(`/app/${envProject.itemId}/dashboard`);
9274
- } catch (err) {
9275
- console.error("Failed to switch environment", err);
9353
+ setTenantGroup(project.tenantGroupId);
9354
+ setSelectedProject(project);
9355
+ navigate(`/app/${project.itemId}/dashboard`);
9356
+ } catch (error) {
9357
+ console.error("Failed to switch environment", error);
9276
9358
  }
9277
9359
  };
9278
- const renderEnvChip = (envProject) => {
9279
- const label = environmentOptions.find(
9280
- (o) => o.value === envProject.environment
9281
- )?.label;
9282
- return /* @__PURE__ */ jsxRuntime.jsxs(
9283
- "button",
9284
- {
9285
- onClick: (e) => onEnvBadgeClick(e, envProject),
9286
- className: "group/chip border-primary bg-primary text-primary-foreground hover:text-primary inline-flex cursor-pointer items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-medium transition-all duration-150 hover:border-blocks-primary-50 hover:bg-blocks-primary-25 active:scale-95",
9287
- children: [
9288
- label,
9289
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3 w-3 transition-all duration-150 group-hover/chip:translate-x-0.5" })
9290
- ]
9291
- },
9292
- envProject.environment
9293
- );
9294
- };
9360
+ const renderEnvironmentChip = (project) => /* @__PURE__ */ jsxRuntime.jsxs(
9361
+ "button",
9362
+ {
9363
+ type: "button",
9364
+ onClick: (event) => onEnvironmentClick(event, project),
9365
+ className: "group/chip border-primary bg-primary text-primary-foreground hover:text-primary inline-flex cursor-pointer items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-medium transition-all duration-150 hover:border-blocks-primary-50 hover:bg-blocks-primary-25 active:scale-95",
9366
+ children: [
9367
+ getEnvironmentLabel(project.environment),
9368
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3 w-3 transition-all duration-150 group-hover/chip:translate-x-0.5" })
9369
+ ]
9370
+ },
9371
+ project.environment
9372
+ );
9373
+ if (projects.length === 0) {
9374
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "border-border/60 bg-muted/40 text-muted-foreground inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs", children: "No environments" });
9375
+ }
9295
9376
  const hasOverflow = projects.length > INLINE_LIMIT;
9296
9377
  const visibleProjects = hasOverflow ? projects.slice(0, INLINE_LIMIT) : projects;
9297
9378
  const overflowCount = projects.length - INLINE_LIMIT;
9379
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
9380
+ visibleProjects.map(renderEnvironmentChip),
9381
+ hasOverflow && /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
9382
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
9383
+ "button",
9384
+ {
9385
+ type: "button",
9386
+ onClick: (event) => event.stopPropagation(),
9387
+ className: "border-border/60 bg-muted/40 text-muted-foreground hover:bg-muted hover:text-foreground inline-flex cursor-pointer items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors",
9388
+ children: [
9389
+ "+",
9390
+ overflowCount,
9391
+ " more"
9392
+ ]
9393
+ }
9394
+ ) }),
9395
+ /* @__PURE__ */ jsxRuntime.jsxs(
9396
+ PopoverContent,
9397
+ {
9398
+ className: "w-52 p-1.5",
9399
+ align: "start",
9400
+ onClick: (event) => event.stopPropagation(),
9401
+ children: [
9402
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground px-2 pb-1.5 pt-1 text-[10px] font-semibold uppercase tracking-wider", children: "All environments" }),
9403
+ projects.map((project) => /* @__PURE__ */ jsxRuntime.jsxs(
9404
+ "button",
9405
+ {
9406
+ type: "button",
9407
+ onClick: (event) => onEnvironmentClick(event, project),
9408
+ className: "group/item hover:bg-accent flex w-full items-center justify-between rounded-md px-2 py-1.5 text-sm transition-colors",
9409
+ children: [
9410
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: getEnvironmentLabel(project.environment) }),
9411
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "text-muted-foreground group-hover/item:text-foreground h-3.5 w-3.5 transition-transform duration-150 group-hover/item:translate-x-0.5" })
9412
+ ]
9413
+ },
9414
+ project.environment
9415
+ ))
9416
+ ]
9417
+ }
9418
+ )
9419
+ ] })
9420
+ ] });
9421
+ };
9422
+ var ProjectCard = ({
9423
+ project,
9424
+ projects,
9425
+ isShared,
9426
+ canOpen = true
9427
+ }) => {
9298
9428
  return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "border-border/60 bg-card hover:border-primary/30 group flex h-40 flex-col overflow-hidden rounded-xl border p-4 shadow-sm transition-all duration-200 hover:shadow-md", children: [
9299
9429
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-start justify-between gap-2", children: [
9300
9430
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { className: "line-clamp-3 break-all text-base font-semibold leading-snug", children: project.name }) }),
@@ -9314,176 +9444,665 @@ var ProjectCard = ({
9314
9444
  ]
9315
9445
  }
9316
9446
  ),
9317
- canOpen && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
9318
- /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
9319
- Button,
9320
- {
9321
- size: "icon",
9322
- "data-testid": "project-card-open-shared",
9323
- variant: "ghost",
9324
- className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
9325
- disabled: isDisabled || isFetching,
9326
- onClick: onConfigureClick,
9327
- "aria-label": "Open shared project",
9328
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings2, { size: 16 })
9329
- }
9330
- ) }),
9331
- /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: "Open Project" })
9332
- ] })
9333
- ] }),
9334
- whenFalse: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
9335
- /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
9336
- Button,
9447
+ /* @__PURE__ */ jsxRuntime.jsx(
9448
+ ProjectActionButton,
9337
9449
  {
9338
- size: "icon",
9339
- "data-testid": "project-card-configure",
9340
- variant: "ghost",
9341
- className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
9342
- disabled: isDisabled || isFetching,
9343
- onClick: onConfigureClick,
9344
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings2, { size: 16 })
9450
+ project,
9451
+ isShared: true,
9452
+ canOpen
9345
9453
  }
9346
- ) }),
9347
- /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: "Configure Project" })
9348
- ] })
9454
+ )
9455
+ ] }),
9456
+ whenFalse: /* @__PURE__ */ jsxRuntime.jsx(ProjectActionButton, { project, isShared: false })
9349
9457
  }
9350
9458
  ) })
9351
9459
  ] }),
9352
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-auto", children: projects.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "border-border/60 bg-muted/40 text-muted-foreground inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs", children: "No environments" }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
9353
- visibleProjects.map((p) => renderEnvChip(p)),
9354
- hasOverflow && /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
9355
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
9356
- "button",
9357
- {
9358
- onClick: (e) => e.stopPropagation(),
9359
- className: "border-border/60 bg-muted/40 text-muted-foreground hover:bg-muted hover:text-foreground inline-flex cursor-pointer items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors",
9360
- children: [
9361
- "+",
9362
- overflowCount,
9363
- " more"
9364
- ]
9365
- }
9366
- ) }),
9367
- /* @__PURE__ */ jsxRuntime.jsxs(
9368
- PopoverContent,
9369
- {
9370
- className: "w-52 p-1.5",
9371
- align: "start",
9372
- onClick: (e) => e.stopPropagation(),
9373
- children: [
9374
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground px-2 pb-1.5 pt-1 text-[10px] font-semibold uppercase tracking-wider", children: "All environments" }),
9375
- projects.map((p) => {
9376
- const opt = environmentOptions.find(
9377
- (o) => o.value === p.environment
9378
- );
9379
- return /* @__PURE__ */ jsxRuntime.jsxs(
9380
- "button",
9381
- {
9382
- onClick: (e) => onEnvBadgeClick(e, p),
9383
- className: "group/item hover:bg-accent flex w-full items-center justify-between rounded-md px-2 py-1.5 text-sm transition-colors",
9384
- children: [
9385
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: opt?.label ?? p.environment }),
9386
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "text-muted-foreground group-hover/item:text-foreground h-3.5 w-3.5 transition-transform duration-150 group-hover/item:translate-x-0.5" })
9387
- ]
9388
- },
9389
- p.environment
9390
- );
9391
- })
9392
- ]
9393
- }
9394
- )
9395
- ] })
9396
- ] }) })
9460
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-auto", children: /* @__PURE__ */ jsxRuntime.jsx(ProjectEnvironments, { projects }) })
9397
9461
  ] });
9398
9462
  };
9399
- var cardVariants = {
9400
- hidden: { opacity: 0, y: 20, scale: 0.97 },
9401
- visible: (i) => ({
9402
- opacity: 1,
9403
- y: 0,
9404
- scale: 1,
9405
- transition: {
9406
- delay: i * 0.06,
9407
- duration: 0.4,
9408
- ease: [0.22, 1, 0.36, 1]
9409
- }
9410
- })
9463
+ var getLastUpdatedLabel = (group) => {
9464
+ const timestamp = getLatestProjectUpdate(group);
9465
+ return timestamp === 0 ? "Unknown" : dateFns.formatDistanceToNow(timestamp, { addSuffix: true });
9411
9466
  };
9412
- var canOpenProject = (group) => !group.isShared || !group.accessPolicies || group.accessPolicies.length > 0;
9413
- var SelfProjectLoading = () => {
9414
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5", "sk-6", "sk-7", "sk-8"].map(
9415
- (itemKey) => /* @__PURE__ */ jsxRuntime.jsx(ProjectCardLoadingSkeleton, {}, itemKey)
9416
- ) });
9467
+ var getLastUpdatedCellLabel = (group) => {
9468
+ const timestamp = getLatestProjectUpdate(group);
9469
+ return timestamp === 0 ? "Not updated yet" : `Updated ${dateFns.formatDistanceToNow(timestamp, { addSuffix: true })}`;
9417
9470
  };
9418
- var SelfProject = ({ canCreateProject = false }) => {
9419
- const { data: data2, isLoading, isFetching } = chunkUVMFL4UV_cjs.useGetProjects({ enabled: true });
9420
- if (isLoading || isFetching) return /* @__PURE__ */ jsxRuntime.jsx(SelfProjectLoading, {});
9421
- const projectGroups = data2 || [];
9422
- if (!projectGroups.length && canCreateProject)
9423
- return /* @__PURE__ */ jsxRuntime.jsx(ConsoleCreateProject, {});
9424
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-4", children: [
9425
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
9426
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
9427
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "shrink-0 text-base font-semibold text-[hsl(var(--high-emphasis))]", children: "Your Blocks Projects" }),
9428
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-primary/10 text-primary rounded-full px-2 py-0.5 text-xs font-semibold", children: projectGroups.length })
9429
- ] }),
9430
- canCreateProject && projectGroups.length > 9 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-sm text-[hsl(var(--medium-emphasis))]", children: "Please delete an existing project to create a new one." })
9431
- ] }),
9432
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: [
9433
- projectGroups.length < 10 && /* @__PURE__ */ jsxRuntime.jsx(
9434
- framerMotion.motion.div,
9435
- {
9436
- variants: cardVariants,
9437
- custom: 0,
9438
- initial: "hidden",
9439
- animate: "visible",
9440
- children: /* @__PURE__ */ jsxRuntime.jsx(AddProjectCard, {})
9441
- }
9442
- ),
9443
- projectGroups.map((project, i) => /* @__PURE__ */ jsxRuntime.jsx(
9444
- framerMotion.motion.div,
9445
- {
9446
- variants: cardVariants,
9447
- custom: projectGroups.length < 10 ? i + 1 : i,
9448
- initial: "hidden",
9449
- animate: "visible",
9450
- children: project.projects[0] && /* @__PURE__ */ jsxRuntime.jsx(
9451
- ProjectCard,
9452
- {
9453
- project: project.projects[0],
9454
- projects: project.projects,
9455
- isShared: project.isShared,
9456
- canOpen: canOpenProject(project)
9457
- }
9458
- )
9459
- },
9460
- project.tenantGroupId
9461
- ))
9462
- ] })
9463
- ] });
9471
+ var CARD_RADIUS = "0.75rem";
9472
+ var ROW_SPACING = "0 0.5rem";
9473
+ var cardCorners = {
9474
+ left: {
9475
+ borderTopLeftRadius: CARD_RADIUS,
9476
+ borderBottomLeftRadius: CARD_RADIUS
9477
+ },
9478
+ right: {
9479
+ borderTopRightRadius: CARD_RADIUS,
9480
+ borderBottomRightRadius: CARD_RADIUS
9481
+ }
9464
9482
  };
9465
- var ConsolePage = ({ canCreateProject = false }) => {
9466
- const { resetSelectedProject, resetTenantGroup } = chunkVAKGHXK6_cjs.useProjectStore();
9467
- React8.useEffect(() => {
9468
- resetSelectedProject();
9469
- resetTenantGroup();
9470
- }, [resetSelectedProject, resetTenantGroup]);
9471
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-1 flex-col overflow-hidden", children: [
9472
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-primary/[0.07] pointer-events-none absolute -top-20 right-0 h-[600px] w-[600px] rounded-full blur-[100px]" }),
9473
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-primary/[0.04] pointer-events-none absolute left-1/3 top-10 h-[350px] w-[350px] rounded-full blur-[80px]" }),
9474
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-1 flex-col gap-12 px-6 py-10 sm:px-10 xl:px-[154px]", children: [
9475
- /* @__PURE__ */ jsxRuntime.jsx(SelfProject, { canCreateProject }),
9476
- /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-5", children: [
9477
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
9478
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-primary/10 text-primary inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold tracking-wide", children: "Resources" }),
9479
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px flex-1 bg-[hsl(var(--border-default))]" })
9480
- ] }),
9481
- /* @__PURE__ */ jsxRuntime.jsx(DefaultDoc, {})
9482
- ] })
9483
- ] })
9484
- ] });
9483
+ var SharedStatus = ({ isShared }) => isShared ? /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "outline", className: "flex w-fit items-center gap-1", children: [
9484
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UsersRound, { size: 16 }),
9485
+ "Shared"
9486
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
9487
+ var AddProjectListAction = ({ mobile = false }) => {
9488
+ const { handleClick, isDisabled, isFetching } = useCreateProjectRedirect();
9489
+ const action = /* @__PURE__ */ jsxRuntime.jsxs(
9490
+ Button,
9491
+ {
9492
+ type: "button",
9493
+ variant: "ghost",
9494
+ className: "text-primary w-full justify-start gap-2",
9495
+ disabled: isDisabled || isFetching,
9496
+ onClick: handleClick,
9497
+ children: [
9498
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" }),
9499
+ "Add Project"
9500
+ ]
9501
+ }
9502
+ );
9503
+ if (mobile) {
9504
+ return /* @__PURE__ */ jsxRuntime.jsx(
9505
+ Card,
9506
+ {
9507
+ "data-testid": "add-project-list-row",
9508
+ className: "border-primary/30 rounded-xl border border-dashed p-2",
9509
+ children: action
9510
+ }
9511
+ );
9512
+ }
9513
+ return /* @__PURE__ */ jsxRuntime.jsx(TableRow, { "data-testid": "add-project-list-row", className: "border-0", children: /* @__PURE__ */ jsxRuntime.jsx(
9514
+ TableCell,
9515
+ {
9516
+ colSpan: 5,
9517
+ className: "border-primary/30 border border-dashed bg-transparent p-2",
9518
+ style: { borderRadius: CARD_RADIUS },
9519
+ children: action
9520
+ }
9521
+ ) });
9485
9522
  };
9486
- var CallbackPage = ({ defaultRedirectUrl }) => {
9523
+ var ProjectMobileList = ({
9524
+ projectGroups,
9525
+ showAddProject
9526
+ }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3", "data-testid": "project-list-mobile", children: [
9527
+ showAddProject && /* @__PURE__ */ jsxRuntime.jsx(AddProjectListAction, { mobile: true }),
9528
+ projectGroups.map((group) => {
9529
+ const project = group.projects[0];
9530
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9531
+ Card,
9532
+ {
9533
+ "data-testid": "project-list-row",
9534
+ className: "border-border/60 space-y-3 rounded-xl border p-4 shadow-sm",
9535
+ children: [
9536
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
9537
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-2", children: [
9538
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { className: "break-all text-base", children: getProjectGroupName(group) || "Unnamed project" }),
9539
+ /* @__PURE__ */ jsxRuntime.jsx(SharedStatus, { isShared: group.isShared })
9540
+ ] }),
9541
+ project && /* @__PURE__ */ jsxRuntime.jsx(
9542
+ ProjectActionButton,
9543
+ {
9544
+ project,
9545
+ isShared: group.isShared,
9546
+ canOpen: canOpenProject(group)
9547
+ }
9548
+ )
9549
+ ] }),
9550
+ /* @__PURE__ */ jsxRuntime.jsx(ProjectEnvironments, { projects: group.projects }),
9551
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground text-xs", children: [
9552
+ "Last updated ",
9553
+ getLastUpdatedLabel(group)
9554
+ ] })
9555
+ ]
9556
+ },
9557
+ group.tenantGroupId
9558
+ );
9559
+ })
9560
+ ] });
9561
+ var ProjectList = ({
9562
+ projectGroups,
9563
+ showAddProject
9564
+ }) => {
9565
+ const isMobile = chunkQ7Y32IBM_cjs.useIsMobile();
9566
+ if (isMobile) {
9567
+ return /* @__PURE__ */ jsxRuntime.jsx(
9568
+ ProjectMobileList,
9569
+ {
9570
+ projectGroups,
9571
+ showAddProject
9572
+ }
9573
+ );
9574
+ }
9575
+ return /* @__PURE__ */ jsxRuntime.jsx(
9576
+ Table,
9577
+ {
9578
+ "data-testid": "project-list-table",
9579
+ style: { borderCollapse: "separate", borderSpacing: ROW_SPACING },
9580
+ children: /* @__PURE__ */ jsxRuntime.jsxs(TableBody, { children: [
9581
+ showAddProject && /* @__PURE__ */ jsxRuntime.jsx(AddProjectListAction, {}),
9582
+ projectGroups.map((group) => {
9583
+ const project = group.projects[0];
9584
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9585
+ TableRow,
9586
+ {
9587
+ "data-testid": "project-list-row",
9588
+ className: "border-0",
9589
+ children: [
9590
+ /* @__PURE__ */ jsxRuntime.jsx(
9591
+ TableCell,
9592
+ {
9593
+ className: "bg-card max-w-64 break-all py-2 font-medium",
9594
+ style: cardCorners.left,
9595
+ children: getProjectGroupName(group) || "Unnamed project"
9596
+ }
9597
+ ),
9598
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "bg-card py-2", children: /* @__PURE__ */ jsxRuntime.jsx(ProjectEnvironments, { projects: group.projects }) }),
9599
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "bg-card py-2", children: /* @__PURE__ */ jsxRuntime.jsx(SharedStatus, { isShared: group.isShared }) }),
9600
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "bg-card whitespace-nowrap py-2 text-muted-foreground", children: getLastUpdatedCellLabel(group) }),
9601
+ /* @__PURE__ */ jsxRuntime.jsx(
9602
+ TableCell,
9603
+ {
9604
+ className: "bg-card py-2 text-right",
9605
+ style: cardCorners.right,
9606
+ children: project && /* @__PURE__ */ jsxRuntime.jsx(
9607
+ ProjectActionButton,
9608
+ {
9609
+ project,
9610
+ isShared: group.isShared,
9611
+ canOpen: canOpenProject(group)
9612
+ }
9613
+ )
9614
+ }
9615
+ )
9616
+ ]
9617
+ },
9618
+ group.tenantGroupId
9619
+ );
9620
+ })
9621
+ ] })
9622
+ }
9623
+ );
9624
+ };
9625
+ function MultiSelect2({
9626
+ label,
9627
+ options,
9628
+ onChange,
9629
+ value: selectedValues
9630
+ }) {
9631
+ const [buttonRef, popoverWidth] = chunkGZSVB47D_cjs.usePopoverWidth();
9632
+ const onSelectHandler = (value) => {
9633
+ const nextValues = selectedValues.includes(value) ? selectedValues.filter((item) => item !== value) : [...selectedValues, value];
9634
+ onChange(nextValues);
9635
+ };
9636
+ const onResetHandler = () => {
9637
+ onChange([]);
9638
+ };
9639
+ const isMobile = chunkQ7Y32IBM_cjs.useIsMobile();
9640
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
9641
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
9642
+ Button,
9643
+ {
9644
+ ref: buttonRef,
9645
+ variant: "outline",
9646
+ size: "sm",
9647
+ className: "h-8 rounded-md border-dashed",
9648
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
9649
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
9650
+ /* @__PURE__ */ jsxRuntime.jsx(reactIcons.PlusCircledIcon, { className: "mr-2 h-4 w-4" }),
9651
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: label }),
9652
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm:hidden", children: label?.split(" ")[0] })
9653
+ ] }),
9654
+ selectedValues?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9655
+ /* @__PURE__ */ jsxRuntime.jsx(
9656
+ Separator,
9657
+ {
9658
+ orientation: "vertical",
9659
+ className: "hidden h-4 sm:mx-2 sm:block"
9660
+ }
9661
+ ),
9662
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex space-x-1", children: selectedValues.length > 2 ? /* @__PURE__ */ jsxRuntime.jsxs(
9663
+ Badge,
9664
+ {
9665
+ variant: "outline",
9666
+ className: "rounded-sm px-1 font-normal",
9667
+ children: [
9668
+ selectedValues.length,
9669
+ " selected"
9670
+ ]
9671
+ }
9672
+ ) : options.filter((option) => selectedValues.includes(option.value)).map((option) => /* @__PURE__ */ jsxRuntime.jsx(
9673
+ Badge,
9674
+ {
9675
+ variant: "outline",
9676
+ className: "rounded-sm px-1 font-normal",
9677
+ children: option.label
9678
+ },
9679
+ option.value
9680
+ )) })
9681
+ ] })
9682
+ ] })
9683
+ }
9684
+ ) }),
9685
+ /* @__PURE__ */ jsxRuntime.jsx(
9686
+ PopoverContent,
9687
+ {
9688
+ className: "w-auto p-0 sm:w-full",
9689
+ align: "start",
9690
+ style: isMobile ? { width: popoverWidth ? `${popoverWidth}px` : "auto" } : void 0,
9691
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
9692
+ /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: label }),
9693
+ /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
9694
+ /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: "No results found." }),
9695
+ /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: options.map((option) => {
9696
+ const isSelected = selectedValues.includes(option.value);
9697
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9698
+ CommandItem,
9699
+ {
9700
+ onSelect: () => onSelectHandler(option.value),
9701
+ children: [
9702
+ /* @__PURE__ */ jsxRuntime.jsx(
9703
+ "div",
9704
+ {
9705
+ className: chunkYAF2X7W5_cjs.cn(
9706
+ "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
9707
+ isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
9708
+ ),
9709
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, { className: chunkYAF2X7W5_cjs.cn("h-4 w-4") })
9710
+ }
9711
+ ),
9712
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label })
9713
+ ]
9714
+ },
9715
+ option.value
9716
+ );
9717
+ }) }),
9718
+ selectedValues.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9719
+ /* @__PURE__ */ jsxRuntime.jsx(CommandSeparator, {}),
9720
+ /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(
9721
+ CommandItem,
9722
+ {
9723
+ onSelect: () => onResetHandler(),
9724
+ className: "justify-center text-center",
9725
+ children: "Clear"
9726
+ }
9727
+ ) })
9728
+ ] })
9729
+ ] })
9730
+ ] })
9731
+ }
9732
+ )
9733
+ ] });
9734
+ }
9735
+ var ResetButton = ({ onClick }) => {
9736
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9737
+ Button,
9738
+ {
9739
+ type: "button",
9740
+ variant: "outline",
9741
+ onClick,
9742
+ className: "h-8 rounded-md px-2 lg:px-3",
9743
+ children: [
9744
+ "Reset",
9745
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "ml-2 h-4 w-4" })
9746
+ ]
9747
+ }
9748
+ );
9749
+ };
9750
+ var SearchInput = ({
9751
+ onChange,
9752
+ placeholder = "Search...",
9753
+ value,
9754
+ className = ""
9755
+ }) => {
9756
+ const [state, setState] = React8.useState(value);
9757
+ const inputRef = React8.useRef(null);
9758
+ React8.useEffect(() => {
9759
+ setState(value);
9760
+ }, [value]);
9761
+ const debounced = React8.useRef(
9762
+ chunkVTOD5ZQU_cjs.debounce((val) => {
9763
+ onChange(val);
9764
+ }, 300)
9765
+ ).current;
9766
+ React8.useEffect(() => {
9767
+ return () => {
9768
+ debounced.cancel();
9769
+ };
9770
+ }, [debounced]);
9771
+ const handleChange = (event) => {
9772
+ event.stopPropagation();
9773
+ setState(event.target.value);
9774
+ debounced(event.target.value);
9775
+ };
9776
+ const handleClear = (e) => {
9777
+ e.stopPropagation();
9778
+ setState("");
9779
+ onChange("");
9780
+ };
9781
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md border bg-background flex items-center px-2", children: [
9782
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
9783
+ /* @__PURE__ */ jsxRuntime.jsx(
9784
+ Input,
9785
+ {
9786
+ ref: inputRef,
9787
+ placeholder,
9788
+ value: state,
9789
+ onChange: handleChange,
9790
+ className: chunkYAF2X7W5_cjs.cn(
9791
+ "h-8 w-52 border-none p-0 focus-visible:ring-0 focus-visible:ring-offset-0",
9792
+ className
9793
+ )
9794
+ }
9795
+ ),
9796
+ /* @__PURE__ */ jsxRuntime.jsx(
9797
+ Button,
9798
+ {
9799
+ variant: "ghost",
9800
+ size: "xs",
9801
+ className: chunkYAF2X7W5_cjs.cn(
9802
+ "h-full p-1 pr-0 hover:bg-transparent",
9803
+ !value && "invisible"
9804
+ ),
9805
+ onClick: handleClear,
9806
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4 text-muted-foreground" })
9807
+ }
9808
+ )
9809
+ ] });
9810
+ };
9811
+ var ProjectToolbar = ({
9812
+ availableEnvironmentOptions,
9813
+ environmentFilter,
9814
+ onEnvironmentFilterChange,
9815
+ onReset,
9816
+ onSearchTextChange,
9817
+ onViewModeChange,
9818
+ searchText,
9819
+ viewMode
9820
+ }) => {
9821
+ const hasActiveFilters = searchText.trim().length > 0 || environmentFilter.length > 0;
9822
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9823
+ "div",
9824
+ {
9825
+ className: "flex flex-wrap items-center justify-between gap-3",
9826
+ "aria-label": "Project filters and view",
9827
+ children: [
9828
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
9829
+ /* @__PURE__ */ jsxRuntime.jsx(
9830
+ SearchInput,
9831
+ {
9832
+ value: searchText,
9833
+ onChange: onSearchTextChange,
9834
+ placeholder: "Search projects..."
9835
+ }
9836
+ ),
9837
+ /* @__PURE__ */ jsxRuntime.jsx(
9838
+ MultiSelect2,
9839
+ {
9840
+ label: "Environment",
9841
+ options: availableEnvironmentOptions,
9842
+ value: environmentFilter,
9843
+ onChange: onEnvironmentFilterChange
9844
+ }
9845
+ ),
9846
+ hasActiveFilters && /* @__PURE__ */ jsxRuntime.jsx(ResetButton, { onClick: onReset })
9847
+ ] }),
9848
+ /* @__PURE__ */ jsxRuntime.jsxs(
9849
+ ToggleGroup,
9850
+ {
9851
+ type: "single",
9852
+ variant: "outline",
9853
+ size: "sm",
9854
+ value: viewMode,
9855
+ onValueChange: (value) => {
9856
+ if (value === "grid" || value === "list") onViewModeChange(value);
9857
+ },
9858
+ "aria-label": "Project view",
9859
+ className: "h-8 rounded-md border bg-background p-0.5",
9860
+ children: [
9861
+ /* @__PURE__ */ jsxRuntime.jsx(
9862
+ ToggleGroupItem,
9863
+ {
9864
+ value: "grid",
9865
+ "aria-label": "Grid view",
9866
+ className: "h-7 w-7 min-w-0 border-0 px-0",
9867
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutGrid, { className: "h-4 w-4" })
9868
+ }
9869
+ ),
9870
+ /* @__PURE__ */ jsxRuntime.jsx(
9871
+ ToggleGroupItem,
9872
+ {
9873
+ value: "list",
9874
+ "aria-label": "List view",
9875
+ className: "h-7 w-7 min-w-0 border-0 px-0",
9876
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "h-4 w-4" })
9877
+ }
9878
+ )
9879
+ ]
9880
+ }
9881
+ )
9882
+ ]
9883
+ }
9884
+ );
9885
+ };
9886
+ var DEFAULT_SORT = {
9887
+ property: "lastUpdatedDate",
9888
+ isDescending: true
9889
+ };
9890
+ var projectViewStorage = chunkVTOD5ZQU_cjs.createStorage("local", { prefix: "console" });
9891
+ var VIEW_MODE_KEY = "projectsViewMode";
9892
+ var readViewMode = () => {
9893
+ const storedValue = projectViewStorage.get(VIEW_MODE_KEY);
9894
+ return storedValue === "list" || storedValue === "grid" ? storedValue : "grid";
9895
+ };
9896
+ var SEARCH_OPTIONS = {
9897
+ keys: ["representativeName"],
9898
+ threshold: 0.3
9899
+ };
9900
+ var useProjectListState = (projectGroups) => {
9901
+ const [viewMode, setViewMode] = React8.useState(readViewMode);
9902
+ const [searchText, setSearchText] = React8.useState("");
9903
+ const [environmentFilter, setEnvironmentFilter] = React8.useState([]);
9904
+ const [sort, setSort] = React8.useState(DEFAULT_SORT);
9905
+ const searchableGroups = React8.useMemo(
9906
+ () => projectGroups.map((group) => ({
9907
+ group,
9908
+ representativeName: getProjectGroupName(group)
9909
+ })),
9910
+ [projectGroups]
9911
+ );
9912
+ const searchedGroups = chunkGZSVB47D_cjs.useDebouncedFuseFilter(
9913
+ searchableGroups,
9914
+ searchText,
9915
+ SEARCH_OPTIONS
9916
+ );
9917
+ const visibleProjectGroups = React8.useMemo(() => {
9918
+ const filteredGroups = searchedGroups.map(({ group }) => group).filter(
9919
+ (group) => environmentFilter.length === 0 || group.projects.some(
9920
+ (project) => environmentFilter.includes(project.environment)
9921
+ )
9922
+ );
9923
+ return filteredGroups.toSorted((left, right) => {
9924
+ const comparison = sort.property === "name" ? getProjectGroupName(left).localeCompare(getProjectGroupName(right)) : getLatestProjectUpdate(left) - getLatestProjectUpdate(right);
9925
+ return sort.isDescending ? -comparison : comparison;
9926
+ });
9927
+ }, [environmentFilter, searchedGroups, sort]);
9928
+ const availableEnvironmentOptions = React8.useMemo(() => {
9929
+ const presentValues = new Set(
9930
+ projectGroups.flatMap(
9931
+ (group) => group.projects.map((project) => project.environment).filter((environment) => environment.length > 0)
9932
+ )
9933
+ );
9934
+ const knownOptions = environmentOptions.filter((option) => presentValues.delete(option.value)).map(({ label, value }) => ({ label, value }));
9935
+ const unknownOptions = [...presentValues].sort((left, right) => left.localeCompare(right)).map((value) => ({ label: value, value }));
9936
+ return [...knownOptions, ...unknownOptions];
9937
+ }, [projectGroups]);
9938
+ const persistViewMode = React8.useCallback((nextViewMode) => {
9939
+ setViewMode(nextViewMode);
9940
+ projectViewStorage.set(VIEW_MODE_KEY, nextViewMode);
9941
+ }, []);
9942
+ const resetFilters = React8.useCallback(() => {
9943
+ setSearchText("");
9944
+ setEnvironmentFilter([]);
9945
+ }, []);
9946
+ return {
9947
+ availableEnvironmentOptions,
9948
+ environmentFilter,
9949
+ resetFilters,
9950
+ searchText,
9951
+ setEnvironmentFilter,
9952
+ setSearchText,
9953
+ setSort,
9954
+ setViewMode: persistViewMode,
9955
+ sort,
9956
+ viewMode,
9957
+ visibleProjectGroups
9958
+ };
9959
+ };
9960
+ var cardVariants = {
9961
+ hidden: { opacity: 0, y: 20, scale: 0.97 },
9962
+ visible: (i) => ({
9963
+ opacity: 1,
9964
+ y: 0,
9965
+ scale: 1,
9966
+ transition: {
9967
+ delay: i * 0.06,
9968
+ duration: 0.4,
9969
+ ease: [0.22, 1, 0.36, 1]
9970
+ }
9971
+ })
9972
+ };
9973
+ var SelfProjectLoading = ({ viewMode }) => {
9974
+ if (viewMode === "list") {
9975
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5"].map((itemKey) => /* @__PURE__ */ jsxRuntime.jsx(ProjectListRowLoadingSkeleton, {}, itemKey)) });
9976
+ }
9977
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5", "sk-6", "sk-7", "sk-8"].map(
9978
+ (itemKey) => /* @__PURE__ */ jsxRuntime.jsx(ProjectCardLoadingSkeleton, {}, itemKey)
9979
+ ) });
9980
+ };
9981
+ var SelfProject = ({ canCreateProject = false }) => {
9982
+ const { data: data2, isLoading, isFetching } = chunkUVMFL4UV_cjs.useGetProjects({ enabled: true });
9983
+ const isPending = isLoading || isFetching;
9984
+ const projectGroups = data2 || [];
9985
+ const {
9986
+ availableEnvironmentOptions,
9987
+ environmentFilter,
9988
+ resetFilters,
9989
+ searchText,
9990
+ setEnvironmentFilter,
9991
+ setSearchText,
9992
+ setViewMode,
9993
+ viewMode,
9994
+ visibleProjectGroups
9995
+ } = useProjectListState(projectGroups);
9996
+ if (!isPending && !projectGroups.length && canCreateProject)
9997
+ return /* @__PURE__ */ jsxRuntime.jsx(ConsoleCreateProject, {});
9998
+ const showAddProject = projectGroups.length < 10 && searchText.trim().length === 0;
9999
+ const hasNoMatches = projectGroups.length > 0 && visibleProjectGroups.length === 0;
10000
+ let projectsContent;
10001
+ if (isPending) {
10002
+ projectsContent = /* @__PURE__ */ jsxRuntime.jsx(SelfProjectLoading, { viewMode });
10003
+ } else if (viewMode === "grid") {
10004
+ projectsContent = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: [
10005
+ showAddProject && /* @__PURE__ */ jsxRuntime.jsx(
10006
+ framerMotion.motion.div,
10007
+ {
10008
+ variants: cardVariants,
10009
+ custom: 0,
10010
+ initial: "hidden",
10011
+ animate: "visible",
10012
+ children: /* @__PURE__ */ jsxRuntime.jsx(AddProjectCard, {})
10013
+ }
10014
+ ),
10015
+ visibleProjectGroups.map((project, index) => /* @__PURE__ */ jsxRuntime.jsx(
10016
+ framerMotion.motion.div,
10017
+ {
10018
+ variants: cardVariants,
10019
+ custom: showAddProject ? index + 1 : index,
10020
+ initial: "hidden",
10021
+ animate: "visible",
10022
+ children: project.projects[0] && /* @__PURE__ */ jsxRuntime.jsx(
10023
+ ProjectCard,
10024
+ {
10025
+ project: project.projects[0],
10026
+ projects: project.projects,
10027
+ isShared: project.isShared,
10028
+ canOpen: canOpenProject(project)
10029
+ }
10030
+ )
10031
+ },
10032
+ project.tenantGroupId
10033
+ ))
10034
+ ] });
10035
+ } else {
10036
+ projectsContent = /* @__PURE__ */ jsxRuntime.jsx(
10037
+ ProjectList,
10038
+ {
10039
+ projectGroups: visibleProjectGroups,
10040
+ showAddProject
10041
+ }
10042
+ );
10043
+ }
10044
+ return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-4", children: [
10045
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-3", children: [
10046
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [
10047
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "shrink-0 text-base font-semibold text-[hsl(var(--high-emphasis))]", children: "Your Blocks Projects" }),
10048
+ isPending ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-5 w-8 rounded-full" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-primary/10 text-primary shrink-0 rounded-full px-2 py-0.5 text-xs font-semibold", children: projectGroups.length })
10049
+ ] }),
10050
+ !isPending && canCreateProject && projectGroups.length > 9 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-[hsl(var(--medium-emphasis))]", children: "Please delete an existing project to create a new one." })
10051
+ ] }),
10052
+ (isPending || projectGroups.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(
10053
+ ProjectToolbar,
10054
+ {
10055
+ availableEnvironmentOptions,
10056
+ environmentFilter,
10057
+ onEnvironmentFilterChange: setEnvironmentFilter,
10058
+ onReset: resetFilters,
10059
+ onSearchTextChange: setSearchText,
10060
+ onViewModeChange: setViewMode,
10061
+ searchText,
10062
+ viewMode
10063
+ }
10064
+ ),
10065
+ projectsContent,
10066
+ hasNoMatches && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center", children: [
10067
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: searchText.trim() ? "No projects match your search" : "No projects match the selected filters" }),
10068
+ /* @__PURE__ */ jsxRuntime.jsx(
10069
+ Button,
10070
+ {
10071
+ type: "button",
10072
+ variant: "outline",
10073
+ size: "sm",
10074
+ onClick: () => {
10075
+ if (searchText.trim()) setSearchText("");
10076
+ else setEnvironmentFilter([]);
10077
+ },
10078
+ children: searchText.trim() ? "Clear search" : "Clear filters"
10079
+ }
10080
+ )
10081
+ ] })
10082
+ ] });
10083
+ };
10084
+ var ConsolePage = ({ canCreateProject = false }) => {
10085
+ const { resetSelectedProject, resetTenantGroup } = chunkVAKGHXK6_cjs.useProjectStore();
10086
+ React8.useEffect(() => {
10087
+ resetSelectedProject();
10088
+ resetTenantGroup();
10089
+ }, [resetSelectedProject, resetTenantGroup]);
10090
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-1 flex-col overflow-hidden", children: [
10091
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-primary/[0.07] pointer-events-none absolute -top-20 right-0 h-[600px] w-[600px] rounded-full blur-[100px]" }),
10092
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-primary/[0.04] pointer-events-none absolute left-1/3 top-10 h-[350px] w-[350px] rounded-full blur-[80px]" }),
10093
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-1 flex-col gap-12 px-6 py-10 sm:px-10 xl:px-[154px]", children: [
10094
+ /* @__PURE__ */ jsxRuntime.jsx(SelfProject, { canCreateProject }),
10095
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-5", children: [
10096
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
10097
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-primary/10 text-primary inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold tracking-wide", children: "Resources" }),
10098
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px flex-1 bg-[hsl(var(--border-default))]" })
10099
+ ] }),
10100
+ /* @__PURE__ */ jsxRuntime.jsx(DefaultDoc, {})
10101
+ ] })
10102
+ ] })
10103
+ ] });
10104
+ };
10105
+ var CallbackPage = ({ defaultRedirectUrl }) => {
9487
10106
  const [searchParams] = reactRouter.useSearchParams();
9488
10107
  const hasProcessed = React8.useRef(false);
9489
10108
  const { setAuthenticated } = chunkVAKGHXK6_cjs.useAuthStore();
@@ -9888,7 +10507,7 @@ var wildcardToRegex2 = (pattern) => {
9888
10507
  const escaped = pattern.replace(/[-/\\^$+?.()|[\]{}]/g, "\\$&");
9889
10508
  return `^${escaped.replace(/\*/g, "[^/]+")}$`;
9890
10509
  };
9891
- function ProjectList({
10510
+ function ProjectList2({
9892
10511
  redirectPaths,
9893
10512
  collapsed = false
9894
10513
  }) {
@@ -10440,8 +11059,8 @@ function EditProject() {
10440
11059
  ] });
10441
11060
  }
10442
11061
  var ProjectCardLoadingSkeleton = () => {
10443
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "border-border/60 flex h-[160px] flex-col overflow-hidden rounded-xl border p-4 shadow-sm", children: [
10444
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
11062
+ return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "border-border/60 bg-card flex h-40 flex-col overflow-hidden rounded-xl border p-4 shadow-sm", children: [
11063
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
10445
11064
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
10446
11065
  /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-4/5" }),
10447
11066
  /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "mt-1.5 h-4 w-3/5" })
@@ -10454,6 +11073,14 @@ var ProjectCardLoadingSkeleton = () => {
10454
11073
  ] })
10455
11074
  ] });
10456
11075
  };
11076
+ var ProjectListRowLoadingSkeleton = () => {
11077
+ return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: "border-border/60 bg-card flex h-14 items-center gap-4 rounded-xl border px-4 py-2 shadow-sm", children: [
11078
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-32" }),
11079
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-5 w-16 shrink-0 rounded-full" }),
11080
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "ml-auto h-4 w-20 shrink-0" }),
11081
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-8 w-8 shrink-0 rounded-md" })
11082
+ ] });
11083
+ };
10457
11084
  function SidebarMobileView({
10458
11085
  redirectPaths,
10459
11086
  navigationMenus
@@ -10491,7 +11118,7 @@ function SidebarMobileView({
10491
11118
  /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
10492
11119
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex w-full flex-col items-start px-6", children: [
10493
11120
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-1 text-sm text-low-emphasis", children: "Project" }),
10494
- /* @__PURE__ */ jsxRuntime.jsx(ProjectList, { redirectPaths })
11121
+ /* @__PURE__ */ jsxRuntime.jsx(ProjectList2, { redirectPaths })
10495
11122
  ] }),
10496
11123
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-3 flex w-full flex-col items-start px-6", children: [
10497
11124
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-1 text-sm text-low-emphasis", children: "Environment" }),
@@ -10559,11 +11186,11 @@ function SidebarMenuDesktop({
10559
11186
  isSidebarOpen ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b px-2 pb-2 pt-2", children: [
10560
11187
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 px-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: "Workspace" }),
10561
11188
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
10562
- /* @__PURE__ */ jsxRuntime.jsx(ProjectList, { redirectPaths }),
11189
+ /* @__PURE__ */ jsxRuntime.jsx(ProjectList2, { redirectPaths }),
10563
11190
  /* @__PURE__ */ jsxRuntime.jsx(RenderConditionally, { condition: !isProjectOverviewRoute, children: /* @__PURE__ */ jsxRuntime.jsx(EnvironmentList, { redirectPaths }) })
10564
11191
  ] })
10565
11192
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b py-1", children: [
10566
- /* @__PURE__ */ jsxRuntime.jsx(ProjectList, { redirectPaths, collapsed: true }),
11193
+ /* @__PURE__ */ jsxRuntime.jsx(ProjectList2, { redirectPaths, collapsed: true }),
10567
11194
  /* @__PURE__ */ jsxRuntime.jsx(RenderConditionally, { condition: !isProjectOverviewRoute, children: /* @__PURE__ */ jsxRuntime.jsx(EnvironmentList, { redirectPaths, collapsed: true }) })
10568
11195
  ] }),
10569
11196
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: chunkYAF2X7W5_cjs.cn("grid w-full items-start gap-1 text-sm"), children: allowedMenu.map((menu) => /* @__PURE__ */ jsxRuntime.jsx(React8.Fragment, { children: menu.type === "menu" ? /* @__PURE__ */ jsxRuntime.jsx(DesktopMenuItem, { menu, isSidebarOpen }) : /* @__PURE__ */ jsxRuntime.jsx(Separator, {}) }, menu.id)) }) })
@@ -11596,116 +12223,6 @@ var DropdownSearchInput = ({
11596
12223
  )
11597
12224
  ] });
11598
12225
  };
11599
- function MultiSelect2({
11600
- label,
11601
- options,
11602
- onChange,
11603
- value: selectedValues
11604
- }) {
11605
- const [buttonRef, popoverWidth] = chunkGZSVB47D_cjs.usePopoverWidth();
11606
- const onSelectHandler = (value) => {
11607
- const nextValues = selectedValues.includes(value) ? selectedValues.filter((item) => item !== value) : [...selectedValues, value];
11608
- onChange(nextValues);
11609
- };
11610
- const onResetHandler = () => {
11611
- onChange([]);
11612
- };
11613
- const isMobile = chunkQ7Y32IBM_cjs.useIsMobile();
11614
- return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
11615
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
11616
- Button,
11617
- {
11618
- ref: buttonRef,
11619
- variant: "outline",
11620
- size: "sm",
11621
- className: "h-8 border-dashed",
11622
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between", children: [
11623
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
11624
- /* @__PURE__ */ jsxRuntime.jsx(reactIcons.PlusCircledIcon, { className: "mr-2 h-4 w-4" }),
11625
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: label }),
11626
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm:hidden", children: label?.split(" ")[0] })
11627
- ] }),
11628
- selectedValues?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11629
- /* @__PURE__ */ jsxRuntime.jsx(
11630
- Separator,
11631
- {
11632
- orientation: "vertical",
11633
- className: "hidden h-4 sm:mx-2 sm:block"
11634
- }
11635
- ),
11636
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex space-x-1", children: selectedValues.length > 2 ? /* @__PURE__ */ jsxRuntime.jsxs(
11637
- Badge,
11638
- {
11639
- variant: "secondary",
11640
- className: "rounded-sm px-1 font-normal",
11641
- children: [
11642
- selectedValues.length,
11643
- " selected"
11644
- ]
11645
- }
11646
- ) : options.filter((option) => selectedValues.includes(option.value)).map((option) => /* @__PURE__ */ jsxRuntime.jsx(
11647
- Badge,
11648
- {
11649
- variant: "secondary",
11650
- className: "rounded-sm px-1 font-normal",
11651
- children: option.label
11652
- },
11653
- option.value
11654
- )) })
11655
- ] })
11656
- ] })
11657
- }
11658
- ) }),
11659
- /* @__PURE__ */ jsxRuntime.jsx(
11660
- PopoverContent,
11661
- {
11662
- className: "w-auto p-0 sm:w-full",
11663
- align: "start",
11664
- style: isMobile ? { width: popoverWidth ? `${popoverWidth}px` : "auto" } : void 0,
11665
- children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
11666
- /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: label }),
11667
- /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
11668
- /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: "No results found." }),
11669
- /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: options.map((option) => {
11670
- const isSelected = selectedValues.includes(option.value);
11671
- return /* @__PURE__ */ jsxRuntime.jsxs(
11672
- CommandItem,
11673
- {
11674
- onSelect: () => onSelectHandler(option.value),
11675
- children: [
11676
- /* @__PURE__ */ jsxRuntime.jsx(
11677
- "div",
11678
- {
11679
- className: chunkYAF2X7W5_cjs.cn(
11680
- "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
11681
- isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
11682
- ),
11683
- children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, { className: chunkYAF2X7W5_cjs.cn("h-4 w-4") })
11684
- }
11685
- ),
11686
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label })
11687
- ]
11688
- },
11689
- option.value
11690
- );
11691
- }) }),
11692
- selectedValues.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11693
- /* @__PURE__ */ jsxRuntime.jsx(CommandSeparator, {}),
11694
- /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(
11695
- CommandItem,
11696
- {
11697
- onSelect: () => onResetHandler(),
11698
- className: "justify-center text-center",
11699
- children: "Clear"
11700
- }
11701
- ) })
11702
- ] })
11703
- ] })
11704
- ] })
11705
- }
11706
- )
11707
- ] });
11708
- }
11709
12226
  var ClearButton = ({ onClear }) => {
11710
12227
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-1", children: /* @__PURE__ */ jsxRuntime.jsx(
11711
12228
  Button,
@@ -11814,82 +12331,6 @@ function Radio({ label, options, onChange, value }) {
11814
12331
  )
11815
12332
  ] });
11816
12333
  }
11817
- var ResetButton = ({ onClick }) => {
11818
- return /* @__PURE__ */ jsxRuntime.jsxs(
11819
- Button,
11820
- {
11821
- type: "button",
11822
- variant: "outline",
11823
- onClick,
11824
- className: "h-8 px-2 lg:px-3",
11825
- children: [
11826
- "Reset",
11827
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "ml-2 h-4 w-4" })
11828
- ]
11829
- }
11830
- );
11831
- };
11832
- var SearchInput = ({
11833
- onChange,
11834
- placeholder = "Search...",
11835
- value,
11836
- className = ""
11837
- }) => {
11838
- const [state, setState] = React8.useState(value);
11839
- const inputRef = React8.useRef(null);
11840
- React8.useEffect(() => {
11841
- setState(value);
11842
- }, [value]);
11843
- const debounced = React8.useRef(
11844
- chunkVTOD5ZQU_cjs.debounce((val) => {
11845
- onChange(val);
11846
- }, 300)
11847
- ).current;
11848
- React8.useEffect(() => {
11849
- return () => {
11850
- debounced.cancel();
11851
- };
11852
- }, [debounced]);
11853
- const handleChange = (event) => {
11854
- event.stopPropagation();
11855
- setState(event.target.value);
11856
- debounced(event.target.value);
11857
- };
11858
- const handleClear = (e) => {
11859
- e.stopPropagation();
11860
- setState("");
11861
- onChange("");
11862
- };
11863
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center rounded-sm border px-2", children: [
11864
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
11865
- /* @__PURE__ */ jsxRuntime.jsx(
11866
- Input,
11867
- {
11868
- ref: inputRef,
11869
- placeholder,
11870
- value: state,
11871
- onChange: handleChange,
11872
- className: chunkYAF2X7W5_cjs.cn(
11873
- "h-8 w-52 border-none p-0 focus-visible:ring-0 focus-visible:ring-offset-0",
11874
- className
11875
- )
11876
- }
11877
- ),
11878
- /* @__PURE__ */ jsxRuntime.jsx(
11879
- Button,
11880
- {
11881
- variant: "ghost",
11882
- size: "xs",
11883
- className: chunkYAF2X7W5_cjs.cn(
11884
- "h-full p-1 pr-0 hover:bg-transparent",
11885
- !value && "invisible"
11886
- ),
11887
- onClick: handleClear,
11888
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4 text-muted-foreground" })
11889
- }
11890
- )
11891
- ] });
11892
- };
11893
12334
  var sortQueryParsers = (initialValues) => ({
11894
12335
  sortProperty: nuqs.parseAsString.withDefault(initialValues.property),
11895
12336
  isDescending: nuqs.parseAsBoolean.withDefault(initialValues.isDescending)
@@ -12668,7 +13109,8 @@ exports.Progress = Progress;
12668
13109
  exports.ProjectActions = ProjectActions;
12669
13110
  exports.ProjectCardLoadingSkeleton = ProjectCardLoadingSkeleton;
12670
13111
  exports.ProjectDetail = ProjectDetail;
12671
- exports.ProjectList = ProjectList;
13112
+ exports.ProjectList = ProjectList2;
13113
+ exports.ProjectListRowLoadingSkeleton = ProjectListRowLoadingSkeleton;
12672
13114
  exports.ProjectOverview = ProjectOverview;
12673
13115
  exports.ProjectRepoList = ProjectRepoList;
12674
13116
  exports.PublicLayout = PublicLayout;
@@ -12796,5 +13238,5 @@ exports.usePaginationQueryParams = usePaginationQueryParams;
12796
13238
  exports.useRightSidePanel = useRightSidePanel;
12797
13239
  exports.useSortQueryParams = useSortQueryParams;
12798
13240
  exports.useWizardStepper = useWizardStepper;
12799
- //# sourceMappingURL=chunk-BCALMPEF.cjs.map
12800
- //# sourceMappingURL=chunk-BCALMPEF.cjs.map
13241
+ //# sourceMappingURL=chunk-SG3SZ45K.cjs.map
13242
+ //# sourceMappingURL=chunk-SG3SZ45K.cjs.map