@powerhousedao/design-system 6.2.3-dev.71 → 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 +8 -0
  11. package/dist/connect/index.d.ts.map +1 -1
  12. package/dist/connect/index.js +95 -44
  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,11 +1,11 @@
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
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";
@@ -668,7 +668,7 @@ function CatchUpInspector({ status, onRefresh, onSweepNow }) {
668
668
  }
669
669
  //#endregion
670
670
  //#region src/connect/components/combobox/combobox.tsx
671
- 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));
672
672
  //#endregion
673
673
  //#region src/connect/components/consent-banner/consent-banner.tsx
674
674
  const CookieBanner = (props) => {
@@ -2111,7 +2111,7 @@ function DocumentStateViewer({ state, ignoredScopes = ["auth", "document"], defa
2111
2111
  }
2112
2112
  //#endregion
2113
2113
  //#region src/connect/components/document-timeline/document-timeline.tsx
2114
- 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));
2115
2115
  //#endregion
2116
2116
  //#region src/connect/components/document-toolbar/containers.tsx
2117
2117
  /**
@@ -4077,10 +4077,10 @@ const FormInput = /*#__PURE__*/ forwardRef(function FormInput(props, ref) {
4077
4077
  });
4078
4078
  //#endregion
4079
4079
  //#region src/connect/components/form/add-local-drive-form.tsx
4080
- 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));
4081
4081
  //#endregion
4082
4082
  //#region src/connect/components/form/add-remote-drive-form.tsx
4083
- 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
4084
  //#endregion
4085
4085
  //#region src/connect/components/branding/background-layers.tsx
4086
4086
  /**
@@ -4285,12 +4285,12 @@ const HomeScreenAddDriveItem = function HomeScreenAddDriveItem(props) {
4285
4285
  const HomeScreen = function HomeScreen(props) {
4286
4286
  const { children, containerClassName } = props;
4287
4287
  const background = normalizeBackground(props.homeBackground);
4288
- const content = /* @__PURE__ */ jsx("div", {
4289
- className: twMerge("relative container mx-auto flex h-full flex-col", containerClassName),
4290
- children: /* @__PURE__ */ jsxs("div", {
4291
- className: twMerge("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: [!background && /* @__PURE__ */ jsx(HomeBackgroundImage, {}), children]
4293
- })
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
4294
  });
4295
4295
  if (!background) return content;
4296
4296
  return /* @__PURE__ */ jsx(BackgroundLayers, {
@@ -4696,7 +4696,8 @@ function AddDriveModal(props) {
4696
4696
  //#region src/connect/components/modal/create-document-modal.tsx
4697
4697
  const CLOSE_ANIMATION_DURATION$1 = 300;
4698
4698
  function CreateDocumentModal(props) {
4699
- const { onOpenChange, onContinue, overlayProps, contentProps, ...restProps } = props;
4699
+ const { onOpenChange, onContinue, overlayProps, contentProps, drives, driveId, onDriveChange, onAddDrive, ...restProps } = props;
4700
+ const needsDrive = !!drives && !driveId;
4700
4701
  const [nodeName, setNodeName] = useState("");
4701
4702
  const [isValid, setIsValid] = useState(false);
4702
4703
  const handleCancel = () => {
@@ -4704,11 +4705,12 @@ function CreateDocumentModal(props) {
4704
4705
  setTimeout(() => setNodeName(""), CLOSE_ANIMATION_DURATION$1);
4705
4706
  };
4706
4707
  const handleCreate = useCallback(() => {
4707
- if (!isValid) return;
4708
+ if (!isValid || needsDrive) return;
4708
4709
  onContinue(nodeName);
4709
4710
  setTimeout(() => setNodeName(""), CLOSE_ANIMATION_DURATION$1);
4710
4711
  }, [
4711
4712
  isValid,
4713
+ needsDrive,
4712
4714
  nodeName,
4713
4715
  onContinue
4714
4716
  ]);
@@ -4735,20 +4737,51 @@ function CreateDocumentModal(props) {
4735
4737
  }),
4736
4738
  /* @__PURE__ */ jsxs("div", {
4737
4739
  className: "my-6",
4738
- children: [!isValid && nodeName && /* @__PURE__ */ jsx("div", {
4739
- className: "mb-2 text-destructive",
4740
- children: "Document name must not be empty or contain control characters."
4741
- }), /* @__PURE__ */ jsx(FormInput, {
4742
- icon: /* @__PURE__ */ jsx(Icon, { name: "BrickGlobe" }),
4743
- onChange: (e) => {
4744
- const name = e.target.value;
4745
- setNodeName(name);
4746
- setIsValid(isValidName(name));
4747
- },
4748
- placeholder: "Document name",
4749
- required: true,
4750
- value: nodeName
4751
- })]
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
+ ]
4752
4785
  }),
4753
4786
  /* @__PURE__ */ jsxs("div", {
4754
4787
  className: "mt-8 flex justify-between gap-3",
@@ -4760,7 +4793,7 @@ function CreateDocumentModal(props) {
4760
4793
  }), /* @__PURE__ */ jsx(ModalButton, {
4761
4794
  variant: "confirm",
4762
4795
  type: "submit",
4763
- disabled: !isValid,
4796
+ disabled: !isValid || needsDrive,
4764
4797
  children: "Create"
4765
4798
  })]
4766
4799
  })
@@ -4935,7 +4968,7 @@ function ConnectDeleteItemModal(props) {
4935
4968
  }
4936
4969
  //#endregion
4937
4970
  //#region src/connect/components/form/drive-settings-form.tsx
4938
- 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));
4939
4972
  //#endregion
