@perses-dev/components 0.42.0 → 0.43.0-rc0

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 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAuB,WAAW,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAGnF,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAID,eAAO,MAAM,MAAM,+DAA0E,WAAW,gBAqBvG,CAAC"}
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAuB,WAAW,IAAI,cAAc,EAAiB,MAAM,eAAe,CAAC;AAGlG,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAID,eAAO,MAAM,MAAM,+DAA0E,WAAW,gBAuBvG,CAAC"}
@@ -11,10 +11,11 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
- import { Drawer as MuiDrawer } from '@mui/material';
14
+ import { Drawer as MuiDrawer, useMediaQuery } from '@mui/material';
15
15
  import { combineSx } from '../utils';
16
16
  const DRAWER_DEFAULT_WIDTH = 1080;
17
17
  export const Drawer = ({ anchor ='right' , isOpen , onClose , PaperProps , children , ...rest })=>{
18
+ const isSmaller = useMediaQuery(`(max-width:${DRAWER_DEFAULT_WIDTH}px)`);
18
19
  return /*#__PURE__*/ _jsx(MuiDrawer, {
19
20
  ...rest,
20
21
  open: isOpen,
@@ -23,7 +24,7 @@ export const Drawer = ({ anchor ='right' , isOpen , onClose , PaperProps , child
23
24
  PaperProps: {
24
25
  ...PaperProps,
25
26
  sx: combineSx({
26
- width: `${DRAWER_DEFAULT_WIDTH}px`,
27
+ width: isSmaller ? '100%' : `${DRAWER_DEFAULT_WIDTH}px`,
27
28
  overflow: 'hidden'
28
29
  }, PaperProps === null || PaperProps === void 0 ? void 0 : PaperProps.sx)
29
30
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Drawer/Drawer.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 { Drawer as MuiDrawer, DrawerProps as MuiDrawerProps } from '@mui/material';\nimport { combineSx } from '../utils';\n\nexport interface DrawerProps extends MuiDrawerProps {\n isOpen: boolean;\n onClose: () => void;\n anchor?: 'left' | 'right';\n}\n\nconst DRAWER_DEFAULT_WIDTH = 1080;\n\nexport const Drawer = ({ anchor = 'right', isOpen, onClose, PaperProps, children, ...rest }: DrawerProps) => {\n return (\n <MuiDrawer\n {...rest}\n open={isOpen}\n onClose={onClose}\n anchor={anchor}\n PaperProps={{\n ...PaperProps,\n sx: combineSx(\n {\n width: `${DRAWER_DEFAULT_WIDTH}px`,\n overflow: 'hidden',\n },\n PaperProps?.sx\n ),\n }}\n >\n {children}\n </MuiDrawer>\n );\n};\n"],"names":["Drawer","MuiDrawer","combineSx","DRAWER_DEFAULT_WIDTH","anchor","isOpen","onClose","PaperProps","children","rest","open","sx","width","overflow"],"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,UAAUC,SAAS,QAAuC,gBAAgB;AACnF,SAASC,SAAS,QAAQ,WAAW;AAQrC,MAAMC,uBAAuB;AAE7B,OAAO,MAAMH,SAAS,CAAC,EAAEI,QAAS,QAAO,EAAEC,OAAM,EAAEC,QAAO,EAAEC,WAAU,EAAEC,SAAQ,EAAE,GAAGC,MAAmB;IACtG,qBACE,KAACR;QACE,GAAGQ,IAAI;QACRC,MAAML;QACNC,SAASA;QACTF,QAAQA;QACRG,YAAY;YACV,GAAGA,UAAU;YACbI,IAAIT,UACF;gBACEU,OAAO,CAAC,EAAET,qBAAqB,EAAE,CAAC;gBAClCU,UAAU;YACZ,GACAN,uBAAAA,wBAAAA,KAAAA,IAAAA,WAAYI;QAEhB;kBAECH;;AAGP,EAAE"}
1
+ {"version":3,"sources":["../../src/Drawer/Drawer.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 { Drawer as MuiDrawer, DrawerProps as MuiDrawerProps, useMediaQuery } from '@mui/material';\nimport { combineSx } from '../utils';\n\nexport interface DrawerProps extends MuiDrawerProps {\n isOpen: boolean;\n onClose: () => void;\n anchor?: 'left' | 'right';\n}\n\nconst DRAWER_DEFAULT_WIDTH = 1080;\n\nexport const Drawer = ({ anchor = 'right', isOpen, onClose, PaperProps, children, ...rest }: DrawerProps) => {\n const isSmaller = useMediaQuery(`(max-width:${DRAWER_DEFAULT_WIDTH}px)`);\n\n return (\n <MuiDrawer\n {...rest}\n open={isOpen}\n onClose={onClose}\n anchor={anchor}\n PaperProps={{\n ...PaperProps,\n sx: combineSx(\n {\n width: isSmaller ? '100%' : `${DRAWER_DEFAULT_WIDTH}px`,\n overflow: 'hidden',\n },\n PaperProps?.sx\n ),\n }}\n >\n {children}\n </MuiDrawer>\n );\n};\n"],"names":["Drawer","MuiDrawer","useMediaQuery","combineSx","DRAWER_DEFAULT_WIDTH","anchor","isOpen","onClose","PaperProps","children","rest","isSmaller","open","sx","width","overflow"],"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,UAAUC,SAAS,EAAiCC,aAAa,QAAQ,gBAAgB;AAClG,SAASC,SAAS,QAAQ,WAAW;AAQrC,MAAMC,uBAAuB;AAE7B,OAAO,MAAMJ,SAAS,CAAC,EAAEK,QAAS,QAAO,EAAEC,OAAM,EAAEC,QAAO,EAAEC,WAAU,EAAEC,SAAQ,EAAE,GAAGC,MAAmB;IACtG,MAAMC,YAAYT,cAAc,CAAC,WAAW,EAAEE,qBAAqB,GAAG,CAAC;IAEvE,qBACE,KAACH;QACE,GAAGS,IAAI;QACRE,MAAMN;QACNC,SAASA;QACTF,QAAQA;QACRG,YAAY;YACV,GAAGA,UAAU;YACbK,IAAIV,UACF;gBACEW,OAAOH,YAAY,SAAS,CAAC,EAAEP,qBAAqB,EAAE,CAAC;gBACvDW,UAAU;YACZ,GACAP,uBAAAA,wBAAAA,KAAAA,IAAAA,WAAYK;QAEhB;kBAECJ;;AAGP,EAAE"}
@@ -25,6 +25,7 @@ const _material = require("@mui/material");
25
25
  const _utils = require("../utils");
26
26
  const DRAWER_DEFAULT_WIDTH = 1080;
27
27
  const Drawer = ({ anchor ='right' , isOpen , onClose , PaperProps , children , ...rest })=>{
28
+ const isSmaller = (0, _material.useMediaQuery)(`(max-width:${DRAWER_DEFAULT_WIDTH}px)`);
28
29
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Drawer, {
29
30
  ...rest,
30
31
  open: isOpen,
@@ -33,7 +34,7 @@ const Drawer = ({ anchor ='right' , isOpen , onClose , PaperProps , children , .
33
34
  PaperProps: {
34
35
  ...PaperProps,
35
36
  sx: (0, _utils.combineSx)({
36
- width: `${DRAWER_DEFAULT_WIDTH}px`,
37
+ width: isSmaller ? '100%' : `${DRAWER_DEFAULT_WIDTH}px`,
37
38
  overflow: 'hidden'
38
39
  }, PaperProps === null || PaperProps === void 0 ? void 0 : PaperProps.sx)
39
40
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/components",
3
- "version": "0.42.0",
3
+ "version": "0.43.0-rc0",
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": "^6.12.1",
39
- "@perses-dev/core": "0.42.0",
39
+ "@perses-dev/core": "0.43.0-rc0",
40
40
  "@tanstack/react-table": "^8.9.1",
41
41
  "@uiw/react-codemirror": "^4.19.1",
42
42
  "date-fns": "^2.28.0",
@@ -51,7 +51,7 @@
51
51
  "react-virtuoso": "^4.3.6"
52
52
  },
53
53
  "devDependencies": {
54
- "@perses-dev/storybook": "0.42.0"
54
+ "@perses-dev/storybook": "0.43.0-rc0"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@mui/material": "^5.10.0",