@burdenoff/microfe-workspaces 2026.625.5 → 2026.626.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.
Files changed (33) hide show
  1. package/dist/pages/ActivityListPage.js +94 -90
  2. package/dist/pages/ActivityListPage.js.map +1 -1
  3. package/dist/pages/CreateWorkspacePage.js +68 -63
  4. package/dist/pages/CreateWorkspacePage.js.map +1 -1
  5. package/dist/pages/InviteAcceptancePage.js +101 -96
  6. package/dist/pages/InviteAcceptancePage.js.map +1 -1
  7. package/dist/pages/MembersListPage.js +185 -184
  8. package/dist/pages/MembersListPage.js.map +1 -1
  9. package/dist/pages/PendingInvitesPage.js +70 -68
  10. package/dist/pages/PendingInvitesPage.js.map +1 -1
  11. package/dist/pages/ProjectDetailPage.js +119 -78
  12. package/dist/pages/ProjectDetailPage.js.map +1 -1
  13. package/dist/pages/ProjectMembersPage.js +105 -104
  14. package/dist/pages/ProjectMembersPage.js.map +1 -1
  15. package/dist/pages/ProjectsListPage.js +158 -157
  16. package/dist/pages/ProjectsListPage.js.map +1 -1
  17. package/dist/pages/WorkspaceDetailPage.js +236 -198
  18. package/dist/pages/WorkspaceDetailPage.js.map +1 -1
  19. package/dist/pages/WorkspaceInvitePage.js +341 -300
  20. package/dist/pages/WorkspaceInvitePage.js.map +1 -1
  21. package/dist/pages/WorkspaceSettingsPage.js +87 -85
  22. package/dist/pages/WorkspaceSettingsPage.js.map +1 -1
  23. package/dist/pages/WorkspacesListPage.js +122 -121
  24. package/dist/pages/WorkspacesListPage.js.map +1 -1
  25. package/dist/pages/dashboard/DashboardPage.js +55 -51
  26. package/dist/pages/dashboard/DashboardPage.js.map +1 -1
  27. package/dist/pages/dashboard/widgets/GroupsWidget.js +16 -17
  28. package/dist/pages/dashboard/widgets/GroupsWidget.js.map +1 -1
  29. package/dist/pages/dashboard/widgets/TagCloudWidget.js +18 -19
  30. package/dist/pages/dashboard/widgets/TagCloudWidget.js.map +1 -1
  31. package/dist/pages/dashboard/widgets/WorkflowStatsWidget.js +10 -11
  32. package/dist/pages/dashboard/widgets/WorkflowStatsWidget.js.map +1 -1
  33. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"CreateWorkspacePage.js","names":[],"sources":["../../src/pages/CreateWorkspacePage.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react';\nimport { ArrowLeft, AlertCircle } from 'lucide-react';\nimport { Link, useNavigate } from 'react-router-dom';\nimport {\n Button,\n GlassCard,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n Skeleton,\n} from '@burdenoff/fe-libs/ui';\nimport { useForm, z } from '@burdenoff/fe-libs/form';\nimport { AccessDenied, UpgradeInlineBanner } from '@burdenoff/fe-libs/shared/components';\nimport { useUpgradePrompt } from '@burdenoff/fe-libs/shared/hooks';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useCreateWorkspace } from '../hooks/useWorkspaceMutations';\nimport { useMyTenants, useMyOrganizations } from '../hooks/useTenants';\nimport { useOrgsWithPermission } from '../hooks/useOrgsWithPermission';\nimport { useWorkspacesContext } from '../providers/WorkspacesProvider';\nimport { useWorkspacesPageView } from '../hooks/useWorkspacesPageView';\nimport { generateSlug } from '../utils/slug';\nimport { tWithFallback } from '../utils/i18n';\n\ntype CreateWorkspaceFormData = {\n name: string;\n slug: string;\n tenantId: string;\n organizationId: string;\n};\n\nexport function CreateWorkspacePage() {\n useWorkspacesPageView('workspaces.create');\n const { t } = useI18n();\n const {\n isFree,\n approachingLimits,\n plan: planSnapshot,\n } = useUpgradePrompt({ resource: 'workspaces' });\n const workspacesUsage = approachingLimits[0];\n const atWorkspaceCap =\n !!workspacesUsage &&\n typeof workspacesUsage.limit === 'number' &&\n workspacesUsage.current >= workspacesUsage.limit;\n const showUpgradeBanner = isFree && !!workspacesUsage;\n const createWorkspaceSchema = useMemo(\n () =>\n z.object({\n name: z\n .string()\n .min(\n 2,\n tWithFallback(\n t,\n 'createWorkspace.validation.nameMin',\n 'Name must be at least 2 characters'\n )\n )\n .max(100),\n slug: z\n .string()\n .min(\n 2,\n tWithFallback(\n t,\n 'createWorkspace.validation.slugMin',\n 'Slug must be at least 2 characters'\n )\n )\n .max(50)\n .regex(\n /^[a-z0-9-]+$/,\n tWithFallback(\n t,\n 'createWorkspace.validation.slugFormat',\n 'Slug can only contain lowercase letters, numbers, and hyphens'\n )\n ),\n tenantId: z\n .string()\n .min(\n 1,\n tWithFallback(t, 'createWorkspace.validation.tenantRequired', 'Please select a tenant')\n ),\n organizationId: z\n .string()\n .min(\n 1,\n tWithFallback(\n t,\n 'createWorkspace.validation.organizationRequired',\n 'Please select an organization'\n )\n ),\n }),\n [t]\n );\n\n const navigate = useNavigate();\n const { basePath = '/' } = useWorkspacesContext();\n const { mutate: createWorkspace, isPending } = useCreateWorkspace();\n const { data: tenantsData, isLoading: isLoadingTenants, error: tenantsError } = useMyTenants();\n const {\n data: organizationsData,\n isLoading: isLoadingOrganizations,\n error: organizationsError,\n } = useMyOrganizations();\n\n const tenants = useMemo(() => tenantsData?.items ?? [], [tenantsData]);\n const allOrganizations = useMemo(() => organizationsData?.items ?? [], [organizationsData]);\n\n const defaultTenantId = useMemo(() => {\n const sharedTenant = tenants.find(\n (tenant) => tenant.type === 'SHARED' || tenant.slug === 'burdenoff-shared'\n );\n return sharedTenant?.id ?? tenants[0]?.id ?? '';\n }, [tenants]);\n\n const form = useForm<CreateWorkspaceFormData>({\n schema: createWorkspaceSchema,\n defaultValues: {\n name: '',\n slug: '',\n tenantId: '',\n organizationId: '',\n },\n });\n\n const selectedTenantId = form.watch('tenantId');\n const workspaceName = form.watch('name');\n\n // Check workspace:create permission across ALL the user's orgs up front\n // (bulk-checked in a single rbac round-trip). This is the authoritative\n // gate — only orgs where the user can actually create a workspace make\n // it into the dropdown, and the page can decisively render the \"no\n // permissions anywhere\" state once the check resolves.\n const allOrgIds = useMemo(() => allOrganizations.map((o) => o.id), [allOrganizations]);\n const {\n allowedIds: workspaceCreateAllowedOrgIds,\n loading: isCheckingOrgPermissions,\n isError: orgPermissionsHadError,\n } = useOrgsWithPermission(allOrgIds, 'workspace', 'create');\n\n // Filter organizations by selected tenant AND permission. When the rbac\n // permission lookup errored we deliberately skip the permission filter\n // (see `orgPermissionsHadError` block below) — the gateway @rbac\n // directive on `createWorkspace` is the authoritative gate, so it's\n // safer to let the user pick from the full tenant list and hit a 403 on\n // submit than to lock them out of a flow they actually have access to.\n const tenantOrganizations = useMemo(() => {\n if (!selectedTenantId) return [];\n return allOrganizations.filter((org) => org.tenantId === selectedTenantId);\n }, [selectedTenantId, allOrganizations]);\n const filteredOrganizations = useMemo(() => {\n if (orgPermissionsHadError) return tenantOrganizations;\n return tenantOrganizations.filter((org) => workspaceCreateAllowedOrgIds.has(org.id));\n }, [tenantOrganizations, workspaceCreateAllowedOrgIds, orgPermissionsHadError]);\n\n // Auto-generate slug from name (clear when name is empty)\n useEffect(() => {\n form.setValue('slug', workspaceName ? generateSlug(workspaceName) : '');\n }, [workspaceName, form]);\n\n // Reset organizationId when tenant changes\n useEffect(() => {\n form.setValue('organizationId', '');\n }, [selectedTenantId, form]);\n\n useEffect(() => {\n if (!form.getValues('tenantId') && defaultTenantId) {\n form.setValue('tenantId', defaultTenantId, {\n shouldDirty: false,\n shouldTouch: false,\n });\n }\n }, [defaultTenantId, form]);\n\n useEffect(() => {\n const currentOrganizationId = form.getValues('organizationId');\n const hasCurrentOrganization = filteredOrganizations.some(\n (organization) => organization.id === currentOrganizationId\n );\n\n if (!hasCurrentOrganization && filteredOrganizations[0]?.id) {\n form.setValue('organizationId', filteredOrganizations[0].id, {\n shouldDirty: false,\n shouldTouch: false,\n });\n }\n }, [filteredOrganizations, form]);\n\n const onSubmit = (data: CreateWorkspaceFormData) => {\n createWorkspace(\n {\n name: data.name,\n slug: data.slug,\n tenantId: data.tenantId,\n organizationId: data.organizationId,\n },\n {\n onSuccess: (newWorkspace) => {\n // Navigate to the new workspace\n navigate(`${basePath}/${newWorkspace.id}`);\n },\n }\n );\n };\n\n // `workspace:create` is an org-scoped permission. Page-level `PermissionGate`\n // resolved at the outer shell scope and incorrectly denied users who *do*\n // have the permission inside at least one of their orgs. The authoritative\n // gate now lives on the org dropdown (only orgs where the user has\n // workspace:create are listed via useOrgsWithPermission) and on the gateway\n // @rbac directive enforcing the createWorkspace mutation. We still want a\n // clear \"you can't create anywhere\" empty state — once tenants and org\n // permission lookups have settled, if no org is eligible we render it.\n // The AccessDenied empty-state should ONLY render when we know with\n // certainty that the user has no creatable org. That requires:\n // 1. tenants + organizations queries both succeeded (otherwise an\n // empty `allOrganizations` is a data-fetch failure, not an authz\n // failure — masking it as \"permission denied\" hides the real\n // error and offers the user no path to retry),\n // 2. the rbac permission lookup also succeeded (errors there fall\n // through to the unfiltered form via the warning banner below),\n // 3. and even then, only when the user has at least one org but none\n // of them allow workspace:create.\n // If `allOrganizations` is empty because the user genuinely belongs to\n // no orgs, the inner \"no organizations found for this tenant\" message\n // is a better surface than an authz-denied page.\n const hasAnyCreatableOrg = workspaceCreateAllowedOrgIds.size > 0;\n const stillResolvingPermissions =\n isLoadingTenants || isLoadingOrganizations || isCheckingOrgPermissions;\n const orgDataLoadedSuccessfully =\n !tenantsError && !organizationsError && allOrganizations.length > 0;\n if (\n !stillResolvingPermissions &&\n !orgPermissionsHadError &&\n orgDataLoadedSuccessfully &&\n !hasAnyCreatableOrg\n ) {\n return (\n <div className=\"p-6\">\n <Link\n to={`${basePath}/list`}\n className=\"inline-flex items-center gap-2 text-text-secondary hover:text-text-primary transition-colors mb-6\"\n >\n <ArrowLeft size={20} />\n {tWithFallback(t, 'createWorkspace.backToWorkspaces', 'Back to Workspaces')}\n </Link>\n <AccessDenied\n variant=\"card\"\n title={tWithFallback(t, 'createWorkspace.permissionRequiredTitle', 'Permission Required')}\n description={tWithFallback(\n t,\n 'createWorkspace.permissionRequiredDescription',\n \"You don't have permission to create workspaces in any of your organizations.\"\n )}\n details={tWithFallback(\n t,\n 'createWorkspace.permissionRequiredDetails',\n 'Required: workspace:create'\n )}\n primaryAction={{\n label: tWithFallback(t, 'createWorkspace.goBack', 'Go Back'),\n onClick: () => navigate(`${basePath}/list`),\n }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6\">\n {/* Back link */}\n <Link\n to={`${basePath}/list`}\n className=\"inline-flex items-center gap-2 text-text-secondary hover:text-text-primary transition-colors\"\n >\n <ArrowLeft size={20} />\n {tWithFallback(t, 'createWorkspace.backToWorkspaces', 'Back to Workspaces')}\n </Link>\n\n {showUpgradeBanner && (\n <div className=\"max-w-2xl mx-auto w-full\">\n <UpgradeInlineBanner\n resource=\"workspaces\"\n current={workspacesUsage.current}\n limit={workspacesUsage.limit ?? undefined}\n severity={atWorkspaceCap ? 'critical' : undefined}\n message={\n atWorkspaceCap\n ? tWithFallback(\n t,\n 'createWorkspace.upgradeCapMessage',\n `You've used all workspaces in the ${planSnapshot?.planName ?? 'free'} plan.`\n )\n : tWithFallback(\n t,\n 'createWorkspace.upgradeApproachingMessage',\n 'Upgrade to create more workspaces.'\n )\n }\n />\n </div>\n )}\n\n {/* Form card */}\n <GlassCard treatment=\"plain\" className=\"max-w-2xl mx-auto border-border-seam\">\n <CardHeader>\n <CardTitle>{tWithFallback(t, 'createWorkspace.title', 'Create New Workspace')}</CardTitle>\n <CardDescription>\n {tWithFallback(t, 'createWorkspace.subtitle', 'Set up a new workspace for your team')}\n </CardDescription>\n </CardHeader>\n <CardContent>\n {orgPermissionsHadError && (\n <div\n role=\"alert\"\n className=\"mb-4 flex items-start gap-2 rounded-md border border-warning/30 bg-warning/10 p-3 text-sm text-text-primary\"\n >\n <AlertCircle size={16} className=\"mt-0.5 shrink-0 text-warning\" />\n <span>\n {tWithFallback(\n t,\n 'createWorkspace.permissionCheckUnavailable',\n \"We couldn't verify your workspace-create permissions just now, so the organization list isn't filtered. If you submit and don't have access, the request will be rejected and you can retry.\"\n )}\n </span>\n </div>\n )}\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-6\">\n <div className=\"space-y-2\">\n <label htmlFor=\"workspace-name\" className=\"text-sm font-medium text-text-primary\">\n {tWithFallback(t, 'createWorkspace.nameLabel', 'Workspace Name *')}\n </label>\n <input\n id=\"workspace-name\"\n placeholder={tWithFallback(t, 'createWorkspace.namePlaceholder', 'My Workspace')}\n className=\"h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n {...form.register('name')}\n />\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.nameHint',\n 'A descriptive name for your workspace'\n )}\n </p>\n {form.formState.errors.name?.message && (\n <p className=\"text-sm text-status-error-text\">\n {form.formState.errors.name.message}\n </p>\n )}\n </div>\n\n <div className=\"space-y-2\">\n <label htmlFor=\"workspace-slug\" className=\"text-sm font-medium text-text-primary\">\n {tWithFallback(t, 'createWorkspace.slugLabel', 'Slug *')}\n </label>\n <input\n id=\"workspace-slug\"\n placeholder={tWithFallback(t, 'createWorkspace.slugPlaceholder', 'my-workspace')}\n className=\"h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n {...form.register('slug')}\n />\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.slugHint',\n 'URL-friendly identifier (auto-generated, but you can edit it)'\n )}\n </p>\n {form.formState.errors.slug?.message && (\n <p className=\"text-sm text-status-error-text\">\n {form.formState.errors.slug.message}\n </p>\n )}\n </div>\n\n {/* Tenant picker — shown only when the user has more than one\n tenant to choose between. With a single shared tenant there is\n nothing to choose, so it is hidden and auto-selected. The\n loading / error / empty branches still render (length !== 1). */}\n {tenants.length !== 1 ? (\n <div className=\"space-y-2\">\n <label htmlFor=\"workspace-tenant\" className=\"text-sm font-medium text-text-primary\">\n {tWithFallback(t, 'createWorkspace.tenantLabel', 'Tenant *')}\n </label>\n {isLoadingTenants ? (\n <Skeleton className=\"h-10 w-full\" />\n ) : tenantsError ? (\n <div className=\"flex items-center gap-2 text-sm text-status-error-text\">\n <AlertCircle size={16} />\n {tWithFallback(\n t,\n 'createWorkspace.failedToLoadTenants',\n 'Failed to load tenants'\n )}\n </div>\n ) : tenants.length === 0 ? (\n <div className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.noTenantsAvailable',\n 'No tenants available. Contact your administrator.'\n )}\n </div>\n ) : (\n <select\n id=\"workspace-tenant\"\n className=\"h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n {...form.register('tenantId')}\n >\n <option value=\"\">\n {tWithFallback(\n t,\n 'createWorkspace.selectTenantPlaceholder',\n 'Select a tenant'\n )}\n </option>\n {tenants.map((tenant) => (\n <option key={tenant.id} value={tenant.id}>\n {tenant.name}\n </option>\n ))}\n </select>\n )}\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.tenantHint',\n 'Select which tenant this workspace belongs to'\n )}\n </p>\n {form.formState.errors.tenantId?.message && (\n <p className=\"text-sm text-status-error-text\">\n {form.formState.errors.tenantId.message}\n </p>\n )}\n </div>\n ) : null}\n\n <div className=\"space-y-2\">\n <label\n htmlFor=\"workspace-organization\"\n className=\"text-sm font-medium text-text-primary\"\n >\n {tWithFallback(t, 'createWorkspace.organizationLabel', 'Organization *')}\n </label>\n {isLoadingOrganizations || isCheckingOrgPermissions ? (\n // While the permission check is in flight,\n // `workspaceCreateAllowedOrgIds` is empty so\n // `filteredOrganizations` is also empty. Render the same\n // skeleton we use for the org-load itself instead of the\n // \"no organizations found\" empty-state — otherwise a slow\n // rbac response briefly looks like an authorization\n // failure for users who DO have workspace:create.\n <Skeleton className=\"h-10 w-full\" />\n ) : organizationsError ? (\n <div className=\"flex items-center gap-2 text-sm text-status-error-text\">\n <AlertCircle size={16} />\n {tWithFallback(\n t,\n 'createWorkspace.failedToLoadOrganizations',\n 'Failed to load organizations'\n )}\n </div>\n ) : !selectedTenantId ? (\n <div className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.selectTenantFirst',\n 'Please select a tenant first'\n )}\n </div>\n ) : filteredOrganizations.length === 0 ? (\n <div className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.noOrganizationsFound',\n 'No organizations found for this tenant'\n )}\n </div>\n ) : (\n <select\n id=\"workspace-organization\"\n className=\"h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n disabled={!selectedTenantId}\n {...form.register('organizationId')}\n >\n <option value=\"\">\n {tWithFallback(\n t,\n 'createWorkspace.selectOrganizationPlaceholder',\n 'Select an organization'\n )}\n </option>\n {filteredOrganizations.map((org) => (\n <option key={org.id} value={org.id}>\n {org.name}\n </option>\n ))}\n </select>\n )}\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.organizationHint',\n 'Select which organization owns this workspace'\n )}\n </p>\n {form.formState.errors.organizationId?.message && (\n <p className=\"text-sm text-status-error-text\">\n {form.formState.errors.organizationId.message}\n </p>\n )}\n </div>\n\n <div className=\"flex justify-end gap-3 pt-4\">\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => navigate(`${basePath}/list`)}\n disabled={isPending}\n >\n {tWithFallback(t, 'createWorkspace.cancel', 'Cancel')}\n </Button>\n <Button\n type=\"submit\"\n disabled={\n isPending ||\n isLoadingTenants ||\n isLoadingOrganizations ||\n isCheckingOrgPermissions ||\n atWorkspaceCap\n }\n title={\n atWorkspaceCap\n ? tWithFallback(\n t,\n 'createWorkspace.disabledAtCap',\n 'Workspace limit reached — upgrade your plan to create more.'\n )\n : undefined\n }\n >\n {isPending\n ? tWithFallback(t, 'createWorkspace.creating', 'Creating...')\n : tWithFallback(t, 'createWorkspace.submit', 'Create Workspace')}\n </Button>\n </div>\n </form>\n </CardContent>\n </GlassCard>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,SAAgB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S,iBAAiB;mBAJrC,CAME,kBAAC,UAAD;UAAQ,OAAM;oBACX,EACC,GACA,iDACA,yBACD;UACM,CAAA,EACR,EAAsB,KAAK,MAC1B,kBAAC,UAAD;UAAqB,OAAO,EAAI;oBAC7B,EAAI;UACE,EAFI,EAAI,GAER,CACT,CACK;aAlCT,kBAAC,OAAD;SAAK,WAAU;mBACZ,EACC,GACA,qCACA,+BACD;SACG,CAAA;QA8BR,kBAAC,KAAD;SAAG,WAAU;mBACV,EACC,GACA,oCACA,gDACD;SACC,CAAA;QACH,EAAK,UAAU,OAAO,gBAAgB,WACrC,kBAAC,KAAD;SAAG,WAAU;mBACV,EAAK,UAAU,OAAO,eAAe;SACpC,CAAA;QAEF;;MAEN,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,GAAD;QACE,MAAK;QACL,SAAQ;QACR,eAAe,EAAS,GAAG,EAAS,OAAO;QAC3C,UAAU;kBAET,EAAc,GAAG,0BAA0B,SAAS;QAC9C,CAAA,EACT,kBAAC,GAAD;QACE,MAAK;QACL,UACE,KACA,KACA,KACA,KACA;QAEF,OACE,IACI,EACE,GACA,iCACA,8DACD,GACD,KAAA;kBAGL,IACG,EAAc,GAAG,4BAA4B,cAAc,GAC3D,EAAc,GAAG,0BAA0B,mBAAmB;QAC3D,CAAA,CACL;;MACD;OACK,EAAA,CAAA,CACJ;;GACR"}
