@openshift-migration-advisor/shared-components 0.0.0

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 (105) hide show
  1. package/LICENSE +13 -0
  2. package/README.md +76 -0
  3. package/dist/charts/MigrationDonutChart.d.ts +53 -0
  4. package/dist/charts/MigrationDonutChart.d.ts.map +1 -0
  5. package/dist/charts/MigrationDonutChart.js +186 -0
  6. package/dist/charts/index.d.ts +2 -0
  7. package/dist/charts/index.d.ts.map +1 -0
  8. package/dist/charts/index.js +1 -0
  9. package/dist/forms/CheckboxFormGroup.d.ts +5 -0
  10. package/dist/forms/CheckboxFormGroup.d.ts.map +1 -0
  11. package/dist/forms/CheckboxFormGroup.js +14 -0
  12. package/dist/forms/FormFieldHelperText.d.ts +7 -0
  13. package/dist/forms/FormFieldHelperText.d.ts.map +1 -0
  14. package/dist/forms/FormFieldHelperText.js +8 -0
  15. package/dist/forms/RadioButtonFormGroup.d.ts +12 -0
  16. package/dist/forms/RadioButtonFormGroup.d.ts.map +1 -0
  17. package/dist/forms/RadioButtonFormGroup.js +12 -0
  18. package/dist/forms/SelectFormGroup.d.ts +8 -0
  19. package/dist/forms/SelectFormGroup.d.ts.map +1 -0
  20. package/dist/forms/SelectFormGroup.js +12 -0
  21. package/dist/forms/TextAreaFormGroup.d.ts +3 -0
  22. package/dist/forms/TextAreaFormGroup.d.ts.map +1 -0
  23. package/dist/forms/TextAreaFormGroup.js +12 -0
  24. package/dist/forms/TextInputFormGroup.d.ts +11 -0
  25. package/dist/forms/TextInputFormGroup.d.ts.map +1 -0
  26. package/dist/forms/TextInputFormGroup.js +16 -0
  27. package/dist/forms/index.d.ts +8 -0
  28. package/dist/forms/index.d.ts.map +1 -0
  29. package/dist/forms/index.js +6 -0
  30. package/dist/forms/types.d.ts +11 -0
  31. package/dist/forms/types.d.ts.map +1 -0
  32. package/dist/forms/types.js +1 -0
  33. package/dist/index.d.ts +4 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +3 -0
  36. package/dist/report/CardEmptyState.d.ts +8 -0
  37. package/dist/report/CardEmptyState.d.ts.map +1 -0
  38. package/dist/report/CardEmptyState.js +13 -0
  39. package/dist/report/DashboardEmptyStateBase.d.ts +8 -0
  40. package/dist/report/DashboardEmptyStateBase.d.ts.map +1 -0
  41. package/dist/report/DashboardEmptyStateBase.js +5 -0
  42. package/dist/report/EmptySearchResults.d.ts +7 -0
  43. package/dist/report/EmptySearchResults.d.ts.map +1 -0
  44. package/dist/report/EmptySearchResults.js +4 -0
  45. package/dist/report/OSDistribution.d.ts +14 -0
  46. package/dist/report/OSDistribution.d.ts.map +1 -0
  47. package/dist/report/OSDistribution.js +37 -0
  48. package/dist/report/OsSupportTiersHelpPopover.d.ts +3 -0
  49. package/dist/report/OsSupportTiersHelpPopover.d.ts.map +1 -0
  50. package/dist/report/OsSupportTiersHelpPopover.js +37 -0
  51. package/dist/report/OsUpgradeNotice.d.ts +3 -0
  52. package/dist/report/OsUpgradeNotice.d.ts.map +1 -0
  53. package/dist/report/OsUpgradeNotice.js +9 -0
  54. package/dist/report/OsUpgradeRecommendationPopover.d.ts +13 -0
  55. package/dist/report/OsUpgradeRecommendationPopover.d.ts.map +1 -0
  56. package/dist/report/OsUpgradeRecommendationPopover.js +24 -0
  57. package/dist/report/PopoverIcon.d.ts +11 -0
  58. package/dist/report/PopoverIcon.d.ts.map +1 -0
  59. package/dist/report/PopoverIcon.js +8 -0
  60. package/dist/report/SupportTierBadge.d.ts +9 -0
  61. package/dist/report/SupportTierBadge.d.ts.map +1 -0
  62. package/dist/report/SupportTierBadge.js +23 -0
  63. package/dist/report/constants.d.ts +11 -0
  64. package/dist/report/constants.d.ts.map +1 -0
  65. package/dist/report/constants.js +12 -0
  66. package/dist/report/dashboardStyles.d.ts +20 -0
  67. package/dist/report/dashboardStyles.d.ts.map +1 -0
  68. package/dist/report/dashboardStyles.js +99 -0
  69. package/dist/report/index.d.ts +15 -0
  70. package/dist/report/index.d.ts.map +1 -0
  71. package/dist/report/index.js +13 -0
  72. package/dist/report/osSupportTier.d.ts +42 -0
  73. package/dist/report/osSupportTier.d.ts.map +1 -0
  74. package/dist/report/osSupportTier.js +106 -0
  75. package/dist/report/useOsBarChartViewModel.d.ts +26 -0
  76. package/dist/report/useOsBarChartViewModel.d.ts.map +1 -0
  77. package/dist/report/useOsBarChartViewModel.js +59 -0
  78. package/package.json +63 -0
  79. package/src/charts/MigrationDonutChart.tsx +398 -0
  80. package/src/charts/index.ts +5 -0
  81. package/src/forms/CheckboxFormGroup.tsx +53 -0
  82. package/src/forms/FormFieldHelperText.tsx +32 -0
  83. package/src/forms/RadioButtonFormGroup.tsx +62 -0
  84. package/src/forms/SelectFormGroup.tsx +57 -0
  85. package/src/forms/TextAreaFormGroup.tsx +43 -0
  86. package/src/forms/TextInputFormGroup.tsx +63 -0
  87. package/src/forms/index.ts +7 -0
  88. package/src/forms/types.ts +11 -0
  89. package/src/index.ts +3 -0
  90. package/src/report/CardEmptyState.tsx +30 -0
  91. package/src/report/DashboardEmptyStateBase.tsx +30 -0
  92. package/src/report/EmptySearchResults.tsx +14 -0
  93. package/src/report/OSDistribution.tsx +206 -0
  94. package/src/report/OsSupportTiersHelpPopover.tsx +87 -0
  95. package/src/report/OsUpgradeNotice.tsx +29 -0
  96. package/src/report/OsUpgradeRecommendationPopover.tsx +78 -0
  97. package/src/report/PopoverIcon.tsx +46 -0
  98. package/src/report/SupportTierBadge.tsx +55 -0
  99. package/src/report/__tests__/OSDistribution.test.tsx +236 -0
  100. package/src/report/__tests__/osSupportTier.test.ts +101 -0
  101. package/src/report/constants.ts +14 -0
  102. package/src/report/dashboardStyles.ts +116 -0
  103. package/src/report/index.ts +54 -0
  104. package/src/report/osSupportTier.ts +161 -0
  105. package/src/report/useOsBarChartViewModel.ts +115 -0
