@backstage/plugin-org-react 0.1.37-next.1 → 0.1.37-next.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @backstage/plugin-org-react
2
2
 
3
+ ## 0.1.37-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a47fd39: Removes instances of default React imports, a necessary update for the upcoming React 19 migration.
8
+
9
+ <https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
10
+
11
+ - Updated dependencies
12
+ - @backstage/core-components@0.17.1-next.1
13
+ - @backstage/core-plugin-api@1.10.6-next.0
14
+ - @backstage/plugin-catalog-react@1.17.0-next.2
15
+ - @backstage/catalog-client@1.9.1
16
+ - @backstage/catalog-model@1.7.3
17
+
3
18
  ## 0.1.37-next.1
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -12,7 +12,7 @@ To use the `GroupListPicker` component you'll need to import it and add it to yo
12
12
 
13
13
  ```diff
14
14
  + import { GroupListPicker } from '@backstage/plugin-org-react';
15
- + import React, { useState } from 'react';
15
+ + import { useState } from 'react';
16
16
 
17
17
  + const [group, setGroup] = useState<GroupEntity | undefined>();
18
18
 
@@ -1,4 +1,5 @@
1
- import React, { useCallback } from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { useState, useCallback } from 'react';
2
3
  import { catalogApiRef, humanizeEntityRef } from '@backstage/plugin-catalog-react';
3
4
  import TextField from '@material-ui/core/TextField';
4
5
  import Autocomplete from '@material-ui/lab/Autocomplete';
@@ -11,8 +12,8 @@ import { GroupListPickerButton } from './GroupListPickerButton.esm.js';
11
12
  const GroupListPicker = (props) => {
12
13
  const catalogApi = useApi(catalogApiRef);
13
14
  const { onChange, groupTypes, placeholder = "", defaultValue = "" } = props;
14
- const [anchorEl, setAnchorEl] = React.useState(null);
15
- const [inputValue, setInputValue] = React.useState(defaultValue);
15
+ const [anchorEl, setAnchorEl] = useState(null);
16
+ const [inputValue, setInputValue] = useState(defaultValue);
16
17
  const handleClick = (event) => {
17
18
  setAnchorEl(event.currentTarget);
18
19
  };
@@ -41,41 +42,44 @@ const GroupListPicker = (props) => {
41
42
  [onChange]
42
43
  );
43
44
  if (error) {
44
- return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
45
+ return /* @__PURE__ */ jsx(ResponseErrorPanel, { error });
45
46
  }
46
47
  const getHumanEntityRef = (entity) => humanizeEntityRef(entity);
47
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
48
- Popover,
49
- {
50
- anchorEl,
51
- open,
52
- onClose: handleClose,
53
- anchorOrigin: { horizontal: "left", vertical: "bottom" }
54
- },
55
- /* @__PURE__ */ React.createElement(
56
- Autocomplete,
48
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
49
+ /* @__PURE__ */ jsx(
50
+ Popover,
57
51
  {
58
- "data-testid": "group-list-picker-input",
59
- loading,
60
- options: groups ?? [],
61
- groupBy: (option) => option.spec.type,
62
- getOptionLabel: (option) => option.spec.profile?.displayName ?? getHumanEntityRef(option),
63
- inputValue,
64
- onInputChange: (_, value) => setInputValue(value),
65
- onChange: handleChange,
66
- style: { width: "300px" },
67
- renderInput: (params) => /* @__PURE__ */ React.createElement(
68
- TextField,
52
+ anchorEl,
53
+ open,
54
+ onClose: handleClose,
55
+ anchorOrigin: { horizontal: "left", vertical: "bottom" },
56
+ children: /* @__PURE__ */ jsx(
57
+ Autocomplete,
69
58
  {
70
- ...params,
71
- autoFocus: true,
72
- placeholder,
73
- variant: "outlined"
59
+ "data-testid": "group-list-picker-input",
60
+ loading,
61
+ options: groups ?? [],
62
+ groupBy: (option) => option.spec.type,
63
+ getOptionLabel: (option) => option.spec.profile?.displayName ?? getHumanEntityRef(option),
64
+ inputValue,
65
+ onInputChange: (_, value) => setInputValue(value),
66
+ onChange: handleChange,
67
+ style: { width: "300px" },
68
+ renderInput: (params) => /* @__PURE__ */ jsx(
69
+ TextField,
70
+ {
71
+ ...params,
72
+ autoFocus: true,
73
+ placeholder,
74
+ variant: "outlined"
75
+ }
76
+ )
74
77
  }
75
78
  )
76
79
  }
77
- )
78
- ), /* @__PURE__ */ React.createElement(GroupListPickerButton, { handleClick, group: inputValue }));
80
+ ),
81
+ /* @__PURE__ */ jsx(GroupListPickerButton, { handleClick, group: inputValue })
82
+ ] });
79
83
  };
80
84
 
81
85
  export { GroupListPicker };
@@ -1 +1 @@
1
- {"version":3,"file":"GroupListPicker.esm.js","sources":["../../../src/components/GroupListPicker/GroupListPicker.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\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 */\n\nimport React, { useCallback } from 'react';\nimport {\n catalogApiRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport TextField from '@material-ui/core/TextField';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport useAsync from 'react-use/esm/useAsync';\nimport Popover from '@material-ui/core/Popover';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ResponseErrorPanel } from '@backstage/core-components';\nimport { Entity, GroupEntity } from '@backstage/catalog-model';\nimport { GroupListPickerButton } from './GroupListPickerButton';\n\n/**\n * Props for {@link GroupListPicker}.\n *\n * @public\n */\nexport type GroupListPickerProps = {\n defaultValue?: string;\n placeholder?: string;\n groupTypes?: Array<string>;\n onChange: (value: GroupEntity | undefined) => void;\n};\n\n/** @public */\nexport const GroupListPicker = (props: GroupListPickerProps) => {\n const catalogApi = useApi(catalogApiRef);\n\n const { onChange, groupTypes, placeholder = '', defaultValue = '' } = props;\n const [anchorEl, setAnchorEl] = React.useState<HTMLElement | null>(null);\n const [inputValue, setInputValue] = React.useState(defaultValue);\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const open = Boolean(anchorEl);\n\n const {\n loading,\n error,\n value: groups,\n } = useAsync(async () => {\n const groupsList = await catalogApi.getEntities({\n filter: {\n kind: 'Group',\n 'spec.type': groupTypes || [],\n },\n });\n\n return groupsList.items as GroupEntity[];\n }, [catalogApi, groupTypes]);\n\n const handleChange = useCallback(\n (_: unknown, v: GroupEntity | null) => {\n onChange(v ?? undefined);\n setAnchorEl(null);\n },\n [onChange],\n );\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const getHumanEntityRef = (entity: Entity) => humanizeEntityRef(entity);\n\n return (\n <>\n <Popover\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }}\n >\n <Autocomplete\n data-testid=\"group-list-picker-input\"\n loading={loading}\n options={groups ?? []}\n groupBy={option => option.spec.type}\n getOptionLabel={option =>\n option.spec.profile?.displayName ?? getHumanEntityRef(option)\n }\n inputValue={inputValue}\n onInputChange={(_, value) => setInputValue(value)}\n onChange={handleChange}\n style={{ width: '300px' }}\n renderInput={params => (\n <TextField\n {...params}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n placeholder={placeholder}\n variant=\"outlined\"\n />\n )}\n />\n </Popover>\n <GroupListPickerButton handleClick={handleClick} group={inputValue} />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA2Ca,MAAA,eAAA,GAAkB,CAAC,KAAgC,KAAA;AAC9D,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AAEvC,EAAA,MAAM,EAAE,QAAU,EAAA,UAAA,EAAY,cAAc,EAAI,EAAA,YAAA,GAAe,IAAO,GA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AA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,QAAA;AAAA,MACA,IAAA;AAAA,MACA,OAAS,EAAA,WAAA;AAAA,MACT,YAAc,EAAA,EAAE,UAAY,EAAA,MAAA,EAAQ,UAAU,QAAS;AAAA,KAAA;AAAA,oBAEvD,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,aAAY,EAAA,yBAAA;AAAA,QACZ,OAAA;AAAA,QACA,OAAA,EAAS,UAAU,EAAC;AAAA,QACpB,OAAA,EAAS,CAAU,MAAA,KAAA,MAAA,CAAO,IAAK,CAAA,IAAA;AAAA,QAC/B,gBAAgB,CACd,MAAA,KAAA,MAAA,CAAO,KAAK,OAAS,EAAA,WAAA,IAAe,kBAAkB,MAAM,CAAA;AAAA,QAE9D,UAAA;AAAA,QACA,aAAe,EAAA,CAAC,CAAG,EAAA,KAAA,KAAU,cAAc,KAAK,CAAA;AAAA,QAChD,QAAU,EAAA,YAAA;AAAA,QACV,KAAA,EAAO,EAAE,KAAA,EAAO,OAAQ,EAAA;AAAA,QACxB,aAAa,CACX,MAAA,qBAAA,KAAA,CAAA,aAAA;AAAA,UAAC,SAAA;AAAA,UAAA;AAAA,YACE,GAAG,MAAA;AAAA,YAEJ,SAAS,EAAA,IAAA;AAAA,YACT,WAAA;AAAA,YACA,OAAQ,EAAA;AAAA;AAAA;AACV;AAAA;AAEJ,qBAED,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,EAAsB,WAA0B,EAAA,KAAA,EAAO,YAAY,CACtE,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"GroupListPicker.esm.js","sources":["../../../src/components/GroupListPicker/GroupListPicker.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\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 */\n\nimport { MouseEvent, useState, useCallback } from 'react';\nimport {\n catalogApiRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport TextField from '@material-ui/core/TextField';\nimport Autocomplete from '@material-ui/lab/Autocomplete';\nimport useAsync from 'react-use/esm/useAsync';\nimport Popover from '@material-ui/core/Popover';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { ResponseErrorPanel } from '@backstage/core-components';\nimport { Entity, GroupEntity } from '@backstage/catalog-model';\nimport { GroupListPickerButton } from './GroupListPickerButton';\n\n/**\n * Props for {@link GroupListPicker}.\n *\n * @public\n */\nexport type GroupListPickerProps = {\n defaultValue?: string;\n placeholder?: string;\n groupTypes?: Array<string>;\n onChange: (value: GroupEntity | undefined) => void;\n};\n\n/** @public */\nexport const GroupListPicker = (props: GroupListPickerProps) => {\n const catalogApi = useApi(catalogApiRef);\n\n const { onChange, groupTypes, placeholder = '', defaultValue = '' } = props;\n const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);\n const [inputValue, setInputValue] = useState(defaultValue);\n\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const open = Boolean(anchorEl);\n\n const {\n loading,\n error,\n value: groups,\n } = useAsync(async () => {\n const groupsList = await catalogApi.getEntities({\n filter: {\n kind: 'Group',\n 'spec.type': groupTypes || [],\n },\n });\n\n return groupsList.items as GroupEntity[];\n }, [catalogApi, groupTypes]);\n\n const handleChange = useCallback(\n (_: unknown, v: GroupEntity | null) => {\n onChange(v ?? undefined);\n setAnchorEl(null);\n },\n [onChange],\n );\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n const getHumanEntityRef = (entity: Entity) => humanizeEntityRef(entity);\n\n return (\n <>\n <Popover\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }}\n >\n <Autocomplete\n data-testid=\"group-list-picker-input\"\n loading={loading}\n options={groups ?? []}\n groupBy={option => option.spec.type}\n getOptionLabel={option =>\n option.spec.profile?.displayName ?? getHumanEntityRef(option)\n }\n inputValue={inputValue}\n onInputChange={(_, value) => setInputValue(value)}\n onChange={handleChange}\n style={{ width: '300px' }}\n renderInput={params => (\n <TextField\n {...params}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n placeholder={placeholder}\n variant=\"outlined\"\n />\n )}\n />\n </Popover>\n <GroupListPickerButton handleClick={handleClick} group={inputValue} />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA2Ca,MAAA,eAAA,GAAkB,CAAC,KAAgC,KAAA;AAC9D,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AAEvC,EAAA,MAAM,EAAE,QAAU,EAAA,UAAA,EAAY,cAAc,EAAI,EAAA,YAAA,GAAe,IAAO,GAAA,KAAA;AACtE,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAA6B,IAAI,CAAA;AACjE,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,YAAY,CAAA;AAEzD,EAAM,MAAA,WAAA,GAAc,CAAC,KAAmC,KAAA;AACtD,IAAA,WAAA,CAAY,MAAM,aAAa,CAAA;AAAA,GACjC;AAEA,EAAA,MAAM,cAAc,MAAM;AACxB,IAAA,WAAA,CAAY,IAAI,CAAA;AAAA,GAClB;AAEA,EAAM,MAAA,IAAA,GAAO,QAAQ,QAAQ,CAAA;AAE7B,EAAM,MAAA;AAAA,IACJ,OAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAO,EAAA;AAAA,GACT,GAAI,SAAS,YAAY;AACvB,IAAM,MAAA,UAAA,GAAa,MAAM,UAA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,cAAc,KAAK,CAAA;AAAA,YAChD,QAAU,EAAA,YAAA;AAAA,YACV,KAAA,EAAO,EAAE,KAAA,EAAO,OAAQ,EAAA;AAAA,YACxB,aAAa,CACX,MAAA,qBAAA,GAAA;AAAA,cAAC,SAAA;AAAA,cAAA;AAAA,gBACE,GAAG,MAAA;AAAA,gBAEJ,SAAS,EAAA,IAAA;AAAA,gBACT,WAAA;AAAA,gBACA,OAAQ,EAAA;AAAA;AAAA;AACV;AAAA;AAEJ;AAAA,KACF;AAAA,oBACC,GAAA,CAAA,qBAAA,EAAA,EAAsB,WAA0B,EAAA,KAAA,EAAO,UAAY,EAAA;AAAA,GACtE,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import Typography from '@material-ui/core/Typography';
3
3
  import Button from '@material-ui/core/Button';
4
4
  import { makeStyles } from '@material-ui/core/styles';
@@ -31,18 +31,18 @@ const useStyles = makeStyles((theme) => ({
31
31
  const GroupListPickerButton = (props) => {
32
32
  const { handleClick, group } = props;
33
33
  const classes = useStyles();
34
- return /* @__PURE__ */ React.createElement(
34
+ return /* @__PURE__ */ jsx(
35
35
  Button,
36
36
  {
37
37
  onClick: handleClick,
38
38
  "data-testid": "group-list-picker-button",
39
39
  "aria-describedby": "group-list-popover",
40
- startIcon: /* @__PURE__ */ React.createElement(PeopleIcon, { className: classes.icon }),
40
+ startIcon: /* @__PURE__ */ jsx(PeopleIcon, { className: classes.icon }),
41
41
  className: classes.btn,
42
42
  size: "large",
43
- endIcon: /* @__PURE__ */ React.createElement(KeyboardArrowDownIcon, { className: classes.icon })
44
- },
45
- /* @__PURE__ */ React.createElement(Typography, { className: classes.title }, group)
43
+ endIcon: /* @__PURE__ */ jsx(KeyboardArrowDownIcon, { className: classes.icon }),
44
+ children: /* @__PURE__ */ jsx(Typography, { className: classes.title, children: group })
45
+ }
46
46
  );
47
47
  };
48
48
 
@@ -1 +1 @@
1
- {"version":3,"file":"GroupListPickerButton.esm.js","sources":["../../../src/components/GroupListPicker/GroupListPickerButton.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\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 */\n\nimport React from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';\nimport PeopleIcon from '@material-ui/icons/People';\n\nconst useStyles = makeStyles(theme => ({\n btn: {\n padding: '10px',\n width: '100%',\n cursor: 'pointer',\n justifyContent: 'space-between',\n },\n title: {\n fontSize: '1.5rem',\n fontStyle: 'normal',\n fontWeight: theme.typography.fontWeightBold,\n height: '32px',\n letterSpacing: '-0.25px',\n marginBottom: 0,\n marginLeft: '4px',\n textAlign: 'left',\n textTransform: 'none',\n width: '100%',\n },\n icon: {\n transform: 'scale(1.5)',\n },\n}));\n\ntype GroupListPickerButtonProps = {\n handleClick: (event: React.MouseEvent<HTMLElement>) => void;\n group: string | undefined;\n};\n\n/** @public */\nexport const GroupListPickerButton = (props: GroupListPickerButtonProps) => {\n const { handleClick, group } = props;\n const classes = useStyles();\n\n return (\n <Button\n onClick={handleClick}\n data-testid=\"group-list-picker-button\"\n aria-describedby=\"group-list-popover\"\n startIcon={<PeopleIcon className={classes.icon} />}\n className={classes.btn}\n size=\"large\"\n endIcon={<KeyboardArrowDownIcon className={classes.icon} />}\n >\n <Typography className={classes.title}>{group}</Typography>\n </Button>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuBA,MAAM,SAAA,GAAY,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SAAW,EAAA,OAAA,CAAQ,SAAQ,KAAM;AAAA,GAC/C;AAEJ;;;;"}
1
+ {"version":3,"file":"GroupListPickerButton.esm.js","sources":["../../../src/components/GroupListPicker/GroupListPickerButton.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\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 */\n\nimport { MouseEvent } from 'react';\nimport Typography from '@material-ui/core/Typography';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';\nimport PeopleIcon from '@material-ui/icons/People';\n\nconst useStyles = makeStyles(theme => ({\n btn: {\n padding: '10px',\n width: '100%',\n cursor: 'pointer',\n justifyContent: 'space-between',\n },\n title: {\n fontSize: '1.5rem',\n fontStyle: 'normal',\n fontWeight: theme.typography.fontWeightBold,\n height: '32px',\n letterSpacing: '-0.25px',\n marginBottom: 0,\n marginLeft: '4px',\n textAlign: 'left',\n textTransform: 'none',\n width: '100%',\n },\n icon: {\n transform: 'scale(1.5)',\n },\n}));\n\ntype GroupListPickerButtonProps = {\n handleClick: (event: MouseEvent<HTMLElement>) => void;\n group: string | undefined;\n};\n\n/** @public */\nexport const GroupListPickerButton = (props: GroupListPickerButtonProps) => {\n const { handleClick, group } = props;\n const classes = useStyles();\n\n return (\n <Button\n onClick={handleClick}\n data-testid=\"group-list-picker-button\"\n aria-describedby=\"group-list-popover\"\n startIcon={<PeopleIcon className={classes.icon} />}\n className={classes.btn}\n size=\"large\"\n endIcon={<KeyboardArrowDownIcon className={classes.icon} />}\n >\n <Typography className={classes.title}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AAA,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,OAAA,CAAQ,OAAQ,QAAM,EAAA,KAAA,EAAA;AAAA;AAAA,GAC/C;AAEJ;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { GroupEntity } from '@backstage/catalog-model';
3
3
 
4
4
  /**
@@ -13,6 +13,6 @@ type GroupListPickerProps = {
13
13
  onChange: (value: GroupEntity | undefined) => void;
14
14
  };
15
15
  /** @public */
16
- declare const GroupListPicker: (props: GroupListPickerProps) => React.JSX.Element;
16
+ declare const GroupListPicker: (props: GroupListPickerProps) => react_jsx_runtime.JSX.Element;
17
17
 
18
18
  export { GroupListPicker, type GroupListPickerProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-org-react",
3
- "version": "0.1.37-next.1",
3
+ "version": "0.1.37-next.2",
4
4
  "backstage": {
5
5
  "role": "web-library",
6
6
  "pluginId": "org",
@@ -42,18 +42,18 @@
42
42
  "dependencies": {
43
43
  "@backstage/catalog-client": "1.9.1",
44
44
  "@backstage/catalog-model": "1.7.3",
45
- "@backstage/core-components": "0.17.1-next.0",
46
- "@backstage/core-plugin-api": "1.10.5",
47
- "@backstage/plugin-catalog-react": "1.16.1-next.1",
45
+ "@backstage/core-components": "0.17.1-next.1",
46
+ "@backstage/core-plugin-api": "1.10.6-next.0",
47
+ "@backstage/plugin-catalog-react": "1.17.0-next.2",
48
48
  "@material-ui/core": "^4.12.2",
49
49
  "@material-ui/icons": "^4.9.1",
50
50
  "@material-ui/lab": "4.0.0-alpha.61",
51
51
  "react-use": "^17.2.4"
52
52
  },
53
53
  "devDependencies": {
54
- "@backstage/cli": "0.32.0-next.1",
55
- "@backstage/core-app-api": "1.16.0",
56
- "@backstage/test-utils": "1.7.6",
54
+ "@backstage/cli": "0.32.0-next.2",
55
+ "@backstage/core-app-api": "1.16.1-next.0",
56
+ "@backstage/test-utils": "1.7.7-next.0",
57
57
  "@testing-library/dom": "^10.0.0",
58
58
  "@testing-library/jest-dom": "^6.0.0",
59
59
  "@testing-library/react": "^16.0.0",
@@ -74,5 +74,12 @@
74
74
  "optional": true
75
75
  }
76
76
  },
77
+ "typesVersions": {
78
+ "*": {
79
+ "package.json": [
80
+ "package.json"
81
+ ]
82
+ }
83
+ },
77
84
  "module": "./dist/index.esm.js"
78
85
  }