@backstage/plugin-user-settings 0.8.21-next.1 → 0.8.21-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.
Files changed (51) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +0 -1
  3. package/dist/alpha.d.ts +3 -3
  4. package/dist/alpha.esm.js +2 -2
  5. package/dist/alpha.esm.js.map +1 -1
  6. package/dist/components/AuthProviders/DefaultProviderSettings.esm.js +84 -74
  7. package/dist/components/AuthProviders/DefaultProviderSettings.esm.js.map +1 -1
  8. package/dist/components/AuthProviders/EmptyProviders.esm.js +28 -20
  9. package/dist/components/AuthProviders/EmptyProviders.esm.js.map +1 -1
  10. package/dist/components/AuthProviders/ProviderSettingsAvatar.esm.js +2 -2
  11. package/dist/components/AuthProviders/ProviderSettingsAvatar.esm.js.map +1 -1
  12. package/dist/components/AuthProviders/ProviderSettingsItem.esm.js +47 -35
  13. package/dist/components/AuthProviders/ProviderSettingsItem.esm.js.map +1 -1
  14. package/dist/components/AuthProviders/UserSettingsAuthProviders.esm.js +4 -4
  15. package/dist/components/AuthProviders/UserSettingsAuthProviders.esm.js.map +1 -1
  16. package/dist/components/DefaultSettingsPage/DefaultSettingsPage.esm.js +15 -9
  17. package/dist/components/DefaultSettingsPage/DefaultSettingsPage.esm.js.map +1 -1
  18. package/dist/components/FeatureFlags/EmptyFlags.esm.js +24 -20
  19. package/dist/components/FeatureFlags/EmptyFlags.esm.js.map +1 -1
  20. package/dist/components/FeatureFlags/FeatureFlagsItem.esm.js +5 -2
  21. package/dist/components/FeatureFlags/FeatureFlagsItem.esm.js.map +1 -1
  22. package/dist/components/FeatureFlags/UserSettingsFeatureFlags.esm.js +38 -31
  23. package/dist/components/FeatureFlags/UserSettingsFeatureFlags.esm.js.map +1 -1
  24. package/dist/components/General/UserSettingsAppearanceCard.esm.js +6 -2
  25. package/dist/components/General/UserSettingsAppearanceCard.esm.js.map +1 -1
  26. package/dist/components/General/UserSettingsGeneral.esm.js +6 -2
  27. package/dist/components/General/UserSettingsGeneral.esm.js.map +1 -1
  28. package/dist/components/General/UserSettingsIdentityCard.esm.js +15 -4
  29. package/dist/components/General/UserSettingsIdentityCard.esm.js.map +1 -1
  30. package/dist/components/General/UserSettingsLanguageToggle.esm.js +27 -24
  31. package/dist/components/General/UserSettingsLanguageToggle.esm.js.map +1 -1
  32. package/dist/components/General/UserSettingsMenu.esm.js +26 -22
  33. package/dist/components/General/UserSettingsMenu.esm.js.map +1 -1
  34. package/dist/components/General/UserSettingsPinToggle.esm.js +26 -23
  35. package/dist/components/General/UserSettingsPinToggle.esm.js.map +1 -1
  36. package/dist/components/General/UserSettingsProfileCard.esm.js +11 -2
  37. package/dist/components/General/UserSettingsProfileCard.esm.js.map +1 -1
  38. package/dist/components/General/UserSettingsSignInAvatar.esm.js +2 -2
  39. package/dist/components/General/UserSettingsSignInAvatar.esm.js.map +1 -1
  40. package/dist/components/General/UserSettingsThemeToggle.esm.js +62 -49
  41. package/dist/components/General/UserSettingsThemeToggle.esm.js.map +1 -1
  42. package/dist/components/Settings.esm.js +2 -2
  43. package/dist/components/Settings.esm.js.map +1 -1
  44. package/dist/components/SettingsLayout/SettingsLayout.esm.js +5 -2
  45. package/dist/components/SettingsLayout/SettingsLayout.esm.js.map +1 -1
  46. package/dist/components/SettingsPage/SettingsPage.esm.js +2 -2
  47. package/dist/components/SettingsPage/SettingsPage.esm.js.map +1 -1
  48. package/dist/components/UserSettingsTab/UserSettingsTab.esm.js +2 -2
  49. package/dist/components/UserSettingsTab/UserSettingsTab.esm.js.map +1 -1
  50. package/dist/index.d.ts +23 -23
  51. package/package.json +16 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @backstage/plugin-user-settings
2
2
 
3
+ ## 0.8.21-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/frontend-plugin-api@0.10.1-next.1
13
+ - @backstage/core-compat-api@0.4.1-next.2
14
+ - @backstage/core-components@0.17.1-next.1
15
+ - @backstage/core-plugin-api@1.10.6-next.0
16
+ - @backstage/core-app-api@1.16.1-next.0
17
+ - @backstage/plugin-catalog-react@1.17.0-next.2
18
+ - @backstage/theme@0.6.5-next.0
19
+ - @backstage/catalog-model@1.7.3
20
+ - @backstage/errors@1.2.7
21
+ - @backstage/types@1.2.1
22
+ - @backstage/plugin-signals-react@0.0.12-next.0
23
+ - @backstage/plugin-user-settings-common@0.0.1
24
+
3
25
  ## 0.8.21-next.1
4
26
 
5
27
  ### Patch Changes
package/README.md CHANGED
@@ -96,7 +96,6 @@ we have created in Backstage's example app.
96
96
  To change the layout altogether, create a custom page in `packages/app/src/components/user-settings/SettingsPage.tsx`:
97
97
 
