@orsetra/shared-ui 1.10.9 → 1.10.10
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.
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Lock } from "lucide-react"
|
|
3
|
+
import { cn } from "../../lib/utils"
|
|
4
|
+
|
|
5
|
+
export interface AccessDeniedStateProps {
|
|
6
|
+
resourceName: string
|
|
7
|
+
message?: string
|
|
8
|
+
className?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function AccessDeniedState({ resourceName, message, className }: AccessDeniedStateProps) {
|
|
12
|
+
return (
|
|
13
|
+
<div
|
|
14
|
+
className={cn(
|
|
15
|
+
"flex flex-col md:flex-row items-center justify-center gap-8 md:gap-12 p-6 md:p-12 min-h-[450px] bg-white text-center md:text-left",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
>
|
|
19
|
+
<div className="flex-shrink-0 h-40 w-40 bg-red-50 flex items-center justify-center">
|
|
20
|
+
<Lock className="h-20 w-20 text-red-200" />
|
|
21
|
+
</div>
|
|
22
|
+
<div className="max-w-md">
|
|
23
|
+
<h2 className="text-xl md:text-2xl font-semibold text-ibm-gray-100 mb-3 text-center md:text-left">
|
|
24
|
+
Access denied
|
|
25
|
+
</h2>
|
|
26
|
+
<p className="text-ibm-gray-60 text-sm md:text-base leading-relaxed text-center md:text-left">
|
|
27
|
+
{message ?? `You don't have permission to view ${resourceName} in this business unit.`}
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
)
|
|
32
|
+
}
|
package/components/ui/index.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from './
|
|
|
24
24
|
export { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel } from './alert-dialog'
|
|
25
25
|
export { Alert, AlertTitle, AlertDescription } from './alert'
|
|
26
26
|
export { AlertBanner, useAlertBanner, type AlertBannerProps, type AlertState } from './alert-banner'
|
|
27
|
+
export { AccessDeniedState, type AccessDeniedStateProps } from './access-denied-state'
|
|
27
28
|
export { ConfirmationDialog, type ConfirmationDialogProps } from './confirmation-dialog'
|
|
28
29
|
export { AspectRatio } from './aspect-ratio'
|
|
29
30
|
export { Badge } from './badge'
|