1
+ {"version":3,"file":"CreateWorkspacePage.js","names":[],"sources":["../../src/pages/CreateWorkspacePage.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react';\nimport { ArrowLeft, AlertCircle } from 'lucide-react';\nimport { Link, useNavigate } from 'react-router-dom';\nimport {\n Button,\n GlassCard,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n Skeleton,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useForm, z } from '@burdenoff/fe-libs/form';\nimport { AccessDenied, UpgradeInlineBanner } from '@burdenoff/fe-libs/shared/components';\nimport { useUpgradePrompt } from '@burdenoff/fe-libs/shared/hooks';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useCreateWorkspace } from '../hooks/useWorkspaceMutations';\nimport { useMyTenants, useMyOrganizations } from '../hooks/useTenants';\nimport { useOrgsWithPermission } from '../hooks/useOrgsWithPermission';\nimport { useWorkspacesContext } from '../providers/WorkspacesProvider';\nimport { useWorkspacesPageView } from '../hooks/useWorkspacesPageView';\nimport { generateSlug } from '../utils/slug';\nimport { tWithFallback } from '../utils/i18n';\n\ntype CreateWorkspaceFormData = {\n name: string;\n slug: string;\n tenantId: string;\n organizationId: string;\n};\n\nexport function CreateWorkspacePage() {\n useWorkspacesPageView('workspaces.create');\n const { t } = useI18n();\n const {\n isFree,\n approachingLimits,\n plan: planSnapshot,\n } = useUpgradePrompt({ resource: 'workspaces' });\n const workspacesUsage = approachingLimits[0];\n const atWorkspaceCap =\n !!workspacesUsage &&\n typeof workspacesUsage.limit === 'number' &&\n workspacesUsage.current >= workspacesUsage.limit;\n const showUpgradeBanner = isFree && !!workspacesUsage;\n const createWorkspaceSchema = useMemo(\n () =>\n z.object({\n name: z\n .string()\n .min(\n 2,\n tWithFallback(\n t,\n 'createWorkspace.validation.nameMin',\n 'Name must be at least 2 characters'\n )\n )\n .max(100),\n slug: z\n .string()\n .min(\n 2,\n tWithFallback(\n t,\n 'createWorkspace.validation.slugMin',\n 'Slug must be at least 2 characters'\n )\n )\n .max(50)\n .regex(\n /^[a-z0-9-]+$/,\n tWithFallback(\n t,\n 'createWorkspace.validation.slugFormat',\n 'Slug can only contain lowercase letters, numbers, and hyphens'\n )\n ),\n tenantId: z\n .string()\n .min(\n 1,\n tWithFallback(t, 'createWorkspace.validation.tenantRequired', 'Please select a tenant')\n ),\n organizationId: z\n .string()\n .min(\n 1,\n tWithFallback(\n t,\n 'createWorkspace.validation.organizationRequired',\n 'Please select an organization'\n )\n ),\n }),\n [t]\n );\n\n const navigate = useNavigate();\n const { basePath = '/' } = useWorkspacesContext();\n const { mutate: createWorkspace, isPending } = useCreateWorkspace();\n const { data: tenantsData, isLoading: isLoadingTenants, error: tenantsError } = useMyTenants();\n const {\n data: organizationsData,\n isLoading: isLoadingOrganizations,\n error: organizationsError,\n } = useMyOrganizations();\n\n const tenants = useMemo(() => tenantsData?.items ?? [], [tenantsData]);\n const allOrganizations = useMemo(() => organizationsData?.items ?? [], [organizationsData]);\n\n const defaultTenantId = useMemo(() => {\n const sharedTenant = tenants.find(\n (tenant) => tenant.type === 'SHARED' || tenant.slug === 'burdenoff-shared'\n );\n return sharedTenant?.id ?? tenants[0]?.id ?? '';\n }, [tenants]);\n\n const form = useForm<CreateWorkspaceFormData>({\n schema: createWorkspaceSchema,\n defaultValues: {\n name: '',\n slug: '',\n tenantId: '',\n organizationId: '',\n },\n });\n\n const selectedTenantId = form.watch('tenantId');\n const workspaceName = form.watch('name');\n\n // Check workspace:create permission across ALL the user's orgs up front\n // (bulk-checked in a single rbac round-trip). This is the authoritative\n // gate — only orgs where the user can actually create a workspace make\n // it into the dropdown, and the page can decisively render the \"no\n // permissions anywhere\" state once the check resolves.\n const allOrgIds = useMemo(() => allOrganizations.map((o) => o.id), [allOrganizations]);\n const {\n allowedIds: workspaceCreateAllowedOrgIds,\n loading: isCheckingOrgPermissions,\n isError: orgPermissionsHadError,\n } = useOrgsWithPermission(allOrgIds, 'workspace', 'create');\n\n // Filter organizations by selected tenant AND permission. When the rbac\n // permission lookup errored we deliberately skip the permission filter\n // (see `orgPermissionsHadError` block below) — the gateway @rbac\n // directive on `createWorkspace` is the authoritative gate, so it's\n // safer to let the user pick from the full tenant list and hit a 403 on\n // submit than to lock them out of a flow they actually have access to.\n const tenantOrganizations = useMemo(() => {\n if (!selectedTenantId) return [];\n return allOrganizations.filter((org) => org.tenantId === selectedTenantId);\n }, [selectedTenantId, allOrganizations]);\n const filteredOrganizations = useMemo(() => {\n if (orgPermissionsHadError) return tenantOrganizations;\n return tenantOrganizations.filter((org) => workspaceCreateAllowedOrgIds.has(org.id));\n }, [tenantOrganizations, workspaceCreateAllowedOrgIds, orgPermissionsHadError]);\n\n // Auto-generate slug from name (clear when name is empty)\n useEffect(() => {\n form.setValue('slug', workspaceName ? generateSlug(workspaceName) : '');\n }, [workspaceName, form]);\n\n // Reset organizationId when tenant changes\n useEffect(() => {\n form.setValue('organizationId', '');\n }, [selectedTenantId, form]);\n\n useEffect(() => {\n if (!form.getValues('tenantId') && defaultTenantId) {\n form.setValue('tenantId', defaultTenantId, {\n shouldDirty: false,\n shouldTouch: false,\n });\n }\n }, [defaultTenantId, form]);\n\n useEffect(() => {\n const currentOrganizationId = form.getValues('organizationId');\n const hasCurrentOrganization = filteredOrganizations.some(\n (organization) => organization.id === currentOrganizationId\n );\n\n if (!hasCurrentOrganization && filteredOrganizations[0]?.id) {\n form.setValue('organizationId', filteredOrganizations[0].id, {\n shouldDirty: false,\n shouldTouch: false,\n });\n }\n }, [filteredOrganizations, form]);\n\n const onSubmit = (data: CreateWorkspaceFormData) => {\n createWorkspace(\n {\n name: data.name,\n slug: data.slug,\n tenantId: data.tenantId,\n organizationId: data.organizationId,\n },\n {\n onSuccess: (newWorkspace) => {\n // Navigate to the new workspace\n navigate(`${basePath}/${newWorkspace.id}`);\n },\n }\n );\n };\n\n // `workspace:create` is an org-scoped permission. Page-level `PermissionGate`\n // resolved at the outer shell scope and incorrectly denied users who *do*\n // have the permission inside at least one of their orgs. The authoritative\n // gate now lives on the org dropdown (only orgs where the user has\n // workspace:create are listed via useOrgsWithPermission) and on the gateway\n // @rbac directive enforcing the createWorkspace mutation. We still want a\n // clear \"you can't create anywhere\" empty state — once tenants and org\n // permission lookups have settled, if no org is eligible we render it.\n // The AccessDenied empty-state should ONLY render when we know with\n // certainty that the user has no creatable org. That requires:\n // 1. tenants + organizations queries both succeeded (otherwise an\n // empty `allOrganizations` is a data-fetch failure, not an authz\n // failure — masking it as \"permission denied\" hides the real\n // error and offers the user no path to retry),\n // 2. the rbac permission lookup also succeeded (errors there fall\n // through to the unfiltered form via the warning banner below),\n // 3. and even then, only when the user has at least one org but none\n // of them allow workspace:create.\n // If `allOrganizations` is empty because the user genuinely belongs to\n // no orgs, the inner \"no organizations found for this tenant\" message\n // is a better surface than an authz-denied page.\n const hasAnyCreatableOrg = workspaceCreateAllowedOrgIds.size > 0;\n const stillResolvingPermissions =\n isLoadingTenants || isLoadingOrganizations || isCheckingOrgPermissions;\n const orgDataLoadedSuccessfully =\n !tenantsError && !organizationsError && allOrganizations.length > 0;\n if (\n !stillResolvingPermissions &&\n !orgPermissionsHadError &&\n orgDataLoadedSuccessfully &&\n !hasAnyCreatableOrg\n ) {\n return (\n <div className=\"p-6\">\n <Link\n to={`${basePath}/list`}\n className=\"inline-flex items-center gap-2 text-text-secondary hover:text-text-primary transition-colors mb-6\"\n >\n <ArrowLeft size={20} />\n {tWithFallback(t, 'createWorkspace.backToWorkspaces', 'Back to Workspaces')}\n </Link>\n <AccessDenied\n variant=\"card\"\n title={tWithFallback(t, 'createWorkspace.permissionRequiredTitle', 'Permission Required')}\n description={tWithFallback(\n t,\n 'createWorkspace.permissionRequiredDescription',\n \"You don't have permission to create workspaces in any of your organizations.\"\n )}\n details={tWithFallback(\n t,\n 'createWorkspace.permissionRequiredDetails',\n 'Required: workspace:create'\n )}\n primaryAction={{\n label: tWithFallback(t, 'createWorkspace.goBack', 'Go Back'),\n onClick: () => navigate(`${basePath}/list`),\n }}\n />\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6\">\n {/* Back link */}\n <Link\n to={`${basePath}/list`}\n className=\"inline-flex items-center gap-2 text-text-secondary hover:text-text-primary transition-colors\"\n >\n <ArrowLeft size={20} />\n {tWithFallback(t, 'createWorkspace.backToWorkspaces', 'Back to Workspaces')}\n </Link>\n\n <div className=\"max-w-2xl mx-auto w-full\">\n <PagePurpose>\n {tWithFallback(\n t,\n 'createWorkspace.purpose',\n 'Create a workspace to give a team, client or initiative its own dedicated space — with its own projects, members, agents and activity, kept separate from the rest. Give it a clear name, pick the organization that owns it, and you can invite people and add projects right after.'\n )}\n </PagePurpose>\n </div>\n\n {showUpgradeBanner && (\n <div className=\"max-w-2xl mx-auto w-full\">\n <UpgradeInlineBanner\n resource=\"workspaces\"\n current={workspacesUsage.current}\n limit={workspacesUsage.limit ?? undefined}\n severity={atWorkspaceCap ? 'critical' : undefined}\n message={\n atWorkspaceCap\n ? tWithFallback(\n t,\n 'createWorkspace.upgradeCapMessage',\n `You've used all workspaces in the ${planSnapshot?.planName ?? 'free'} plan.`\n )\n : tWithFallback(\n t,\n 'createWorkspace.upgradeApproachingMessage',\n 'Upgrade to create more workspaces.'\n )\n }\n />\n </div>\n )}\n\n {/* Form card */}\n <GlassCard treatment=\"glass\" glow className=\"max-w-2xl mx-auto border-border-seam\">\n <CardHeader>\n <CardTitle>{tWithFallback(t, 'createWorkspace.title', 'Create New Workspace')}</CardTitle>\n <CardDescription>\n {tWithFallback(t, 'createWorkspace.subtitle', 'Set up a new workspace for your team')}\n </CardDescription>\n </CardHeader>\n <CardContent>\n {orgPermissionsHadError && (\n <div\n role=\"alert\"\n className=\"mb-4 flex items-start gap-2 rounded-md border border-warning/30 bg-warning/10 p-3 text-sm text-text-primary\"\n >\n <AlertCircle size={16} className=\"mt-0.5 shrink-0 text-warning\" />\n <span>\n {tWithFallback(\n t,\n 'createWorkspace.permissionCheckUnavailable',\n \"We couldn't verify your workspace-create permissions just now, so the organization list isn't filtered. If you submit and don't have access, the request will be rejected and you can retry.\"\n )}\n </span>\n </div>\n )}\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-6\">\n <div className=\"space-y-2\">\n <label htmlFor=\"workspace-name\" className=\"text-sm font-medium text-text-primary\">\n {tWithFallback(t, 'createWorkspace.nameLabel', 'Workspace Name *')}\n </label>\n <input\n id=\"workspace-name\"\n placeholder={tWithFallback(t, 'createWorkspace.namePlaceholder', 'My Workspace')}\n className=\"h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n {...form.register('name')}\n />\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.nameHint',\n 'A descriptive name for your workspace'\n )}\n </p>\n {form.formState.errors.name?.message && (\n <p className=\"text-sm text-status-error-text\">\n {form.formState.errors.name.message}\n </p>\n )}\n </div>\n\n <div className=\"space-y-2\">\n <label htmlFor=\"workspace-slug\" className=\"text-sm font-medium text-text-primary\">\n {tWithFallback(t, 'createWorkspace.slugLabel', 'Slug *')}\n </label>\n <input\n id=\"workspace-slug\"\n placeholder={tWithFallback(t, 'createWorkspace.slugPlaceholder', 'my-workspace')}\n className=\"h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n {...form.register('slug')}\n />\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.slugHint',\n 'URL-friendly identifier (auto-generated, but you can edit it)'\n )}\n </p>\n {form.formState.errors.slug?.message && (\n <p className=\"text-sm text-status-error-text\">\n {form.formState.errors.slug.message}\n </p>\n )}\n </div>\n\n {/* Tenant picker — shown only when the user has more than one\n tenant to choose between. With a single shared tenant there is\n nothing to choose, so it is hidden and auto-selected. The\n loading / error / empty branches still render (length !== 1). */}\n {tenants.length !== 1 ? (\n <div className=\"space-y-2\">\n <label htmlFor=\"workspace-tenant\" className=\"text-sm font-medium text-text-primary\">\n {tWithFallback(t, 'createWorkspace.tenantLabel', 'Tenant *')}\n </label>\n {isLoadingTenants ? (\n <Skeleton className=\"h-10 w-full\" />\n ) : tenantsError ? (\n <div className=\"flex items-center gap-2 text-sm text-status-error-text\">\n <AlertCircle size={16} />\n {tWithFallback(\n t,\n 'createWorkspace.failedToLoadTenants',\n 'Failed to load tenants'\n )}\n </div>\n ) : tenants.length === 0 ? (\n <div className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.noTenantsAvailable',\n 'No tenants available. Contact your administrator.'\n )}\n </div>\n ) : (\n <select\n id=\"workspace-tenant\"\n className=\"h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n {...form.register('tenantId')}\n >\n <option value=\"\">\n {tWithFallback(\n t,\n 'createWorkspace.selectTenantPlaceholder',\n 'Select a tenant'\n )}\n </option>\n {tenants.map((tenant) => (\n <option key={tenant.id} value={tenant.id}>\n {tenant.name}\n </option>\n ))}\n </select>\n )}\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.tenantHint',\n 'Select which tenant this workspace belongs to'\n )}\n </p>\n {form.formState.errors.tenantId?.message && (\n <p className=\"text-sm text-status-error-text\">\n {form.formState.errors.tenantId.message}\n </p>\n )}\n </div>\n ) : null}\n\n <div className=\"space-y-2\">\n <label\n htmlFor=\"workspace-organization\"\n className=\"text-sm font-medium text-text-primary\"\n >\n {tWithFallback(t, 'createWorkspace.organizationLabel', 'Organization *')}\n </label>\n {isLoadingOrganizations || isCheckingOrgPermissions ? (\n // While the permission check is in flight,\n // `workspaceCreateAllowedOrgIds` is empty so\n // `filteredOrganizations` is also empty. Render the same\n // skeleton we use for the org-load itself instead of the\n // \"no organizations found\" empty-state — otherwise a slow\n // rbac response briefly looks like an authorization\n // failure for users who DO have workspace:create.\n <Skeleton className=\"h-10 w-full\" />\n ) : organizationsError ? (\n <div className=\"flex items-center gap-2 text-sm text-status-error-text\">\n <AlertCircle size={16} />\n {tWithFallback(\n t,\n 'createWorkspace.failedToLoadOrganizations',\n 'Failed to load organizations'\n )}\n </div>\n ) : !selectedTenantId ? (\n <div className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.selectTenantFirst',\n 'Please select a tenant first'\n )}\n </div>\n ) : filteredOrganizations.length === 0 ? (\n <div className=\"text-sm text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.noOrganizationsFound',\n 'No organizations found for this tenant'\n )}\n </div>\n ) : (\n <select\n id=\"workspace-organization\"\n className=\"h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n disabled={!selectedTenantId}\n {...form.register('organizationId')}\n >\n <option value=\"\">\n {tWithFallback(\n t,\n 'createWorkspace.selectOrganizationPlaceholder',\n 'Select an organization'\n )}\n </option>\n {filteredOrganizations.map((org) => (\n <option key={org.id} value={org.id}>\n {org.name}\n </option>\n ))}\n </select>\n )}\n <p className=\"text-xs text-text-secondary\">\n {tWithFallback(\n t,\n 'createWorkspace.organizationHint',\n 'Select which organization owns this workspace'\n )}\n </p>\n {form.formState.errors.organizationId?.message && (\n <p className=\"text-sm text-status-error-text\">\n {form.formState.errors.organizationId.message}\n </p>\n )}\n </div>\n\n <div className=\"flex justify-end gap-3 pt-4\">\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => navigate(`${basePath}/list`)}\n disabled={isPending}\n >\n {tWithFallback(t, 'createWorkspace.cancel', 'Cancel')}\n </Button>\n <Button\n type=\"submit\"\n disabled={\n isPending ||\n isLoadingTenants ||\n isLoadingOrganizations ||\n isCheckingOrgPermissions ||\n atWorkspaceCap\n }\n title={\n atWorkspaceCap\n ? tWithFallback(\n t,\n 'createWorkspace.disabledAtCap',\n 'Workspace limit reached — upgrade your plan to create more.'\n )\n : undefined\n }\n >\n {isPending\n ? tWithFallback(t, 'createWorkspace.creating', 'Creating...')\n : tWithFallback(t, 'createWorkspace.submit', 'Create Workspace')}\n </Button>\n </div>\n </form>\n </CardContent>\n </GlassCard>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,SAAgB,IAAsB;AACpC,GAAsB,oBAAoB;CAC1C,IAAM,EAAE,SAAM,GAAS,EACjB,EACJ,WACA,uBACA,MAAM,OACJ,EAAiB,EAAE,UAAU,cAAc,CAAC,EAC1C,IAAkB,GAAkB,IACpC,IACJ,CAAC,CAAC,KACF,OAAO,EAAgB,SAAU,YACjC,EAAgB,WAAW,EAAgB,OACvC,IAAoB,KAAU,CAAC,CAAC,GAChC,IAAwB,QAE1B,EAAE,OA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FI,EAAI,GAER,CACT,CACK;aAlCT,kBAAC,OAAD;SAAK,WAAU;mBACZ,EACC,GACA,qCACA,+BACD;SACG,CAAA;QA8BR,kBAAC,KAAD;SAAG,WAAU;mBACV,EACC,GACA,oCACA,gDACD;SACC,CAAA;QACH,EAAK,UAAU,OAAO,gBAAgB,WACrC,kBAAC,KAAD;SAAG,WAAU;mBACV,EAAK,UAAU,OAAO,eAAe;SACpC,CAAA;QAEF;;MAEN,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,GAAD;QACE,MAAK;QACL,SAAQ;QACR,eAAe,EAAS,GAAG,EAAS,OAAO;QAC3C,UAAU;kBAET,EAAc,GAAG,0BAA0B,SAAS;QAC9C,CAAA,EACT,kBAAC,GAAD;QACE,MAAK;QACL,UACE,KACA,KACA,KACA,KACA;QAEF,OACE,IACI,EACE,GACA,iCACA,8DACD,GACD,KAAA;kBAGL,IACG,EAAc,GAAG,4BAA4B,cAAc,GAC3D,EAAc,GAAG,0BAA0B,mBAAmB;QAC3D,CAAA,CACL;;MACD;OACK,EAAA,CAAA,CACJ;;GACR"}
@@ -6,13 +6,13 @@ import { useAcceptInvitation as i, useRejectInvitation as a } from "../hooks/use
6
6
  import { getProjectDisplayNames as o, getRoleDisplayNames as s, getWorkspaceDisplayName as c } from "../utils/invitationDisplay.js";
7
7
  import { AlertTriangle as l, Ban as u, CheckCircle as d, Clock as f, Home as p, Mail as m, RefreshCw as h, XCircle as g } from "lucide-react";
8
8
  import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
9
- import { Badge as b, Button as x, CardContent as S, CardDescription as C, CardHeader as w, CardTitle as T, GlassCard as E, Skeleton as D } from "@burdenoff/fe-libs/ui";
10
- import { useLocation as O, useNavigate as k, useParams as A } from "react-router-dom";
9
+ import { Badge as b, Button as x, CardContent as S, CardDescription as C, CardHeader as w, CardTitle as T, GlassCard as E, PagePurpose as D, Skeleton as O } from "@burdenoff/fe-libs/ui";
10
+ import { useLocation as ee, useNavigate as k, useParams as A } from "react-router-dom";
11
11
  import { useI18n as j } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
12
  //#region src/pages/InviteAcceptancePage.tsx
13
13
  function M() {
14
14
  n("workspaces.invite");
15
- let { t: l } = j(), { invitationId: u } = A(), D = O(), M = k(), { authToken: B } = e(), V = u || D.pathname.split("/").filter(Boolean).at(-1) || "", H = !!B, U = V ? `/auth/login?returnTo=${encodeURIComponent(`/workspaces/invite/${V}`)}` : "/auth/login?returnTo=%2Fworkspaces%2Flist", { data: W, isLoading: G, error: K, refetch: q } = r(V || "", H), { mutate: J, isPending: Y } = i(), { mutate: X, isPending: Z } = a(), ee = W ? c(W) : null, Q = W ? s(W) : [], $ = W ? o(W) : [], te = () => {
15
+ let { t: l } = j(), { invitationId: u } = A(), O = ee(), M = k(), { authToken: B } = e(), V = u || O.pathname.split("/").filter(Boolean).at(-1) || "", H = !!B, U = V ? `/auth/login?returnTo=${encodeURIComponent(`/workspaces/invite/${V}`)}` : "/auth/login?returnTo=%2Fworkspaces%2Flist", { data: W, isLoading: G, error: K, refetch: q } = r(V || "", H), { mutate: J, isPending: Y } = i(), { mutate: X, isPending: Z } = a(), te = W ? c(W) : null, Q = W ? s(W) : [], $ = W ? o(W) : [], ne = () => {
16
16
  V && J(V, {
17
17
  onSuccess: (e) => {
18
18
  let t = e.workspaceId || W?.workspaceId;
@@ -59,7 +59,7 @@ function M() {
59
59
  })]
60
60
  })
61
61
  });
62
- let ne = () => {
62
+ let re = () => {
63
63
  V && X(V, {
64
64
  onSuccess: () => {
65
65
  M("/workspaces/list");
@@ -84,6 +84,7 @@ function M() {
84
84
  className: "min-h-screen flex items-center justify-center p-4 bg-bg-sunken/30",
85
85
  children: /* @__PURE__ */ y(E, {
86
86
  treatment: "glass",
87
+ glow: !0,
87
88
  className: "max-w-2xl w-full",
88
89
  children: [/* @__PURE__ */ v(w, { children: /* @__PURE__ */ y("div", {
89
90
  className: "flex items-center gap-3",
@@ -99,94 +100,98 @@ function M() {
99
100
  })]
100
101
  }) }), /* @__PURE__ */ y(S, {
101
102
  className: "space-y-6",
102
- children: [/* @__PURE__ */ y("div", {
103
- className: "space-y-4 p-4 rounded-lg bg-bg-sunken/50",
104
- children: [
105
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
106
- className: "text-sm font-medium text-text-secondary",
107
- children: t(l, "inviteAcceptance.emailAddressLabel", "Email Address")
108
- }), /* @__PURE__ */ v("p", {
109
- className: "text-lg font-medium mt-1",
110
- children: W.email
111
- })] }),
112
- /* @__PURE__ */ y("div", { children: [
113
- /* @__PURE__ */ v("p", {
103
+ children: [
104
+ /* @__PURE__ */ v(D, { children: t(l, "inviteAcceptance.purpose", "Someone has invited you to join their workspace. Review the details below — which workspace it is, the roles and projects you would receive, and when the invite expires — then accept to become a member or reject to decline.") }),
105
+ /* @__PURE__ */ y("div", {
106
+ className: "space-y-4 p-4 rounded-lg bg-bg-sunken/50",
107
+ children: [
108
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
114
109
  className: "text-sm font-medium text-text-secondary",
115
- children: t(l, "inviteAcceptance.workspaceLabel", "Workspace")
116
- }),
117
- /* @__PURE__ */ v("p", {
118
- className: "text-lg font-medium mt-1 break-words",
119
- children: ee
120
- }),
121
- W.workspaceId ? /* @__PURE__ */ v("p", {
122
- className: "mt-1 font-mono text-xs text-text-secondary break-all",
123
- children: W.workspaceId
124
- }) : null
125
- ] }),
126
- W.expiresAt && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
127
- className: "text-sm font-medium text-text-secondary",
128
- children: t(l, "inviteAcceptance.expiresLabel", "Expires")
129
- }), /* @__PURE__ */ y("p", {
130
- className: "text-lg font-medium mt-1 flex items-center gap-2",
131
- children: [/* @__PURE__ */ v(f, {
132
- size: 16,
133
- className: "text-text-secondary"
134
- }), new Date(W.expiresAt).toLocaleDateString("en-US", {
135
- year: "numeric",
136
- month: "long",
137
- day: "numeric",
138
- hour: "2-digit",
139
- minute: "2-digit"
140
- })]
141
- })] }),
142
- Q.length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
143
- className: "text-sm font-medium text-text-secondary mb-2",
144
- children: t(l, "inviteAcceptance.rolesLabel", "Roles")
145
- }), /* @__PURE__ */ v("div", {
146
- className: "flex flex-wrap gap-2",
147
- children: Q.map((e, t) => /* @__PURE__ */ v(b, {
148
- variant: "secondary",
149
- children: e
150
- }, `${W.id}-${W.roleIds[t] ?? e}`))
151
- })] }),
152
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
153
- className: "text-sm font-medium text-text-secondary mb-2",
154
- children: t(l, "inviteAcceptance.projectsLabel", "Projects")
155
- }), /* @__PURE__ */ v("div", {
156
- className: "flex flex-wrap gap-2",
157
- children: $.length > 0 ? $.map((e, t) => /* @__PURE__ */ v(b, {
158
- variant: "outline",
159
- children: e
160
- }, `${W.id}-project-${e}-${t}`)) : /* @__PURE__ */ v("p", {
161
- className: "text-sm text-text-secondary",
162
- children: t(l, "inviteAcceptance.noProjects", "No project memberships will be granted automatically with this invitation.")
163
- })
164
- })] }),
165
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
166
- className: "text-sm font-medium text-text-secondary",
167
- children: t(l, "inviteAcceptance.invitationIdLabel", "Invitation ID")
168
- }), /* @__PURE__ */ v("p", {
169
- className: "text-sm font-mono mt-1 text-text-secondary",
170
- children: W.id
171
- })] })
172
- ]
173
- }), /* @__PURE__ */ y("div", {
174
- className: "flex flex-col sm:flex-row gap-3 pt-4 border-t",
175
- children: [/* @__PURE__ */ v(x, {
176
- onClick: te,
177
- disabled: Y || Z,
178
- className: "flex-1",
179
- size: "lg",
180
- children: Y ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, { className: "mr-2 size-4 animate-spin" }), t(l, "inviteAcceptance.accepting", "Accepting...")] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(d, { className: "mr-2 size-4" }), t(l, "inviteAcceptance.acceptButton", "Accept Invitation")] })
181
- }), /* @__PURE__ */ v(x, {
182
- variant: "outline",
183
- onClick: ne,
184
- disabled: Y || Z,
185
- className: "flex-1",
186
- size: "lg",
187
- children: Z ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, { className: "mr-2 size-4 animate-spin" }), t(l, "inviteAcceptance.rejecting", "Rejecting...")] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(g, { className: "mr-2 size-4" }), t(l, "inviteAcceptance.rejectButton", "Reject")] })
188
- })]
189
- })]
110
+ children: t(l, "inviteAcceptance.emailAddressLabel", "Email Address")
111
+ }), /* @__PURE__ */ v("p", {
112
+ className: "text-lg font-medium mt-1",
113
+ children: W.email
114
+ })] }),
115
+ /* @__PURE__ */ y("div", { children: [
116
+ /* @__PURE__ */ v("p", {
117
+ className: "text-sm font-medium text-text-secondary",
118
+ children: t(l, "inviteAcceptance.workspaceLabel", "Workspace")
119
+ }),
120
+ /* @__PURE__ */ v("p", {
121
+ className: "text-lg font-medium mt-1 break-words",
122
+ children: te
123
+ }),
124
+ W.workspaceId ? /* @__PURE__ */ v("p", {
125
+ className: "mt-1 font-mono text-xs text-text-secondary break-all",
126
+ children: W.workspaceId
127
+ }) : null
128
+ ] }),
129
+ W.expiresAt && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
130
+ className: "text-sm font-medium text-text-secondary",
131
+ children: t(l, "inviteAcceptance.expiresLabel", "Expires")
132
+ }), /* @__PURE__ */ y("p", {
133
+ className: "text-lg font-medium mt-1 flex items-center gap-2",
134
+ children: [/* @__PURE__ */ v(f, {
135
+ size: 16,
136
+ className: "text-text-secondary"
137
+ }), new Date(W.expiresAt).toLocaleDateString("en-US", {
138
+ year: "numeric",
139
+ month: "long",
140
+ day: "numeric",
141
+ hour: "2-digit",
142
+ minute: "2-digit"
143
+ })]
144
+ })] }),
145
+ Q.length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
146
+ className: "text-sm font-medium text-text-secondary mb-2",
147
+ children: t(l, "inviteAcceptance.rolesLabel", "Roles")
148
+ }), /* @__PURE__ */ v("div", {
149
+ className: "flex flex-wrap gap-2",
150
+ children: Q.map((e, t) => /* @__PURE__ */ v(b, {
151
+ variant: "secondary",
152
+ children: e
153
+ }, `${W.id}-${W.roleIds[t] ?? e}`))
154
+ })] }),
155
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
156
+ className: "text-sm font-medium text-text-secondary mb-2",
157
+ children: t(l, "inviteAcceptance.projectsLabel", "Projects")
158
+ }), /* @__PURE__ */ v("div", {
159
+ className: "flex flex-wrap gap-2",
160
+ children: $.length > 0 ? $.map((e, t) => /* @__PURE__ */ v(b, {
161
+ variant: "outline",
162
+ children: e
163
+ }, `${W.id}-project-${e}-${t}`)) : /* @__PURE__ */ v("p", {
164
+ className: "text-sm text-text-secondary",
165
+ children: t(l, "inviteAcceptance.noProjects", "No project memberships will be granted automatically with this invitation.")
166
+ })
167
+ })] }),
168
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
169
+ className: "text-sm font-medium text-text-secondary",
170
+ children: t(l, "inviteAcceptance.invitationIdLabel", "Invitation ID")
171
+ }), /* @__PURE__ */ v("p", {
172
+ className: "text-sm font-mono mt-1 text-text-secondary",
173
+ children: W.id
174
+ })] })
175
+ ]
176
+ }),
177
+ /* @__PURE__ */ y("div", {
178
+ className: "flex flex-col sm:flex-row gap-3 pt-4 border-t",
179
+ children: [/* @__PURE__ */ v(x, {
180
+ onClick: ne,
181
+ disabled: Y || Z,
182
+ className: "flex-1",
183
+ size: "lg",
184
+ children: Y ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, { className: "mr-2 size-4 animate-spin" }), t(l, "inviteAcceptance.accepting", "Accepting...")] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(d, { className: "mr-2 size-4" }), t(l, "inviteAcceptance.acceptButton", "Accept Invitation")] })
185
+ }), /* @__PURE__ */ v(x, {
186
+ variant: "outline",
187
+ onClick: re,
188
+ disabled: Y || Z,
189
+ className: "flex-1",
190
+ size: "lg",
191
+ children: Z ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, { className: "mr-2 size-4 animate-spin" }), t(l, "inviteAcceptance.rejecting", "Rejecting...")] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(g, { className: "mr-2 size-4" }), t(l, "inviteAcceptance.rejectButton", "Reject")] })
192
+ })]
193
+ })
194
+ ]
190
195
  })]