98
98
  ```tsx
99
- import React from 'react';
100
99
  import {
101
100
  SettingsLayout,
102
101
  UserSettingsGeneral,
package/dist/alpha.d.ts CHANGED
@@ -1,6 +1,6 @@
1
+ import * as react from 'react';
1
2
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
3
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
3
- import React__default from 'react';
4
4
  import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
5
5
 
6
6
  /** @alpha */
@@ -65,11 +65,11 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
65
65
  configInput: {
66
66
  path?: string | undefined;
67
67
  };
68
- output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
68
+ output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
69
69
  optional: true;
70
70
  }>;
71
71
  inputs: {
72
- providerSettings: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React__default.JSX.Element, "core.reactElement", {}>, {
72
+ providerSettings: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>, {
73
73
  singleton: true;
74
74
  optional: true;
75
75
  }>;
package/dist/alpha.esm.js CHANGED
@@ -1,8 +1,8 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { PageBlueprint, createExtensionInput, coreExtensionData, NavItemBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
2
3
  import { convertLegacyRouteRef, compatWrapper, convertLegacyRouteRefs } from '@backstage/core-compat-api';
3
4
  import SettingsIcon from '@material-ui/icons/Settings';
4
5
  import { settingsRouteRef } from './plugin.esm.js';
5
- import React from 'react';
6
6
  export { userSettingsTranslationRef } from './translation.esm.js';
7
7
 
8
8
  const userSettingsPage = PageBlueprint.makeWithOverrides({
@@ -18,7 +18,7 @@ const userSettingsPage = PageBlueprint.makeWithOverrides({
18
18
  routeRef: convertLegacyRouteRef(settingsRouteRef),
19
19
  loader: () => import('./components/SettingsPage/index.esm.js').then(
20
20
  (m) => compatWrapper(
21
- /* @__PURE__ */ React.createElement(
21
+ /* @__PURE__ */ jsx(
22
22
  m.SettingsPage,
23
23
  {
24
24
  providerSettings: inputs.providerSettings?.get(
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport {\n coreExtensionData,\n createExtensionInput,\n createFrontendPlugin,\n PageBlueprint,\n NavItemBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n compatWrapper,\n} from '@backstage/core-compat-api';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport { settingsRouteRef } from './plugin';\n\nimport React from 'react';\n\nexport * from './translation';\n\nconst userSettingsPage = PageBlueprint.makeWithOverrides({\n inputs: {\n providerSettings: createExtensionInput([coreExtensionData.reactElement], {\n singleton: true,\n optional: true,\n }),\n },\n factory(originalFactory, { inputs }) {\n return originalFactory({\n defaultPath: '/settings',\n routeRef: convertLegacyRouteRef(settingsRouteRef),\n loader: () =>\n import('./components/SettingsPage').then(m =>\n compatWrapper(\n <m.SettingsPage\n providerSettings={inputs.providerSettings?.get(\n coreExtensionData.reactElement,\n )}\n />,\n ),\n ),\n });\n },\n});\n\n/** @alpha */\nexport const settingsNavItem = NavItemBlueprint.make({\n params: {\n routeRef: convertLegacyRouteRef(settingsRouteRef),\n title: 'Settings',\n icon: SettingsIcon,\n },\n});\n\n/**\n * @alpha\n */\nexport default createFrontendPlugin({\n id: 'user-settings',\n extensions: [userSettingsPage, settingsNavItem],\n routes: convertLegacyRouteRefs({\n root: settingsRouteRef,\n }),\n});\n"],"names":[],"mappings":";;;;;;;AAkCA,MAAM,gBAAA,GAAmB,cAAc,iBAAkB,CAAA;AAAA,EACvD,MAAQ,EAAA;AAAA,IACN,gBAAkB,EAAA,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAG,EAAA;AAAA,MACvE,SAAW,EAAA,IAAA;AAAA,MACX,QAAU,EAAA;AAAA,KACX;AAAA,GACH;AAAA,EACA,OAAQ,CAAA,eAAA,EAAiB,EAAE,MAAA,EAAU,EAAA;AACnC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,WAAa,EAAA,WAAA;AAAA,MACb,QAAA,EAAU,sBAAsB,gBAAgB,CAAA;AAAA,MAChD,MAAQ,EAAA,MACN,OAAO,wCAA2B,CAAE,CAAA,IAAA;AAAA,QAAK,CACvC,CAAA,KAAA,aAAA;AAAA,0BACE,KAAA,CAAA,aAAA;AAAA,YAAC,CAAE,CAAA,YAAA;AAAA,YAAF;AAAA,cACC,gBAAA,EAAkB,OAAO,gBAAkB,EAAA,GAAA;AAAA,gBACzC,iBAAkB,CAAA;AAAA;AACpB;AAAA;AACF;AACF;AACF,KACH,CAAA;AAAA;AAEL,CAAC,CAAA;AAGY,MAAA,eAAA,GAAkB,iBAAiB,IAAK,CAAA;AAAA,EACnD,MAAQ,EAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,gBAAgB,CAAA;AAAA,IAChD,KAAO,EAAA,UAAA;AAAA,IACP,IAAM,EAAA;AAAA;AAEV,CAAC;AAKD,YAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,eAAA;AAAA,EACJ,UAAA,EAAY,CAAC,gBAAA,EAAkB,eAAe,CAAA;AAAA,EAC9C,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA;AAAA,GACP;AACH,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport {\n coreExtensionData,\n createExtensionInput,\n createFrontendPlugin,\n PageBlueprint,\n NavItemBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n compatWrapper,\n} from '@backstage/core-compat-api';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport { settingsRouteRef } from './plugin';\n\nexport * from './translation';\n\nconst userSettingsPage = PageBlueprint.makeWithOverrides({\n inputs: {\n providerSettings: createExtensionInput([coreExtensionData.reactElement], {\n singleton: true,\n optional: true,\n }),\n },\n factory(originalFactory, { inputs }) {\n return originalFactory({\n defaultPath: '/settings',\n routeRef: convertLegacyRouteRef(settingsRouteRef),\n loader: () =>\n import('./components/SettingsPage').then(m =>\n compatWrapper(\n <m.SettingsPage\n providerSettings={inputs.providerSettings?.get(\n coreExtensionData.reactElement,\n )}\n />,\n ),\n ),\n });\n },\n});\n\n/** @alpha */\nexport const settingsNavItem = NavItemBlueprint.make({\n params: {\n routeRef: convertLegacyRouteRef(settingsRouteRef),\n title: 'Settings',\n icon: SettingsIcon,\n },\n});\n\n/**\n * @alpha\n */\nexport default createFrontendPlugin({\n id: 'user-settings',\n extensions: [userSettingsPage, settingsNavItem],\n routes: convertLegacyRouteRefs({\n root: settingsRouteRef,\n }),\n});\n"],"names":[],"mappings":";;;;;;;AAgCA,MAAM,gBAAA,GAAmB,cAAc,iBAAkB,CAAA;AAAA,EACvD,MAAQ,EAAA;AAAA,IACN,gBAAkB,EAAA,oBAAA,CAAqB,CAAC,iBAAA,CAAkB,YAAY,CAAG,EAAA;AAAA,MACvE,SAAW,EAAA,IAAA;AAAA,MACX,QAAU,EAAA;AAAA,KACX;AAAA,GACH;AAAA,EACA,OAAQ,CAAA,eAAA,EAAiB,EAAE,MAAA,EAAU,EAAA;AACnC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,WAAa,EAAA,WAAA;AAAA,MACb,QAAA,EAAU,sBAAsB,gBAAgB,CAAA;AAAA,MAChD,MAAQ,EAAA,MACN,OAAO,wCAA2B,CAAE,CAAA,IAAA;AAAA,QAAK,CACvC,CAAA,KAAA,aAAA;AAAA,0BACE,GAAA;AAAA,YAAC,CAAE,CAAA,YAAA;AAAA,YAAF;AAAA,cACC,gBAAA,EAAkB,OAAO,gBAAkB,EAAA,GAAA;AAAA,gBACzC,iBAAkB,CAAA;AAAA;AACpB;AAAA;AACF;AACF;AACF,KACH,CAAA;AAAA;AAEL,CAAC,CAAA;AAGY,MAAA,eAAA,GAAkB,iBAAiB,IAAK,CAAA;AAAA,EACnD,MAAQ,EAAA;AAAA,IACN,QAAA,EAAU,sBAAsB,gBAAgB,CAAA;AAAA,IAChD,KAAO,EAAA,UAAA;AAAA,IACP,IAAM,EAAA;AAAA;AAEV,CAAC;AAKD,YAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,eAAA;AAAA,EACJ,UAAA,EAAY,CAAC,gBAAA,EAAkB,eAAe,CAAA;AAAA,EAC9C,QAAQ,sBAAuB,CAAA;AAAA,IAC7B,IAAM,EAAA;AAAA,GACP;AACH,CAAC,CAAA;;;;"}
@@ -1,83 +1,93 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
1
2
  import Star from '@material-ui/icons/Star';
2
- import React from 'react';
3
3
  import { ProviderSettingsItem } from './ProviderSettingsItem.esm.js';
4
4
  import { googleAuthApiRef, microsoftAuthApiRef, githubAuthApiRef, gitlabAuthApiRef, oktaAuthApiRef, bitbucketAuthApiRef, oneloginAuthApiRef, atlassianAuthApiRef, bitbucketServerAuthApiRef } from '@backstage/core-plugin-api';
5
5
 
6
6
  const DefaultProviderSettings = (props) => {
7
7
  const { configuredProviders } = props;
8
- return /* @__PURE__ */ React.createElement(React.Fragment, null, configuredProviders.includes("google") && /* @__PURE__ */ React.createElement(
9
- ProviderSettingsItem,
10
- {
11
- title: "Google",
12
- description: "Provides authentication towards Google APIs and identities",
13
- apiRef: googleAuthApiRef,
14
- icon: Star
15
- }
16
- ), configuredProviders.includes("microsoft") && /* @__PURE__ */ React.createElement(
17
- ProviderSettingsItem,
18
- {
19
- title: "Microsoft",
20
- description: "Provides authentication towards Microsoft APIs and identities",
21
- apiRef: microsoftAuthApiRef,
22
- icon: Star
23
- }
24
- ), configuredProviders.includes("github") && /* @__PURE__ */ React.createElement(
25
- ProviderSettingsItem,
26
- {
27
- title: "GitHub",
28
- description: "Provides authentication towards GitHub APIs",
29
- apiRef: githubAuthApiRef,
30
- icon: Star
31
- }
32
- ), configuredProviders.includes("gitlab") && /* @__PURE__ */ React.createElement(
33
- ProviderSettingsItem,
34
- {
35
- title: "GitLab",
36
- description: "Provides authentication towards GitLab APIs",
37
- apiRef: gitlabAuthApiRef,
38
- icon: Star
39
- }
40
- ), configuredProviders.includes("okta") && /* @__PURE__ */ React.createElement(
41
- ProviderSettingsItem,
42
- {
43
- title: "Okta",
44
- description: "Provides authentication towards Okta APIs",
45
- apiRef: oktaAuthApiRef,
46
- icon: Star
47
- }
48
- ), configuredProviders.includes("bitbucket") && /* @__PURE__ */ React.createElement(
49
- ProviderSettingsItem,
50
- {
51
- title: "Bitbucket",
52
- description: "Provides authentication towards Bitbucket APIs",
53
- apiRef: bitbucketAuthApiRef,
54
- icon: Star
55
- }
56
- ), configuredProviders.includes("onelogin") && /* @__PURE__ */ React.createElement(
57
- ProviderSettingsItem,
58
- {
59
- title: "OneLogin",
60
- description: "Provides authentication towards OneLogin APIs",
61
- apiRef: oneloginAuthApiRef,
62
- icon: Star
63
- }
64
- ), configuredProviders.includes("atlassian") && /* @__PURE__ */ React.createElement(
65
- ProviderSettingsItem,
66
- {
67
- title: "Atlassian",
68
- description: "Provides authentication towards Atlassian APIs",
69
- apiRef: atlassianAuthApiRef,
70
- icon: Star
71
- }
72
- ), configuredProviders.includes("bitbucketServer") && /* @__PURE__ */ React.createElement(
73
- ProviderSettingsItem,
74
- {
75
- title: "Bitbucket Server",
76
- description: "Provides authentication towards Bitbucket Server APIs",
77
- apiRef: bitbucketServerAuthApiRef,
78
- icon: Star
79
- }
80
- ));
8
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
9
+ configuredProviders.includes("google") && /* @__PURE__ */ jsx(
10
+ ProviderSettingsItem,
11
+ {
12
+ title: "Google",
13
+ description: "Provides authentication towards Google APIs and identities",
14
+ apiRef: googleAuthApiRef,
15
+ icon: Star
16
+ }
17
+ ),
18
+ configuredProviders.includes("microsoft") && /* @__PURE__ */ jsx(
19
+ ProviderSettingsItem,
20
+ {
21
+ title: "Microsoft",
22
+ description: "Provides authentication towards Microsoft APIs and identities",
23
+ apiRef: microsoftAuthApiRef,
24
+ icon: Star
25
+ }
26
+ ),
27
+ configuredProviders.includes("github") && /* @__PURE__ */ jsx(
28
+ ProviderSettingsItem,
29
+ {
30
+ title: "GitHub",
31
+ description: "Provides authentication towards GitHub APIs",
32
+ apiRef: githubAuthApiRef,
33
+ icon: Star
34
+ }
35
+ ),
36
+ configuredProviders.includes("gitlab") && /* @__PURE__ */ jsx(
37
+ ProviderSettingsItem,
38
+ {
39
+ title: "GitLab",
40
+ description: "Provides authentication towards GitLab APIs",
41
+ apiRef: gitlabAuthApiRef,
42
+ icon: Star
43
+ }
44
+ ),
45
+ configuredProviders.includes("okta") && /* @__PURE__ */ jsx(
46
+ ProviderSettingsItem,
47
+ {
48
+ title: "Okta",
49
+ description: "Provides authentication towards Okta APIs",
50
+ apiRef: oktaAuthApiRef,
51
+ icon: Star
52
+ }
53
+ ),
54
+ configuredProviders.includes("bitbucket") && /* @__PURE__ */ jsx(
55
+ ProviderSettingsItem,
56
+ {
57
+ title: "Bitbucket",
58
+ description: "Provides authentication towards Bitbucket APIs",
59
+ apiRef: bitbucketAuthApiRef,
60
+ icon: Star
61
+ }
62
+ ),
63
+ configuredProviders.includes("onelogin") && /* @__PURE__ */ jsx(
64
+ ProviderSettingsItem,
65
+ {
66
+ title: "OneLogin",
67
+ description: "Provides authentication towards OneLogin APIs",
68
+ apiRef: oneloginAuthApiRef,
69
+ icon: Star
70
+ }
71
+ ),
72
+ configuredProviders.includes("atlassian") && /* @__PURE__ */ jsx(
73
+ ProviderSettingsItem,
74
+ {
75
+ title: "Atlassian",
76
+ description: "Provides authentication towards Atlassian APIs",
77
+ apiRef: atlassianAuthApiRef,
78
+ icon: Star
79
+ }
80
+ ),
81
+ configuredProviders.includes("bitbucketServer") && /* @__PURE__ */ jsx(
82
+ ProviderSettingsItem,
83
+ {
84
+ title: "Bitbucket Server",
85
+ description: "Provides authentication towards Bitbucket Server APIs",
86
+ apiRef: bitbucketServerAuthApiRef,
87
+ icon: Star
88
+ }
89
+ )
90
+ ] });
81
91
  };
82
92
 
83
93
  export { DefaultProviderSettings };
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultProviderSettings.esm.js","sources":["../../../src/components/AuthProviders/DefaultProviderSettings.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 Star from '@material-ui/icons/Star';\nimport React from 'react';\nimport { ProviderSettingsItem } from './ProviderSettingsItem';\nimport {\n githubAuthApiRef,\n gitlabAuthApiRef,\n googleAuthApiRef,\n oktaAuthApiRef,\n microsoftAuthApiRef,\n bitbucketAuthApiRef,\n bitbucketServerAuthApiRef,\n atlassianAuthApiRef,\n oneloginAuthApiRef,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const DefaultProviderSettings = (props: {\n configuredProviders: string[];\n}) => {\n const { configuredProviders } = props;\n return (\n <>\n {configuredProviders.includes('google') && (\n <ProviderSettingsItem\n title=\"Google\"\n description=\"Provides authentication towards Google APIs and identities\"\n apiRef={googleAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('microsoft') && (\n <ProviderSettingsItem\n title=\"Microsoft\"\n description=\"Provides authentication towards Microsoft APIs and identities\"\n apiRef={microsoftAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('github') && (\n <ProviderSettingsItem\n title=\"GitHub\"\n description=\"Provides authentication towards GitHub APIs\"\n apiRef={githubAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('gitlab') && (\n <ProviderSettingsItem\n title=\"GitLab\"\n description=\"Provides authentication towards GitLab APIs\"\n apiRef={gitlabAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('okta') && (\n <ProviderSettingsItem\n title=\"Okta\"\n description=\"Provides authentication towards Okta APIs\"\n apiRef={oktaAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucket') && (\n <ProviderSettingsItem\n title=\"Bitbucket\"\n description=\"Provides authentication towards Bitbucket APIs\"\n apiRef={bitbucketAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('onelogin') && (\n <ProviderSettingsItem\n title=\"OneLogin\"\n description=\"Provides authentication towards OneLogin APIs\"\n apiRef={oneloginAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('atlassian') && (\n <ProviderSettingsItem\n title=\"Atlassian\"\n description=\"Provides authentication towards Atlassian APIs\"\n apiRef={atlassianAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucketServer') && (\n <ProviderSettingsItem\n title=\"Bitbucket Server\"\n description=\"Provides authentication towards Bitbucket Server APIs\"\n apiRef={bitbucketServerAuthApiRef}\n icon={Star}\n />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AAgCa,MAAA,uBAAA,GAA0B,CAAC,KAElC,KAAA;AACJ,EAAM,MAAA,EAAE,qBAAwB,GAAA,KAAA;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AAA,GAGT,EAAA,mBAAA,CAAoB,QAAS,CAAA,WAAW,CACvC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,WAAA;AAAA,MACN,WAAY,EAAA,gDAAA;AAAA,MACZ,MAAQ,EAAA,mBAAA;AAAA,MACR,IAAM,EAAA;AAAA;AAAA,GAGT,EAAA,mBAAA,CAAoB,QAAS,CAAA,UAAU,CACtC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,UAAA;AAAA,MACN,WAAY,EAAA,+CAAA;AAAA,MACZ,MAAQ,EAAA,kBAAA;AAAA,MACR,IAAM,EAAA;AAAA;AAAA,GAGT,EAAA,mBAAA,CAAoB,QAAS,CAAA,WAAW,CACvC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,WAAA;AAAA,MACN,WAAY,EAAA,gDAAA;AAAA,MACZ,MAAQ,EAAA,mBAAA;AAAA,MACR,IAAM,EAAA;AAAA;AAAA,GAGT,EAAA,mBAAA,CAAoB,QAAS,CAAA,iBAAiB,CAC7C,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,kBAAA;AAAA,MACN,WAAY,EAAA,uDAAA;AAAA,MACZ,MAAQ,EAAA,yBAAA;AAAA,MACR,IAAM,EAAA;AAAA;AAAA,GAGZ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"DefaultProviderSettings.esm.js","sources":["../../../src/components/AuthProviders/DefaultProviderSettings.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 Star from '@material-ui/icons/Star';\nimport { ProviderSettingsItem } from './ProviderSettingsItem';\nimport {\n githubAuthApiRef,\n gitlabAuthApiRef,\n googleAuthApiRef,\n oktaAuthApiRef,\n microsoftAuthApiRef,\n bitbucketAuthApiRef,\n bitbucketServerAuthApiRef,\n atlassianAuthApiRef,\n oneloginAuthApiRef,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const DefaultProviderSettings = (props: {\n configuredProviders: string[];\n}) => {\n const { configuredProviders } = props;\n return (\n <>\n {configuredProviders.includes('google') && (\n <ProviderSettingsItem\n title=\"Google\"\n description=\"Provides authentication towards Google APIs and identities\"\n apiRef={googleAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('microsoft') && (\n <ProviderSettingsItem\n title=\"Microsoft\"\n description=\"Provides authentication towards Microsoft APIs and identities\"\n apiRef={microsoftAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('github') && (\n <ProviderSettingsItem\n title=\"GitHub\"\n description=\"Provides authentication towards GitHub APIs\"\n apiRef={githubAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('gitlab') && (\n <ProviderSettingsItem\n title=\"GitLab\"\n description=\"Provides authentication towards GitLab APIs\"\n apiRef={gitlabAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('okta') && (\n <ProviderSettingsItem\n title=\"Okta\"\n description=\"Provides authentication towards Okta APIs\"\n apiRef={oktaAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucket') && (\n <ProviderSettingsItem\n title=\"Bitbucket\"\n description=\"Provides authentication towards Bitbucket APIs\"\n apiRef={bitbucketAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('onelogin') && (\n <ProviderSettingsItem\n title=\"OneLogin\"\n description=\"Provides authentication towards OneLogin APIs\"\n apiRef={oneloginAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('atlassian') && (\n <ProviderSettingsItem\n title=\"Atlassian\"\n description=\"Provides authentication towards Atlassian APIs\"\n apiRef={atlassianAuthApiRef}\n icon={Star}\n />\n )}\n {configuredProviders.includes('bitbucketServer') && (\n <ProviderSettingsItem\n title=\"Bitbucket Server\"\n description=\"Provides authentication towards Bitbucket Server APIs\"\n apiRef={bitbucketServerAuthApiRef}\n icon={Star}\n />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AA+Ba,MAAA,uBAAA,GAA0B,CAAC,KAElC,KAAA;AACJ,EAAM,MAAA,EAAE,qBAAwB,GAAA,KAAA;AAChC,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IAAoB,mBAAA,CAAA,QAAA,CAAS,QAAQ,CACpC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,QAAA;AAAA,QACN,WAAY,EAAA,4DAAA;AAAA,QACZ,MAAQ,EAAA,gBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;AAAA,IAED,mBAAA,CAAoB,QAAS,CAAA,WAAW,CACvC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,WAAA;AAAA,QACN,WAAY,EAAA,+DAAA;AAAA,QACZ,MAAQ,EAAA,mBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;AAAA,IAED,mBAAA,CAAoB,QAAS,CAAA,QAAQ,CACpC,oBAAA,GAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,QAAA;AAAA,QACN,WAAY,EAAA,6CAAA;AAAA,QACZ,MAAQ,EAAA,gBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA,KACR;AAAA,IAED,mBAAA,CAAoB,QAAS,CAAA,QAAQ,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DAAA;AAAA,QACZ,MAAQ,EAAA,yBAAA;AAAA,QACR,IAAM,EAAA;AAAA;AAAA;AACR,GAEJ,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import Button from '@material-ui/core/Button';
3
3
  import Typography from '@material-ui/core/Typography';
4
4
  import { EmptyState, CodeSnippet } from '@backstage/core-components';
@@ -10,30 +10,38 @@ const EXAMPLE = `auth:
10
10
  clientId: \${AUTH_GOOGLE_CLIENT_ID}
