diff --git a/workspaces/microsoft-calendar/.changeset/three-parrots-report.md b/workspaces/microsoft-calendar/.changeset/three-parrots-report.md new file mode 100644 index 00000000000..7be296e2800 --- /dev/null +++ b/workspaces/microsoft-calendar/.changeset/three-parrots-report.md @@ -0,0 +1,5 @@ +--- +'@backstage-community/plugin-microsoft-calendar': minor +--- + +migrate plugin from mui to bui diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/dev/index.tsx b/workspaces/microsoft-calendar/plugins/microsoft-calendar/dev/index.tsx index 7ddf8757537..c39c88ff1df 100644 --- a/workspaces/microsoft-calendar/plugins/microsoft-calendar/dev/index.tsx +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/dev/index.tsx @@ -19,7 +19,7 @@ import { microsoftCalendarApiRef } from '../src'; import responseMock from './mock.json'; import { microsoftAuthApiRef } from '@backstage/core-plugin-api'; import { Content, Page } from '@backstage/core-components'; -import Grid from '@material-ui/core/Grid'; +import { Grid } from '@backstage/ui'; createDevApp() .registerPlugin(microsoftCalendarPlugin) @@ -50,9 +50,11 @@ createDevApp() element: ( - - - + + + + + ), diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/package.json b/workspaces/microsoft-calendar/plugins/microsoft-calendar/package.json index 80e832e87d6..48583c59b33 100644 --- a/workspaces/microsoft-calendar/plugins/microsoft-calendar/package.json +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/package.json @@ -55,16 +55,16 @@ "@backstage/core-components": "backstage:^", "@backstage/core-plugin-api": "backstage:^", "@backstage/errors": "backstage:^", - "@material-ui/core": "^4.12.2", - "@material-ui/icons": "^4.9.1", + "@backstage/ui": "backstage:^", "@microsoft/microsoft-graph-types": "^2.25.0", + "@remixicon/react": "^4.2.0", "@tanstack/react-query": "^4.1.3", "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0", "classnames": "^2.3.1", "dompurify": "^3.4.0", "lodash": "^4.17.21", "luxon": "^3.0.0", - "material-ui-popup-state": "^1.9.3", + "react-aria-components": "^1.0.0", "react-use": "^17.2.4" }, "peerDependencies": { diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/AttendeeChip.module.css b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/AttendeeChip.module.css new file mode 100644 index 00000000000..a27150f0d96 --- /dev/null +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/AttendeeChip.module.css @@ -0,0 +1,42 @@ +@layer components { + .badge { + position: relative; + display: inline-block; + } + + .chip { + display: inline-flex; + align-items: center; + padding: 4px var(--bui-space-2); + border: 1px solid var(--bui-border-primary); + border-radius: 16px; + background-color: transparent; + color: var(--bui-fg-primary); + font-size: 12px; + font-weight: 500; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 200px; + } + + .badgeContent { + position: absolute; + right: 10px; + top: 5px; + display: flex; + align-items: center; + justify-content: center; + width: 16px; + height: 16px; + background-color: var(--bui-bg-surface-1); + } + + .acceptedIcon { + color: var(--bui-fg-success, #10b981); + } + + .declinedIcon { + color: var(--bui-fg-danger, #ef4444); + } +} diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/AttendeeChip.tsx b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/AttendeeChip.tsx index e10c66671e6..7dec777fba9 100644 --- a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/AttendeeChip.tsx +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/AttendeeChip.tsx @@ -14,46 +14,28 @@ * limitations under the License. */ -import Badge from '@material-ui/core/Badge'; -import Chip from '@material-ui/core/Chip'; -import { makeStyles } from '@material-ui/core/styles'; -import CancelIcon from '@material-ui/icons/Cancel'; -import CheckIcon from '@material-ui/icons/CheckCircle'; +import { RiCloseLine, RiCheckLine } from '@remixicon/react'; import { Attendee, ResponseStatusMap } from '../api'; - -const useStyles = makeStyles(theme => { - const getIconColor = (responseStatus?: string) => { - if (!responseStatus) return theme.palette.primary.light; - - return { - [ResponseStatusMap.accepted]: theme.palette.status.ok, - [ResponseStatusMap.declined]: theme.palette.status.error, - }[responseStatus]; - }; - - return { - responseStatus: { - color: ({ responseStatus }: { responseStatus?: string }) => - getIconColor(responseStatus), - }, - badge: { - right: 10, - top: 5, - '& svg': { - height: 16, - width: 16, - background: theme.palette.common.white, - }, - }, - }; -}); +import styles from './AttendeeChip.module.css'; const ResponseIcon = ({ responseStatus }: { responseStatus: string }) => { if (responseStatus === ResponseStatusMap.accepted) { - return ; + return ( + + ); } if (responseStatus === ResponseStatusMap.declined) { - return ; + return ( + + ); } return null; @@ -64,24 +46,16 @@ type AttendeeChipProps = { }; export const AttendeeChip = ({ user }: AttendeeChipProps) => { - const classes = useStyles({ responseStatus: user.status?.response || '' }); + const responseStatus = user.status?.response || ''; return ( - - } - > - - +
+
{user.emailAddress?.address}
+ {responseStatus && ( +
+ +
+ )} +
); }; diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarCard.module.css b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarCard.module.css new file mode 100644 index 00000000000..38116b41024 --- /dev/null +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarCard.module.css @@ -0,0 +1,47 @@ +@layer components { + .titleWrapper { + display: flex; + align-items: center; + gap: var(--bui-space-2); + } + + .iconWrapper { + height: 32px; + width: 32px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + } + + .iconWrapper img { + height: 100%; + width: 100%; + object-fit: contain; + } + + .spacer { + width: var(--bui-space-1); + } + + .flex { + flex: 1; + } + + .loaderContainer { + padding: var(--bui-space-3); + } + + .eventsContainer { + padding: var(--bui-space-1); + padding-bottom: 0; + max-height: 602px; + overflow-y: auto; + } + + .emptyState { + padding-top: var(--bui-space-3); + padding-bottom: var(--bui-space-3); + text-align: center; + } +} diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarCard.tsx b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarCard.tsx index f9236417e5a..1af0e36a1bc 100644 --- a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarCard.tsx +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarCard.tsx @@ -19,12 +19,8 @@ import { DateTime } from 'luxon'; import { useState } from 'react'; import { InfoCard, Progress } from '@backstage/core-components'; - -import Box from '@material-ui/core/Box'; -import IconButton from '@material-ui/core/IconButton'; -import Typography from '@material-ui/core/Typography'; -import PrevIcon from '@material-ui/icons/NavigateBefore'; -import NextIcon from '@material-ui/icons/NavigateNext'; +import { ButtonIcon, Text } from '@backstage/ui'; +import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react'; import { useCalendarsQuery, useEventsQuery, useSignIn } from '../hooks'; import calendarIcon from '../icons/calendar.svg'; @@ -33,6 +29,7 @@ import { CalendarSelect } from './CalendarSelect'; import { SignInContent } from './SignInContent'; import { getStartDate } from './util'; import useAsync from 'react-use/esm/useAsync'; +import styles from './CalendarCard.module.css'; export const CalendarCard = () => { const [date, setDate] = useState(DateTime.now()); @@ -73,28 +70,34 @@ export const CalendarCard = () => { - +
+
Microsoft Calendar - +
{isSignedIn ? ( <> - changeDay(-1)} size="small"> - - - changeDay(1)} size="small"> - - - - + changeDay(-1)} + icon={} + variant="secondary" + aria-label="Previous day" + /> + changeDay(1)} + icon={} + variant="secondary" + aria-label="Next day" + /> +
+ {date.toLocaleString({ weekday: 'short', month: 'short', day: 'numeric', })} - + - +
{ /> ) : ( - Agenda + Agenda )} - +
} deepLink={{ link: 'https://outlook.office.com/calendar/', title: 'Go to Calendar', }} > - +
{showLoader && ( - +
- +
)} {!isSignedIn && isInitialized && ( signIn(false)} /> )} {!isEventLoading && !isCalendarLoading && isSignedIn && ( - +
{events?.length === 0 && ( - - - No events - - +
+ No events +
)} {sortBy(events, [getStartDate]).map(event => ( ))} - +
)} -
+
); }; diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEvent.module.css b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEvent.module.css new file mode 100644 index 00000000000..7a614428115 --- /dev/null +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEvent.module.css @@ -0,0 +1,101 @@ +@layer components { + .eventWrapper { + position: relative; + } + + .event { + display: flex; + align-items: center; + margin-bottom: var(--bui-space-2); + cursor: pointer; + padding-right: 12px; + padding: var(--bui-space-2); + border-radius: var(--bui-radius-1); + background-color: var(--bui-bg-surface-1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); + transition: box-shadow 150ms ease-in-out; + } + + .event:hover { + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); + } + + .event.hovered { + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); + } + + .event.passed { + opacity: 0.6; + transition: opacity 0.15s ease-in-out; + } + + .event.passed:hover { + opacity: 1; + } + + .calendarColor { + width: 8px; + height: 100%; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + background-color: var(--bui-fg-primary); + margin-right: var(--bui-space-2); + flex-shrink: 0; + } + + .content { + flex: 1; + padding-top: var(--bui-space-1); + padding-bottom: var(--bui-space-1); + display: flex; + flex-direction: column; + gap: var(--bui-space-1); + } + + .declined { + text-decoration: line-through; + } + + .link { + width: 48px; + height: 48px; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 8px; + border-radius: 50%; + flex-shrink: 0; + transition: background-color 150ms ease-in-out; + } + + .link:hover { + background-color: var(--bui-bg-surface-2); + } + + .link img { + width: 100%; + height: 100%; + object-fit: contain; + } + + .popoverBackdrop { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 999; + } + + .popover { + position: absolute; + top: 0; + left: 0; + z-index: 1000; + background-color: var(--bui-bg-surface-1); + border: 1px solid var(--bui-border-neutral); + border-radius: var(--bui-radius-2); + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); + margin-top: var(--bui-space-2); + } +} diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEvent.tsx b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEvent.tsx index e3da897bce8..290bd092d59 100644 --- a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEvent.tsx +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEvent.tsx @@ -14,21 +14,11 @@ * limitations under the License. */ import classnames from 'classnames'; -import { - bindPopover, - bindTrigger, - usePopupState, -} from 'material-ui-popup-state/hooks'; -import { useState } from 'react'; +import { useRef, useState } from 'react'; +import { TooltipTrigger, Tooltip } from 'react-aria-components'; import { Link } from '@backstage/core-components'; - -import Box from '@material-ui/core/Box'; -import Paper from '@material-ui/core/Paper'; -import Popover from '@material-ui/core/Popover'; -import Tooltip from '@material-ui/core/Tooltip'; -import Typography from '@material-ui/core/Typography'; -import { makeStyles } from '@material-ui/core/styles'; +import { Text } from '@backstage/ui'; import webcamIcon from '../icons/webcam.svg'; import { CalendarEventPopoverContent } from './CalendarEventPopoverContent'; @@ -39,101 +29,57 @@ import { isAllDay, isPassed, } from './util'; - -const useStyles = makeStyles( - theme => ({ - event: { - display: 'flex', - alignItems: 'center', - marginBottom: theme.spacing(1), - cursor: 'pointer', - paddingRight: 12, - }, - declined: { - textDecoration: 'line-through', - }, - passed: { - opacity: 0.6, - transition: 'opacity 0.15s ease-in-out', - '&:hover': { - opacity: 1, - }, - }, - link: { - width: 48, - height: 48, - display: 'inline-block', - padding: 8, - borderRadius: '50%', - '&:hover': { - backgroundColor: theme.palette.grey[100], - }, - }, - calendarColor: { - width: 8, - borderTopLeftRadius: 4, - borderBottomLeftRadius: 4, - }, - }), - { - name: 'MicrosoftCalendarEvent', - }, -); +import styles from './CalendarEvent.module.css'; export const CalendarEvent = ({ event }: { event: MicrosoftCalendarEvent }) => { - const classes = useStyles(); - const popoverState = usePopupState({ - variant: 'popover', - popupId: event.id, - disableAutoFocus: true, - }); const [hovered, setHovered] = useState(false); + const [popoverOpen, setPopoverOpen] = useState(false); + const containerRef = useRef(null); const onlineMeetingLink = getOnlineMeetingLink(event); - const { onClick, ...restBindProps } = bindTrigger(popoverState); - return ( - <> - { - onClick(e); - }} - {...restBindProps} +
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */} +
setPopoverOpen(!popoverOpen)} onMouseEnter={() => setHovered(true)} onMouseLeave={() => setHovered(false)} - elevation={hovered ? 4 : 1} - className={classnames(classes.event, { - [classes.passed]: isPassed(event), + className={classnames(styles.event, { + [styles.passed]: isPassed(event), + [styles.hovered]: hovered, })} data-testid="microsoft-calendar-event" > - - - +
+ {event.subject} - + {!isAllDay(event) && ( - + {getTimePeriod(event)} - + )} - +
{event.isOnlineMeeting && ( - + { e.stopPropagation(); }} noTrack > - {/* we can use onlineMeetingProvider to show icon accordingly */} { alt="Online Meeting link" /> - + Join Online Meeting + )} - +
- - - - + {popoverOpen && ( + // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions +
e.stopPropagation()}> + +
+ )} + {popoverOpen && ( + // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions +
setPopoverOpen(false)} + /> + )} +
); }; diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.module.css b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.module.css new file mode 100644 index 00000000000..0e62a676bd1 --- /dev/null +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.module.css @@ -0,0 +1,43 @@ +@layer components { + .container { + display: flex; + flex-direction: column; + width: 400px; + padding: var(--bui-space-3); + gap: var(--bui-space-2); + } + + .header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: var(--bui-space-2); + } + + .headerContent { + display: flex; + flex-direction: column; + gap: var(--bui-space-1); + flex: 1; + } + + .description { + word-break: break-word; + } + + .description a { + color: var(--bui-fg-primary); + font-weight: 500; + text-decoration: underline; + } + + .divider { + height: 1px; + background-color: var(--bui-border-neutral); + margin: var(--bui-space-3) 0; + } + + .attendeeGap { + height: var(--bui-space-2); + } +} diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.tsx b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.tsx index a7ed2a38d00..ffff14d4e29 100644 --- a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.tsx +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarEventPopoverContent.tsx @@ -15,38 +15,16 @@ */ import { sortBy } from 'lodash'; import DOMPurify from 'dompurify'; +import { TooltipTrigger, Tooltip } from 'react-aria-components'; import { Link } from '@backstage/core-components'; -import Box from '@material-ui/core/Box'; -import Divider from '@material-ui/core/Divider'; -import IconButton from '@material-ui/core/IconButton'; -import Tooltip from '@material-ui/core/Tooltip'; -import Typography from '@material-ui/core/Typography'; -import { makeStyles } from '@material-ui/core/styles'; -import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; +import { ButtonIcon, Text } from '@backstage/ui'; +import { RiArrowRightSLine } from '@remixicon/react'; import { AttendeeChip } from './AttendeeChip'; import { MicrosoftCalendarEvent } from '../api'; import { getTimePeriod, getOnlineMeetingLink } from './util'; - -const useStyles = makeStyles( - theme => ({ - description: { - wordBreak: 'break-word', - '& a': { - color: theme.palette.primary.main, - fontWeight: 500, - }, - }, - divider: { - marginTop: theme.spacing(2), - marginBottom: theme.spacing(2), - }, - }), - { - name: 'MicrosoftCalendarEventPopoverContent', - }, -); +import styles from './CalendarEventPopoverContent.module.css'; type CalendarEventPopoverProps = { event: MicrosoftCalendarEvent; @@ -55,31 +33,35 @@ type CalendarEventPopoverProps = { export const CalendarEventPopoverContent = ({ event, }: CalendarEventPopoverProps) => { - const classes = useStyles(); const onlineMeetingLink = getOnlineMeetingLink(event); return ( - - - - {event.subject} - {getTimePeriod(event)} - +
+
+
+ {event.subject} + + {getTimePeriod(event)} + +
{event.webLink && ( - + {}} noTrack > - - - + } + variant="secondary" + aria-label="Open in Calendar" + /> - + Open in Calendar + )} - +
{onlineMeetingLink && ( {}} noTrack> Join Online Meeting @@ -88,9 +70,9 @@ export const CalendarEventPopoverContent = ({ {event.bodyPreview && ( <> - - +
- - - Attendees - +
+
+ + Attendees + +
{sortBy(event.attendees || [], 'emailAddress').map(user => ( ))} - +
)} - +
); }; diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarSelect.module.css b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarSelect.module.css new file mode 100644 index 00000000000..75b90ebfade --- /dev/null +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarSelect.module.css @@ -0,0 +1,37 @@ +@layer components { + .select { + width: 120px; + padding: var(--bui-space-2); + border: 1px solid var(--bui-border-neutral); + border-radius: var(--bui-radius-1); + background-color: var(--bui-bg-surface-1); + color: var(--bui-fg-primary); + font-size: inherit; + font-family: inherit; + cursor: pointer; + transition: border-color 150ms ease-in-out, + background-color 150ms ease-in-out; + } + + .select:hover:not(:disabled) { + border-color: var(--bui-border-emphasis); + } + + .select:focus { + outline: none; + border-color: var(--bui-fg-primary); + box-shadow: 0 0 0 2px rgba(var(--bui-fg-primary-rgb), 0.1); + } + + .select:disabled { + opacity: 0.5; + cursor: not-allowed; + background-color: var(--bui-bg-surface-1); + } + + .select option { + padding: var(--bui-space-2); + background-color: var(--bui-bg-surface-1); + color: var(--bui-fg-primary); + } +} diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarSelect.tsx b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarSelect.tsx index 64a6ea394f3..b8a192d863a 100644 --- a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarSelect.tsx +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/CalendarSelect.tsx @@ -14,31 +14,8 @@ * limitations under the License. */ import { sortBy } from 'lodash'; - -import Checkbox from '@material-ui/core/Checkbox'; -import FormControl from '@material-ui/core/FormControl'; -import Input from '@material-ui/core/Input'; -import ListItemText from '@material-ui/core/ListItemText'; -import MenuItem from '@material-ui/core/MenuItem'; -import Select from '@material-ui/core/Select'; -import Typography from '@material-ui/core/Typography'; -import { makeStyles } from '@material-ui/core/styles'; import { MicrosoftCalendar } from '../api'; - -const useStyles = makeStyles( - { - formControl: { - width: 120, - }, - selectedCalendars: { - textOverflow: 'ellipsis', - overflow: 'hidden', - }, - }, - { - name: 'MicrosoftCalendarSelect', - }, -); +import styles from './CalendarSelect.module.css'; type CalendarSelectProps = { disabled: boolean; @@ -53,37 +30,18 @@ export const CalendarSelect = ({ setSelectedCalendarId, calendars, }: CalendarSelectProps) => { - const classes = useStyles(); return ( - - } - renderValue={selected => { - return ( - - {calendars.find(c => c.id === selected)?.name} - - ); - }} - MenuProps={{ - PaperProps: { - style: { - width: 350, - }, - }, - }} - > - {sortBy(calendars, 'name').map(c => ( - - - - - ))} - - + ); }; diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/SignInContent.module.css b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/SignInContent.module.css new file mode 100644 index 00000000000..5eaf5ffee72 --- /dev/null +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/SignInContent.module.css @@ -0,0 +1,24 @@ +@layer components { + .container { + position: relative; + height: 100%; + width: 100%; + } + + .mockContent { + opacity: 0.3; + filter: blur(1.5px); + padding: var(--bui-space-1); + } + + .overlay { + height: 100%; + width: 100%; + display: flex; + justify-content: center; + align-items: center; + position: absolute; + left: 0; + top: 0; + } +} diff --git a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/SignInContent.tsx b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/SignInContent.tsx index b34bee62300..6c080194f33 100644 --- a/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/SignInContent.tsx +++ b/workspaces/microsoft-calendar/plugins/microsoft-calendar/src/components/SignInContent.tsx @@ -14,51 +14,30 @@ * limitations under the License. */ -import type { MouseEventHandler } from 'react'; -import Box from '@material-ui/core/Box'; -import Button from '@material-ui/core/Button'; -import { styled } from '@material-ui/core/styles'; +import { Button } from '@backstage/ui'; import { CalendarEvent } from './CalendarEvent'; import mockEvents from './eventMock.json'; import { MicrosoftCalendarEvent } from '../api'; +import styles from './SignInContent.module.css'; type Props = { - handleAuthClick: MouseEventHandler; + handleAuthClick: (e: any) => void; }; -const TransparentBox = styled(Box)({ - opacity: 0.3, - filter: 'blur(1.5px)', -}); - export const SignInContent = ({ handleAuthClick }: Props) => { return ( - - +
+
{(mockEvents as MicrosoftCalendarEvent[]).map(event => ( ))} - +
- - - - +
+
); }; diff --git a/workspaces/microsoft-calendar/yarn.lock b/workspaces/microsoft-calendar/yarn.lock index 24d618e63f2..f22e893d5fc 100644 --- a/workspaces/microsoft-calendar/yarn.lock +++ b/workspaces/microsoft-calendar/yarn.lock @@ -361,9 +361,9 @@ __metadata: "@backstage/core-plugin-api": "backstage:^" "@backstage/dev-utils": "backstage:^" "@backstage/errors": "backstage:^" - "@material-ui/core": "npm:^4.12.2" - "@material-ui/icons": "npm:^4.9.1" + "@backstage/ui": "backstage:^" "@microsoft/microsoft-graph-types": "npm:^2.25.0" + "@remixicon/react": "npm:^4.2.0" "@tanstack/react-query": "npm:^4.1.3" "@testing-library/dom": "npm:^10.0.0" "@testing-library/jest-dom": "npm:^6.0.0" @@ -376,8 +376,8 @@ __metadata: dompurify: "npm:^3.4.0" lodash: "npm:^4.17.21" luxon: "npm:^3.0.0" - material-ui-popup-state: "npm:^1.9.3" react: "npm:^16.13.1 || ^17.0.0 || ^18.0.0" + react-aria-components: "npm:^1.0.0" react-dom: "npm:^16.13.1 || ^17.0.0 || ^18.0.0" react-router-dom: "npm:6.0.0-beta.0 || ^6.3.0" react-use: "npm:^17.2.4" @@ -1473,7 +1473,7 @@ __metadata: languageName: node linkType: hard -"@backstage/ui@npm:^0.17.0": +"@backstage/ui@backstage:^::backstage=1.53.0&npm=0.17.0, @backstage/ui@npm:^0.17.0": version: 0.17.0 resolution: "@backstage/ui@npm:0.17.0" dependencies: @@ -2296,30 +2296,30 @@ __metadata: languageName: unknown linkType: soft -"@internationalized/date@npm:^3.12.0, @internationalized/date@npm:^3.12.1": - version: 3.12.1 - resolution: "@internationalized/date@npm:3.12.1" +"@internationalized/date@npm:^3.12.0, @internationalized/date@npm:^3.12.1, @internationalized/date@npm:^3.12.3": + version: 3.12.3 + resolution: "@internationalized/date@npm:3.12.3" dependencies: "@swc/helpers": "npm:^0.5.0" - checksum: 10/a8178a73e65cb86357008e39e589bf5899b47a4ebd6123d96b54e3b19aade31c136d8e5f9c48c4627110f26d857e15aa4be9e189e56386a4b26c616df4ea1795 + checksum: 10/2c4ce86ac5aec2f9f6799cd455b776ab8750238059d1ed031f866c1f7bd7799fc6f938d46a328066989e1f24f5f9c10d4bfad3b2cab45fba0ce8fbb369ef7e1e languageName: node linkType: hard -"@internationalized/number@npm:^3.6.6": - version: 3.6.6 - resolution: "@internationalized/number@npm:3.6.6" +"@internationalized/number@npm:^3.6.6, @internationalized/number@npm:^3.6.7": + version: 3.6.7 + resolution: "@internationalized/number@npm:3.6.7" dependencies: "@swc/helpers": "npm:^0.5.0" - checksum: 10/7a7c8290a91bae3c1b22ab006c036b50f041162a383446360d0dd8194aa491a370057df1b2aa2cdfbccefd335cf6f4679e14608f5c24031b6852375654fa59df + checksum: 10/bdf2a21d338789825e7ba0f2b0d7000c3dbc4a5ee2e395e7a347ee094927eb271327bf10467de17e4c23c4a51f9467aa9de7f3e568407c84487a34960c7f7fda languageName: node linkType: hard -"@internationalized/string@npm:^3.2.8": - version: 3.2.8 - resolution: "@internationalized/string@npm:3.2.8" +"@internationalized/string@npm:^3.2.10, @internationalized/string@npm:^3.2.8": + version: 3.2.10 + resolution: "@internationalized/string@npm:3.2.10" dependencies: "@swc/helpers": "npm:^0.5.0" - checksum: 10/2054baf8b2d5f32c7904b5a584e724d00ae781b3efb22c113c18d6a604f700569faf006be28929032831972272693d7dd863d324550a7385068715e3a67b8a56 + checksum: 10/98687f3a67c09e567794b5236bd43ca987fc1ffab7b0bda906276bff80ba6ebc565a722f67a57e0dcd16e617a704ce1825dca1fd60b10d12d7fc2500a8c86281 languageName: node linkType: hard @@ -2769,18 +2769,6 @@ __metadata: languageName: node linkType: hard -"@material-ui/types@npm:^6.0.1": - version: 6.0.2 - resolution: "@material-ui/types@npm:6.0.2" - peerDependencies: - "@types/react": "*" - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 10/cfdc412efcf471924a058e76601a2dcbf20924db3df34093b9329983172653f22d46fbaf9ae767a26eb9ed060f8e19571829329019019441f6801e1aae4cfdb4 - languageName: node - linkType: hard - "@material-ui/utils@npm:^4.11.3": version: 4.11.3 resolution: "@material-ui/utils@npm:4.11.3" @@ -4097,12 +4085,12 @@ __metadata: languageName: node linkType: hard -"@react-types/shared@npm:^3.34.0": - version: 3.34.0 - resolution: "@react-types/shared@npm:3.34.0" +"@react-types/shared@npm:^3.34.0, @react-types/shared@npm:^3.36.1": + version: 3.36.1 + resolution: "@react-types/shared@npm:3.36.1" peerDependencies: react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - checksum: 10/d28b0a3a3f68f94167fd7b4f474803430093b1a31f5f50cef6ddd755b923ba3af35dde40ffcc1f320926892744823a039b4a396c671f7c59aa49634811f0c43a + checksum: 10/c7b720a8f3fea7cf2a3f4f6f2194f7942fd6b4afac0e280e2edcb06d11fb40f560ba7cb50105b2167793b5e998e8f093470a971765f700032b94c3973e069ec4 languageName: node linkType: hard @@ -4122,6 +4110,15 @@ __metadata: languageName: node linkType: hard +"@remixicon/react@npm:^4.2.0": + version: 4.9.0 + resolution: "@remixicon/react@npm:4.9.0" + peerDependencies: + react: ">=18.2.0" + checksum: 10/3d8f1d86b2bb20ab5e44d15f18811e928b0886f7710eb7a1516afb9913ba72e46facec5dfee382825139d800bcbb6704c15d0c760d0f977c12257d4af8db3295 + languageName: node + linkType: hard + "@rollup/plugin-commonjs@npm:^26.0.0": version: 26.0.3 resolution: "@rollup/plugin-commonjs@npm:26.0.3" @@ -13116,21 +13113,6 @@ __metadata: languageName: node linkType: hard -"material-ui-popup-state@npm:^1.9.3": - version: 1.9.3 - resolution: "material-ui-popup-state@npm:1.9.3" - dependencies: - "@babel/runtime": "npm:^7.12.5" - "@material-ui/types": "npm:^6.0.1" - classnames: "npm:^2.2.6" - prop-types: "npm:^15.7.2" - peerDependencies: - "@material-ui/core": ^4.0.0 || ^5.0.0-beta - react: ^15.0.0 || ^16.0.0 || ^17.0.0 - checksum: 10/9b0bb7bdcf257e1bf868cb2e74e2d80208fb870ab8e29229c49a0b64f1c1cb5c8b7ba78e89fb81019c2109729d25473188d79bf99f889c8ee698020f2013d578 - languageName: node - linkType: hard - "material-ui-popup-state@npm:^5.3.6": version: 5.3.6 resolution: "material-ui-popup-state@npm:5.3.6" @@ -15978,6 +15960,24 @@ __metadata: languageName: node linkType: hard +"react-aria-components@npm:^1.0.0": + version: 1.20.0 + resolution: "react-aria-components@npm:1.20.0" + dependencies: + "@internationalized/date": "npm:^3.12.3" + "@internationalized/string": "npm:^3.2.10" + "@react-types/shared": "npm:^3.36.1" + "@swc/helpers": "npm:^0.5.0" + client-only: "npm:^0.0.1" + react-aria: "npm:3.51.0" + react-stately: "npm:3.49.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + checksum: 10/195cc87bf8b09c977ad217aa18ea2eea7c96637ece9a9ec8e3520c960161ce151df5ee7978e92d5d0b549a5ef4926c114c5deda737fec6c54f31385d10bb498a + languageName: node + linkType: hard + "react-aria-components@npm:~1.17.0": version: 1.17.0 resolution: "react-aria-components@npm:1.17.0" @@ -16015,6 +16015,26 @@ __metadata: languageName: node linkType: hard +"react-aria@npm:3.51.0": + version: 3.51.0 + resolution: "react-aria@npm:3.51.0" + dependencies: + "@internationalized/date": "npm:^3.12.3" + "@internationalized/number": "npm:^3.6.7" + "@internationalized/string": "npm:^3.2.10" + "@react-types/shared": "npm:^3.36.1" + "@swc/helpers": "npm:^0.5.0" + aria-hidden: "npm:^1.2.3" + clsx: "npm:^2.0.0" + react-stately: "npm:3.49.0" + use-sync-external-store: "npm:^1.6.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + checksum: 10/32d0e236b7689765d273960fbff6df1e75971cce0a80bf73b14a90f6ee68bfc0dcb2b5c056a69b8fe78fb79f114e52726bcc47c732f5a84f7adfbedf60b8a1ef + languageName: node + linkType: hard + "react-beautiful-dnd@npm:^13.0.0": version: 13.0.0 resolution: "react-beautiful-dnd@npm:13.0.0" @@ -16280,6 +16300,22 @@ __metadata: languageName: node linkType: hard +"react-stately@npm:3.49.0": + version: 3.49.0 + resolution: "react-stately@npm:3.49.0" + dependencies: + "@internationalized/date": "npm:^3.12.3" + "@internationalized/number": "npm:^3.6.7" + "@internationalized/string": "npm:^3.2.10" + "@react-types/shared": "npm:^3.36.1" + "@swc/helpers": "npm:^0.5.0" + use-sync-external-store: "npm:^1.6.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + checksum: 10/f8296a3ec7845a3a6544225fcaf73fe7077ac3041d043e51bd20ca0da2741bac3166df57e429154c060fe9d8df19059840893dd1a0e3006cd025a0963edd0b7c + languageName: node + linkType: hard + "react-syntax-highlighter@npm:^15.4.5": version: 15.5.0 resolution: "react-syntax-highlighter@npm:15.5.0"