@nocobase/portal-template-default 1.0.7 → 1.0.9
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/assets/CoordinateSystem-C8P-Cleg.js +1 -0
- package/dist/assets/LegendVisualProvider-Bdgkckq-.js +1 -0
- package/dist/assets/LineDraw-C0m1GONT.js +1 -0
- package/dist/assets/SymbolDraw-CCospe5G.js +1 -0
- package/dist/assets/VisualMapping-Cbv1v7Cd.js +1 -0
- package/dist/assets/ai-employee-shortcut-B253WWow.js +1 -0
- package/dist/assets/calendar-B3dXXyIv.js +1 -0
- package/dist/assets/chat-inline-xpQ9iq4p.js +1 -0
- package/dist/assets/chat-side-panel-layout-BVWsp5rr.js +1 -0
- package/dist/assets/components-ChhJaNRc.js +20 -0
- package/dist/assets/configuration-gate-Dwdq_lxf.js +1 -0
- package/dist/assets/createClipPathFromCoordSys-uEftn1Mq.js +1 -0
- package/dist/assets/createSeriesDataSimply-CI7l7Ufv.js +1 -0
- package/dist/assets/customGraphicKeyframeAnimation-DE3jSfMd.js +3 -0
- package/dist/assets/echarts-preview-C-cNUtJF.js +1 -0
- package/dist/assets/echarts-runtime-CEgJbv68.js +58 -0
- package/dist/assets/echarts-runtime-advanced-Buhm2BHz.js +1 -0
- package/dist/assets/echarts-runtime-common-DLAdBAIa.js +1 -0
- package/dist/assets/echarts-runtime-components-ypnyLkYx.js +1 -0
- package/dist/assets/echarts-runtime-hierarchy-ClStquCF.js +1 -0
- package/dist/assets/floating-BarTmn-b.js +13 -0
- package/dist/assets/index-BJIcYTdc.js +53 -0
- package/dist/assets/index-C6xNKxpg.js +656 -0
- package/dist/assets/index-D4JQi1TM.js +54 -0
- package/dist/assets/index-YA7-AUO8.css +1 -0
- package/dist/assets/index-g8zWVpP9.js +23 -0
- package/dist/assets/labelHelper-C137W5gU.js +1 -0
- package/dist/assets/nocobase-ai-chat-VTMaZFQB.svg +50 -0
- package/dist/assets/page-context-Cxx11gzg.js +73 -0
- package/dist/assets/prompt-card-BsYMW_rq.js +1 -0
- package/dist/assets/sectorHelper-Fqgz3uEk.js +1 -0
- package/dist/assets/shortcut-xtghDP63.js +47 -0
- package/dist/assets/static.browser-CfQQzERe.js +30 -0
- package/dist/assets/switch-DrxImI8F.js +1 -0
- package/dist/assets/tool-cards-BGfsY8JF.js +41 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +40 -0
- package/dist/index.raw.html +46 -0
- package/dist/logo-dark.png +0 -0
- package/dist/logo-mark-dark.png +0 -0
- package/dist/logo-mark.png +0 -0
- package/dist/logo.png +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import{O as k,j as e,w as r,G as K,H as $,J as R,K as f,M as _,N as j,r as m,P as G,b as W,x as o,y as l,z as b,A as d,D as T,I as g,T as V,B as n,E,F as H,l as I,U,Q as J,V as X,W as Q,X as Y}from"./index-C6xNKxpg.js";/**
|
|
2
|
+
* @license lucide-react v0.487.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Z=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]],S=k("layout-panel-top",Z);/**
|
|
7
|
+
* @license lucide-react v0.487.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const ee=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],O=k("lock-keyhole",ee);/**
|
|
12
|
+
* @license lucide-react v0.487.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const se=[["path",{d:"M2 21a8 8 0 0 1 10.434-7.62",key:"1yezr2"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"m19.5 14.3-.4.9",key:"1eb35c"}],["path",{d:"m16.9 20.8-.4.9",key:"dfjc4z"}],["path",{d:"m21.7 19.5-.9-.4",key:"q4dx6b"}],["path",{d:"m15.2 16.9-.9-.4",key:"1r0w5f"}],["path",{d:"m21.7 16.5-.9.4",key:"1knoei"}],["path",{d:"m15.2 19.1-.9.4",key:"j188fs"}],["path",{d:"m19.5 21.7-.4-.9",key:"1tonu5"}],["path",{d:"m16.9 15.2-.4-.9",key:"699xu"}]],te=k("user-round-cog",se),ae=[["anyOf","AclPermission[]","undefined","Allows the page when any listed permission is available."],["allOf","AclPermission[]","undefined","Requires every listed permission before rendering the page."],["fallback","ReactNode","AccessDenied","Replaces the complete page when its permission test fails."],["children","ReactNode","required","The protected page content."]],ie=[["resource","string","required","NocoBase collection or ACL resource name."],["action","string","required","Resource action such as list, show, create, edit, or delete."],["id","BaseKey","undefined","Optional record ID for record-scoped permission checks."],["dataSourceKey","string","undefined","Selects a non-main NocoBase data source."],["fallback",'"hidden" | "forbidden" | ReactNode','"hidden"',"Hides the region or replaces it with a local denied state."],["children","ReactNode","required","The protected page region."]],re=[["resource","string","required","NocoBase collection containing the field."],["action","string","required","The action whose field whitelist should be checked."],["field","string","required","Exact NocoBase field name."],["dataSourceKey","string","undefined","Selects a non-main NocoBase data source."],["fallback","ReactNode","null","Optional read-only replacement for a denied field."],["children","ReactNode","required","The protected field or field group."]];function ne(){return e.jsxs("section",{className:"space-y-5 border-t pt-8",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Permission boundaries"}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:"Components behind the patterns"}),e.jsx("p",{className:"mt-1.5 max-w-3xl text-sm leading-6 text-muted-foreground",children:"Use the smallest boundary that matches the intended user experience: complete page, independent region, or individual field."})]}),e.jsxs("div",{className:"space-y-7",children:[e.jsx(w,{title:"AclPage",description:"Protects a complete route or business page. This corresponds to the Page permission pattern above.",rows:ae}),e.jsx(w,{title:"AclRegion",description:"Protects one independent area inside a larger page. This corresponds to the Region permission pattern.",rows:ie}),e.jsx(w,{title:"AclField",description:"Protects one field or field group. This corresponds to the Field permission pattern.",rows:re})]})]})}function w({title:s,description:t,rows:i}){return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:s}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t})]}),e.jsx(r,{className:"gap-0 overflow-hidden py-0",children:e.jsxs(K,{children:[e.jsx($,{children:e.jsxs(R,{children:[e.jsx(f,{children:"Prop"}),e.jsx(f,{children:"Type"}),e.jsx(f,{children:"Default"}),e.jsx(f,{children:"Description"})]})}),e.jsx(_,{children:i.map(([a,c,p,u])=>e.jsxs(R,{children:[e.jsx(j,{className:"font-mono text-xs font-medium",children:a}),e.jsx(j,{className:"font-mono text-xs text-muted-foreground",children:c}),e.jsx(j,{className:"font-mono text-xs text-muted-foreground",children:p}),e.jsx(j,{className:"min-w-72 whitespace-normal text-muted-foreground",children:u})]},a))})]})})]})}function oe({config:s}){const[t,i]=m.useState(s.defaultScene),[a,c]=m.useState(s.defaultTarget),[p,u]=m.useState(!1),[M,C]=m.useState(!1),P=m.useMemo(()=>`Build a complete NocoBase ACL scene in the NocoBase Admin Starter.
|
|
17
|
+
|
|
18
|
+
Business scene
|
|
19
|
+
- Page or feature: ${t}
|
|
20
|
+
- Permission target: ${a}
|
|
21
|
+
- Use realistic fixed sample content so the permission behavior is visible immediately.
|
|
22
|
+
- Build the complete page section and user flow, not an isolated ACL snippet.
|
|
23
|
+
|
|
24
|
+
ACL scenario
|
|
25
|
+
${s.requirements}
|
|
26
|
+
|
|
27
|
+
Implementation contract
|
|
28
|
+
- Use the Starter's built-in NocoBase accessControlProvider and ACL store.
|
|
29
|
+
- NocoBase roles:check is the source of truth. Do not create a second permission store or hard-code role names.
|
|
30
|
+
- Keep backend ACL enforcement in place; frontend checks only control presentation and navigation.
|
|
31
|
+
- Import reusable components from the installed local entry point at @/extensions/nocobase-acl when page composition is needed.
|
|
32
|
+
- Resource actions use the application names list, show, create, edit, and delete. Let the Starter map them to NocoBase list/get/create/update/destroy.
|
|
33
|
+
- Preserve dataSourceKey when the collection belongs to a non-main data source.
|
|
34
|
+
- Show an understandable forbidden or hidden state where appropriate.
|
|
35
|
+
- Deliver complete React component code, resource metadata, route integration, and the visible sample UI.`,[s.requirements,t,a]);return e.jsxs("details",{className:"group rounded-xl border bg-muted/15",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-4 py-3 text-sm font-medium marker:hidden",children:[e.jsx(G,{className:"size-4 text-primary"}),"Prompt generator",e.jsx("span",{className:"ml-auto text-xs font-normal text-muted-foreground",children:s.title}),e.jsx(W,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-180"})]}),e.jsxs("div",{className:"grid items-start gap-5 border-t p-4 xl:grid-cols-[360px_minmax(0,1fr)]",children:[e.jsxs(r,{className:"gap-0 py-0",children:[e.jsxs(o,{className:"border-b py-4",children:[e.jsx(l,{className:"text-base",children:"Scenario settings"}),e.jsx(b,{children:s.description})]}),e.jsxs(d,{className:"space-y-5 py-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:`${s.title}-scene`,children:"Business scene"}),e.jsx(g,{id:`${s.title}-scene`,value:t,onChange:y=>i(y.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:`${s.title}-target`,children:"Permission target"}),e.jsx(V,{id:`${s.title}-target`,value:a,onChange:y=>c(y.target.value),className:"min-h-24"})]})]})]}),e.jsxs(r,{className:"min-w-0 gap-0 overflow-hidden py-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Generated prompt"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Updates as you change the business scene and permission target."})]}),e.jsxs(n,{size:"sm",onClick:async()=>{try{await navigator.clipboard.writeText(P),C(!1),u(!0),window.setTimeout(()=>u(!1),1500)}catch{C(!0)}},children:[p?e.jsx(E,{}):e.jsx(H,{}),p?"Copied":"Copy prompt"]})]}),M?e.jsx("p",{className:"border-b px-4 py-2 text-xs text-destructive",children:"Clipboard access failed. Select the prompt text and copy it manually."}):null,e.jsx("pre",{className:"max-h-[520px] overflow-auto whitespace-pre-wrap bg-muted/25 p-5 font-mono text-xs leading-5 text-muted-foreground",children:P})]})]})]})}function h({eyebrow:s,title:t,description:i,children:a,prompt:c}){return e.jsxs("section",{className:"space-y-5 border-t pt-8",children:[e.jsxs("div",{children:[e.jsx(I,{variant:"outline",children:s}),e.jsx("h2",{className:"mt-3 text-2xl font-semibold tracking-[-0.025em]",children:t}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-muted-foreground",children:i})]}),a,e.jsx(oe,{config:c})]})}const A=[{id:1,name:"Alex Johnson",username:"alex",email:"alex@example.com",phone:"+1 202 555 0148",role:"Administrator"},{id:2,name:"Jamie Chen",username:"jamie",email:"jamie@example.com",phone:"+1 202 555 0186",role:"Member"},{id:3,name:"Morgan Lee",username:"morgan",email:"morgan@example.com",phone:"+1 202 555 0162",role:"Member"}];function me(){return e.jsxs("div",{className:"space-y-10 pb-12",children:[e.jsxs("header",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-[-0.025em] sm:text-3xl",children:"Permission patterns"}),e.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:"Compare the authorized and restricted outcomes of navigation, pages, regions, record actions, and form fields using the same fixed data."})]}),e.jsx(h,{eyebrow:"Navigation permission",title:"Inaccessible resources disappear from navigation",description:"A denied collection is removed from the sidebar and its direct route is guarded. Other accessible navigation remains unchanged.",prompt:{title:"Resource navigation",description:"Generate application resources, sidebar behavior, and guarded routes backed by NocoBase collections.",defaultScene:"User and role administration",defaultTarget:"Allow the Users resource but remove Roles from navigation and block its direct URL.",requirements:`- Mark collection resources with meta.acl.type = "collection".
|
|
36
|
+
- Let the Starter filter inaccessible sidebar items and choose the first accessible default route.
|
|
37
|
+
- Wrap list, create, show, and edit routes with ResourceAccessGuard.
|
|
38
|
+
- Mark non-collection utility pages as authenticated, snippet, route, or acl: false instead of treating them as collections.
|
|
39
|
+
- If a parent route is denied but an accessible child remains, navigation must continue to the child route.`},children:e.jsx(x,{allowedTitle:"Users permission granted",deniedTitle:"Users permission denied",allowed:e.jsx(B,{showUsers:!0}),denied:e.jsx(B,{showUsers:!1})})}),e.jsx(h,{eyebrow:"Page permission",title:"A complete page is either available or replaced",description:"Page-level permission is useful when the whole route has one business purpose. Denial produces an understandable destination instead of a blank screen.",prompt:{title:"Page permission",description:"Generate a complete page whose availability depends on NocoBase permissions.",defaultScene:"User directory and account administration page",defaultTarget:"Require users:list before rendering the complete page.",requirements:`- Wrap the complete business page with AclPage.
|
|
40
|
+
- Use anyOf when one accessible collection is enough, or allOf when every permission is required.
|
|
41
|
+
- Provide a useful page-level fallback instead of rendering an empty screen.
|
|
42
|
+
- Keep each inner data region independently protected when the page combines multiple collections.`},children:e.jsx(x,{allowedTitle:"Page allowed",deniedTitle:"Page denied",allowed:e.jsx(le,{}),denied:e.jsx(de,{})})}),e.jsx(h,{eyebrow:"Region permission",title:"Only the protected region changes",description:"On a page with multiple data sources, denying Roles must not hide the Users table. The restricted panel can be hidden or replaced with a local explanation.",prompt:{title:"Region permission",description:"Generate a multi-table page where each region follows its own collection ACL.",defaultScene:"Identity administration dashboard",defaultTarget:"Keep Users visible while replacing the denied Roles panel with a local fallback.",requirements:`- Keep the outer page visible when its page-level permission is satisfied.
|
|
43
|
+
- Wrap every collection-backed panel in its own AclRegion.
|
|
44
|
+
- Enable each data query only when the corresponding list permission is allowed.
|
|
45
|
+
- Use fallback="hidden" for optional panels and fallback="forbidden" or a custom ReactNode when the missing region should be explained.
|
|
46
|
+
- Never use permission for one collection to hide unrelated tables or controls.`},children:e.jsx(x,{allowedTitle:"Both regions allowed",deniedTitle:"Roles region denied",allowed:e.jsx(q,{showRoles:!0}),denied:e.jsx(q,{showRoles:!1})})}),e.jsx(h,{eyebrow:"Action and record permission",title:"Only unavailable actions are removed",description:"Collection permission controls global actions such as Create. Record ACL metadata controls Edit and Delete for each individual row.",prompt:{title:"Action permission",description:"Generate a data table whose toolbar and row actions respond to collection and record scopes.",defaultScene:"User administration table",defaultTarget:"Allow all actions for one user record and show a view-only row when update and delete are denied.",requirements:`- Use the Starter dataProvider so X-With-ACL-Meta captures NocoBase allowedActions from list, get, and getMany responses.
|
|
47
|
+
- Use the built-in Create, Show, Edit, and Delete buttons; do not manually compare user IDs or role names.
|
|
48
|
+
- Collection-level denial hides the action everywhere.
|
|
49
|
+
- Record-level allowedActions must hide or disable only the affected row action.
|
|
50
|
+
- Keep 403 responses authenticated and let NocoBase perform the final action validation.`},children:e.jsx(x,{allowedTitle:"Create and row actions allowed",deniedTitle:"Create, Update, and Delete denied",allowed:e.jsx(z,{allowed:!0}),denied:e.jsx(z,{allowed:!1})})}),e.jsx(h,{eyebrow:"Field permission",title:"A form can mix editable, read-only, and hidden fields",description:"Field ACL does not have to hide the complete form. Only protected inputs change, while permitted fields remain usable.",prompt:{title:"Field permission",description:"Generate a form or detail page whose individual fields follow NocoBase field ACL.",defaultScene:"User profile edit form",defaultTarget:"Allow nickname editing, make email read-only, and hide phone when those fields are denied.",requirements:`- Wrap each protected field or field group with AclField.
|
|
51
|
+
- Pass the collection resource, application action, and exact field name.
|
|
52
|
+
- Choose whether a denied field is hidden, replaced by read-only output, or shown with a custom fallback.
|
|
53
|
+
- Do not infer field access from the overall edit permission.
|
|
54
|
+
- Submit only values the current UI is allowed to edit; NocoBase still performs final field validation.`},children:e.jsx(x,{allowedTitle:"All fields editable",deniedTitle:"Email read-only and phone hidden",allowed:e.jsx(D,{restricted:!1}),denied:e.jsx(D,{restricted:!0})})}),e.jsx(ne,{})]})}function x({allowedTitle:s,deniedTitle:t,allowed:i,denied:a}){return e.jsxs("div",{className:"grid items-start gap-5 xl:grid-cols-2",children:[e.jsxs("div",{className:"min-w-0 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-emerald-700 dark:text-emerald-400",children:[e.jsx(E,{className:"size-4"}),s]}),i]}),e.jsxs("div",{className:"min-w-0 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-400",children:[e.jsx(O,{className:"size-4"}),t]}),a]})]})}function B({showUsers:s}){return e.jsxs("div",{className:"grid min-h-48 grid-cols-[150px_minmax(0,1fr)] overflow-hidden rounded-xl border bg-background",children:[e.jsxs("aside",{className:"border-r bg-muted/35 p-3",children:[e.jsx("div",{className:"mb-3 text-xs font-semibold text-muted-foreground",children:"Workspace"}),e.jsx(N,{icon:e.jsx(S,{}),label:"Dashboard"}),s?e.jsx(N,{icon:e.jsx(U,{}),label:"Users",active:!0}):null,e.jsx(N,{icon:e.jsx(te,{}),label:"Roles"})]}),e.jsx("div",{className:"flex items-center justify-center p-5 text-center",children:s?e.jsxs("div",{children:[e.jsx(U,{className:"mx-auto size-7 text-primary"}),e.jsx("div",{className:"mt-2 font-medium",children:"Users"}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"Route is available"})]}):e.jsxs("div",{children:[e.jsx(S,{className:"mx-auto size-7 text-muted-foreground"}),e.jsx("div",{className:"mt-2 font-medium",children:"Dashboard"}),e.jsx("div",{className:"mt-1 max-w-48 text-xs text-muted-foreground",children:"Users is absent from navigation and its direct route is guarded."})]})})]})}function N({icon:s,label:t,active:i=!1}){return e.jsxs("div",{className:`mb-1 flex items-center gap-2 rounded-md px-2 py-2 text-xs ${i?"bg-primary text-primary-foreground":"text-muted-foreground"}`,children:[e.jsx("span",{className:"[&_svg]:size-3.5",children:s}),t]})}function le(){return e.jsxs(r,{children:[e.jsxs(o,{children:[e.jsx(l,{children:"User directory"}),e.jsx(b,{children:"3 users"})]}),e.jsx(d,{children:e.jsx(F,{})})]})}function de(){return e.jsx("div",{className:"flex min-h-64 items-center justify-center rounded-xl border border-dashed bg-background p-6 text-center",children:e.jsxs("div",{children:[e.jsx(O,{className:"mx-auto size-8 text-muted-foreground"}),e.jsx("div",{className:"mt-3 font-medium",children:"You cannot open this page"}),e.jsx("p",{className:"mx-auto mt-1 max-w-xs text-sm text-muted-foreground",children:"Ask an administrator for access to the user directory or return to an available page."}),e.jsx(n,{className:"mt-4",variant:"outline",size:"sm",children:"Return to dashboard"})]})})}function q({showRoles:s}){return e.jsxs("div",{className:`grid gap-3 rounded-xl border bg-background p-3 ${s?"md:grid-cols-[minmax(0,1.3fr)_minmax(180px,0.7fr)]":"grid-cols-1"}`,children:[e.jsxs(r,{size:"sm",children:[e.jsx(o,{children:e.jsx(l,{children:"Users"})}),e.jsx(d,{children:e.jsx(F,{limit:2})})]}),s?e.jsxs(r,{size:"sm",children:[e.jsx(o,{children:e.jsx(l,{children:"Roles"})}),e.jsxs(d,{className:"space-y-2",children:[e.jsx(L,{title:"Administrator",name:"admin"}),e.jsx(L,{title:"Member",name:"member"})]})]}):null]})}function z({allowed:s}){return e.jsxs(r,{children:[e.jsxs(o,{className:"flex-row items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(l,{children:"Users"}),e.jsx(b,{children:"Record actions"})]}),s?e.jsxs(n,{size:"sm",children:[e.jsx(J,{})," New user"]}):null]}),e.jsx(d,{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[420px] text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-left text-muted-foreground",children:[e.jsx("th",{className:"pb-3 font-medium",children:"User"}),e.jsx("th",{className:"pb-3 font-medium",children:"Role"}),e.jsx("th",{className:"pb-3 text-right font-medium",children:"Actions"})]})}),e.jsx("tbody",{children:A.slice(0,2).map(t=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsx("td",{className:"py-3 font-medium",children:t.name}),e.jsx("td",{className:"py-3 text-muted-foreground",children:t.role}),e.jsx("td",{className:"py-3",children:e.jsxs("div",{className:"flex justify-end gap-1",children:[e.jsx(n,{variant:"ghost",size:"icon-sm","aria-label":"View user",children:e.jsx(X,{})}),s?e.jsxs(e.Fragment,{children:[e.jsx(n,{variant:"ghost",size:"icon-sm","aria-label":"Edit user",children:e.jsx(Q,{})}),e.jsx(n,{variant:"ghost",size:"icon-sm","aria-label":"Delete user",children:e.jsx(Y,{})})]}):null]})})]},t.id))})]})})]})}function D({restricted:s}){const t=A[1];return e.jsxs(r,{children:[e.jsxs(o,{children:[e.jsx(l,{children:"Edit profile"}),e.jsx(b,{children:t.name})]}),e.jsxs(d,{className:"space-y-4",children:[e.jsx(v,{label:"Nickname",children:e.jsx(g,{defaultValue:t.name})}),e.jsx(v,{label:"Email",children:s?e.jsxs("div",{className:"rounded-md border bg-muted/45 px-3 py-2 text-sm text-muted-foreground",children:[t.email,e.jsx(I,{className:"ml-2",variant:"outline",children:"Read only"})]}):e.jsx(g,{defaultValue:t.email})}),s?null:e.jsx(v,{label:"Phone",children:e.jsx(g,{defaultValue:t.phone})}),e.jsx(n,{size:"sm",children:"Save changes"})]})]})}function v({label:s,children:t}){return e.jsxs("label",{className:"block space-y-2",children:[e.jsx("span",{className:"text-xs font-medium",children:s}),t]})}function F({limit:s=3}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[360px] text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-left text-muted-foreground",children:[e.jsx("th",{className:"pb-3 font-medium",children:"User"}),e.jsx("th",{className:"pb-3 font-medium",children:"Email"})]})}),e.jsx("tbody",{children:A.slice(0,s).map(t=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsxs("td",{className:"py-3",children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t.username})]}),e.jsx("td",{className:"py-3 text-muted-foreground",children:t.email})]},t.id))})]})})}function L({title:s,name:t}){return e.jsxs("div",{className:"rounded-lg border px-3 py-2",children:[e.jsx("div",{className:"text-sm font-medium",children:s}),e.jsx("div",{className:"mt-0.5 font-mono text-xs text-muted-foreground",children:t})]})}export{me as AclPatternsPage};
|