@powerhousedao/design-system 6.2.3-dev.70 → 6.2.3-dev.72

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.
Files changed (42) hide show
  1. package/dist/{add-local-drive-form.impl-xsC6R634.js → add-local-drive-form.impl-B8f13Rzz.js} +3 -3
  2. package/dist/{add-local-drive-form.impl-xsC6R634.js.map → add-local-drive-form.impl-B8f13Rzz.js.map} +1 -1
  3. package/dist/{add-remote-drive-form.impl-B2DxdWGF.js → add-remote-drive-form.impl-_SqOzbSt.js} +13 -4
  4. package/dist/add-remote-drive-form.impl-_SqOzbSt.js.map +1 -0
  5. package/dist/{address-DfZqD6IM.js → address-DVC3zalI.js} +2 -2
  6. package/dist/{address-DfZqD6IM.js.map → address-DVC3zalI.js.map} +1 -1
  7. package/dist/{combobox.impl-EqgAawKJ.js → combobox.impl-CQHG0NgO.js} +2 -2
  8. package/dist/{combobox.impl-EqgAawKJ.js.map → combobox.impl-CQHG0NgO.js.map} +1 -1
  9. package/dist/connect/components/toast/toast.js +2 -2
  10. package/dist/connect/index.d.ts +87 -2
  11. package/dist/connect/index.d.ts.map +1 -1
  12. package/dist/connect/index.js +260 -55
  13. package/dist/connect/index.js.map +1 -1
  14. package/dist/{document-timeline.impl-CCkyXpt5.js → document-timeline.impl-zx6f7k2d.js} +2 -2
  15. package/dist/{document-timeline.impl-CCkyXpt5.js.map → document-timeline.impl-zx6f7k2d.js.map} +1 -1
  16. package/dist/{drive-settings-form.impl-Bwam9-CG.js → drive-settings-form.impl-Dthjyouk.js} +3 -3
  17. package/dist/{drive-settings-form.impl-Bwam9-CG.js.map → drive-settings-form.impl-Dthjyouk.js.map} +1 -1
  18. package/dist/{formatted-json-viewer.impl-DadZ5uvb.js → formatted-json-viewer.impl-COERJCiE.js} +2 -2
  19. package/dist/{formatted-json-viewer.impl-DadZ5uvb.js.map → formatted-json-viewer.impl-COERJCiE.js.map} +1 -1
  20. package/dist/{icon-CHR45tj_.js → icon-DQ2yrWYv.js} +2 -2
  21. package/dist/{icon-CHR45tj_.js.map → icon-DQ2yrWYv.js.map} +1 -1
  22. package/dist/{icon-components-CJ4I3Y6Y.js → icon-components-NK-y5dkv.js} +3 -3
  23. package/dist/{icon-components-CJ4I3Y6Y.js.map → icon-components-NK-y5dkv.js.map} +1 -1
  24. package/dist/index.js +2 -2
  25. package/dist/{revision-history.impl-CrtSnhXQ.js → revision-history.impl-C8YnBJ6U.js} +4 -4
  26. package/dist/{revision-history.impl-CrtSnhXQ.js.map → revision-history.impl-C8YnBJ6U.js.map} +1 -1
  27. package/dist/{src-CohvVFnR.js → src-DhSJCeu5.js} +4 -4
  28. package/dist/src-DhSJCeu5.js.map +1 -0
  29. package/dist/ui/components/command/command.js +1 -1
  30. package/dist/ui/components/form-label/form-label.js +1 -1
  31. package/dist/ui/components/id-autocomplete/id-autocomplete-input-container.js +1 -1
  32. package/dist/ui/components/id-autocomplete/id-autocomplete-list-option.js +1 -1
  33. package/dist/ui/components/input/splitted-input-diff.js +1 -1
  34. package/dist/ui/components/select-field/content.js +1 -1
  35. package/dist/ui/components/select-field/selected-content.js +1 -1
  36. package/dist/ui/components/select-field/subcomponents/CommandItemList.js +1 -1
  37. package/dist/ui/components/sidebar/sidebar.js +1 -1
  38. package/dist/ui/components/sidebar/subcomponents/sidebar-content-area.js +1 -1
  39. package/dist/ui/components/sidebar/subcomponents/sidebar-item.js +1 -1
  40. package/package.json +4 -4
  41. package/dist/add-remote-drive-form.impl-B2DxdWGF.js.map +0 -1
  42. package/dist/src-CohvVFnR.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import { _ as DropdownMenuItem, b as PowerhouseButton, c as SidebarHeader, d as PackageAnimation, f as Modal, g as DropdownMenuContent, h as DropdownMenu, l as SidebarPanel, o as Sidebar, s as SidebarFooter, t as useWindowSize, y as DropdownMenuTrigger } from "../src-CohvVFnR.js";
2
- import { n as getDimensions, t as Icon } from "../icon-CHR45tj_.js";
1
+ import { _ as DropdownMenuItem, b as PowerhouseButton, c as SidebarHeader, d as PackageAnimation, f as Modal, g as DropdownMenuContent, h as DropdownMenu, l as SidebarPanel, o as Sidebar, s as SidebarFooter, t as useWindowSize, y as DropdownMenuTrigger } from "../src-DhSJCeu5.js";
2
+ import { n as getDimensions, t as Icon } from "../icon-DQ2yrWYv.js";
3
3
  import { Checkbox } from "../ui/components/checkbox/checkbox.js";
