@perses-dev/components 0.0.0-snapshot-test-internal-dep-dd238ac → 0.0.0-snapshot-datasource-create-transform-e9f8493

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ButtonProps, DialogActions, DialogContentProps as MuiDialogContentProps, DialogProps, DialogTitleProps } from '@mui/material';
2
+ import { ButtonProps, DialogActions, DialogContentProps as MuiDialogContentProps, DialogProps, DialogTitleProps, Theme } from '@mui/material';
3
3
  export interface DialogHeaderProps extends DialogTitleProps {
4
4
  /**
5
5
  * Callback fired when close button is clicked. If undefined, close button will not appear in header.
@@ -16,6 +16,7 @@ export interface DialogContentProps extends MuiDialogContentProps {
16
16
  export declare const Dialog: {
17
17
  ({ children, ...props }: DialogProps): JSX.Element;
18
18
  Header: ({ children, onClose, ...props }: DialogHeaderProps) => JSX.Element;
19
+ Form: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, {}>;
19
20
  Content: ({ children, width, sx, ...props }: DialogContentProps) => JSX.Element;
20
21
  PrimaryButton: ({ children, ...props }: DialogButtonProps) => JSX.Element;
21
22
  SecondaryButton: ({ children, ...props }: DialogButtonProps) => JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,WAAW,EAEX,aAAa,EAEb,kBAAkB,IAAI,qBAAqB,EAC3C,WAAW,EAEX,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACtD;AAED,oBAAY,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAEhF,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAyCD,eAAO,MAAM,MAAM;6BAA4B,WAAW;8CAvCT,iBAAiB;iDAaR,kBAAkB;4CAM7B,iBAAiB;8CAMf,iBAAiB;;CAcyC,CAAC"}
1
+ {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,WAAW,EAEX,aAAa,EAEb,kBAAkB,IAAI,qBAAqB,EAC3C,WAAW,EAEX,gBAAgB,EAGhB,KAAK,EACN,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACtD;AAED,oBAAY,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAEhF,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqDD,eAAO,MAAM,MAAM;6BAA4B,WAAW;8CAnDT,iBAAiB;;iDAaR,kBAAkB;4CAM7B,iBAAiB;8CAMf,iBAAiB;;CA0ByC,CAAC"}
@@ -12,7 +12,7 @@
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import React from 'react';
15
- import { Button, Dialog as MuiDialog, DialogActions, DialogContent, DialogTitle, IconButton } from '@mui/material';
15
+ import { Button, Dialog as MuiDialog, DialogActions, DialogContent, DialogTitle, IconButton, styled } from '@mui/material';
16
16
  import CloseIcon from 'mdi-material-ui/Close';
17
17
  import { combineSx } from '../utils';
18
18
  const Header = ({ children , onClose , ...props })=>{
@@ -51,6 +51,16 @@ const SecondaryButton = ({ children , ...props })=>/*#__PURE__*/ _jsx(Button, {
51
51
  ...props,
52
52
  children: children
53
53
  });
54
+ /*
55
+ * Material-ui has a prop "scroll=paper" that is specifically for dialog header and actions to be sticky and body to scroll,
56
+ * but that doesn't work when dialog content is wrapped in form.
57
+ * https://github.com/mui-org/material-ui/issues/13253
58
+ * This component adds style to get expected behavior & should be used whenever we have a Form inside a Dialog
59
+ */ const Form = styled('form')({
60
+ overflowY: 'auto',
61
+ display: 'flex',
62
+ flexDirection: 'column'
63
+ });
54
64
  /**
55
65
  * Render the CSS of the dialog's close button, according to the given material theme.
56
66
  * @param theme material theme
@@ -66,6 +76,7 @@ export const Dialog = ({ children , ...props })=>/*#__PURE__*/ _jsx(MuiDialog, {
66
76
  children: children
67
77
  });
68
78
  Dialog.Header = Header;
79
+ Dialog.Form = Form;
69
80
  Dialog.Content = Content;
70
81
  Dialog.PrimaryButton = PrimaryButton;
71
82
  Dialog.SecondaryButton = SecondaryButton;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Dialog/Dialog.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport {\n Button,\n ButtonProps,\n Dialog as MuiDialog,\n DialogActions,\n DialogContent,\n DialogContentProps as MuiDialogContentProps,\n DialogProps,\n DialogTitle,\n DialogTitleProps,\n IconButton,\n Theme,\n} from '@mui/material';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport { combineSx } from '../utils';\n\nexport interface DialogHeaderProps extends DialogTitleProps {\n /**\n * Callback fired when close button is clicked. If undefined, close button will not appear in header.\n */\n onClose?: (e: React.MouseEvent<HTMLElement>) => void;\n}\n\nexport type DialogButtonProps = Omit<ButtonProps, 'variant' | 'color' | 'type'>;\n\nexport interface DialogContentProps extends MuiDialogContentProps {\n /**\n * @default 500\n */\n width?: number;\n}\n\nconst Header = ({ children, onClose, ...props }: DialogHeaderProps) => {\n return (\n <>\n <DialogTitle {...props}>{children}</DialogTitle>\n {onClose && (\n <IconButton aria-label=\"Close\" onClick={onClose} sx={dialogCloseIconButtonStyle}>\n <CloseIcon />\n </IconButton>\n )}\n </>\n );\n};\n\nconst Content = ({ children, width = 500, sx, ...props }: DialogContentProps) => (\n <DialogContent dividers {...props} sx={combineSx({ width: `${width}px` }, sx)}>\n {children}\n </DialogContent>\n);\n\nconst PrimaryButton = ({ children, ...props }: DialogButtonProps) => (\n <Button variant=\"contained\" type=\"submit\" {...props}>\n {children}\n </Button>\n);\n\nconst SecondaryButton = ({ children, ...props }: DialogButtonProps) => (\n <Button variant=\"outlined\" color=\"secondary\" {...props}>\n {children}\n </Button>\n);\n\n/**\n * Render the CSS of the dialog's close button, according to the given material theme.\n * @param theme material theme\n */\nconst dialogCloseIconButtonStyle = (theme: Theme) => {\n return { position: 'absolute', top: theme.spacing(0.5), right: theme.spacing(0.5) };\n};\n\nexport const Dialog = ({ children, ...props }: DialogProps) => <MuiDialog {...props}>{children}</MuiDialog>;\n\nDialog.Header = Header;\nDialog.Content = Content;\nDialog.PrimaryButton = PrimaryButton;\nDialog.SecondaryButton = SecondaryButton;\nDialog.Actions = DialogActions;\n"],"names":["React","Button","Dialog","MuiDialog","DialogActions","DialogContent","DialogTitle","IconButton","CloseIcon","combineSx","Header","children","onClose","props","aria-label","onClick","sx","dialogCloseIconButtonStyle","Content","width","dividers","PrimaryButton","variant","type","SecondaryButton","color","theme","position","top","spacing","right","Actions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,OAAOA,KAAK,MAAM,OAAO,CAAC;AAC1B,SACEC,MAAM,EAENC,MAAM,IAAIC,SAAS,EACnBC,aAAa,EACbC,aAAa,EAGbC,WAAW,EAEXC,UAAU,QAEL,eAAe,CAAC;AACvB,OAAOC,SAAS,MAAM,uBAAuB,CAAC;AAC9C,SAASC,SAAS,QAAQ,UAAU,CAAC;AAkBrC,MAAMC,MAAM,GAAG,CAAC,EAAEC,QAAQ,CAAA,EAAEC,OAAO,CAAA,EAAE,GAAGC,KAAK,EAAqB,GAAK;IACrE,qBACE;;0BACE,KAACP,WAAW;gBAAE,GAAGO,KAAK;0BAAGF,QAAQ;cAAe;YAC/CC,OAAO,kBACN,KAACL,UAAU;gBAACO,YAAU,EAAC,OAAO;gBAACC,OAAO,EAAEH,OAAO;gBAAEI,EAAE,EAAEC,0BAA0B;0BAC7E,cAAA,KAACT,SAAS,KAAG;cACF,AACd;;MACA,CACH;AACJ,CAAC,AAAC;AAEF,MAAMU,OAAO,GAAG,CAAC,EAAEP,QAAQ,CAAA,EAAEQ,KAAK,EAAG,GAAG,CAAA,EAAEH,EAAE,CAAA,EAAE,GAAGH,KAAK,EAAsB,iBAC1E,KAACR,aAAa;QAACe,QAAQ;QAAE,GAAGP,KAAK;QAAEG,EAAE,EAAEP,SAAS,CAAC;YAAEU,KAAK,EAAE,CAAC,EAAEA,KAAK,CAAC,EAAE,CAAC;SAAE,EAAEH,EAAE,CAAC;kBAC1EL,QAAQ;MACK,AACjB,AAAC;AAEF,MAAMU,aAAa,GAAG,CAAC,EAAEV,QAAQ,CAAA,EAAE,GAAGE,KAAK,EAAqB,iBAC9D,KAACZ,MAAM;QAACqB,OAAO,EAAC,WAAW;QAACC,IAAI,EAAC,QAAQ;QAAE,GAAGV,KAAK;kBAChDF,QAAQ;MACF,AACV,AAAC;AAEF,MAAMa,eAAe,GAAG,CAAC,EAAEb,QAAQ,CAAA,EAAE,GAAGE,KAAK,EAAqB,iBAChE,KAACZ,MAAM;QAACqB,OAAO,EAAC,UAAU;QAACG,KAAK,EAAC,WAAW;QAAE,GAAGZ,KAAK;kBACnDF,QAAQ;MACF,AACV,AAAC;AAEF;;;CAGC,GACD,MAAMM,0BAA0B,GAAG,CAACS,KAAY,GAAK;IACnD,OAAO;QAAEC,QAAQ,EAAE,UAAU;QAAEC,GAAG,EAAEF,KAAK,CAACG,OAAO,CAAC,GAAG,CAAC;QAAEC,KAAK,EAAEJ,KAAK,CAACG,OAAO,CAAC,GAAG,CAAC;KAAE,CAAC;AACtF,CAAC,AAAC;AAEF,OAAO,MAAM3B,MAAM,GAAG,CAAC,EAAES,QAAQ,CAAA,EAAE,GAAGE,KAAK,EAAe,iBAAK,KAACV,SAAS;QAAE,GAAGU,KAAK;kBAAGF,QAAQ;MAAa,CAAC;AAE5GT,MAAM,CAACQ,MAAM,GAAGA,MAAM,CAAC;AACvBR,MAAM,CAACgB,OAAO,GAAGA,OAAO,CAAC;AACzBhB,MAAM,CAACmB,aAAa,GAAGA,aAAa,CAAC;AACrCnB,MAAM,CAACsB,eAAe,GAAGA,eAAe,CAAC;AACzCtB,MAAM,CAAC6B,OAAO,GAAG3B,aAAa,CAAC"}
1
+ {"version":3,"sources":["../../src/Dialog/Dialog.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport {\n Button,\n ButtonProps,\n Dialog as MuiDialog,\n DialogActions,\n DialogContent,\n DialogContentProps as MuiDialogContentProps,\n DialogProps,\n DialogTitle,\n DialogTitleProps,\n IconButton,\n styled,\n Theme,\n} from '@mui/material';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport { combineSx } from '../utils';\n\nexport interface DialogHeaderProps extends DialogTitleProps {\n /**\n * Callback fired when close button is clicked. If undefined, close button will not appear in header.\n */\n onClose?: (e: React.MouseEvent<HTMLElement>) => void;\n}\n\nexport type DialogButtonProps = Omit<ButtonProps, 'variant' | 'color' | 'type'>;\n\nexport interface DialogContentProps extends MuiDialogContentProps {\n /**\n * @default 500\n */\n width?: number;\n}\n\nconst Header = ({ children, onClose, ...props }: DialogHeaderProps) => {\n return (\n <>\n <DialogTitle {...props}>{children}</DialogTitle>\n {onClose && (\n <IconButton aria-label=\"Close\" onClick={onClose} sx={dialogCloseIconButtonStyle}>\n <CloseIcon />\n </IconButton>\n )}\n </>\n );\n};\n\nconst Content = ({ children, width = 500, sx, ...props }: DialogContentProps) => (\n <DialogContent dividers {...props} sx={combineSx({ width: `${width}px` }, sx)}>\n {children}\n </DialogContent>\n);\n\nconst PrimaryButton = ({ children, ...props }: DialogButtonProps) => (\n <Button variant=\"contained\" type=\"submit\" {...props}>\n {children}\n </Button>\n);\n\nconst SecondaryButton = ({ children, ...props }: DialogButtonProps) => (\n <Button variant=\"outlined\" color=\"secondary\" {...props}>\n {children}\n </Button>\n);\n\n/*\n * Material-ui has a prop \"scroll=paper\" that is specifically for dialog header and actions to be sticky and body to scroll,\n * but that doesn't work when dialog content is wrapped in form.\n * https://github.com/mui-org/material-ui/issues/13253\n * This component adds style to get expected behavior & should be used whenever we have a Form inside a Dialog\n */\nconst Form = styled('form')({\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n});\n\n/**\n * Render the CSS of the dialog's close button, according to the given material theme.\n * @param theme material theme\n */\nconst dialogCloseIconButtonStyle = (theme: Theme) => {\n return { position: 'absolute', top: theme.spacing(0.5), right: theme.spacing(0.5) };\n};\n\nexport const Dialog = ({ children, ...props }: DialogProps) => <MuiDialog {...props}>{children}</MuiDialog>;\n\nDialog.Header = Header;\nDialog.Form = Form;\nDialog.Content = Content;\nDialog.PrimaryButton = PrimaryButton;\nDialog.SecondaryButton = SecondaryButton;\nDialog.Actions = DialogActions;\n"],"names":["React","Button","Dialog","MuiDialog","DialogActions","DialogContent","DialogTitle","IconButton","styled","CloseIcon","combineSx","Header","children","onClose","props","aria-label","onClick","sx","dialogCloseIconButtonStyle","Content","width","dividers","PrimaryButton","variant","type","SecondaryButton","color","Form","overflowY","display","flexDirection","theme","position","top","spacing","right","Actions"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,OAAOA,KAAK,MAAM,OAAO,CAAC;AAC1B,SACEC,MAAM,EAENC,MAAM,IAAIC,SAAS,EACnBC,aAAa,EACbC,aAAa,EAGbC,WAAW,EAEXC,UAAU,EACVC,MAAM,QAED,eAAe,CAAC;AACvB,OAAOC,SAAS,MAAM,uBAAuB,CAAC;AAC9C,SAASC,SAAS,QAAQ,UAAU,CAAC;AAkBrC,MAAMC,MAAM,GAAG,CAAC,EAAEC,QAAQ,CAAA,EAAEC,OAAO,CAAA,EAAE,GAAGC,KAAK,EAAqB,GAAK;IACrE,qBACE;;0BACE,KAACR,WAAW;gBAAE,GAAGQ,KAAK;0BAAGF,QAAQ;cAAe;YAC/CC,OAAO,kBACN,KAACN,UAAU;gBAACQ,YAAU,EAAC,OAAO;gBAACC,OAAO,EAAEH,OAAO;gBAAEI,EAAE,EAAEC,0BAA0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MhC,MAAM,GAAG,CAAC,EAAEU,QAAQ,CAAA,EAAE,GAAGE,KAAK,EAAe,iBAAK,KAACX,SAAS;QAAE,GAAGW,KAAK;kBAAGF,QAAQ;MAAa,CAAC;AAE5GV,MAAM,CAACS,MAAM,GAAGA,MAAM,CAAC;AACvBT,MAAM,CAACyB,IAAI,GAAGA,IAAI,CAAC;AACnBzB,MAAM,CAACiB,OAAO,GAAGA,OAAO,CAAC;AACzBjB,MAAM,CAACoB,aAAa,GAAGA,aAAa,CAAC;AACrCpB,MAAM,CAACuB,eAAe,GAAGA,eAAe,CAAC;AACzCvB,MAAM,CAACkC,OAAO,GAAGhC,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"InfoTooltip.d.ts","sourceRoot":"","sources":["../../src/InfoTooltip/InfoTooltip.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,oBAAY,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEnE,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,WAAW,iFAQrB,gBAAgB,gBAalB,CAAC"}
1
+ {"version":3,"file":"InfoTooltip.d.ts","sourceRoot":"","sources":["../../src/InfoTooltip/InfoTooltip.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,oBAAY,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEnE,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,WAAW,iFAQrB,gBAAgB,gBAkBlB,CAAC"}
@@ -14,6 +14,12 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
14
14
  import React from 'react';
15
15
  import { styled, Tooltip as MuiTooltip, tooltipClasses, Typography } from '@mui/material';
16
16
  export const InfoTooltip = ({ id , title , description , placement , children , enterDelay , enterNextDelay })=>{
17
+ // Only wrap in a div if passed a non-element. This enables the tooltip to
18
+ // support text with a wrapper div while avoiding breaking css on element
19
+ // children by unnecessarily wrapping them.
20
+ const formattedChildren = /*#__PURE__*/ React.isValidElement(children) ? children : /*#__PURE__*/ _jsx("div", {
21
+ children: children
22
+ });
17
23
  return /*#__PURE__*/ _jsx(StyledTooltip, {
18
24
  arrow: true,
19
25
  id: id,
@@ -24,9 +30,7 @@ export const InfoTooltip = ({ id , title , description , placement , children ,
24
30
  }),
25
31
  enterDelay: enterDelay !== null && enterDelay !== void 0 ? enterDelay : 500,
26
32
  enterNextDelay: enterNextDelay !== null && enterNextDelay !== void 0 ? enterNextDelay : 500,
27
- children: /*#__PURE__*/ _jsx("div", {
28
- children: children
29
- })
33
+ children: formattedChildren
30
34
  });
31
35
  };
32
36
  const TooltipContent = ({ title , description })=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/InfoTooltip/InfoTooltip.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport {\n styled,\n TooltipProps as MuiTooltipProps,\n Tooltip as MuiTooltip,\n tooltipClasses,\n Typography,\n} from '@mui/material';\n\nexport type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom';\n\ninterface InfoTooltipProps {\n description: string;\n children: React.ReactNode;\n id?: string;\n title?: string;\n placement?: TooltipPlacement;\n enterDelay?: number; // default is 500ms\n enterNextDelay?: number; // default is 500ms\n}\n\nexport const InfoTooltip = ({\n id,\n title,\n description,\n placement,\n children,\n enterDelay,\n enterNextDelay,\n}: InfoTooltipProps) => {\n return (\n <StyledTooltip\n arrow\n id={id}\n placement={placement ?? 'top'}\n title={<TooltipContent title={title} description={description} />}\n enterDelay={enterDelay ?? 500}\n enterNextDelay={enterNextDelay ?? 500}\n >\n <div>{children}</div>\n </StyledTooltip>\n );\n};\n\nconst TooltipContent = ({ title, description }: Pick<InfoTooltipProps, 'title' | 'description'>) => {\n return (\n <>\n {title && (\n <Typography\n variant=\"body2\"\n sx={(theme) => ({\n color: theme.palette.text.primary,\n fontWeight: theme.typography.fontWeightMedium,\n })}\n >\n {title}\n </Typography>\n )}\n <Typography\n variant=\"caption\"\n sx={(theme) => ({\n color: theme.palette.text.primary,\n })}\n >\n {description}\n </Typography>\n </>\n );\n};\n\nconst StyledTooltip = styled(({ className, ...props }: MuiTooltipProps) => (\n <MuiTooltip {...props} classes={{ popper: className }} />\n))(({ theme }) => ({\n [`& .${tooltipClasses.tooltip}`]: {\n backgroundColor: theme.palette.background.tooltip,\n color: theme.palette.text.primary,\n maxWidth: '300px',\n padding: theme.spacing(1),\n boxShadow: theme.shadows[1],\n },\n [`& .${tooltipClasses.arrow}`]: {\n color: theme.palette.background.tooltip,\n },\n}));\n"],"names":["React","styled","Tooltip","MuiTooltip","tooltipClasses","Typography","InfoTooltip","id","title","description","placement","children","enterDelay","enterNextDelay","StyledTooltip","arrow","TooltipContent","div","variant","sx","theme","color","palette","text","primary","fontWeight","typography","fontWeightMedium","className","props","classes","popper","tooltip","backgroundColor","background","maxWidth","padding","spacing","boxShadow","shadows"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,OAAOA,KAAK,MAAM,OAAO,CAAC;AAC1B,SACEC,MAAM,EAENC,OAAO,IAAIC,UAAU,EACrBC,cAAc,EACdC,UAAU,QACL,eAAe,CAAC;AAcvB,OAAO,MAAMC,WAAW,GAAG,CAAC,EAC1BC,EAAE,CAAA,EACFC,KAAK,CAAA,EACLC,WAAW,CAAA,EACXC,SAAS,CAAA,EACTC,QAAQ,CAAA,EACRC,UAAU,CAAA,EACVC,cAAc,CAAA,EACG,GAAK;IACtB,qBACE,KAACC,aAAa;QACZC,KAAK;QACLR,EAAE,EAAEA,EAAE;QACNG,SAAS,EAAEA,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,KAAK;QAC7BF,KAAK,gBAAE,KAACQ,cAAc;YAACR,KAAK,EAAEA,KAAK;YAAEC,WAAW,EAAEA,WAAW;UAAI;QACjEG,UAAU,EAAEA,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,GAAG;QAC7BC,cAAc,EAAEA,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,GAAG;kBAErC,cAAA,KAACI,KAAG;sBAAEN,QAAQ;UAAO;MACP,CAChB;AACJ,CAAC,CAAC;AAEF,MAAMK,cAAc,GAAG,CAAC,EAAER,KAAK,CAAA,EAAEC,WAAW,CAAA,EAAmD,GAAK;IAClG,qBACE;;YACGD,KAAK,kBACJ,KAACH,UAAU;gBACTa,OAAO,EAAC,OA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ltip/InfoTooltip.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport {\n styled,\n TooltipProps as MuiTooltipProps,\n Tooltip as MuiTooltip,\n tooltipClasses,\n Typography,\n} from '@mui/material';\n\nexport type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom';\n\ninterface InfoTooltipProps {\n description: string;\n children: React.ReactNode;\n id?: string;\n title?: string;\n placement?: TooltipPlacement;\n enterDelay?: number; // default is 500ms\n enterNextDelay?: number; // default is 500ms\n}\n\nexport const InfoTooltip = ({\n id,\n title,\n description,\n placement,\n children,\n enterDelay,\n enterNextDelay,\n}: InfoTooltipProps) => {\n // Only wrap in a div if passed a non-element. This enables the tooltip to\n // support text with a wrapper div while avoiding breaking css on element\n // children by unnecessarily wrapping them.\n const formattedChildren = React.isValidElement(children) ? children : <div>{children}</div>;\n\n return (\n <StyledTooltip\n arrow\n id={id}\n placement={placement ?? 'top'}\n title={<TooltipContent title={title} description={description} />}\n enterDelay={enterDelay ?? 500}\n enterNextDelay={enterNextDelay ?? 500}\n >\n {formattedChildren}\n </StyledTooltip>\n );\n};\n\nconst TooltipContent = ({ title, description }: Pick<InfoTooltipProps, 'title' | 'description'>) => {\n return (\n <>\n {title && (\n <Typography\n variant=\"body2\"\n sx={(theme) => ({\n color: theme.palette.text.primary,\n fontWeight: theme.typography.fontWeightMedium,\n })}\n >\n {title}\n </Typography>\n )}\n <Typography\n variant=\"caption\"\n sx={(theme) => ({\n color: theme.palette.text.primary,\n })}\n >\n {description}\n </Typography>\n </>\n );\n};\n\nconst StyledTooltip = styled(({ className, ...props }: MuiTooltipProps) => (\n <MuiTooltip {...props} classes={{ popper: className }} />\n))(({ theme }) => ({\n [`& .${tooltipClasses.tooltip}`]: {\n backgroundColor: theme.palette.background.tooltip,\n color: theme.palette.text.primary,\n maxWidth: '300px',\n padding: theme.spacing(1),\n boxShadow: theme.shadows[1],\n },\n [`& .${tooltipClasses.arrow}`]: {\n color: theme.palette.background.tooltip,\n },\n}));\n"],"names":["React","styled","Tooltip","MuiTooltip","tooltipClasses","Typography","InfoTooltip","id","title","description","placement","children","enterDelay","enterNextDelay","formattedChildren","isValidElement","div","StyledTooltip","arrow","TooltipContent","variant","sx","theme","color","palette","text","primary","fontWeight","typography","fontWeightMedium","className","props","classes","popper","tooltip","backgroundColor","background","maxWidth","padding","spacing","boxShadow","shadows"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,OAAOA,KAAK,MAAM,OAAO,CAAC;AAC1B,SACEC,MAAM,EAENC,OAAO,IAAIC,UAAU,EACrBC,cAAc,EACdC,UAAU,QACL,eAAe,CAAC;AAcvB,OAAO,MAAMC,WAAW,GAAG,CAAC,EAC1BC,EAAE,CAAA,EACFC,KAAK,CAAA,EACLC,WAAW,CAAA,EACXC,SAAS,CAAA,EACTC,QAAQ,CAAA,EACRC,UAAU,CAAA,EACVC,cAAc,CAAA,EACG,GAAK;IACtB,0EAA0E;IAC1E,yEAAyE;IACzE,2CAA2C;IAC3C,MAAMC,iBAAiB,iBAAGd,KAAK,CAACe,cAAc,CAACJ,QAAQ,CAAC,GAAGA,QAAQ,iBAAG,KAACK,KAAG;kBAAEL,QAAQ;MAAO,AAAC;IAE5F,qBACE,KAACM,aAAa;QACZC,KAAK;QACLX,EAAE,EAAEA,EAAE;QACNG,SAAS,EAA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AAe,EAAEb,KAAK,CAACE,OAAO,CAACY,UAAU,CAACF,OAAO;YACjDX,KAAK,EAAED,KAAK,CAACE,OAAO,CAACC,IAAI,CAACC,OAAO;YACjCW,QAAQ,EAAE,OAAO;YACjBC,OAAO,EAAEhB,KAAK,CAACiB,OAAO,CAAC,CAAC,CAAC;YACzBC,SAAS,EAAElB,KAAK,CAACmB,OAAO,CAAC,CAAC,CAAC;SAC5B;QACD,CAAC,CAAC,GAAG,EAAErC,cAAc,CAACc,KAAK,CAAC,CAAC,CAAC,EAAE;YAC9BK,KAAK,EAAED,KAAK,CAACE,OAAO,CAACY,UAAU,CAACF,OAAO;SACxC;KACF,CAAA,AAAC,CAAC,AAAC"}
@@ -1,11 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { LegendOptions, LegendItem } from '../model';
3
- interface LegendProps {
3
+ export interface LegendProps {
4
4
  width: number;
5
5
  height: number;
6
6
  data: LegendItem[];
7
7
  options: LegendOptions;
8
8
  }
9
9
  export declare function Legend({ width, height, options, data }: LegendProps): JSX.Element;
10
- export {};
11
10
  //# sourceMappingURL=Legend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../src/Legend/Legend.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIrD,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,WAAW,eA+BnE"}
1
+ {"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../src/Legend/Legend.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIrD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,WAAW,eA+BnE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Legend/Legend.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { LegendOptions, LegendItem } from '../model';\nimport { ListLegend } from './ListLegend';\nimport { CompactLegend } from './CompactLegend';\n\ninterface LegendProps {\n width: number;\n height: number;\n data: LegendItem[];\n options: LegendOptions;\n}\n\nexport function Legend({ width, height, options, data }: LegendProps) {\n if (options.position === 'Right') {\n return (\n <Box\n sx={{\n width: width,\n height: '100%',\n position: 'absolute',\n top: 0,\n right: 0,\n overflowX: 'hidden',\n overflowY: 'scroll',\n }}\n >\n <ListLegend items={data} />\n </Box>\n );\n }\n\n return (\n <Box\n sx={{\n width: width,\n height: height,\n position: 'absolute',\n bottom: 0,\n }}\n >\n <CompactLegend items={data} height={height} />\n </Box>\n );\n}\n"],"names":["Box","ListLegend","CompactLegend","Legend","width","height","options","data","position","sx","top","right","overflowX","overflowY","items","bottom"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,GAAG,QAAQ,eAAe,CAAC;AAEpC,SAASC,UAAU,QAAQ,cAAc,CAAC;AAC1C,SAASC,aAAa,QAAQ,iBAAiB,CAAC;AAShD,OAAO,SAASC,MAAM,CAAC,EAAEC,KAAK,CAAA,EAAEC,MAAM,CAAA,EAAEC,OAAO,CAAA,EAAEC,IAAI,CAAA,EAAe,EAAE;IACpE,IAAID,OAAO,CAACE,QAAQ,KAAK,OAAO,EAAE;QAChC,qBACE,KAACR,GAAG;YACFS,EAAE,EAAE;gBACFL,KAAK,EAAEA,KAAK;gBACZC,MAAM,EAAE,MAAM;gBACdG,QAAQ,EAAE,UAAU;gBACpBE,GAAG,EAAE,CAAC;gBACNC,KAAK,EAAE,CAAC;gBACRC,SAAS,EAAE,QAAQ;gBACnBC,SAAS,EAAE,QAAQ;aACpB;sBAED,cAAA,KAACZ,UAAU;gBAACa,KAAK,EAAEP,IAAI;cAAI;UACvB,CACN;IACJ,CAAC;IAED,qBACE,KAACP,GAAG;QACFS,EAAE,EAAE;YACFL,KAAK,EAAEA,KAAK;YACZC,MAAM,EAAEA,MAAM;YACdG,QAAQ,EAAE,UAAU;YACpBO,MAAM,EAAE,CAAC;SACV;kBAED,cAAA,KAACb,aAAa;YAACY,KAAK,EAAEP,IAAI;YAAEF,MAAM,EAAEA,MAAM;UAAI;MAC1C,CACN;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../src/Legend/Legend.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { LegendOptions, LegendItem } from '../model';\nimport { ListLegend } from './ListLegend';\nimport { CompactLegend } from './CompactLegend';\n\nexport interface LegendProps {\n width: number;\n height: number;\n data: LegendItem[];\n options: LegendOptions;\n}\n\nexport function Legend({ width, height, options, data }: LegendProps) {\n if (options.position === 'Right') {\n return (\n <Box\n sx={{\n width: width,\n height: '100%',\n position: 'absolute',\n top: 0,\n right: 0,\n overflowX: 'hidden',\n overflowY: 'scroll',\n }}\n >\n <ListLegend items={data} />\n </Box>\n );\n }\n\n return (\n <Box\n sx={{\n width: width,\n height: height,\n position: 'absolute',\n bottom: 0,\n }}\n >\n <CompactLegend items={data} height={height} />\n </Box>\n );\n}\n"],"names":["Box","ListLegend","CompactLegend","Legend","width","height","options","data","position","sx","top","right","overflowX","overflowY","items","bottom"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,GAAG,QAAQ,eAAe,CAAC;AAEpC,SAASC,UAAU,QAAQ,cAAc,CAAC;AAC1C,SAASC,aAAa,QAAQ,iBAAiB,CAAC;AAShD,OAAO,SAASC,MAAM,CAAC,EAAEC,KAAK,CAAA,EAAEC,MAAM,CAAA,EAAEC,OAAO,CAAA,EAAEC,IAAI,CAAA,EAAe,EAAE;IACpE,IAAID,OAAO,CAACE,QAAQ,KAAK,OAAO,EAAE;QAChC,qBACE,KAACR,GAAG;YACFS,EAAE,EAAE;gBACFL,KAAK,EAAEA,KAAK;gBACZC,MAAM,EAAE,MAAM;gBACdG,QAAQ,EAAE,UAAU;gBACpBE,GAAG,EAAE,CAAC;gBACNC,KAAK,EAAE,CAAC;gBACRC,SAAS,EAAE,QAAQ;gBACnBC,SAAS,EAAE,QAAQ;aACpB;sBAED,cAAA,KAACZ,UAAU;gBAACa,KAAK,EAAEP,IAAI;cAAI;UACvB,CACN;IACJ,CAAC;IAED,qBACE,KAACP,GAAG;QACFS,EAAE,EAAE;YACFL,KAAK,EAAEA,KAAK;YACZC,MAAM,EAAEA,MAAM;YACdG,QAAQ,EAAE,UAAU;YACpBO,MAAM,EAAE,CAAC;SACV;kBAED,cAAA,KAACb,aAAa;YAACY,KAAK,EAAEP,IAAI;YAAEF,MAAM,EAAEA,MAAM;UAAI;MAC1C,CACN;AACJ,CAAC"}
@@ -64,6 +64,16 @@ const SecondaryButton = ({ children , ...props })=>/*#__PURE__*/ (0, _jsxRuntime
64
64
  ...props,
65
65
  children: children
66
66
  });
67
+ /*
68
+ * Material-ui has a prop "scroll=paper" that is specifically for dialog header and actions to be sticky and body to scroll,
69
+ * but that doesn't work when dialog content is wrapped in form.
70
+ * https://github.com/mui-org/material-ui/issues/13253
71
+ * This component adds style to get expected behavior & should be used whenever we have a Form inside a Dialog
72
+ */ const Form = (0, _material.styled)('form')({
73
+ overflowY: 'auto',
74
+ display: 'flex',
75
+ flexDirection: 'column'
76
+ });
67
77
  /**
68
78
  * Render the CSS of the dialog's close button, according to the given material theme.
69
79
  * @param theme material theme
@@ -79,6 +89,7 @@ const Dialog = ({ children , ...props })=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_ma
79
89
  children: children
80
90
  });
81
91
  Dialog.Header = Header;
92
+ Dialog.Form = Form;
82
93
  Dialog.Content = Content;
83
94
  Dialog.PrimaryButton = PrimaryButton;
84
95
  Dialog.SecondaryButton = SecondaryButton;
@@ -27,6 +27,12 @@ function _interopRequireDefault(obj) {
27
27
  };
28
28
  }
29
29
  const InfoTooltip = ({ id , title , description , placement , children , enterDelay , enterNextDelay })=>{
30
+ // Only wrap in a div if passed a non-element. This enables the tooltip to
31
+ // support text with a wrapper div while avoiding breaking css on element
32
+ // children by unnecessarily wrapping them.
33
+ const formattedChildren = /*#__PURE__*/ _react.default.isValidElement(children) ? children : /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
34
+ children: children
35
+ });
30
36
  return /*#__PURE__*/ (0, _jsxRuntime.jsx)(StyledTooltip, {
31
37
  arrow: true,
32
38
  id: id,
@@ -37,9 +43,7 @@ const InfoTooltip = ({ id , title , description , placement , children , enterDe
37
43
  }),
38
44
  enterDelay: enterDelay !== null && enterDelay !== void 0 ? enterDelay : 500,
39
45
  enterNextDelay: enterNextDelay !== null && enterNextDelay !== void 0 ? enterNextDelay : 500,
40
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
41
- children: children
42
- })
46
+ children: formattedChildren
43
47
  });
44
48
  };
45
49
  const TooltipContent = ({ title , description })=>{
@@ -0,0 +1,102 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "MuiAlert", {
18
+ enumerable: true,
19
+ get: ()=>MuiAlert
20
+ });
21
+ const _material = require("@mui/material");
22
+ const MuiAlert = {
23
+ defaultProps: {
24
+ variant: 'standard',
25
+ severity: 'success'
26
+ },
27
+ styleOverrides: {
28
+ standardError: ({ theme })=>{
29
+ return theme.palette.mode === 'dark' ? {
30
+ ...theme.typography.body1,
31
+ backgroundColor: theme.palette.error.dark,
32
+ color: theme.palette.error.light,
33
+ [`& .${_material.alertClasses.icon}`]: {
34
+ color: theme.palette.error.main
35
+ }
36
+ } : {
37
+ ...theme.typography.body1,
38
+ backgroundColor: theme.palette.error.light,
39
+ color: theme.palette.error.dark,
40
+ [`& .${_material.alertClasses.icon}`]: {
41
+ color: theme.palette.error.main
42
+ }
43
+ };
44
+ },
45
+ standardInfo: ({ theme })=>{
46
+ return theme.palette.mode === 'dark' ? {
47
+ ...theme.typography.body1,
48
+ backgroundColor: theme.palette.info.dark,
49
+ color: theme.palette.info.light,
50
+ [`& .${_material.alertClasses.icon}`]: {
51
+ color: theme.palette.info.main
52
+ }
53
+ } : {
54
+ ...theme.typography.body1,
55
+ backgroundColor: theme.palette.info.light,
56
+ color: theme.palette.info.dark,
57
+ [`& .${_material.alertClasses.icon}`]: {
58
+ color: theme.palette.info.main
59
+ }
60
+ };
61
+ },
62
+ standardSuccess: ({ theme })=>{
63
+ return theme.palette.mode === 'dark' ? {
64
+ ...theme.typography.body1,
65
+ backgroundColor: theme.palette.success.dark,
66
+ color: theme.palette.success.light,
67
+ [`& .${_material.alertClasses.icon}`]: {
68
+ color: theme.palette.success.main
69
+ }
70
+ } : {
71
+ ...theme.typography.body1,
72
+ backgroundColor: theme.palette.success.light,
73
+ color: theme.palette.success.dark,
74
+ [`& .${_material.alertClasses.icon}`]: {
75
+ color: theme.palette.success.main
76
+ }
77
+ };
78
+ },
79
+ standardWarning: ({ theme })=>{
80
+ return theme.palette.mode === 'dark' ? {
81
+ ...theme.typography.body1,
82
+ backgroundColor: theme.palette.warning.dark,
83
+ color: theme.palette.warning.light,
84
+ [`& .${_material.alertClasses.icon}`]: {
85
+ color: theme.palette.warning.main
86
+ }
87
+ } : {
88
+ ...theme.typography.body1,
89
+ backgroundColor: theme.palette.warning.light,
90
+ color: theme.palette.warning.dark,
91
+ [`& .${_material.alertClasses.icon}`]: {
92
+ color: theme.palette.warning.main
93
+ }
94
+ };
95
+ },
96
+ root: {
97
+ ['& .' + _material.linkClasses.root]: {
98
+ textDecoration: 'underline'
99
+ }
100
+ }
101
+ }
102
+ };
@@ -19,6 +19,7 @@ Object.defineProperty(exports, "getTheme", {
19
19
  get: ()=>getTheme
20
20
  });
21
21
  const _material = require("@mui/material");
22
+ const _alert = require("./component-overrides/alert");
22
23
  const _paletteOptions = require("./palette/palette-options");
23
24
  const _typography = require("./typography");
24
25
  const getModalBackgroundStyle = ({ theme })=>{
@@ -41,6 +42,7 @@ function getTheme(mode) {
41
42
  }
42
43
  // Overrides for component default prop values and styles go here
43
44
  const components = {
45
+ MuiAlert: _alert.MuiAlert,
44
46
  MuiFormControl: {
45
47
  defaultProps: {
46
48
  size: 'small'
@@ -65,16 +67,5 @@ const components = {
65
67
  styleOverrides: {
66
68
  paper: getModalBackgroundStyle
67
69
  }
68
- },
69
- MuiAlert: {
70
- styleOverrides: {
71
- standardError: ({ theme })=>({
72
- backgroundColor: theme.palette.designSystem.red[500],
73
- color: theme.palette.common.white,
74
- [`& .${_material.alertClasses.icon}`]: {
75
- color: theme.palette.common.white
76
- }
77
- })
78
- }
79
70
  }
80
71
  };
@@ -0,0 +1,3 @@
1
+ import { Components, Theme } from '@mui/material';
2
+ export declare const MuiAlert: Components<Theme>['MuiAlert'];
3
+ //# sourceMappingURL=alert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/theme/component-overrides/alert.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,KAAK,EAA6B,MAAM,eAAe,CAAC;AAE7E,eAAO,MAAM,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,UAAU,CAwFlD,CAAC"}
@@ -0,0 +1,96 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { alertClasses, linkClasses } from '@mui/material';
14
+ export const MuiAlert = {
15
+ defaultProps: {
16
+ variant: 'standard',
17
+ severity: 'success'
18
+ },
19
+ styleOverrides: {
20
+ standardError: ({ theme })=>{
21
+ return theme.palette.mode === 'dark' ? {
22
+ ...theme.typography.body1,
23
+ backgroundColor: theme.palette.error.dark,
24
+ color: theme.palette.error.light,
25
+ [`& .${alertClasses.icon}`]: {
26
+ color: theme.palette.error.main
27
+ }
28
+ } : {
29
+ ...theme.typography.body1,
30
+ backgroundColor: theme.palette.error.light,
31
+ color: theme.palette.error.dark,
32
+ [`& .${alertClasses.icon}`]: {
33
+ color: theme.palette.error.main
34
+ }
35
+ };
36
+ },
37
+ standardInfo: ({ theme })=>{
38
+ return theme.palette.mode === 'dark' ? {
39
+ ...theme.typography.body1,
40
+ backgroundColor: theme.palette.info.dark,
41
+ color: theme.palette.info.light,
42
+ [`& .${alertClasses.icon}`]: {
43
+ color: theme.palette.info.main
44
+ }
45
+ } : {
46
+ ...theme.typography.body1,
47
+ backgroundColor: theme.palette.info.light,
48
+ color: theme.palette.info.dark,
49
+ [`& .${alertClasses.icon}`]: {
50
+ color: theme.palette.info.main
51
+ }
52
+ };
53
+ },
54
+ standardSuccess: ({ theme })=>{
55
+ return theme.palette.mode === 'dark' ? {
56
+ ...theme.typography.body1,
57
+ backgroundColor: theme.palette.success.dark,
58
+ color: theme.palette.success.light,
59
+ [`& .${alertClasses.icon}`]: {
60
+ color: theme.palette.success.main
61
+ }
62
+ } : {
63
+ ...theme.typography.body1,
64
+ backgroundColor: theme.palette.success.light,
65
+ color: theme.palette.success.dark,
66
+ [`& .${alertClasses.icon}`]: {
67
+ color: theme.palette.success.main
68
+ }
69
+ };
70
+ },
71
+ standardWarning: ({ theme })=>{
72
+ return theme.palette.mode === 'dark' ? {
73
+ ...theme.typography.body1,
74
+ backgroundColor: theme.palette.warning.dark,
75
+ color: theme.palette.warning.light,
76
+ [`& .${alertClasses.icon}`]: {
77
+ color: theme.palette.warning.main
78
+ }
79
+ } : {
80
+ ...theme.typography.body1,
81
+ backgroundColor: theme.palette.warning.light,
82
+ color: theme.palette.warning.dark,
83
+ [`& .${alertClasses.icon}`]: {
84
+ color: theme.palette.warning.main
85
+ }
86
+ };
87
+ },
88
+ root: {
89
+ ['& .' + linkClasses.root]: {
90
+ textDecoration: 'underline'
91
+ }
92
+ }
93
+ }
94
+ };
95
+
96
+ //# sourceMappingURL=alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/theme/component-overrides/alert.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Components, Theme, alertClasses, linkClasses } from '@mui/material';\n\nexport const MuiAlert: Components<Theme>['MuiAlert'] = {\n defaultProps: {\n variant: 'standard',\n severity: 'success',\n },\n styleOverrides: {\n standardError: ({ theme }) => {\n return theme.palette.mode === 'dark'\n ? {\n ...theme.typography.body1,\n backgroundColor: theme.palette.error.dark,\n color: theme.palette.error.light,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.error.main,\n },\n }\n : {\n ...theme.typography.body1,\n backgroundColor: theme.palette.error.light,\n color: theme.palette.error.dark,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.error.main,\n },\n };\n },\n standardInfo: ({ theme }) => {\n return theme.palette.mode === 'dark'\n ? {\n ...theme.typography.body1,\n backgroundColor: theme.palette.info.dark,\n color: theme.palette.info.light,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.info.main,\n },\n }\n : {\n ...theme.typography.body1,\n backgroundColor: theme.palette.info.light,\n color: theme.palette.info.dark,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.info.main,\n },\n };\n },\n standardSuccess: ({ theme }) => {\n return theme.palette.mode === 'dark'\n ? {\n ...theme.typography.body1,\n backgroundColor: theme.palette.success.dark,\n color: theme.palette.success.light,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.success.main,\n },\n }\n : {\n ...theme.typography.body1,\n backgroundColor: theme.palette.success.light,\n color: theme.palette.success.dark,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.success.main,\n },\n };\n },\n standardWarning: ({ theme }) => {\n return theme.palette.mode === 'dark'\n ? {\n ...theme.typography.body1,\n backgroundColor: theme.palette.warning.dark,\n color: theme.palette.warning.light,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.warning.main,\n },\n }\n : {\n ...theme.typography.body1,\n backgroundColor: theme.palette.warning.light,\n color: theme.palette.warning.dark,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.warning.main,\n },\n };\n },\n root: {\n ['& .' + linkClasses.root]: {\n textDecoration: 'underline',\n },\n },\n },\n};\n"],"names":["alertClasses","linkClasses","MuiAlert","defaultProps","variant","severity","styleOverrides","standardError","theme","palette","mode","typography","body1","backgroundColor","error","dark","color","light","icon","main","standardInfo","info","standardSuccess","success","standardWarning","warning","root","textDecoration"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAA4BA,YAAY,EAAEC,WAAW,QAAQ,eAAe,CAAC;AAE7E,OAAO,MAAMC,QAAQ,GAAkC;IACrDC,YAAY,EAAE;QACZC,OAAO,EAAE,UAAU;QACnBC,QAAQ,EAAE,SAAS;KACpB;IACDC,cAAc,EAAE;QACdC,aAAa,EAAE,CAAC,EAAEC,KAAK,CAAA,EAAE,GAAK;YA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KAAK;gBACzBC,eAAe,EAAEL,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACV,IAAI;gBAC3CC,KAAK,EAAER,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACR,KAAK;gBAClC,CAAC,CAAC,GAAG,EAAEjB,YAAY,CAACkB,IAAI,CAAC,CAAC,CAAC,EAAE;oBAC3BF,KAAK,EAAER,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACN,IAAI;iBAClC;aACF,GACD;gBACE,GAAGX,KAAK,CAACG,UAAU,CAACC,KAAK;gBACzBC,eAAe,EAAEL,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACR,KAAK;gBAC5CD,KAAK,EAAER,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACV,IAAI;gBACjC,CAAC,CAAC,GAAG,EAAEf,YAAY,CAACkB,IAAI,CAAC,CAAC,CAAC,EAAE;oBAC3BF,KAAK,EAAER,KAAK,CAACC,OAAO,CAACgB,OAAO,CAACN,IAAI;iBAClC;aACF,CAAC;QACR,CAAC;QACDO,IAAI,EAAE;YACJ,CAAC,KAAK,GAAGzB,WAAW,CAACyB,IAAI,CAAC,EAAE;gBAC1BC,cAAc,EAAE,WAAW;aAC5B;SACF;KACF;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAaA,OAAO,EAAe,WAAW,EAAgB,KAAK,EAAgB,MAAM,eAAe,CAAC;AAiB5F;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,SAQzC"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAaA,OAAO,EAAe,WAAW,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAkB9E;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,WAAW,SAQzC"}
@@ -10,7 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { createTheme, alertClasses } from '@mui/material';
13
+ import { createTheme } from '@mui/material';
14
+ import { MuiAlert } from './component-overrides/alert';
14
15
  import { getPaletteOptions } from './palette/palette-options';
15
16
  import { typography } from './typography';
16
17
  const getModalBackgroundStyle = ({ theme })=>{
@@ -42,6 +43,7 @@ const getModalBackgroundStyle = ({ theme })=>{
42
43
  }
43
44
  // Overrides for component default prop values and styles go here
44
45
  const components = {
46
+ MuiAlert,
45
47
  MuiFormControl: {
46
48
  defaultProps: {
47
49
  size: 'small'
@@ -66,17 +68,6 @@ const components = {
66
68
  styleOverrides: {
67
69
  paper: getModalBackgroundStyle
68
70
  }
69
- },
70
- MuiAlert: {
71
- styleOverrides: {
72
- standardError: ({ theme })=>({
73
- backgroundColor: theme.palette.designSystem.red[500],
74
- color: theme.palette.common.white,
75
- [`& .${alertClasses.icon}`]: {
76
- color: theme.palette.common.white
77
- }
78
- })
79
- }
80
71
  }
81
72
  };
82
73
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/theme/theme.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createTheme, PaletteMode, ThemeOptions, Theme, alertClasses } from '@mui/material';\nimport { getPaletteOptions } from './palette/palette-options';\nimport { typography } from './typography';\n\nconst getModalBackgroundStyle = ({ theme }: { theme: Omit<Theme, 'components'> }) => {\n const backgroundStyle =\n theme.palette.mode === 'light'\n ? {}\n : {\n backgroundImage: 'unset',\n backgroundColor: theme.palette.designSystem.grey[800],\n };\n return {\n ...backgroundStyle,\n };\n};\n\n/**\n * Gets theme used by all components for the provided mode. For more details, see:\n * - Base colors, typography, sizing - go/chrono-ui-theme\n * - Material UI defaults: https://material-ui.com/customization/default-theme/\n * - Material UI variables: https://material-ui.com/customization/theming/#theme-configuration-variables\n * - Material UI global overrides and default props: https://material-ui.com/customization/globals/#css\n *\n * Need to reinstantiate the theme everytime to support switching between light and dark themes\n * https://github.com/mui-org/material-ui/issues/18831\n */\nexport function getTheme(mode: PaletteMode) {\n const theme = createTheme({\n palette: getPaletteOptions(mode),\n typography,\n mixins: {},\n components,\n });\n return theme;\n}\n\n// Overrides for component default prop values and styles go here\nconst components: ThemeOptions['components'] = {\n MuiFormControl: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiTextField: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiDrawer: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiDialog: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiPopover: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiAlert: {\n styleOverrides: {\n standardError: ({ theme }) => ({\n backgroundColor: theme.palette.designSystem.red[500],\n color: theme.palette.common.white,\n [`&\t.${alertClasses.icon}`]: {\n color: theme.palette.common.white,\n },\n }),\n },\n },\n};\n"],"names":["createTheme","alertClasses","getPaletteOptions","typography","getModalBackgroundStyle","theme","backgroundStyle","palette","mode","backgroundImage","backgroundColor","designSystem","grey","getTheme","mixins","components","MuiFormControl","defaultProps","size","MuiTextField","MuiDrawer","styleOverrides","paper","MuiDialog","MuiPopover","MuiAlert","standardError","red","color","common","white","icon"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,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AAe,EAAEL,KAAK,CAACE,OAAO,CAACI,YAAY,CAACgB,GAAG,CAAC,GAAG,CAAC;oBACpDC,KAAK,EAAEvB,KAAK,CAACE,OAAO,CAACsB,MAAM,CAACC,KAAK;oBACjC,CAAC,CAAC,GAAG,EAAE7B,YAAY,CAAC8B,IAAI,CAAC,CAAC,CAAC,EAAE;wBAC3BH,KAAK,EAAEvB,KAAK,CAACE,OAAO,CAACsB,MAAM,CAACC,KAAK;qBAClC;iBACF,CAAA,AAAC;SACH;KACF;CACF,AAAC"}
1
+ {"version":3,"sources":["../../src/theme/theme.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createTheme, PaletteMode, ThemeOptions, Theme } from '@mui/material';\nimport { MuiAlert } from './component-overrides/alert';\nimport { getPaletteOptions } from './palette/palette-options';\nimport { typography } from './typography';\n\nconst getModalBackgroundStyle = ({ theme }: { theme: Omit<Theme, 'components'> }) => {\n const backgroundStyle =\n theme.palette.mode === 'light'\n ? {}\n : {\n backgroundImage: 'unset',\n backgroundColor: theme.palette.designSystem.grey[800],\n };\n return {\n ...backgroundStyle,\n };\n};\n\n/**\n * Gets theme used by all components for the provided mode. For more details, see:\n * - Base colors, typography, sizing - go/chrono-ui-theme\n * - Material UI defaults: https://material-ui.com/customization/default-theme/\n * - Material UI variables: https://material-ui.com/customization/theming/#theme-configuration-variables\n * - Material UI global overrides and default props: https://material-ui.com/customization/globals/#css\n *\n * Need to reinstantiate the theme everytime to support switching between light and dark themes\n * https://github.com/mui-org/material-ui/issues/18831\n */\nexport function getTheme(mode: PaletteMode) {\n const theme = createTheme({\n palette: getPaletteOptions(mode),\n typography,\n mixins: {},\n components,\n });\n return theme;\n}\n\n// Overrides for component default prop values and styles go here\nconst components: ThemeOptions['components'] = {\n MuiAlert,\n MuiFormControl: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiTextField: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiDrawer: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiDialog: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiPopover: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n};\n"],"names":["createTheme","MuiAlert","getPaletteOptions","typography","getModalBackgroundStyle","theme","backgroundStyle","palette","mode","backgroundImage","backgroundColor","designSystem","grey","getTheme","mixins","components","MuiFormControl","defaultProps","size","MuiTextField","MuiDrawer","styleOverrides","paper","MuiDialog","MuiPopover"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,QAA0C,eAAe,CAAC;AAC9E,SAASC,QAAQ,QAAQ,6BAA6B,CAAC;AACvD,SAASC,iBAAiB,QAAQ,2BAA2B,CAAC;AAC9D,SAASC,UAAU,QAAQ,cAAc,CAAC;AAE1C,MAAMC,uBAAuB,GAAG,CAAC,EAAEC,KAAK,CAAA,EAAwC,GAAK;IACnF,MAAMC,eAAe,GACnBD,KAAK,CAACE,OAAO,CAACC,IAAI,KAAK,OAAO,GAC1B,EAAE,GACF;QACEC,eAAe,EAAE,OAAO;QACxBC,eAAe,EAAEL,KAAK,CAACE,OAAO,CAACI,YAAY,CAACC,IAAI,CAAC,GAAG,CAAC;KACtD,AAAC;IACR,OAAO;QACL,GAAGN,eAAe;KACnB,CAAC;AACJ,CAAC,AAAC;AAEF;;;;;;;;;CASC,GACD,OAAO,SAASO,QAAQ,CAACL,IAAiB,EAAE;IAC1C,MAAMH,KAAK,GAAGL,WAAW,CAAC;QACxBO,OAAO,EAAEL,iBAAiB,CAACM,IAAI,CAAC;QAChCL,UAAU;QACVW,MAAM,EAAE,EAAE;QACVC,UAAU;KACX,CAAC,AAAC;IACH,OAAOV,KAAK,CAAC;AACf,CAAC;AAED,iEAAiE;AACjE,MAAMU,UAAU,GAA+B;IAC7Cd,QAAQ;IACRe,cAAc,EAAE;QACdC,YAAY,EAAE;YACZC,IAAI,EAAE,OAAO;SACd;KACF;IACDC,YAAY,EAAE;QACZF,YAAY,EAAE;YACZC,IAAI,EAAE,OAAO;SACd;KACF;IACDE,SAAS,EAAE;QACTC,cAAc,EAAE;YACdC,KAAK,EAAElB,uBAAuB;SAC/B;KACF;IACDmB,SAAS,EAAE;QACTF,cAAc,EAAE;YACdC,KAAK,EAAElB,uBAAuB;SAC/B;KACF;IACDoB,UAAU,EAAE;QACVH,cAAc,EAAE;YACdC,KAAK,EAAElB,uBAAuB;SAC/B;KACF;CACF,AAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/components",
3
- "version": "0.0.0-snapshot-test-internal-dep-dd238ac",
3
+ "version": "0.0.0-snapshot-datasource-create-transform-e9f8493",
4
4
  "description": "Common UI components used across Perses features",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -36,7 +36,7 @@
36
36
  "@codemirror/lang-json": "^6.0.1",
37
37
  "@fontsource/lato": "^4.5.10",
38
38
  "@mui/x-date-pickers": "^5.0.0-beta.1",
39
- "@perses-dev/core": "0.0.0-snapshot-test-internal-dep-dd238ac",
39
+ "@perses-dev/core": "0.0.0-snapshot-datasource-create-transform-e9f8493",
40
40
  "@uiw/react-codemirror": "^4.19.1",
41
41
  "date-fns": "^2.28.0",
42
42
  "date-fns-tz": "^1.3.7",
@@ -48,7 +48,7 @@
48
48
  "react-error-boundary": "^3.1.4"
49
49
  },
50
50
  "devDependencies": {
51
- "@perses-dev/storybook": "0.0.0-snapshot-test-internal-dep-dd238ac"
51
+ "@perses-dev/storybook": "0.0.0-snapshot-datasource-create-transform-e9f8493"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@mui/material": "^5.10.0",