11
11
  clientSecret: \${AUTH_GOOGLE_CLIENT_SECRET}
12
12
  `;
13
- const EmptyProviders = () => /* @__PURE__ */ React.createElement(
13
+ const EmptyProviders = () => /* @__PURE__ */ jsx(
14
14
  EmptyState,
15
15
  {
16
16
  missing: "content",
17
17
  title: "No Authentication Providers",
18
18
  description: "You can add Authentication Providers to Backstage which allows you to use these providers to authenticate yourself.",
19
- action: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "Open ", /* @__PURE__ */ React.createElement("code", null, "app-config.yaml"), " and make the changes as highlighted below:"), /* @__PURE__ */ React.createElement(
20
- CodeSnippet,
21
- {
22
- text: EXAMPLE,
23
- language: "yaml",
24
- showLineNumbers: true,
25
- highlightedNumbers: [3, 4, 5, 6, 7, 8],
26
- customStyle: { background: "inherit", fontSize: "115%" }
27
- }
28
- ), /* @__PURE__ */ React.createElement(
29
- Button,
30
- {
31
- variant: "contained",
32
- color: "primary",
33
- href: "https://backstage.io/docs/auth/add-auth-provider"
34
- },
35
- "Read More"
36
- ))
19
+ action: /* @__PURE__ */ jsxs(Fragment, { children: [
20
+ /* @__PURE__ */ jsxs(Typography, { variant: "body1", children: [
21
+ "Open ",
22
+ /* @__PURE__ */ jsx("code", { children: "app-config.yaml" }),
23
+ " and make the changes as highlighted below:"
24
+ ] }),
25
+ /* @__PURE__ */ jsx(
26
+ CodeSnippet,
27
+ {
28
+ text: EXAMPLE,
29
+ language: "yaml",
30
+ showLineNumbers: true,
31
+ highlightedNumbers: [3, 4, 5, 6, 7, 8],
32
+ customStyle: { background: "inherit", fontSize: "115%" }
33
+ }
34
+ ),
35
+ /* @__PURE__ */ jsx(
36
+ Button,
37
+ {
38
+ variant: "contained",
39
+ color: "primary",
40
+ href: "https://backstage.io/docs/auth/add-auth-provider",
41
+ children: "Read More"
42
+ }
43
+ )
44
+ ] })
37
45
  }
38
46
  );
39
47
 
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyProviders.esm.js","sources":["../../../src/components/AuthProviders/EmptyProviders.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport { CodeSnippet, EmptyState } from '@backstage/core-components';\n\nconst EXAMPLE = `auth:\n providers:\n google:\n development:\n clientId: \\${AUTH_GOOGLE_CLIENT_ID}\n clientSecret: \\${AUTH_GOOGLE_CLIENT_SECRET}\n`;\n\nexport const EmptyProviders = () => (\n <EmptyState\n missing=\"content\"\n title=\"No Authentication Providers\"\n description=\"You can add Authentication Providers to Backstage which allows you to use these providers to authenticate yourself.\"\n action={\n <>\n <Typography variant=\"body1\">\n Open <code>app-config.yaml</code> and make the changes as highlighted\n below:\n </Typography>\n <CodeSnippet\n text={EXAMPLE}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6, 7, 8]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://backstage.io/docs/auth/add-auth-provider\"\n >\n Read More\n </Button>\n </>\n }\n />\n);\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,OAAU,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQT,MAAM,iBAAiB,sBAC5B,KAAA,CAAA,aAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAQ,EAAA,SAAA;AAAA,IACR,KAAM,EAAA,6BAAA;AAAA,IACN,WAAY,EAAA,qHAAA;AAAA,IACZ,MACE,kBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAA,EAAQ,OACrB,kBAAA,KAAA,CAAA,aAAA,CAAC,MAAK,EAAA,IAAA,EAAA,iBAAe,CAAO,EAAA,6CAEnC,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QACC,IAAM,EAAA,OAAA;AAAA,QACN,QAAS,EAAA,MAAA;AAAA,QACT,eAAe,EAAA,IAAA;AAAA,QACf,oBAAoB,CAAC,CAAA,EAAG,GAAG,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,QACrC,WAAa,EAAA,EAAE,UAAY,EAAA,SAAA,EAAW,UAAU,MAAO;AAAA;AAAA,KAEzD,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,OAAQ,EAAA,WAAA;AAAA,QACR,KAAM,EAAA,SAAA;AAAA,QACN,IAAK,EAAA;AAAA,OAAA;AAAA,MACN;AAAA,KAGH;AAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"EmptyProviders.esm.js","sources":["../../../src/components/AuthProviders/EmptyProviders.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport { CodeSnippet, EmptyState } from '@backstage/core-components';\n\nconst EXAMPLE = `auth:\n providers:\n google:\n development:\n clientId: \\${AUTH_GOOGLE_CLIENT_ID}\n clientSecret: \\${AUTH_GOOGLE_CLIENT_SECRET}\n`;\n\nexport const EmptyProviders = () => (\n <EmptyState\n missing=\"content\"\n title=\"No Authentication Providers\"\n description=\"You can add Authentication Providers to Backstage which allows you to use these providers to authenticate yourself.\"\n action={\n <>\n <Typography variant=\"body1\">\n Open <code>app-config.yaml</code> and make the changes as highlighted\n below:\n </Typography>\n <CodeSnippet\n text={EXAMPLE}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6, 7, 8]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://backstage.io/docs/auth/add-auth-provider\"\n >\n Read More\n </Button>\n </>\n }\n />\n);\n"],"names":[],"mappings":";;;;;AAoBA,MAAM,OAAU,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQT,MAAM,iBAAiB,sBAC5B,GAAA;AAAA,EAAC,UAAA;AAAA,EAAA;AAAA,IACC,OAAQ,EAAA,SAAA;AAAA,IACR,KAAM,EAAA,6BAAA;AAAA,IACN,WAAY,EAAA,qHAAA;AAAA,IACZ,wBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAC,IAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,OAAQ,EAAA,QAAA,EAAA;AAAA,QAAA,OAAA;AAAA,wBACrB,GAAA,CAAC,UAAK,QAAe,EAAA,iBAAA,EAAA,CAAA;AAAA,QAAO;AAAA,OAEnC,EAAA,CAAA;AAAA,sBACA,GAAA;AAAA,QAAC,WAAA;AAAA,QAAA;AAAA,UACC,IAAM,EAAA,OAAA;AAAA,UACN,QAAS,EAAA,MAAA;AAAA,UACT,eAAe,EAAA,IAAA;AAAA,UACf,oBAAoB,CAAC,CAAA,EAAG,GAAG,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;AAAA,UACrC,WAAa,EAAA,EAAE,UAAY,EAAA,SAAA,EAAW,UAAU,MAAO;AAAA;AAAA,OACzD;AAAA,sBACA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,WAAA;AAAA,UACR,KAAM,EAAA,SAAA;AAAA,UACN,IAAK,EAAA,kDAAA;AAAA,UACN,QAAA,EAAA;AAAA;AAAA;AAED,KACF,EAAA;AAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import Avatar from '@material-ui/core/Avatar';
3
3
  import { makeStyles } from '@material-ui/core/styles';
4
4
  import { sidebarConfig } from '@backstage/core-components';
@@ -14,7 +14,7 @@ const useStyles = makeStyles((theme) => ({
14
14
  const ProviderSettingsAvatar = ({ size, picture }) => {
15
15
  const { iconSize } = sidebarConfig;
16
16
  const classes = useStyles(size ? { size } : { size: iconSize });
17
- return /* @__PURE__ */ React.createElement(Avatar, { src: picture, className: classes.avatar });
17
+ return /* @__PURE__ */ jsx(Avatar, { src: picture, className: classes.avatar });
18
18
  };
19
19
 
20
20
  export { ProviderSettingsAvatar };
@@ -1 +1 @@
1
- {"version":3,"file":"ProviderSettingsAvatar.esm.js","sources":["../../../src/components/AuthProviders/ProviderSettingsAvatar.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 Avatar from '@material-ui/core/Avatar';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { sidebarConfig } from '@backstage/core-components';\n\nconst useStyles = makeStyles<Theme, { size: number }>(theme => ({\n avatar: {\n width: ({ size }) => size,\n height: ({ size }) => size,\n fontSize: ({ size }) => size * 0.7,\n border: `1px solid ${theme.palette.textSubtle}`,\n },\n}));\n\ntype Props = { size?: number; picture: string | undefined };\n\nexport const ProviderSettingsAvatar = ({ size, picture }: Props) => {\n const { iconSize } = sidebarConfig;\n const classes = useStyles(size ? { size } : { size: iconSize });\n\n return <Avatar src={picture} className={classes.avatar} />;\n};\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,SAAA,GAAY,WAAoC,CAAU,KAAA,MAAA;AAAA,EAC9D,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,CAAC,EAAE,IAAA,EAAW,KAAA,IAAA;AAAA,IACrB,MAAQ,EAAA,CAAC,EAAE,IAAA,EAAW,KAAA,IAAA;AAAA,IACtB,QAAU,EAAA,CAAC,EAAE,IAAA,OAAW,IAAO,GAAA,GAAA;AAAA,IAC/B,MAAQ,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,UAAU,CAAA;AAAA;AAEjD,CAAE,CAAA,CAAA;AAIK,MAAM,sBAAyB,GAAA,CAAC,EAAE,IAAA,EAAM,SAAqB,KAAA;AAClE,EAAM,MAAA,EAAE,UAAa,GAAA,aAAA;AACrB,EAAM,MAAA,OAAA,GAAU,UAAU,IAAO,GAAA,EAAE,MAAS,GAAA,EAAE,IAAM,EAAA,QAAA,EAAU,CAAA;AAE9D,EAAA,2CAAQ,MAAO,EAAA,EAAA,GAAA,EAAK,OAAS,EAAA,SAAA,EAAW,QAAQ,MAAQ,EAAA,CAAA;AAC1D;;;;"}
1
+ {"version":3,"file":"ProviderSettingsAvatar.esm.js","sources":["../../../src/components/AuthProviders/ProviderSettingsAvatar.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 Avatar from '@material-ui/core/Avatar';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { sidebarConfig } from '@backstage/core-components';\n\nconst useStyles = makeStyles<Theme, { size: number }>(theme => ({\n avatar: {\n width: ({ size }) => size,\n height: ({ size }) => size,\n fontSize: ({ size }) => size * 0.7,\n border: `1px solid ${theme.palette.textSubtle}`,\n },\n}));\n\ntype Props = { size?: number; picture: string | undefined };\n\nexport const ProviderSettingsAvatar = ({ size, picture }: Props) => {\n const { iconSize } = sidebarConfig;\n const classes = useStyles(size ? { size } : { size: iconSize });\n\n return <Avatar src={picture} className={classes.avatar} />;\n};\n"],"names":[],"mappings":";;;;;AAoBA,MAAM,SAAA,GAAY,WAAoC,CAAU,KAAA,MAAA;AAAA,EAC9D,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,CAAC,EAAE,IAAA,EAAW,KAAA,IAAA;AAAA,IACrB,MAAQ,EAAA,CAAC,EAAE,IAAA,EAAW,KAAA,IAAA;AAAA,IACtB,QAAU,EAAA,CAAC,EAAE,IAAA,OAAW,IAAO,GAAA,GAAA;AAAA,IAC/B,MAAQ,EAAA,CAAA,UAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,UAAU,CAAA;AAAA;AAEjD,CAAE,CAAA,CAAA;AAIK,MAAM,sBAAyB,GAAA,CAAC,EAAE,IAAA,EAAM,SAAqB,KAAA;AAClE,EAAM,MAAA,EAAE,UAAa,GAAA,aAAA;AACrB,EAAM,MAAA,OAAA,GAAU,UAAU,IAAO,GAAA,EAAE,MAAS,GAAA,EAAE,IAAM,EAAA,QAAA,EAAU,CAAA;AAE9D,EAAA,2BAAQ,MAAO,EAAA,EAAA,GAAA,EAAK,OAAS,EAAA,SAAA,EAAW,QAAQ,MAAQ,EAAA,CAAA;AAC1D;;;;"}
@@ -1,4 +1,5 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
2
3
  import Button from '@material-ui/core/Button';
3
4
  import Grid from '@material-ui/core/Grid';
4
5
  import ListItem from '@material-ui/core/ListItem';
@@ -42,41 +43,52 @@ const ProviderSettingsItem = (props) => {
42
43
  subscription.unsubscribe();
43
44
  };
44
45
  }, [api]);
45
- return /* @__PURE__ */ React.createElement(ListItem, null, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(Icon, null)), /* @__PURE__ */ React.createElement(
46
- ListItemText,
47
- {
48
- primary: title,
49
- secondary: /* @__PURE__ */ React.createElement(Tooltip, { placement: "top", arrow: true, title: description }, /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 6 }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(ProviderSettingsAvatar, { size: 48, picture: profile.picture })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, sm: true, container: true }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true, container: true, direction: "column", spacing: 2 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, profile.displayName && /* @__PURE__ */ React.createElement(
50
- Typography,
51
- {
52
- variant: "subtitle1",
53
- color: "textPrimary",
54
- gutterBottom: true
55
- },
56
- profile.displayName
57
- ), profile.email && /* @__PURE__ */ React.createElement(Typography, { variant: "body2", color: "textSecondary" }, profile.email), /* @__PURE__ */ React.createElement(Typography, { variant: "body2", color: "textSecondary" }, description)))))),
58
- secondaryTypographyProps: { noWrap: true, style: { width: "80%" } }
59
- }
60
- ), /* @__PURE__ */ React.createElement(ListItemSecondaryAction, null, /* @__PURE__ */ React.createElement(
61
- Tooltip,
62
- {
63
- placement: "top",
64
- arrow: true,
65
- title: signedIn ? `Sign out from ${title}` : `Sign in to ${title}`
66
- },
67
- /* @__PURE__ */ React.createElement(
68
- Button,
46
+ return /* @__PURE__ */ jsxs(ListItem, { children: [
47
+ /* @__PURE__ */ jsx(ListItemIcon, { children: /* @__PURE__ */ jsx(Icon, {}) }),
48
+ /* @__PURE__ */ jsx(
49
+ ListItemText,
69
50
  {
70
- variant: "outlined",
71
- color: "primary",
72
- onClick: () => {
73
- const action = signedIn ? api.signOut() : api.signIn();
74
- action.catch((error) => errorApi.post(error));
75
- }
76
- },
77
- signedIn ? `Sign out` : `Sign in`
78
- )
79
- )));
51
+ primary: title,
52
+ secondary: /* @__PURE__ */ jsx(Tooltip, { placement: "top", arrow: true, title: description, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 6, children: [
53
+ /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(ProviderSettingsAvatar, { size: 48, picture: profile.picture }) }),
54
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, sm: true, container: true, children: /* @__PURE__ */ jsx(Grid, { item: true, xs: true, container: true, direction: "column", spacing: 2, children: /* @__PURE__ */ jsxs(Grid, { item: true, xs: true, children: [
55
+ profile.displayName && /* @__PURE__ */ jsx(
56
+ Typography,
57
+ {
58
+ variant: "subtitle1",
59
+ color: "textPrimary",
60
+ gutterBottom: true,
61
+ children: profile.displayName
62
+ }
63
+ ),
64
+ profile.email && /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", children: profile.email }),
65
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", children: description })
66
+ ] }) }) })
67
+ ] }) }),
68
+ secondaryTypographyProps: { noWrap: true, style: { width: "80%" } }
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx(ListItemSecondaryAction, { children: /* @__PURE__ */ jsx(
72
+ Tooltip,
73
+ {
74
+ placement: "top",
75
+ arrow: true,
76
+ title: signedIn ? `Sign out from ${title}` : `Sign in to ${title}`,
77
+ children: /* @__PURE__ */ jsx(
78
+ Button,
79
+ {
80
+ variant: "outlined",
81
+ color: "primary",
82
+ onClick: () => {
83
+ const action = signedIn ? api.signOut() : api.signIn();
84
+ action.catch((error) => errorApi.post(error));
85
+ },
86
+ children: signedIn ? `Sign out` : `Sign in`
87
+ }
88
+ )
89
+ }
90
+ ) })
91
+ ] });
80
92
  };
81
93
 
82
94
  export { ProviderSettingsItem };
@@ -1 +1 @@
1
- {"version":3,"file":"ProviderSettingsItem.esm.js","sources":["../../../src/components/AuthProviders/ProviderSettingsItem.tsx"],"sourcesContent":["/*\n * Copyright 2020 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, { useEffect, useState } from 'react';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport {\n ApiRef,\n SessionApi,\n SessionState,\n ProfileInfoApi,\n ProfileInfo,\n useApi,\n errorApiRef,\n IconComponent,\n} from '@backstage/core-plugin-api';\nimport { ProviderSettingsAvatar } from './ProviderSettingsAvatar';\n\nconst emptyProfile: ProfileInfo = {};\n\n/** @public */\nexport const ProviderSettingsItem = (props: {\n title: string;\n description: string;\n icon: IconComponent;\n apiRef: ApiRef<ProfileInfoApi & SessionApi>;\n}) => {\n const { title, description, icon: Icon, apiRef } = props;\n\n const api = useApi(apiRef);\n const errorApi = useApi(errorApiRef);\n const [signedIn, setSignedIn] = useState(false);\n const [profile, setProfile] = useState<ProfileInfo>(emptyProfile);\n\n useEffect(() => {\n let didCancel = false;\n\n const subscription = api\n .sessionState$()\n .subscribe((sessionState: SessionState) => {\n if (sessionState !== SessionState.SignedIn) {\n setProfile(emptyProfile);\n setSignedIn(false);\n }\n if (!didCancel) {\n api\n .getProfile({ optional: true })\n .then((profileResponse: ProfileInfo | undefined) => {\n if (!didCancel) {\n if (sessionState === SessionState.SignedIn) {\n setSignedIn(true);\n }\n if (profileResponse) {\n setProfile(profileResponse);\n }\n }\n });\n }\n });\n\n return () => {\n didCancel = true;\n subscription.unsubscribe();\n };\n }, [api]);\n\n return (\n <ListItem>\n <ListItemIcon>\n <Icon />\n </ListItemIcon>\n <ListItemText\n primary={title}\n secondary={\n <Tooltip placement=\"top\" arrow title={description}>\n <Grid container spacing={6}>\n <Grid item>\n <ProviderSettingsAvatar size={48} picture={profile.picture} />\n </Grid>\n <Grid item xs={12} sm container>\n <Grid item xs container direction=\"column\" spacing={2}>\n <Grid item xs>\n {profile.displayName && (\n <Typography\n variant=\"subtitle1\"\n color=\"textPrimary\"\n gutterBottom\n >\n {profile.displayName}\n </Typography>\n )}\n {profile.email && (\n <Typography variant=\"body2\" color=\"textSecondary\">\n {profile.email}\n </Typography>\n )}\n <Typography variant=\"body2\" color=\"textSecondary\">\n {description}\n </Typography>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n </Tooltip>\n }\n secondaryTypographyProps={{ noWrap: true, style: { width: '80%' } }}\n />\n <ListItemSecondaryAction>\n <Tooltip\n placement=\"top\"\n arrow\n title={signedIn ? `Sign out from ${title}` : `Sign in to ${title}`}\n >\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => {\n const action = signedIn ? api.signOut() : api.signIn();\n action.catch(error => errorApi.post(error));\n }}\n >\n {signedIn ? `Sign out` : `Sign in`}\n </Button>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAqCA,MAAM,eAA4B,EAAC;AAGtB,MAAA,oBAAA,GAAuB,CAAC,KAK/B,KAAA;AACJ,EAAA,MAAM,EAAE,KAAO,EAAA,WAAA,EAAa,IAAM,EAAA,IAAA,EAAM,QAAW,GAAA,KAAA;AAEnD,EAAM,MAAA,GAAA,GAAM,OAAO,MAAM,CAAA;AACzB,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA;AAC9C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAsB,YAAY,CAAA;AAEhE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,SAAY,GAAA,KAAA;AAEhB,IAAA,MAAM,eAAe,GAClB,CAAA,aAAA,EACA,CAAA,SAAA,CAAU,CAAC,YAA+B,KAAA;AACzC,MAAI,IAAA,YAAA,KAAiB,aAAa,QAAU,EAAA;AAC1C,QAAA,UAAA,CAAW,YAAY,CAAA;AACvB,QAAA,WAAA,CAAY,KAAK,CAAA;AAAA;AAEnB,MAAA,IAAI,CAAC,SAAW,EAAA;AACd,QACG,GAAA,CAAA,UAAA,CAAW,EAAE,QAAU,EAAA,IAAA,EAAM,CAC7B,CAAA,IAAA,CAAK,CAAC,eAA6C,KAAA;AAClD,UAAA,IAAI,CAAC,SAAW,EAAA;A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,CAAA,KAAA,KAAS,QAAS,CAAA,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA;AAC5C,OAAA;AAAA,MAEC,WAAW,CAAa,QAAA,CAAA,GAAA,CAAA,OAAA;AAAA;AAC3B,GAEJ,CACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ProviderSettingsItem.esm.js","sources":["../../../src/components/AuthProviders/ProviderSettingsItem.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { useEffect, useState } from 'react';\nimport Button from '@material-ui/core/Button';\nimport Grid from '@material-ui/core/Grid';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport {\n ApiRef,\n SessionApi,\n SessionState,\n ProfileInfoApi,\n ProfileInfo,\n useApi,\n errorApiRef,\n IconComponent,\n} from '@backstage/core-plugin-api';\nimport { ProviderSettingsAvatar } from './ProviderSettingsAvatar';\n\nconst emptyProfile: ProfileInfo = {};\n\n/** @public */\nexport const ProviderSettingsItem = (props: {\n title: string;\n description: string;\n icon: IconComponent;\n apiRef: ApiRef<ProfileInfoApi & SessionApi>;\n}) => {\n const { title, description, icon: Icon, apiRef } = props;\n\n const api = useApi(apiRef);\n const errorApi = useApi(errorApiRef);\n const [signedIn, setSignedIn] = useState(false);\n const [profile, setProfile] = useState<ProfileInfo>(emptyProfile);\n\n useEffect(() => {\n let didCancel = false;\n\n const subscription = api\n .sessionState$()\n .subscribe((sessionState: SessionState) => {\n if (sessionState !== SessionState.SignedIn) {\n setProfile(emptyProfile);\n setSignedIn(false);\n }\n if (!didCancel) {\n api\n .getProfile({ optional: true })\n .then((profileResponse: ProfileInfo | undefined) => {\n if (!didCancel) {\n if (sessionState === SessionState.SignedIn) {\n setSignedIn(true);\n }\n if (profileResponse) {\n setProfile(profileResponse);\n }\n }\n });\n }\n });\n\n return () => {\n didCancel = true;\n subscription.unsubscribe();\n };\n }, [api]);\n\n return (\n <ListItem>\n <ListItemIcon>\n <Icon />\n </ListItemIcon>\n <ListItemText\n primary={title}\n secondary={\n <Tooltip placement=\"top\" arrow title={description}>\n <Grid container spacing={6}>\n <Grid item>\n <ProviderSettingsAvatar size={48} picture={profile.picture} />\n </Grid>\n <Grid item xs={12} sm container>\n <Grid item xs container direction=\"column\" spacing={2}>\n <Grid item xs>\n {profile.displayName && (\n <Typography\n variant=\"subtitle1\"\n color=\"textPrimary\"\n gutterBottom\n >\n {profile.displayName}\n </Typography>\n )}\n {profile.email && (\n <Typography variant=\"body2\" color=\"textSecondary\">\n {profile.email}\n </Typography>\n )}\n <Typography variant=\"body2\" color=\"textSecondary\">\n {description}\n </Typography>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n </Tooltip>\n }\n secondaryTypographyProps={{ noWrap: true, style: { width: '80%' } }}\n />\n <ListItemSecondaryAction>\n <Tooltip\n placement=\"top\"\n arrow\n title={signedIn ? `Sign out from ${title}` : `Sign in to ${title}`}\n >\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => {\n const action = signedIn ? api.signOut() : api.signIn();\n action.catch(error => errorApi.post(error));\n }}\n >\n {signedIn ? `Sign out` : `Sign in`}\n </Button>\n </Tooltip>\n </ListItemSecondaryAction>\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAqCA,MAAM,eAA4B,EAAC;AAGtB,MAAA,oBA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GAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,OAAQ,EAAA,KAAA,EAAM,eAC/B,EAAA,QAAA,EAAA,OAAA,CAAQ,KACX,EAAA,CAAA;AAAA,gCAED,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,KAAA,EAAM,iBAC/B,QACH,EAAA,WAAA,EAAA;AAAA,WAAA,EACF,GACF,CACF,EAAA;AAAA,SAAA,EACF,CACF,EAAA,CAAA;AAAA,QAEF,wBAAA,EAA0B,EAAE,MAAQ,EAAA,IAAA,EAAM,OAAO,EAAE,KAAA,EAAO,OAAQ;AAAA;AAAA,KACpE;AAAA,wBACC,uBACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,SAAU,EAAA,KAAA;AAAA,QACV,KAAK,EAAA,IAAA;AAAA,QACL,OAAO,QAAW,GAAA,CAAA,cAAA,EAAiB,KAAK,CAAA,CAAA,GAAK,cAAc,KAAK,CAAA,CAAA;AAAA,QAEhE,QAAA,kBAAA,GAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,UAAA;AAAA,YACR,KAAM,EAAA,SAAA;AAAA,YACN,SAAS,MAAM;AACb,cAAA,MAAM,SAAS,QAAW,GAAA,GAAA,CAAI,OAAQ,EAAA,GAAI,IAAI,MAAO,EAAA;AACrD,cAAA,MAAA,CAAO,KAAM,CAAA,CAAA,KAAA,KAAS,QAAS,CAAA,IAAA,CAAK,KAAK,CAAC,CAAA;AAAA,aAC5C;AAAA,YAEC,qBAAW,CAAa,QAAA,CAAA,GAAA,CAAA,OAAA;AAAA;AAAA;AAC3B;AAAA,KAEJ,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import List from '@material-ui/core/List';
3
3
  import { EmptyProviders } from './EmptyProviders.esm.js';
4
4
  import { DefaultProviderSettings } from './DefaultProviderSettings.esm.js';
@@ -10,11 +10,11 @@ const UserSettingsAuthProviders = (props) => {
10
10
  const configApi = useApi(configApiRef);
11
11
  const providersConfig = configApi.getOptionalConfig("auth.providers");
12
12
  const configuredProviders = providersConfig?.keys() || [];
13
- const providers = providerSettings ?? /* @__PURE__ */ React.createElement(DefaultProviderSettings, { configuredProviders });
13
+ const providers = providerSettings ?? /* @__PURE__ */ jsx(DefaultProviderSettings, { configuredProviders });
14
14
  if (!providerSettings && !configuredProviders?.length) {
15
- return /* @__PURE__ */ React.createElement(EmptyProviders, null);
15
+ return /* @__PURE__ */ jsx(EmptyProviders, {});
16
16
  }
17
- return /* @__PURE__ */ React.createElement(InfoCard, { title: "Available Providers" }, /* @__PURE__ */ React.createElement(List, { dense: true }, providers));
17
+ return /* @__PURE__ */ jsx(InfoCard, { title: "Available Providers", children: /* @__PURE__ */ jsx(List, { dense: true, children: providers }) });
18
18
  };
19
19
 
20
20
  export { UserSettingsAuthProviders };
@@ -1 +1 @@
1
- {"version":3,"file":"UserSettingsAuthProviders.esm.js","sources":["../../../src/components/AuthProviders/UserSettingsAuthProviders.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 List from '@material-ui/core/List';\nimport { EmptyProviders } from './EmptyProviders';\nimport { DefaultProviderSettings } from './DefaultProviderSettings';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { InfoCard } from '@backstage/core-components';\n\n/** @public */\nexport const UserSettingsAuthProviders = (props: {\n providerSettings?: JSX.Element;\n}) => {\n const { providerSettings } = props;\n const configApi = useApi(configApiRef);\n const providersConfig = configApi.getOptionalConfig('auth.providers');\n const configuredProviders = providersConfig?.keys() || [];\n const providers = providerSettings ?? (\n <DefaultProviderSettings configuredProviders={configuredProviders} />\n );\n\n if (!providerSettings && !configuredProviders?.length) {\n return <EmptyProviders />;\n }\n\n return (\n <InfoCard title=\"Available Providers\">\n <List dense>{providers}</List>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAwBa,MAAA,yBAAA,GAA4B,CAAC,KAEpC,KAAA;AACJ,EAAM,MAAA,EAAE,kBAAqB,GAAA,KAAA;AAC7B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAM,MAAA,eAAA,GAAkB,SAAU,CAAA,iBAAA,CAAkB,gBAAgB,CAAA;AACpE,EAAA,MAAM,mBAAsB,GAAA,eAAA,EAAiB,IAAK,EAAA,IAAK,EAAC;AACxD,EAAA,MAAM,SAAY,GAAA,gBAAA,oBACf,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,mBAA0C,EAAA,CAAA;AAGrE,EAAA,IAAI,CAAC,gBAAA,IAAoB,CAAC,mBAAA,EAAqB,MAAQ,EAAA;AACrD,IAAA,2CAAQ,cAAe,EAAA,IAAA,CAAA;AAAA;AAGzB,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,YAAS,KAAM,EAAA,qBAAA,EAAA,sCACb,IAAK,EAAA,EAAA,KAAA,EAAK,IAAE,EAAA,EAAA,SAAU,CACzB,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"UserSettingsAuthProviders.esm.js","sources":["../../../src/components/AuthProviders/UserSettingsAuthProviders.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 List from '@material-ui/core/List';\nimport { EmptyProviders } from './EmptyProviders';\nimport { DefaultProviderSettings } from './DefaultProviderSettings';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { InfoCard } from '@backstage/core-components';\n\n/** @public */\nexport const UserSettingsAuthProviders = (props: {\n providerSettings?: JSX.Element;\n}) => {\n const { providerSettings } = props;\n const configApi = useApi(configApiRef);\n const providersConfig = configApi.getOptionalConfig('auth.providers');\n const configuredProviders = providersConfig?.keys() || [];\n const providers = providerSettings ?? (\n <DefaultProviderSettings configuredProviders={configuredProviders} />\n );\n\n if (!providerSettings && !configuredProviders?.length) {\n return <EmptyProviders />;\n }\n\n return (\n <InfoCard title=\"Available Providers\">\n <List dense>{providers}</List>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuBa,MAAA,yBAAA,GAA4B,CAAC,KAEpC,KAAA;AACJ,EAAM,MAAA,EAAE,kBAAqB,GAAA,KAAA;AAC7B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAM,MAAA,eAAA,GAAkB,SAAU,CAAA,iBAAA,CAAkB,gBAAgB,CAAA;AACpE,EAAA,MAAM,mBAAsB,GAAA,eAAA,EAAiB,IAAK,EAAA,IAAK,EAAC;AACxD,EAAA,MAAM,SAAY,GAAA,gBAAA,oBACf,GAAA,CAAA,uBAAA,EAAA,EAAwB,mBAA0C,EAAA,CAAA;AAGrE,EAAA,IAAI,CAAC,gBAAA,IAAoB,CAAC,mBAAA,EAAqB,MAAQ,EAAA;AACrD,IAAA,2BAAQ,cAAe,EAAA,EAAA,CAAA;AAAA;AAGzB,EACE,uBAAA,GAAA,CAAC,YAAS,KAAM,EAAA,qBAAA,EACd,8BAAC,IAAK,EAAA,EAAA,KAAA,EAAK,IAAE,EAAA,QAAA,EAAA,SAAA,EAAU,CACzB,EAAA,CAAA;AAEJ;;;;"}