@12-apps/ui 6.53.0 → 6.54.1
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/InteractiveTooltip/InteractiveTooltip.js +2 -2
- package/dist/_internal/components/data-display/InteractiveTooltip/InteractiveTooltip.styles.js +1 -1
- package/dist/_internal/components/data-display/Tooltip/Tooltip.js +1 -1
- package/dist/_internal/components/data-display/index.js +5 -4
- 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 +14 -13
- package/dist/_internal/components/layout/SettingCard/SettingCard.js +4 -4
- package/dist/_internal/components/layout/SettingCard/SettingCard.summary.js +3 -3
- package/dist/_internal/components/layout/SettingCard/SettingGroup.js +5 -5
- package/dist/_internal/components/layout/SettingCard/SettingSwitch.js +4 -4
- package/dist/_internal/components/layout/SettingCard/SettingToggle.js +5 -5
- package/dist/_internal/components/layout/index.js +7 -7
- 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-TQCQCW2P.js → chunk-524PRSSD.js} +3 -3
- package/dist/chunk-524PRSSD.js.map +1 -0
- package/dist/{chunk-Y5QDXG5N.js → chunk-6WNMVWAV.js} +2 -2
- package/dist/{chunk-OT3KFZRE.js → chunk-7WWPKA7Y.js} +2 -2
- package/dist/chunk-AET54GT6.js +99 -0
- package/dist/chunk-AET54GT6.js.map +1 -0
- package/dist/{chunk-ZXEDKRRT.js → chunk-ECVNRLKD.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-OESAYTNG.js → chunk-JDVHNDY3.js} +2 -2
- package/dist/{chunk-TYBZ4XZZ.js → chunk-KRIPQUFB.js} +27 -32
- package/dist/chunk-KRIPQUFB.js.map +1 -0
- package/dist/{chunk-4WCDMCIS.js → chunk-PI3GPLE2.js} +2 -2
- package/dist/{chunk-N4R6T5K7.js → chunk-PKSU3RBT.js} +2 -2
- package/dist/{chunk-IRNKHHQM.js → chunk-QKMXMBUK.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/data-display/InteractiveTooltip.js +2 -2
- package/dist/data-display/Tooltip.js +1 -1
- package/dist/feedback/ConfirmAction.js +6 -5
- package/dist/layout/SettingCard.js +7 -7
- 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/dist/types/components/data-display/InteractiveTooltip/InteractiveTooltip.d.ts +2 -2
- package/dist/types/components/data-display/InteractiveTooltip/InteractiveTooltip.d.ts.map +1 -1
- package/dist/types/components/data-display/Tooltip/Tooltip.d.ts +2 -2
- package/dist/types/components/data-display/Tooltip/Tooltip.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/src/components/data-display/InteractiveTooltip/InteractiveTooltip.styles.ts +2 -2
- package/src/components/data-display/InteractiveTooltip/InteractiveTooltip.tsx +102 -99
- package/src/components/data-display/Tooltip/Tooltip.tsx +64 -56
- package/dist/chunk-OG6LYQ7C.js.map +0 -1
- package/dist/chunk-TQCQCW2P.js.map +0 -1
- package/dist/chunk-TYBZ4XZZ.js.map +0 -1
- package/dist/chunk-XM7QCNZQ.js +0 -110
- package/dist/chunk-XM7QCNZQ.js.map +0 -1
- /package/dist/{chunk-QOLIBVGS.js.map → chunk-3CIIB74Y.js.map} +0 -0
- /package/dist/{chunk-Y5QDXG5N.js.map → chunk-6WNMVWAV.js.map} +0 -0
- /package/dist/{chunk-OT3KFZRE.js.map → chunk-7WWPKA7Y.js.map} +0 -0
- /package/dist/{chunk-ZXEDKRRT.js.map → chunk-ECVNRLKD.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-OESAYTNG.js.map → chunk-JDVHNDY3.js.map} +0 -0
- /package/dist/{chunk-4WCDMCIS.js.map → chunk-PI3GPLE2.js.map} +0 -0
- /package/dist/{chunk-N4R6T5K7.js.map → chunk-PKSU3RBT.js.map} +0 -0
- /package/dist/{chunk-IRNKHHQM.js.map → chunk-QKMXMBUK.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,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AlertDialogFooter
|
|
3
|
+
} from "./chunk-IQQX3NDO.js";
|
|
1
4
|
import {
|
|
2
5
|
neutralTones
|
|
3
6
|
} from "./chunk-FQ6UW7IY.js";
|
|
@@ -10,16 +13,13 @@ import {
|
|
|
10
13
|
import Close from "@mui/icons-material/Close";
|
|
11
14
|
import Error from "@mui/icons-material/Error";
|
|
12
15
|
import Info from "@mui/icons-material/Info";
|
|
13
|
-
import Button from "@mui/material/Button/index.js";
|
|
14
|
-
import CircularProgress from "@mui/material/CircularProgress/index.js";
|
|
15
16
|
import Dialog from "@mui/material/Dialog/index.js";
|
|
16
|
-
import DialogActions from "@mui/material/DialogActions/index.js";
|
|
17
17
|
import DialogContent from "@mui/material/DialogContent/index.js";
|
|
18
18
|
import DialogContentText from "@mui/material/DialogContentText/index.js";
|
|
19
19
|
import DialogTitle from "@mui/material/DialogTitle/index.js";
|
|
20
20
|
import IconButton from "@mui/material/IconButton/index.js";
|
|
21
21
|
import Typography from "@mui/material/Typography/index.js";
|
|
22
|
-
import { alpha, keyframes, styled
|
|
22
|
+
import { alpha, keyframes, styled } from "@mui/material/styles/index.js";
|
|
23
23
|
import React from "react";
|
|
24
24
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
25
|
var pulseAnimation = (theme) => keyframes`
|
|
@@ -127,10 +127,6 @@ var StyledDialogContent = styled(DialogContent)(({ theme }) => ({
|
|
|
127
127
|
paddingTop: theme.spacing(1),
|
|
128
128
|
paddingBottom: theme.spacing(2)
|
|
129
129
|
}));
|
|
130
|
-
var StyledDialogActions = styled(DialogActions)(({ theme }) => ({
|
|
131
|
-
padding: theme.spacing(2, 3, 3, 3),
|
|
132
|
-
gap: theme.spacing(1)
|
|
133
|
-
}));
|
|
134
130
|
var CloseButton = styled(IconButton)(({ theme }) => ({
|
|
135
131
|
position: "absolute",
|
|
136
132
|
right: theme.spacing(1),
|
|
@@ -153,8 +149,6 @@ function ariaSlotProps(dataTestId, title, description) {
|
|
|
153
149
|
}
|
|
154
150
|
};
|
|
155
151
|
}
|
|
156
|
-
var CONFIRM_BUTTON_VARIANT = "contained";
|
|
157
|
-
var confirmButtonColor = (variant) => variant === "destructive" ? "error" : "primary";
|
|
158
152
|
function AlertDialogHeader({
|
|
159
153
|
title,
|
|
160
154
|
icon,
|
|
@@ -167,54 +161,6 @@ function AlertDialogHeader({
|
|
|
167
161
|
/* @__PURE__ */ jsx(Typography, { variant: "h6", component: "span", children: title })
|
|
168
162
|
] });
|
|
169
163
|
}
|
|
170
|
-
function AlertDialogFooter({
|
|
171
|
-
variant,
|
|
172
|
-
cancelText = "Cancel",
|
|
173
|
-
confirmText = "Confirm",
|
|
174
|
-
showCancel = true,
|
|
175
|
-
loading = false,
|
|
176
|
-
confirmDisabled = false,
|
|
177
|
-
initialFocus = "confirm",
|
|
178
|
-
onCancel,
|
|
179
|
-
onConfirm,
|
|
180
|
-
dataTestId
|
|
181
|
-
}) {
|
|
182
|
-
const theme = useTheme();
|
|
183
|
-
return /* @__PURE__ */ jsxs(StyledDialogActions, { "data-testid": `${dataTestId}-actions`, children: [
|
|
184
|
-
showCancel && /* @__PURE__ */ jsx(
|
|
185
|
-
Button,
|
|
186
|
-
{
|
|
187
|
-
onClick: onCancel,
|
|
188
|
-
variant: "outlined",
|
|
189
|
-
color: "inherit",
|
|
190
|
-
disabled: loading,
|
|
191
|
-
autoFocus: initialFocus === "cancel",
|
|
192
|
-
"data-testid": `${dataTestId}-cancel-button`,
|
|
193
|
-
children: cancelText
|
|
194
|
-
}
|
|
195
|
-
),
|
|
196
|
-
/* @__PURE__ */ jsx(
|
|
197
|
-
Button,
|
|
198
|
-
{
|
|
199
|
-
onClick: onConfirm,
|
|
200
|
-
variant: CONFIRM_BUTTON_VARIANT,
|
|
201
|
-
color: confirmButtonColor(variant),
|
|
202
|
-
disabled: confirmDisabled || loading,
|
|
203
|
-
startIcon: loading ? /* @__PURE__ */ jsx(
|
|
204
|
-
CircularProgress,
|
|
205
|
-
{
|
|
206
|
-
size: rem(theme, 16),
|
|
207
|
-
color: "inherit",
|
|
208
|
-
"data-testid": `${dataTestId}-loading-spinner`
|
|
209
|
-
}
|
|
210
|
-
) : void 0,
|
|
211
|
-
autoFocus: initialFocus !== "cancel",
|
|
212
|
-
"data-testid": `${dataTestId}-confirm-button`,
|
|
213
|
-
children: confirmText
|
|
214
|
-
}
|
|
215
|
-
)
|
|
216
|
-
] });
|
|
217
|
-
}
|
|
218
164
|
var AlertDialog = React.forwardRef(
|
|
219
165
|
({
|
|
220
166
|
variant = "default",
|
|
@@ -231,6 +177,7 @@ var AlertDialog = React.forwardRef(
|
|
|
231
177
|
loading,
|
|
232
178
|
confirmDisabled,
|
|
233
179
|
initialFocus,
|
|
180
|
+
emphasis,
|
|
234
181
|
children,
|
|
235
182
|
onClose,
|
|
236
183
|
"data-testid": dataTestId = "alert-dialog",
|
|
@@ -262,15 +209,7 @@ var AlertDialog = React.forwardRef(
|
|
|
262
209
|
children: /* @__PURE__ */ jsx(Close, {})
|
|
263
210
|
}
|
|
264
211
|
),
|
|
265
|
-
/* @__PURE__ */ jsx(
|
|
266
|
-
AlertDialogHeader,
|
|
267
|
-
{
|
|
268
|
-
title,
|
|
269
|
-
icon,
|
|
270
|
-
variant,
|
|
271
|
-
dataTestId
|
|
272
|
-
}
|
|
273
|
-
),
|
|
212
|
+
/* @__PURE__ */ jsx(AlertDialogHeader, { title, icon, variant, dataTestId }),
|
|
274
213
|
/* @__PURE__ */ jsxs(StyledDialogContent, { "data-testid": `${dataTestId}-content`, children: [
|
|
275
214
|
description && /* @__PURE__ */ jsx(
|
|
276
215
|
DialogContentText,
|
|
@@ -292,6 +231,7 @@ var AlertDialog = React.forwardRef(
|
|
|
292
231
|
loading,
|
|
293
232
|
confirmDisabled,
|
|
294
233
|
initialFocus,
|
|
234
|
+
emphasis,
|
|
295
235
|
onCancel: handleCancel,
|
|
296
236
|
onConfirm: () => onConfirm?.(),
|
|
297
237
|
dataTestId
|
|
@@ -307,4 +247,4 @@ AlertDialog.displayName = "AlertDialog";
|
|
|
307
247
|
export {
|
|
308
248
|
AlertDialog
|
|
309
249
|
};
|
|
310
|
-
//# sourceMappingURL=chunk-
|
|
250
|
+
//# sourceMappingURL=chunk-4PFKMNLP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 Dialog from '@mui/material/Dialog/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 } 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 { AlertDialogFooter } from './AlertDialog.parts';\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 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/** 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\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 emphasis,\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 title={title} icon={icon} variant={variant} dataTestId={dataTestId} />\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 emphasis={emphasis}\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;AACjB,OAAO,YAAY;AACnB,OAAO,mBAAmB;AAC1B,OAAO,uBAAuB;AAC9B,OAAO,iBAAiB;AACxB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,SAAS,OAAO,WAAW,cAAc;AAEzC,OAAO,WAAW;AAkJmB,cA2DjC,YA3DiC;AAzIrC,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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ACL,GAAG,QAAQ;AACT,UAAM,eAAe,MAAM;AACzB,iBAAW;AACX,gBAAU,CAAC,GAAG,eAAe;AAAA,IAC/B;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAa;AAAA,QACb,WAAW,cAAc,YAAY,OAAO,WAAW;AAAA,QACtD,GAAG;AAAA,QAEJ;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,cAAW;AAAA,cACX,SAAS;AAAA,cACT,MAAK;AAAA,cACL,eAAa,GAAG,UAAU;AAAA,cAE1B,8BAAC,SAAM;AAAA;AAAA,UACT;AAAA,UAEA,oBAAC,qBAAkB,OAAc,MAAY,SAAkB,YAAwB;AAAA,UAEvF,qBAAC,uBAAoB,eAAa,GAAG,UAAU,YAC5C;AAAA,2BACC;AAAA,cAAC;AAAA;AAAA,gBACC,IAAI,cAAc,UAAU;AAAA,gBAC5B,eAAa,GAAG,UAAU;AAAA,gBAEzB;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;AAAA,cACA,UAAU;AAAA,cACV,WAAW,MAAM,YAAY;AAAA,cAC7B;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -36,7 +36,7 @@ var variantStyles = (theme, variant) => {
|
|
|
36
36
|
switch (variant) {
|
|
37
37
|
case "default":
|
|
38
38
|
return {
|
|
39
|
-
backgroundColor:
|
|
39
|
+
backgroundColor: neutralTones(theme).inverseSurface,
|
|
40
40
|
color: absoluteInk(theme).white,
|
|
41
41
|
boxShadow: `${rems(theme, 0, 4, 12)} ${shadowInk(theme, 0.3)}`
|
|
42
42
|
};
|
|
@@ -89,7 +89,7 @@ var arrowColor = (theme, variant) => {
|
|
|
89
89
|
case "dark":
|
|
90
90
|
return absoluteInk(theme).black;
|
|
91
91
|
default:
|
|
92
|
-
return
|
|
92
|
+
return neutralTones(theme).inverseSurface;
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
|
|
@@ -100,4 +100,4 @@ export {
|
|
|
100
100
|
tooltipCap,
|
|
101
101
|
arrowColor
|
|
102
102
|
};
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
103
|
+
//# sourceMappingURL=chunk-524PRSSD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/InteractiveTooltip/InteractiveTooltip.styles.ts"],"sourcesContent":["import { alpha, keyframes } from '@mui/material/styles/index.js';\nimport type { CSSObject, Theme } from '@mui/material/styles/index.js';\n\nimport { absoluteInk, neutralTones, shadowInk, sheen } from '../../../tokens/ink';\nimport { rem, rems, sxRem } from '../../../tokens/relative';\n\nconst pulseAnimation = keyframes`\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 70% {\n transform: scale(1.05);\n opacity: 0.8;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n`;\n\nconst SIZE_MAP = {\n sm: { fontSize: sxRem(12), padding: (theme: Theme) => rems(theme, 4, 8) },\n md: { fontSize: sxRem(14), padding: (theme: Theme) => rems(theme, 6, 12) },\n lg: { fontSize: sxRem(16), padding: (theme: Theme) => rems(theme, 8, 16) },\n} as const;\n\nexport const getSizeStyles = (\n size?: string,\n): { fontSize: (theme: Theme) => string; padding: (theme: Theme) => string } =>\n SIZE_MAP[size as keyof typeof SIZE_MAP] || SIZE_MAP.md;\n\nexport const variantStyles = (theme: Theme, variant?: string): CSSObject => {\n switch (variant) {\n case 'default':\n return {\n backgroundColor: neutralTones(theme).inverseSurface,\n color: absoluteInk(theme).white,\n boxShadow: `${rems(theme, 0, 4, 12)} ${shadowInk(theme, 0.3)}`,\n };\n case 'dark':\n return {\n backgroundColor: absoluteInk(theme).black,\n color: absoluteInk(theme).white,\n boxShadow: `${rems(theme, 0, 6, 16)} ${shadowInk(theme, 0.5)}`,\n border: `1px solid ${sheen(theme, 0.1)}`,\n };\n case 'light':\n return {\n backgroundColor: absoluteInk(theme).white,\n color: neutralTones(theme).inverseSurface,\n border: `1px solid ${alpha(neutralTones(theme).subtle, 0.4)}`,\n boxShadow: `${rems(theme, 0, 4, 16)} ${shadowInk(theme, 0.15)}`,\n };\n case 'glass':\n return {\n backgroundColor: alpha(theme.palette.background.paper, 0.75),\n backdropFilter: `blur(${rem(theme, 24)}) saturate(180%)`,\n WebkitBackdropFilter: `blur(${rem(theme, 24)}) saturate(180%)`,\n border: `1px solid ${alpha(theme.palette.divider, 0.3)}`,\n color: theme.palette.text.primary,\n boxShadow: `${rems(theme, 0, 8, 32)} ${shadowInk(theme, 0.12)}`,\n };\n default:\n return {};\n }\n};\n\n// glow and pulse are independent flags. The three combinations used to be spelled\n// out one by one, but each is just the union of whichever flags are set.\nexport const emphasisStyles = (theme: Theme, glow?: boolean, pulse?: boolean): CSSObject => ({\n ...(glow && {\n boxShadow: `${rems(theme, 0, 0, 15, 3)} ${alpha(theme.palette.primary.main, 0.4)} !important`,\n filter: 'brightness(1.05)',\n }),\n ...(pulse && {\n animation: `${pulseAnimation} 2s infinite`,\n }),\n});\n\n/**\n * The tooltip's cap: 300 design px unless the caller says otherwise. `sx` has\n * always read a number of 1 or less as a fraction of the parent, and that stays so.\n */\nexport const tooltipCap =\n (maxWidth: number | undefined) =>\n (theme: Theme): string => {\n const cap = maxWidth ?? 300;\n return cap <= 1 && cap !== 0 ? `${cap * 100}%` : rem(theme, cap);\n };\n\nexport const arrowColor = (theme: Theme, variant?: string): string => {\n switch (variant) {\n case 'light':\n return absoluteInk(theme).white;\n case 'glass':\n return alpha(theme.palette.background.paper, 0.75);\n case 'dark':\n return absoluteInk(theme).black;\n default:\n return neutralTones(theme).inverseSurface;\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS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6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useSummaryInfo
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PKSU3RBT.js";
|
|
4
4
|
import {
|
|
5
5
|
PendingSpinner,
|
|
6
6
|
SaveError,
|
|
@@ -87,4 +87,4 @@ export {
|
|
|
87
87
|
useSettingSwitchIds,
|
|
88
88
|
SettingSwitchBlock
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-6WNMVWAV.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
ViewDialogs,
|
|
12
12
|
ViewMutationErrorAlert
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-HKD4TDZP.js";
|
|
14
14
|
import {
|
|
15
15
|
useSavedViewsController
|
|
16
16
|
} from "./chunk-HR7YTBR7.js";
|
|
@@ -178,4 +178,4 @@ function renderViewDialogs(ctl, fields, columns, views, testIdPrefix, onSaved) {
|
|
|
178
178
|
export {
|
|
179
179
|
DataViewsTableBase
|
|
180
180
|
};
|
|
181
|
-
//# sourceMappingURL=chunk-
|
|
181
|
+
//# sourceMappingURL=chunk-7WWPKA7Y.js.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
arrowColor,
|
|
3
|
+
emphasisStyles,
|
|
4
|
+
getSizeStyles,
|
|
5
|
+
tooltipCap,
|
|
6
|
+
variantStyles
|
|
7
|
+
} from "./chunk-524PRSSD.js";
|
|
8
|
+
import {
|
|
9
|
+
resolveTooltipProps,
|
|
10
|
+
useHoverOpen,
|
|
11
|
+
usePinnedTooltip
|
|
12
|
+
} from "./chunk-QYJ25FWM.js";
|
|
13
|
+
|
|
14
|
+
// src/components/data-display/InteractiveTooltip/InteractiveTooltip.tsx
|
|
15
|
+
import MuiTooltip from "@mui/material/Tooltip/index.js";
|
|
16
|
+
import React from "react";
|
|
17
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
var bubbleSx = (variant, size, glow, pulse, maxWidth) => (theme) => {
|
|
19
|
+
const sizeStyles = getSizeStyles(size);
|
|
20
|
+
return {
|
|
21
|
+
borderRadius: theme.spacing(1),
|
|
22
|
+
fontSize: sizeStyles.fontSize(theme),
|
|
23
|
+
padding: sizeStyles.padding(theme),
|
|
24
|
+
fontWeight: 500,
|
|
25
|
+
transition: "all 0.3s ease",
|
|
26
|
+
position: "relative",
|
|
27
|
+
maxWidth: tooltipCap(maxWidth)(theme),
|
|
28
|
+
...variantStyles(theme, variant),
|
|
29
|
+
...emphasisStyles(theme, glow, pulse)
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
var InteractiveTooltip = React.forwardRef((rawProps, ref) => {
|
|
33
|
+
const {
|
|
34
|
+
variant,
|
|
35
|
+
size,
|
|
36
|
+
glow,
|
|
37
|
+
pulse,
|
|
38
|
+
maxWidth,
|
|
39
|
+
dataTestId,
|
|
40
|
+
hoverContent,
|
|
41
|
+
pinnedContent,
|
|
42
|
+
clickable,
|
|
43
|
+
onPin,
|
|
44
|
+
onUnpin,
|
|
45
|
+
className,
|
|
46
|
+
children,
|
|
47
|
+
onOpen,
|
|
48
|
+
onClose,
|
|
49
|
+
...props
|
|
50
|
+
} = resolveTooltipProps(rawProps);
|
|
51
|
+
const { isPinned, isControlledOpen, wrapperRef, handleClick } = usePinnedTooltip({
|
|
52
|
+
clickable,
|
|
53
|
+
onPin,
|
|
54
|
+
onUnpin
|
|
55
|
+
});
|
|
56
|
+
const hover = useHoverOpen(isPinned, onOpen, onClose);
|
|
57
|
+
const tooltipContent = isPinned ? pinnedContent : hoverContent;
|
|
58
|
+
const childElement = children;
|
|
59
|
+
const childWithProps = React.cloneElement(childElement, {
|
|
60
|
+
onClick: (e) => {
|
|
61
|
+
handleClick(e);
|
|
62
|
+
childElement.props.onClick?.(e);
|
|
63
|
+
},
|
|
64
|
+
"data-testid": dataTestId ? `${dataTestId}-trigger` : void 0
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ jsx("div", { ref: wrapperRef, className, children: /* @__PURE__ */ jsx(
|
|
67
|
+
MuiTooltip,
|
|
68
|
+
{
|
|
69
|
+
ref,
|
|
70
|
+
title: tooltipContent,
|
|
71
|
+
open: isPinned ? isControlledOpen : hover.open,
|
|
72
|
+
onOpen: hover.onOpen,
|
|
73
|
+
onClose: hover.onClose,
|
|
74
|
+
enterDelay: isPinned ? 0 : 100,
|
|
75
|
+
leaveDelay: 0,
|
|
76
|
+
disableHoverListener: isPinned,
|
|
77
|
+
disableFocusListener: isPinned,
|
|
78
|
+
disableTouchListener: isPinned,
|
|
79
|
+
slotProps: {
|
|
80
|
+
tooltip: {
|
|
81
|
+
sx: bubbleSx(variant, size, glow, pulse, maxWidth),
|
|
82
|
+
role: "tooltip",
|
|
83
|
+
...dataTestId && { "data-testid": `${dataTestId}-content` }
|
|
84
|
+
},
|
|
85
|
+
arrow: {
|
|
86
|
+
sx: (theme) => ({ color: arrowColor(theme, variant) })
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
...props,
|
|
90
|
+
children: childWithProps
|
|
91
|
+
}
|
|
92
|
+
) });
|
|
93
|
+
});
|
|
94
|
+
InteractiveTooltip.displayName = "InteractiveTooltip";
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
InteractiveTooltip
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=chunk-AET54GT6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/InteractiveTooltip/InteractiveTooltip.tsx"],"sourcesContent":["import MuiTooltip from \"@mui/material/Tooltip/index.js\";\nimport type { CSSObject, Theme } from \"@mui/material/styles/index.js\";\nimport React from \"react\";\n\nimport {\n resolveTooltipProps,\n useHoverOpen,\n usePinnedTooltip,\n} from \"./InteractiveTooltip.hooks\";\nimport {\n arrowColor,\n emphasisStyles,\n getSizeStyles,\n tooltipCap,\n variantStyles,\n} from \"./InteractiveTooltip.styles\";\nimport type { InteractiveTooltipProps } from \"./InteractiveTooltip.types\";\n\n/**\n * The bubble's own look, applied to the BUBBLE (FUT-3093) — see `Tooltip`'s\n * `bubbleSx`: a `& .MuiTooltip-tooltip` rule on the root never reached the\n * portalled bubble, so the variants had never been on screen.\n */\nconst bubbleSx =\n (\n variant: string | undefined,\n size: string | undefined,\n glow: boolean | undefined,\n pulse: boolean | undefined,\n maxWidth: number | undefined,\n ) =>\n (theme: Theme): CSSObject => {\n const sizeStyles = getSizeStyles(size);\n return {\n borderRadius: theme.spacing(1),\n fontSize: sizeStyles.fontSize(theme),\n padding: sizeStyles.padding(theme),\n fontWeight: 500,\n transition: \"all 0.3s ease\",\n position: \"relative\",\n maxWidth: tooltipCap(maxWidth)(theme),\n ...variantStyles(theme, variant),\n ...emphasisStyles(theme, glow, pulse),\n };\n };\n\nexport const InteractiveTooltip = React.forwardRef<\n HTMLDivElement,\n InteractiveTooltipProps\n>((rawProps, ref) => {\n const {\n variant,\n size,\n glow,\n pulse,\n maxWidth,\n dataTestId,\n hoverContent,\n pinnedContent,\n clickable,\n onPin,\n onUnpin,\n className,\n children,\n onOpen,\n onClose,\n ...props\n } = resolveTooltipProps(rawProps);\n\n const { isPinned, isControlledOpen, wrapperRef, handleClick } =\n usePinnedTooltip({\n clickable,\n onPin,\n onUnpin,\n });\n const hover = useHoverOpen(isPinned, onOpen, onClose);\n\n // Determine which content to show\n const tooltipContent = isPinned ? pinnedContent : hoverContent;\n\n // Child with click handler and ref\n const childElement = children as React.ReactElement<{\n onClick?: (e: React.MouseEvent) => void;\n \"data-testid\"?: string;\n }>;\n\n const childWithProps = React.cloneElement(childElement, {\n onClick: (e: React.MouseEvent) => {\n handleClick(e);\n // Call original onClick if it exists\n childElement.props.onClick?.(e);\n },\n \"data-testid\": dataTestId ? `${dataTestId}-trigger` : undefined,\n });\n\n return (\n <div ref={wrapperRef} className={className}>\n <MuiTooltip\n ref={ref}\n title={tooltipContent}\n open={isPinned ? isControlledOpen : hover.open}\n onOpen={hover.onOpen}\n onClose={hover.onClose}\n enterDelay={isPinned ? 0 : 100}\n leaveDelay={0}\n disableHoverListener={isPinned}\n disableFocusListener={isPinned}\n disableTouchListener={isPinned}\n slotProps={{\n tooltip: {\n sx: bubbleSx(variant, size, glow, pulse, maxWidth),\n role: \"tooltip\",\n ...(dataTestId && { \"data-testid\": `${dataTestId}-content` }),\n },\n arrow: {\n sx: (theme: Theme) => ({ color: arrowColor(theme, variant) }),\n },\n }}\n {...props}\n >\n {childWithProps}\n </MuiTooltip>\n </div>\n );\n});\n\nInteractiveTooltip.displayName = \"InteractiveTooltip\";\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAO,gBAAgB;AAEvB,OAAO,WAAW;AA+FZ;AA1EN,IAAM,WACJ,CACE,SACA,MACA,MACA,OACA,aAEF,CAAC,UAA4B;AAC3B,QAAM,aAAa,cAAc,IAAI;AACrC,SAAO;AAAA,IACL,cAAc,MAAM,QAAQ,CAAC;AAAA,IAC7B,UAAU,WAAW,SAAS,KAAK;AAAA,IACnC,SAAS,WAAW,QAAQ,KAAK;AAAA,IACjC,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,UAAU,WAAW,QAAQ,EAAE,KAAK;AAAA,IACpC,GAAG,cAAc,OAAO,OAAO;AAAA,IAC/B,GAAG,eAAe,OAAO,MAAM,KAAK;AAAA,EACtC;AACF;AAEK,IAAM,qBAAqB,MAAM,WAGtC,CAAC,UAAU,QAAQ;AACnB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,oBAAoB,QAAQ;AAEhC,QAAM,EAAE,UAAU,kBAAkB,YAAY,YAAY,IAC1D,iBAAiB;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH,QAAM,QAAQ,aAAa,UAAU,QAAQ,OAAO;AAGpD,QAAM,iBAAiB,WAAW,gBAAgB;AAGlD,QAAM,eAAe;AAKrB,QAAM,iBAAiB,MAAM,aAAa,cAAc;AAAA,IACtD,SAAS,CAAC,MAAwB;AAChC,kBAAY,CAAC;AAEb,mBAAa,MAAM,UAAU,CAAC;AAAA,IAChC;AAAA,IACA,eAAe,aAAa,GAAG,UAAU,aAAa;AAAA,EACxD,CAAC;AAED,SACE,oBAAC,SAAI,KAAK,YAAY,WACpB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,OAAO;AAAA,MACP,MAAM,WAAW,mBAAmB,MAAM;AAAA,MAC1C,QAAQ,MAAM;AAAA,MACd,SAAS,MAAM;AAAA,MACf,YAAY,WAAW,IAAI;AAAA,MAC3B,YAAY;AAAA,MACZ,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB,sBAAsB;AAAA,MACtB,WAAW;AAAA,QACT,SAAS;AAAA,UACP,IAAI,SAAS,SAAS,MAAM,MAAM,OAAO,QAAQ;AAAA,UACjD,MAAM;AAAA,UACN,GAAI,cAAc,EAAE,eAAe,GAAG,UAAU,WAAW;AAAA,QAC7D;AAAA,QACA,OAAO;AAAA,UACL,IAAI,CAAC,WAAkB,EAAE,OAAO,WAAW,OAAO,OAAO,EAAE;AAAA,QAC7D;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ,CAAC;AAED,mBAAmB,cAAc;","names":[]}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
SettingSwitchBlock,
|
|
9
9
|
useSettingSwitchIds
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6WNMVWAV.js";
|
|
11
11
|
import {
|
|
12
12
|
partTestId
|
|
13
13
|
} from "./chunk-2JTZWQ25.js";
|
|
@@ -84,4 +84,4 @@ SettingGroup.displayName = "SettingGroup";
|
|
|
84
84
|
export {
|
|
85
85
|
SettingGroup
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
87
|
+
//# sourceMappingURL=chunk-ECVNRLKD.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-KHG57NAE.js";
|
|
4
4
|
import {
|
|
5
5
|
createConfirmButton
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HV7HIMMY.js";
|
|
7
7
|
import {
|
|
8
8
|
Dialog,
|
|
9
9
|
DialogContent
|
|
@@ -128,4 +128,4 @@ function ManageViewsDialog({
|
|
|
128
128
|
export {
|
|
129
129
|
ManageViewsDialog
|
|
130
130
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
131
|
+
//# sourceMappingURL=chunk-GCH7CLM4.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-4E4MSUY5.js";
|
|
4
4
|
import {
|
|
5
5
|
ManageViewsDialog
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GCH7CLM4.js";
|
|
7
7
|
import {
|
|
8
8
|
useDataViewsCopy
|
|
9
9
|
} from "./chunk-KHG57NAE.js";
|
|
@@ -121,4 +121,4 @@ export {
|
|
|
121
121
|
ViewsMenuSlot,
|
|
122
122
|
ViewDialogs
|
|
123
123
|
};
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-HKD4TDZP.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withConfirmation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PI3GPLE2.js";
|
|
4
4
|
import {
|
|
5
5
|
Button
|
|
6
6
|
} from "./chunk-RIZRF5XR.js";
|
|
@@ -18,4 +18,4 @@ function createConfirmButton(copy, errorText) {
|
|
|
18
18
|
export {
|
|
19
19
|
createConfirmButton
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-HV7HIMMY.js.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rem
|
|
3
|
+
} from "./chunk-YKCAJ2TN.js";
|
|
4
|
+
|
|
5
|
+
// src/components/data-display/AlertDialog/AlertDialog.parts.tsx
|
|
6
|
+
import Button from "@mui/material/Button/index.js";
|
|
7
|
+
import CircularProgress from "@mui/material/CircularProgress/index.js";
|
|
8
|
+
import DialogActions from "@mui/material/DialogActions/index.js";
|
|
9
|
+
import { styled, useTheme } from "@mui/material/styles/index.js";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var StyledDialogActions = styled(DialogActions, {
|
|
12
|
+
shouldForwardProp: (prop) => prop !== "fill"
|
|
13
|
+
})(({ theme, fill }) => ({
|
|
14
|
+
padding: theme.spacing(2, 3, 3, 3),
|
|
15
|
+
flexWrap: "wrap-reverse",
|
|
16
|
+
columnGap: theme.spacing(2),
|
|
17
|
+
rowGap: theme.spacing(1),
|
|
18
|
+
...fill && { "& > .MuiButton-root": { flexGrow: 1 } }
|
|
19
|
+
}));
|
|
20
|
+
var confirmButtonColor = (variant) => variant === "destructive" ? "error" : "primary";
|
|
21
|
+
var buttonLooks = (emphasis, variant) => emphasis === "cancel" ? {
|
|
22
|
+
cancel: { variant: "contained", color: "primary" },
|
|
23
|
+
confirm: { variant: "outlined", color: "inherit" }
|
|
24
|
+
} : {
|
|
25
|
+
cancel: { variant: "outlined", color: "inherit" },
|
|
26
|
+
confirm: { variant: "contained", color: confirmButtonColor(variant) }
|
|
27
|
+
};
|
|
28
|
+
var effectiveEmphasis = (emphasis, showCancel) => emphasis === "cancel" && showCancel ? "cancel" : "confirm";
|
|
29
|
+
var focusesCancel = (initialFocus, emphasis) => (initialFocus ?? emphasis) === "cancel";
|
|
30
|
+
var inSlotOrder = (emphasis, cancel, confirm) => emphasis === "cancel" ? [confirm, cancel] : [cancel, confirm];
|
|
31
|
+
function AlertDialogFooter({
|
|
32
|
+
variant,
|
|
33
|
+
cancelText = "Cancel",
|
|
34
|
+
confirmText = "Confirm",
|
|
35
|
+
showCancel = true,
|
|
36
|
+
loading = false,
|
|
37
|
+
confirmDisabled = false,
|
|
38
|
+
initialFocus,
|
|
39
|
+
emphasis: asked,
|
|
40
|
+
onCancel,
|
|
41
|
+
onConfirm,
|
|
42
|
+
dataTestId
|
|
43
|
+
}) {
|
|
44
|
+
const theme = useTheme();
|
|
45
|
+
const emphasis = effectiveEmphasis(asked, showCancel);
|
|
46
|
+
const look = buttonLooks(emphasis, variant);
|
|
47
|
+
const cancelFocused = focusesCancel(initialFocus, emphasis);
|
|
48
|
+
const cancel = showCancel && /* @__PURE__ */ jsx(
|
|
49
|
+
Button,
|
|
50
|
+
{
|
|
51
|
+
onClick: onCancel,
|
|
52
|
+
variant: look.cancel.variant,
|
|
53
|
+
color: look.cancel.color,
|
|
54
|
+
disabled: loading,
|
|
55
|
+
autoFocus: cancelFocused,
|
|
56
|
+
"data-testid": `${dataTestId}-cancel-button`,
|
|
57
|
+
children: cancelText
|
|
58
|
+
},
|
|
59
|
+
"cancel"
|
|
60
|
+
);
|
|
61
|
+
const confirm = /* @__PURE__ */ jsx(
|
|
62
|
+
Button,
|
|
63
|
+
{
|
|
64
|
+
onClick: onConfirm,
|
|
65
|
+
variant: look.confirm.variant,
|
|
66
|
+
color: look.confirm.color,
|
|
67
|
+
disabled: confirmDisabled || loading,
|
|
68
|
+
startIcon: loading ? /* @__PURE__ */ jsx(
|
|
69
|
+
CircularProgress,
|
|
70
|
+
{
|
|
71
|
+
size: rem(theme, 16),
|
|
72
|
+
color: "inherit",
|
|
73
|
+
"data-testid": `${dataTestId}-loading-spinner`
|
|
74
|
+
}
|
|
75
|
+
) : void 0,
|
|
76
|
+
autoFocus: !cancelFocused,
|
|
77
|
+
"data-testid": `${dataTestId}-confirm-button`,
|
|
78
|
+
children: confirmText
|
|
79
|
+
},
|
|
80
|
+
"confirm"
|
|
81
|
+
);
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
StyledDialogActions,
|
|
84
|
+
{
|
|
85
|
+
disableSpacing: true,
|
|
86
|
+
fill: emphasis === "cancel",
|
|
87
|
+
"data-testid": `${dataTestId}-actions`,
|
|
88
|
+
children: inSlotOrder(emphasis, cancel, confirm)
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
AlertDialogFooter
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=chunk-IQQX3NDO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-display/AlertDialog/AlertDialog.parts.tsx"],"sourcesContent":["/**\n * The AlertDialog's action row, kept apart from the dialog shell so each stays\n * inside the complexity budget: which button is filled, where each one sits,\n * and how the row wraps.\n */\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 DialogActions from '@mui/material/DialogActions/index.js';\nimport { styled, useTheme } from '@mui/material/styles/index.js';\nimport React from 'react';\n\nimport { rem } from '../../../tokens/relative';\n\nimport type { AlertDialogProps } from './AlertDialog.types';\n\n/**\n * The action row WRAPS WHOLE BUTTONS; it never breaks a label inside one. A pair\n * that did not fit side by side used to squeeze the longer label onto two\n * lines, so one button stood twice as tall as its neighbour. Now the row breaks\n * instead. `wrap-reverse` puts the LAST button — the primary, whichever\n * `emphasis` picks — on top when it stacks, the same slot it holds on the right\n * when the row fits. A pair that fits is laid out exactly as before: natural\n * widths, pushed to the right.\n *\n * `fill` — set only by `emphasis=\"cancel\"` — lets the buttons grow to share the\n * row, and so to take the full width of their line once it stacks. It is not\n * the default because growing also stretches a pair that fits, which would\n * redraw every existing dialog's footer.\n *\n * Rendered with `disableSpacing`: MUI's own spacing is a left margin on every\n * button after the first, which would indent a button that wrapped onto a line\n * of its own. The gaps below replace it, at the same 16px across.\n */\nconst StyledDialogActions = styled(DialogActions, {\n shouldForwardProp: (prop) => prop !== 'fill',\n})<{ fill: boolean }>(({ theme, fill }) => ({\n padding: theme.spacing(2, 3, 3, 3),\n flexWrap: 'wrap-reverse',\n columnGap: theme.spacing(2),\n rowGap: theme.spacing(1),\n ...(fill && { '& > .MuiButton-root': { flexGrow: 1 } }),\n}));\n\nconst confirmButtonColor = (variant: AlertDialogProps['variant']): 'error' | 'primary' =>\n variant === 'destructive' ? 'error' : 'primary';\n\ninterface ButtonLook {\n variant: ButtonProps['variant'];\n color: ButtonProps['color'];\n}\n\n/**\n * How each button is drawn, by `emphasis`: the emphasised one is filled, the\n * other a NEUTRAL outline. Primary / neutral both ways round — a confirm that\n * steps down drops the variant's colour too, so the one filled button is the\n * only coloured thing in the row and the eye has a single place to land.\n */\nconst buttonLooks = (\n emphasis: AlertDialogProps['emphasis'],\n variant: AlertDialogProps['variant'],\n): { cancel: ButtonLook; confirm: ButtonLook } =>\n emphasis === 'cancel'\n ? {\n cancel: { variant: 'contained', color: 'primary' },\n confirm: { variant: 'outlined', color: 'inherit' },\n }\n : {\n cancel: { variant: 'outlined', color: 'inherit' },\n confirm: { variant: 'contained', color: confirmButtonColor(variant) },\n };\n\n/**\n * The emphasis that applies: `cancel` only while the cancel is shown. A hidden\n * cancel with the confirm stepped down would leave a dialog with no primary.\n */\nconst effectiveEmphasis = (\n emphasis: AlertDialogProps['emphasis'],\n showCancel: boolean,\n): NonNullable<AlertDialogProps['emphasis']> =>\n emphasis === 'cancel' && showCancel ? 'cancel' : 'confirm';\n\n/**\n * Whether the cancel owns focus on open: what `initialFocus` says, and when it\n * says nothing, the emphasised button — so Enter on a steered question keeps\n * the work instead of completing the loss.\n */\nconst focusesCancel = (\n initialFocus: AlertDialogProps['initialFocus'],\n emphasis: NonNullable<AlertDialogProps['emphasis']>,\n): boolean => (initialFocus ?? emphasis) === 'cancel';\n\n/** The two buttons in slot order: the emphasised one LAST, the primary slot. */\nconst inSlotOrder = (\n emphasis: AlertDialogProps['emphasis'],\n cancel: React.ReactNode,\n confirm: React.ReactNode,\n): React.ReactNode[] => (emphasis === 'cancel' ? [confirm, cancel] : [cancel, confirm]);\n\n/**\n * Action row: the optional cancel button and the (variant-coloured) confirm,\n * with the emphasised one LAST — the primary slot, on the right or, once the\n * row stacks, on top. DOM order is the tab order, so it follows the same rule.\n */\nexport function AlertDialogFooter({\n variant,\n cancelText = 'Cancel',\n confirmText = 'Confirm',\n showCancel = true,\n loading = false,\n confirmDisabled = false,\n initialFocus,\n emphasis: asked,\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 | 'emphasis'\n> & {\n onCancel: () => void;\n onConfirm: () => void;\n dataTestId: string;\n}): React.ReactElement {\n const theme = useTheme();\n const emphasis = effectiveEmphasis(asked, showCancel);\n const look = buttonLooks(emphasis, variant);\n const cancelFocused = focusesCancel(initialFocus, emphasis);\n const cancel = showCancel && (\n <Button\n key=\"cancel\"\n onClick={onCancel}\n variant={look.cancel.variant}\n color={look.cancel.color}\n disabled={loading}\n autoFocus={cancelFocused}\n data-testid={`${dataTestId}-cancel-button`}\n >\n {cancelText}\n </Button>\n );\n const confirm = (\n <Button\n key=\"confirm\"\n onClick={onConfirm}\n variant={look.confirm.variant}\n color={look.confirm.color}\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={!cancelFocused}\n data-testid={`${dataTestId}-confirm-button`}\n >\n {confirmText}\n </Button>\n );\n return (\n <StyledDialogActions\n disableSpacing\n fill={emphasis === 'cancel'}\n data-testid={`${dataTestId}-actions`}\n >\n {inSlotOrder(emphasis, cancel, confirm)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,SAAS;AACvB,QAAM,WAAW,kBAAkB,OAAO,UAAU;AACpD,QAAM,OAAO,YAAY,UAAU,OAAO;AAC1C,QAAM,gBAAgB,cAAc,cAAc,QAAQ;AAC1D,QAAM,SAAS,cACb;AAAA,IAAC;AAAA;AAAA,MAEC,SAAS;AAAA,MACT,SAAS,KAAK,OAAO;AAAA,MACrB,OAAO,KAAK,OAAO;AAAA,MACnB,UAAU;AAAA,MACV,WAAW;AAAA,MACX,eAAa,GAAG,UAAU;AAAA,MAEzB;AAAA;AAAA,IARG;AAAA,EASN;AAEF,QAAM,UACJ;AAAA,IAAC;AAAA;AAAA,MAEC,SAAS;AAAA,MACT,SAAS,KAAK,QAAQ;AAAA,MACtB,OAAO,KAAK,QAAQ;AAAA,MACpB,UAAU,mBAAmB;AAAA,MAC7B,WACE,UACE;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,IAAI,OAAO,EAAE;AAAA,UACnB,OAAM;AAAA,UACN,eAAa,GAAG,UAAU;AAAA;AAAA,MAC5B,IACE;AAAA,MAEN,WAAW,CAAC;AAAA,MACZ,eAAa,GAAG,UAAU;AAAA,MAEzB;AAAA;AAAA,IAjBG;AAAA,EAkBN;AAEF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAc;AAAA,MACd,MAAM,aAAa;AAAA,MACnB,eAAa,GAAG,UAAU;AAAA,MAEzB,sBAAY,UAAU,QAAQ,OAAO;AAAA;AAAA,EACxC;AAEJ;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-SALQ65SM.js";
|
|
4
4
|
import {
|
|
5
5
|
useSummaryInfo
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PKSU3RBT.js";
|
|
7
7
|
import {
|
|
8
8
|
LearnMore,
|
|
9
9
|
PendingSpinner,
|
|
@@ -170,4 +170,4 @@ SettingCard.displayName = "SettingCard";
|
|
|
170
170
|
export {
|
|
171
171
|
SettingCard
|
|
172
172
|
};
|
|
173
|
-
//# sourceMappingURL=chunk-
|
|
173
|
+
//# sourceMappingURL=chunk-JDVHNDY3.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
// src/components/data-display/Tooltip/Tooltip.tsx
|
|
12
12
|
import MuiTooltip from "@mui/material/Tooltip/index.js";
|
|
13
|
-
import { alpha, keyframes
|
|
13
|
+
import { alpha, keyframes } from "@mui/material/styles/index.js";
|
|
14
14
|
import React from "react";
|
|
15
15
|
import { jsx } from "react/jsx-runtime";
|
|
16
16
|
var pulseAnimation = keyframes`
|
|
@@ -37,7 +37,7 @@ var variantStyles = (theme, variant) => {
|
|
|
37
37
|
switch (variant) {
|
|
38
38
|
case "default":
|
|
39
39
|
return {
|
|
40
|
-
backgroundColor:
|
|
40
|
+
backgroundColor: neutralTones(theme).inverseSurface,
|
|
41
41
|
color: absoluteInk(theme).white
|
|
42
42
|
};
|
|
43
43
|
case "dark":
|
|
@@ -81,30 +81,23 @@ var arrowColor = (theme, variant) => {
|
|
|
81
81
|
case "dark":
|
|
82
82
|
return neutralTones(theme).inverseSurface;
|
|
83
83
|
default:
|
|
84
|
-
return
|
|
84
|
+
return neutralTones(theme).inverseSurface;
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
})(({ theme, customVariant, customSize, glow, pulse }) => {
|
|
90
|
-
const sizeStyles = getSizeStyles(customSize);
|
|
87
|
+
var bubbleSx = (variant, size, glow, pulse, maxWidth) => (theme) => {
|
|
88
|
+
const sizeStyles = getSizeStyles(size);
|
|
91
89
|
return {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
...emphasisStyles(theme, glow, pulse)
|
|
102
|
-
},
|
|
103
|
-
"& .MuiTooltip-arrow": {
|
|
104
|
-
color: arrowColor(theme, customVariant)
|
|
105
|
-
}
|
|
90
|
+
borderRadius: theme.spacing(1),
|
|
91
|
+
fontSize: sizeStyles.fontSize(theme),
|
|
92
|
+
padding: sizeStyles.padding(theme),
|
|
93
|
+
fontWeight: 500,
|
|
94
|
+
transition: "all 0.3s ease",
|
|
95
|
+
position: "relative",
|
|
96
|
+
maxWidth: tooltipCap(maxWidth)(theme),
|
|
97
|
+
...variantStyles(theme, variant),
|
|
98
|
+
...emphasisStyles(theme, glow, pulse)
|
|
106
99
|
};
|
|
107
|
-
}
|
|
100
|
+
};
|
|
108
101
|
var tooltipCap = (maxWidth) => (theme) => {
|
|
109
102
|
const cap = maxWidth ?? 300;
|
|
110
103
|
return cap <= 1 && cap !== 0 ? `${cap * 100}%` : rem(theme, cap);
|
|
@@ -120,17 +113,16 @@ var Tooltip = React.forwardRef(
|
|
|
120
113
|
children,
|
|
121
114
|
...props
|
|
122
115
|
}, ref) => {
|
|
123
|
-
const childWithTestId = dataTestId ? React.cloneElement(
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
const childWithTestId = dataTestId ? React.cloneElement(
|
|
117
|
+
children,
|
|
118
|
+
{
|
|
119
|
+
"data-testid": `${dataTestId}-trigger`
|
|
120
|
+
}
|
|
121
|
+
) : children;
|
|
126
122
|
return /* @__PURE__ */ jsx(
|
|
127
|
-
|
|
123
|
+
MuiTooltip,
|
|
128
124
|
{
|
|
129
125
|
ref,
|
|
130
|
-
customVariant: variant,
|
|
131
|
-
customSize: size,
|
|
132
|
-
glow,
|
|
133
|
-
pulse,
|
|
134
126
|
enterDelay: 0,
|
|
135
127
|
leaveDelay: 0,
|
|
136
128
|
disableHoverListener: false,
|
|
@@ -138,9 +130,12 @@ var Tooltip = React.forwardRef(
|
|
|
138
130
|
disableTouchListener: false,
|
|
139
131
|
slotProps: {
|
|
140
132
|
tooltip: {
|
|
141
|
-
sx:
|
|
133
|
+
sx: bubbleSx(variant, size, glow, pulse, maxWidth),
|
|
142
134
|
role: "tooltip",
|
|
143
135
|
...dataTestId && { "data-testid": `${dataTestId}-content` }
|
|
136
|
+
},
|
|
137
|
+
arrow: {
|
|
138
|
+
sx: (theme) => ({ color: arrowColor(theme, variant) })
|
|
144
139
|
}
|
|
145
140
|
},
|
|
146
141
|
...props,
|
|
@@ -154,4 +149,4 @@ Tooltip.displayName = "Tooltip";
|
|
|
154
149
|
export {
|
|
155
150
|
Tooltip
|
|
156
151
|
};
|
|
157
|
-
//# sourceMappingURL=chunk-
|
|
152
|
+
//# sourceMappingURL=chunk-KRIPQUFB.js.map
|