4
4
  import { Popover, PopoverContent, PopoverTrigger } from "../ui/components/popover/popover.js";
5
5
  import { Input } from "../ui/components/input/input.js";
6
6
  import { JsonViewer } from "../ui/components/json-viewer/json-viewer.js";
7
7
  import "../ui/index.js";
8
- import { a as lazyComponent, i as ENSAvatar, n as useEns, r as FormattedJsonViewer, t as formatEthAddress } from "../address-DfZqD6IM.js";
8
+ import { a as lazyComponent, i as ENSAvatar, n as useEns, r as FormattedJsonViewer, t as formatEthAddress } from "../address-DVC3zalI.js";
9
9
  import { t as Label } from "../label-nH2HoKfI.js";
10
- import React, { Fragment, createElement, forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
10
+ import React, { Fragment, createContext, createElement, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
11
11
  import { twJoin, twMerge } from "tailwind-merge";
12
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
13
  import { Content, Portal, Provider, Root, Trigger } from "@radix-ui/react-tooltip";
@@ -18,6 +18,7 @@ import { Content as Content$1, List, Root as Root$1, Trigger as Trigger$1 } from
18
18
  import { addProp, defaultTo, entries, filter, hasAtLeast, isArray, isDefined, isIncludedIn, isTruthy, keys, map, pipe, prop, values } from "remeda";
19
19
  import { redo, undo } from "@powerhousedao/shared/document-model";
20
20
  import { RenownLogo } from "@powerhousedao/reactor-browser/renown";
21
+ import { colorVariants, imageVariants, layerStyle, normalizeBackground } from "@powerhousedao/shared/connect";
21
22
  import { isValidName } from "@powerhousedao/shared/document-drive";
22
23
  import { capitalCase } from "change-case";
23
24
  import { getUpdateTarget, parseInstallSpec } from "@powerhousedao/shared/registry/updates";
@@ -667,7 +668,7 @@ function CatchUpInspector({ status, onRefresh, onSweepNow }) {
667
668
  }
668
669
  //#endregion
669
670
  //#region src/connect/components/combobox/combobox.tsx
670
- const Combobox = lazyComponent(() => import("../combobox.impl-EqgAawKJ.js").then((m) => m.Combobox));
671
+ const Combobox = lazyComponent(() => import("../combobox.impl-CQHG0NgO.js").then((m) => m.Combobox));
671
672
  //#endregion
672
673
  //#region src/connect/components/consent-banner/consent-banner.tsx
673
674
  const CookieBanner = (props) => {
@@ -1859,7 +1860,63 @@ const PATHS = {
1859
1860
  b9: "M18.0156 9.8918C18.0156 9.61566 18.2394 9.39181 18.5155 9.39181L43.0627 9.39138C44.9475 11.8519 46.3659 14.6855 47.1892 17.7635L18.5154 17.7641C18.2392 17.7641 18.0154 17.5402 18.0154 17.2641L18.0156 9.8918Z",
1860
1861
  b10: "M25.0158 -2.51999e-05C31.418 0.265176 37.1737 3.03916 41.3227 7.36511L25.5156 7.36547C25.2395 7.36547 25.0156 7.14161 25.0156 6.86546L25.0158 -2.51999e-05Z"
1861
1862
  };
1863
+ /** A project's loading image, declared by the build as
1864
+ * `<meta name="ph-loader" content="<file>" data-animation data-size>`
1865
+ * (powerhouse.config.json `icons.loader`). */
1866
+ const LOADER_MOTION = {
1867
+ pulse: "ph-loader-pulse 1.6s ease-in-out infinite",
1868
+ spin: "ph-loader-spin 1.4s linear infinite",
1869
+ none: "none"
1870
+ };
1871
+ const LOADER_KEYFRAMES = "@keyframes ph-loader-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(.94)}}@keyframes ph-loader-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){[data-ph-loader-img]{animation:none!important}}";
1872
+ let projectLoader;
1873
+ /** The page's project loader, or null when Connect's logo stays. Read once:
1874
+ * the meta tag is static in index.html. */
1875
+ function getProjectLoader() {
1876
+ if (projectLoader !== void 0) return projectLoader;
1877
+ if (typeof document === "undefined") return null;
1878
+ const meta = document.querySelector("meta[name=\"ph-loader\"]");
1879
+ const file = meta?.content;
1880
+ if (!meta || !file) return projectLoader = null;
1881
+ const animation = meta.dataset.animation;
1882
+ const size = Number(meta.dataset.size);
1883
+ projectLoader = {
1884
+ src: new URL(file, document.baseURI).toString(),
1885
+ animation: animation === "spin" || animation === "none" ? animation : "pulse",
1886
+ size: Number.isFinite(size) && size > 0 ? size : 96
1887
+ };
1888
+ return projectLoader;
1889
+ }
1890
+ /** The project's loading image with its motion. */
1891
+ function ProjectLoaderImage({ loader, className = "" }) {
1892
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("style", { children: LOADER_KEYFRAMES }), /* @__PURE__ */ jsx("img", {
1893
+ "data-ph-loader-img": "",
1894
+ src: loader.src,
1895
+ alt: "",
1896
+ "aria-label": "Loading",
1897
+ width: loader.size,
1898
+ className,
1899
+ style: {
1900
+ width: loader.size,
1901
+ height: "auto",
1902
+ animation: LOADER_MOTION[loader.animation]
1903
+ }
1904
+ })] });
1905
+ }
1906
+ /** Connect's loading animation: the project's loader when one is
1907
+ * configured, else the animated Powerhouse logo. */
1862
1908
  function LogoAnimation({ size = 48, className = "" }) {
1909
+ const loader = getProjectLoader();
1910
+ if (loader) return /* @__PURE__ */ jsx(ProjectLoaderImage, {
1911
+ loader,
1912
+ className
1913
+ });
1914
+ return /* @__PURE__ */ jsx(PowerhouseLogoAnimation, {
1915
+ size,
1916
+ className
1917
+ });
1918
+ }
1919
+ function PowerhouseLogoAnimation({ size = 48, className = "" }) {
1863
1920
  const refsMap = useRef({});
1864
1921
  const timers = useRef([]);
1865
1922
  function getEls(id) {
@@ -2054,7 +2111,7 @@ function DocumentStateViewer({ state, ignoredScopes = ["auth", "document"], defa
2054
2111
  }
2055
2112
  //#endregion
2056
2113
  //#region src/connect/components/document-timeline/document-timeline.tsx
2057
- const DocumentTimeline = lazyComponent(() => import("../document-timeline.impl-CCkyXpt5.js").then((m) => m.DocumentTimeline));
2114
+ const DocumentTimeline = lazyComponent(() => import("../document-timeline.impl-zx6f7k2d.js").then((m) => m.DocumentTimeline));
2058
2115
  //#endregion
2059
2116
  //#region src/connect/components/document-toolbar/containers.tsx
2060
2117
  /**
@@ -3373,6 +3430,33 @@ function EditorUndoRedoButtons(props) {
3373
3430
  });
3374
3431
  }
3375
3432
  //#endregion
3433
+ //#region src/connect/components/branding/connect-branding.tsx
3434
+ /**
3435
+ * Connect's branding as the components see it: the host app provides it once
3436
+ * at its root (images already resolved to data URIs) and the components read
3437
+ * it from here instead of reaching into configuration. `icons` are the drive
3438
+ * explorer's, which the generic plugin owns; `appName`, `icon` and
3439
+ * `homeBackground` are Connect's identity (`connect.branding`). Without a
3440
+ * provider every built-in icon renders.
3441
+ */
3442
+ const ConnectBrandingContext = /*#__PURE__*/ createContext({});
3443
+ function ConnectBrandingProvider(props) {
3444
+ return /* @__PURE__ */ jsx(ConnectBrandingContext.Provider, {
3445
+ value: props.branding ?? {},
3446
+ children: props.children
3447
+ });
3448
+ }
3449
+ /** The provided branding; `{}` (built-in look) without a provider. */
3450
+ function useConnectBranding() {
3451
+ return useContext(ConnectBrandingContext);
3452
+ }
3453
+ /** The icon for a document of `documentType`: the explorer's icon for that
3454
+ * type, else its default document icon, else undefined (the icon the package
3455
+ * ships, or the built-in one). */
3456
+ function brandedDocumentIcon(branding, documentType) {
3457
+ return branding.icons?.documents?.[documentType] ?? branding.icons?.document ?? void 0;
3458
+ }
3459
+ //#endregion
3376
3460
  //#region src/connect/constants/options.tsx
3377
3461
  const defaultDriveOptions = [
3378
3462
  "DOWNLOAD",
@@ -3653,13 +3737,15 @@ function FileItem(props) {
3653
3737
  handler();
3654
3738
  setIsDropdownMenuOpen(false);
3655
3739
  }
3740
+ const branding = useConnectBranding();
3741
+ const documentIconSrc = customDocumentIconSrc ?? brandedDocumentIcon(branding, fileNode.documentType);
3656
3742
  const iconNode = /* @__PURE__ */ jsxs("div", {
3657
3743
  className: "relative",
3658
- children: [customDocumentIconSrc ? /* @__PURE__ */ jsx("img", {
3744
+ children: [documentIconSrc ? /* @__PURE__ */ jsx("img", {
3659
3745
  alt: "file icon",
3660
- className: "max-w-none",
3746
+ className: "max-w-none object-contain",
3661
3747
  height: 34,
3662
- src: customDocumentIconSrc,
3748
+ src: documentIconSrc,
3663
3749
  width: 32,
3664
3750
  draggable: false
3665
3751
  }) : /* @__PURE__ */ jsx(DefaultFileIcon, {}), isReadMode && syncStatus && /* @__PURE__ */ jsx("div", {
@@ -3843,6 +3929,7 @@ function DefaultFileIcon() {
3843
3929
  //#region src/connect/components/folder-item/folder-item.tsx
3844
3930
  function FolderItem(props) {
3845
3931
  const { folderNode, className } = props;
3932
+ const folderIconSrc = useConnectBranding().icons?.folder;
3846
3933
  const setSelectedNode = useSetSelectedNode();
3847
3934
  const preloadNode = usePreloadNode();
3848
3935
  const target = useNodeTarget(folderNode);
@@ -3914,7 +4001,14 @@ function FolderItem(props) {
3914
4001
  className: "p-1",
3915
4002
  children: /* @__PURE__ */ jsx("div", {
3916
4003
  className: "relative text-foreground",
3917
- children: /* @__PURE__ */ jsx(Icon, {
4004
+ children: folderIconSrc ? /* @__PURE__ */ jsx("img", {
4005
+ alt: "folder icon",
4006
+ className: "object-contain",
4007
+ src: folderIconSrc,
4008
+ width: 24,
4009
+ height: 24,
4010
+ draggable: false
4011
+ }) : /* @__PURE__ */ jsx(Icon, {
3918
4012
  name: "FolderClose",
3919
4013
  size: 24
3920
4014
  })
@@ -3983,19 +4077,66 @@ const FormInput = /*#__PURE__*/ forwardRef(function FormInput(props, ref) {
3983
4077
  });
3984
4078
  //#endregion
3985
4079
  //#region src/connect/components/form/add-local-drive-form.tsx
3986
- const AddLocalDriveForm = lazyComponent(() => import("../add-local-drive-form.impl-xsC6R634.js").then((m) => m.AddLocalDriveForm));
4080
+ const AddLocalDriveForm = lazyComponent(() => import("../add-local-drive-form.impl-B8f13Rzz.js").then((m) => m.AddLocalDriveForm));
3987
4081
  //#endregion
3988
4082
  //#region src/connect/components/form/add-remote-drive-form.tsx
3989
- const AddRemoteDriveForm = lazyComponent(() => import("../add-remote-drive-form.impl-B2DxdWGF.js").then((m) => m.AddRemoteDriveForm));
4083
+ const AddRemoteDriveForm = lazyComponent(() => import("../add-remote-drive-form.impl-_SqOzbSt.js").then((m) => m.AddRemoteDriveForm));
4084
+ //#endregion
4085
+ //#region src/connect/components/branding/background-layers.tsx
4086
+ /**
4087
+ * A decorated pane: the configured page colour with the background's layers
4088
+ * painted over it, in order, and the children above them all. Each layer is
4089
+ * placed by the shared `layerStyle`, the same declarations the desktop
4090
+ * loading page emits as static CSS, so a background configured once looks
4091
+ * the same in both hosts. Images come resolved (data URIs or URLs); a
4092
+ * light/dark pair follows the `.dark` theme class, not the OS scheme.
4093
+ * Without a background the pane is the theme's page colour and nothing more.
4094
+ */
4095
+ function BackgroundLayers(props) {
4096
+ const background = normalizeBackground(props.background);
4097
+ const color = colorVariants(background?.color);
4098
+ const style = color ? {
4099
+ "--ph-pane-bg": color.light,
4100
+ "--ph-pane-bg-dark": color.dark ?? color.light
4101
+ } : void 0;
4102
+ return /* @__PURE__ */ jsxs("div", {
4103
+ className: twMerge("relative size-full overflow-hidden", color ? "bg-(--ph-pane-bg) dark:bg-(--ph-pane-bg-dark)" : "bg-background", props.className),
4104
+ style,
4105
+ children: [background?.layers.map((layer, index) => /* @__PURE__ */ jsx(BackgroundLayer, { layer }, index)), props.children]
4106
+ });
4107
+ }
4108
+ function BackgroundLayer({ layer }) {
4109
+ const { light, dark } = imageVariants(layer.src);
4110
+ const style = layerStyle(layer);
4111
+ if (!dark) return /* @__PURE__ */ jsx("img", {
4112
+ src: light,
4113
+ alt: "",
4114
+ style
4115
+ });
4116
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("img", {
4117
+ src: light,
4118
+ alt: "",
4119
+ style,
4120
+ className: "dark:hidden"
4121
+ }), /* @__PURE__ */ jsx("img", {
4122
+ src: dark,
4123
+ alt: "",
4124
+ style,
4125
+ className: "hidden dark:block"
4126
+ })] });
4127
+ }
3990
4128
  //#endregion
3991
4129
  //#region src/connect/components/home-screen/home-background-image.tsx
4130
+ /** The default home-screen gradient. A custom `src` is kept for callers that
4131
+ * still pass one, sized to its box; HomeScreen itself renders custom images
4132
+ * as a hero below the drive tiles instead. */
3992
4133
  const HomeBackgroundImage = ({ src } = {}) => {
3993
4134
  if (src) return /* @__PURE__ */ jsx("picture", {
3994
- className: "pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain",
4135
+ className: "pointer-events-none absolute inset-8 z-0",
3995
4136
  children: /* @__PURE__ */ jsx("img", {
3996
4137
  src,
3997
- alt: "background",
3998
- className: "object-contain"
4138
+ alt: "",
4139
+ className: "size-full object-contain"
3999
4140
  })
4000
4141
  });
4001
4142
  return /* @__PURE__ */ jsx("div", {
@@ -4142,13 +4283,19 @@ const HomeScreenAddDriveItem = function HomeScreenAddDriveItem(props) {
4142
4283
  //#endregion
4143
4284
  //#region src/connect/components/home-screen/home-screen.tsx
4144
4285
  const HomeScreen = function HomeScreen(props) {
4145
- const { children, containerClassName, homeBackground } = props;
4146
- return /* @__PURE__ */ jsx("div", {
4147
- className: twMerge("relative container mx-auto flex h-full flex-col", containerClassName),
4148
- children: /* @__PURE__ */ jsxs("div", {
4149
- className: "m-8 flex flex-wrap justify-center gap-4 bg-background pt-12",
4150
- children: [/* @__PURE__ */ jsx(HomeBackgroundImage, { src: homeBackground ?? void 0 }), children]
4151
- })
4286
+ const { children, containerClassName } = props;
4287
+ const background = normalizeBackground(props.homeBackground);
4288
+ const content = /* @__PURE__ */ jsxs("div", {
4289
+ className: twMerge("relative isolate container mx-auto flex h-full flex-col", containerClassName),
4290
+ children: [!background && /* @__PURE__ */ jsx(HomeBackgroundImage, {}), /* @__PURE__ */ jsx("div", {
4291
+ className: twMerge("relative z-10 m-8 flex flex-wrap justify-center gap-4 pt-12", background ? "rounded-2xl bg-background/75 px-6 pb-6 backdrop-blur-sm" : "bg-background"),
4292
+ children
4293
+ })]
4294
+ });
4295
+ if (!background) return content;
4296
+ return /* @__PURE__ */ jsx(BackgroundLayers, {
4297
+ background,
4298
+ children: content
4152
4299
  });
4153
4300
  };
4154
4301
  //#endregion
@@ -4549,7 +4696,8 @@ function AddDriveModal(props) {
4549
4696
  //#region src/connect/components/modal/create-document-modal.tsx
4550
4697
  const CLOSE_ANIMATION_DURATION$1 = 300;
4551
4698
  function CreateDocumentModal(props) {
4552
- const { onOpenChange, onContinue, overlayProps, contentProps, ...restProps } = props;
4699
+ const { onOpenChange, onContinue, overlayProps, contentProps, drives, driveId, onDriveChange, onAddDrive, ...restProps } = props;
4700
+ const needsDrive = !!drives && !driveId;
4553
4701
  const [nodeName, setNodeName] = useState("");
4554
4702
  const [isValid, setIsValid] = useState(false);
4555
4703
  const handleCancel = () => {
@@ -4557,11 +4705,12 @@ function CreateDocumentModal(props) {
4557
4705
  setTimeout(() => setNodeName(""), CLOSE_ANIMATION_DURATION$1);
4558
4706
  };
4559
4707
  const handleCreate = useCallback(() => {
4560
- if (!isValid) return;
4708
+ if (!isValid || needsDrive) return;
4561
4709
  onContinue(nodeName);
4562
4710
  setTimeout(() => setNodeName(""), CLOSE_ANIMATION_DURATION$1);
4563
4711
  }, [
4564
4712
  isValid,
4713
+ needsDrive,
4565
4714
  nodeName,
4566
4715
  onContinue
4567
4716
  ]);
@@ -4588,20 +4737,51 @@ function CreateDocumentModal(props) {
4588
4737
  }),
4589
4738
  /* @__PURE__ */ jsxs("div", {
4590
4739
  className: "my-6",
4591
- children: [!isValid && nodeName && /* @__PURE__ */ jsx("div", {
4592
- className: "mb-2 text-destructive",
4593
- children: "Document name must not be empty or contain control characters."
4594
- }), /* @__PURE__ */ jsx(FormInput, {
4595
- icon: /* @__PURE__ */ jsx(Icon, { name: "BrickGlobe" }),
4596
- onChange: (e) => {
4597
- const name = e.target.value;
4598
- setNodeName(name);
4599
- setIsValid(isValidName(name));
4600
- },
4601
- placeholder: "Document name",
4602
- required: true,
4603
- value: nodeName
4604
- })]
4740
+ children: [
4741
+ !isValid && nodeName && /* @__PURE__ */ jsx("div", {
4742
+ className: "mb-2 text-destructive",
4743
+ children: "Document name must not be empty or contain control characters."
4744
+ }),
4745
+ /* @__PURE__ */ jsx(FormInput, {
4746
+ icon: /* @__PURE__ */ jsx(Icon, { name: "BrickGlobe" }),
4747
+ onChange: (e) => {
4748
+ const name = e.target.value;
4749
+ setNodeName(name);
4750
+ setIsValid(isValidName(name));
4751
+ },
4752
+ placeholder: "Document name",
4753
+ required: true,
4754
+ value: nodeName
4755
+ }),
4756
+ !!drives?.length && /* @__PURE__ */ jsxs("label", {
4757
+ className: "mt-4 flex flex-col gap-1 text-sm text-muted-foreground",
4758
+ children: ["Drive", /* @__PURE__ */ jsxs("select", {
4759
+ className: "rounded-md border border-border bg-background px-3 py-2 text-foreground",
4760
+ value: driveId ?? "",
4761
+ onChange: (e) => onDriveChange?.(e.target.value),
4762
+ children: [!driveId && /* @__PURE__ */ jsx("option", {
4763
+ value: "",
4764
+ children: "Choose a drive"
4765
+ }), drives.map((drive) => /* @__PURE__ */ jsx("option", {
4766
+ value: drive.id,
4767
+ children: drive.name
4768
+ }, drive.id))]
4769
+ })]
4770
+ }),
4771
+ drives?.length === 0 && /* @__PURE__ */ jsxs("p", {
4772
+ className: "mt-4 text-sm text-muted-foreground",
4773
+ children: [
4774
+ "There's no drive to create it in.",
4775
+ " ",
4776
+ onAddDrive && /* @__PURE__ */ jsx("button", {
4777
+ type: "button",
4778
+ className: "cursor-pointer text-foreground underline",
4779
+ onClick: onAddDrive,
4780
+ children: "Add a drive"
4781
+ })
4782
+ ]
4783
+ })
4784
+ ]
4605
4785
  }),
4606
4786
  /* @__PURE__ */ jsxs("div", {
4607
4787
  className: "mt-8 flex justify-between gap-3",
@@ -4613,7 +4793,7 @@ function CreateDocumentModal(props) {
4613
4793
  }), /* @__PURE__ */ jsx(ModalButton, {
4614
4794
  variant: "confirm",
4615
4795
  type: "submit",
4616
- disabled: !isValid,
4796
+ disabled: !isValid || needsDrive,
4617
4797
  children: "Create"
4618
4798
  })]
4619
4799
  })
@@ -4788,7 +4968,7 @@ function ConnectDeleteItemModal(props) {
4788
4968
  }
4789
4969
  //#endregion
4790
4970
  //#region src/connect/components/form/drive-settings-form.tsx
4791
- const DriveSettingsForm = lazyComponent(() => import("../drive-settings-form.impl-Bwam9-CG.js").then((m) => m.DriveSettingsForm));
4971
+ const DriveSettingsForm = lazyComponent(() => import("../drive-settings-form.impl-Dthjyouk.js").then((m) => m.DriveSettingsForm));
4792
4972
  //#endregion
4793
4973
  //#region src/connect/components/modal/drive-settings-modal.tsx
4794
4974
  function DriveSettingsModal(props) {
@@ -8355,7 +8535,7 @@ function ConnectUpgradeDriveModal(props) {
8355
8535
  }
8356
8536
  //#endregion
8357
8537
  //#region src/connect/components/revision-history/revision-history.tsx
8358
- const RevisionHistory = lazyComponent(() => import("../revision-history.impl-CrtSnhXQ.js").then((m) => m.RevisionHistory));
8538
+ const RevisionHistory = lazyComponent(() => import("../revision-history.impl-C8YnBJ6U.js").then((m) => m.RevisionHistory));
8359
8539
  //#endregion
8360
8540
  //#region src/connect/components/search-bar/filter-item.tsx
8361
8541
  const FilterItem = (props) => {
@@ -8445,16 +8625,25 @@ const ConnectTooltipProvider = Provider;
8445
8625
  //#endregion
8446
8626
  //#region src/connect/components/sidebar/sidebar-item.tsx
8447
8627
  const SidebarItem = function SidebarItem(props) {
8448
- const { icon, title, description: _description, containerClassName, active, href, onClick, onPreload } = props;
8449
- const Element = href ? "a" : "div";
8628
+ const { icon, title, description, containerClassName, active, href, onClick, onPreload } = props;
8629
+ const Element = href ? "a" : onClick ? "button" : "div";
8450
8630
  const current = href ? props["aria-current"] : void 0;
8451
8631
  return /* @__PURE__ */ jsx(ConnectTooltip, {
8452
- content: title,
8632
+ content: description ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
8633
+ className: "block font-medium",
8634
+ children: title
8635
+ }), /* @__PURE__ */ jsx("span", {
8636
+ className: "block opacity-80",
8637
+ children: description
8638
+ })] }) : title,
8453
8639
  side: "right",
8454
8640
  sideOffset: 12,
8455
8641
  className: "border-none bg-primary px-3 py-2 text-sm text-primary-foreground",
8456
8642
  children: /* @__PURE__ */ jsxs(Element, {
8457
8643
  href,
8644
+ type: Element === "button" ? "button" : void 0,
8645
+ "aria-label": title,
8646
+ "aria-description": description,
8458
8647
  "aria-current": current,
8459
8648
  className: twMerge("group/sidebar-item relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-foreground", containerClassName, "aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground", active && "bg-sidebar-accent text-sidebar-accent-foreground", onClick && "cursor-pointer"),
8460
8649
  onClick,
@@ -8462,11 +8651,12 @@ const SidebarItem = function SidebarItem(props) {
8462
8651
  onTouchStart: onPreload,
8463
8652
  onFocus: href ? onPreload : void 0,
8464
8653
  children: [
8465
- /* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 hidden h-10 w-1 -translate-y-1/2 rounded-r-sm bg-info group-aria-[current=page]/sidebar-item:block", active && "block") }),
8466
- /* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 h-6 w-1 -translate-y-1/2 rounded-r-sm bg-secondary opacity-0 transition-opacity group-hover/sidebar-item:opacity-100 group-aria-[current=page]/sidebar-item:hidden", active && "hidden") }),
8654
+ /* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 hidden h-10 w-1 -translate-y-1/2 rounded-r-sm bg-info group-aria-[current=page]/sidebar-item:block max-sm:hidden!", active && "block") }),
8655
+ /* @__PURE__ */ jsx("div", { className: twMerge("absolute top-1/2 left-0 h-6 w-1 -translate-y-1/2 rounded-r-sm bg-secondary opacity-0 transition-opacity group-hover/sidebar-item:opacity-100 group-aria-[current=page]/sidebar-item:hidden max-sm:hidden", active && "hidden") }),
8467
8656
  /* @__PURE__ */ jsx("div", {
8468
- className: "mx-auto py-4",
8657
+ className: "mx-auto py-4 max-sm:px-3 max-sm:py-2",
8469
8658
  children: icon || /* @__PURE__ */ jsx("div", {
8659
+ "aria-hidden": true,
8470
8660
  className: "flex size-8 items-center justify-center rounded-lg bg-primary",
8471
8661
  children: /* @__PURE__ */ jsx("span", {
8472
8662
  className: "text-sm font-medium text-primary-foreground",
@@ -8640,6 +8830,7 @@ const SidebarUser = ({ address, ensName, avatarUrl, etherscanUrl, onDisconnect }
8640
8830
  //#endregion
8641
8831
  //#region src/connect/components/sidebar/sidebar-footer.tsx
8642
8832
  const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin, onClickSettings, settingsHref, settingsCurrent, onDisconnect, onHomeClick, showDebug, onDebugClick, etherscanUrl = "", ...props }) => {
8833
+ const appLogoSrc = useConnectBranding().icon;
8643
8834
  const settingsIcon = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Settings, {
8644
8835
  className: "text-foreground",
8645
8836
  size: 24,
@@ -8650,14 +8841,20 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
8650
8841
  })] });
8651
8842
  return /* @__PURE__ */ jsxs(SidebarFooter, {
8652
8843
  ...props,
8653
- className: twMerge("flex flex-col items-center gap-3 border-t border-sidebar-border px-2 py-4 dark:border-none", className),
8844
+ className: twMerge("flex flex-col items-center gap-3 border-t border-sidebar-border px-2 py-4 max-sm:flex-row max-sm:border-t-0 max-sm:border-l max-sm:py-2 dark:border-none", className),
8654
8845
  children: [
8655
8846
  onHomeClick && /* @__PURE__ */ jsx("button", {
8656
8847
  "aria-label": "Home",
8657
8848
  type: "button",
8658
8849
  className: "cursor-pointer",
8659
8850
  onClick: onHomeClick,
8660
- children: /* @__PURE__ */ jsx(Icon, {
8851
+ children: appLogoSrc ? /* @__PURE__ */ jsx("img", {
8852
+ alt: "",
8853
+ className: "object-contain",
8854
+ src: appLogoSrc,
8855
+ width: 24,
8856
+ height: 24
8857
+ }) : /* @__PURE__ */ jsx(Icon, {
8661
8858
  className: "text-muted-foreground",
8662
8859
  name: "ConnectSmall",
8663
8860
  size: 24
@@ -8675,7 +8872,7 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
8675
8872
  })
8676
8873
  }),
8677
8874
  /* @__PURE__ */ jsx("div", {
8678
- className: onHomeClick ? "mt-3" : "",
8875
+ className: onHomeClick ? "mt-3 max-sm:mt-0" : "",
8679
8876
  children: address ? /* @__PURE__ */ jsx(SidebarUser, {
8680
8877
  address,
8681
8878
  ensName,
@@ -8716,12 +8913,20 @@ const ConnectSidebarHeader = ({ className, children, ...props }) => {
8716
8913
  const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, settingsHref, settingsCurrent, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
8717
8914
  return /* @__PURE__ */ jsxs(Sidebar, {
8718
8915
  ...props,
8916
+ "data-connect-sidebar": "",
8719
8917
  maxWidth,
8720
8918
  minWidth,
8721
- children: [/* @__PURE__ */ jsxs(SidebarPanel, { children: [/* @__PURE__ */ jsx(ConnectSidebarHeader, { children: headerContent }), /* @__PURE__ */ jsx("div", {
8722
- className: "flex flex-col",
8723
- children: props.children
8724
- })] }), /* @__PURE__ */ jsx(ConnectSidebarFooter, {
8919
+ children: [/* @__PURE__ */ jsxs(SidebarPanel, {
8920
+ className: "max-sm:flex max-sm:overflow-x-auto max-sm:overflow-y-hidden",
8921
+ children: [/* @__PURE__ */ jsx(ConnectSidebarHeader, {
8922
+ className: "max-sm:hidden",
8923
+ children: headerContent
8924
+ }), /* @__PURE__ */ jsx("nav", {
8925
+ "aria-label": "Drives and pages",
8926
+ className: "flex flex-col max-sm:flex-row",
8927
+ children: props.children
8928
+ })]
8929
+ }), /* @__PURE__ */ jsx(ConnectSidebarFooter, {
8725
8930
  address,
8726
8931
  ensName,
8727
8932
  avatarUrl,
@@ -8867,6 +9072,6 @@ const removeSuccessFiles = (files) => {
8867
9072
  return files.filter((file) => file.status !== "SUCCESS");
8868
9073
  };
8869
9074
  //#endregion
8870
- export { About, AccountPopover, AccountPopoverLogin, AddDriveModal, AddLocalDriveForm, AddRemoteDriveForm, AnimatedLoader, AvailablePackagesPanel, Breadcrumb, Breadcrumbs, CONFLICT, CatchUpInspector, ChannelInspector, Checkbox, Combobox, ConnectConfirmationModal, ConnectDeleteDriveModal, ConnectDeleteItemModal, ConnectDropdownMenu, ConnectReplaceDuplicateModal, ConnectSearchBar, ConnectSelect, ConnectSidebar, ConnectSidebarFooter, ConnectSidebarHeader, ConnectTooltip, ConnectTooltipProvider, ConnectUpgradeDriveModal, ConnectionStateBadge, CookieBanner, CreateDocumentModal, CreateDocumentWithTypeModal, DBExplorer, DangerZone, DebugInspector, DefaultEditor, DefaultEditorLoader, DefaultEditorSelect, DependencyVersions, Disclosure, Divider, DocumentStateViewer, DocumentTimeline, DocumentToolbar, DriveAuthGate, DriveSettingsModal, DropZone, DropZoneWrapper, ENSAvatar, ERROR, EditorActionButtons, EditorUndoRedoButtons, FileItem, FolderItem, Footer, FooterLink, FormInput, FormattedJsonViewer, HomeBackgroundImage, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, INITIAL_SYNC, Icon, InspectorModal, InstalledPackagesPanel, IntegrityInspector, LoadingScreen, LogoAnimation, MISSING, Modal, ModalButton, NodeInput, ObjectInspectorModal, PackageInstallModal, PackageList, PackageManager, PackageManagerListItem, PackagePanelScrollArea, PackageRegistryError, PackageSubSection, PeerAgreementPanel, PowerhouseButton, ProcessorsInspector, QueueInspector, ReadRequiredModal, RemotesInspector, RenownLoginMethods, RevisionHistory, SUCCESS, SYNCING, SettingsModal, SidebarAddDriveItem, SidebarItem, SidebarLogin, SidebarUser, SyncStatusIcon, TabContent, Tabs, ThemeSwitch, Toggle, ToolbarButton, ToolbarCloseButton, ToolbarContainer, ToolbarControlsContainer, ToolbarDownloadButton, ToolbarHistoryButton, ToolbarInput, ToolbarName, ToolbarRedoButton, ToolbarSwitchboardButton, ToolbarUndoButton, UploadFileItem, UploadFileList, UploadFileListContainer, WorkerInspector, debugNodeOptions, debugNodeOptionsMap, defaultDriveOptions, defaultNodeOptions, fileNodeDropdownOptions, folderNodeDropdownOptions, formatEthAddress, formatFileSize, generateId, getFolderStatus, locationInfoByLocation, mapProgressStageToStatus, mapUploadsToFileItems, nodeOptions, normalNodeOptions, peerManifestLabel, removeSuccessFiles, sharingTypeOptions, sortFilesByStatus, syncStatuses, useEns, useWindowSize, verifyPackageJsonFields };
9075
+ export { About, AccountPopover, AccountPopoverLogin, AddDriveModal, AddLocalDriveForm, AddRemoteDriveForm, AnimatedLoader, AvailablePackagesPanel, BackgroundLayers, Breadcrumb, Breadcrumbs, CONFLICT, CatchUpInspector, ChannelInspector, Checkbox, Combobox, ConnectBrandingProvider, ConnectConfirmationModal, ConnectDeleteDriveModal, ConnectDeleteItemModal, ConnectDropdownMenu, ConnectReplaceDuplicateModal, ConnectSearchBar, ConnectSelect, ConnectSidebar, ConnectSidebarFooter, ConnectSidebarHeader, ConnectTooltip, ConnectTooltipProvider, ConnectUpgradeDriveModal, ConnectionStateBadge, CookieBanner, CreateDocumentModal, CreateDocumentWithTypeModal, DBExplorer, DangerZone, DebugInspector, DefaultEditor, DefaultEditorLoader, DefaultEditorSelect, DependencyVersions, Disclosure, Divider, DocumentStateViewer, DocumentTimeline, DocumentToolbar, DriveAuthGate, DriveSettingsModal, DropZone, DropZoneWrapper, ENSAvatar, ERROR, EditorActionButtons, EditorUndoRedoButtons, FileItem, FolderItem, Footer, FooterLink, FormInput, FormattedJsonViewer, HomeBackgroundImage, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, INITIAL_SYNC, Icon, InspectorModal, InstalledPackagesPanel, IntegrityInspector, LoadingScreen, LogoAnimation, MISSING, Modal, ModalButton, NodeInput, ObjectInspectorModal, PackageInstallModal, PackageList, PackageManager, PackageManagerListItem, PackagePanelScrollArea, PackageRegistryError, PackageSubSection, PeerAgreementPanel, PowerhouseButton, ProcessorsInspector, ProjectLoaderImage, QueueInspector, ReadRequiredModal, RemotesInspector, RenownLoginMethods, RevisionHistory, SUCCESS, SYNCING, SettingsModal, SidebarAddDriveItem, SidebarItem, SidebarLogin, SidebarUser, SyncStatusIcon, TabContent, Tabs, ThemeSwitch, Toggle, ToolbarButton, ToolbarCloseButton, ToolbarContainer, ToolbarControlsContainer, ToolbarDownloadButton, ToolbarHistoryButton, ToolbarInput, ToolbarName, ToolbarRedoButton, ToolbarSwitchboardButton, ToolbarUndoButton, UploadFileItem, UploadFileList, UploadFileListContainer, WorkerInspector, brandedDocumentIcon, debugNodeOptions, debugNodeOptionsMap, defaultDriveOptions, defaultNodeOptions, fileNodeDropdownOptions, folderNodeDropdownOptions, formatEthAddress, formatFileSize, generateId, getFolderStatus, getProjectLoader, locationInfoByLocation, mapProgressStageToStatus, mapUploadsToFileItems, nodeOptions, normalNodeOptions, peerManifestLabel, removeSuccessFiles, sharingTypeOptions, sortFilesByStatus, syncStatuses, useConnectBranding, useEns, useWindowSize, verifyPackageJsonFields };
8871
9076
 
8872
9077
  //# sourceMappingURL=index.js.map