191
196
  })
192
197
  });
@@ -201,9 +206,9 @@ function N() {
201
206
  className: "max-w-2xl w-full",
202
207
  children: [/* @__PURE__ */ v(w, { children: /* @__PURE__ */ y("div", {
203
208
  className: "flex items-center gap-3",
204
- children: [/* @__PURE__ */ v(D, { className: "size-12 rounded-lg" }), /* @__PURE__ */ y("div", {
209
+ children: [/* @__PURE__ */ v(O, { className: "size-12 rounded-lg" }), /* @__PURE__ */ y("div", {
205
210
  className: "flex-1 space-y-2",
206
- children: [/* @__PURE__ */ v(D, { className: "h-6 w-48" }), /* @__PURE__ */ v(D, { className: "h-4 w-64" })]
211
+ children: [/* @__PURE__ */ v(O, { className: "h-6 w-48" }), /* @__PURE__ */ v(O, { className: "h-4 w-64" })]
207
212
  })]
208
213
  }) }), /* @__PURE__ */ y(S, {
209
214
  className: "space-y-6",
@@ -211,14 +216,14 @@ function N() {
211
216
  className: "space-y-4 p-4 rounded-lg bg-bg-sunken/50",
212
217
  children: [/* @__PURE__ */ y("div", {
213
218
  className: "space-y-2",
214
- children: [/* @__PURE__ */ v(D, { className: "h-4 w-24" }), /* @__PURE__ */ v(D, { className: "h-6 w-48" })]
219
+ children: [/* @__PURE__ */ v(O, { className: "h-4 w-24" }), /* @__PURE__ */ v(O, { className: "h-6 w-48" })]
215
220
  }), /* @__PURE__ */ y("div", {
216
221
  className: "space-y-2",
217
- children: [/* @__PURE__ */ v(D, { className: "h-4 w-24" }), /* @__PURE__ */ v(D, { className: "h-6 w-64" })]
222
+ children: [/* @__PURE__ */ v(O, { className: "h-4 w-24" }), /* @__PURE__ */ v(O, { className: "h-6 w-64" })]
218
223
  })]
219
224
  }), /* @__PURE__ */ y("div", {
220
225
  className: "flex gap-3 pt-4",
221
- children: [/* @__PURE__ */ v(D, { className: "h-12 flex-1" }), /* @__PURE__ */ v(D, { className: "h-12 flex-1" })]
226
+ children: [/* @__PURE__ */ v(O, { className: "h-12 flex-1" }), /* @__PURE__ */ v(O, { className: "h-12 flex-1" })]
222
227
  })]
223
228
  })]
224
229
  })