@omnibase/shadcn 0.6.2 → 0.7.2
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 +265 -229
- package/dist/index.d.cts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.js +264 -229
- package/package.json +7 -3
package/dist/index.js
CHANGED
|
@@ -860,6 +860,27 @@ function SettingsForm({ flow }) {
|
|
|
860
860
|
] });
|
|
861
861
|
}
|
|
862
862
|
|
|
863
|
+
// src/form/error.tsx
|
|
864
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
865
|
+
function ErrorForm({
|
|
866
|
+
error,
|
|
867
|
+
login_url = "/auth/login",
|
|
868
|
+
Header
|
|
869
|
+
}) {
|
|
870
|
+
const errorDetails = error.error;
|
|
871
|
+
return /* @__PURE__ */ jsx19("div", { children: /* @__PURE__ */ jsxs10(Card, { className: "w-full max-w-md mx-auto", children: [
|
|
872
|
+
Header && /* @__PURE__ */ jsx19(CardHeader, { children: /* @__PURE__ */ jsx19(CardTitle, { className: "text-center pb-1", children: Header }) }),
|
|
873
|
+
/* @__PURE__ */ jsxs10(CardContent, { className: "space-y-4", children: [
|
|
874
|
+
/* @__PURE__ */ jsxs10(Alert, { variant: "destructive", children: [
|
|
875
|
+
/* @__PURE__ */ jsx19(AlertTitle, { children: errorDetails?.status || "Authentication Error" }),
|
|
876
|
+
/* @__PURE__ */ jsx19(AlertDescription, { children: errorDetails?.message || "An unexpected error occurred." })
|
|
877
|
+
] }),
|
|
878
|
+
errorDetails?.reason && /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: errorDetails.reason }),
|
|
879
|
+
/* @__PURE__ */ jsx19(Button, { asChild: true, className: "w-full", children: /* @__PURE__ */ jsx19("a", { href: login_url, children: "Back to Login" }) })
|
|
880
|
+
] })
|
|
881
|
+
] }) });
|
|
882
|
+
}
|
|
883
|
+
|
|
863
884
|
// src/tenant-switcher/index.tsx
|
|
864
885
|
import * as React10 from "react";
|
|
865
886
|
|
|
@@ -867,10 +888,10 @@ import * as React10 from "react";
|
|
|
867
888
|
import * as React9 from "react";
|
|
868
889
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
869
890
|
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
870
|
-
import { jsx as
|
|
891
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
871
892
|
var Select = SelectPrimitive.Root;
|
|
872
893
|
var SelectValue = SelectPrimitive.Value;
|
|
873
|
-
var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
894
|
+
var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
874
895
|
SelectPrimitive.Trigger,
|
|
875
896
|
{
|
|
876
897
|
ref,
|
|
@@ -881,12 +902,12 @@ var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) =
|
|
|
881
902
|
...props,
|
|
882
903
|
children: [
|
|
883
904
|
children,
|
|
884
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ jsx20(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx20(ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
885
906
|
]
|
|
886
907
|
}
|
|
887
908
|
));
|
|
888
909
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
889
|
-
var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
910
|
+
var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
890
911
|
SelectPrimitive.ScrollUpButton,
|
|
891
912
|
{
|
|
892
913
|
ref,
|
|
@@ -895,11 +916,11 @@ var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /
|
|
|
895
916
|
className
|
|
896
917
|
),
|
|
897
918
|
...props,
|
|
898
|
-
children: /* @__PURE__ */
|
|
919
|
+
children: /* @__PURE__ */ jsx20(ChevronUp, { className: "h-4 w-4" })
|
|
899
920
|
}
|
|
900
921
|
));
|
|
901
922
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
902
|
-
var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
923
|
+
var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
903
924
|
SelectPrimitive.ScrollDownButton,
|
|
904
925
|
{
|
|
905
926
|
ref,
|
|
@@ -908,11 +929,11 @@ var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) =>
|
|
|
908
929
|
className
|
|
909
930
|
),
|
|
910
931
|
...props,
|
|
911
|
-
children: /* @__PURE__ */
|
|
932
|
+
children: /* @__PURE__ */ jsx20(ChevronDown, { className: "h-4 w-4" })
|
|
912
933
|
}
|
|
913
934
|
));
|
|
914
935
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
915
|
-
var SelectContent = React9.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */
|
|
936
|
+
var SelectContent = React9.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx20(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs11(
|
|
916
937
|
SelectPrimitive.Content,
|
|
917
938
|
{
|
|
918
939
|
ref,
|
|
@@ -924,8 +945,8 @@ var SelectContent = React9.forwardRef(({ className, children, position = "popper
|
|
|
924
945
|
position,
|
|
925
946
|
...props,
|
|
926
947
|
children: [
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ jsx20(SelectScrollUpButton, {}),
|
|
949
|
+
/* @__PURE__ */ jsx20(
|
|
929
950
|
SelectPrimitive.Viewport,
|
|
930
951
|
{
|
|
931
952
|
className: cn(
|
|
@@ -935,12 +956,12 @@ var SelectContent = React9.forwardRef(({ className, children, position = "popper
|
|
|
935
956
|
children
|
|
936
957
|
}
|
|
937
958
|
),
|
|
938
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ jsx20(SelectScrollDownButton, {})
|
|
939
960
|
]
|
|
940
961
|
}
|
|
941
962
|
) }));
|
|
942
963
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
943
|
-
var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
964
|
+
var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
944
965
|
SelectPrimitive.Label,
|
|
945
966
|
{
|
|
946
967
|
ref,
|
|
@@ -949,7 +970,7 @@ var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
949
970
|
}
|
|
950
971
|
));
|
|
951
972
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
952
|
-
var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
973
|
+
var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs11(
|
|
953
974
|
SelectPrimitive.Item,
|
|
954
975
|
{
|
|
955
976
|
ref,
|
|
@@ -959,13 +980,13 @@ var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
959
980
|
),
|
|
960
981
|
...props,
|
|
961
982
|
children: [
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ jsx20("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx20(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx20(Check, { className: "h-4 w-4" }) }) }),
|
|
984
|
+
/* @__PURE__ */ jsx20(SelectPrimitive.ItemText, { children })
|
|
964
985
|
]
|
|
965
986
|
}
|
|
966
987
|
));
|
|
967
988
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
968
|
-
var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
989
|
+
var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
969
990
|
SelectPrimitive.Separator,
|
|
970
991
|
{
|
|
971
992
|
ref,
|
|
@@ -976,24 +997,31 @@ var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
976
997
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
977
998
|
|
|
978
999
|
// src/tenant-switcher/index.tsx
|
|
979
|
-
import { jsx as
|
|
1000
|
+
import { Fragment, jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1001
|
+
var CREATE_TENANT_VALUE = "__create_tenant__";
|
|
980
1002
|
function SwitchActiveTenant({
|
|
981
1003
|
tenants,
|
|
982
1004
|
currentTenantId,
|
|
983
1005
|
formAction,
|
|
984
1006
|
placeholder = "Select tenant...",
|
|
985
1007
|
className,
|
|
986
|
-
onTenantChange
|
|
1008
|
+
onTenantChange,
|
|
1009
|
+
onCreateTenant,
|
|
1010
|
+
createTenantLabel = "Create Tenant"
|
|
987
1011
|
}) {
|
|
988
1012
|
const [isLoading, setIsLoading] = React10.useState(false);
|
|
989
|
-
const handleTenantChange = async (
|
|
990
|
-
if (
|
|
1013
|
+
const handleTenantChange = async (value) => {
|
|
1014
|
+
if (value === CREATE_TENANT_VALUE) {
|
|
1015
|
+
onCreateTenant?.();
|
|
1016
|
+
return;
|
|
1017
|
+
}
|
|
1018
|
+
if (value === currentTenantId) return;
|
|
991
1019
|
setIsLoading(true);
|
|
992
1020
|
try {
|
|
993
|
-
onTenantChange?.(
|
|
1021
|
+
onTenantChange?.(value);
|
|
994
1022
|
if (formAction) {
|
|
995
1023
|
const formData = new FormData();
|
|
996
|
-
formData.append("tenant_id",
|
|
1024
|
+
formData.append("tenant_id", value);
|
|
997
1025
|
await formAction(formData);
|
|
998
1026
|
}
|
|
999
1027
|
} catch (error) {
|
|
@@ -1003,15 +1031,21 @@ function SwitchActiveTenant({
|
|
|
1003
1031
|
}
|
|
1004
1032
|
};
|
|
1005
1033
|
const currentTenant = tenants.find((tenant) => tenant.id === currentTenantId);
|
|
1006
|
-
return /* @__PURE__ */
|
|
1034
|
+
return /* @__PURE__ */ jsxs12(
|
|
1007
1035
|
Select,
|
|
1008
1036
|
{
|
|
1009
1037
|
value: currentTenantId,
|
|
1010
1038
|
onValueChange: handleTenantChange,
|
|
1011
1039
|
disabled: isLoading,
|
|
1012
1040
|
children: [
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
1041
|
+
/* @__PURE__ */ jsx21(SelectTrigger, { className: cn("max-w-64", className), children: /* @__PURE__ */ jsx21(SelectValue, { placeholder, children: currentTenant ? currentTenant.name : placeholder }) }),
|
|
1042
|
+
/* @__PURE__ */ jsxs12(SelectContent, { children: [
|
|
1043
|
+
tenants.map((tenant) => /* @__PURE__ */ jsx21(SelectItem, { value: tenant.id, children: tenant.name }, tenant.id)),
|
|
1044
|
+
onCreateTenant && /* @__PURE__ */ jsxs12(Fragment, { children: [
|
|
1045
|
+
/* @__PURE__ */ jsx21(SelectSeparator, {}),
|
|
1046
|
+
/* @__PURE__ */ jsx21(SelectItem, { value: CREATE_TENANT_VALUE, children: createTenantLabel })
|
|
1047
|
+
] })
|
|
1048
|
+
] })
|
|
1015
1049
|
]
|
|
1016
1050
|
}
|
|
1017
1051
|
);
|
|
@@ -1020,7 +1054,7 @@ function SwitchActiveTenant({
|
|
|
1020
1054
|
// src/pricing-table/index.tsx
|
|
1021
1055
|
import * as React11 from "react";
|
|
1022
1056
|
import { Check as Check2, Star, ChevronLeft, ChevronRight } from "lucide-react";
|
|
1023
|
-
import { Fragment, jsx as
|
|
1057
|
+
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1024
1058
|
var getCurrencySymbol = (currency) => {
|
|
1025
1059
|
const symbols = {
|
|
1026
1060
|
USD: "$",
|
|
@@ -1060,7 +1094,7 @@ function PricingCard({
|
|
|
1060
1094
|
}) {
|
|
1061
1095
|
const ui = product.ui || {};
|
|
1062
1096
|
const isHighlighted = ui.highlighted;
|
|
1063
|
-
return /* @__PURE__ */
|
|
1097
|
+
return /* @__PURE__ */ jsxs13(
|
|
1064
1098
|
"div",
|
|
1065
1099
|
{
|
|
1066
1100
|
className: cn(
|
|
@@ -1068,11 +1102,11 @@ function PricingCard({
|
|
|
1068
1102
|
isHighlighted ? "relative" : ""
|
|
1069
1103
|
),
|
|
1070
1104
|
children: [
|
|
1071
|
-
/* @__PURE__ */
|
|
1072
|
-
ui.badge === "Most Popular" && /* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ jsx22("div", { className: "h-4 flex-shrink-0 relative", children: ui.badge && /* @__PURE__ */ jsx22("div", { className: "absolute top-0 left-1/2 transform -translate-x-1/2 z-10", children: /* @__PURE__ */ jsxs13("div", { className: "bg-primary text-primary-foreground px-3 py-1 rounded-full text-sm font-medium flex items-center gap-1 whitespace-nowrap shadow-md", children: [
|
|
1106
|
+
ui.badge === "Most Popular" && /* @__PURE__ */ jsx22(Star, { className: "w-3 h-3" }),
|
|
1073
1107
|
ui.badge
|
|
1074
1108
|
] }) }) }),
|
|
1075
|
-
/* @__PURE__ */
|
|
1109
|
+
/* @__PURE__ */ jsxs13(
|
|
1076
1110
|
Card,
|
|
1077
1111
|
{
|
|
1078
1112
|
className: cn(
|
|
@@ -1081,35 +1115,35 @@ function PricingCard({
|
|
|
1081
1115
|
isSelected && "ring-2 ring-primary"
|
|
1082
1116
|
),
|
|
1083
1117
|
children: [
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
ui.tagline && /* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ jsxs13(CardHeader, { className: "text-center", children: [
|
|
1119
|
+
/* @__PURE__ */ jsx22(CardTitle, { className: "text-xl font-bold", children: ui.displayName || product.name }),
|
|
1120
|
+
ui.tagline && /* @__PURE__ */ jsx22(CardDescription, { className: "text-base", children: ui.tagline })
|
|
1087
1121
|
] }),
|
|
1088
|
-
/* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */
|
|
1090
|
-
/* @__PURE__ */
|
|
1091
|
-
/* @__PURE__ */
|
|
1122
|
+
/* @__PURE__ */ jsxs13(CardContent, { className: "flex-1 space-y-6", children: [
|
|
1123
|
+
/* @__PURE__ */ jsxs13("div", { className: "text-center", children: [
|
|
1124
|
+
/* @__PURE__ */ jsx22("div", { className: "text-3xl font-bold", children: formatPrice(displayedPrice) }),
|
|
1125
|
+
/* @__PURE__ */ jsx22("div", { className: "text-sm text-muted-foreground", children: formatBillingPeriod(displayedPrice) })
|
|
1092
1126
|
] }),
|
|
1093
|
-
(ui.features && ui.features.length > 0 || (displayedPrice.ui?.features?.length ?? 0) > 0 || (displayedPrice.ui?.limits?.length ?? 0) > 0) && /* @__PURE__ */
|
|
1094
|
-
ui.features && ui.features.length > 0 && /* @__PURE__ */
|
|
1095
|
-
/* @__PURE__ */
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
/* @__PURE__ */
|
|
1127
|
+
(ui.features && ui.features.length > 0 || (displayedPrice.ui?.features?.length ?? 0) > 0 || (displayedPrice.ui?.limits?.length ?? 0) > 0) && /* @__PURE__ */ jsxs13("div", { className: "space-y-4", children: [
|
|
1128
|
+
ui.features && ui.features.length > 0 && /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
|
|
1129
|
+
/* @__PURE__ */ jsx22("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Features" }),
|
|
1130
|
+
/* @__PURE__ */ jsx22("ul", { className: "space-y-2", children: ui.features.map((feature, index) => /* @__PURE__ */ jsxs13("li", { className: "flex items-start gap-2", children: [
|
|
1131
|
+
/* @__PURE__ */ jsx22(Check2, { className: "w-4 h-4 text-green-500 mt-0.5 flex-shrink-0" }),
|
|
1132
|
+
/* @__PURE__ */ jsx22("span", { className: "text-sm", children: feature })
|
|
1099
1133
|
] }, index)) })
|
|
1100
1134
|
] }),
|
|
1101
|
-
displayedPrice.ui?.features && displayedPrice.ui.features.length > 0 && /* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
(feature, index) => /* @__PURE__ */
|
|
1105
|
-
/* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1135
|
+
displayedPrice.ui?.features && displayedPrice.ui.features.length > 0 && /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
|
|
1136
|
+
/* @__PURE__ */ jsx22("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "This Plan" }),
|
|
1137
|
+
/* @__PURE__ */ jsx22("ul", { className: "space-y-2", children: displayedPrice.ui.features.map(
|
|
1138
|
+
(feature, index) => /* @__PURE__ */ jsxs13("li", { className: "flex items-start gap-2", children: [
|
|
1139
|
+
/* @__PURE__ */ jsx22(Check2, { className: "w-4 h-4 text-blue-500 mt-0.5 flex-0" }),
|
|
1140
|
+
/* @__PURE__ */ jsx22("span", { className: "text-sm", children: feature })
|
|
1107
1141
|
] }, index)
|
|
1108
1142
|
) })
|
|
1109
1143
|
] }),
|
|
1110
|
-
displayedPrice.ui?.limits && displayedPrice.ui.limits.length > 0 && /* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1144
|
+
displayedPrice.ui?.limits && displayedPrice.ui.limits.length > 0 && /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
|
|
1145
|
+
/* @__PURE__ */ jsx22("h4", { className: "font-medium text-sm text-muted-foreground uppercase tracking-wide", children: "Usage Limits" }),
|
|
1146
|
+
/* @__PURE__ */ jsx22("ul", { className: "space-y-1", children: displayedPrice.ui.limits.map((limit, index) => /* @__PURE__ */ jsx22(
|
|
1113
1147
|
"li",
|
|
1114
1148
|
{
|
|
1115
1149
|
className: "text-sm text-muted-foreground",
|
|
@@ -1120,7 +1154,7 @@ function PricingCard({
|
|
|
1120
1154
|
] })
|
|
1121
1155
|
] })
|
|
1122
1156
|
] }),
|
|
1123
|
-
/* @__PURE__ */
|
|
1157
|
+
/* @__PURE__ */ jsx22(CardFooter, { children: /* @__PURE__ */ jsx22(
|
|
1124
1158
|
Button,
|
|
1125
1159
|
{
|
|
1126
1160
|
className: "w-full",
|
|
@@ -1164,7 +1198,7 @@ function PricingTable({
|
|
|
1164
1198
|
const getDisplayedPrice = (product) => product.prices.find((price) => price.interval === selectedInterval) || product.prices[0];
|
|
1165
1199
|
const renderCard = (product) => {
|
|
1166
1200
|
const displayedPrice = getDisplayedPrice(product);
|
|
1167
|
-
return /* @__PURE__ */
|
|
1201
|
+
return /* @__PURE__ */ jsx22(
|
|
1168
1202
|
PricingCard,
|
|
1169
1203
|
{
|
|
1170
1204
|
product,
|
|
@@ -1174,8 +1208,8 @@ function PricingTable({
|
|
|
1174
1208
|
}
|
|
1175
1209
|
);
|
|
1176
1210
|
};
|
|
1177
|
-
const desktopCarousel = /* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */
|
|
1211
|
+
const desktopCarousel = /* @__PURE__ */ jsxs13("div", { className: "relative max-w-7xl mx-auto", children: [
|
|
1212
|
+
/* @__PURE__ */ jsx22(
|
|
1179
1213
|
Button,
|
|
1180
1214
|
{
|
|
1181
1215
|
variant: "ghost",
|
|
@@ -1183,15 +1217,15 @@ function PricingTable({
|
|
|
1183
1217
|
className: "absolute left-0 top-1/2 transform -translate-y-1/2 -translate-x-4 z-10 bg-white shadow-lg border hover:bg-gray-50 disabled:opacity-50",
|
|
1184
1218
|
onClick: () => setCarouselIndex(Math.max(0, carouselIndex - 1)),
|
|
1185
1219
|
disabled: carouselIndex === 0,
|
|
1186
|
-
children: /* @__PURE__ */
|
|
1220
|
+
children: /* @__PURE__ */ jsx22(ChevronLeft, { className: "w-4 h-4" })
|
|
1187
1221
|
}
|
|
1188
1222
|
),
|
|
1189
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ jsx22(
|
|
1190
1224
|
"div",
|
|
1191
1225
|
{
|
|
1192
1226
|
className: "overflow-hidden mx-auto",
|
|
1193
1227
|
style: { width: `${3 * CARD_WIDTH + 2 * GAP}px` },
|
|
1194
|
-
children: /* @__PURE__ */
|
|
1228
|
+
children: /* @__PURE__ */ jsx22(
|
|
1195
1229
|
"div",
|
|
1196
1230
|
{
|
|
1197
1231
|
className: "flex items-stretch transition-transform duration-300 ease-in-out",
|
|
@@ -1199,7 +1233,7 @@ function PricingTable({
|
|
|
1199
1233
|
transform: `translateX(-${carouselIndex * (CARD_WIDTH + GAP)}px)`,
|
|
1200
1234
|
gap: `${GAP}px`
|
|
1201
1235
|
},
|
|
1202
|
-
children: sortedProducts.map((p) => /* @__PURE__ */
|
|
1236
|
+
children: sortedProducts.map((p) => /* @__PURE__ */ jsx22(
|
|
1203
1237
|
"div",
|
|
1204
1238
|
{
|
|
1205
1239
|
style: { width: `${CARD_WIDTH}px` },
|
|
@@ -1212,7 +1246,7 @@ function PricingTable({
|
|
|
1212
1246
|
)
|
|
1213
1247
|
}
|
|
1214
1248
|
),
|
|
1215
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ jsx22(
|
|
1216
1250
|
Button,
|
|
1217
1251
|
{
|
|
1218
1252
|
variant: "ghost",
|
|
@@ -1222,12 +1256,12 @@ function PricingTable({
|
|
|
1222
1256
|
Math.min(sortedProducts.length - 3, carouselIndex + 1)
|
|
1223
1257
|
),
|
|
1224
1258
|
disabled: carouselIndex >= sortedProducts.length - 3,
|
|
1225
|
-
children: /* @__PURE__ */
|
|
1259
|
+
children: /* @__PURE__ */ jsx22(ChevronRight, { className: "w-4 h-4" })
|
|
1226
1260
|
}
|
|
1227
1261
|
),
|
|
1228
|
-
/* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ jsx22("div", { className: "flex justify-center mt-6 space-x-2", children: Array.from(
|
|
1229
1263
|
{ length: Math.max(1, sortedProducts.length - 2) },
|
|
1230
|
-
(_, i) => /* @__PURE__ */
|
|
1264
|
+
(_, i) => /* @__PURE__ */ jsx22(
|
|
1231
1265
|
"button",
|
|
1232
1266
|
{
|
|
1233
1267
|
onClick: () => setCarouselIndex(i),
|
|
@@ -1241,12 +1275,12 @@ function PricingTable({
|
|
|
1241
1275
|
)
|
|
1242
1276
|
) })
|
|
1243
1277
|
] });
|
|
1244
|
-
const staticLayout = /* @__PURE__ */
|
|
1278
|
+
const staticLayout = /* @__PURE__ */ jsx22(
|
|
1245
1279
|
"div",
|
|
1246
1280
|
{
|
|
1247
1281
|
className: "flex flex-row items-stretch justify-center",
|
|
1248
1282
|
style: { gap: `${GAP}px` },
|
|
1249
|
-
children: sortedProducts.map((p) => /* @__PURE__ */
|
|
1283
|
+
children: sortedProducts.map((p) => /* @__PURE__ */ jsx22(
|
|
1250
1284
|
"div",
|
|
1251
1285
|
{
|
|
1252
1286
|
style: { width: `${CARD_WIDTH}px` },
|
|
@@ -1257,9 +1291,9 @@ function PricingTable({
|
|
|
1257
1291
|
))
|
|
1258
1292
|
}
|
|
1259
1293
|
);
|
|
1260
|
-
return /* @__PURE__ */
|
|
1261
|
-
showPricingToggle && hasMultipleIntervals && /* @__PURE__ */
|
|
1262
|
-
/* @__PURE__ */
|
|
1294
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn("w-full", className), children: [
|
|
1295
|
+
showPricingToggle && hasMultipleIntervals && /* @__PURE__ */ jsx22("div", { className: "flex justify-center mb-4", children: /* @__PURE__ */ jsxs13("div", { className: "flex bg-gray-100 p-1 rounded-lg", children: [
|
|
1296
|
+
/* @__PURE__ */ jsx22(
|
|
1263
1297
|
Button,
|
|
1264
1298
|
{
|
|
1265
1299
|
variant: selectedInterval === "month" ? "default" : "ghost",
|
|
@@ -1269,7 +1303,7 @@ function PricingTable({
|
|
|
1269
1303
|
children: "Monthly"
|
|
1270
1304
|
}
|
|
1271
1305
|
),
|
|
1272
|
-
/* @__PURE__ */
|
|
1306
|
+
/* @__PURE__ */ jsx22(
|
|
1273
1307
|
Button,
|
|
1274
1308
|
{
|
|
1275
1309
|
variant: selectedInterval === "year" ? "default" : "ghost",
|
|
@@ -1280,20 +1314,20 @@ function PricingTable({
|
|
|
1280
1314
|
}
|
|
1281
1315
|
)
|
|
1282
1316
|
] }) }),
|
|
1283
|
-
/* @__PURE__ */
|
|
1284
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ jsxs13("div", { className: "lg:hidden relative", children: [
|
|
1318
|
+
/* @__PURE__ */ jsx22(
|
|
1285
1319
|
"div",
|
|
1286
1320
|
{
|
|
1287
1321
|
className: "overflow-hidden mx-auto",
|
|
1288
1322
|
style: { width: `${CARD_WIDTH}px` },
|
|
1289
|
-
children: /* @__PURE__ */
|
|
1323
|
+
children: /* @__PURE__ */ jsx22(
|
|
1290
1324
|
"div",
|
|
1291
1325
|
{
|
|
1292
1326
|
className: "flex transition-transform duration-300 ease-in-out items-stretch",
|
|
1293
1327
|
style: {
|
|
1294
1328
|
transform: `translateX(-${carouselIndex * CARD_WIDTH}px)`
|
|
1295
1329
|
},
|
|
1296
|
-
children: sortedProducts.map((product) => /* @__PURE__ */
|
|
1330
|
+
children: sortedProducts.map((product) => /* @__PURE__ */ jsx22(
|
|
1297
1331
|
"div",
|
|
1298
1332
|
{
|
|
1299
1333
|
className: "flex-shrink-0",
|
|
@@ -1306,8 +1340,8 @@ function PricingTable({
|
|
|
1306
1340
|
)
|
|
1307
1341
|
}
|
|
1308
1342
|
),
|
|
1309
|
-
sortedProducts.length > 1 && /* @__PURE__ */
|
|
1310
|
-
/* @__PURE__ */
|
|
1343
|
+
sortedProducts.length > 1 && /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
1344
|
+
/* @__PURE__ */ jsx22(
|
|
1311
1345
|
Button,
|
|
1312
1346
|
{
|
|
1313
1347
|
variant: "ghost",
|
|
@@ -1315,10 +1349,10 @@ function PricingTable({
|
|
|
1315
1349
|
className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-2 z-10 bg-white shadow-lg border hover:bg-gray-50 disabled:opacity-50",
|
|
1316
1350
|
onClick: () => setCarouselIndex((prev) => Math.max(0, prev - 1)),
|
|
1317
1351
|
disabled: carouselIndex === 0,
|
|
1318
|
-
children: /* @__PURE__ */
|
|
1352
|
+
children: /* @__PURE__ */ jsx22(ChevronLeft, { className: "w-5 h-5" })
|
|
1319
1353
|
}
|
|
1320
1354
|
),
|
|
1321
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ jsx22(
|
|
1322
1356
|
Button,
|
|
1323
1357
|
{
|
|
1324
1358
|
variant: "ghost",
|
|
@@ -1328,10 +1362,10 @@ function PricingTable({
|
|
|
1328
1362
|
(prev) => Math.min(sortedProducts.length - 1, prev + 1)
|
|
1329
1363
|
),
|
|
1330
1364
|
disabled: carouselIndex >= sortedProducts.length - 1,
|
|
1331
|
-
children: /* @__PURE__ */
|
|
1365
|
+
children: /* @__PURE__ */ jsx22(ChevronRight, { className: "w-5 h-5" })
|
|
1332
1366
|
}
|
|
1333
1367
|
),
|
|
1334
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ jsx22("div", { className: "flex justify-center mt-6 space-x-2", children: Array.from({ length: sortedProducts.length }, (_, i) => /* @__PURE__ */ jsx22(
|
|
1335
1369
|
"button",
|
|
1336
1370
|
{
|
|
1337
1371
|
onClick: () => setCarouselIndex(i),
|
|
@@ -1345,13 +1379,13 @@ function PricingTable({
|
|
|
1345
1379
|
)) })
|
|
1346
1380
|
] })
|
|
1347
1381
|
] }),
|
|
1348
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ jsx22("div", { className: "hidden lg:block", children: sortedProducts.length <= 3 ? staticLayout : desktopCarousel })
|
|
1349
1383
|
] });
|
|
1350
1384
|
}
|
|
1351
1385
|
|
|
1352
1386
|
// src/tenant-creator/index.tsx
|
|
1353
1387
|
import { useState as useState4, useEffect as useEffect2 } from "react";
|
|
1354
|
-
import { jsx as
|
|
1388
|
+
import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1355
1389
|
function TenantCreator({
|
|
1356
1390
|
config = {},
|
|
1357
1391
|
formActions = {},
|
|
@@ -1400,14 +1434,14 @@ function TenantCreator({
|
|
|
1400
1434
|
setIsLoading(false);
|
|
1401
1435
|
}
|
|
1402
1436
|
};
|
|
1403
|
-
return /* @__PURE__ */
|
|
1404
|
-
/* @__PURE__ */
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1437
|
+
return /* @__PURE__ */ jsxs14(Card, { className: cn("w-full max-w-md mx-auto", className), children: [
|
|
1438
|
+
/* @__PURE__ */ jsxs14(CardHeader, { children: [
|
|
1439
|
+
/* @__PURE__ */ jsx23(CardTitle, { children: "Organization Setup" }),
|
|
1440
|
+
/* @__PURE__ */ jsx23(CardDescription, { children: "Choose how you want to get started with your organization." })
|
|
1407
1441
|
] }),
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1442
|
+
/* @__PURE__ */ jsxs14(CardContent, { className: "space-y-6", children: [
|
|
1443
|
+
/* @__PURE__ */ jsxs14("div", { className: "grid grid-cols-2 rounded-lg bg-muted p-1", children: [
|
|
1444
|
+
/* @__PURE__ */ jsxs14(
|
|
1411
1445
|
"label",
|
|
1412
1446
|
{
|
|
1413
1447
|
className: cn(
|
|
@@ -1416,7 +1450,7 @@ function TenantCreator({
|
|
|
1416
1450
|
isLoading && "pointer-events-none opacity-50"
|
|
1417
1451
|
),
|
|
1418
1452
|
children: [
|
|
1419
|
-
/* @__PURE__ */
|
|
1453
|
+
/* @__PURE__ */ jsx23(
|
|
1420
1454
|
"input",
|
|
1421
1455
|
{
|
|
1422
1456
|
type: "radio",
|
|
@@ -1432,7 +1466,7 @@ function TenantCreator({
|
|
|
1432
1466
|
]
|
|
1433
1467
|
}
|
|
1434
1468
|
),
|
|
1435
|
-
/* @__PURE__ */
|
|
1469
|
+
/* @__PURE__ */ jsxs14(
|
|
1436
1470
|
"label",
|
|
1437
1471
|
{
|
|
1438
1472
|
className: cn(
|
|
@@ -1441,7 +1475,7 @@ function TenantCreator({
|
|
|
1441
1475
|
isLoading && "pointer-events-none opacity-50"
|
|
1442
1476
|
),
|
|
1443
1477
|
children: [
|
|
1444
|
-
/* @__PURE__ */
|
|
1478
|
+
/* @__PURE__ */ jsx23(
|
|
1445
1479
|
"input",
|
|
1446
1480
|
{
|
|
1447
1481
|
type: "radio",
|
|
@@ -1458,10 +1492,10 @@ function TenantCreator({
|
|
|
1458
1492
|
}
|
|
1459
1493
|
)
|
|
1460
1494
|
] }),
|
|
1461
|
-
mode === "create" && /* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */
|
|
1495
|
+
mode === "create" && /* @__PURE__ */ jsxs14("form", { onSubmit: handleCreateSubmit, className: "space-y-4", children: [
|
|
1496
|
+
/* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
|
|
1497
|
+
/* @__PURE__ */ jsx23(Label, { htmlFor: "organizationName", children: config.createForm?.organizationName?.label || "Organization Name" }),
|
|
1498
|
+
/* @__PURE__ */ jsx23(
|
|
1465
1499
|
Input,
|
|
1466
1500
|
{
|
|
1467
1501
|
id: "organizationName",
|
|
@@ -1475,9 +1509,9 @@ function TenantCreator({
|
|
|
1475
1509
|
}
|
|
1476
1510
|
)
|
|
1477
1511
|
] }),
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
|
|
1513
|
+
/* @__PURE__ */ jsx23(Label, { htmlFor: "billingEmail", children: config.createForm?.billingEmail?.label || "Billing Email" }),
|
|
1514
|
+
/* @__PURE__ */ jsx23(
|
|
1481
1515
|
Input,
|
|
1482
1516
|
{
|
|
1483
1517
|
id: "billingEmail",
|
|
@@ -1491,12 +1525,12 @@ function TenantCreator({
|
|
|
1491
1525
|
}
|
|
1492
1526
|
)
|
|
1493
1527
|
] }),
|
|
1494
|
-
/* @__PURE__ */
|
|
1528
|
+
/* @__PURE__ */ jsx23(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? "Creating..." : "Create Organization" })
|
|
1495
1529
|
] }),
|
|
1496
|
-
mode === "join" && /* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
/* @__PURE__ */
|
|
1499
|
-
/* @__PURE__ */
|
|
1530
|
+
mode === "join" && /* @__PURE__ */ jsxs14("form", { onSubmit: handleJoinSubmit, className: "space-y-4", children: [
|
|
1531
|
+
/* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
|
|
1532
|
+
/* @__PURE__ */ jsx23(Label, { htmlFor: "token", children: config.joinForm?.token?.label || "Invitation Token" }),
|
|
1533
|
+
/* @__PURE__ */ jsx23(
|
|
1500
1534
|
Input,
|
|
1501
1535
|
{
|
|
1502
1536
|
id: "token",
|
|
@@ -1510,7 +1544,7 @@ function TenantCreator({
|
|
|
1510
1544
|
}
|
|
1511
1545
|
)
|
|
1512
1546
|
] }),
|
|
1513
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ jsx23(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? "Joining..." : "Join Organization" })
|
|
1514
1548
|
] })
|
|
1515
1549
|
] })
|
|
1516
1550
|
] });
|
|
@@ -1518,7 +1552,7 @@ function TenantCreator({
|
|
|
1518
1552
|
|
|
1519
1553
|
// src/user-invite/index.tsx
|
|
1520
1554
|
import { useState as useState5 } from "react";
|
|
1521
|
-
import { jsx as
|
|
1555
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1522
1556
|
function UserInvite({ roles, onInvite }) {
|
|
1523
1557
|
const [email, setEmail] = useState5("");
|
|
1524
1558
|
const [selectedRole, setSelectedRole] = useState5("");
|
|
@@ -1563,15 +1597,15 @@ function UserInvite({ roles, onInvite }) {
|
|
|
1563
1597
|
setSelectedRole("");
|
|
1564
1598
|
setError(null);
|
|
1565
1599
|
};
|
|
1566
|
-
return /* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1600
|
+
return /* @__PURE__ */ jsxs15(Card, { className: "w-full max-w-2xl", children: [
|
|
1601
|
+
/* @__PURE__ */ jsxs15(CardHeader, { children: [
|
|
1602
|
+
/* @__PURE__ */ jsx24(CardTitle, { children: "Invite User" }),
|
|
1603
|
+
/* @__PURE__ */ jsx24(CardDescription, { children: "Send an invitation to a new user to join your organization" })
|
|
1570
1604
|
] }),
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ jsx24(CardContent, { children: /* @__PURE__ */ jsxs15("form", { onSubmit: handleSubmit, className: "space-y-6", children: [
|
|
1606
|
+
/* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
|
|
1607
|
+
/* @__PURE__ */ jsx24(Label, { htmlFor: "email", children: "Email Address" }),
|
|
1608
|
+
/* @__PURE__ */ jsx24(
|
|
1575
1609
|
Input,
|
|
1576
1610
|
{
|
|
1577
1611
|
id: "email",
|
|
@@ -1582,19 +1616,19 @@ function UserInvite({ roles, onInvite }) {
|
|
|
1582
1616
|
"aria-invalid": email !== "" && !isValidEmail(email)
|
|
1583
1617
|
}
|
|
1584
1618
|
),
|
|
1585
|
-
email !== "" && !isValidEmail(email) && /* @__PURE__ */
|
|
1619
|
+
email !== "" && !isValidEmail(email) && /* @__PURE__ */ jsx24("p", { className: "text-xs text-destructive", children: "Please enter a valid email address" })
|
|
1586
1620
|
] }),
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
/* @__PURE__ */
|
|
1589
|
-
/* @__PURE__ */
|
|
1590
|
-
/* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1621
|
+
/* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
|
|
1622
|
+
/* @__PURE__ */ jsx24(Label, { htmlFor: "role", children: "Role" }),
|
|
1623
|
+
/* @__PURE__ */ jsxs15(Select, { value: selectedRole, onValueChange: setSelectedRole, children: [
|
|
1624
|
+
/* @__PURE__ */ jsx24(SelectTrigger, { id: "role", children: /* @__PURE__ */ jsx24(SelectValue, { placeholder: "Select a role" }) }),
|
|
1625
|
+
/* @__PURE__ */ jsx24(SelectContent, { children: roles.length > 0 ? roles.map((role) => /* @__PURE__ */ jsx24(SelectItem, { value: role, children: role }, role)) : /* @__PURE__ */ jsx24(SelectItem, { value: "no-roles", disabled: true, children: "No roles available" }) })
|
|
1592
1626
|
] }),
|
|
1593
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ jsx24("p", { className: "text-xs text-muted-foreground", children: "The role determines what permissions the user will have" })
|
|
1594
1628
|
] }),
|
|
1595
|
-
error && /* @__PURE__ */
|
|
1596
|
-
/* @__PURE__ */
|
|
1597
|
-
/* @__PURE__ */
|
|
1629
|
+
error && /* @__PURE__ */ jsx24("div", { className: "p-3 rounded-md bg-destructive/10 border border-destructive/20", children: /* @__PURE__ */ jsx24("p", { className: "text-sm text-destructive", children: error }) }),
|
|
1630
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex justify-end space-x-3", children: [
|
|
1631
|
+
/* @__PURE__ */ jsx24(
|
|
1598
1632
|
Button,
|
|
1599
1633
|
{
|
|
1600
1634
|
type: "button",
|
|
@@ -1604,7 +1638,7 @@ function UserInvite({ roles, onInvite }) {
|
|
|
1604
1638
|
children: "Reset"
|
|
1605
1639
|
}
|
|
1606
1640
|
),
|
|
1607
|
-
/* @__PURE__ */
|
|
1641
|
+
/* @__PURE__ */ jsx24(Button, { type: "submit", disabled: !isFormValid() || isSubmitting, children: isSubmitting ? "Sending..." : "Send Invitation" })
|
|
1608
1642
|
] })
|
|
1609
1643
|
] }) })
|
|
1610
1644
|
] });
|
|
@@ -1616,14 +1650,14 @@ import { useState as useState7, useMemo as useMemo3 } from "react";
|
|
|
1616
1650
|
// src/components/ui/separator.tsx
|
|
1617
1651
|
import "react";
|
|
1618
1652
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
1619
|
-
import { jsx as
|
|
1653
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1620
1654
|
function Separator2({
|
|
1621
1655
|
className,
|
|
1622
1656
|
orientation = "horizontal",
|
|
1623
1657
|
decorative = true,
|
|
1624
1658
|
...props
|
|
1625
1659
|
}) {
|
|
1626
|
-
return /* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ jsx25(
|
|
1627
1661
|
SeparatorPrimitive.Root,
|
|
1628
1662
|
{
|
|
1629
1663
|
"data-slot": "separator",
|
|
@@ -1644,16 +1678,16 @@ import { useState as useState6, useMemo as useMemo2, useEffect as useEffect3 } f
|
|
|
1644
1678
|
// src/components/ui/popover.tsx
|
|
1645
1679
|
import "react";
|
|
1646
1680
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1647
|
-
import { jsx as
|
|
1681
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1648
1682
|
function Popover({
|
|
1649
1683
|
...props
|
|
1650
1684
|
}) {
|
|
1651
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ jsx26(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
1652
1686
|
}
|
|
1653
1687
|
function PopoverTrigger({
|
|
1654
1688
|
...props
|
|
1655
1689
|
}) {
|
|
1656
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ jsx26(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
1657
1691
|
}
|
|
1658
1692
|
function PopoverContent({
|
|
1659
1693
|
className,
|
|
@@ -1661,7 +1695,7 @@ function PopoverContent({
|
|
|
1661
1695
|
sideOffset = 4,
|
|
1662
1696
|
...props
|
|
1663
1697
|
}) {
|
|
1664
|
-
return /* @__PURE__ */
|
|
1698
|
+
return /* @__PURE__ */ jsx26(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx26(
|
|
1665
1699
|
PopoverPrimitive.Content,
|
|
1666
1700
|
{
|
|
1667
1701
|
"data-slot": "popover-content",
|
|
@@ -1685,15 +1719,15 @@ import { SearchIcon } from "lucide-react";
|
|
|
1685
1719
|
import "react";
|
|
1686
1720
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1687
1721
|
import { XIcon } from "lucide-react";
|
|
1688
|
-
import { jsx as
|
|
1722
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1689
1723
|
|
|
1690
1724
|
// src/components/ui/command.tsx
|
|
1691
|
-
import { jsx as
|
|
1725
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1692
1726
|
function Command({
|
|
1693
1727
|
className,
|
|
1694
1728
|
...props
|
|
1695
1729
|
}) {
|
|
1696
|
-
return /* @__PURE__ */
|
|
1730
|
+
return /* @__PURE__ */ jsx28(
|
|
1697
1731
|
CommandPrimitive,
|
|
1698
1732
|
{
|
|
1699
1733
|
"data-slot": "command",
|
|
@@ -1709,14 +1743,14 @@ function CommandInput({
|
|
|
1709
1743
|
className,
|
|
1710
1744
|
...props
|
|
1711
1745
|
}) {
|
|
1712
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ jsxs17(
|
|
1713
1747
|
"div",
|
|
1714
1748
|
{
|
|
1715
1749
|
"data-slot": "command-input-wrapper",
|
|
1716
1750
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
1717
1751
|
children: [
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
1752
|
+
/* @__PURE__ */ jsx28(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
1753
|
+
/* @__PURE__ */ jsx28(
|
|
1720
1754
|
CommandPrimitive.Input,
|
|
1721
1755
|
{
|
|
1722
1756
|
"data-slot": "command-input",
|
|
@@ -1735,7 +1769,7 @@ function CommandList({
|
|
|
1735
1769
|
className,
|
|
1736
1770
|
...props
|
|
1737
1771
|
}) {
|
|
1738
|
-
return /* @__PURE__ */
|
|
1772
|
+
return /* @__PURE__ */ jsx28(
|
|
1739
1773
|
CommandPrimitive.List,
|
|
1740
1774
|
{
|
|
1741
1775
|
"data-slot": "command-list",
|
|
@@ -1750,7 +1784,7 @@ function CommandList({
|
|
|
1750
1784
|
function CommandEmpty({
|
|
1751
1785
|
...props
|
|
1752
1786
|
}) {
|
|
1753
|
-
return /* @__PURE__ */
|
|
1787
|
+
return /* @__PURE__ */ jsx28(
|
|
1754
1788
|
CommandPrimitive.Empty,
|
|
1755
1789
|
{
|
|
1756
1790
|
"data-slot": "command-empty",
|
|
@@ -1763,7 +1797,7 @@ function CommandGroup({
|
|
|
1763
1797
|
className,
|
|
1764
1798
|
...props
|
|
1765
1799
|
}) {
|
|
1766
|
-
return /* @__PURE__ */
|
|
1800
|
+
return /* @__PURE__ */ jsx28(
|
|
1767
1801
|
CommandPrimitive.Group,
|
|
1768
1802
|
{
|
|
1769
1803
|
"data-slot": "command-group",
|
|
@@ -1779,7 +1813,7 @@ function CommandItem({
|
|
|
1779
1813
|
className,
|
|
1780
1814
|
...props
|
|
1781
1815
|
}) {
|
|
1782
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ jsx28(
|
|
1783
1817
|
CommandPrimitive.Item,
|
|
1784
1818
|
{
|
|
1785
1819
|
"data-slot": "command-item",
|
|
@@ -1794,7 +1828,7 @@ function CommandItem({
|
|
|
1794
1828
|
|
|
1795
1829
|
// src/permissions-selector/index.tsx
|
|
1796
1830
|
import { Trash2, Check as Check3, ChevronsUpDown } from "lucide-react";
|
|
1797
|
-
import { jsx as
|
|
1831
|
+
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1798
1832
|
function Combobox({
|
|
1799
1833
|
options,
|
|
1800
1834
|
value,
|
|
@@ -1808,8 +1842,8 @@ function Combobox({
|
|
|
1808
1842
|
const [open, setOpen] = useState6(false);
|
|
1809
1843
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
1810
1844
|
const isEmpty = options.length === 0;
|
|
1811
|
-
return /* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ jsxs18(Popover, { open, onOpenChange: setOpen, children: [
|
|
1846
|
+
/* @__PURE__ */ jsx29(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
|
|
1813
1847
|
Button,
|
|
1814
1848
|
{
|
|
1815
1849
|
variant: "outline",
|
|
@@ -1822,21 +1856,21 @@ function Combobox({
|
|
|
1822
1856
|
className
|
|
1823
1857
|
),
|
|
1824
1858
|
children: [
|
|
1825
|
-
isEmpty ? /* @__PURE__ */
|
|
1826
|
-
/* @__PURE__ */
|
|
1859
|
+
isEmpty ? /* @__PURE__ */ jsx29("span", { className: "text-muted-foreground", children: "None" }) : selectedOption ? /* @__PURE__ */ jsx29("span", { className: "truncate", children: selectedOption.label }) : placeholder,
|
|
1860
|
+
/* @__PURE__ */ jsx29(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1827
1861
|
]
|
|
1828
1862
|
}
|
|
1829
1863
|
) }),
|
|
1830
|
-
/* @__PURE__ */
|
|
1864
|
+
/* @__PURE__ */ jsx29(
|
|
1831
1865
|
PopoverContent,
|
|
1832
1866
|
{
|
|
1833
1867
|
className: "w-[--radix-popover-trigger-width] p-0",
|
|
1834
1868
|
align: "start",
|
|
1835
|
-
children: /* @__PURE__ */
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
/* @__PURE__ */
|
|
1838
|
-
/* @__PURE__ */
|
|
1839
|
-
/* @__PURE__ */
|
|
1869
|
+
children: /* @__PURE__ */ jsxs18(Command, { children: [
|
|
1870
|
+
/* @__PURE__ */ jsx29(CommandInput, { placeholder: searchPlaceholder }),
|
|
1871
|
+
/* @__PURE__ */ jsxs18(CommandList, { children: [
|
|
1872
|
+
/* @__PURE__ */ jsx29(CommandEmpty, { children: emptyText }),
|
|
1873
|
+
/* @__PURE__ */ jsx29(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs18(
|
|
1840
1874
|
CommandItem,
|
|
1841
1875
|
{
|
|
1842
1876
|
value: option.label,
|
|
@@ -1845,7 +1879,7 @@ function Combobox({
|
|
|
1845
1879
|
setOpen(false);
|
|
1846
1880
|
},
|
|
1847
1881
|
children: [
|
|
1848
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__PURE__ */ jsx29(
|
|
1849
1883
|
Check3,
|
|
1850
1884
|
{
|
|
1851
1885
|
className: cn(
|
|
@@ -1951,13 +1985,13 @@ function PermissionsSelector({
|
|
|
1951
1985
|
setPermissionRows(initialPermissions);
|
|
1952
1986
|
}
|
|
1953
1987
|
}, [initialPermissions]);
|
|
1954
|
-
return /* @__PURE__ */
|
|
1955
|
-
/* @__PURE__ */
|
|
1988
|
+
return /* @__PURE__ */ jsxs18("div", { className: cn("space-y-4", className), children: [
|
|
1989
|
+
/* @__PURE__ */ jsx29("div", { className: "space-y-3", children: permissionRows.map((row) => {
|
|
1956
1990
|
const relationOptions = getRelationsForNamespace(row.namespace);
|
|
1957
1991
|
const objectOptions = getObjectsForNamespace(row.namespace);
|
|
1958
1992
|
const showObjectSelect = objectOptions !== null;
|
|
1959
|
-
return /* @__PURE__ */
|
|
1960
|
-
/* @__PURE__ */
|
|
1993
|
+
return /* @__PURE__ */ jsxs18("div", { className: "flex items-start gap-2", children: [
|
|
1994
|
+
/* @__PURE__ */ jsx29(
|
|
1961
1995
|
Button,
|
|
1962
1996
|
{
|
|
1963
1997
|
type: "button",
|
|
@@ -1966,11 +2000,11 @@ function PermissionsSelector({
|
|
|
1966
2000
|
onClick: () => removePermissionRow(row.id),
|
|
1967
2001
|
disabled: disabled || permissionRows.length === 1,
|
|
1968
2002
|
className: "shrink-0",
|
|
1969
|
-
children: /* @__PURE__ */
|
|
2003
|
+
children: /* @__PURE__ */ jsx29(Trash2, { className: "h-4 w-4 text-muted-foreground" })
|
|
1970
2004
|
}
|
|
1971
2005
|
),
|
|
1972
|
-
/* @__PURE__ */
|
|
1973
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-1 gap-0", children: [
|
|
2007
|
+
/* @__PURE__ */ jsx29(
|
|
1974
2008
|
Combobox,
|
|
1975
2009
|
{
|
|
1976
2010
|
options: namespaceOptions,
|
|
@@ -1982,7 +2016,7 @@ function PermissionsSelector({
|
|
|
1982
2016
|
className: "w-1/3 min-w-[120px] rounded-r-none border-r-0"
|
|
1983
2017
|
}
|
|
1984
2018
|
),
|
|
1985
|
-
/* @__PURE__ */
|
|
2019
|
+
/* @__PURE__ */ jsx29(
|
|
1986
2020
|
Combobox,
|
|
1987
2021
|
{
|
|
1988
2022
|
options: relationOptions,
|
|
@@ -1997,7 +2031,7 @@ function PermissionsSelector({
|
|
|
1997
2031
|
)
|
|
1998
2032
|
}
|
|
1999
2033
|
),
|
|
2000
|
-
/* @__PURE__ */
|
|
2034
|
+
/* @__PURE__ */ jsx29(
|
|
2001
2035
|
Combobox,
|
|
2002
2036
|
{
|
|
2003
2037
|
options: objectOptions ?? [],
|
|
@@ -2015,15 +2049,15 @@ function PermissionsSelector({
|
|
|
2015
2049
|
] })
|
|
2016
2050
|
] }, row.id);
|
|
2017
2051
|
}) }),
|
|
2018
|
-
showPreview && permissionRows.some((row) => row.namespace && row.relation) && /* @__PURE__ */
|
|
2019
|
-
/* @__PURE__ */
|
|
2020
|
-
/* @__PURE__ */
|
|
2052
|
+
showPreview && permissionRows.some((row) => row.namespace && row.relation) && /* @__PURE__ */ jsxs18("div", { className: "rounded-md bg-muted p-3", children: [
|
|
2053
|
+
/* @__PURE__ */ jsx29("p", { className: "text-xs text-muted-foreground mb-2", children: "Permissions to be granted:" }),
|
|
2054
|
+
/* @__PURE__ */ jsx29("ul", { className: "space-y-1 text-xs font-mono", children: buildPermissions().map((perm, idx) => /* @__PURE__ */ jsx29("li", { className: "text-muted-foreground", children: perm }, idx)) })
|
|
2021
2055
|
] })
|
|
2022
2056
|
] });
|
|
2023
2057
|
}
|
|
2024
2058
|
|
|
2025
2059
|
// src/role-creator/index.tsx
|
|
2026
|
-
import { jsx as
|
|
2060
|
+
import { jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2027
2061
|
function RoleCreator({
|
|
2028
2062
|
definitions,
|
|
2029
2063
|
roles,
|
|
@@ -2118,15 +2152,15 @@ function RoleCreator({
|
|
|
2118
2152
|
setIsEditMode(false);
|
|
2119
2153
|
setEditingRoleId(null);
|
|
2120
2154
|
};
|
|
2121
|
-
return /* @__PURE__ */
|
|
2122
|
-
/* @__PURE__ */
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */
|
|
2155
|
+
return /* @__PURE__ */ jsxs19(Card, { className: "w-full max-w-4xl", children: [
|
|
2156
|
+
/* @__PURE__ */ jsxs19(CardHeader, { children: [
|
|
2157
|
+
/* @__PURE__ */ jsx30(CardTitle, { children: isEditMode ? `Edit Role: ${roleName}` : "Create New Role" }),
|
|
2158
|
+
/* @__PURE__ */ jsx30(CardDescription, { children: isEditMode ? "Update permissions for this existing role" : "Define a new role with specific permissions" })
|
|
2125
2159
|
] }),
|
|
2126
|
-
/* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ jsxs19(CardContent, { className: "space-y-6", children: [
|
|
2161
|
+
/* @__PURE__ */ jsxs19("div", { className: "space-y-2 relative", children: [
|
|
2162
|
+
/* @__PURE__ */ jsx30(Label, { htmlFor: "role-name", children: "Role Name" }),
|
|
2163
|
+
/* @__PURE__ */ jsx30(
|
|
2130
2164
|
Input,
|
|
2131
2165
|
{
|
|
2132
2166
|
id: "role-name",
|
|
@@ -2137,9 +2171,9 @@ function RoleCreator({
|
|
|
2137
2171
|
onBlur: () => setTimeout(() => setShowSuggestions(false), 200)
|
|
2138
2172
|
}
|
|
2139
2173
|
),
|
|
2140
|
-
showSuggestions && roleSuggestions.length > 0 && /* @__PURE__ */
|
|
2174
|
+
showSuggestions && roleSuggestions.length > 0 && /* @__PURE__ */ jsx30("div", { className: "absolute z-10 w-full mt-1 bg-background border rounded-md shadow-lg max-h-48 overflow-y-auto", children: roleSuggestions.filter(
|
|
2141
2175
|
(suggestion) => suggestion.toLowerCase().includes(roleName.toLowerCase())
|
|
2142
|
-
).map((suggestion) => /* @__PURE__ */
|
|
2176
|
+
).map((suggestion) => /* @__PURE__ */ jsx30(
|
|
2143
2177
|
"button",
|
|
2144
2178
|
{
|
|
2145
2179
|
className: "w-full px-4 py-2 text-left hover:bg-accent hover:text-accent-foreground text-sm",
|
|
@@ -2151,12 +2185,12 @@ function RoleCreator({
|
|
|
2151
2185
|
},
|
|
2152
2186
|
suggestion
|
|
2153
2187
|
)) }),
|
|
2154
|
-
isEditMode && /* @__PURE__ */
|
|
2188
|
+
isEditMode && /* @__PURE__ */ jsx30("p", { className: "text-xs text-amber-600 dark:text-amber-400", children: "Editing existing role - changes will update all users with this role" })
|
|
2155
2189
|
] }),
|
|
2156
|
-
/* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2190
|
+
/* @__PURE__ */ jsx30(Separator2, {}),
|
|
2191
|
+
/* @__PURE__ */ jsxs19("div", { className: "space-y-4", children: [
|
|
2192
|
+
/* @__PURE__ */ jsx30(Label, { children: "Permissions" }),
|
|
2193
|
+
/* @__PURE__ */ jsx30(
|
|
2160
2194
|
PermissionsSelector,
|
|
2161
2195
|
{
|
|
2162
2196
|
definitions,
|
|
@@ -2166,10 +2200,10 @@ function RoleCreator({
|
|
|
2166
2200
|
}
|
|
2167
2201
|
)
|
|
2168
2202
|
] }),
|
|
2169
|
-
/* @__PURE__ */
|
|
2170
|
-
/* @__PURE__ */
|
|
2171
|
-
/* @__PURE__ */
|
|
2172
|
-
/* @__PURE__ */
|
|
2203
|
+
/* @__PURE__ */ jsx30(Separator2, {}),
|
|
2204
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-end space-x-3", children: [
|
|
2205
|
+
/* @__PURE__ */ jsx30(Button, { variant: "outline", onClick: handleReset, children: "Reset" }),
|
|
2206
|
+
/* @__PURE__ */ jsx30(
|
|
2173
2207
|
Button,
|
|
2174
2208
|
{
|
|
2175
2209
|
onClick: handleSubmit,
|
|
@@ -2187,14 +2221,14 @@ import { useState as useState8, useMemo as useMemo4 } from "react";
|
|
|
2187
2221
|
|
|
2188
2222
|
// src/components/ui/table.tsx
|
|
2189
2223
|
import "react";
|
|
2190
|
-
import { jsx as
|
|
2224
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2191
2225
|
function Table({ className, ...props }) {
|
|
2192
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ jsx31(
|
|
2193
2227
|
"div",
|
|
2194
2228
|
{
|
|
2195
2229
|
"data-slot": "table-container",
|
|
2196
2230
|
className: "relative w-full overflow-x-auto",
|
|
2197
|
-
children: /* @__PURE__ */
|
|
2231
|
+
children: /* @__PURE__ */ jsx31(
|
|
2198
2232
|
"table",
|
|
2199
2233
|
{
|
|
2200
2234
|
"data-slot": "table",
|
|
@@ -2206,7 +2240,7 @@ function Table({ className, ...props }) {
|
|
|
2206
2240
|
);
|
|
2207
2241
|
}
|
|
2208
2242
|
function TableHeader({ className, ...props }) {
|
|
2209
|
-
return /* @__PURE__ */
|
|
2243
|
+
return /* @__PURE__ */ jsx31(
|
|
2210
2244
|
"thead",
|
|
2211
2245
|
{
|
|
2212
2246
|
"data-slot": "table-header",
|
|
@@ -2216,7 +2250,7 @@ function TableHeader({ className, ...props }) {
|
|
|
2216
2250
|
);
|
|
2217
2251
|
}
|
|
2218
2252
|
function TableBody({ className, ...props }) {
|
|
2219
|
-
return /* @__PURE__ */
|
|
2253
|
+
return /* @__PURE__ */ jsx31(
|
|
2220
2254
|
"tbody",
|
|
2221
2255
|
{
|
|
2222
2256
|
"data-slot": "table-body",
|
|
@@ -2226,7 +2260,7 @@ function TableBody({ className, ...props }) {
|
|
|
2226
2260
|
);
|
|
2227
2261
|
}
|
|
2228
2262
|
function TableRow({ className, ...props }) {
|
|
2229
|
-
return /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ jsx31(
|
|
2230
2264
|
"tr",
|
|
2231
2265
|
{
|
|
2232
2266
|
"data-slot": "table-row",
|
|
@@ -2239,7 +2273,7 @@ function TableRow({ className, ...props }) {
|
|
|
2239
2273
|
);
|
|
2240
2274
|
}
|
|
2241
2275
|
function TableHead({ className, ...props }) {
|
|
2242
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ jsx31(
|
|
2243
2277
|
"th",
|
|
2244
2278
|
{
|
|
2245
2279
|
"data-slot": "table-head",
|
|
@@ -2252,7 +2286,7 @@ function TableHead({ className, ...props }) {
|
|
|
2252
2286
|
);
|
|
2253
2287
|
}
|
|
2254
2288
|
function TableCell({ className, ...props }) {
|
|
2255
|
-
return /* @__PURE__ */
|
|
2289
|
+
return /* @__PURE__ */ jsx31(
|
|
2256
2290
|
"td",
|
|
2257
2291
|
{
|
|
2258
2292
|
"data-slot": "table-cell",
|
|
@@ -2268,12 +2302,12 @@ function TableCell({ className, ...props }) {
|
|
|
2268
2302
|
// src/components/ui/avatar.tsx
|
|
2269
2303
|
import "react";
|
|
2270
2304
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2271
|
-
import { jsx as
|
|
2305
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2272
2306
|
function Avatar({
|
|
2273
2307
|
className,
|
|
2274
2308
|
...props
|
|
2275
2309
|
}) {
|
|
2276
|
-
return /* @__PURE__ */
|
|
2310
|
+
return /* @__PURE__ */ jsx32(
|
|
2277
2311
|
AvatarPrimitive.Root,
|
|
2278
2312
|
{
|
|
2279
2313
|
"data-slot": "avatar",
|
|
@@ -2289,7 +2323,7 @@ function AvatarFallback({
|
|
|
2289
2323
|
className,
|
|
2290
2324
|
...props
|
|
2291
2325
|
}) {
|
|
2292
|
-
return /* @__PURE__ */
|
|
2326
|
+
return /* @__PURE__ */ jsx32(
|
|
2293
2327
|
AvatarPrimitive.Fallback,
|
|
2294
2328
|
{
|
|
2295
2329
|
"data-slot": "avatar-fallback",
|
|
@@ -2304,7 +2338,7 @@ function AvatarFallback({
|
|
|
2304
2338
|
|
|
2305
2339
|
// src/user-viewer/index.tsx
|
|
2306
2340
|
import { Search, UserX } from "lucide-react";
|
|
2307
|
-
import { jsx as
|
|
2341
|
+
import { jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2308
2342
|
function UserViewer({
|
|
2309
2343
|
users,
|
|
2310
2344
|
availableRoles,
|
|
@@ -2350,17 +2384,17 @@ function UserViewer({
|
|
|
2350
2384
|
setIsUpdating((prev) => ({ ...prev, [userId]: false }));
|
|
2351
2385
|
}
|
|
2352
2386
|
};
|
|
2353
|
-
return /* @__PURE__ */
|
|
2354
|
-
/* @__PURE__ */
|
|
2355
|
-
/* @__PURE__ */
|
|
2356
|
-
/* @__PURE__ */
|
|
2387
|
+
return /* @__PURE__ */ jsxs20(Card, { className: "w-full max-w-6xl", children: [
|
|
2388
|
+
/* @__PURE__ */ jsxs20(CardHeader, { children: [
|
|
2389
|
+
/* @__PURE__ */ jsx33(CardTitle, { children: "Team Members" }),
|
|
2390
|
+
/* @__PURE__ */ jsx33(CardDescription, { children: canEditUsers ? "View and manage users in your organization" : "View users in your organization" })
|
|
2357
2391
|
] }),
|
|
2358
|
-
/* @__PURE__ */
|
|
2359
|
-
/* @__PURE__ */
|
|
2360
|
-
/* @__PURE__ */
|
|
2361
|
-
/* @__PURE__ */
|
|
2362
|
-
/* @__PURE__ */
|
|
2363
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ jsxs20(CardContent, { children: [
|
|
2393
|
+
/* @__PURE__ */ jsxs20("div", { className: "mb-6", children: [
|
|
2394
|
+
/* @__PURE__ */ jsx33(Label, { htmlFor: "search", className: "sr-only", children: "Search users" }),
|
|
2395
|
+
/* @__PURE__ */ jsxs20("div", { className: "relative", children: [
|
|
2396
|
+
/* @__PURE__ */ jsx33(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
|
|
2397
|
+
/* @__PURE__ */ jsx33(
|
|
2364
2398
|
Input,
|
|
2365
2399
|
{
|
|
2366
2400
|
id: "search",
|
|
@@ -2372,7 +2406,7 @@ function UserViewer({
|
|
|
2372
2406
|
}
|
|
2373
2407
|
)
|
|
2374
2408
|
] }),
|
|
2375
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsxs20("p", { className: "text-xs text-muted-foreground mt-2", children: [
|
|
2376
2410
|
"Showing ",
|
|
2377
2411
|
filteredUsers.length,
|
|
2378
2412
|
" of ",
|
|
@@ -2380,39 +2414,39 @@ function UserViewer({
|
|
|
2380
2414
|
" users"
|
|
2381
2415
|
] })
|
|
2382
2416
|
] }),
|
|
2383
|
-
filteredUsers.length > 0 ? /* @__PURE__ */
|
|
2384
|
-
/* @__PURE__ */
|
|
2385
|
-
/* @__PURE__ */
|
|
2386
|
-
/* @__PURE__ */
|
|
2387
|
-
/* @__PURE__ */
|
|
2388
|
-
canEditUsers && onRemoveUser && /* @__PURE__ */
|
|
2417
|
+
filteredUsers.length > 0 ? /* @__PURE__ */ jsx33("div", { className: "border rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs20(Table, { children: [
|
|
2418
|
+
/* @__PURE__ */ jsx33(TableHeader, { children: /* @__PURE__ */ jsxs20(TableRow, { children: [
|
|
2419
|
+
/* @__PURE__ */ jsx33(TableHead, { className: "w-[300px]", children: "User" }),
|
|
2420
|
+
/* @__PURE__ */ jsx33(TableHead, { children: "Email" }),
|
|
2421
|
+
/* @__PURE__ */ jsx33(TableHead, { className: "w-[180px]", children: "Role" }),
|
|
2422
|
+
canEditUsers && onRemoveUser && /* @__PURE__ */ jsx33(TableHead, { className: "w-[100px] text-right", children: "Actions" })
|
|
2389
2423
|
] }) }),
|
|
2390
|
-
/* @__PURE__ */
|
|
2391
|
-
/* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
/* @__PURE__ */
|
|
2424
|
+
/* @__PURE__ */ jsx33(TableBody, { children: filteredUsers.map((user) => /* @__PURE__ */ jsxs20(TableRow, { children: [
|
|
2425
|
+
/* @__PURE__ */ jsx33(TableCell, { className: "font-medium", children: /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-3", children: [
|
|
2426
|
+
/* @__PURE__ */ jsx33(Avatar, { children: /* @__PURE__ */ jsx33(AvatarFallback, { children: getInitials(user.firstName, user.lastName) }) }),
|
|
2427
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
2428
|
+
/* @__PURE__ */ jsxs20("div", { className: "font-medium", children: [
|
|
2395
2429
|
user.firstName,
|
|
2396
2430
|
" ",
|
|
2397
2431
|
user.lastName
|
|
2398
2432
|
] }),
|
|
2399
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ jsx33("div", { className: "text-xs text-muted-foreground md:hidden", children: user.email })
|
|
2400
2434
|
] })
|
|
2401
2435
|
] }) }),
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
-
/* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ jsx33(TableCell, { className: "hidden md:table-cell", children: user.email }),
|
|
2437
|
+
/* @__PURE__ */ jsx33(TableCell, { children: canEditUsers && onRoleUpdate ? /* @__PURE__ */ jsxs20(
|
|
2404
2438
|
Select,
|
|
2405
2439
|
{
|
|
2406
2440
|
value: user.role,
|
|
2407
2441
|
onValueChange: (newRole) => handleRoleUpdate(user.userId, newRole),
|
|
2408
2442
|
disabled: isUpdating[user.userId],
|
|
2409
2443
|
children: [
|
|
2410
|
-
/* @__PURE__ */
|
|
2411
|
-
/* @__PURE__ */
|
|
2444
|
+
/* @__PURE__ */ jsx33(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ jsx33(SelectValue, {}) }),
|
|
2445
|
+
/* @__PURE__ */ jsx33(SelectContent, { children: availableRoles.map((role) => /* @__PURE__ */ jsx33(SelectItem, { value: role, children: role }, role)) })
|
|
2412
2446
|
]
|
|
2413
2447
|
}
|
|
2414
|
-
) : /* @__PURE__ */
|
|
2415
|
-
canEditUsers && onRemoveUser && /* @__PURE__ */
|
|
2448
|
+
) : /* @__PURE__ */ jsx33("span", { className: "capitalize text-sm font-medium", children: user.role }) }),
|
|
2449
|
+
canEditUsers && onRemoveUser && /* @__PURE__ */ jsx33(TableCell, { className: "text-right", children: /* @__PURE__ */ jsxs20(
|
|
2416
2450
|
Button,
|
|
2417
2451
|
{
|
|
2418
2452
|
variant: "ghost",
|
|
@@ -2421,17 +2455,18 @@ function UserViewer({
|
|
|
2421
2455
|
disabled: isUpdating[user.userId],
|
|
2422
2456
|
className: "h-8 w-8",
|
|
2423
2457
|
children: [
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
/* @__PURE__ */
|
|
2458
|
+
/* @__PURE__ */ jsx33(UserX, { className: "h-4 w-4" }),
|
|
2459
|
+
/* @__PURE__ */ jsx33("span", { className: "sr-only", children: "Remove user" })
|
|
2426
2460
|
]
|
|
2427
2461
|
}
|
|
2428
2462
|
) })
|
|
2429
2463
|
] }, user.userId)) })
|
|
2430
|
-
] }) }) : /* @__PURE__ */
|
|
2464
|
+
] }) }) : /* @__PURE__ */ jsx33("div", { className: "text-center py-12 border rounded-lg", children: /* @__PURE__ */ jsx33("p", { className: "text-muted-foreground", children: searchQuery ? "No users found matching your search" : "No users in this organization yet" }) })
|
|
2431
2465
|
] })
|
|
2432
2466
|
] });
|
|
2433
2467
|
}
|
|
2434
2468
|
export {
|
|
2469
|
+
ErrorForm,
|
|
2435
2470
|
LoginForm,
|
|
2436
2471
|
PermissionsSelector,
|
|
2437
2472
|
PricingTable,
|