@authowl/react 0.18.5 → 0.18.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +17 -5
- package/dist/index.js +105 -93
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3591,7 +3591,7 @@ function AuthOwlBranding({ href, showEnvironment = true } = {}) {
|
|
|
3591
3591
|
showAppName ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "ba-branding-name", children: appName }) : null
|
|
3592
3592
|
] });
|
|
3593
3593
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3594
|
-
"
|
|
3594
|
+
"div",
|
|
3595
3595
|
{
|
|
3596
3596
|
className: `ba-branding ba-branding-align-${alignment}`,
|
|
3597
3597
|
"data-testid": "authowl-branding",
|
|
@@ -5862,7 +5862,9 @@ var React39 = __toESM(require("react"), 1);
|
|
|
5862
5862
|
|
|
5863
5863
|
// src/components/ModalSurface.tsx
|
|
5864
5864
|
var React38 = __toESM(require("react"), 1);
|
|
5865
|
+
var import_react_dom = require("react-dom");
|
|
5865
5866
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5867
|
+
var useClientLayoutEffect = typeof document === "undefined" ? React38.useEffect : React38.useLayoutEffect;
|
|
5866
5868
|
function ModalSurface({
|
|
5867
5869
|
overlayClassName,
|
|
5868
5870
|
panelClassName,
|
|
@@ -5872,12 +5874,18 @@ function ModalSurface({
|
|
|
5872
5874
|
onClose,
|
|
5873
5875
|
children
|
|
5874
5876
|
}) {
|
|
5877
|
+
const ownerRef = React38.useRef(null);
|
|
5875
5878
|
const panelRef = React38.useRef(null);
|
|
5879
|
+
const [portalTarget, setPortalTarget] = React38.useState(null);
|
|
5876
5880
|
const onCloseRef = React38.useRef(onClose);
|
|
5877
5881
|
const returnFocusRefRef = React38.useRef(returnFocusRef);
|
|
5878
5882
|
onCloseRef.current = onClose;
|
|
5879
5883
|
returnFocusRefRef.current = returnFocusRef;
|
|
5884
|
+
useClientLayoutEffect(() => {
|
|
5885
|
+
setPortalTarget(ownerRef.current?.closest(".authowl-root") ?? document.body);
|
|
5886
|
+
}, []);
|
|
5880
5887
|
React38.useEffect(() => {
|
|
5888
|
+
if (!portalTarget) return;
|
|
5881
5889
|
const previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
5882
5890
|
const previousOverflow = document.body.style.overflow;
|
|
5883
5891
|
document.body.style.overflow = "hidden";
|
|
@@ -5909,8 +5917,8 @@ function ModalSurface({
|
|
|
5909
5917
|
const returnTarget = returnFocusRefRef.current?.current ?? previousFocus;
|
|
5910
5918
|
window.setTimeout(() => returnTarget?.focus(), 0);
|
|
5911
5919
|
};
|
|
5912
|
-
}, []);
|
|
5913
|
-
|
|
5920
|
+
}, [portalTarget]);
|
|
5921
|
+
const surface = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: overlayClassName, role: "presentation", onMouseDown: (event) => {
|
|
5914
5922
|
if (event.target === event.currentTarget) onClose();
|
|
5915
5923
|
}, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5916
5924
|
"div",
|
|
@@ -5924,6 +5932,10 @@ function ModalSurface({
|
|
|
5924
5932
|
children
|
|
5925
5933
|
}
|
|
5926
5934
|
) });
|
|
5935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
5936
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { ref: ownerRef, hidden: true, "aria-hidden": "true" }),
|
|
5937
|
+
portalTarget ? (0, import_react_dom.createPortal)(surface, portalTarget) : null
|
|
5938
|
+
] });
|
|
5927
5939
|
}
|
|
5928
5940
|
|
|
5929
5941
|
// src/components/user-profile/UserProfileModal.tsx
|
|
@@ -5944,7 +5956,7 @@ function UserProfileModal({
|
|
|
5944
5956
|
testId: "user-profile-modal",
|
|
5945
5957
|
onClose,
|
|
5946
5958
|
children: [
|
|
5947
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("
|
|
5959
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "ba-profile-modal-header", children: [
|
|
5948
5960
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { children: [
|
|
5949
5961
|
branding,
|
|
5950
5962
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h1", { id: titleId, children: t("userProfile.title") }),
|
|
@@ -6323,7 +6335,7 @@ function OrganizationModal({
|
|
|
6323
6335
|
returnFocusRef,
|
|
6324
6336
|
onClose,
|
|
6325
6337
|
children: [
|
|
6326
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("
|
|
6338
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "ba-organization-modal-header", children: [
|
|
6327
6339
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { id: titleId, className: "ba-title", children: title }),
|
|
6328
6340
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6329
6341
|
"button",
|
package/dist/index.js
CHANGED
|
@@ -3513,7 +3513,7 @@ function AuthOwlBranding({ href, showEnvironment = true } = {}) {
|
|
|
3513
3513
|
showAppName ? /* @__PURE__ */ jsx20("span", { className: "ba-branding-name", children: appName }) : null
|
|
3514
3514
|
] });
|
|
3515
3515
|
return /* @__PURE__ */ jsxs16(
|
|
3516
|
-
"
|
|
3516
|
+
"div",
|
|
3517
3517
|
{
|
|
3518
3518
|
className: `ba-branding ba-branding-align-${alignment}`,
|
|
3519
3519
|
"data-testid": "authowl-branding",
|
|
@@ -5784,7 +5784,9 @@ import * as React39 from "react";
|
|
|
5784
5784
|
|
|
5785
5785
|
// src/components/ModalSurface.tsx
|
|
5786
5786
|
import * as React38 from "react";
|
|
5787
|
-
import {
|
|
5787
|
+
import { createPortal } from "react-dom";
|
|
5788
|
+
import { Fragment as Fragment15, jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5789
|
+
var useClientLayoutEffect = typeof document === "undefined" ? React38.useEffect : React38.useLayoutEffect;
|
|
5788
5790
|
function ModalSurface({
|
|
5789
5791
|
overlayClassName,
|
|
5790
5792
|
panelClassName,
|
|
@@ -5794,12 +5796,18 @@ function ModalSurface({
|
|
|
5794
5796
|
onClose,
|
|
5795
5797
|
children
|
|
5796
5798
|
}) {
|
|
5799
|
+
const ownerRef = React38.useRef(null);
|
|
5797
5800
|
const panelRef = React38.useRef(null);
|
|
5801
|
+
const [portalTarget, setPortalTarget] = React38.useState(null);
|
|
5798
5802
|
const onCloseRef = React38.useRef(onClose);
|
|
5799
5803
|
const returnFocusRefRef = React38.useRef(returnFocusRef);
|
|
5800
5804
|
onCloseRef.current = onClose;
|
|
5801
5805
|
returnFocusRefRef.current = returnFocusRef;
|
|
5806
|
+
useClientLayoutEffect(() => {
|
|
5807
|
+
setPortalTarget(ownerRef.current?.closest(".authowl-root") ?? document.body);
|
|
5808
|
+
}, []);
|
|
5802
5809
|
React38.useEffect(() => {
|
|
5810
|
+
if (!portalTarget) return;
|
|
5803
5811
|
const previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
5804
5812
|
const previousOverflow = document.body.style.overflow;
|
|
5805
5813
|
document.body.style.overflow = "hidden";
|
|
@@ -5831,8 +5839,8 @@ function ModalSurface({
|
|
|
5831
5839
|
const returnTarget = returnFocusRefRef.current?.current ?? previousFocus;
|
|
5832
5840
|
window.setTimeout(() => returnTarget?.focus(), 0);
|
|
5833
5841
|
};
|
|
5834
|
-
}, []);
|
|
5835
|
-
|
|
5842
|
+
}, [portalTarget]);
|
|
5843
|
+
const surface = /* @__PURE__ */ jsx46("div", { className: overlayClassName, role: "presentation", onMouseDown: (event) => {
|
|
5836
5844
|
if (event.target === event.currentTarget) onClose();
|
|
5837
5845
|
}, children: /* @__PURE__ */ jsx46(
|
|
5838
5846
|
"div",
|
|
@@ -5846,10 +5854,14 @@ function ModalSurface({
|
|
|
5846
5854
|
children
|
|
5847
5855
|
}
|
|
5848
5856
|
) });
|
|
5857
|
+
return /* @__PURE__ */ jsxs41(Fragment15, { children: [
|
|
5858
|
+
/* @__PURE__ */ jsx46("span", { ref: ownerRef, hidden: true, "aria-hidden": "true" }),
|
|
5859
|
+
portalTarget ? createPortal(surface, portalTarget) : null
|
|
5860
|
+
] });
|
|
5849
5861
|
}
|
|
5850
5862
|
|
|
5851
5863
|
// src/components/user-profile/UserProfileModal.tsx
|
|
5852
|
-
import { jsx as jsx47, jsxs as
|
|
5864
|
+
import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5853
5865
|
function UserProfileModal({
|
|
5854
5866
|
children,
|
|
5855
5867
|
onClose,
|
|
@@ -5857,7 +5869,7 @@ function UserProfileModal({
|
|
|
5857
5869
|
}) {
|
|
5858
5870
|
const t = useT();
|
|
5859
5871
|
const titleId = React39.useId();
|
|
5860
|
-
return /* @__PURE__ */
|
|
5872
|
+
return /* @__PURE__ */ jsxs42(
|
|
5861
5873
|
ModalSurface,
|
|
5862
5874
|
{
|
|
5863
5875
|
overlayClassName: "ba-profile-overlay",
|
|
@@ -5866,8 +5878,8 @@ function UserProfileModal({
|
|
|
5866
5878
|
testId: "user-profile-modal",
|
|
5867
5879
|
onClose,
|
|
5868
5880
|
children: [
|
|
5869
|
-
/* @__PURE__ */
|
|
5870
|
-
/* @__PURE__ */
|
|
5881
|
+
/* @__PURE__ */ jsxs42("div", { className: "ba-profile-modal-header", children: [
|
|
5882
|
+
/* @__PURE__ */ jsxs42("span", { children: [
|
|
5871
5883
|
branding,
|
|
5872
5884
|
/* @__PURE__ */ jsx47("h1", { id: titleId, children: t("userProfile.title") }),
|
|
5873
5885
|
/* @__PURE__ */ jsx47("p", { children: t("userProfile.description") })
|
|
@@ -5900,7 +5912,7 @@ function UserProfileModal({
|
|
|
5900
5912
|
}
|
|
5901
5913
|
|
|
5902
5914
|
// src/components/UserProfile.tsx
|
|
5903
|
-
import { jsx as jsx48, jsxs as
|
|
5915
|
+
import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
5904
5916
|
var SECTION_KEYS = {
|
|
5905
5917
|
profile: "userProfile.nav.profile",
|
|
5906
5918
|
email: "userProfile.nav.email",
|
|
@@ -5966,7 +5978,7 @@ function UserProfile(props = {}) {
|
|
|
5966
5978
|
window.history.replaceState(null, "", userProfileSectionHash(next));
|
|
5967
5979
|
}
|
|
5968
5980
|
};
|
|
5969
|
-
const content = !isLoaded ? /* @__PURE__ */
|
|
5981
|
+
const content = !isLoaded ? /* @__PURE__ */ jsxs43("div", { className: "ba-profile-loading", "aria-busy": "true", children: [
|
|
5970
5982
|
/* @__PURE__ */ jsx48("div", { className: "ba-skeleton" }),
|
|
5971
5983
|
/* @__PURE__ */ jsx48("div", { className: "ba-skeleton" }),
|
|
5972
5984
|
/* @__PURE__ */ jsx48("div", { className: "ba-skeleton" })
|
|
@@ -5991,8 +6003,8 @@ function UserProfile(props = {}) {
|
|
|
5991
6003
|
}
|
|
5992
6004
|
);
|
|
5993
6005
|
}
|
|
5994
|
-
return /* @__PURE__ */
|
|
5995
|
-
/* @__PURE__ */
|
|
6006
|
+
return /* @__PURE__ */ jsxs43("article", { className: "ba-profile ba-profile-page", "data-testid": "user-profile", children: [
|
|
6007
|
+
/* @__PURE__ */ jsxs43("header", { className: "ba-profile-heading", children: [
|
|
5996
6008
|
showBranding ? /* @__PURE__ */ jsx48(AuthOwlBranding, {}) : null,
|
|
5997
6009
|
/* @__PURE__ */ jsx48("h1", { children: t("userProfile.title") }),
|
|
5998
6010
|
/* @__PURE__ */ jsx48("p", { children: t("userProfile.description") })
|
|
@@ -6009,7 +6021,7 @@ function UserProfileBody({
|
|
|
6009
6021
|
capabilities
|
|
6010
6022
|
}) {
|
|
6011
6023
|
const t = useT();
|
|
6012
|
-
return /* @__PURE__ */
|
|
6024
|
+
return /* @__PURE__ */ jsxs43("div", { className: "ba-profile-layout", children: [
|
|
6013
6025
|
/* @__PURE__ */ jsx48("nav", { className: "ba-profile-nav", "aria-label": t("userProfile.nav.aria"), children: sections.map((item) => /* @__PURE__ */ jsx48(
|
|
6014
6026
|
"button",
|
|
6015
6027
|
{
|
|
@@ -6021,7 +6033,7 @@ function UserProfileBody({
|
|
|
6021
6033
|
},
|
|
6022
6034
|
item
|
|
6023
6035
|
)) }),
|
|
6024
|
-
/* @__PURE__ */
|
|
6036
|
+
/* @__PURE__ */ jsxs43("div", { className: "ba-profile-content", "data-section": active, children: [
|
|
6025
6037
|
active === "profile" && /* @__PURE__ */ jsx48(
|
|
6026
6038
|
ProfileSection,
|
|
6027
6039
|
{
|
|
@@ -6043,7 +6055,7 @@ function UserProfileBody({
|
|
|
6043
6055
|
}
|
|
6044
6056
|
|
|
6045
6057
|
// src/components/UserButton.tsx
|
|
6046
|
-
import { jsx as jsx49, jsxs as
|
|
6058
|
+
import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6047
6059
|
function UserButton() {
|
|
6048
6060
|
const t = useT();
|
|
6049
6061
|
const { user, isLoaded } = useUser();
|
|
@@ -6053,7 +6065,7 @@ function UserButton() {
|
|
|
6053
6065
|
const triggerRef = React41.useRef(null);
|
|
6054
6066
|
if (!isLoaded || !user) return null;
|
|
6055
6067
|
const identity = user.email ?? user.phoneNumber ?? user.name ?? "?";
|
|
6056
|
-
return /* @__PURE__ */
|
|
6068
|
+
return /* @__PURE__ */ jsxs44("div", { className: "ba-user-button", "data-testid": "user-button", children: [
|
|
6057
6069
|
/* @__PURE__ */ jsx49(
|
|
6058
6070
|
"button",
|
|
6059
6071
|
{
|
|
@@ -6064,7 +6076,7 @@ function UserButton() {
|
|
|
6064
6076
|
children: user.image ? /* @__PURE__ */ jsx49("img", { className: "ba-avatar", src: user.image, alt: "" }) : /* @__PURE__ */ jsx49("span", { className: "ba-avatar ba-avatar-fallback", children: identity[0]?.toUpperCase() })
|
|
6065
6077
|
}
|
|
6066
6078
|
),
|
|
6067
|
-
open && /* @__PURE__ */
|
|
6079
|
+
open && /* @__PURE__ */ jsxs44("div", { className: "ba-menu", children: [
|
|
6068
6080
|
/* @__PURE__ */ jsx49("p", { className: "ba-menu-label", children: identity }),
|
|
6069
6081
|
/* @__PURE__ */ jsx49(
|
|
6070
6082
|
"button",
|
|
@@ -6116,7 +6128,7 @@ function canManageOrganization(member) {
|
|
|
6116
6128
|
}
|
|
6117
6129
|
|
|
6118
6130
|
// src/components/CreateOrganization.tsx
|
|
6119
|
-
import { jsx as jsx50, jsxs as
|
|
6131
|
+
import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6120
6132
|
function CreateOrganization({ onCreated, title } = {}) {
|
|
6121
6133
|
const t = useT();
|
|
6122
6134
|
const { config, isLoading: configLoading } = usePublicConfig();
|
|
@@ -6156,13 +6168,13 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
6156
6168
|
}
|
|
6157
6169
|
);
|
|
6158
6170
|
};
|
|
6159
|
-
return /* @__PURE__ */
|
|
6160
|
-
title !== null && /* @__PURE__ */
|
|
6171
|
+
return /* @__PURE__ */ jsxs45("section", { className: "ba-organization-create", children: [
|
|
6172
|
+
title !== null && /* @__PURE__ */ jsxs45("header", { className: "ba-organization-section-header", children: [
|
|
6161
6173
|
/* @__PURE__ */ jsx50("h2", { className: "ba-title", children: title ?? t("organization.create.title") }),
|
|
6162
6174
|
/* @__PURE__ */ jsx50("p", { className: "ba-muted", children: t("organization.create.description") })
|
|
6163
6175
|
] }),
|
|
6164
|
-
/* @__PURE__ */
|
|
6165
|
-
/* @__PURE__ */
|
|
6176
|
+
/* @__PURE__ */ jsxs45("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6177
|
+
/* @__PURE__ */ jsxs45("label", { className: "ba-label", children: [
|
|
6166
6178
|
t("organization.create.name"),
|
|
6167
6179
|
/* @__PURE__ */ jsx50(
|
|
6168
6180
|
"input",
|
|
@@ -6179,7 +6191,7 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
6179
6191
|
}
|
|
6180
6192
|
)
|
|
6181
6193
|
] }),
|
|
6182
|
-
/* @__PURE__ */
|
|
6194
|
+
/* @__PURE__ */ jsxs45("label", { className: "ba-label", children: [
|
|
6183
6195
|
t("organization.create.slug"),
|
|
6184
6196
|
/* @__PURE__ */ jsx50(
|
|
6185
6197
|
"input",
|
|
@@ -6196,7 +6208,7 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
6196
6208
|
}
|
|
6197
6209
|
)
|
|
6198
6210
|
] }),
|
|
6199
|
-
/* @__PURE__ */
|
|
6211
|
+
/* @__PURE__ */ jsxs45("label", { className: "ba-label", children: [
|
|
6200
6212
|
t("organization.create.logo"),
|
|
6201
6213
|
/* @__PURE__ */ jsx50(
|
|
6202
6214
|
"input",
|
|
@@ -6227,7 +6239,7 @@ function CreateOrganization({ onCreated, title } = {}) {
|
|
|
6227
6239
|
|
|
6228
6240
|
// src/components/organization/OrganizationModal.tsx
|
|
6229
6241
|
import * as React43 from "react";
|
|
6230
|
-
import { jsx as jsx51, jsxs as
|
|
6242
|
+
import { jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
6231
6243
|
function OrganizationModal({
|
|
6232
6244
|
title,
|
|
6233
6245
|
onClose,
|
|
@@ -6236,7 +6248,7 @@ function OrganizationModal({
|
|
|
6236
6248
|
}) {
|
|
6237
6249
|
const t = useT();
|
|
6238
6250
|
const titleId = React43.useId();
|
|
6239
|
-
return /* @__PURE__ */
|
|
6251
|
+
return /* @__PURE__ */ jsxs46(
|
|
6240
6252
|
ModalSurface,
|
|
6241
6253
|
{
|
|
6242
6254
|
overlayClassName: "ba-organization-overlay",
|
|
@@ -6245,7 +6257,7 @@ function OrganizationModal({
|
|
|
6245
6257
|
returnFocusRef,
|
|
6246
6258
|
onClose,
|
|
6247
6259
|
children: [
|
|
6248
|
-
/* @__PURE__ */
|
|
6260
|
+
/* @__PURE__ */ jsxs46("div", { className: "ba-organization-modal-header", children: [
|
|
6249
6261
|
/* @__PURE__ */ jsx51("h2", { id: titleId, className: "ba-title", children: title }),
|
|
6250
6262
|
/* @__PURE__ */ jsx51(
|
|
6251
6263
|
"button",
|
|
@@ -6320,7 +6332,7 @@ import * as React49 from "react";
|
|
|
6320
6332
|
|
|
6321
6333
|
// src/components/organization/DangerSection.tsx
|
|
6322
6334
|
import * as React45 from "react";
|
|
6323
|
-
import { jsx as jsx52, jsxs as
|
|
6335
|
+
import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
6324
6336
|
function DangerSection({
|
|
6325
6337
|
organization,
|
|
6326
6338
|
membership,
|
|
@@ -6361,20 +6373,20 @@ function DangerSection({
|
|
|
6361
6373
|
}
|
|
6362
6374
|
);
|
|
6363
6375
|
};
|
|
6364
|
-
return /* @__PURE__ */
|
|
6365
|
-
/* @__PURE__ */
|
|
6376
|
+
return /* @__PURE__ */ jsxs47("section", { className: "ba-organization-section ba-organization-danger", children: [
|
|
6377
|
+
/* @__PURE__ */ jsxs47("header", { className: "ba-organization-section-header", children: [
|
|
6366
6378
|
/* @__PURE__ */ jsx52("h3", { className: "ba-title", children: t("organization.profile.danger.title") }),
|
|
6367
6379
|
/* @__PURE__ */ jsx52("p", { className: "ba-muted", children: t("organization.profile.danger.description") })
|
|
6368
6380
|
] }),
|
|
6369
|
-
/* @__PURE__ */
|
|
6381
|
+
/* @__PURE__ */ jsxs47("div", { className: "ba-organization-danger-action", children: [
|
|
6370
6382
|
/* @__PURE__ */ jsx52("strong", { children: t("organization.profile.danger.leaveTitle") }),
|
|
6371
6383
|
/* @__PURE__ */ jsx52("p", { className: "ba-muted", children: isOwner ? t("organization.profile.danger.ownerLeaveHint") : t("organization.profile.danger.leaveHint") }),
|
|
6372
6384
|
/* @__PURE__ */ jsx52("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: leave, children: t("organization.profile.danger.leave") })
|
|
6373
6385
|
] }),
|
|
6374
|
-
isOwner && /* @__PURE__ */
|
|
6386
|
+
isOwner && /* @__PURE__ */ jsxs47("form", { method: "post", className: "ba-organization-danger-action ba-organization-delete", onSubmit: remove, children: [
|
|
6375
6387
|
/* @__PURE__ */ jsx52("strong", { children: t("organization.profile.danger.deleteTitle") }),
|
|
6376
6388
|
/* @__PURE__ */ jsx52("p", { className: "ba-muted", children: t("organization.profile.danger.deleteHint") }),
|
|
6377
|
-
/* @__PURE__ */
|
|
6389
|
+
/* @__PURE__ */ jsxs47("label", { className: "ba-label", children: [
|
|
6378
6390
|
t("organization.profile.danger.deleteConfirm"),
|
|
6379
6391
|
" ",
|
|
6380
6392
|
/* @__PURE__ */ jsx52(Bidi, { children: organization.slug }),
|
|
@@ -6397,7 +6409,7 @@ function DangerSection({
|
|
|
6397
6409
|
|
|
6398
6410
|
// src/components/organization/GeneralSection.tsx
|
|
6399
6411
|
import * as React46 from "react";
|
|
6400
|
-
import { jsx as jsx53, jsxs as
|
|
6412
|
+
import { jsx as jsx53, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
6401
6413
|
function GeneralSection({
|
|
6402
6414
|
organization,
|
|
6403
6415
|
canManage,
|
|
@@ -6415,14 +6427,14 @@ function GeneralSection({
|
|
|
6415
6427
|
setLogo(organization.logo ?? "");
|
|
6416
6428
|
}, [organization.id, organization.logo, organization.name, organization.slug]);
|
|
6417
6429
|
if (!canManage) {
|
|
6418
|
-
return /* @__PURE__ */
|
|
6430
|
+
return /* @__PURE__ */ jsxs48("section", { className: "ba-organization-section", children: [
|
|
6419
6431
|
/* @__PURE__ */ jsx53("p", { className: "ba-muted", children: t("organization.profile.general.readOnly") }),
|
|
6420
|
-
/* @__PURE__ */
|
|
6421
|
-
/* @__PURE__ */
|
|
6432
|
+
/* @__PURE__ */ jsxs48("dl", { className: "ba-organization-facts", children: [
|
|
6433
|
+
/* @__PURE__ */ jsxs48("div", { children: [
|
|
6422
6434
|
/* @__PURE__ */ jsx53("dt", { children: t("organization.create.name") }),
|
|
6423
6435
|
/* @__PURE__ */ jsx53("dd", { children: organization.name })
|
|
6424
6436
|
] }),
|
|
6425
|
-
/* @__PURE__ */
|
|
6437
|
+
/* @__PURE__ */ jsxs48("div", { children: [
|
|
6426
6438
|
/* @__PURE__ */ jsx53("dt", { children: t("organization.create.slug") }),
|
|
6427
6439
|
/* @__PURE__ */ jsx53("dd", { children: /* @__PURE__ */ jsx53(Bidi, { children: organization.slug }) })
|
|
6428
6440
|
] })
|
|
@@ -6442,17 +6454,17 @@ function GeneralSection({
|
|
|
6442
6454
|
}
|
|
6443
6455
|
);
|
|
6444
6456
|
};
|
|
6445
|
-
return /* @__PURE__ */
|
|
6446
|
-
/* @__PURE__ */
|
|
6457
|
+
return /* @__PURE__ */ jsxs48("section", { className: "ba-organization-section", children: [
|
|
6458
|
+
/* @__PURE__ */ jsxs48("header", { className: "ba-organization-section-header", children: [
|
|
6447
6459
|
/* @__PURE__ */ jsx53("h3", { className: "ba-title", children: t("organization.profile.general.title") }),
|
|
6448
6460
|
/* @__PURE__ */ jsx53("p", { className: "ba-muted", children: t("organization.profile.general.description") })
|
|
6449
6461
|
] }),
|
|
6450
|
-
/* @__PURE__ */
|
|
6451
|
-
/* @__PURE__ */
|
|
6462
|
+
/* @__PURE__ */ jsxs48("form", { method: "post", className: "ba-fields", onSubmit: submit, children: [
|
|
6463
|
+
/* @__PURE__ */ jsxs48("label", { className: "ba-label", children: [
|
|
6452
6464
|
t("organization.create.name"),
|
|
6453
6465
|
/* @__PURE__ */ jsx53("input", { className: "ba-input", value: name, onChange: (event) => setName(event.target.value), required: true })
|
|
6454
6466
|
] }),
|
|
6455
|
-
/* @__PURE__ */
|
|
6467
|
+
/* @__PURE__ */ jsxs48("label", { className: "ba-label", children: [
|
|
6456
6468
|
t("organization.create.slug"),
|
|
6457
6469
|
/* @__PURE__ */ jsx53(
|
|
6458
6470
|
"input",
|
|
@@ -6466,7 +6478,7 @@ function GeneralSection({
|
|
|
6466
6478
|
}
|
|
6467
6479
|
)
|
|
6468
6480
|
] }),
|
|
6469
|
-
/* @__PURE__ */
|
|
6481
|
+
/* @__PURE__ */ jsxs48("label", { className: "ba-label", children: [
|
|
6470
6482
|
t("organization.create.logo"),
|
|
6471
6483
|
/* @__PURE__ */ jsx53("input", { className: "ba-input", type: "url", dir: "ltr", value: logo, onChange: (event) => setLogo(event.target.value), placeholder: "https://" })
|
|
6472
6484
|
] }),
|
|
@@ -6537,7 +6549,7 @@ function useOrganizationRoles(organizationId) {
|
|
|
6537
6549
|
}
|
|
6538
6550
|
|
|
6539
6551
|
// src/components/organization/InvitationsSection.tsx
|
|
6540
|
-
import { jsx as jsx54, jsxs as
|
|
6552
|
+
import { jsx as jsx54, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
6541
6553
|
function InvitationsSection({
|
|
6542
6554
|
organization,
|
|
6543
6555
|
onChanged
|
|
@@ -6569,17 +6581,17 @@ function InvitationsSection({
|
|
|
6569
6581
|
{ failure: t("organization.profile.invitations.cancelError"), onSuccess: onChanged }
|
|
6570
6582
|
);
|
|
6571
6583
|
};
|
|
6572
|
-
return /* @__PURE__ */
|
|
6573
|
-
/* @__PURE__ */
|
|
6584
|
+
return /* @__PURE__ */ jsxs49("section", { className: "ba-organization-section", children: [
|
|
6585
|
+
/* @__PURE__ */ jsxs49("header", { className: "ba-organization-section-header", children: [
|
|
6574
6586
|
/* @__PURE__ */ jsx54("h3", { className: "ba-title", children: t("organization.profile.invitations.title") }),
|
|
6575
6587
|
/* @__PURE__ */ jsx54("p", { className: "ba-muted", children: t("organization.profile.invitations.description") })
|
|
6576
6588
|
] }),
|
|
6577
|
-
/* @__PURE__ */
|
|
6578
|
-
/* @__PURE__ */
|
|
6589
|
+
/* @__PURE__ */ jsxs49("form", { method: "post", className: "ba-organization-invite-form", onSubmit: invite, children: [
|
|
6590
|
+
/* @__PURE__ */ jsxs49("label", { className: "ba-label", children: [
|
|
6579
6591
|
t("organization.profile.invitations.email"),
|
|
6580
6592
|
/* @__PURE__ */ jsx54("input", { className: "ba-input", type: "email", dir: "ltr", value: email, onChange: (event) => setEmail(event.target.value), required: true })
|
|
6581
6593
|
] }),
|
|
6582
|
-
/* @__PURE__ */
|
|
6594
|
+
/* @__PURE__ */ jsxs49("label", { className: "ba-label", children: [
|
|
6583
6595
|
t("organization.profile.members.role"),
|
|
6584
6596
|
/* @__PURE__ */ jsx54("select", { className: "ba-input", value: role, onChange: (event) => setRole(event.target.value), children: roles.map((option) => /* @__PURE__ */ jsx54("option", { value: option, children: organizationRoleLabel(option, t) }, option)) })
|
|
6585
6597
|
] }),
|
|
@@ -6595,8 +6607,8 @@ function InvitationsSection({
|
|
|
6595
6607
|
)
|
|
6596
6608
|
] }),
|
|
6597
6609
|
/* @__PURE__ */ jsx54(FormError, { children: error }),
|
|
6598
|
-
invitations.length === 0 ? /* @__PURE__ */ jsx54("p", { className: "ba-muted", children: t("organization.profile.invitations.empty") }) : /* @__PURE__ */ jsx54("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */
|
|
6599
|
-
/* @__PURE__ */
|
|
6610
|
+
invitations.length === 0 ? /* @__PURE__ */ jsx54("p", { className: "ba-muted", children: t("organization.profile.invitations.empty") }) : /* @__PURE__ */ jsx54("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ jsxs49("li", { className: "ba-organization-invitation", children: [
|
|
6611
|
+
/* @__PURE__ */ jsxs49("span", { children: [
|
|
6600
6612
|
/* @__PURE__ */ jsx54("strong", { children: /* @__PURE__ */ jsx54(Bidi, { children: invitation.email }) }),
|
|
6601
6613
|
/* @__PURE__ */ jsx54("small", { children: organizationRoleLabel(invitation.role, t) })
|
|
6602
6614
|
] }),
|
|
@@ -6606,7 +6618,7 @@ function InvitationsSection({
|
|
|
6606
6618
|
}
|
|
6607
6619
|
|
|
6608
6620
|
// src/components/organization/MembersSection.tsx
|
|
6609
|
-
import { jsx as jsx55, jsxs as
|
|
6621
|
+
import { jsx as jsx55, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
6610
6622
|
function MembersSection({
|
|
6611
6623
|
organization,
|
|
6612
6624
|
userId,
|
|
@@ -6633,8 +6645,8 @@ function MembersSection({
|
|
|
6633
6645
|
{ failure: t("organization.profile.members.removeError"), onSuccess: onChanged }
|
|
6634
6646
|
);
|
|
6635
6647
|
};
|
|
6636
|
-
return /* @__PURE__ */
|
|
6637
|
-
/* @__PURE__ */
|
|
6648
|
+
return /* @__PURE__ */ jsxs50("section", { className: "ba-organization-section", children: [
|
|
6649
|
+
/* @__PURE__ */ jsxs50("header", { className: "ba-organization-section-header", children: [
|
|
6638
6650
|
/* @__PURE__ */ jsx55("h3", { className: "ba-title", children: t("organization.profile.members.title") }),
|
|
6639
6651
|
/* @__PURE__ */ jsx55("p", { className: "ba-muted", children: t("organization.profile.members.description") })
|
|
6640
6652
|
] }),
|
|
@@ -6642,16 +6654,16 @@ function MembersSection({
|
|
|
6642
6654
|
/* @__PURE__ */ jsx55("ul", { className: "ba-organization-list", children: organization.members.map((member) => {
|
|
6643
6655
|
const primaryRole = organizationRoles(member.role)[0] ?? member.role;
|
|
6644
6656
|
const isCurrent = member.userId === userId;
|
|
6645
|
-
return /* @__PURE__ */
|
|
6657
|
+
return /* @__PURE__ */ jsxs50("li", { className: "ba-organization-member", children: [
|
|
6646
6658
|
/* @__PURE__ */ jsx55("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: member.user.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
6647
|
-
/* @__PURE__ */
|
|
6648
|
-
/* @__PURE__ */
|
|
6659
|
+
/* @__PURE__ */ jsxs50("span", { className: "ba-organization-member-copy", children: [
|
|
6660
|
+
/* @__PURE__ */ jsxs50("strong", { children: [
|
|
6649
6661
|
member.user.name,
|
|
6650
6662
|
isCurrent ? ` ${t("organization.profile.members.you")}` : ""
|
|
6651
6663
|
] }),
|
|
6652
6664
|
/* @__PURE__ */ jsx55("small", { children: /* @__PURE__ */ jsx55(Bidi, { children: member.user.email }) })
|
|
6653
6665
|
] }),
|
|
6654
|
-
canManage && !isCurrent ? /* @__PURE__ */
|
|
6666
|
+
canManage && !isCurrent ? /* @__PURE__ */ jsxs50("span", { className: "ba-organization-member-actions", children: [
|
|
6655
6667
|
/* @__PURE__ */ jsx55("label", { className: "ba-sr-only", htmlFor: `organization-role-${member.id}`, children: t("organization.profile.members.role") }),
|
|
6656
6668
|
/* @__PURE__ */ jsx55(
|
|
6657
6669
|
"select",
|
|
@@ -6672,7 +6684,7 @@ function MembersSection({
|
|
|
6672
6684
|
}
|
|
6673
6685
|
|
|
6674
6686
|
// src/components/OrganizationProfile.tsx
|
|
6675
|
-
import { jsx as jsx56, jsxs as
|
|
6687
|
+
import { jsx as jsx56, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
6676
6688
|
var SECTION_KEYS2 = {
|
|
6677
6689
|
general: "organization.profile.nav.general",
|
|
6678
6690
|
members: "organization.profile.nav.members",
|
|
@@ -6731,7 +6743,7 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
6731
6743
|
if (wasRemoved) return /* @__PURE__ */ jsx56("p", { className: "ba-muted", children: t("organization.profile.noActive") });
|
|
6732
6744
|
if (!requestedId) return /* @__PURE__ */ jsx56("p", { className: "ba-muted", children: t("organization.profile.noActive") });
|
|
6733
6745
|
if (error) {
|
|
6734
|
-
return /* @__PURE__ */
|
|
6746
|
+
return /* @__PURE__ */ jsxs51("div", { className: "ba-inline-error", children: [
|
|
6735
6747
|
/* @__PURE__ */ jsx56(FormError, { children: error }),
|
|
6736
6748
|
/* @__PURE__ */ jsx56("button", { className: "ba-link-button", type: "button", onClick: () => void load(), children: t("organization.retry") })
|
|
6737
6749
|
] });
|
|
@@ -6747,15 +6759,15 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
6747
6759
|
setOrganization(null);
|
|
6748
6760
|
callback?.(removedOrganization);
|
|
6749
6761
|
};
|
|
6750
|
-
return /* @__PURE__ */
|
|
6751
|
-
/* @__PURE__ */
|
|
6762
|
+
return /* @__PURE__ */ jsxs51("article", { className: "ba-organization-profile", children: [
|
|
6763
|
+
/* @__PURE__ */ jsxs51("header", { className: "ba-organization-profile-heading", children: [
|
|
6752
6764
|
/* @__PURE__ */ jsx56("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
6753
|
-
/* @__PURE__ */
|
|
6765
|
+
/* @__PURE__ */ jsxs51("span", { children: [
|
|
6754
6766
|
/* @__PURE__ */ jsx56("h2", { className: "ba-title", children: organization.name }),
|
|
6755
6767
|
/* @__PURE__ */ jsx56("p", { className: "ba-muted", children: organization.slug })
|
|
6756
6768
|
] })
|
|
6757
6769
|
] }),
|
|
6758
|
-
/* @__PURE__ */
|
|
6770
|
+
/* @__PURE__ */ jsxs51("div", { className: "ba-organization-profile-layout", children: [
|
|
6759
6771
|
/* @__PURE__ */ jsx56("nav", { className: "ba-organization-profile-nav", "aria-label": t("organization.profile.nav.label"), children: visibleSections.map((item) => /* @__PURE__ */ jsx56(
|
|
6760
6772
|
"button",
|
|
6761
6773
|
{
|
|
@@ -6767,7 +6779,7 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
6767
6779
|
},
|
|
6768
6780
|
item
|
|
6769
6781
|
)) }),
|
|
6770
|
-
/* @__PURE__ */
|
|
6782
|
+
/* @__PURE__ */ jsxs51("div", { className: "ba-organization-profile-content", children: [
|
|
6771
6783
|
activeSection === "general" && /* @__PURE__ */ jsx56(GeneralSection, { organization, canManage, onChanged: load }),
|
|
6772
6784
|
activeSection === "members" && /* @__PURE__ */ jsx56(MembersSection, { organization, userId: user.id, canManage, onChanged: load }),
|
|
6773
6785
|
activeSection === "invitations" && /* @__PURE__ */ jsx56(InvitationsSection, { organization, onChanged: load }),
|
|
@@ -6786,7 +6798,7 @@ function OrganizationProfile({ organizationId, defaultSection = "general", onDel
|
|
|
6786
6798
|
}
|
|
6787
6799
|
|
|
6788
6800
|
// src/components/OrganizationSwitcher.tsx
|
|
6789
|
-
import { Fragment as
|
|
6801
|
+
import { Fragment as Fragment16, jsx as jsx57, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
6790
6802
|
function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChange } = {}) {
|
|
6791
6803
|
const t = useT();
|
|
6792
6804
|
const { config, isLoading: configLoading } = usePublicConfig();
|
|
@@ -6864,9 +6876,9 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
6864
6876
|
else if (event.key === "ArrowDown") items[(current + 1 + items.length) % items.length]?.focus();
|
|
6865
6877
|
else items[(current - 1 + items.length) % items.length]?.focus();
|
|
6866
6878
|
};
|
|
6867
|
-
return /* @__PURE__ */
|
|
6868
|
-
/* @__PURE__ */
|
|
6869
|
-
/* @__PURE__ */
|
|
6879
|
+
return /* @__PURE__ */ jsxs52(Fragment16, { children: [
|
|
6880
|
+
/* @__PURE__ */ jsxs52("div", { ref: rootRef, className: "ba-organization-switcher", children: [
|
|
6881
|
+
/* @__PURE__ */ jsxs52(
|
|
6870
6882
|
"button",
|
|
6871
6883
|
{
|
|
6872
6884
|
ref: triggerRef,
|
|
@@ -6889,25 +6901,25 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
6889
6901
|
]
|
|
6890
6902
|
}
|
|
6891
6903
|
),
|
|
6892
|
-
open && /* @__PURE__ */
|
|
6893
|
-
isLoading ? /* @__PURE__ */ jsx57("div", { className: "ba-skeleton" }) : /* @__PURE__ */
|
|
6894
|
-
showPersonalWorkspace && /* @__PURE__ */
|
|
6904
|
+
open && /* @__PURE__ */ jsxs52("div", { ref: menuRef, id: menuId, className: "ba-organization-menu", role: "menu", "aria-label": t("organization.switcher.label"), onKeyDown: onMenuKeyDown, children: [
|
|
6905
|
+
isLoading ? /* @__PURE__ */ jsx57("div", { className: "ba-skeleton" }) : /* @__PURE__ */ jsxs52(Fragment16, { children: [
|
|
6906
|
+
showPersonalWorkspace && /* @__PURE__ */ jsxs52("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === null ? "true" : void 0, disabled: pending, onClick: () => select(null), children: [
|
|
6895
6907
|
/* @__PURE__ */ jsx57("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: "P" }),
|
|
6896
6908
|
/* @__PURE__ */ jsx57("span", { children: t("organization.personal") })
|
|
6897
6909
|
] }),
|
|
6898
|
-
organizations?.map((organization) => /* @__PURE__ */
|
|
6910
|
+
organizations?.map((organization) => /* @__PURE__ */ jsxs52("button", { className: "ba-organization-menu-item", type: "button", role: "menuitem", "aria-current": activeId === organization.id ? "true" : void 0, disabled: pending, onClick: () => select(organization), children: [
|
|
6899
6911
|
/* @__PURE__ */ jsx57("span", { className: "ba-organization-avatar", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
6900
|
-
/* @__PURE__ */
|
|
6912
|
+
/* @__PURE__ */ jsxs52("span", { children: [
|
|
6901
6913
|
organization.name,
|
|
6902
6914
|
/* @__PURE__ */ jsx57("small", { children: organization.slug })
|
|
6903
6915
|
] })
|
|
6904
6916
|
] }, organization.id))
|
|
6905
6917
|
] }),
|
|
6906
|
-
(loadError || error) && /* @__PURE__ */
|
|
6918
|
+
(loadError || error) && /* @__PURE__ */ jsxs52("div", { className: "ba-inline-error", children: [
|
|
6907
6919
|
/* @__PURE__ */ jsx57(FormError, { children: loadError ?? error }),
|
|
6908
6920
|
loadError && /* @__PURE__ */ jsx57("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
|
|
6909
6921
|
] }),
|
|
6910
|
-
/* @__PURE__ */
|
|
6922
|
+
/* @__PURE__ */ jsxs52("div", { className: "ba-organization-menu-actions", children: [
|
|
6911
6923
|
active && /* @__PURE__ */ jsx57("button", { className: "ba-menu-item", type: "button", role: "menuitem", onClick: () => {
|
|
6912
6924
|
setOpen(false);
|
|
6913
6925
|
setDialog("profile");
|
|
@@ -6939,7 +6951,7 @@ function OrganizationSwitcher({ showPersonalWorkspace = true, onOrganizationChan
|
|
|
6939
6951
|
|
|
6940
6952
|
// src/components/OrganizationList.tsx
|
|
6941
6953
|
import * as React51 from "react";
|
|
6942
|
-
import { Fragment as
|
|
6954
|
+
import { Fragment as Fragment17, jsx as jsx58, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
6943
6955
|
function OrganizationList({ onOrganizationChange } = {}) {
|
|
6944
6956
|
const t = useT();
|
|
6945
6957
|
const toServerError = useServerError();
|
|
@@ -7031,10 +7043,10 @@ function OrganizationList({ onOrganizationChange } = {}) {
|
|
|
7031
7043
|
setDialog(null);
|
|
7032
7044
|
setProfileId(null);
|
|
7033
7045
|
};
|
|
7034
|
-
return /* @__PURE__ */
|
|
7035
|
-
/* @__PURE__ */
|
|
7036
|
-
/* @__PURE__ */
|
|
7037
|
-
/* @__PURE__ */
|
|
7046
|
+
return /* @__PURE__ */ jsxs53(Fragment17, { children: [
|
|
7047
|
+
/* @__PURE__ */ jsxs53("section", { className: "ba-organization-directory", children: [
|
|
7048
|
+
/* @__PURE__ */ jsxs53("header", { className: "ba-organization-directory-header", children: [
|
|
7049
|
+
/* @__PURE__ */ jsxs53("span", { children: [
|
|
7038
7050
|
/* @__PURE__ */ jsx58("h2", { className: "ba-title", children: t("organization.list.title") }),
|
|
7039
7051
|
/* @__PURE__ */ jsx58("p", { className: "ba-muted", children: t("organization.list.description") })
|
|
7040
7052
|
] }),
|
|
@@ -7043,40 +7055,40 @@ function OrganizationList({ onOrganizationChange } = {}) {
|
|
|
7043
7055
|
setDialog("create");
|
|
7044
7056
|
}, children: t("organization.switcher.create") })
|
|
7045
7057
|
] }),
|
|
7046
|
-
(organizationError || error) && /* @__PURE__ */
|
|
7058
|
+
(organizationError || error) && /* @__PURE__ */ jsxs53("div", { className: "ba-inline-error", children: [
|
|
7047
7059
|
/* @__PURE__ */ jsx58(FormError, { children: organizationError ?? error }),
|
|
7048
7060
|
organizationError && /* @__PURE__ */ jsx58("button", { className: "ba-link-button", type: "button", onClick: () => void refresh(), children: t("organization.retry") })
|
|
7049
7061
|
] }),
|
|
7050
|
-
isLoading ? /* @__PURE__ */
|
|
7062
|
+
isLoading ? /* @__PURE__ */ jsxs53("div", { className: "ba-organization-card-grid", children: [
|
|
7051
7063
|
/* @__PURE__ */ jsx58("div", { className: "ba-skeleton" }),
|
|
7052
7064
|
/* @__PURE__ */ jsx58("div", { className: "ba-skeleton" })
|
|
7053
|
-
] }) : organizations?.length ? /* @__PURE__ */ jsx58("ul", { className: "ba-organization-card-grid", children: organizations.map((organization) => /* @__PURE__ */
|
|
7065
|
+
] }) : organizations?.length ? /* @__PURE__ */ jsx58("ul", { className: "ba-organization-card-grid", children: organizations.map((organization) => /* @__PURE__ */ jsxs53("li", { className: "ba-organization-card", children: [
|
|
7054
7066
|
/* @__PURE__ */ jsx58("span", { className: "ba-organization-avatar ba-organization-avatar-large", "aria-hidden": "true", children: organization.name.trim().charAt(0).toUpperCase() || "?" }),
|
|
7055
|
-
/* @__PURE__ */
|
|
7067
|
+
/* @__PURE__ */ jsxs53("span", { className: "ba-organization-card-copy", children: [
|
|
7056
7068
|
/* @__PURE__ */ jsx58("strong", { children: organization.name }),
|
|
7057
7069
|
/* @__PURE__ */ jsx58("small", { children: /* @__PURE__ */ jsx58(Bidi, { children: organization.slug }) })
|
|
7058
7070
|
] }),
|
|
7059
7071
|
activeId === organization.id && /* @__PURE__ */ jsx58("span", { className: "ba-organization-active", children: t("organization.list.active") }),
|
|
7060
|
-
/* @__PURE__ */
|
|
7072
|
+
/* @__PURE__ */ jsxs53("span", { className: "ba-organization-card-actions", children: [
|
|
7061
7073
|
activeId !== organization.id && /* @__PURE__ */ jsx58("button", { className: "ba-button ba-button-secondary", type: "button", disabled: pending, onClick: () => setActive(organization), children: t("organization.list.switch") }),
|
|
7062
7074
|
/* @__PURE__ */ jsx58("button", { className: "ba-link-button", type: "button", onClick: (event) => openProfile(organization, event.currentTarget), children: t("organization.list.manage") })
|
|
7063
7075
|
] })
|
|
7064
7076
|
] }, organization.id)) }) : /* @__PURE__ */ jsx58("p", { className: "ba-muted", children: t("organization.list.empty") }),
|
|
7065
|
-
/* @__PURE__ */
|
|
7066
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsxs53("section", { className: "ba-organization-user-invitations", children: [
|
|
7078
|
+
/* @__PURE__ */ jsxs53("header", { className: "ba-organization-section-header", children: [
|
|
7067
7079
|
/* @__PURE__ */ jsx58("h3", { className: "ba-title", children: t("organization.list.invitationsTitle") }),
|
|
7068
7080
|
/* @__PURE__ */ jsx58("p", { className: "ba-muted", children: t("organization.list.invitationsDescription") })
|
|
7069
7081
|
] }),
|
|
7070
|
-
invitationError && /* @__PURE__ */
|
|
7082
|
+
invitationError && /* @__PURE__ */ jsxs53("div", { className: "ba-inline-error", children: [
|
|
7071
7083
|
/* @__PURE__ */ jsx58(FormError, { children: invitationError }),
|
|
7072
7084
|
/* @__PURE__ */ jsx58("button", { className: "ba-link-button", type: "button", onClick: () => void loadInvitations(), children: t("organization.retry") })
|
|
7073
7085
|
] }),
|
|
7074
|
-
invitations === null && !invitationError ? /* @__PURE__ */ jsx58("div", { className: "ba-skeleton" }) : invitations?.length ? /* @__PURE__ */ jsx58("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */
|
|
7075
|
-
/* @__PURE__ */
|
|
7086
|
+
invitations === null && !invitationError ? /* @__PURE__ */ jsx58("div", { className: "ba-skeleton" }) : invitations?.length ? /* @__PURE__ */ jsx58("ul", { className: "ba-organization-list", children: invitations.map((invitation) => /* @__PURE__ */ jsxs53("li", { className: "ba-organization-invitation", children: [
|
|
7087
|
+
/* @__PURE__ */ jsxs53("span", { children: [
|
|
7076
7088
|
/* @__PURE__ */ jsx58("strong", { children: invitation.organizationName }),
|
|
7077
7089
|
/* @__PURE__ */ jsx58("small", { children: organizationRoleLabel(invitation.role, t) })
|
|
7078
7090
|
] }),
|
|
7079
|
-
/* @__PURE__ */
|
|
7091
|
+
/* @__PURE__ */ jsxs53("span", { className: "ba-organization-card-actions", children: [
|
|
7080
7092
|
/* @__PURE__ */ jsx58("button", { className: "ba-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "accept"), children: t("organization.list.accept") }),
|
|
7081
7093
|
/* @__PURE__ */ jsx58("button", { className: "ba-link-button", type: "button", disabled: pending, onClick: () => invitationAction(invitation, "reject"), children: t("organization.list.reject") })
|
|
7082
7094
|
] })
|
package/dist/styles.css
CHANGED
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
tab - Profile, an avatar field and a button - is the one most people open
|
|
207
207
|
first, and it left roughly 200px of empty white below the content, reading as
|
|
208
208
|
a broken panel rather than a stable one. */
|
|
209
|
-
.ba-profile-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr);
|
|
209
|
+
.ba-profile-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
|
|
210
210
|
.ba-profile-nav { display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; border-inline-end: 1px solid var(--ba-divider); background: color-mix(in srgb, var(--ba-hover) 55%, var(--ba-surface)); }
|
|
211
211
|
.ba-profile-nav-item { width: 100%; min-height: 40px; padding: 9px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ba-muted); cursor: pointer; font: inherit; font-weight: 500; text-align: start; }
|
|
212
212
|
.ba-profile-nav-item:hover { color: var(--ba-fg); background: var(--ba-hover); }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authowl/react",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.7",
|
|
4
4
|
"description": "React provider, hooks, and drop-in components for AuthOwl, the multi-tenant auth SaaS.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"LICENSE"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@authowl/core": "0.15.
|
|
50
|
+
"@authowl/core": "0.15.3"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": ">=18",
|