@krak-stack/auth 0.2.5 → 0.2.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.
|
@@ -492,7 +492,7 @@ const organizationDisplay = (organization, m, baseUrl) => {
|
|
|
492
492
|
name: translation?.name ||
|
|
493
493
|
organization?.name ||
|
|
494
494
|
m.organization_switcher_label(),
|
|
495
|
-
subtitle: organization?.slug ??
|
|
495
|
+
subtitle: organization?.slug ?? "",
|
|
496
496
|
image: assetUrl(translation?.icon || translation?.logo, baseUrl),
|
|
497
497
|
};
|
|
498
498
|
};
|
|
@@ -732,8 +732,7 @@ export function OrganizationSwitcher({ baseUrl: providedBaseUrl, side = "bottom"
|
|
|
732
732
|
onFailure: () => null,
|
|
733
733
|
onSuccess: ({ value }) => value,
|
|
734
734
|
});
|
|
735
|
-
const
|
|
736
|
-
const activeOrganizationAtom = activeAuthOrganizationAtom(baseUrl)(activeOrganizationId);
|
|
735
|
+
const activeOrganizationAtom = activeAuthOrganizationAtom(baseUrl)(null);
|
|
737
736
|
const activeOrganizationResult = useAtomValue(activeOrganizationAtom);
|
|
738
737
|
const activeOrganization = AsyncResult.match(activeOrganizationResult, {
|
|
739
738
|
onInitial: () => null,
|
|
@@ -809,6 +808,8 @@ export function OrganizationSwitcher({ baseUrl: providedBaseUrl, side = "bottom"
|
|
|
809
808
|
}
|
|
810
809
|
const active = activeOrganization;
|
|
811
810
|
const activeName = active?.name;
|
|
811
|
+
const activeLoading = activeOrganizationResult._tag === "Initial" ||
|
|
812
|
+
activeOrganizationResult.waiting;
|
|
812
813
|
const visibleOrganizations = organizations.filter((organization) => !allowedOrganizationIds ||
|
|
813
814
|
allowedOrganizationIds.includes(organization.id));
|
|
814
815
|
const selectableOrganizations = canSwitchOrganizations
|
|
@@ -837,7 +838,9 @@ export function OrganizationSwitcher({ baseUrl: providedBaseUrl, side = "bottom"
|
|
|
837
838
|
const activeSubtitle = organizationSwitcherSubtitle(active ?? null, activeDisplay.subtitle, m);
|
|
838
839
|
return (_jsxs(OrganizationMessagesContext.Provider, { value: m, children: [hideTrigger ? null : (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { render: _jsxs(Button, { variant: "ghost", className: cn("h-11 w-full justify-between gap-2 !px-1 !py-0 group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:justify-start group-data-[collapsible=icon]:!p-0", className), children: [_jsx(AppBrand, { to: null, label: activeName
|
|
839
840
|
? activeDisplay.name
|
|
840
|
-
:
|
|
841
|
+
: activeLoading
|
|
842
|
+
? m.organization_loading()
|
|
843
|
+
: m.organization_switcher_label(), subtitle: activeSubtitle, icon: Building2, variant: "sidebar", className: "min-w-0 flex-1 !p-0 text-left group-data-[collapsible=icon]:flex-none group-data-[collapsible=icon]:justify-start", ...(activeDisplay.image
|
|
841
844
|
? { imageSrc: activeDisplay.image }
|
|
842
845
|
: {}) }), _jsx(ChevronsUpDown, { className: "text-muted-foreground size-4 shrink-0 group-data-[collapsible=icon]:hidden" })] }) }), _jsx(DropdownMenuContent, { className: "max-w-[calc(100vw-1rem)] min-w-64 rounded-lg", side: side, align: "end", sideOffset: 4, children: _jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuLabel, { className: "p-0 font-normal", children: _jsx(AppBrand, { to: null, label: activeDisplay.name, subtitle: activeSubtitle, icon: Building2, variant: "sidebar", className: "px-1 py-1.5 text-left text-sm", ...(activeDisplay.image
|
|
843
846
|
? { imageSrc: activeDisplay.image }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krak-stack/auth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Effect HttpApi clients and schemas for KrakStack Auth.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -74,27 +74,20 @@
|
|
|
74
74
|
"prepack": "bun run build",
|
|
75
75
|
"type:check": "tsc -p tsconfig.json --noEmit"
|
|
76
76
|
},
|
|
77
|
-
"
|
|
77
|
+
"dependencies": {
|
|
78
78
|
"@effect/atom-react": "4.0.0-rc.112",
|
|
79
79
|
"@krak-stack/registry": "^0.1.25",
|
|
80
80
|
"@lucas-barake/effect-form-react": "^0.26.0-beta.5",
|
|
81
|
+
"react-qr-code": "^2.2.0"
|
|
82
|
+
},
|
|
83
|
+
"peerDependencies": {
|
|
81
84
|
"@tanstack/react-router": "^1.170.15",
|
|
82
85
|
"effect": "4.0.0-rc.112",
|
|
83
|
-
"input-otp": "^1.
|
|
86
|
+
"input-otp": "^1.5.0",
|
|
84
87
|
"lucide-react": "^1.18.0",
|
|
85
|
-
"react": "^19.2.0"
|
|
86
|
-
"react-qr-code": "^2.2.0"
|
|
88
|
+
"react": "^19.2.0"
|
|
87
89
|
},
|
|
88
90
|
"peerDependenciesMeta": {
|
|
89
|
-
"@effect/atom-react": {
|
|
90
|
-
"optional": true
|
|
91
|
-
},
|
|
92
|
-
"@krak-stack/registry": {
|
|
93
|
-
"optional": true
|
|
94
|
-
},
|
|
95
|
-
"@lucas-barake/effect-form-react": {
|
|
96
|
-
"optional": true
|
|
97
|
-
},
|
|
98
91
|
"@tanstack/react-router": {
|
|
99
92
|
"optional": true
|
|
100
93
|
},
|
|
@@ -106,9 +99,6 @@
|
|
|
106
99
|
},
|
|
107
100
|
"react": {
|
|
108
101
|
"optional": true
|
|
109
|
-
},
|
|
110
|
-
"react-qr-code": {
|
|
111
|
-
"optional": true
|
|
112
102
|
}
|
|
113
103
|
}
|
|
114
104
|
}
|