4940
4973
  //#region src/connect/components/modal/drive-settings-modal.tsx
4941
4974
  function DriveSettingsModal(props) {
@@ -8502,7 +8535,7 @@ function ConnectUpgradeDriveModal(props) {
8502
8535
  }
8503
8536
  //#endregion
8504
8537
  //#region src/connect/components/revision-history/revision-history.tsx
8505
- 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));
8506
8539
  //#endregion
8507
8540
  //#region src/connect/components/search-bar/filter-item.tsx
8508
8541
  const FilterItem = (props) => {
@@ -8592,16 +8625,25 @@ const ConnectTooltipProvider = Provider;
8592
8625
  //#endregion
8593
8626
  //#region src/connect/components/sidebar/sidebar-item.tsx
8594
8627
  const SidebarItem = function SidebarItem(props) {
8595
- const { icon, title, description: _description, containerClassName, active, href, onClick, onPreload } = props;
8596
- const Element = href ? "a" : "div";
8628
+ const { icon, title, description, containerClassName, active, href, onClick, onPreload } = props;
8629
+ const Element = href ? "a" : onClick ? "button" : "div";
8597
8630
  const current = href ? props["aria-current"] : void 0;
8598
8631
  return /* @__PURE__ */ jsx(ConnectTooltip, {
8599
- 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,
8600
8639
  side: "right",
8601
8640
  sideOffset: 12,
8602
8641
  className: "border-none bg-primary px-3 py-2 text-sm text-primary-foreground",
8603
8642
  children: /* @__PURE__ */ jsxs(Element, {
8604
8643
  href,
8644
+ type: Element === "button" ? "button" : void 0,
8645
+ "aria-label": title,
8646
+ "aria-description": description,
8605
8647
  "aria-current": current,
8606
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"),
8607
8649
  onClick,
@@ -8609,11 +8651,12 @@ const SidebarItem = function SidebarItem(props) {
8609
8651
  onTouchStart: onPreload,
8610
8652
  onFocus: href ? onPreload : void 0,
8611
8653
  children: [
8612
- /* @__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") }),
8613
- /* @__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") }),
8614
8656
  /* @__PURE__ */ jsx("div", {
8615
- className: "mx-auto py-4",
8657
+ className: "mx-auto py-4 max-sm:px-3 max-sm:py-2",
8616
8658
  children: icon || /* @__PURE__ */ jsx("div", {
8659
+ "aria-hidden": true,
8617
8660
  className: "flex size-8 items-center justify-center rounded-lg bg-primary",
8618
8661
  children: /* @__PURE__ */ jsx("span", {
8619
8662
  className: "text-sm font-medium text-primary-foreground",
@@ -8798,7 +8841,7 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
8798
8841
  })] });
8799
8842
  return /* @__PURE__ */ jsxs(SidebarFooter, {
8800
8843
  ...props,
8801
- 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),
8802
8845
  children: [
8803
8846
  onHomeClick && /* @__PURE__ */ jsx("button", {
8804
8847
  "aria-label": "Home",
@@ -8829,7 +8872,7 @@ const ConnectSidebarFooter = ({ address, ensName, avatarUrl, className, onLogin,
8829
8872
  })
8830
8873
  }),
8831
8874
  /* @__PURE__ */ jsx("div", {
8832
- className: onHomeClick ? "mt-3" : "",
8875
+ className: onHomeClick ? "mt-3 max-sm:mt-0" : "",
8833
8876
  children: address ? /* @__PURE__ */ jsx(SidebarUser, {
8834
8877
  address,
8835
8878
  ensName,
@@ -8870,12 +8913,20 @@ const ConnectSidebarHeader = ({ className, children, ...props }) => {
8870
8913
  const ConnectSidebar = ({ onClick, address, ensName, avatarUrl, headerContent, onClickSettings, settingsHref, settingsCurrent, maxWidth = "304px", minWidth = "58px", onLogin, onDisconnect, etherscanUrl, showDebug, onDebugClick, ...props }) => {
8871
8914
  return /* @__PURE__ */ jsxs(Sidebar, {
8872
8915
  ...props,
8916
+ "data-connect-sidebar": "",
8873
8917
  maxWidth,
8874
8918
  minWidth,
8875
- children: [/* @__PURE__ */ jsxs(SidebarPanel, { children: [/* @__PURE__ */ jsx(ConnectSidebarHeader, { children: headerContent }), /* @__PURE__ */ jsx("div", {
8876
- className: "flex flex-col",
8877
- children: props.children
8878
- })] }), /* @__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, {
8879
8930
  address,
8880
8931
  ensName,
8881
8932
  avatarUrl,