@@ -1,6 +1,6 @@
|
||||
import { colorsFlattened } from '@shared/util/themeColors';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { Button } from '@views/components/common/Button/Button';
|
||||
import { Button } from '@views/components/common/Button';
|
||||
import React from 'react';
|
||||
|
||||
import AddIcon from '~icons/material-symbols/add';
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import Card from '@views/components/common/Card/Card';
|
||||
import React from 'react';
|
||||
|
||||
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
||||
const meta = {
|
||||
title: 'Components/Common/Card',
|
||||
component: Card,
|
||||
parameters: {
|
||||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
||||
layout: 'centered',
|
||||
},
|
||||
args: {
|
||||
children: <div>Hello</div>,
|
||||
},
|
||||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
||||
tags: ['autodocs'],
|
||||
} satisfies Meta<typeof Card>;
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {};
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { Chip } from '@views/components/common/Chip/Chip';
|
||||
import { Chip } from '@views/components/common/Chip';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Common/Chip',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CourseMeeting } from '@shared/types/CourseMeeting';
|
||||
import Instructor from '@shared/types/Instructor';
|
||||
import { getCourseColors } from '@shared/util/colors';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import ConflictsWithWarning from '@views/components/common/ConflictsWithWarning/ConflictsWithWarning';
|
||||
import ConflictsWithWarning from '@views/components/common/ConflictsWithWarning';
|
||||
|
||||
export const ExampleCourse: Course = new Course({
|
||||
courseName: 'ELEMS OF COMPTRS/PROGRAMMNG-WB',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Status } from '@shared/types/Course';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import CourseStatus from '@views/components/common/CourseStatus/CourseStatus';
|
||||
import CourseStatus from '@views/components/common/CourseStatus';
|
||||
import React from 'react';
|
||||
|
||||
const meta = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { Button } from '@views/components/common/Button/Button';
|
||||
import Divider from '@views/components/common/Divider/Divider';
|
||||
import { Button } from '@views/components/common/Button';
|
||||
import Divider from '@views/components/common/Divider';
|
||||
import React from 'react';
|
||||
|
||||
import AddIcon from '~icons/material-symbols/add';
|
||||
|
||||
@@ -2,10 +2,10 @@ import { UserScheduleStore } from '@shared/storage/UserScheduleStore';
|
||||
import { UserSchedule } from '@shared/types/UserSchedule';
|
||||
import { generateRandomId } from '@shared/util/random';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import List from '@views/components/common/List/List';
|
||||
import type { ScheduleDropdownProps } from '@views/components/common/ScheduleDropdown/ScheduleDropdown';
|
||||
import ScheduleDropdown from '@views/components/common/ScheduleDropdown/ScheduleDropdown';
|
||||
import ScheduleListItem from '@views/components/common/ScheduleListItem/ScheduleListItem';
|
||||
import List from '@views/components/common/List';
|
||||
import type { ScheduleDropdownProps } from '@views/components/common/ScheduleDropdown';
|
||||
import ScheduleDropdown from '@views/components/common/ScheduleDropdown';
|
||||
import ScheduleListItem from '@views/components/common/ScheduleListItem';
|
||||
import useSchedules, { getActiveSchedule, switchSchedule } from '@views/hooks/useSchedules';
|
||||
import type { Serialized } from 'chrome-extension-toolkit';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import InfoCard from '@views/components/common/InfoCard/InfoCard';
|
||||
import InfoCard from '@views/components/common/InfoCard';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Common/InfoCard',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import Link from '@views/components/common/Link/Link';
|
||||
import Link from '@views/components/common/Link';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Common/Link',
|
||||
|
||||
@@ -4,8 +4,8 @@ import { CourseMeeting } from '@shared/types/CourseMeeting';
|
||||
import Instructor from '@shared/types/Instructor';
|
||||
import { tailwindColorways } from '@shared/util/storybook';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import List from '@views/components/common/List/List';
|
||||
import PopupCourseBlock from '@views/components/common/PopupCourseBlock/PopupCourseBlock';
|
||||
import List from '@views/components/common/List';
|
||||
import PopupCourseBlock from '@views/components/common/PopupCourseBlock';
|
||||
import React from 'react';
|
||||
|
||||
const numberOfCourses = 5;
|
||||
|
||||
@@ -4,7 +4,7 @@ import Instructor from '@shared/types/Instructor';
|
||||
import { getCourseColors } from '@shared/util/colors';
|
||||
import { tailwindColorways } from '@shared/util/storybook';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import PopupCourseBlock from '@views/components/common/PopupCourseBlock/PopupCourseBlock';
|
||||
import PopupCourseBlock from '@views/components/common/PopupCourseBlock';
|
||||
import React from 'react';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { Button } from '@views/components/common/Button/Button';
|
||||
import type { PromptDialogProps } from '@views/components/common/Prompt/Prompt';
|
||||
import PromptDialog from '@views/components/common/Prompt/Prompt';
|
||||
import { Button } from '@views/components/common/Button';
|
||||
import type { PromptDialogProps } from '@views/components/common/Prompt';
|
||||
import PromptDialog from '@views/components/common/Prompt';
|
||||
import Text from '@views/components/common/Text/Text';
|
||||
import React from 'react';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import ScheduleTotalHoursAndCourses from '@views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses';
|
||||
import ScheduleTotalHoursAndCourses from '@views/components/common/ScheduleTotalHoursAndCourses';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Common/ScheduleTotalHoursAndCourses',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { UserSchedule } from '@shared/types/UserSchedule';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import ScheduleListItem from '@views/components/common/ScheduleListItem/ScheduleListItem';
|
||||
import ScheduleListItem from '@views/components/common/ScheduleListItem';
|
||||
import useSchedules from '@views/hooks/useSchedules';
|
||||
import React from 'react';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import Calendar from '@views/components/calendar/Calendar/Calendar';
|
||||
import Calendar from '@views/components/calendar/Calendar';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Calendar/Calendar',
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Course, Status } from '@shared/types/Course';
|
||||
import Instructor from '@shared/types/Instructor';
|
||||
import { getCourseColors } from '@shared/util/colors';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import CalendarBottomBar from '@views/components/calendar/CalendarBottomBar/CalendarBottomBar';
|
||||
import CalendarBottomBar from '@views/components/calendar/CalendarBottomBar';
|
||||
import React from 'react';
|
||||
|
||||
const exampleGovCourse: Course = new Course({
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
import { Course, Status } from '@shared/types/Course';
|
||||
import { CourseMeeting, DAY_MAP } from '@shared/types/CourseMeeting';
|
||||
import { CourseSchedule } from '@shared/types/CourseSchedule';
|
||||
import Instructor from '@shared/types/Instructor';
|
||||
import { getCourseColors } from '@shared/util/colors';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import CalendarCourse from '@views/components/calendar/CalendarCourseBlock/CalendarCourseMeeting';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Calendar/CalendarCourseMeeting',
|
||||
component: CalendarCourse,
|
||||
parameters: {
|
||||
layout: 'centered',
|
||||
},
|
||||
tags: ['autodocs'],
|
||||
argTypes: {
|
||||
course: { control: 'object' },
|
||||
meetingIdx: { control: 'number' },
|
||||
},
|
||||
} satisfies Meta<typeof CalendarCourse>;
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
course: new Course({
|
||||
uniqueId: 123,
|
||||
number: '311C',
|
||||
fullName: "311C - Bevo's Default Course",
|
||||
courseName: "Bevo's Default Course",
|
||||
department: 'BVO',
|
||||
creditHours: 3,
|
||||
status: Status.OPEN,
|
||||
instructors: [new Instructor({ firstName: '', lastName: 'Bevo', fullName: 'Bevo' })],
|
||||
isReserved: false,
|
||||
url: '',
|
||||
flags: [],
|
||||
schedule: new CourseSchedule({
|
||||
meetings: [
|
||||
new CourseMeeting({
|
||||
days: [DAY_MAP.M, DAY_MAP.W, DAY_MAP.F],
|
||||
startTime: 480,
|
||||
endTime: 570,
|
||||
location: {
|
||||
building: 'UTC',
|
||||
room: '123',
|
||||
},
|
||||
}),
|
||||
],
|
||||
}),
|
||||
instructionMode: 'In Person',
|
||||
semester: {
|
||||
year: 2024,
|
||||
season: 'Spring',
|
||||
},
|
||||
scrapedAt: Date.now(),
|
||||
colors: getCourseColors('emerald', 500),
|
||||
}),
|
||||
meetingIdx: 0,
|
||||
},
|
||||
};
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Status } from '@shared/types/Course';
|
||||
import { getCourseColors } from '@shared/util/colors';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import type { CalendarCourseCellProps } from '@views/components/calendar/CalendarCourseCell/CalendarCourseCell';
|
||||
import CalendarCourseCell from '@views/components/calendar/CalendarCourseCell/CalendarCourseCell';
|
||||
import type { CalendarCourseCellProps } from '@views/components/calendar/CalendarCourseCell';
|
||||
import CalendarCourseCell from '@views/components/calendar/CalendarCourseCell';
|
||||
import React from 'react';
|
||||
|
||||
import { ExampleCourse } from '../PopupCourseBlock.stories';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Status } from '@shared/types/Course';
|
||||
import { getCourseColors } from '@shared/util/colors';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import CalendarGrid from '@views/components/calendar/CalendarGrid/CalendarGrid';
|
||||
import CalendarGrid from '@views/components/calendar/CalendarGrid';
|
||||
import type { CalendarGridCourse } from '@views/hooks/useFlattenedCourseSchedule';
|
||||
|
||||
import { ExampleCourse } from '../PopupCourseBlock.stories';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Calendar.stories.tsx
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import CalendarCell from '@views/components/calendar/CalendarGridCell/CalendarGridCell';
|
||||
import CalendarCell from '@views/components/calendar/CalendarGridCell';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Calendar/CalendarGridCell',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import CalendarHeader from '@views/components/calendar/CalendarHeader/CalenderHeader';
|
||||
import CalendarHeader from '@views/components/calendar/CalenderHeader';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Calendar/CalendarHeader',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { CalendarSchedules } from '@views/components/calendar/CalendarSchedules/CalendarSchedules';
|
||||
import { CalendarSchedules } from '@views/components/calendar/CalendarSchedules';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Calendar/CalendarSchedules',
|
||||
|
||||
Reference in New Issue
Block a user