@12-apps/ui 6.53.0 → 6.54.0
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/_internal/components/data-display/AlertDialog/AlertDialog.js +2 -1
- package/dist/_internal/components/data-display/AlertDialog/AlertDialog.parts.js +9 -0
- package/dist/_internal/components/data-display/AlertDialog/AlertDialog.parts.js.map +1 -0
- package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +7 -6
- package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +7 -6
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +9 -8
- package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +7 -6
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +8 -7
- package/dist/_internal/components/data-display/index.js +2 -1
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmAction.js +4 -3
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmAction.parts.js +3 -2
- package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +5 -4
- package/dist/_internal/components/feedback/ConfirmAction/with-confirmation.js +4 -3
- package/dist/_internal/components/feedback/index.js +6 -5
- package/dist/_internal/components/index.js +6 -5
- package/dist/{chunk-QOLIBVGS.js → chunk-3CIIB74Y.js} +2 -2
- package/dist/{chunk-OG6LYQ7C.js → chunk-4PFKMNLP.js} +8 -68
- package/dist/chunk-4PFKMNLP.js.map +1 -0
- package/dist/{chunk-OT3KFZRE.js → chunk-7WWPKA7Y.js} +2 -2
- package/dist/{chunk-JUHNEYCH.js → chunk-GCH7CLM4.js} +2 -2
- package/dist/{chunk-HCEJT65A.js → chunk-HKD4TDZP.js} +2 -2
- package/dist/{chunk-3GVMUASU.js → chunk-HV7HIMMY.js} +2 -2
- package/dist/chunk-IQQX3NDO.js +96 -0
- package/dist/chunk-IQQX3NDO.js.map +1 -0
- package/dist/{chunk-4WCDMCIS.js → chunk-PI3GPLE2.js} +2 -2
- package/dist/{chunk-FWPFCK4D.js → chunk-S6G3CJFP.js} +2 -2
- package/dist/{chunk-BJZOBG24.js → chunk-UJHXEOU3.js} +2 -2
- package/dist/{chunk-U4QUDFPJ.js → chunk-VKVOP4OK.js} +2 -2
- package/dist/data-display/AlertDialog.js +2 -1
- package/dist/data-display/CardKit.js +8 -7
- package/dist/data-display/DataViews.js +9 -8
- package/dist/feedback/ConfirmAction.js +6 -5
- package/dist/types/components/data-display/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/types/components/data-display/AlertDialog/AlertDialog.parts.d.ts +13 -0
- package/dist/types/components/data-display/AlertDialog/AlertDialog.parts.d.ts.map +1 -0
- package/dist/types/components/data-display/AlertDialog/AlertDialog.types.d.ts +16 -3
- package/dist/types/components/data-display/AlertDialog/AlertDialog.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/data-display/AlertDialog/AlertDialog.md +30 -0
- package/src/components/data-display/AlertDialog/AlertDialog.parts.tsx +180 -0
- package/src/components/data-display/AlertDialog/AlertDialog.tsx +5 -85
- package/src/components/data-display/AlertDialog/AlertDialog.types.ts +17 -3
- package/dist/chunk-OG6LYQ7C.js.map +0 -1
- /package/dist/{chunk-QOLIBVGS.js.map → chunk-3CIIB74Y.js.map} +0 -0
- /package/dist/{chunk-OT3KFZRE.js.map → chunk-7WWPKA7Y.js.map} +0 -0
- /package/dist/{chunk-JUHNEYCH.js.map → chunk-GCH7CLM4.js.map} +0 -0
- /package/dist/{chunk-HCEJT65A.js.map → chunk-HKD4TDZP.js.map} +0 -0
- /package/dist/{chunk-3GVMUASU.js.map → chunk-HV7HIMMY.js.map} +0 -0
- /package/dist/{chunk-4WCDMCIS.js.map → chunk-PI3GPLE2.js.map} +0 -0
- /package/dist/{chunk-FWPFCK4D.js.map → chunk-S6G3CJFP.js.map} +0 -0
- /package/dist/{chunk-BJZOBG24.js.map → chunk-UJHXEOU3.js.map} +0 -0
- /package/dist/{chunk-U4QUDFPJ.js.map → chunk-VKVOP4OK.js.map} +0 -0
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import Close from '@mui/icons-material/Close';
|
|
2
2
|
import Error from '@mui/icons-material/Error';
|
|
3
3
|
import Info from '@mui/icons-material/Info';
|
|
4
|
-
import type { ButtonProps } from '@mui/material/Button/index.js';
|
|
5
|
-
import Button from '@mui/material/Button/index.js';
|
|
6
|
-
import CircularProgress from '@mui/material/CircularProgress/index.js';
|
|
7
4
|
import Dialog from '@mui/material/Dialog/index.js';
|
|
8
|
-
import DialogActions from '@mui/material/DialogActions/index.js';
|
|
9
5
|
import DialogContent from '@mui/material/DialogContent/index.js';
|
|
10
6
|
import DialogContentText from '@mui/material/DialogContentText/index.js';
|
|
11
7
|
import DialogTitle from '@mui/material/DialogTitle/index.js';
|
|
12
8
|
import IconButton from '@mui/material/IconButton/index.js';
|
|
13
9
|
import Typography from '@mui/material/Typography/index.js';
|
|
14
|
-
import { alpha, keyframes, styled
|
|
10
|
+
import { alpha, keyframes, styled } from '@mui/material/styles/index.js';
|
|
15
11
|
import type { Theme } from '@mui/material/styles/index.js';
|
|
16
12
|
import React from 'react';
|
|
17
13
|
|
|
18
14
|
import { neutralTones } from '../../../tokens/ink';
|
|
19
15
|
|
|
16
|
+
import { AlertDialogFooter } from './AlertDialog.parts';
|
|
20
17
|
import type { AlertDialogProps } from './AlertDialog.types';
|
|
21
18
|
import { rem, rems } from '../../../tokens/relative';
|
|
22
19
|
|
|
@@ -140,11 +137,6 @@ const StyledDialogContent = styled(DialogContent)(({ theme }) => ({
|
|
|
140
137
|
paddingBottom: theme.spacing(2),
|
|
141
138
|
}));
|
|
142
139
|
|
|
143
|
-
const StyledDialogActions = styled(DialogActions)(({ theme }) => ({
|
|
144
|
-
padding: theme.spacing(2, 3, 3, 3),
|
|
145
|
-
gap: theme.spacing(1),
|
|
146
|
-
}));
|
|
147
|
-
|
|
148
140
|
const CloseButton = styled(IconButton)(({ theme }) => ({
|
|
149
141
|
position: 'absolute',
|
|
150
142
|
right: theme.spacing(1),
|
|
@@ -208,11 +200,6 @@ function ariaSlotProps(
|
|
|
208
200
|
};
|
|
209
201
|
}
|
|
210
202
|
|
|
211
|
-
/** Both variants render a filled confirm; only the colour distinguishes them. */
|
|
212
|
-
const CONFIRM_BUTTON_VARIANT: ButtonProps['variant'] = 'contained';
|
|
213
|
-
const confirmButtonColor = (variant: AlertDialogProps['variant']): 'error' | 'primary' =>
|
|
214
|
-
variant === 'destructive' ? 'error' : 'primary';
|
|
215
|
-
|
|
216
203
|
/** Title row: the variant icon (unless explicitly suppressed with `null`) + the title. */
|
|
217
204
|
function AlertDialogHeader({
|
|
218
205
|
title,
|
|
@@ -238,70 +225,6 @@ function AlertDialogHeader({
|
|
|
238
225
|
);
|
|
239
226
|
}
|
|
240
227
|
|
|
241
|
-
/** Action row: the optional cancel button and the (variant-coloured) confirm. */
|
|
242
|
-
function AlertDialogFooter({
|
|
243
|
-
variant,
|
|
244
|
-
cancelText = 'Cancel',
|
|
245
|
-
confirmText = 'Confirm',
|
|
246
|
-
showCancel = true,
|
|
247
|
-
loading = false,
|
|
248
|
-
confirmDisabled = false,
|
|
249
|
-
initialFocus = 'confirm',
|
|
250
|
-
onCancel,
|
|
251
|
-
onConfirm,
|
|
252
|
-
dataTestId,
|
|
253
|
-
}: Pick<
|
|
254
|
-
AlertDialogProps,
|
|
255
|
-
| 'variant'
|
|
256
|
-
| 'cancelText'
|
|
257
|
-
| 'confirmText'
|
|
258
|
-
| 'showCancel'
|
|
259
|
-
| 'loading'
|
|
260
|
-
| 'confirmDisabled'
|
|
261
|
-
| 'initialFocus'
|
|
262
|
-
> & {
|
|
263
|
-
onCancel: () => void;
|
|
264
|
-
onConfirm: () => void;
|
|
265
|
-
dataTestId: string;
|
|
266
|
-
}): React.ReactElement {
|
|
267
|
-
const theme = useTheme();
|
|
268
|
-
return (
|
|
269
|
-
<StyledDialogActions data-testid={`${dataTestId}-actions`}>
|
|
270
|
-
{showCancel && (
|
|
271
|
-
<Button
|
|
272
|
-
onClick={onCancel}
|
|
273
|
-
variant="outlined"
|
|
274
|
-
color="inherit"
|
|
275
|
-
disabled={loading}
|
|
276
|
-
autoFocus={initialFocus === 'cancel'}
|
|
277
|
-
data-testid={`${dataTestId}-cancel-button`}
|
|
278
|
-
>
|
|
279
|
-
{cancelText}
|
|
280
|
-
</Button>
|
|
281
|
-
)}
|
|
282
|
-
<Button
|
|
283
|
-
onClick={onConfirm}
|
|
284
|
-
variant={CONFIRM_BUTTON_VARIANT}
|
|
285
|
-
color={confirmButtonColor(variant)}
|
|
286
|
-
disabled={confirmDisabled || loading}
|
|
287
|
-
startIcon={
|
|
288
|
-
loading ? (
|
|
289
|
-
<CircularProgress
|
|
290
|
-
size={rem(theme, 16)}
|
|
291
|
-
color="inherit"
|
|
292
|
-
data-testid={`${dataTestId}-loading-spinner`}
|
|
293
|
-
/>
|
|
294
|
-
) : undefined
|
|
295
|
-
}
|
|
296
|
-
autoFocus={initialFocus !== 'cancel'}
|
|
297
|
-
data-testid={`${dataTestId}-confirm-button`}
|
|
298
|
-
>
|
|
299
|
-
{confirmText}
|
|
300
|
-
</Button>
|
|
301
|
-
</StyledDialogActions>
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
228
|
export const AlertDialog = React.forwardRef<HTMLDivElement, AlertDialogProps>(
|
|
306
229
|
({
|
|
307
230
|
variant = 'default',
|
|
@@ -318,6 +241,7 @@ export const AlertDialog = React.forwardRef<HTMLDivElement, AlertDialogProps>(
|
|
|
318
241
|
loading,
|
|
319
242
|
confirmDisabled,
|
|
320
243
|
initialFocus,
|
|
244
|
+
emphasis,
|
|
321
245
|
children,
|
|
322
246
|
onClose,
|
|
323
247
|
'data-testid': dataTestId = 'alert-dialog',
|
|
@@ -348,12 +272,7 @@ export const AlertDialog = React.forwardRef<HTMLDivElement, AlertDialogProps>(
|
|
|
348
272
|
<Close />
|
|
349
273
|
</CloseButton>
|
|
350
274
|
|
|
351
|
-
<AlertDialogHeader
|
|
352
|
-
title={title}
|
|
353
|
-
icon={icon}
|
|
354
|
-
variant={variant}
|
|
355
|
-
dataTestId={dataTestId}
|
|
356
|
-
/>
|
|
275
|
+
<AlertDialogHeader title={title} icon={icon} variant={variant} dataTestId={dataTestId} />
|
|
357
276
|
|
|
358
277
|
<StyledDialogContent data-testid={`${dataTestId}-content`}>
|
|
359
278
|
{description && (
|
|
@@ -375,6 +294,7 @@ export const AlertDialog = React.forwardRef<HTMLDivElement, AlertDialogProps>(
|
|
|
375
294
|
loading={loading}
|
|
376
295
|
confirmDisabled={confirmDisabled}
|
|
377
296
|
initialFocus={initialFocus}
|
|
297
|
+
emphasis={emphasis}
|
|
378
298
|
onCancel={handleCancel}
|
|
379
299
|
onConfirm={() => onConfirm?.()}
|
|
380
300
|
dataTestId={dataTestId}
|
|
@@ -68,12 +68,26 @@ export interface AlertDialogProps extends Omit<MuiDialogProps, 'variant'> {
|
|
|
68
68
|
confirmDisabled?: boolean;
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
* Which button owns focus when the dialog opens. Defaults to
|
|
72
|
-
*
|
|
73
|
-
*
|
|
71
|
+
* Which button owns focus when the dialog opens. Defaults to the emphasised
|
|
72
|
+
* one — `confirm`, unless `emphasis="cancel"` — which is right for an
|
|
73
|
+
* acknowledgement; a destructive dialog should pass `cancel` so a stray Enter
|
|
74
|
+
* on the trigger cannot complete the action.
|
|
74
75
|
*/
|
|
75
76
|
initialFocus?: 'confirm' | 'cancel';
|
|
76
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Which button is the filled, primary one. Defaults to `confirm`. Pass
|
|
80
|
+
* `cancel` when backing out is the action to steer toward — a "discard what
|
|
81
|
+
* you wrote?" question, where the confirm is the loss: cancel is then filled
|
|
82
|
+
* and takes the primary slot (right, or on top once the row stacks), and the
|
|
83
|
+
* confirm steps down to the neutral outline cancel normally wears — primary
|
|
84
|
+
* and neutral, whatever the variant. The two buttons then grow to share the
|
|
85
|
+
* row, so once it stacks each takes its full width; focus opens on the cancel
|
|
86
|
+
* unless `initialFocus` says otherwise. With `showCancel={false}` it has no
|
|
87
|
+
* effect: the confirm keeps its default, filled look.
|
|
88
|
+
*/
|
|
89
|
+
emphasis?: 'confirm' | 'cancel';
|
|
90
|
+
|
|
77
91
|
/**
|
|
78
92
|
* Optional data-testid attribute for testing
|
|
79
93
|
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/data-display/AlertDialog/AlertDialog.tsx"],"sourcesContent":["import Close from '@mui/icons-material/Close';\nimport Error from '@mui/icons-material/Error';\nimport Info from '@mui/icons-material/Info';\nimport type { ButtonProps } from '@mui/material/Button/index.js';\nimport Button from '@mui/material/Button/index.js';\nimport CircularProgress from '@mui/material/CircularProgress/index.js';\nimport Dialog from '@mui/material/Dialog/index.js';\nimport DialogActions from '@mui/material/DialogActions/index.js';\nimport DialogContent from '@mui/material/DialogContent/index.js';\nimport DialogContentText from '@mui/material/DialogContentText/index.js';\nimport DialogTitle from '@mui/material/DialogTitle/index.js';\nimport IconButton from '@mui/material/IconButton/index.js';\nimport Typography from '@mui/material/Typography/index.js';\nimport { alpha, keyframes, styled, useTheme } from '@mui/material/styles/index.js';\nimport type { Theme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { neutralTones } from '../../../tokens/ink';\n\nimport type { AlertDialogProps } from './AlertDialog.types';\nimport { rem, rems } from '../../../tokens/relative';\n\n// Define pulse animation\nconst pulseAnimation = (theme: Theme) => keyframes`\n 0% {\n box-shadow: 0 0 0 0 currentColor;\n opacity: 1;\n }\n 70% {\n box-shadow: 0 0 0 ${rem(theme, 15)} currentColor;\n opacity: 0;\n }\n 100% {\n box-shadow: 0 0 0 0 currentColor;\n opacity: 0;\n }\n`;\n\nconst StyledDialog = styled(Dialog, {\n shouldForwardProp: (prop) => \n !['customVariant', 'glow', 'pulse'].includes(prop as string),\n})<{ \n customVariant?: string; \n glow?: boolean; \n pulse?: boolean; \n}>(({ theme, customVariant, glow, pulse }) => ({\n '& .MuiDialog-paper': {\n borderRadius: theme.spacing(2),\n transition: 'all 0.3s ease',\n position: 'relative',\n overflow: 'hidden',\n\n // Variant styles\n ...(customVariant === 'default' && {\n backgroundColor: theme.palette.background.paper,\n border: `1px solid ${alpha(theme.palette.divider, 0.2)}`,\n }),\n\n // The error tint is LAYERED over the paper, not used as the background\n // itself: `alpha(error, 0.05)` alone leaves the panel 95% transparent, so\n // the page behind it showed straight through the question and its buttons.\n // A confirm nobody can read is the one dialog that must never be hard to\n // read. Same tint, opaque base.\n ...(customVariant === 'destructive' && {\n backgroundColor: theme.palette.background.paper,\n backgroundImage: `linear-gradient(${alpha(theme.palette.error.main, 0.05)}, ${alpha(\n theme.palette.error.main,\n 0.05,\n )})`,\n border: `1px solid ${alpha(theme.palette.error.main, 0.2)}`,\n }),\n\n ...(customVariant === 'glass' && {\n backgroundColor: alpha(theme.palette.background.paper, 0.1),\n backdropFilter: `blur(${rem(theme, 20)})`,\n border: `1px solid ${alpha(theme.palette.divider, 0.2)}`,\n }),\n\n // Glow effect\n ...(glow && !pulse && {\n boxShadow: `0 0 ${rems(theme, 30, 10)} ${alpha(theme.palette.primary.main, 0.3)} !important`,\n filter: 'brightness(1.05)',\n }),\n\n // Pulse animation\n ...(pulse && !glow && {\n position: 'relative',\n '&::after': {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n borderRadius: 'inherit',\n backgroundColor: theme.palette.primary.main,\n opacity: 0.1,\n animation: `${pulseAnimation(theme)} 2s infinite`,\n pointerEvents: 'none',\n zIndex: -1,\n },\n }),\n\n // Both glow and pulse\n ...(glow && pulse && {\n position: 'relative',\n boxShadow: `0 0 ${rems(theme, 30, 10)} ${alpha(theme.palette.primary.main, 0.3)} !important`,\n filter: 'brightness(1.05)',\n '&::after': {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n borderRadius: 'inherit',\n backgroundColor: theme.palette.primary.main,\n opacity: 0.1,\n animation: `${pulseAnimation(theme)} 2s infinite`,\n pointerEvents: 'none',\n zIndex: -1,\n },\n }),\n },\n}));\n\nconst StyledDialogTitle = styled(DialogTitle)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1.5),\n paddingRight: theme.spacing(6), // Space for close button\n '& .MuiTypography-root': {\n fontWeight: 600,\n fontSize: rem(theme, 20),\n },\n}));\n\nconst StyledDialogContent = styled(DialogContent)(({ theme }) => ({\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(2),\n}));\n\nconst StyledDialogActions = styled(DialogActions)(({ theme }) => ({\n padding: theme.spacing(2, 3, 3, 3),\n gap: theme.spacing(1),\n}));\n\nconst CloseButton = styled(IconButton)(({ theme }) => ({\n position: 'absolute',\n right: theme.spacing(1),\n top: theme.spacing(1),\n color: neutralTones(theme).muted,\n}));\n\n/**\n * Per-variant lookups, hoisted out of the render function. They depend on\n * nothing but their arguments, so keeping them at module scope means they are\n * not rebuilt on every render — and it keeps the component's own branch count\n * inside the repo's complexity budget.\n */\nconst variantIcon = (\n variant: AlertDialogProps['variant'],\n icon: AlertDialogProps['icon'],\n): React.ReactNode => {\n if (icon) return icon;\n return variant === 'destructive' ? <Error color=\"error\" /> : <Info color=\"primary\" />;\n};\n\n/**\n * Ids for the two elements that give the dialog its accessible name and\n * description. Derived from the test id so they are stable and unique per\n * dialog without a generated id that would change on every render.\n */\nconst titleId = (dataTestId: string): string => `${dataTestId}-title`;\nconst descriptionId = (dataTestId: string): string => `${dataTestId}-description`;\n\n/**\n * `alertdialog`, not `dialog`.\n *\n * This component interrupts what the operator was doing and will not go away\n * until they answer — which is exactly the distinction the two roles draw, and\n * it is what makes a screen reader announce the message itself on open rather\n * than just the dialog's name. MUI hardcodes `role=\"dialog\"` on the paper, so\n * it has to be overridden through the paper slot.\n */\nconst ALERT_ROLE = 'alertdialog';\n\n/**\n * The paper slot's a11y props: the role, plus the name and description wired to\n * the elements that actually carry them, so the announcement is the QUESTION\n * rather than the word \"dialog\".\n *\n * Both references are conditional — pointing `aria-labelledby` at an element\n * that was never rendered leaves a dangling id, which screen readers treat as\n * no name at all, i.e. worse than omitting it.\n */\nfunction ariaSlotProps(\n dataTestId: string,\n title: AlertDialogProps['title'],\n description: AlertDialogProps['description'],\n): { paper: Record<string, string> } {\n return {\n paper: {\n role: ALERT_ROLE,\n ...(title ? { 'aria-labelledby': titleId(dataTestId) } : {}),\n ...(description ? { 'aria-describedby': descriptionId(dataTestId) } : {}),\n },\n };\n}\n\n/** Both variants render a filled confirm; only the colour distinguishes them. */\nconst CONFIRM_BUTTON_VARIANT: ButtonProps['variant'] = 'contained';\nconst confirmButtonColor = (variant: AlertDialogProps['variant']): 'error' | 'primary' =>\n variant === 'destructive' ? 'error' : 'primary';\n\n/** Title row: the variant icon (unless explicitly suppressed with `null`) + the title. */\nfunction AlertDialogHeader({\n title,\n icon,\n variant,\n dataTestId,\n}: {\n title: AlertDialogProps['title'];\n icon: AlertDialogProps['icon'];\n variant: AlertDialogProps['variant'];\n dataTestId: string;\n}): React.ReactElement | null {\n if (!title) return null;\n return (\n <StyledDialogTitle id={titleId(dataTestId)} data-testid={`${dataTestId}-title`}>\n {icon !== null && (\n <span data-testid={`${dataTestId}-icon`}>{variantIcon(variant, icon)}</span>\n )}\n <Typography variant=\"h6\" component=\"span\">\n {title}\n </Typography>\n </StyledDialogTitle>\n );\n}\n\n/** Action row: the optional cancel button and the (variant-coloured) confirm. */\nfunction AlertDialogFooter({\n variant,\n cancelText = 'Cancel',\n confirmText = 'Confirm',\n showCancel = true,\n loading = false,\n confirmDisabled = false,\n initialFocus = 'confirm',\n onCancel,\n onConfirm,\n dataTestId,\n}: Pick<\n AlertDialogProps,\n | 'variant'\n | 'cancelText'\n | 'confirmText'\n | 'showCancel'\n | 'loading'\n | 'confirmDisabled'\n | 'initialFocus'\n> & {\n onCancel: () => void;\n onConfirm: () => void;\n dataTestId: string;\n}): React.ReactElement {\n const theme = useTheme();\n return (\n <StyledDialogActions data-testid={`${dataTestId}-actions`}>\n {showCancel && (\n <Button\n onClick={onCancel}\n variant=\"outlined\"\n color=\"inherit\"\n disabled={loading}\n autoFocus={initialFocus === 'cancel'}\n data-testid={`${dataTestId}-cancel-button`}\n >\n {cancelText}\n </Button>\n )}\n <Button\n onClick={onConfirm}\n variant={CONFIRM_BUTTON_VARIANT}\n color={confirmButtonColor(variant)}\n disabled={confirmDisabled || loading}\n startIcon={\n loading ? (\n <CircularProgress\n size={rem(theme, 16)}\n color=\"inherit\"\n data-testid={`${dataTestId}-loading-spinner`}\n />\n ) : undefined\n }\n autoFocus={initialFocus !== 'cancel'}\n data-testid={`${dataTestId}-confirm-button`}\n >\n {confirmText}\n </Button>\n </StyledDialogActions>\n );\n}\n\nexport const AlertDialog = React.forwardRef<HTMLDivElement, AlertDialogProps>(\n ({\n variant = 'default',\n glow = false,\n pulse = false,\n title,\n description,\n icon,\n cancelText,\n confirmText,\n onCancel,\n onConfirm,\n showCancel,\n loading,\n confirmDisabled,\n initialFocus,\n children,\n onClose,\n 'data-testid': dataTestId = 'alert-dialog',\n ...props\n }, ref) => {\n const handleCancel = () => {\n onCancel?.();\n onClose?.({}, 'backdropClick');\n };\n\n return (\n <StyledDialog\n ref={ref}\n customVariant={variant}\n glow={glow}\n pulse={pulse}\n onClose={onClose}\n data-testid={dataTestId}\n slotProps={ariaSlotProps(dataTestId, title, description)}\n {...props}\n >\n <CloseButton\n aria-label=\"close\"\n onClick={handleCancel}\n size=\"small\"\n data-testid={`${dataTestId}-close-button`}\n >\n <Close />\n </CloseButton>\n\n <AlertDialogHeader\n title={title}\n icon={icon}\n variant={variant}\n dataTestId={dataTestId}\n />\n\n <StyledDialogContent data-testid={`${dataTestId}-content`}>\n {description && (\n <DialogContentText\n id={descriptionId(dataTestId)}\n data-testid={`${dataTestId}-description`}\n >\n {description}\n </DialogContentText>\n )}\n {children}\n </StyledDialogContent>\n\n <AlertDialogFooter\n variant={variant}\n cancelText={cancelText}\n confirmText={confirmText}\n showCancel={showCancel}\n loading={loading}\n confirmDisabled={confirmDisabled}\n initialFocus={initialFocus}\n onCancel={handleCancel}\n onConfirm={() => onConfirm?.()}\n dataTestId={dataTestId}\n />\n </StyledDialog>\n );\n }\n);\n\nAlertDialog.displayName = 'AlertDialog';"],"mappings":";;;;;;;;;AAAA,OAAO,WAAW;AAClB,OAAO,WAAW;AAClB,OAAO,UAAU;AAEjB,OAAO,YAAY;AACnB,OAAO,sBAAsB;AAC7B,OAAO,YAAY;AACnB,OAAO,mBAAmB;AAC1B,OAAO,mBAAmB;AAC1B,OAAO,uBAAuB;AAC9B,OAAO,iBAAiB;AACxB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,SAAS,OAAO,WAAW,QAAQ,gBAAgB;AAEnD,OAAO,WAAW;AAsJmB,cAgEjC,YAhEiC;AA9IrC,IAAM,iBAAiB,CAAC,UAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMjB,IAAI,OAAO,EAAE,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAStC,IAAM,eAAe,OAAO,QAAQ;AAAA,EAClC,mBAAmB,CAAC,SAClB,CAAC,CAAC,iBAAiB,QAAQ,OAAO,EAAE,SAAS,IAAc;AAC/D,CAAC,EAIE,CAAC,EAAE,OAAO,eAAe,MAAM,MAAM,OAAO;AAAA,EAC7C,sBAAsB;AAAA,IACpB,cAAc,MAAM,QAAQ,CAAC;AAAA,IAC7B,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,UAAU;AAAA;AAAA,IAGV,GAAI,kBAAkB,aAAa;AAAA,MACjC,iBAAiB,MAAM,QAAQ,WAAW;AAAA,MAC1C,QAAQ,aAAa,MAAM,MAAM,QAAQ,SAAS,GAAG,CAAC;AAAA,IACxD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,GAAI,kBAAkB,iBAAiB;AAAA,MACrC,iBAAiB,MAAM,QAAQ,WAAW;AAAA,MAC1C,iBAAiB,mBA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zB;AAAA;AAAA,YACH;AAAA,YAED;AAAA,aACH;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,UAAU;AAAA,cACV,WAAW,MAAM,YAAY;AAAA,cAC7B;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|