Skip to content

Commit 2c84e5e

Browse files
Deploy PR #6346 preview
1 parent 9dfe9fc commit 2c84e5e

3,152 files changed

Lines changed: 187574 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎pr/6346/.astryx-preview.json‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"version": 1,
3+
"repository": "facebook/astryx",
4+
"pullRequest": {
5+
"number": 6346,
6+
"headSha": "d9425653de47f40a4aea8b99418517775c412aff",
7+
"headRef": "night-watch-component-audit/ChartAxis/2026-09-16",
8+
"headRepository": "facebook/astryx",
9+
"headRepositoryId": "1131202426"
10+
},
11+
"sourceRun": {
12+
"id": 35089089678,
13+
"attempt": 1,
14+
"conclusion": "success"
15+
},
16+
"targets": {
17+
"storybook": {
18+
"available": true,
19+
"path": "pr/6346/",
20+
"indexSha256": "b1897f3f4703faf8ebc0206d5d9223d232a0528f87b91aed5b2877c19b7952cd"
21+
},
22+
"sandbox": {
23+
"available": true,
24+
"path": "pr/6346/sandbox/",
25+
"indexSha256": "39aa813710a482adb74481235844a28e61cd286f11d41564d058921da1516304"
26+
}
27+
}
28+
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
import{i as e,s as t}from"./preload-helper-CT_b8DTk.js";import{t as n}from"./react-B7Te67-h.js";import{t as r}from"./jsx-runtime-DqZldVDK.js";import{t as i}from"./Button-X-dHpmZa.js";import{t as a}from"./Button-CzpP5d6y.js";import{G as o,K as s,U as c}from"./iframe-1DDZOe-V.js";var l,u,d,f,p,m,h,g,_,v,y,b,x;e((()=>{l=t(n()),c(),a(),u=r(),d={title:`Core/AlertDialog`,component:s,tags:[`autodocs`],argTypes:{isOpen:{control:`boolean`},width:{control:`number`},actionVariant:{control:`select`,options:[`destructive`,`primary`,`secondary`,`ghost`]}}},f={render:()=>{let[e,t]=(0,l.useState)(!1);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i,{label:`Delete item`,variant:`destructive`,onClick:()=>t(!0)}),(0,u.jsx)(s,{isOpen:e,onOpenChange:t,title:`Delete item?`,description:`This action cannot be undone. The item and all its data will be permanently removed.`,actionLabel:`Delete`,onAction:()=>t(!1)})]})}},p={render:()=>{let[e,t]=(0,l.useState)(!1),[n,r]=(0,l.useState)(!1);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i,{label:`Revoke access`,variant:`destructive`,onClick:()=>t(!0)}),(0,u.jsx)(s,{isOpen:e,onOpenChange:t,title:`Revoke access?`,description:`This user will immediately lose access to all shared resources.`,actionLabel:`Revoke`,isActionLoading:n,onAction:async()=>{r(!0),await new Promise(e=>setTimeout(e,2e3)),r(!1),t(!1)}})]})}},m={args:{isOpen:!0,isInline:!0,title:`Delete item?`,description:`This action cannot be undone. The item and all its data will be permanently removed.`,actionLabel:`Delete`,onOpenChange:()=>{},onAction:()=>{}}},h={args:{isOpen:!0,isInline:!0,title:`Permanently delete this workspace?`,description:`Everyone will lose access to its dashboards, saved queries, and sharing links. This cannot be undone.`,cancelLabel:`Keep this workspace`,actionLabel:`Permanently delete workspace`,onOpenChange:()=>{},onAction:()=>{}}},g={args:h.args},_={render:()=>{let e=o();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i,{label:`Delete item`,variant:`destructive`,onClick:()=>e.show({title:`Delete item?`,description:`This action cannot be undone.`,actionLabel:`Delete`,onAction:()=>e.hide()})}),e.element]})}},v={render:()=>{let[e,t]=(0,l.useState)(!1);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i,{label:`Discard draft`,variant:`secondary`,onClick:()=>t(!0)}),(0,u.jsx)(s,{isOpen:e,onOpenChange:t,title:`Discard this draft?`,description:`Your unsaved edits will be lost.`,cancelLabel:`Keep editing`,actionLabel:`Discard`,onAction:()=>t(!1)})]})}},y={render:()=>{let[e,t]=(0,l.useState)(!1);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i,{label:`Delete workspace`,variant:`destructive`,onClick:()=>t(!0)}),(0,u.jsx)(s,{isOpen:e,onOpenChange:t,title:`Delete the entire Marketing Analytics workspace and everything inside it?`,description:`This removes 1,284 documents, 37 dashboards, every saved query, and all sharing links, for all 62 members of the workspace. Exports already scheduled will stop running. Anyone holding a link will get a 404 instead of the content. This cannot be undone, and support cannot restore it for you afterwards.`,actionLabel:`Delete workspace`,onAction:()=>t(!1)})]})}},b={args:{isOpen:!0,isInline:!0,title:`Delete item?`,description:`This action cannot be undone.`,actionLabel:`Delete`,onOpenChange:()=>{},onAction:()=>{}}},f.parameters={...f.parameters,docs:{...f.parameters?.docs,source:{originalSource:`{
2+
render: () => {
3+
const [isOpen, setIsOpen] = useState(false);
4+
return <>
5+
<Button label="Delete item" variant="destructive" onClick={() => setIsOpen(true)} />
6+
<AlertDialog isOpen={isOpen} onOpenChange={setIsOpen} title="Delete item?" description="This action cannot be undone. The item and all its data will be permanently removed." actionLabel="Delete" onAction={() => setIsOpen(false)} />
7+
</>;
8+
}
9+
}`,...f.parameters?.docs?.source},description:{story:`Delete confirmation — the most common alert dialog pattern.`,...f.parameters?.docs?.description}}},p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
10+
render: () => {
11+
const [isOpen, setIsOpen] = useState(false);
12+
const [isLoading, setIsLoading] = useState(false);
13+
return <>
14+
<Button label="Revoke access" variant="destructive" onClick={() => setIsOpen(true)} />
15+
<AlertDialog isOpen={isOpen} onOpenChange={setIsOpen} title="Revoke access?" description="This user will immediately lose access to all shared resources." actionLabel="Revoke" isActionLoading={isLoading} onAction={async () => {
16+
setIsLoading(true);
17+
await new Promise(r => setTimeout(r, 2000));
18+
setIsLoading(false);
19+
setIsOpen(false);
20+
}} />
21+
</>;
22+
}
23+
}`,...p.parameters?.docs?.source},description:{story:`Async action with loading state.`,...p.parameters?.docs?.description}}},m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
24+
args: {
25+
isOpen: true,
26+
isInline: true,
27+
title: 'Delete item?',
28+
description: 'This action cannot be undone. The item and all its data will be permanently removed.',
29+
actionLabel: 'Delete',
30+
onOpenChange: () => {},
31+
onAction: () => {}
32+
}
33+
}`,...m.parameters?.docs?.source},description:{story:`Wide reference state. In a wide viewport, Dialog preserves AlertDialog's
34+
preferred 400px surface and AlertDialog renders a horizontal action row.`,...m.parameters?.docs?.description}}},h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:`{
35+
args: {
36+
isOpen: true,
37+
isInline: true,
38+
title: 'Permanently delete this workspace?',
39+
description: 'Everyone will lose access to its dashboards, saved queries, and sharing links. This cannot be undone.',
40+
cancelLabel: 'Keep this workspace',
41+
actionLabel: 'Permanently delete workspace',
42+
onOpenChange: () => {},
43+
onAction: () => {}
44+
}
45+
}`,...h.parameters?.docs?.source},description:{story:`Narrow reference state. Use a <=640px viewport to see Dialog's width clamp
46+
with AlertDialog's destructive-above-Cancel stacked action order.`,...h.parameters?.docs?.description}}},g.parameters={...g.parameters,docs:{...g.parameters?.docs,source:{originalSource:`{
47+
args: NarrowFinePointer.args
48+
}`,...g.parameters?.docs?.source},description:{story:`Mobile reference state. Use a <=640px mobile viewport to verify the same
49+
stacked action order; this story does not emulate pointer or hover capability.`,...g.parameters?.docs?.description}}},_.parameters={..._.parameters,docs:{..._.parameters?.docs,source:{originalSource:`{
50+
render: () => {
51+
const alert = useImperativeAlertDialog();
52+
return <>
53+
<Button label="Delete item" variant="destructive" onClick={() => alert.show({
54+
title: 'Delete item?',
55+
description: 'This action cannot be undone.',
56+
actionLabel: 'Delete',
57+
onAction: () => alert.hide()
58+
})} />
59+
{alert.element}
60+
</>;
61+
}
62+
}`,..._.parameters?.docs?.source},description:{story:`Imperative API — no state management needed.`,..._.parameters?.docs?.description}}},v.parameters={...v.parameters,docs:{...v.parameters?.docs,source:{originalSource:`{
63+
render: () => {
64+
const [isOpen, setIsOpen] = useState(false);
65+
return <>
66+
<Button label="Discard draft" variant="secondary" onClick={() => setIsOpen(true)} />
67+
<AlertDialog isOpen={isOpen} onOpenChange={setIsOpen} title="Discard this draft?" description="Your unsaved edits will be lost." cancelLabel="Keep editing" actionLabel="Discard" onAction={() => setIsOpen(false)} />
68+
</>;
69+
}
70+
}`,...v.parameters?.docs?.source},description:{story:'A task-specific cancel label. Override `cancelLabel` when "Cancel" reads as\nambiguous next to the action, for example when both choices are verbs.',...v.parameters?.docs?.description}}},y.parameters={...y.parameters,docs:{...y.parameters?.docs,source:{originalSource:`{
71+
render: () => {
72+
const [isOpen, setIsOpen] = useState(false);
73+
return <>
74+
<Button label="Delete workspace" variant="destructive" onClick={() => setIsOpen(true)} />
75+
<AlertDialog isOpen={isOpen} onOpenChange={setIsOpen} title="Delete the entire Marketing Analytics workspace and everything inside it?" description="This removes 1,284 documents, 37 dashboards, every saved query, and all sharing links, for all 62 members of the workspace. Exports already scheduled will stop running. Anyone holding a link will get a 404 instead of the content. This cannot be undone, and support cannot restore it for you afterwards." actionLabel="Delete workspace" onAction={() => setIsOpen(false)} />
76+
</>;
77+
}
78+
}`,...y.parameters?.docs?.source},description:{story:`Long title and description. The dialog wraps rather than clipping, and the
79+
footer buttons stay on screen; the body scrolls when the viewport is short.`,...y.parameters?.docs?.description}}},b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
80+
args: {
81+
isOpen: true,
82+
isInline: true,
83+
title: 'Delete item?',
84+
description: 'This action cannot be undone.',
85+
actionLabel: 'Delete',
86+
onOpenChange: () => {},
87+
onAction: () => {}
88+
}
89+
}`,...b.parameters?.docs?.source},description:{story:'The inline preview path (`isInline`). Renders the content in place without\n`showModal()`, for documentation previews and showcases. It is not a modal:\nit does not trap focus, block the page, or respond to Escape — so it exposes\n`role="group"` rather than `role="alertdialog"`.',...b.parameters?.docs?.description}}},x=[`Delete`,`Async`,`DesktopFinePointer`,`NarrowFinePointer`,`MobileTouch`,`Imperative`,`CustomCancelLabel`,`LongContent`,`Inline`]}))();export{p as Async,v as CustomCancelLabel,f as Delete,m as DesktopFinePointer,_ as Imperative,b as Inline,y as LongContent,g as MobileTouch,h as NarrowFinePointer,x as __namedExportsOrder,d as default};

0 commit comments

Comments
 (0)