@drawbridge/components 0.1.31 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bridge/template-modal.js +2 -1
- package/dist/bridge/template-modal.mjs +2 -1
- package/dist/dashboard/buttons-subscription.js +65 -20
- package/dist/dashboard/buttons-subscription.mjs +64 -20
- package/dist/dashboard/card-payment-method.js +1 -1
- package/dist/dashboard/card-payment-method.mjs +1 -1
- package/dist/dashboard/card-section.js +2 -2
- package/dist/dashboard/card-section.mjs +2 -2
- package/dist/dashboard/card-setting.js +4 -3
- package/dist/dashboard/card-setting.mjs +4 -3
- package/dist/dashboard/card-task.js +22 -4
- package/dist/dashboard/card-task.mjs +22 -4
- package/dist/dashboard/card-tile.js +6 -6
- package/dist/dashboard/card-tile.mjs +6 -6
- package/dist/dashboard/drawer.js +7 -2
- package/dist/dashboard/drawer.mjs +8 -3
- package/dist/dashboard/form-organization-workflow.js +2 -2
- package/dist/dashboard/form-organization-workflow.mjs +2 -2
- package/dist/dashboard/input-combobox.js +7 -2
- package/dist/dashboard/input-combobox.mjs +7 -2
- package/dist/dashboard/lib/escape.js +48 -0
- package/dist/dashboard/lib/escape.mjs +25 -0
- package/dist/dashboard/lib/rail.js +75 -0
- package/dist/dashboard/lib/rail.mjs +46 -0
- package/dist/dashboard/lib/throttle.js +57 -0
- package/dist/dashboard/lib/throttle.mjs +34 -0
- package/dist/dashboard/list.js +1 -1
- package/dist/dashboard/list.mjs +1 -1
- package/dist/dashboard/menu.js +188 -96
- package/dist/dashboard/menu.mjs +189 -97
- package/dist/dashboard/modal.js +9 -3
- package/dist/dashboard/modal.mjs +10 -4
- package/dist/dashboard/notice.js +5 -3
- package/dist/dashboard/notice.mjs +5 -3
- package/dist/dashboard/table-cell-title.js +2 -0
- package/dist/dashboard/table-cell-title.mjs +2 -0
- package/dist/dashboard/table.js +61 -20
- package/dist/dashboard/table.mjs +61 -20
- package/dist/dashboard/template-dashboard.js +35 -133
- package/dist/dashboard/template-dashboard.mjs +36 -134
- package/dist/dashboard/template-rail.js +674 -0
- package/dist/dashboard/template-rail.mjs +640 -0
- package/dist/dashboard/template-socket.js +19 -3
- package/dist/dashboard/template-socket.mjs +19 -3
- package/dist/dashboard/template-ui.js +150 -186
- package/dist/dashboard/template-ui.mjs +151 -187
- package/dist/icons/book-open.js +46 -0
- package/dist/icons/book-open.mjs +27 -0
- package/dist/icons/task.js +46 -0
- package/dist/icons/task.mjs +27 -0
- package/dist/shared/lib/helpers.js +9 -2
- package/dist/shared/lib/helpers.mjs +9 -2
- package/dist/shared/lib/motion.js +27 -0
- package/dist/shared/lib/motion.mjs +4 -0
- package/dist/shared/overlay.js +5 -3
- package/dist/shared/overlay.mjs +5 -3
- package/package.json +28 -13
- package/types/dashboard/card-task.d.ts +5 -1
- package/types/dashboard/lib/rail.d.ts +32 -0
- package/types/dashboard/lib/throttle.d.ts +5 -0
- package/types/dashboard/table.d.ts +3 -1
- package/types/dashboard/template-dashboard.d.ts +4 -1
- package/types/dashboard/template-rail.d.ts +36 -0
- package/types/dashboard/template-ui.d.ts +2 -2
- package/types/icons/book-open.d.ts +5 -0
- package/types/icons/task.d.ts +5 -0
- package/dist/dashboard/guide.js +0 -238
- package/dist/dashboard/guide.mjs +0 -209
- package/types/dashboard/guide.d.ts +0 -23
package/dist/dashboard/menu.js
CHANGED
|
@@ -82,6 +82,79 @@ const icons = {
|
|
|
82
82
|
star: import_star.default,
|
|
83
83
|
users: import_users.default
|
|
84
84
|
};
|
|
85
|
+
const Reveal = ({
|
|
86
|
+
children,
|
|
87
|
+
className,
|
|
88
|
+
shown
|
|
89
|
+
}) => {
|
|
90
|
+
const box = (0, import_react.useRef)(null);
|
|
91
|
+
(0, import_react.useEffect)(
|
|
92
|
+
() => {
|
|
93
|
+
if (box.current) box.current.inert = !shown;
|
|
94
|
+
},
|
|
95
|
+
[shown]
|
|
96
|
+
);
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
...{
|
|
101
|
+
className: "grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none " + (shown ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
102
|
+
ref: box
|
|
103
|
+
},
|
|
104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
...{
|
|
108
|
+
className: "min-h-0 overflow-hidden"
|
|
109
|
+
},
|
|
110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
...{
|
|
114
|
+
className
|
|
115
|
+
},
|
|
116
|
+
children: children.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
...{
|
|
120
|
+
className: "transition-opacity ease-out motion-reduce:transition-none " + (shown ? "opacity-100 duration-150" : "opacity-0 duration-75"),
|
|
121
|
+
...shown && {
|
|
122
|
+
style: {
|
|
123
|
+
transitionDelay: index * 30 + "ms"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
children: child
|
|
128
|
+
},
|
|
129
|
+
index
|
|
130
|
+
))
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
const opened = /* @__PURE__ */ new Set();
|
|
139
|
+
let primed = false;
|
|
140
|
+
const useShown = (key, open, enabled) => {
|
|
141
|
+
const [shown, setShown] = (0, import_react.useState)(() => primed ? opened.has(key) : open);
|
|
142
|
+
(0, import_react.useEffect)(
|
|
143
|
+
() => {
|
|
144
|
+
if (!enabled) return void 0;
|
|
145
|
+
primed = true;
|
|
146
|
+
if (open) {
|
|
147
|
+
opened.add(key);
|
|
148
|
+
} else {
|
|
149
|
+
opened.delete(key);
|
|
150
|
+
}
|
|
151
|
+
const frame = window.requestAnimationFrame(() => setShown(open));
|
|
152
|
+
return () => window.cancelAnimationFrame(frame);
|
|
153
|
+
},
|
|
154
|
+
[enabled, key, open]
|
|
155
|
+
);
|
|
156
|
+
return shown;
|
|
157
|
+
};
|
|
85
158
|
const MenuItem = ({
|
|
86
159
|
active,
|
|
87
160
|
badge,
|
|
@@ -100,6 +173,7 @@ const MenuItem = ({
|
|
|
100
173
|
...rest
|
|
101
174
|
}) => {
|
|
102
175
|
const Icon = icons[icon];
|
|
176
|
+
const shown = useShown(rest.href || title, open, children.length > 0);
|
|
103
177
|
const classes = {
|
|
104
178
|
row: [
|
|
105
179
|
"flex items-center justify-between w-full transform duration-300 text-left py-1 rounded",
|
|
@@ -215,11 +289,12 @@ const MenuItem = ({
|
|
|
215
289
|
children: content
|
|
216
290
|
}
|
|
217
291
|
),
|
|
218
|
-
|
|
219
|
-
|
|
292
|
+
children.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
293
|
+
Reveal,
|
|
220
294
|
{
|
|
221
295
|
...{
|
|
222
|
-
className: "
|
|
296
|
+
className: "pt-0.5 pb-2",
|
|
297
|
+
shown
|
|
223
298
|
},
|
|
224
299
|
children: children.map(({ key: childKey, exact, ...props }, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
225
300
|
MenuItem,
|
|
@@ -621,11 +696,10 @@ const MenuAccountDropdown = ({
|
|
|
621
696
|
account,
|
|
622
697
|
balance,
|
|
623
698
|
actions,
|
|
624
|
-
guide,
|
|
625
699
|
modal,
|
|
626
700
|
onClick
|
|
627
701
|
}) => {
|
|
628
|
-
var _a, _b, _c, _d, _e
|
|
702
|
+
var _a, _b, _c, _d, _e;
|
|
629
703
|
const app = (0, import_react_query.useQuery)({
|
|
630
704
|
queryKey: ["app"]
|
|
631
705
|
});
|
|
@@ -645,15 +719,6 @@ const MenuAccountDropdown = ({
|
|
|
645
719
|
title: "Account"
|
|
646
720
|
}
|
|
647
721
|
];
|
|
648
|
-
if (guide) {
|
|
649
|
-
items.push({
|
|
650
|
-
"data-guide": "menu-item-account-guide",
|
|
651
|
-
element: "button",
|
|
652
|
-
onClick: actions.guide,
|
|
653
|
-
title: "Screen guide"
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
;
|
|
657
722
|
if (process.env.NEXT_PUBLIC_SUPPORT_URI) {
|
|
658
723
|
items.push({
|
|
659
724
|
"data-guide": "menu-item-account-support",
|
|
@@ -782,95 +847,122 @@ const MenuAccountDropdown = ({
|
|
|
782
847
|
"div",
|
|
783
848
|
{
|
|
784
849
|
...{
|
|
785
|
-
|
|
850
|
+
// No space-y: the always-drawn panel would leave its gap under a closed menu;
|
|
851
|
+
// the gap rides inside the panel's reveal.
|
|
852
|
+
className: "flex flex-col justify-between p-6" + (banded ? "" : " border-t border-gray-dark")
|
|
786
853
|
},
|
|
787
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
854
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Disclosure, { children: ({ open }) => {
|
|
855
|
+
var _a2, _b2;
|
|
856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
858
|
+
import_react2.DisclosureButton,
|
|
859
|
+
{
|
|
860
|
+
...{
|
|
861
|
+
as: import_button.default,
|
|
862
|
+
variant: "link"
|
|
863
|
+
},
|
|
864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
865
|
+
"span",
|
|
866
|
+
{
|
|
867
|
+
...{
|
|
868
|
+
className: "flex items-center w-full space-x-3"
|
|
869
|
+
},
|
|
870
|
+
children: [
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
872
|
+
"span",
|
|
873
|
+
{
|
|
874
|
+
...{
|
|
875
|
+
// The avatar's own size: a fixed w-8 box let the 40 px avatar
|
|
876
|
+
// spill down and right, off the text's centre and into the gap.
|
|
877
|
+
// A gray ring: the black initials circle is otherwise lost on
|
|
878
|
+
// the black sidebar, leaving the dot floating.
|
|
879
|
+
className: "relative flex shrink-0 rounded-full ring-1 ring-gray-dark"
|
|
880
|
+
},
|
|
881
|
+
children: [
|
|
882
|
+
Boolean(inbox) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
883
|
+
"span",
|
|
884
|
+
{
|
|
885
|
+
...{
|
|
886
|
+
// On the circle's edge, at its top right.
|
|
887
|
+
className: "w-3 h-3 z-10 flex items-center justify-center absolute top-0 right-0 border-2 border-black rounded-full overflow-hidden"
|
|
888
|
+
},
|
|
889
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
890
|
+
import_indicator.default,
|
|
891
|
+
{
|
|
892
|
+
...{
|
|
893
|
+
type: "warning"
|
|
894
|
+
}
|
|
820
895
|
}
|
|
896
|
+
)
|
|
897
|
+
}
|
|
898
|
+
),
|
|
899
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
900
|
+
import_avatar.default,
|
|
901
|
+
{
|
|
902
|
+
...{
|
|
903
|
+
email: (_a2 = account == null ? void 0 : account.data) == null ? void 0 : _a2.email,
|
|
904
|
+
image: (_b2 = account == null ? void 0 : account.data) == null ? void 0 : _b2.image,
|
|
905
|
+
name: (0, import_helpers.formatUserName)(account == null ? void 0 : account.data)
|
|
821
906
|
}
|
|
822
|
-
)
|
|
823
|
-
}
|
|
824
|
-
),
|
|
825
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
826
|
-
import_avatar.default,
|
|
827
|
-
{
|
|
828
|
-
...{
|
|
829
|
-
email: (_f = account == null ? void 0 : account.data) == null ? void 0 : _f.email,
|
|
830
|
-
image: (_g = account == null ? void 0 : account.data) == null ? void 0 : _g.image,
|
|
831
|
-
name: (0, import_helpers.formatUserName)(account == null ? void 0 : account.data)
|
|
832
907
|
}
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
908
|
+
)
|
|
909
|
+
]
|
|
910
|
+
}
|
|
911
|
+
),
|
|
912
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
913
|
+
"span",
|
|
914
|
+
{
|
|
915
|
+
...{
|
|
916
|
+
className: "w-full flex flex-col text-left leading-none space-y-[3px]"
|
|
917
|
+
},
|
|
918
|
+
children: [
|
|
919
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
920
|
+
"span",
|
|
921
|
+
{
|
|
922
|
+
...{
|
|
923
|
+
className: "block text-white"
|
|
924
|
+
},
|
|
925
|
+
children: (0, import_helpers.formatUserName)(account == null ? void 0 : account.data)
|
|
926
|
+
}
|
|
927
|
+
),
|
|
928
|
+
renderStatus()
|
|
929
|
+
]
|
|
930
|
+
}
|
|
931
|
+
)
|
|
932
|
+
]
|
|
933
|
+
}
|
|
934
|
+
)
|
|
935
|
+
}
|
|
936
|
+
),
|
|
937
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
938
|
+
import_react2.DisclosurePanel,
|
|
939
|
+
{
|
|
940
|
+
...{
|
|
941
|
+
static: true
|
|
942
|
+
},
|
|
943
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
944
|
+
Reveal,
|
|
945
|
+
{
|
|
946
|
+
...{
|
|
947
|
+
className: "pt-4",
|
|
948
|
+
shown: open
|
|
949
|
+
},
|
|
950
|
+
children: items.map((item, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
951
|
+
MenuItem,
|
|
840
952
|
{
|
|
841
953
|
...{
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
},
|
|
851
|
-
children: (0, import_helpers.formatUserName)(account == null ? void 0 : account.data)
|
|
852
|
-
}
|
|
853
|
-
),
|
|
854
|
-
renderStatus()
|
|
855
|
-
]
|
|
856
|
-
}
|
|
857
|
-
)
|
|
858
|
-
]
|
|
859
|
-
}
|
|
860
|
-
)
|
|
861
|
-
}
|
|
862
|
-
),
|
|
863
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.DisclosurePanel, { children: items.map((item, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
864
|
-
MenuItem,
|
|
865
|
-
{
|
|
866
|
-
...{
|
|
867
|
-
...item,
|
|
868
|
-
onClick: item.onClick || onClick
|
|
954
|
+
...item,
|
|
955
|
+
onClick: item.onClick || onClick
|
|
956
|
+
}
|
|
957
|
+
},
|
|
958
|
+
key
|
|
959
|
+
))
|
|
960
|
+
}
|
|
961
|
+
)
|
|
869
962
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
] })
|
|
963
|
+
)
|
|
964
|
+
] });
|
|
965
|
+
} })
|
|
874
966
|
}
|
|
875
967
|
)
|
|
876
968
|
] });
|
package/dist/dashboard/menu.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Fragment } from "react";
|
|
3
|
+
import { Fragment, useEffect, useRef, useState } from "react";
|
|
4
4
|
import Link from "./link.mjs";
|
|
5
5
|
import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/react";
|
|
6
6
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -44,6 +44,79 @@ const icons = {
|
|
|
44
44
|
star: Star,
|
|
45
45
|
users: Users
|
|
46
46
|
};
|
|
47
|
+
const Reveal = ({
|
|
48
|
+
children,
|
|
49
|
+
className,
|
|
50
|
+
shown
|
|
51
|
+
}) => {
|
|
52
|
+
const box = useRef(null);
|
|
53
|
+
useEffect(
|
|
54
|
+
() => {
|
|
55
|
+
if (box.current) box.current.inert = !shown;
|
|
56
|
+
},
|
|
57
|
+
[shown]
|
|
58
|
+
);
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
...{
|
|
63
|
+
className: "grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none " + (shown ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
64
|
+
ref: box
|
|
65
|
+
},
|
|
66
|
+
children: /* @__PURE__ */ jsx(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
...{
|
|
70
|
+
className: "min-h-0 overflow-hidden"
|
|
71
|
+
},
|
|
72
|
+
children: /* @__PURE__ */ jsx(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
...{
|
|
76
|
+
className
|
|
77
|
+
},
|
|
78
|
+
children: children.map((child, index) => /* @__PURE__ */ jsx(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
...{
|
|
82
|
+
className: "transition-opacity ease-out motion-reduce:transition-none " + (shown ? "opacity-100 duration-150" : "opacity-0 duration-75"),
|
|
83
|
+
...shown && {
|
|
84
|
+
style: {
|
|
85
|
+
transitionDelay: index * 30 + "ms"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
children: child
|
|
90
|
+
},
|
|
91
|
+
index
|
|
92
|
+
))
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
const opened = /* @__PURE__ */ new Set();
|
|
101
|
+
let primed = false;
|
|
102
|
+
const useShown = (key, open, enabled) => {
|
|
103
|
+
const [shown, setShown] = useState(() => primed ? opened.has(key) : open);
|
|
104
|
+
useEffect(
|
|
105
|
+
() => {
|
|
106
|
+
if (!enabled) return void 0;
|
|
107
|
+
primed = true;
|
|
108
|
+
if (open) {
|
|
109
|
+
opened.add(key);
|
|
110
|
+
} else {
|
|
111
|
+
opened.delete(key);
|
|
112
|
+
}
|
|
113
|
+
const frame = window.requestAnimationFrame(() => setShown(open));
|
|
114
|
+
return () => window.cancelAnimationFrame(frame);
|
|
115
|
+
},
|
|
116
|
+
[enabled, key, open]
|
|
117
|
+
);
|
|
118
|
+
return shown;
|
|
119
|
+
};
|
|
47
120
|
const MenuItem = ({
|
|
48
121
|
active,
|
|
49
122
|
badge,
|
|
@@ -62,6 +135,7 @@ const MenuItem = ({
|
|
|
62
135
|
...rest
|
|
63
136
|
}) => {
|
|
64
137
|
const Icon = icons[icon];
|
|
138
|
+
const shown = useShown(rest.href || title, open, children.length > 0);
|
|
65
139
|
const classes = {
|
|
66
140
|
row: [
|
|
67
141
|
"flex items-center justify-between w-full transform duration-300 text-left py-1 rounded",
|
|
@@ -177,11 +251,12 @@ const MenuItem = ({
|
|
|
177
251
|
children: content
|
|
178
252
|
}
|
|
179
253
|
),
|
|
180
|
-
|
|
181
|
-
|
|
254
|
+
children.length > 0 && /* @__PURE__ */ jsx(
|
|
255
|
+
Reveal,
|
|
182
256
|
{
|
|
183
257
|
...{
|
|
184
|
-
className: "
|
|
258
|
+
className: "pt-0.5 pb-2",
|
|
259
|
+
shown
|
|
185
260
|
},
|
|
186
261
|
children: children.map(({ key: childKey, exact, ...props }, key) => /* @__PURE__ */ jsx(
|
|
187
262
|
MenuItem,
|
|
@@ -583,11 +658,10 @@ const MenuAccountDropdown = ({
|
|
|
583
658
|
account,
|
|
584
659
|
balance,
|
|
585
660
|
actions,
|
|
586
|
-
guide,
|
|
587
661
|
modal,
|
|
588
662
|
onClick
|
|
589
663
|
}) => {
|
|
590
|
-
var _a, _b, _c, _d, _e
|
|
664
|
+
var _a, _b, _c, _d, _e;
|
|
591
665
|
const app = useQuery({
|
|
592
666
|
queryKey: ["app"]
|
|
593
667
|
});
|
|
@@ -607,15 +681,6 @@ const MenuAccountDropdown = ({
|
|
|
607
681
|
title: "Account"
|
|
608
682
|
}
|
|
609
683
|
];
|
|
610
|
-
if (guide) {
|
|
611
|
-
items.push({
|
|
612
|
-
"data-guide": "menu-item-account-guide",
|
|
613
|
-
element: "button",
|
|
614
|
-
onClick: actions.guide,
|
|
615
|
-
title: "Screen guide"
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
;
|
|
619
684
|
if (process.env.NEXT_PUBLIC_SUPPORT_URI) {
|
|
620
685
|
items.push({
|
|
621
686
|
"data-guide": "menu-item-account-support",
|
|
@@ -744,95 +809,122 @@ const MenuAccountDropdown = ({
|
|
|
744
809
|
"div",
|
|
745
810
|
{
|
|
746
811
|
...{
|
|
747
|
-
|
|
812
|
+
// No space-y: the always-drawn panel would leave its gap under a closed menu;
|
|
813
|
+
// the gap rides inside the panel's reveal.
|
|
814
|
+
className: "flex flex-col justify-between p-6" + (banded ? "" : " border-t border-gray-dark")
|
|
748
815
|
},
|
|
749
|
-
children: /* @__PURE__ */
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
816
|
+
children: /* @__PURE__ */ jsx(Disclosure, { children: ({ open }) => {
|
|
817
|
+
var _a2, _b2;
|
|
818
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
819
|
+
/* @__PURE__ */ jsx(
|
|
820
|
+
DisclosureButton,
|
|
821
|
+
{
|
|
822
|
+
...{
|
|
823
|
+
as: Button,
|
|
824
|
+
variant: "link"
|
|
825
|
+
},
|
|
826
|
+
children: /* @__PURE__ */ jsxs(
|
|
827
|
+
"span",
|
|
828
|
+
{
|
|
829
|
+
...{
|
|
830
|
+
className: "flex items-center w-full space-x-3"
|
|
831
|
+
},
|
|
832
|
+
children: [
|
|
833
|
+
/* @__PURE__ */ jsxs(
|
|
834
|
+
"span",
|
|
835
|
+
{
|
|
836
|
+
...{
|
|
837
|
+
// The avatar's own size: a fixed w-8 box let the 40 px avatar
|
|
838
|
+
// spill down and right, off the text's centre and into the gap.
|
|
839
|
+
// A gray ring: the black initials circle is otherwise lost on
|
|
840
|
+
// the black sidebar, leaving the dot floating.
|
|
841
|
+
className: "relative flex shrink-0 rounded-full ring-1 ring-gray-dark"
|
|
842
|
+
},
|
|
843
|
+
children: [
|
|
844
|
+
Boolean(inbox) && /* @__PURE__ */ jsx(
|
|
845
|
+
"span",
|
|
846
|
+
{
|
|
847
|
+
...{
|
|
848
|
+
// On the circle's edge, at its top right.
|
|
849
|
+
className: "w-3 h-3 z-10 flex items-center justify-center absolute top-0 right-0 border-2 border-black rounded-full overflow-hidden"
|
|
850
|
+
},
|
|
851
|
+
children: /* @__PURE__ */ jsx(
|
|
852
|
+
Indicator,
|
|
853
|
+
{
|
|
854
|
+
...{
|
|
855
|
+
type: "warning"
|
|
856
|
+
}
|
|
782
857
|
}
|
|
858
|
+
)
|
|
859
|
+
}
|
|
860
|
+
),
|
|
861
|
+
/* @__PURE__ */ jsx(
|
|
862
|
+
Avatar,
|
|
863
|
+
{
|
|
864
|
+
...{
|
|
865
|
+
email: (_a2 = account == null ? void 0 : account.data) == null ? void 0 : _a2.email,
|
|
866
|
+
image: (_b2 = account == null ? void 0 : account.data) == null ? void 0 : _b2.image,
|
|
867
|
+
name: formatUserName(account == null ? void 0 : account.data)
|
|
783
868
|
}
|
|
784
|
-
)
|
|
785
|
-
}
|
|
786
|
-
),
|
|
787
|
-
/* @__PURE__ */ jsx(
|
|
788
|
-
Avatar,
|
|
789
|
-
{
|
|
790
|
-
...{
|
|
791
|
-
email: (_f = account == null ? void 0 : account.data) == null ? void 0 : _f.email,
|
|
792
|
-
image: (_g = account == null ? void 0 : account.data) == null ? void 0 : _g.image,
|
|
793
|
-
name: formatUserName(account == null ? void 0 : account.data)
|
|
794
869
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
870
|
+
)
|
|
871
|
+
]
|
|
872
|
+
}
|
|
873
|
+
),
|
|
874
|
+
/* @__PURE__ */ jsxs(
|
|
875
|
+
"span",
|
|
876
|
+
{
|
|
877
|
+
...{
|
|
878
|
+
className: "w-full flex flex-col text-left leading-none space-y-[3px]"
|
|
879
|
+
},
|
|
880
|
+
children: [
|
|
881
|
+
/* @__PURE__ */ jsx(
|
|
882
|
+
"span",
|
|
883
|
+
{
|
|
884
|
+
...{
|
|
885
|
+
className: "block text-white"
|
|
886
|
+
},
|
|
887
|
+
children: formatUserName(account == null ? void 0 : account.data)
|
|
888
|
+
}
|
|
889
|
+
),
|
|
890
|
+
renderStatus()
|
|
891
|
+
]
|
|
892
|
+
}
|
|
893
|
+
)
|
|
894
|
+
]
|
|
895
|
+
}
|
|
896
|
+
)
|
|
897
|
+
}
|
|
898
|
+
),
|
|
899
|
+
/* @__PURE__ */ jsx(
|
|
900
|
+
DisclosurePanel,
|
|
901
|
+
{
|
|
902
|
+
...{
|
|
903
|
+
static: true
|
|
904
|
+
},
|
|
905
|
+
children: /* @__PURE__ */ jsx(
|
|
906
|
+
Reveal,
|
|
907
|
+
{
|
|
908
|
+
...{
|
|
909
|
+
className: "pt-4",
|
|
910
|
+
shown: open
|
|
911
|
+
},
|
|
912
|
+
children: items.map((item, key) => /* @__PURE__ */ jsx(
|
|
913
|
+
MenuItem,
|
|
802
914
|
{
|
|
803
915
|
...{
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
},
|
|
813
|
-
children: formatUserName(account == null ? void 0 : account.data)
|
|
814
|
-
}
|
|
815
|
-
),
|
|
816
|
-
renderStatus()
|
|
817
|
-
]
|
|
818
|
-
}
|
|
819
|
-
)
|
|
820
|
-
]
|
|
821
|
-
}
|
|
822
|
-
)
|
|
823
|
-
}
|
|
824
|
-
),
|
|
825
|
-
/* @__PURE__ */ jsx(DisclosurePanel, { children: items.map((item, key) => /* @__PURE__ */ jsx(
|
|
826
|
-
MenuItem,
|
|
827
|
-
{
|
|
828
|
-
...{
|
|
829
|
-
...item,
|
|
830
|
-
onClick: item.onClick || onClick
|
|
916
|
+
...item,
|
|
917
|
+
onClick: item.onClick || onClick
|
|
918
|
+
}
|
|
919
|
+
},
|
|
920
|
+
key
|
|
921
|
+
))
|
|
922
|
+
}
|
|
923
|
+
)
|
|
831
924
|
}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
] })
|
|
925
|
+
)
|
|
926
|
+
] });
|
|
927
|
+
} })
|
|
836
928
|
}
|
|
837
929
|
)
|
|
838
930
|
] });
|