@@ -0,0 +1,46 @@
1
+ import {
2
+ Button,
3
+ type ButtonProps,
4
+ Icon,
5
+ Popover,
6
+ type PopoverProps,
7
+ } from "@patternfly/react-core";
8
+ import { QuestionCircleIcon } from "@patternfly/react-icons";
9
+ import type { CSSProperties, FC } from "react";
10
+
11
+ type PopoverIconProps = PopoverProps & {
12
+ variant?: ButtonProps["variant"];
13
+ noVerticalAlign?: boolean;
14
+ buttonOuiaId?: string;
15
+ buttonStyle?: CSSProperties;
16
+ };
17
+
18
+ const PopoverIcon: FC<PopoverIconProps> = ({
19
+ variant = "plain",
20
+ noVerticalAlign = false,
21
+ buttonOuiaId,
22
+ buttonStyle,
23
+ "aria-label": ariaLabel,
24
+ ...props
25
+ }) => (
26
+ <Popover {...props}>
27
+ <Button
28
+ icon={
29
+ <Icon isInline={noVerticalAlign}>
30
+ <QuestionCircleIcon />
31
+ </Icon>
32
+ }
33
+ variant={variant}
34
+ aria-label={ariaLabel}
35
+ onClick={(e) => {
36
+ e.preventDefault();
37
+ e.stopPropagation();
38
+ }}
39
+ className="pf-v6-c-form__group-label-help pf-v6-u-p-0"
40
+ ouiaId={buttonOuiaId}
41
+ style={buttonStyle}
42
+ />
43
+ </Popover>
44
+ );
45
+
46
+ export default PopoverIcon;
@@ -0,0 +1,55 @@
1
+ import { css } from "@emotion/css";
2
+ import { Label, Tooltip } from "@patternfly/react-core";
3
+ import type { FC } from "react";
4
+ import {
5
+ getSupportTierBadgeColor,
6
+ getSupportTierBadgeInlineStyle,
7
+ getSupportTierDefinition,
8
+ getSupportTierLegendLabel,
9
+ type SupportTier,
10
+ } from "./osSupportTier.js";
11
+
12
+ const exportBadgeStyle = css`
13
+ display: inline-block;
14
+ padding: var(--pf-t--global--spacer--xs) var(--pf-t--global--spacer--sm);
15
+ border-radius: var(--pf-t--global--border--radius--pill);
16
+ font-size: var(--pf-t--global--font--size--body--sm);
17
+ line-height: var(--pf-t--global--font--line-height--body);
18
+ white-space: nowrap;
19
+ `;
20
+
21
+ interface SupportTierBadgeProps {
22
+ tier: SupportTier;
23
+ isExportMode?: boolean;
24
+ }
25
+
26
+ const ExportSupportTierBadge: FC<{ tier: SupportTier }> = ({ tier }) => {
27
+ const { backgroundColor, color } = getSupportTierBadgeInlineStyle(tier);
28
+
29
+ return (
30
+ <span className={exportBadgeStyle} style={{ backgroundColor, color }}>
31
+ {getSupportTierLegendLabel(tier)}
32
+ </span>
33
+ );
34
+ };
35
+
36
+ export const SupportTierBadge: FC<SupportTierBadgeProps> = ({
37
+ tier,
38
+ isExportMode = false,
39
+ }) => {
40
+ if (isExportMode) {
41
+ return <ExportSupportTierBadge tier={tier} />;
42
+ }
43
+
44
+ return (
45
+ <Tooltip content={getSupportTierDefinition(tier)}>
46
+ <span>
47
+ <Label color={getSupportTierBadgeColor(tier)} isCompact>
48
+ {getSupportTierLegendLabel(tier)}
49
+ </Label>
50
+ </span>
51
+ </Tooltip>
52
+ );
53
+ };
54
+
55
+ SupportTierBadge.displayName = "SupportTierBadge";
@@ -0,0 +1,236 @@
1
+ import "@testing-library/jest-dom";
2
+
3
+ import { render, screen, within } from "@testing-library/react";
4
+ import userEvent from "@testing-library/user-event";
5
+ import { describe, expect, it } from "vitest";
6
+ import { OSBarChart, OSDistribution } from "../OSDistribution.js";
7
+ import { SUPPORT_TIER_DEFINITIONS, SupportTier } from "../osSupportTier.js";
8
+
9
+ const sampleOsData = {
10
+ "Red Hat Enterprise Linux 9 (64-bit)": {
11
+ count: 5,
12
+ supported: true,
13
+ supportTier: SupportTier.Certified,
14
+ upgradeRecommendation: "",
15
+ },
16
+ "Ubuntu Linux 22.04 (64-bit)": {
17
+ count: 3,
18
+ supported: true,
19
+ supportTier: SupportTier.VendorSupported,
20
+ upgradeRecommendation: "",
21
+ },
22
+ "CentOS 7 (64-bit)": {
23
+ count: 2,
24
+ supported: false,
25
+ supportTier: SupportTier.SpecialHandling,
26
+ upgradeRecommendation: "Upgrade to RHEL 7",
27
+ },
28
+ };
29
+
30
+ describe("OSBarChart", () => {
31
+ it("renders operating systems in a table sorted by support tier", () => {
32
+ render(<OSBarChart osData={sampleOsData} />);
33
+
34
+ const rows = screen.getAllByRole("row").slice(1);
35
+ expect(rows[0]).toHaveTextContent("Red Hat Enterprise Linux 9 (64-bit)");
36
+ expect(rows[0]).toHaveTextContent("Certified");
37
+ expect(rows[0]).toHaveTextContent("5");
38
+ expect(rows[1]).toHaveTextContent("Ubuntu Linux 22.04 (64-bit)");
39
+ expect(rows[2]).toHaveTextContent("CentOS 7 (64-bit)");
40
+ expect(rows[2]).toHaveTextContent("Special handling");
41
+ });
42
+
43
+ it("sorts by tier before VM count", () => {
44
+ render(
45
+ <OSBarChart
46
+ osData={{
47
+ "CentOS 7 (64-bit)": {
48
+ count: 100,
49
+ supported: false,
50
+ supportTier: SupportTier.SpecialHandling,
51
+ upgradeRecommendation: "",
52
+ },
53
+ "Red Hat Enterprise Linux 9 (64-bit)": {
54
+ count: 1,
55
+ supported: true,
56
+ supportTier: SupportTier.Certified,
57
+ upgradeRecommendation: "",
58
+ },
59
+ }}
60
+ />,
61
+ );
62
+
63
+ const rows = screen.getAllByRole("row").slice(1);
64
+ expect(rows[0]).toHaveTextContent("Red Hat Enterprise Linux 9 (64-bit)");
65
+ expect(rows[1]).toHaveTextContent("CentOS 7 (64-bit)");
66
+ });
67
+
68
+ it("shows upgrade recommendation details next to the operating system", async () => {
69
+ const user = userEvent.setup();
70
+
71
+ render(<OSBarChart osData={sampleOsData} />);
72
+
73
+ const upgradeButton = screen.getByRole("button", {
74
+ name: "Open operating system upgrade information",
75
+ });
76
+ await user.click(upgradeButton);
77
+
78
+ const popover = await screen.findByRole("dialog");
79
+ expect(
80
+ within(popover).getByText("Upgrade to get support"),
81
+ ).toBeInTheDocument();
82
+ expect(within(popover).getByText("Upgrade to RHEL 7")).toBeInTheDocument();
83
+ });
84
+
85
+ it("does not show upgrade recommendation icon in export mode", () => {
86
+ render(<OSBarChart osData={sampleOsData} isExportMode />);
87
+
88
+ expect(
89
+ screen.queryByRole("button", {
90
+ name: "Open operating system upgrade information",
91
+ }),
92
+ ).not.toBeInTheDocument();
93
+ });
94
+
95
+ it("shows official Red Hat definitions in tier badge tooltips", async () => {
96
+ const user = userEvent.setup();
97
+
98
+ render(<OSBarChart osData={sampleOsData} />);
99
+
100
+ const certifiedBadge = screen.getByText("Certified");
101
+ await user.hover(certifiedBadge);
102
+
103
+ expect(
104
+ await screen.findByText(SUPPORT_TIER_DEFINITIONS[SupportTier.Certified]),
105
+ ).toBeInTheDocument();
106
+ });
107
+
108
+ it("filters operating systems by name", async () => {
109
+ const user = userEvent.setup();
110
+
111
+ render(<OSBarChart osData={sampleOsData} />);
112
+
113
+ await user.type(screen.getByPlaceholderText("Filter by OS"), "Ubuntu");
114
+
115
+ expect(screen.getByText("Ubuntu Linux 22.04 (64-bit)")).toBeInTheDocument();
116
+ expect(
117
+ screen.queryByText("Red Hat Enterprise Linux 9 (64-bit)"),
118
+ ).not.toBeInTheDocument();
119
+ });
120
+
121
+ it("filters operating systems by support tier", async () => {
122
+ const user = userEvent.setup();
123
+
124
+ render(<OSBarChart osData={sampleOsData} />);
125
+
126
+ await user.click(screen.getByRole("button", { name: /filter by tier/i }));
127
+ await user.click(screen.getByRole("option", { name: "Special handling" }));
128
+
129
+ expect(screen.getByText("CentOS 7 (64-bit)")).toBeInTheDocument();
130
+ expect(
131
+ screen.queryByText("Red Hat Enterprise Linux 9 (64-bit)"),
132
+ ).not.toBeInTheDocument();
133
+ });
134
+
135
+ it("shows an empty state when filters match no operating systems", async () => {
136
+ const user = userEvent.setup();
137
+
138
+ render(<OSBarChart osData={sampleOsData} />);
139
+
140
+ await user.type(screen.getByPlaceholderText("Filter by OS"), "ccc");
141
+
142
+ expect(
143
+ screen.getByText("No matching operating system found"),
144
+ ).toBeInTheDocument();
145
+ expect(
146
+ screen.getByText(
147
+ "To continue, adjust your search or filters and try again",
148
+ ),
149
+ ).toBeInTheDocument();
150
+ });
151
+
152
+ it("renders export-friendly inline tier badge colors in export mode", () => {
153
+ render(<OSBarChart osData={sampleOsData} isExportMode />);
154
+
155
+ const certifiedBadge = screen.getByText("Certified");
156
+ expect(certifiedBadge.tagName).toBe("SPAN");
157
+ expect(certifiedBadge).toHaveStyle({
158
+ backgroundColor: "rgb(185, 218, 252)",
159
+ color: "rgb(0, 77, 153)",
160
+ });
161
+ });
162
+
163
+ it("shows empty state when no operating systems are available", () => {
164
+ render(<OSBarChart osData={{}} />);
165
+
166
+ expect(
167
+ screen.getByText("Operating system data not collected"),
168
+ ).toBeInTheDocument();
169
+ });
170
+ });
171
+
172
+ describe("OSDistribution", () => {
173
+ it("shows the guest OS support tiers help popover", async () => {
174
+ const user = userEvent.setup();
175
+
176
+ render(<OSDistribution osData={sampleOsData} />);
177
+
178
+ await user.click(
179
+ screen.getByRole("button", { name: "Guest OS support tiers help" }),
180
+ );
181
+
182
+ const popover = await screen.findByRole("dialog");
183
+ expect(
184
+ within(popover).getByText("Guest OS support tiers"),
185
+ ).toBeInTheDocument();
186
+ expect(within(popover).getByText("Certified")).toBeInTheDocument();
187
+ expect(
188
+ within(popover).getByText("Commercial Vendor Supported"),
189
+ ).toBeInTheDocument();
190
+ expect(
191
+ within(popover).getByRole("link", { name: /learn more/i }),
192
+ ).toHaveAttribute("href", "https://access.redhat.com/articles/4234591");
193
+ });
194
+
195
+ it("shows the upgrade notice when non-certified operating systems are present", () => {
196
+ render(
197
+ <OSDistribution
198
+ osData={{
199
+ "CentOS 7 (64-bit)": {
200
+ count: 2,
201
+ supported: false,
202
+ supportTier: SupportTier.SpecialHandling,
203
+ upgradeRecommendation: "",
204
+ },
205
+ }}
206
+ />,
207
+ );
208
+
209
+ expect(
210
+ screen.getByText(
211
+ "Some operating systems may need upgrades before migration",
212
+ ),
213
+ ).toBeInTheDocument();
214
+ });
215
+
216
+ it("does not show the upgrade notice when all operating systems are certified", () => {
217
+ render(
218
+ <OSDistribution
219
+ osData={{
220
+ "Red Hat Enterprise Linux 9 (64-bit)": {
221
+ count: 5,
222
+ supported: true,
223
+ supportTier: SupportTier.Certified,
224
+ upgradeRecommendation: "",
225
+ },
226
+ }}
227
+ />,
228
+ );
229
+
230
+ expect(
231
+ screen.queryByText(
232
+ "Some operating systems may need upgrades before migration",
233
+ ),
234
+ ).not.toBeInTheDocument();
235
+ });
236
+ });
@@ -0,0 +1,101 @@
1
+ import { describe, expect, it } from "vitest";
2
+
3
+ import {
4
+ getSupportTierBadgeInlineStyle,
5
+ getSupportTierDefinition,
6
+ getSupportTierLegendLabel,
7
+ getSupportTierSortOrder,
8
+ hasOsUpgradeNotice,
9
+ resolveSupportTier,
10
+ SUPPORT_TIER_DEFINITIONS,
11
+ SupportTier,
12
+ } from "../osSupportTier.js";
13
+
14
+ describe("osSupportTier", () => {
15
+ it("maps API tier values to display labels", () => {
16
+ expect(getSupportTierLegendLabel(SupportTier.Certified)).toBe("Certified");
17
+ expect(getSupportTierLegendLabel(SupportTier.VendorSupported)).toBe(
18
+ "Commercial Vendor Supported",
19
+ );
20
+ expect(getSupportTierLegendLabel(SupportTier.CommunitySupported)).toBe(
21
+ "Community supported",
22
+ );
23
+ expect(getSupportTierLegendLabel(SupportTier.SpecialHandling)).toBe(
24
+ "Special handling",
25
+ );
26
+ });
27
+
28
+ it("orders tiers from best to worst support", () => {
29
+ expect(getSupportTierSortOrder(SupportTier.Certified)).toBeLessThan(
30
+ getSupportTierSortOrder(SupportTier.VendorSupported),
31
+ );
32
+ expect(getSupportTierSortOrder(SupportTier.VendorSupported)).toBeLessThan(
33
+ getSupportTierSortOrder(SupportTier.CommunitySupported),
34
+ );
35
+ expect(
36
+ getSupportTierSortOrder(SupportTier.CommunitySupported),
37
+ ).toBeLessThan(getSupportTierSortOrder(SupportTier.SpecialHandling));
38
+ });
39
+
40
+ it("uses support tier when present", () => {
41
+ expect(resolveSupportTier(SupportTier.CommunitySupported, true)).toBe(
42
+ SupportTier.CommunitySupported,
43
+ );
44
+ });
45
+
46
+ it("falls back to certified when supportTier is missing and supported is true", () => {
47
+ expect(resolveSupportTier(undefined, true)).toBe(SupportTier.Certified);
48
+ });
49
+
50
+ it("falls back to special handling when supportTier is missing and supported is false", () => {
51
+ expect(resolveSupportTier(undefined, false)).toBe(
52
+ SupportTier.SpecialHandling,
53
+ );
54
+ });
55
+
56
+ it("provides official Red Hat definitions for each support tier", () => {
57
+ expect(getSupportTierDefinition(SupportTier.Certified)).toBe(
58
+ SUPPORT_TIER_DEFINITIONS[SupportTier.Certified],
59
+ );
60
+ expect(getSupportTierDefinition(SupportTier.VendorSupported)).toContain(
61
+ "commercial vendor supported guest operating system",
62
+ );
63
+ expect(getSupportTierDefinition(SupportTier.CommunitySupported)).toContain(
64
+ "community channels",
65
+ );
66
+ expect(getSupportTierDefinition(SupportTier.SpecialHandling)).toContain(
67
+ "third-party software support policy",
68
+ );
69
+ });
70
+
71
+ it("provides explicit inline badge colors for PDF export", () => {
72
+ expect(getSupportTierBadgeInlineStyle(SupportTier.Certified)).toEqual({
73
+ backgroundColor: "#b9dafc",
74
+ color: "#004d99",
75
+ });
76
+ });
77
+
78
+ it("detects when the upgrade notice should be shown", () => {
79
+ expect(
80
+ hasOsUpgradeNotice({
81
+ "Red Hat Enterprise Linux 9 (64-bit)": {
82
+ count: 1,
83
+ supported: true,
84
+ supportTier: SupportTier.Certified,
85
+ upgradeRecommendation: "",
86
+ },
87
+ }),
88
+ ).toBe(false);
89
+
90
+ expect(
91
+ hasOsUpgradeNotice({
92
+ "CentOS 7 (64-bit)": {
93
+ count: 1,
94
+ supported: false,
95
+ supportTier: SupportTier.SpecialHandling,
96
+ upgradeRecommendation: "",
97
+ },
98
+ }),
99
+ ).toBe(true);
100
+ });
101
+ });
@@ -0,0 +1,14 @@
1
+ import { chart_color_blue_300 } from "@patternfly/react-tokens/dist/esm/chart_color_blue_300";
2
+ import { chart_color_yellow_300 } from "@patternfly/react-tokens/dist/esm/chart_color_yellow_300";
3
+
4
+ /**
5
+ * PatternFly chart color semantics (https://www.patternfly.org/charts/colors-for-charts/design-guidelines/#best-practices):
6
+ * Blue → success / migratable / supported
7
+ * Red-orange → failure / non-migratable / unsupported
8
+ */
9
+ export const chartColorSuccess = chart_color_blue_300.value;
10
+ export const chartColorFailure = chart_color_yellow_300.value;
11
+
12
+ export const REPORT_CARD_EMPTY_STATE_TITLES = {
13
+ operatingSystems: "Operating system data not collected",
14
+ } as const;
@@ -0,0 +1,116 @@
1
+ import { css } from "@emotion/css";
2
+
3
+ export const dashboardStyles = {
4
+ cardClip: css`
5
+ clip-path: inset(0 round 10px);
6
+ background: #fff;
7
+ height: 100%;
8
+ width: 100%;
9
+ `,
10
+
11
+ cardScroll: css`
12
+ height: 100%;
13
+ min-height: 300px;
14
+ max-height: 500px;
15
+ overflow: auto;
16
+ display: flex;
17
+ flex-direction: column;
18
+ `,
19
+
20
+ equalHeightRow: css`
21
+ display: flex;
22
+ gap: var(--pf-t--global--spacer--gap--group--horizontal);
23
+ align-items: stretch;
24
+ `,
25
+
26
+ equalHeight: css`
27
+ display: flex;
28
+ flex-direction: column;
29
+ flex: 1 1 0;
30
+ height: 100%;
31
+ `,
32
+
33
+ cardBodyScrollable: css`
34
+ overflow: auto;
35
+ `,
36
+
37
+ // `!important` on overflow: PatternFly sets `.pf-v6-c-card { overflow: auto }`
38
+ // at the same specificity, which wins in the production build due to stylesheet
39
+ // injection order. `!important` forces `hidden` regardless of that order.
40
+ card: css`
41
+ min-height: 430px;
42
+ max-height: 520px;
43
+ height: 100%;
44
+ display: flex;
45
+ flex-direction: column;
46
+ justify-content: space-between;
47
+ overflow: hidden !important;
48
+ `,
49
+
50
+ cardPrint: css`
51
+ border: 1px solid #d2d2d2 !important;
52
+ border-radius: 10px;
53
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
54
+ min-height: unset;
55
+ max-height: unset;
56
+ page-break-inside: avoid;
57
+ `,
58
+
59
+ storageCardOverflowHidden: css`
60
+ overflow: hidden;
61
+ `,
62
+
63
+ storageCardOverflowVisible: css`
64
+ overflow: visible;
65
+ `,
66
+
67
+ storageChartWrapper: css`
68
+ display: flex;
69
+ justify-content: center;
70
+ align-items: center;
71
+ width: 100%;
72
+ padding: 20px 0;
73
+ `,
74
+
75
+ storageExportSectionMargin: css`
76
+ margin-bottom: 24px;
77
+ `,
78
+
79
+ storageExportSectionTitle: css`
80
+ font-size: 14px;
81
+ font-weight: 600;
82
+ margin-bottom: 12px;
83
+ `,
84
+
85
+ storageFlexFullWidth: css`
86
+ width: 100%;
87
+ `,
88
+
89
+ storageMenuToggleMinWidth: css`
90
+ min-width: 200px;
91
+ `,
92
+
93
+ storageNoDataContainer: css`
94
+ display: flex;
95
+ justify-content: center;
96
+ align-items: center;
97
+ height: 250px;
98
+ font-size: 16px;
99
+ color: #6a6e73;
100
+ `,
101
+
102
+ storageTotalsNote: css`
103
+ margin-top: 12px;
104
+ color: #6a6e73;
105
+ font-style: italic;
106
+ text-align: center;
107
+ `,
108
+ };
109
+
110
+ export const tableFullWidthStyle = css`
111
+ margin-inline: calc(-1 * var(--pf-v6-c-card--child--PaddingInlineStart));
112
+ width: calc(
113
+ 100% + var(--pf-v6-c-card--child--PaddingInlineStart) +
114
+ var(--pf-v6-c-card--child--PaddingInlineEnd)
115
+ );
116
+ `;
@@ -0,0 +1,54 @@
1
+ export {
2
+ CARD_EMPTY_STATE_DESCRIPTION,
3
+ CardEmptyState,
4
+ type CardEmptyStateProps,
5
+ } from "./CardEmptyState.js";
6
+ export {
7
+ chartColorFailure,
8
+ chartColorSuccess,
9
+ REPORT_CARD_EMPTY_STATE_TITLES,
10
+ } from "./constants.js";
11
+ export {
12
+ DashboardEmptyStateBase,
13
+ type DashboardEmptyStateBaseProps,
14
+ } from "./DashboardEmptyStateBase.js";
15
+ export { dashboardStyles, tableFullWidthStyle } from "./dashboardStyles.js";
16
+ export {
17
+ EmptySearchResults,
18
+ type EmptySearchResultsProps,
19
+ } from "./EmptySearchResults.js";
20
+ export { OSBarChart, OSDistribution } from "./OSDistribution.js";
21
+ export { OsSupportTiersHelpPopover } from "./OsSupportTiersHelpPopover.js";
22
+ export { OsUpgradeNotice } from "./OsUpgradeNotice.js";
23
+ export {
24
+ OsNameCell,
25
+ OsUpgradeRecommendationPopover,
26
+ } from "./OsUpgradeRecommendationPopover.js";
27
+ export type {
28
+ OSDistributionEntry,
29
+ SupportTierBadgeStyle,
30
+ } from "./osSupportTier.js";
31
+ export {
32
+ getSupportTierBadgeColor,
33
+ getSupportTierBadgeInlineStyle,
34
+ getSupportTierDefinition,
35
+ getSupportTierLegendLabel,
36
+ getSupportTierSortOrder,
37
+ hasOsUpgradeNotice,
38
+ ORDERED_SUPPORT_TIERS,
39
+ resolveSupportTier,
40
+ SUPPORT_TIER_BADGE_COLORS,
41
+ SUPPORT_TIER_BADGE_INLINE_STYLES,
42
+ SUPPORT_TIER_DEFINITIONS,
43
+ SUPPORT_TIER_LABELS,
44
+ SUPPORT_TIER_LEARN_MORE_URL,
45
+ SupportTier,
46
+ } from "./osSupportTier.js";
47
+ export { default as PopoverIcon } from "./PopoverIcon.js";
48
+ export { SupportTierBadge } from "./SupportTierBadge.js";
49
+ export {
50
+ ALL_TIERS_FILTER,
51
+ type OsBarChartViewModel,
52
+ type OsTableRow,
53
+ useOsBarChartViewModel,
54
+ } from "./useOsBarChartViewModel.js";