From a6359e337bc515f6a846b9712238456232e6033f Mon Sep 17 00:00:00 2001 From: Yangshun Date: Tue, 25 Jun 2024 09:39:16 +0800 Subject: [PATCH] chore: merge ui package into portal --- apps/portal/package.json | 1 - .../portal/src/components/global/AppShell.tsx | 2 +- .../components/global/MobileNavigation.tsx | 2 +- .../components/offers/admin/OffersTable.tsx | 2 +- .../offers/admin/OffersTablePagination.tsx | 2 +- .../offers/dashboard/DashboardProfileCard.tsx | 2 +- .../components/offers/forms/FormRadioList.tsx | 2 +- .../components/offers/forms/FormSection.tsx | 2 +- .../components/offers/forms/FormSelect.tsx | 2 +- .../components/offers/forms/FormTextArea.tsx | 2 +- .../components/offers/forms/FormTextInput.tsx | 2 +- .../offers/offerAnalysis/OfferAnalysis.tsx | 2 +- .../offers/offerAnalysis/OfferProfileCard.tsx | 2 +- .../offersSubmission/OffersProfileSave.tsx | 2 +- .../offersSubmission/OffersSubmissionForm.tsx | 2 +- .../submissionForm/BackgroundForm.tsx | 2 +- .../submissionForm/OfferDetailsForm.tsx | 2 +- .../offers/profile/ProfileComments.tsx | 2 +- .../offers/profile/ProfileDetails.tsx | 2 +- .../offers/profile/ProfileHeader.tsx | 2 +- .../offers/profile/comments/CommentCard.tsx | 2 +- .../components/offers/table/OffersTable.tsx | 2 +- .../offers/table/OffersTablePagination.tsx | 2 +- .../questions/ContributeQuestionDialog.tsx | 2 +- .../components/questions/CreateListDialog.tsx | 2 +- .../components/questions/DeleteListDialog.tsx | 2 +- .../questions/DiscardDraftDialog.tsx | 2 +- .../questions/FullScreenSpinner.tsx | 2 +- .../components/questions/LandingComponent.tsx | 4 +- .../questions/PaginationLoadMoreButton.tsx | 2 +- .../questions/QuestionSearchBar.tsx | 2 +- .../questions/QuestionTypeBadge.tsx | 4 +- .../questions/SortOptionsSelect.tsx | 2 +- .../card/question/BaseQuestionCard.tsx | 2 +- .../questions/filter/FilterSection.tsx | 2 +- .../forms/ContributeQuestionForm.tsx | 6 +- .../forms/CreateQuestionEncounterForm.tsx | 2 +- .../questions/layout/BackButtonLayout.tsx | 2 +- .../questions/protected/ProtectedDialog.tsx | 2 +- .../questions/typeahead/ExpandedTypeahead.tsx | 2 +- .../questions/typeahead/LocationTypeahead.tsx | 2 +- .../src/components/resumes/ResumePdf.tsx | 3 +- .../resumes/comments/ResumeCommentsForm.tsx | 2 +- .../resumes/comments/ResumeCommentsList.tsx | 2 +- .../comment/ResumeCommentDeleteForm.tsx | 2 +- .../comment/ResumeCommentEditForm.tsx | 2 +- .../comment/ResumeCommentReplyForm.tsx | 2 +- .../src/components/resumes/landing/Hero.tsx | 2 +- .../shared/ResumeExperienceTypeahead.tsx | 4 +- .../src/components/shared/CitiesTypeahead.tsx | 4 +- .../components/shared/CompaniesTypeahead.tsx | 4 +- .../components/shared/CountriesTypeahead.tsx | 4 +- .../components/shared/JobTitlesTypeahead.tsx | 4 +- .../src/components/shared/MonthYearPicker.tsx | 2 +- apps/portal/src/pages/_app.tsx | 2 +- apps/portal/src/pages/index.tsx | 2 +- apps/portal/src/pages/login.tsx | 2 +- apps/portal/src/pages/offers/admin.tsx | 2 +- apps/portal/src/pages/offers/dashboard.tsx | 2 +- apps/portal/src/pages/offers/index.tsx | 2 +- .../pages/offers/profile/[offerProfileId].tsx | 2 +- .../offers/profile/edit/[offerProfileId].tsx | 2 +- .../offers/submit/result/[offerProfileId].tsx | 2 +- .../answer/[answerId]/[answerSlug]/index.tsx | 2 +- .../[questionId]/[questionSlug]/index.tsx | 2 +- apps/portal/src/pages/questions/browse.tsx | 6 +- apps/portal/src/pages/questions/lists.tsx | 2 +- apps/portal/src/pages/resumes/[resumeId].tsx | 2 +- apps/portal/src/pages/resumes/index.tsx | 4 +- apps/portal/src/pages/resumes/submit.tsx | 4 +- apps/portal/src/pages/settings.tsx | 2 +- apps/portal/src/pages/test__.tsx | 8 +- .../portal/src/ui}/Alert/Alert.tsx | 0 .../portal/src/ui}/Badge/Badge.tsx | 0 .../portal/src/ui}/Banner/Banner.tsx | 0 .../portal/src/ui}/Button/Button.tsx | 0 .../src/ui}/CheckboxInput/CheckboxInput.tsx | 0 .../src/ui}/CheckboxList/CheckboxList.tsx | 0 .../src/ui}/Collapsible/Collapsible.tsx | 0 .../portal/src/ui}/Dialog/Dialog.tsx | 0 .../src/ui}/DropdownMenu/DropdownMenu.tsx | 0 .../src/ui}/DropdownMenu/DropdownMenuItem.tsx | 0 .../HorizontalDivider/HorizontalDivider.tsx | 0 .../portal/src/ui}/Pagination/Pagination.tsx | 0 .../portal/src/ui}/RadioList/RadioList.tsx | 0 .../src/ui}/RadioList/RadioListContext.ts | 0 .../src/ui}/RadioList/RadioListItem.tsx | 0 .../portal/src/ui}/Select/Select.tsx | 0 .../portal/src/ui}/SlideOut/SlideOut.tsx | 0 .../portal/src/ui}/Spinner/Spinner.tsx | 0 .../src => apps/portal/src/ui}/Tabs/Tabs.tsx | 0 .../portal/src/ui}/TextArea/TextArea.tsx | 0 .../portal/src/ui}/TextInput/TextInput.tsx | 0 .../portal/src/ui}/Toast/Toast.tsx | 0 .../portal/src/ui}/Toast/ToastsProvider.tsx | 0 .../portal/src/ui}/Typeahead/Typeahead.tsx | 0 .../ui/src => apps/portal/src/ui}/index.tsx | 0 .../ui/src => apps/portal/src/ui}/styles.css | 0 .../offers/currency/CurrencySelector.tsx | 2 +- .../src/utils/questions/locationSlug.ts | 2 +- .../portal/src/utils/resumes/resumeFilters.ts | 2 +- apps/storybook/.eslintrc.js | 8 - apps/storybook/.gitignore | 1 - apps/storybook/.storybook/main.js | 35 - apps/storybook/.storybook/preview.js | 6 - apps/storybook/package.json | 37 - apps/storybook/postcss.config.js | 6 - apps/storybook/stories/alert.stories.tsx | 54 - apps/storybook/stories/badge.stories.tsx | 93 - apps/storybook/stories/banner.stories.tsx | 53 - apps/storybook/stories/button.stories.tsx | 245 - .../stories/checkbox-input.stories.tsx | 99 - .../stories/checkbox-list.stories.tsx | 262 - .../storybook/stories/collapsible.stories.tsx | 46 - apps/storybook/stories/dialog.stories.tsx | 59 - .../stories/dropdown-menu.stories.tsx | 129 - .../stories/horizontal-divider.stories.tsx | 28 - apps/storybook/stories/pagination.stories.tsx | 234 - apps/storybook/stories/radio-list.stories.tsx | 256 - apps/storybook/stories/select.stories.tsx | 288 - apps/storybook/stories/slide-out.stories.tsx | 58 - apps/storybook/stories/spinner.stories.tsx | 57 - apps/storybook/stories/tabs.stories.tsx | 45 - apps/storybook/stories/text-area.stories.tsx | 168 - apps/storybook/stories/text-input.stories.tsx | 292 - apps/storybook/stories/typeahead.stories.tsx | 184 - apps/storybook/tailwind.config.js | 7 - apps/storybook/tsconfig.json | 13 - apps/storybook/vercel.json | 5 - packages/ui/.eslintrc.js | 8 - packages/ui/package.json | 45 - packages/ui/tailwind.config.js | 3 - packages/ui/tsconfig.json | 8 - pnpm-lock.yaml | 9058 ++--------------- turbo.json | 3 +- 135 files changed, 1210 insertions(+), 10865 deletions(-) rename {packages/ui/src => apps/portal/src/ui}/Alert/Alert.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Badge/Badge.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Banner/Banner.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Button/Button.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/CheckboxInput/CheckboxInput.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/CheckboxList/CheckboxList.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Collapsible/Collapsible.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Dialog/Dialog.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/DropdownMenu/DropdownMenu.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/DropdownMenu/DropdownMenuItem.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/HorizontalDivider/HorizontalDivider.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Pagination/Pagination.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/RadioList/RadioList.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/RadioList/RadioListContext.ts (100%) rename {packages/ui/src => apps/portal/src/ui}/RadioList/RadioListItem.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Select/Select.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/SlideOut/SlideOut.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Spinner/Spinner.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Tabs/Tabs.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/TextArea/TextArea.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/TextInput/TextInput.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Toast/Toast.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Toast/ToastsProvider.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/Typeahead/Typeahead.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/index.tsx (100%) rename {packages/ui/src => apps/portal/src/ui}/styles.css (100%) delete mode 100644 apps/storybook/.eslintrc.js delete mode 100644 apps/storybook/.gitignore delete mode 100644 apps/storybook/.storybook/main.js delete mode 100644 apps/storybook/.storybook/preview.js delete mode 100644 apps/storybook/package.json delete mode 100644 apps/storybook/postcss.config.js delete mode 100644 apps/storybook/stories/alert.stories.tsx delete mode 100644 apps/storybook/stories/badge.stories.tsx delete mode 100644 apps/storybook/stories/banner.stories.tsx delete mode 100644 apps/storybook/stories/button.stories.tsx delete mode 100644 apps/storybook/stories/checkbox-input.stories.tsx delete mode 100644 apps/storybook/stories/checkbox-list.stories.tsx delete mode 100644 apps/storybook/stories/collapsible.stories.tsx delete mode 100644 apps/storybook/stories/dialog.stories.tsx delete mode 100644 apps/storybook/stories/dropdown-menu.stories.tsx delete mode 100644 apps/storybook/stories/horizontal-divider.stories.tsx delete mode 100644 apps/storybook/stories/pagination.stories.tsx delete mode 100644 apps/storybook/stories/radio-list.stories.tsx delete mode 100644 apps/storybook/stories/select.stories.tsx delete mode 100644 apps/storybook/stories/slide-out.stories.tsx delete mode 100644 apps/storybook/stories/spinner.stories.tsx delete mode 100644 apps/storybook/stories/tabs.stories.tsx delete mode 100644 apps/storybook/stories/text-area.stories.tsx delete mode 100644 apps/storybook/stories/text-input.stories.tsx delete mode 100644 apps/storybook/stories/typeahead.stories.tsx delete mode 100644 apps/storybook/tailwind.config.js delete mode 100644 apps/storybook/tsconfig.json delete mode 100644 apps/storybook/vercel.json delete mode 100644 packages/ui/.eslintrc.js delete mode 100644 packages/ui/package.json delete mode 100644 packages/ui/tailwind.config.js delete mode 100644 packages/ui/tsconfig.json diff --git a/apps/portal/package.json b/apps/portal/package.json index fcb87003..83a807a6 100644 --- a/apps/portal/package.json +++ b/apps/portal/package.json @@ -22,7 +22,6 @@ "@popperjs/core": "^2.11.6", "@prisma/client": "^4.4.0", "@supabase/supabase-js": "^1.35.7", - "@tih/ui": "workspace:0.0.0", "@trpc/client": "^9.27.2", "@trpc/next": "^9.27.2", "@trpc/react": "^9.27.2", diff --git a/apps/portal/src/components/global/AppShell.tsx b/apps/portal/src/components/global/AppShell.tsx index 57f0b1ef..d524aaad 100644 --- a/apps/portal/src/components/global/AppShell.tsx +++ b/apps/portal/src/components/global/AppShell.tsx @@ -6,7 +6,7 @@ import type { ReactNode } from 'react'; import { Fragment, useState } from 'react'; import { Menu, Transition } from '@headlessui/react'; import { Bars3BottomLeftIcon } from '@heroicons/react/24/outline'; -import { Button } from '@tih/ui'; +import { Button } from '~/ui'; import GlobalNavigation from '~/components/global/GlobalNavigation'; import HomeNavigation from '~/components/global/HomeNavigation'; diff --git a/apps/portal/src/components/global/MobileNavigation.tsx b/apps/portal/src/components/global/MobileNavigation.tsx index af13aab9..1acb3f78 100644 --- a/apps/portal/src/components/global/MobileNavigation.tsx +++ b/apps/portal/src/components/global/MobileNavigation.tsx @@ -3,7 +3,7 @@ import Link from 'next/link'; import { Fragment } from 'react'; import { Dialog, Transition } from '@headlessui/react'; import { XMarkIcon } from '@heroicons/react/24/outline'; -import { HorizontalDivider } from '@tih/ui'; +import { HorizontalDivider } from '~/ui'; import type { GlobalNavigationItems } from './GlobalNavigation'; import type { ProductNavigationItems } from './ProductNavigation'; diff --git a/apps/portal/src/components/offers/admin/OffersTable.tsx b/apps/portal/src/components/offers/admin/OffersTable.tsx index 4058907c..b6078862 100644 --- a/apps/portal/src/components/offers/admin/OffersTable.tsx +++ b/apps/portal/src/components/offers/admin/OffersTable.tsx @@ -1,7 +1,7 @@ import { useRouter } from 'next/router'; import { useEffect, useMemo, useRef, useState } from 'react'; import { JobType } from '@prisma/client'; -import { DropdownMenu, Spinner, useToast } from '@tih/ui'; +import { DropdownMenu, Spinner, useToast } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import OffersHeader from '~/components/offers/admin/OffersHeader'; diff --git a/apps/portal/src/components/offers/admin/OffersTablePagination.tsx b/apps/portal/src/components/offers/admin/OffersTablePagination.tsx index fd227cfa..7ebf9fb7 100644 --- a/apps/portal/src/components/offers/admin/OffersTablePagination.tsx +++ b/apps/portal/src/components/offers/admin/OffersTablePagination.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react'; -import { Pagination, Spinner } from '@tih/ui'; +import { Pagination, Spinner } from '~/ui'; import type { Paging } from '~/types/offers'; diff --git a/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx b/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx index a4e82b69..46a42305 100644 --- a/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx +++ b/apps/portal/src/components/offers/dashboard/DashboardProfileCard.tsx @@ -1,7 +1,7 @@ import { useRouter } from 'next/router'; import { BookmarkSlashIcon } from '@heroicons/react/20/solid'; import { ArrowRightIcon } from '@heroicons/react/24/outline'; -import { Button, useToast } from '@tih/ui'; +import { Button, useToast } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import DashboardOfferCard from '~/components/offers/dashboard/DashboardOfferCard'; diff --git a/apps/portal/src/components/offers/forms/FormRadioList.tsx b/apps/portal/src/components/offers/forms/FormRadioList.tsx index 5fbbd53d..2965b56f 100644 --- a/apps/portal/src/components/offers/forms/FormRadioList.tsx +++ b/apps/portal/src/components/offers/forms/FormRadioList.tsx @@ -1,6 +1,6 @@ import type { ComponentProps } from 'react'; import { useFormContext } from 'react-hook-form'; -import { RadioList } from '@tih/ui'; +import { RadioList } from '~/ui'; type RadioListProps = ComponentProps; diff --git a/apps/portal/src/components/offers/forms/FormSection.tsx b/apps/portal/src/components/offers/forms/FormSection.tsx index e83b8c70..9fbfda34 100644 --- a/apps/portal/src/components/offers/forms/FormSection.tsx +++ b/apps/portal/src/components/offers/forms/FormSection.tsx @@ -1,4 +1,4 @@ -import { HorizontalDivider } from '@tih/ui'; +import { HorizontalDivider } from '~/ui'; export default function FormSection({ children, diff --git a/apps/portal/src/components/offers/forms/FormSelect.tsx b/apps/portal/src/components/offers/forms/FormSelect.tsx index c12d0f07..2c2e9eb2 100644 --- a/apps/portal/src/components/offers/forms/FormSelect.tsx +++ b/apps/portal/src/components/offers/forms/FormSelect.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, ForwardedRef } from 'react'; import { forwardRef } from 'react'; import { useFormContext } from 'react-hook-form'; -import { Select } from '@tih/ui'; +import { Select } from '~/ui'; type SelectProps = ComponentProps; diff --git a/apps/portal/src/components/offers/forms/FormTextArea.tsx b/apps/portal/src/components/offers/forms/FormTextArea.tsx index 20f606cf..c0d66dd7 100644 --- a/apps/portal/src/components/offers/forms/FormTextArea.tsx +++ b/apps/portal/src/components/offers/forms/FormTextArea.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, ForwardedRef } from 'react'; import { forwardRef } from 'react'; import type { UseFormRegisterReturn } from 'react-hook-form'; -import { TextArea } from '@tih/ui'; +import { TextArea } from '~/ui'; type TextAreaProps = ComponentProps; diff --git a/apps/portal/src/components/offers/forms/FormTextInput.tsx b/apps/portal/src/components/offers/forms/FormTextInput.tsx index 88e817ec..a5646faf 100644 --- a/apps/portal/src/components/offers/forms/FormTextInput.tsx +++ b/apps/portal/src/components/offers/forms/FormTextInput.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, ForwardedRef } from 'react'; import { forwardRef } from 'react'; import type { UseFormRegisterReturn } from 'react-hook-form'; -import { TextInput } from '@tih/ui'; +import { TextInput } from '~/ui'; type TextInputProps = ComponentProps; diff --git a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx index 4da33d3b..e6706427 100644 --- a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx +++ b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx @@ -2,7 +2,7 @@ import { useEffect } from 'react'; import { useState } from 'react'; import { ArrowUpRightIcon } from '@heroicons/react/24/outline'; import { JobType } from '@prisma/client'; -import { Alert, Button, HorizontalDivider, Spinner, Tabs } from '@tih/ui'; +import { Alert, Button, HorizontalDivider, Spinner, Tabs } from '~/ui'; import OfferPercentileAnalysisText from './OfferPercentileAnalysisText'; import OfferProfileCard from './OfferProfileCard'; diff --git a/apps/portal/src/components/offers/offerAnalysis/OfferProfileCard.tsx b/apps/portal/src/components/offers/offerAnalysis/OfferProfileCard.tsx index 73a1f2c3..790772c3 100644 --- a/apps/portal/src/components/offers/offerAnalysis/OfferProfileCard.tsx +++ b/apps/portal/src/components/offers/offerAnalysis/OfferProfileCard.tsx @@ -14,7 +14,7 @@ import CompanyProfileImage from '~/components/shared/CompanyProfileImage'; import type { JobTitleType } from '~/components/shared/JobTitles'; import { getLabelForJobTitleType } from '~/components/shared/JobTitles'; -import { Button } from '~/../../../packages/ui/dist'; +import { Button } from '~/ui'; import { convertMoneyToString } from '~/utils/offers/currency'; import { formatDate } from '~/utils/offers/time'; diff --git a/apps/portal/src/components/offers/offersSubmission/OffersProfileSave.tsx b/apps/portal/src/components/offers/offersSubmission/OffersProfileSave.tsx index 513d0de7..0d56f9a5 100644 --- a/apps/portal/src/components/offers/offersSubmission/OffersProfileSave.tsx +++ b/apps/portal/src/components/offers/offersSubmission/OffersProfileSave.tsx @@ -3,7 +3,7 @@ import type { UseQueryResult } from 'react-query'; import { DocumentDuplicateIcon } from '@heroicons/react/20/solid'; import { BookmarkIcon as BookmarkOutlineIcon } from '@heroicons/react/24/outline'; import { BookmarkIcon as BookmarkSolidIcon } from '@heroicons/react/24/solid'; -import { Button, TextInput, useToast } from '@tih/ui'; +import { Button, TextInput, useToast } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; diff --git a/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx b/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx index ca3beed3..7ec2a48b 100644 --- a/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx +++ b/apps/portal/src/components/offers/offersSubmission/OffersSubmissionForm.tsx @@ -4,7 +4,7 @@ import type { SubmitHandler } from 'react-hook-form'; import { FormProvider, useForm } from 'react-hook-form'; import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/20/solid'; import { JobType } from '@prisma/client'; -import { Button, Spinner, useToast } from '@tih/ui'; +import { Button, Spinner, useToast } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import type { BreadcrumbStep } from '~/components/offers/Breadcrumbs'; diff --git a/apps/portal/src/components/offers/offersSubmission/submissionForm/BackgroundForm.tsx b/apps/portal/src/components/offers/offersSubmission/submissionForm/BackgroundForm.tsx index 2b9f3a4c..1303e93b 100644 --- a/apps/portal/src/components/offers/offersSubmission/submissionForm/BackgroundForm.tsx +++ b/apps/portal/src/components/offers/offersSubmission/submissionForm/BackgroundForm.tsx @@ -1,6 +1,6 @@ import { useFormContext, useWatch } from 'react-hook-form'; import { JobType } from '@prisma/client'; -import { Collapsible, RadioList } from '@tih/ui'; +import { Collapsible, RadioList } from '~/ui'; import { FieldError } from '~/components/offers/constants'; import type { BackgroundPostData } from '~/components/offers/types'; diff --git a/apps/portal/src/components/offers/offersSubmission/submissionForm/OfferDetailsForm.tsx b/apps/portal/src/components/offers/offersSubmission/submissionForm/OfferDetailsForm.tsx index 859526da..9d4f3fe0 100644 --- a/apps/portal/src/components/offers/offersSubmission/submissionForm/OfferDetailsForm.tsx +++ b/apps/portal/src/components/offers/offersSubmission/submissionForm/OfferDetailsForm.tsx @@ -11,7 +11,7 @@ import { useFieldArray } from 'react-hook-form'; import { PlusIcon } from '@heroicons/react/20/solid'; import { TrashIcon } from '@heroicons/react/24/outline'; import { JobType } from '@prisma/client'; -import { Button, Dialog, HorizontalDivider } from '@tih/ui'; +import { Button, Dialog, HorizontalDivider } from '~/ui'; import { defaultFullTimeOfferValues, diff --git a/apps/portal/src/components/offers/profile/ProfileComments.tsx b/apps/portal/src/components/offers/profile/ProfileComments.tsx index 326ca3e1..ef001314 100644 --- a/apps/portal/src/components/offers/profile/ProfileComments.tsx +++ b/apps/portal/src/components/offers/profile/ProfileComments.tsx @@ -1,7 +1,7 @@ import { signIn, useSession } from 'next-auth/react'; import { useState } from 'react'; import { ClipboardDocumentIcon, ShareIcon } from '@heroicons/react/24/outline'; -import { Button, Spinner, TextArea, useToast } from '@tih/ui'; +import { Button, Spinner, TextArea, useToast } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import ExpandableCommentCard from '~/components/offers/profile/comments/ExpandableCommentCard'; diff --git a/apps/portal/src/components/offers/profile/ProfileDetails.tsx b/apps/portal/src/components/offers/profile/ProfileDetails.tsx index ccf28f3e..f492d375 100644 --- a/apps/portal/src/components/offers/profile/ProfileDetails.tsx +++ b/apps/portal/src/components/offers/profile/ProfileDetails.tsx @@ -4,7 +4,7 @@ import { ArrowPathIcon, BriefcaseIcon, } from '@heroicons/react/24/outline'; -import { Button, Spinner } from '@tih/ui'; +import { Button, Spinner } from '~/ui'; import EducationCard from '~/components/offers/profile/EducationCard'; import OfferCard from '~/components/offers/profile/OfferCard'; diff --git a/apps/portal/src/components/offers/profile/ProfileHeader.tsx b/apps/portal/src/components/offers/profile/ProfileHeader.tsx index 03ffd68b..e515111f 100644 --- a/apps/portal/src/components/offers/profile/ProfileHeader.tsx +++ b/apps/portal/src/components/offers/profile/ProfileHeader.tsx @@ -9,7 +9,7 @@ import { TrashIcon, } from '@heroicons/react/24/outline'; import { BookmarkIcon as BookmarkIconSolid } from '@heroicons/react/24/solid'; -import { Button, Dialog, Spinner, Tabs, useToast } from '@tih/ui'; +import { Button, Dialog, Spinner, Tabs, useToast } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import type { ProfileDetailTab } from '~/components/offers/constants'; diff --git a/apps/portal/src/components/offers/profile/comments/CommentCard.tsx b/apps/portal/src/components/offers/profile/comments/CommentCard.tsx index 2b1022ba..68327004 100644 --- a/apps/portal/src/components/offers/profile/comments/CommentCard.tsx +++ b/apps/portal/src/components/offers/profile/comments/CommentCard.tsx @@ -1,7 +1,7 @@ import { formatDistanceToNow } from 'date-fns'; import { signIn, useSession } from 'next-auth/react'; import { useState } from 'react'; -import { Button, Dialog, TextArea, useToast } from '@tih/ui'; +import { Button, Dialog, TextArea, useToast } from '~/ui'; import ProfilePhotoHolder from '~/components/offers/profile/ProfilePhotoHolder'; diff --git a/apps/portal/src/components/offers/table/OffersTable.tsx b/apps/portal/src/components/offers/table/OffersTable.tsx index e95b399c..e70ce39a 100644 --- a/apps/portal/src/components/offers/table/OffersTable.tsx +++ b/apps/portal/src/components/offers/table/OffersTable.tsx @@ -1,7 +1,7 @@ import { useRouter } from 'next/router'; import { useEffect, useMemo, useRef, useState } from 'react'; import { JobType } from '@prisma/client'; -import { DropdownMenu, Spinner, useToast } from '@tih/ui'; +import { DropdownMenu, Spinner, useToast } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import OffersRow from '~/components/offers/table//OffersRow'; diff --git a/apps/portal/src/components/offers/table/OffersTablePagination.tsx b/apps/portal/src/components/offers/table/OffersTablePagination.tsx index fd227cfa..7ebf9fb7 100644 --- a/apps/portal/src/components/offers/table/OffersTablePagination.tsx +++ b/apps/portal/src/components/offers/table/OffersTablePagination.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react'; -import { Pagination, Spinner } from '@tih/ui'; +import { Pagination, Spinner } from '~/ui'; import type { Paging } from '~/types/offers'; diff --git a/apps/portal/src/components/questions/ContributeQuestionDialog.tsx b/apps/portal/src/components/questions/ContributeQuestionDialog.tsx index 8e481632..9031cf8f 100644 --- a/apps/portal/src/components/questions/ContributeQuestionDialog.tsx +++ b/apps/portal/src/components/questions/ContributeQuestionDialog.tsx @@ -1,6 +1,6 @@ import { Fragment, useState } from 'react'; import { Dialog, Transition } from '@headlessui/react'; -import { HorizontalDivider, useToast } from '@tih/ui'; +import { HorizontalDivider, useToast } from '~/ui'; import DiscardDraftDialog from './DiscardDraftDialog'; import type { ContributeQuestionFormProps } from './forms/ContributeQuestionForm'; diff --git a/apps/portal/src/components/questions/CreateListDialog.tsx b/apps/portal/src/components/questions/CreateListDialog.tsx index bd14174a..7fcd54dd 100644 --- a/apps/portal/src/components/questions/CreateListDialog.tsx +++ b/apps/portal/src/components/questions/CreateListDialog.tsx @@ -1,5 +1,5 @@ import { useForm } from 'react-hook-form'; -import { Button, Dialog, TextInput } from '@tih/ui'; +import { Button, Dialog, TextInput } from '~/ui'; import { useFormRegister } from '~/utils/questions/useFormRegister'; diff --git a/apps/portal/src/components/questions/DeleteListDialog.tsx b/apps/portal/src/components/questions/DeleteListDialog.tsx index 3da568d2..0eff26c9 100644 --- a/apps/portal/src/components/questions/DeleteListDialog.tsx +++ b/apps/portal/src/components/questions/DeleteListDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Dialog } from '@tih/ui'; +import { Button, Dialog } from '~/ui'; export type DeleteListDialogProps = { onCancel: () => void; diff --git a/apps/portal/src/components/questions/DiscardDraftDialog.tsx b/apps/portal/src/components/questions/DiscardDraftDialog.tsx index 85b56c4d..e781f06c 100644 --- a/apps/portal/src/components/questions/DiscardDraftDialog.tsx +++ b/apps/portal/src/components/questions/DiscardDraftDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Dialog } from '@tih/ui'; +import { Button, Dialog } from '~/ui'; export type DiscardDraftDialogProps = { onCancel: () => void; diff --git a/apps/portal/src/components/questions/FullScreenSpinner.tsx b/apps/portal/src/components/questions/FullScreenSpinner.tsx index 02e6e02f..b7a23cad 100644 --- a/apps/portal/src/components/questions/FullScreenSpinner.tsx +++ b/apps/portal/src/components/questions/FullScreenSpinner.tsx @@ -1,4 +1,4 @@ -import { Spinner } from '@tih/ui'; +import { Spinner } from '~/ui'; export default function FullScreenSpinner() { return ( diff --git a/apps/portal/src/components/questions/LandingComponent.tsx b/apps/portal/src/components/questions/LandingComponent.tsx index 07dacd04..3d98612b 100644 --- a/apps/portal/src/components/questions/LandingComponent.tsx +++ b/apps/portal/src/components/questions/LandingComponent.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from 'react'; import { ArrowSmallRightIcon } from '@heroicons/react/24/outline'; import type { QuestionsQuestionType } from '@prisma/client'; -import type { TypeaheadOption } from '@tih/ui'; -import { Button, Select } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; +import { Button, Select } from '~/ui'; import Container from '~/components/shared/Container'; diff --git a/apps/portal/src/components/questions/PaginationLoadMoreButton.tsx b/apps/portal/src/components/questions/PaginationLoadMoreButton.tsx index e54f540f..341919d7 100644 --- a/apps/portal/src/components/questions/PaginationLoadMoreButton.tsx +++ b/apps/portal/src/components/questions/PaginationLoadMoreButton.tsx @@ -1,5 +1,5 @@ import type { UseInfiniteQueryResult } from 'react-query'; -import { Button } from '@tih/ui'; +import { Button } from '~/ui'; export type PaginationLoadMoreButtonProps = { query: UseInfiniteQueryResult; diff --git a/apps/portal/src/components/questions/QuestionSearchBar.tsx b/apps/portal/src/components/questions/QuestionSearchBar.tsx index bfd378ad..ea9e3d26 100644 --- a/apps/portal/src/components/questions/QuestionSearchBar.tsx +++ b/apps/portal/src/components/questions/QuestionSearchBar.tsx @@ -2,7 +2,7 @@ import { AdjustmentsHorizontalIcon, MagnifyingGlassIcon, } from '@heroicons/react/24/outline'; -import { Button, Tabs, TextInput } from '@tih/ui'; +import { Button, Tabs, TextInput } from '~/ui'; import { SORT_ORDERS } from '~/utils/questions/constants'; diff --git a/apps/portal/src/components/questions/QuestionTypeBadge.tsx b/apps/portal/src/components/questions/QuestionTypeBadge.tsx index 2f40467d..86a560f0 100644 --- a/apps/portal/src/components/questions/QuestionTypeBadge.tsx +++ b/apps/portal/src/components/questions/QuestionTypeBadge.tsx @@ -6,8 +6,8 @@ import { WrenchIcon, } from '@heroicons/react/20/solid'; import type { QuestionsQuestionType } from '@prisma/client'; -import type { BadgeVariant } from '@tih/ui'; -import { Badge } from '@tih/ui'; +import type { BadgeVariant } from '~/ui'; +import { Badge } from '~/ui'; import { QUESTION_TYPES } from '~/utils/questions/constants'; diff --git a/apps/portal/src/components/questions/SortOptionsSelect.tsx b/apps/portal/src/components/questions/SortOptionsSelect.tsx index f9e8fa5a..ff934d33 100644 --- a/apps/portal/src/components/questions/SortOptionsSelect.tsx +++ b/apps/portal/src/components/questions/SortOptionsSelect.tsx @@ -1,4 +1,4 @@ -import { Select } from '~/../../../packages/ui/dist'; +import { Select } from '~/ui'; import { SORT_ORDERS, SORT_TYPES } from '~/utils/questions/constants'; import type { SortOrder, SortType } from '~/types/questions.d'; diff --git a/apps/portal/src/components/questions/card/question/BaseQuestionCard.tsx b/apps/portal/src/components/questions/card/question/BaseQuestionCard.tsx index 4de12f7a..a1bde796 100644 --- a/apps/portal/src/components/questions/card/question/BaseQuestionCard.tsx +++ b/apps/portal/src/components/questions/card/question/BaseQuestionCard.tsx @@ -13,7 +13,7 @@ import { TrashIcon, } from '@heroicons/react/24/outline'; import type { QuestionsQuestionType } from '@prisma/client'; -import { Button } from '@tih/ui'; +import { Button } from '~/ui'; import { useProtectedCallback } from '~/utils/questions/useProtectedCallback'; import { useQuestionVote } from '~/utils/questions/vote/useQuestionVote'; diff --git a/apps/portal/src/components/questions/filter/FilterSection.tsx b/apps/portal/src/components/questions/filter/FilterSection.tsx index 20324718..70f78821 100644 --- a/apps/portal/src/components/questions/filter/FilterSection.tsx +++ b/apps/portal/src/components/questions/filter/FilterSection.tsx @@ -1,7 +1,7 @@ import { useMemo } from 'react'; import type { UseFormRegisterReturn } from 'react-hook-form'; import { useForm } from 'react-hook-form'; -import { CheckboxInput, CheckboxList, Collapsible, RadioList } from '@tih/ui'; +import { CheckboxInput, CheckboxList, Collapsible, RadioList } from '~/ui'; export type FilterChoice = { id: string; diff --git a/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx b/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx index c1d4c111..ac85d3a6 100644 --- a/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx +++ b/apps/portal/src/components/questions/forms/ContributeQuestionForm.tsx @@ -3,9 +3,9 @@ import { useEffect, useState } from 'react'; import { Controller, useForm } from 'react-hook-form'; import { ArrowPathIcon } from '@heroicons/react/20/solid'; import type { QuestionsQuestionType } from '@prisma/client'; -import type { TypeaheadOption } from '@tih/ui'; -import { CheckboxInput } from '@tih/ui'; -import { Button, Select, TextArea } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; +import { CheckboxInput } from '~/ui'; +import { Button, Select, TextArea } from '~/ui'; import { QUESTION_TYPES } from '~/utils/questions/constants'; import relabelQuestionAggregates from '~/utils/questions/relabelQuestionAggregates'; diff --git a/apps/portal/src/components/questions/forms/CreateQuestionEncounterForm.tsx b/apps/portal/src/components/questions/forms/CreateQuestionEncounterForm.tsx index b230606a..9de11d55 100644 --- a/apps/portal/src/components/questions/forms/CreateQuestionEncounterForm.tsx +++ b/apps/portal/src/components/questions/forms/CreateQuestionEncounterForm.tsx @@ -1,7 +1,7 @@ import { startOfMonth } from 'date-fns'; import { useState } from 'react'; import { CheckIcon } from '@heroicons/react/20/solid'; -import { Button } from '@tih/ui'; +import { Button } from '~/ui'; import type { Month } from '~/components/shared/MonthYearPicker'; import MonthYearPicker from '~/components/shared/MonthYearPicker'; diff --git a/apps/portal/src/components/questions/layout/BackButtonLayout.tsx b/apps/portal/src/components/questions/layout/BackButtonLayout.tsx index f87f83e6..f0fdf705 100644 --- a/apps/portal/src/components/questions/layout/BackButtonLayout.tsx +++ b/apps/portal/src/components/questions/layout/BackButtonLayout.tsx @@ -1,6 +1,6 @@ import type { PropsWithChildren } from 'react'; import { ArrowSmallLeftIcon } from '@heroicons/react/24/outline'; -import { Button } from '@tih/ui'; +import { Button } from '~/ui'; import Container from '~/components/shared/Container'; diff --git a/apps/portal/src/components/questions/protected/ProtectedDialog.tsx b/apps/portal/src/components/questions/protected/ProtectedDialog.tsx index 98e5ed62..0c1301f5 100644 --- a/apps/portal/src/components/questions/protected/ProtectedDialog.tsx +++ b/apps/portal/src/components/questions/protected/ProtectedDialog.tsx @@ -1,5 +1,5 @@ import { signIn } from 'next-auth/react'; -import { Button, Dialog } from '@tih/ui'; +import { Button, Dialog } from '~/ui'; export type ProtectedDialogProps = { onClose: () => void; diff --git a/apps/portal/src/components/questions/typeahead/ExpandedTypeahead.tsx b/apps/portal/src/components/questions/typeahead/ExpandedTypeahead.tsx index 7d56ea20..b3cec26a 100644 --- a/apps/portal/src/components/questions/typeahead/ExpandedTypeahead.tsx +++ b/apps/portal/src/components/questions/typeahead/ExpandedTypeahead.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import { useState } from 'react'; import { useMemo } from 'react'; -import { Button, Typeahead } from '@tih/ui'; +import { Button, Typeahead } from '~/ui'; import type { RequireAllOrNone } from '~/utils/questions/RequireAllOrNone'; diff --git a/apps/portal/src/components/questions/typeahead/LocationTypeahead.tsx b/apps/portal/src/components/questions/typeahead/LocationTypeahead.tsx index a224b9a3..b0b0eab6 100644 --- a/apps/portal/src/components/questions/typeahead/LocationTypeahead.tsx +++ b/apps/portal/src/components/questions/typeahead/LocationTypeahead.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import type { TypeaheadOption } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; import useLocationOptions from '~/utils/questions/useLocationOptions'; diff --git a/apps/portal/src/components/resumes/ResumePdf.tsx b/apps/portal/src/components/resumes/ResumePdf.tsx index f06effef..886508e6 100644 --- a/apps/portal/src/components/resumes/ResumePdf.tsx +++ b/apps/portal/src/components/resumes/ResumePdf.tsx @@ -5,7 +5,8 @@ import { MagnifyingGlassMinusIcon, MagnifyingGlassPlusIcon, } from '@heroicons/react/20/solid'; -import { Button, Pagination, Spinner } from '@tih/ui'; + +import { Button, Pagination, Spinner } from '~/ui'; pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.js`; diff --git a/apps/portal/src/components/resumes/comments/ResumeCommentsForm.tsx b/apps/portal/src/components/resumes/comments/ResumeCommentsForm.tsx index 3a12a41f..42f41796 100644 --- a/apps/portal/src/components/resumes/comments/ResumeCommentsForm.tsx +++ b/apps/portal/src/components/resumes/comments/ResumeCommentsForm.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import type { SubmitHandler } from 'react-hook-form'; import { useForm } from 'react-hook-form'; -import { Button, Dialog, TextArea } from '@tih/ui'; +import { Button, Dialog, TextArea } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; diff --git a/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx b/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx index 0cc910a4..bd01d85b 100644 --- a/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx +++ b/apps/portal/src/components/resumes/comments/ResumeCommentsList.tsx @@ -8,7 +8,7 @@ import { SparklesIcon, } from '@heroicons/react/24/outline'; import { ResumesSection } from '@prisma/client'; -import { Spinner } from '@tih/ui'; +import { Spinner } from '~/ui'; import { trpc } from '~/utils/trpc'; diff --git a/apps/portal/src/components/resumes/comments/comment/ResumeCommentDeleteForm.tsx b/apps/portal/src/components/resumes/comments/comment/ResumeCommentDeleteForm.tsx index 25f6444e..269b7580 100644 --- a/apps/portal/src/components/resumes/comments/comment/ResumeCommentDeleteForm.tsx +++ b/apps/portal/src/components/resumes/comments/comment/ResumeCommentDeleteForm.tsx @@ -1,4 +1,4 @@ -import { Button, Dialog } from '@tih/ui'; +import { Button, Dialog } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; diff --git a/apps/portal/src/components/resumes/comments/comment/ResumeCommentEditForm.tsx b/apps/portal/src/components/resumes/comments/comment/ResumeCommentEditForm.tsx index ddfdb5df..6460b5b0 100644 --- a/apps/portal/src/components/resumes/comments/comment/ResumeCommentEditForm.tsx +++ b/apps/portal/src/components/resumes/comments/comment/ResumeCommentEditForm.tsx @@ -1,6 +1,6 @@ import type { SubmitHandler } from 'react-hook-form'; import { useForm } from 'react-hook-form'; -import { Button, TextArea } from '@tih/ui'; +import { Button, TextArea } from '~/ui'; import { trpc } from '~/utils/trpc'; diff --git a/apps/portal/src/components/resumes/comments/comment/ResumeCommentReplyForm.tsx b/apps/portal/src/components/resumes/comments/comment/ResumeCommentReplyForm.tsx index 7d549f59..2a0324d8 100644 --- a/apps/portal/src/components/resumes/comments/comment/ResumeCommentReplyForm.tsx +++ b/apps/portal/src/components/resumes/comments/comment/ResumeCommentReplyForm.tsx @@ -1,7 +1,7 @@ import type { SubmitHandler } from 'react-hook-form'; import { useForm } from 'react-hook-form'; import type { ResumesSection } from '@prisma/client'; -import { Button, TextArea } from '@tih/ui'; +import { Button, TextArea } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; diff --git a/apps/portal/src/components/resumes/landing/Hero.tsx b/apps/portal/src/components/resumes/landing/Hero.tsx index c0adecbe..b751f639 100644 --- a/apps/portal/src/components/resumes/landing/Hero.tsx +++ b/apps/portal/src/components/resumes/landing/Hero.tsx @@ -1,4 +1,4 @@ -import { Button } from '@tih/ui'; +import { Button } from '~/ui'; import { Container } from './Container'; diff --git a/apps/portal/src/components/resumes/shared/ResumeExperienceTypeahead.tsx b/apps/portal/src/components/resumes/shared/ResumeExperienceTypeahead.tsx index f343665c..09a3d477 100644 --- a/apps/portal/src/components/resumes/shared/ResumeExperienceTypeahead.tsx +++ b/apps/portal/src/components/resumes/shared/ResumeExperienceTypeahead.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import { useState } from 'react'; -import type { TypeaheadOption } from '@tih/ui'; -import { Typeahead } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; +import { Typeahead } from '~/ui'; import { EXPERIENCES } from '~/utils/resumes/resumeFilters'; diff --git a/apps/portal/src/components/shared/CitiesTypeahead.tsx b/apps/portal/src/components/shared/CitiesTypeahead.tsx index 12812a7a..a876e0cf 100644 --- a/apps/portal/src/components/shared/CitiesTypeahead.tsx +++ b/apps/portal/src/components/shared/CitiesTypeahead.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import { useState } from 'react'; -import type { TypeaheadOption } from '@tih/ui'; -import { Typeahead } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; +import { Typeahead } from '~/ui'; import { trpc } from '~/utils/trpc'; diff --git a/apps/portal/src/components/shared/CompaniesTypeahead.tsx b/apps/portal/src/components/shared/CompaniesTypeahead.tsx index 07d61669..0323bca6 100644 --- a/apps/portal/src/components/shared/CompaniesTypeahead.tsx +++ b/apps/portal/src/components/shared/CompaniesTypeahead.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import { useState } from 'react'; -import type { TypeaheadOption } from '@tih/ui'; -import { Typeahead } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; +import { Typeahead } from '~/ui'; import useCompanyOptions from '~/utils/shared/useCompanyOptions'; diff --git a/apps/portal/src/components/shared/CountriesTypeahead.tsx b/apps/portal/src/components/shared/CountriesTypeahead.tsx index 2f4bb2a0..a3e492fd 100644 --- a/apps/portal/src/components/shared/CountriesTypeahead.tsx +++ b/apps/portal/src/components/shared/CountriesTypeahead.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import { useState } from 'react'; -import type { TypeaheadOption } from '@tih/ui'; -import { Typeahead } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; +import { Typeahead } from '~/ui'; import useCountryOptions from '~/utils/shared/useCountryOptions'; diff --git a/apps/portal/src/components/shared/JobTitlesTypeahead.tsx b/apps/portal/src/components/shared/JobTitlesTypeahead.tsx index 131db3d0..6b2d3139 100644 --- a/apps/portal/src/components/shared/JobTitlesTypeahead.tsx +++ b/apps/portal/src/components/shared/JobTitlesTypeahead.tsx @@ -1,7 +1,7 @@ import type { ComponentProps } from 'react'; import { useState } from 'react'; -import type { TypeaheadOption } from '@tih/ui'; -import { Typeahead } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; +import { Typeahead } from '~/ui'; import useJobTitleOptions from '~/utils/shared/useJobTitleOptions'; diff --git a/apps/portal/src/components/shared/MonthYearPicker.tsx b/apps/portal/src/components/shared/MonthYearPicker.tsx index 0612455c..463a41bf 100644 --- a/apps/portal/src/components/shared/MonthYearPicker.tsx +++ b/apps/portal/src/components/shared/MonthYearPicker.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx'; import { useEffect, useId, useState } from 'react'; -import { Select } from '@tih/ui'; +import { Select } from '~/ui'; export type Month = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; diff --git a/apps/portal/src/pages/_app.tsx b/apps/portal/src/pages/_app.tsx index 565a48f6..f1fbd1ff 100644 --- a/apps/portal/src/pages/_app.tsx +++ b/apps/portal/src/pages/_app.tsx @@ -3,7 +3,7 @@ import type { Session } from 'next-auth'; import { SessionProvider } from 'next-auth/react'; import React from 'react'; import superjson from 'superjson'; -import { ToastsProvider } from '@tih/ui'; +import { ToastsProvider } from '~/ui'; import { httpBatchLink } from '@trpc/client/links/httpBatchLink'; import { loggerLink } from '@trpc/client/links/loggerLink'; import { withTRPC } from '@trpc/next'; diff --git a/apps/portal/src/pages/index.tsx b/apps/portal/src/pages/index.tsx index ceb83050..e3e3e927 100644 --- a/apps/portal/src/pages/index.tsx +++ b/apps/portal/src/pages/index.tsx @@ -1,5 +1,5 @@ import Head from 'next/head'; -import { Button } from '@tih/ui'; +import { Button } from '~/ui'; import Container from '~/components/shared/Container'; diff --git a/apps/portal/src/pages/login.tsx b/apps/portal/src/pages/login.tsx index 113eb891..37fc6c0e 100644 --- a/apps/portal/src/pages/login.tsx +++ b/apps/portal/src/pages/login.tsx @@ -4,7 +4,7 @@ import type { InferGetServerSidePropsType, } from 'next/types'; import { getProviders, signIn } from 'next-auth/react'; -import { Button } from '@tih/ui'; +import { Button } from '~/ui'; import GitHubIcon from '~/components/shared/icons/GitHubIcon'; diff --git a/apps/portal/src/pages/offers/admin.tsx b/apps/portal/src/pages/offers/admin.tsx index 2b6eca52..2abc1712 100644 --- a/apps/portal/src/pages/offers/admin.tsx +++ b/apps/portal/src/pages/offers/admin.tsx @@ -4,7 +4,7 @@ import Link from 'next/link'; import { useRouter } from 'next/router'; import { useState } from 'react'; import { MapPinIcon } from '@heroicons/react/24/outline'; -import { Banner, Spinner } from '@tih/ui'; +import { Banner, Spinner } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import OffersTable from '~/components/offers/admin/OffersTable'; diff --git a/apps/portal/src/pages/offers/dashboard.tsx b/apps/portal/src/pages/offers/dashboard.tsx index f1b2427d..04b77603 100644 --- a/apps/portal/src/pages/offers/dashboard.tsx +++ b/apps/portal/src/pages/offers/dashboard.tsx @@ -2,7 +2,7 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { signIn, useSession } from 'next-auth/react'; import { useState } from 'react'; -import { Button, Spinner } from '@tih/ui'; +import { Button, Spinner } from '~/ui'; import DashboardProfileCard from '~/components/offers/dashboard/DashboardProfileCard'; import Container from '~/components/shared/Container'; diff --git a/apps/portal/src/pages/offers/index.tsx b/apps/portal/src/pages/offers/index.tsx index d2ee066f..37400671 100644 --- a/apps/portal/src/pages/offers/index.tsx +++ b/apps/portal/src/pages/offers/index.tsx @@ -3,7 +3,7 @@ import Head from 'next/head'; import Link from 'next/link'; import { useState } from 'react'; import { MapPinIcon } from '@heroicons/react/24/outline'; -import { Banner } from '@tih/ui'; +import { Banner } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import OffersTable from '~/components/offers/table/OffersTable'; diff --git a/apps/portal/src/pages/offers/profile/[offerProfileId].tsx b/apps/portal/src/pages/offers/profile/[offerProfileId].tsx index 9941c6bc..f7660403 100644 --- a/apps/portal/src/pages/offers/profile/[offerProfileId].tsx +++ b/apps/portal/src/pages/offers/profile/[offerProfileId].tsx @@ -3,7 +3,6 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { useSession } from 'next-auth/react'; import { useState } from 'react'; -import { Spinner, useToast } from '@tih/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import { ProfileDetailTab } from '~/components/offers/constants'; @@ -18,6 +17,7 @@ import type { import type { JobTitleType } from '~/components/shared/JobTitles'; import { getLabelForJobTitleType } from '~/components/shared/JobTitles'; +import { Spinner, useToast } from '~/ui'; import { convertMoneyToString } from '~/utils/offers/currency'; import { getProfilePath } from '~/utils/offers/link'; import { formatDate } from '~/utils/offers/time'; diff --git a/apps/portal/src/pages/offers/profile/edit/[offerProfileId].tsx b/apps/portal/src/pages/offers/profile/edit/[offerProfileId].tsx index 338eb067..a21eb5b5 100644 --- a/apps/portal/src/pages/offers/profile/edit/[offerProfileId].tsx +++ b/apps/portal/src/pages/offers/profile/edit/[offerProfileId].tsx @@ -10,7 +10,7 @@ import OffersSubmissionForm, { } from '~/components/offers/offersSubmission/OffersSubmissionForm'; import type { OffersProfileFormData } from '~/components/offers/types'; -import { Spinner } from '~/../../../packages/ui/dist'; +import { Spinner } from '~/ui'; import { getProfilePath } from '~/utils/offers/link'; import { convertToMonthYear } from '~/utils/offers/time'; import { trpc } from '~/utils/trpc'; diff --git a/apps/portal/src/pages/offers/submit/result/[offerProfileId].tsx b/apps/portal/src/pages/offers/submit/result/[offerProfileId].tsx index 63012b4c..ac741b5a 100644 --- a/apps/portal/src/pages/offers/submit/result/[offerProfileId].tsx +++ b/apps/portal/src/pages/offers/submit/result/[offerProfileId].tsx @@ -5,7 +5,7 @@ import { useSession } from 'next-auth/react'; import { useEffect, useRef, useState } from 'react'; import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/20/solid'; import { EyeIcon } from '@heroicons/react/24/outline'; -import { Button, Spinner } from '@tih/ui'; +import { Button, Spinner } from '~/ui'; import type { BreadcrumbStep } from '~/components/offers/Breadcrumbs'; import { Breadcrumbs } from '~/components/offers/Breadcrumbs'; diff --git a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx index 9c7f9d19..5bf452b2 100644 --- a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx +++ b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/answer/[answerId]/[answerSlug]/index.tsx @@ -2,7 +2,7 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { useState } from 'react'; import { useForm } from 'react-hook-form'; -import { Button, TextArea } from '@tih/ui'; +import { Button, TextArea } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import FullAnswerCard from '~/components/questions/card/FullAnswerCard'; diff --git a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx index 61a0737a..a5987916 100644 --- a/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx +++ b/apps/portal/src/pages/questions/[questionId]/[questionSlug]/index.tsx @@ -2,7 +2,7 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; -import { Button, Collapsible, HorizontalDivider, TextArea } from '@tih/ui'; +import { Button, Collapsible, HorizontalDivider, TextArea } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import FullQuestionCard from '~/components/questions/card/question/FullQuestionCard'; diff --git a/apps/portal/src/pages/questions/browse.tsx b/apps/portal/src/pages/questions/browse.tsx index df2feeaa..5ca7bc6d 100644 --- a/apps/portal/src/pages/questions/browse.tsx +++ b/apps/portal/src/pages/questions/browse.tsx @@ -5,9 +5,9 @@ import { useEffect, useMemo, useState } from 'react'; import { Bars3BottomLeftIcon } from '@heroicons/react/20/solid'; import { NoSymbolIcon } from '@heroicons/react/24/outline'; import type { QuestionsQuestionType } from '@prisma/client'; -import type { TypeaheadOption } from '@tih/ui'; -import { useToast } from '@tih/ui'; -import { Button, SlideOut } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; +import { useToast } from '~/ui'; +import { Button, SlideOut } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import QuestionOverviewCard from '~/components/questions/card/question/QuestionOverviewCard'; diff --git a/apps/portal/src/pages/questions/lists.tsx b/apps/portal/src/pages/questions/lists.tsx index 6becc903..adcfe0fe 100644 --- a/apps/portal/src/pages/questions/lists.tsx +++ b/apps/portal/src/pages/questions/lists.tsx @@ -7,7 +7,7 @@ import { PlusIcon, TrashIcon, } from '@heroicons/react/24/outline'; -import { Button, Select } from '@tih/ui'; +import { Button, Select } from '~/ui'; import QuestionListCard from '~/components/questions/card/question/QuestionListCard'; import type { CreateListFormData } from '~/components/questions/CreateListDialog'; diff --git a/apps/portal/src/pages/resumes/[resumeId].tsx b/apps/portal/src/pages/resumes/[resumeId].tsx index a8f7cb16..b8c7935f 100644 --- a/apps/portal/src/pages/resumes/[resumeId].tsx +++ b/apps/portal/src/pages/resumes/[resumeId].tsx @@ -17,7 +17,7 @@ import { StarIcon, TrashIcon, } from '@heroicons/react/20/solid'; -import { Button, Dialog, Spinner } from '@tih/ui'; +import { Button, Dialog, Spinner } from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import ResumeCommentsForm from '~/components/resumes/comments/ResumeCommentsForm'; diff --git a/apps/portal/src/pages/resumes/index.tsx b/apps/portal/src/pages/resumes/index.tsx index a2f2be70..6ba8fbf5 100644 --- a/apps/portal/src/pages/resumes/index.tsx +++ b/apps/portal/src/pages/resumes/index.tsx @@ -9,7 +9,7 @@ import { NewspaperIcon, XMarkIcon, } from '@heroicons/react/24/outline'; -import type { TypeaheadOption } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; import { Button, CheckboxInput, @@ -19,7 +19,7 @@ import { Spinner, Tabs, TextInput, -} from '@tih/ui'; +} from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import ResumeFilterPill from '~/components/resumes/browse/ResumeFilterPill'; diff --git a/apps/portal/src/pages/resumes/submit.tsx b/apps/portal/src/pages/resumes/submit.tsx index 802b0107..97639044 100644 --- a/apps/portal/src/pages/resumes/submit.tsx +++ b/apps/portal/src/pages/resumes/submit.tsx @@ -9,7 +9,7 @@ import { useDropzone } from 'react-dropzone'; import type { SubmitHandler } from 'react-hook-form'; import { Controller, useForm } from 'react-hook-form'; import { ArrowUpCircleIcon } from '@heroicons/react/24/outline'; -import type { TypeaheadOption } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; import { Button, CheckboxInput, @@ -18,7 +18,7 @@ import { Spinner, TextArea, TextInput, -} from '@tih/ui'; +} from '~/ui'; import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics'; import ResumeSubmissionGuidelines from '~/components/resumes/submit-form/ResumeSubmissionGuidelines'; diff --git a/apps/portal/src/pages/settings.tsx b/apps/portal/src/pages/settings.tsx index e8c3c3b5..e132bccc 100644 --- a/apps/portal/src/pages/settings.tsx +++ b/apps/portal/src/pages/settings.tsx @@ -2,7 +2,7 @@ import Head from 'next/head'; import type { Session } from 'next-auth'; import { useSession } from 'next-auth/react'; import { useState } from 'react'; -import { Button, HorizontalDivider, TextInput, useToast } from '@tih/ui'; +import { Button, HorizontalDivider, TextInput, useToast } from '~/ui'; import Container from '~/components/shared/Container'; diff --git a/apps/portal/src/pages/test__.tsx b/apps/portal/src/pages/test__.tsx index e2b470f2..10f92e91 100644 --- a/apps/portal/src/pages/test__.tsx +++ b/apps/portal/src/pages/test__.tsx @@ -1,8 +1,8 @@ import { useState } from 'react'; -import type { TypeaheadOption } from '@tih/ui'; -import { Button } from '@tih/ui'; -import { useToast } from '@tih/ui'; -import { HorizontalDivider } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; +import { Button } from '~/ui'; +import { useToast } from '~/ui'; +import { HorizontalDivider } from '~/ui'; import CitiesTypeahead from '~/components/shared/CitiesTypeahead'; import CompaniesTypeahead from '~/components/shared/CompaniesTypeahead'; diff --git a/packages/ui/src/Alert/Alert.tsx b/apps/portal/src/ui/Alert/Alert.tsx similarity index 100% rename from packages/ui/src/Alert/Alert.tsx rename to apps/portal/src/ui/Alert/Alert.tsx diff --git a/packages/ui/src/Badge/Badge.tsx b/apps/portal/src/ui/Badge/Badge.tsx similarity index 100% rename from packages/ui/src/Badge/Badge.tsx rename to apps/portal/src/ui/Badge/Badge.tsx diff --git a/packages/ui/src/Banner/Banner.tsx b/apps/portal/src/ui/Banner/Banner.tsx similarity index 100% rename from packages/ui/src/Banner/Banner.tsx rename to apps/portal/src/ui/Banner/Banner.tsx diff --git a/packages/ui/src/Button/Button.tsx b/apps/portal/src/ui/Button/Button.tsx similarity index 100% rename from packages/ui/src/Button/Button.tsx rename to apps/portal/src/ui/Button/Button.tsx diff --git a/packages/ui/src/CheckboxInput/CheckboxInput.tsx b/apps/portal/src/ui/CheckboxInput/CheckboxInput.tsx similarity index 100% rename from packages/ui/src/CheckboxInput/CheckboxInput.tsx rename to apps/portal/src/ui/CheckboxInput/CheckboxInput.tsx diff --git a/packages/ui/src/CheckboxList/CheckboxList.tsx b/apps/portal/src/ui/CheckboxList/CheckboxList.tsx similarity index 100% rename from packages/ui/src/CheckboxList/CheckboxList.tsx rename to apps/portal/src/ui/CheckboxList/CheckboxList.tsx diff --git a/packages/ui/src/Collapsible/Collapsible.tsx b/apps/portal/src/ui/Collapsible/Collapsible.tsx similarity index 100% rename from packages/ui/src/Collapsible/Collapsible.tsx rename to apps/portal/src/ui/Collapsible/Collapsible.tsx diff --git a/packages/ui/src/Dialog/Dialog.tsx b/apps/portal/src/ui/Dialog/Dialog.tsx similarity index 100% rename from packages/ui/src/Dialog/Dialog.tsx rename to apps/portal/src/ui/Dialog/Dialog.tsx diff --git a/packages/ui/src/DropdownMenu/DropdownMenu.tsx b/apps/portal/src/ui/DropdownMenu/DropdownMenu.tsx similarity index 100% rename from packages/ui/src/DropdownMenu/DropdownMenu.tsx rename to apps/portal/src/ui/DropdownMenu/DropdownMenu.tsx diff --git a/packages/ui/src/DropdownMenu/DropdownMenuItem.tsx b/apps/portal/src/ui/DropdownMenu/DropdownMenuItem.tsx similarity index 100% rename from packages/ui/src/DropdownMenu/DropdownMenuItem.tsx rename to apps/portal/src/ui/DropdownMenu/DropdownMenuItem.tsx diff --git a/packages/ui/src/HorizontalDivider/HorizontalDivider.tsx b/apps/portal/src/ui/HorizontalDivider/HorizontalDivider.tsx similarity index 100% rename from packages/ui/src/HorizontalDivider/HorizontalDivider.tsx rename to apps/portal/src/ui/HorizontalDivider/HorizontalDivider.tsx diff --git a/packages/ui/src/Pagination/Pagination.tsx b/apps/portal/src/ui/Pagination/Pagination.tsx similarity index 100% rename from packages/ui/src/Pagination/Pagination.tsx rename to apps/portal/src/ui/Pagination/Pagination.tsx diff --git a/packages/ui/src/RadioList/RadioList.tsx b/apps/portal/src/ui/RadioList/RadioList.tsx similarity index 100% rename from packages/ui/src/RadioList/RadioList.tsx rename to apps/portal/src/ui/RadioList/RadioList.tsx diff --git a/packages/ui/src/RadioList/RadioListContext.ts b/apps/portal/src/ui/RadioList/RadioListContext.ts similarity index 100% rename from packages/ui/src/RadioList/RadioListContext.ts rename to apps/portal/src/ui/RadioList/RadioListContext.ts diff --git a/packages/ui/src/RadioList/RadioListItem.tsx b/apps/portal/src/ui/RadioList/RadioListItem.tsx similarity index 100% rename from packages/ui/src/RadioList/RadioListItem.tsx rename to apps/portal/src/ui/RadioList/RadioListItem.tsx diff --git a/packages/ui/src/Select/Select.tsx b/apps/portal/src/ui/Select/Select.tsx similarity index 100% rename from packages/ui/src/Select/Select.tsx rename to apps/portal/src/ui/Select/Select.tsx diff --git a/packages/ui/src/SlideOut/SlideOut.tsx b/apps/portal/src/ui/SlideOut/SlideOut.tsx similarity index 100% rename from packages/ui/src/SlideOut/SlideOut.tsx rename to apps/portal/src/ui/SlideOut/SlideOut.tsx diff --git a/packages/ui/src/Spinner/Spinner.tsx b/apps/portal/src/ui/Spinner/Spinner.tsx similarity index 100% rename from packages/ui/src/Spinner/Spinner.tsx rename to apps/portal/src/ui/Spinner/Spinner.tsx diff --git a/packages/ui/src/Tabs/Tabs.tsx b/apps/portal/src/ui/Tabs/Tabs.tsx similarity index 100% rename from packages/ui/src/Tabs/Tabs.tsx rename to apps/portal/src/ui/Tabs/Tabs.tsx diff --git a/packages/ui/src/TextArea/TextArea.tsx b/apps/portal/src/ui/TextArea/TextArea.tsx similarity index 100% rename from packages/ui/src/TextArea/TextArea.tsx rename to apps/portal/src/ui/TextArea/TextArea.tsx diff --git a/packages/ui/src/TextInput/TextInput.tsx b/apps/portal/src/ui/TextInput/TextInput.tsx similarity index 100% rename from packages/ui/src/TextInput/TextInput.tsx rename to apps/portal/src/ui/TextInput/TextInput.tsx diff --git a/packages/ui/src/Toast/Toast.tsx b/apps/portal/src/ui/Toast/Toast.tsx similarity index 100% rename from packages/ui/src/Toast/Toast.tsx rename to apps/portal/src/ui/Toast/Toast.tsx diff --git a/packages/ui/src/Toast/ToastsProvider.tsx b/apps/portal/src/ui/Toast/ToastsProvider.tsx similarity index 100% rename from packages/ui/src/Toast/ToastsProvider.tsx rename to apps/portal/src/ui/Toast/ToastsProvider.tsx diff --git a/packages/ui/src/Typeahead/Typeahead.tsx b/apps/portal/src/ui/Typeahead/Typeahead.tsx similarity index 100% rename from packages/ui/src/Typeahead/Typeahead.tsx rename to apps/portal/src/ui/Typeahead/Typeahead.tsx diff --git a/packages/ui/src/index.tsx b/apps/portal/src/ui/index.tsx similarity index 100% rename from packages/ui/src/index.tsx rename to apps/portal/src/ui/index.tsx diff --git a/packages/ui/src/styles.css b/apps/portal/src/ui/styles.css similarity index 100% rename from packages/ui/src/styles.css rename to apps/portal/src/ui/styles.css diff --git a/apps/portal/src/utils/offers/currency/CurrencySelector.tsx b/apps/portal/src/utils/offers/currency/CurrencySelector.tsx index 2b339933..ef754c7a 100644 --- a/apps/portal/src/utils/offers/currency/CurrencySelector.tsx +++ b/apps/portal/src/utils/offers/currency/CurrencySelector.tsx @@ -1,4 +1,4 @@ -import { Select } from '@tih/ui'; +import { Select } from '~/ui'; import { Currency } from '~/utils/offers/currency/CurrencyEnum'; diff --git a/apps/portal/src/utils/questions/locationSlug.ts b/apps/portal/src/utils/questions/locationSlug.ts index ad450ce0..4b004f28 100644 --- a/apps/portal/src/utils/questions/locationSlug.ts +++ b/apps/portal/src/utils/questions/locationSlug.ts @@ -1,4 +1,4 @@ -import type { TypeaheadOption } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; import type { Location } from '~/types/questions'; diff --git a/apps/portal/src/utils/resumes/resumeFilters.ts b/apps/portal/src/utils/resumes/resumeFilters.ts index 4d39b772..bad976a7 100644 --- a/apps/portal/src/utils/resumes/resumeFilters.ts +++ b/apps/portal/src/utils/resumes/resumeFilters.ts @@ -1,4 +1,4 @@ -import type { TypeaheadOption } from '@tih/ui'; +import type { TypeaheadOption } from '~/ui'; import type { JobTitleType } from '~/components/shared/JobTitles'; import { getLabelForJobTitleType } from '~/components/shared/JobTitles'; diff --git a/apps/storybook/.eslintrc.js b/apps/storybook/.eslintrc.js deleted file mode 100644 index 07b7f196..00000000 --- a/apps/storybook/.eslintrc.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - root: true, - extends: ['tih'], - parserOptions: { - tsconfigRootDir: __dirname, - project: ['./tsconfig.json'], - }, -}; diff --git a/apps/storybook/.gitignore b/apps/storybook/.gitignore deleted file mode 100644 index 0640db61..00000000 --- a/apps/storybook/.gitignore +++ /dev/null @@ -1 +0,0 @@ -storybook-static \ No newline at end of file diff --git a/apps/storybook/.storybook/main.js b/apps/storybook/.storybook/main.js deleted file mode 100644 index 4f41c20b..00000000 --- a/apps/storybook/.storybook/main.js +++ /dev/null @@ -1,35 +0,0 @@ -const path = require('path'); - -module.exports = { - stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.tsx'], - addons: [ - { - name: '@storybook/addon-postcss', - options: { - postcssLoaderOptions: { - implementation: require('postcss'), - }, - }, - }, - '@storybook/addon-links', - '@storybook/addon-essentials', - ], - framework: '@storybook/react', - core: { - builder: '@storybook/builder-vite', - }, - async viteFinal(config, { configType }) { - // customize the Vite config here - return { - ...config, - resolve: { - alias: [ - { - find: '@tih/ui', - replacement: path.resolve(__dirname, '../../../packages/ui/'), - }, - ], - }, - }; - }, -}; diff --git a/apps/storybook/.storybook/preview.js b/apps/storybook/.storybook/preview.js deleted file mode 100644 index 605293ac..00000000 --- a/apps/storybook/.storybook/preview.js +++ /dev/null @@ -1,6 +0,0 @@ -import 'tailwindcss/tailwind.css'; -import '@tih/ui/dist/styles.css'; - -export const parameters = { - controls: { expanded: true }, -}; diff --git a/apps/storybook/package.json b/apps/storybook/package.json deleted file mode 100644 index 781900ce..00000000 --- a/apps/storybook/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@tih/storybook", - "version": "0.0.0", - "private": true, - "scripts": { - "dev": "start-storybook -p 6001", - "build": "tsc && build-storybook --docs", - "preview-storybook": "serve storybook-static", - "clean": "rm -rf .turbo && rm -rf node_modules", - "lint": "eslint stories/**/*.ts* --fix", - "tsc": "tsc" - }, - "dependencies": { - "@tih/ui": "workspace:0.0.0", - "react": "^18.2.0", - "react-dom": "^18.2.0" - }, - "devDependencies": { - "@heroicons/react": "2.0.11", - "@storybook/addon-actions": "^6.4.18", - "@storybook/addon-docs": "^6.4.22", - "@storybook/addon-essentials": "^6.4.18", - "@storybook/addon-links": "^6.4.18", - "@storybook/addon-postcss": "^2.0.0", - "@storybook/builder-vite": "^0.1.33", - "@storybook/react": "^6.4.18", - "@tih/tailwind-config": "workspace:0.0.0", - "@tih/tsconfig": "workspace:0.0.0", - "@vitejs/plugin-react": "^1.3.2", - "autoprefixer": "^10.4.12", - "eslint-config-tih": "workspace:0.0.0", - "serve": "^13.0.2", - "tailwindcss": "^3.1.8", - "typescript": "^4.8.3", - "vite": "^2.9.9" - } -} diff --git a/apps/storybook/postcss.config.js b/apps/storybook/postcss.config.js deleted file mode 100644 index 12a703d9..00000000 --- a/apps/storybook/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -}; diff --git a/apps/storybook/stories/alert.stories.tsx b/apps/storybook/stories/alert.stories.tsx deleted file mode 100644 index 6cf0d425..00000000 --- a/apps/storybook/stories/alert.stories.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import type { AlertVariant } from '@tih/ui'; -import { Alert } from '@tih/ui'; - -const alertVariants: ReadonlyArray = [ - 'info', - 'danger', - 'success', - 'warning', -]; - -export default { - argTypes: { - title: { - control: 'text', - }, - variant: { - control: { type: 'select' }, - options: alertVariants, - }, - }, - component: Alert, - title: 'Alert', -} as ComponentMeta; - -export const Basic = { - args: { - children: 'This is something you should pay your full attention to.', - title: 'Please pay attention', - variant: 'info', - }, -}; - -export function Variants() { - return ( -
- - Your order has been placed! Please check your email for the - confirmation. - - - A new software update is available. See what's new in version 2.0.4. - - - Doing that are not advisable, you are recommended to stay away from such - practices. - - - Please try again later, or close it and forget about it. - -
- ); -} diff --git a/apps/storybook/stories/badge.stories.tsx b/apps/storybook/stories/badge.stories.tsx deleted file mode 100644 index d5c4ee46..00000000 --- a/apps/storybook/stories/badge.stories.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import React from 'react'; -import { - CheckCircleIcon, - ExclamationCircleIcon, - ExclamationTriangleIcon, - InformationCircleIcon, - StarIcon, -} from '@heroicons/react/20/solid'; -import type { ComponentMeta } from '@storybook/react'; -import type { BadgeVariant } from '@tih/ui'; -import { Badge } from '@tih/ui'; - -const badgeVariants: ReadonlyArray = [ - 'primary', - 'info', - 'danger', - 'success', - 'warning', -]; - -export default { - argTypes: { - variant: { - control: { type: 'select' }, - options: badgeVariants, - }, - }, - component: Badge, - title: 'Badge', -} as ComponentMeta; - -export const Basic = { - args: { - label: 'Hello', - variant: 'primary', - }, -}; - -export function Variants() { - return ( -
- - - - - -
- ); -} - -export function StartIcon() { - return ( -
- - - - - -
- ); -} - -export function EndIcon() { - return ( -
- - - - - -
- ); -} diff --git a/apps/storybook/stories/banner.stories.tsx b/apps/storybook/stories/banner.stories.tsx deleted file mode 100644 index 4054f470..00000000 --- a/apps/storybook/stories/banner.stories.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import React, { useState } from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import type { BannerSize } from '@tih/ui'; -import { Banner } from '@tih/ui'; - -const bannerSizes: ReadonlyArray = ['xs', 'sm', 'md']; - -export default { - argTypes: { - children: { - control: 'text', - }, - size: { - control: { type: 'select' }, - options: bannerSizes, - }, - }, - component: Banner, - title: 'Banner', -} as ComponentMeta; - -export const Basic = { - args: { - children: 'This notice is going to change your life', - size: 'md', - }, -}; - -export function Sizes() { - const [isShown, setIsShown] = useState(true); - const [isShown2, setIsShown2] = useState(true); - const [isShown3, setIsShown3] = useState(true); - return ( -
- {isShown && ( - setIsShown(false)}> - This notice is going to change your life unless you close it. - - )} - {isShown2 && ( - setIsShown2(false)}> - This smaller notice is going to change your life unless you close it. - - )} - {isShown3 && ( - setIsShown3(false)}> - This even smaller notice is going to change your life unless you close - it. - - )} -
- ); -} diff --git a/apps/storybook/stories/button.stories.tsx b/apps/storybook/stories/button.stories.tsx deleted file mode 100644 index f48d3fcb..00000000 --- a/apps/storybook/stories/button.stories.tsx +++ /dev/null @@ -1,245 +0,0 @@ -import React from 'react'; -import { EnvelopeIcon } from '@heroicons/react/24/solid'; -import type { ComponentMeta } from '@storybook/react'; -import type { - ButtonAddOnPosition, - ButtonDisplay, - ButtonSize, - ButtonType, - ButtonVariant, -} from '@tih/ui'; -import { Button } from '@tih/ui'; - -const buttonTypes: ReadonlyArray = ['button', 'reset', 'submit']; -const buttonSizes: ReadonlyArray = ['sm', 'md', 'lg']; -const buttonAddOnPositions: ReadonlyArray = [ - 'start', - 'end', -]; -const buttonDisplays: ReadonlyArray = ['block', 'inline']; -const buttonVariants: ReadonlyArray = [ - 'primary', - 'secondary', - 'tertiary', - 'special', - 'success', - 'danger', - 'warning', - 'info', -]; - -export default { - argTypes: { - addonPosition: { - control: { type: 'select' }, - options: buttonAddOnPositions, - }, - disabled: { - control: 'boolean', - }, - display: { - control: { type: 'select' }, - options: buttonDisplays, - }, - isLoading: { - control: 'boolean', - }, - label: { - control: 'text', - }, - size: { - control: { type: 'select' }, - options: buttonSizes, - }, - type: { - control: { type: 'select' }, - options: buttonTypes, - }, - variant: { - control: { type: 'select' }, - options: buttonVariants, - }, - }, - component: Button, - title: 'Button', -} as ComponentMeta; - -export const Basic = { - args: { - label: 'Click Me', - size: 'md', - variant: 'primary', - }, -}; - -export function Variant() { - return ( -
- {buttonVariants.map((variant) => ( -
- ); -} - -export function Size() { - return ( -
- {buttonSizes.map((size) => ( -
- ); -} - -export function Display() { - return ( -
- {buttonSizes.map((size) => ( -
- ); -} - -export function Disabled() { - return ( -
- {buttonVariants.map((variant) => ( -
- ); -} - -export function Loading() { - return ( -
-
- {buttonVariants.map((variant) => ( -
-
- {buttonVariants.map((variant) => ( -
-
- ); -} - -export function Icons() { - return ( -
-
- {buttonSizes.map((size) => ( -
-
- {buttonSizes.map((size) => ( -
-
- {buttonSizes.map((size) => ( -
-
- ); -} - -export function HiddenLabel() { - return ( -
- {buttonSizes.map((size) => ( -
- ); -} diff --git a/apps/storybook/stories/checkbox-input.stories.tsx b/apps/storybook/stories/checkbox-input.stories.tsx deleted file mode 100644 index 637925f5..00000000 --- a/apps/storybook/stories/checkbox-input.stories.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import React, { useState } from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import { CheckboxInput } from '@tih/ui'; - -export default { - argTypes: { - defaultValue: { - control: 'boolean', - }, - description: { - control: 'text', - }, - disabled: { - control: 'boolean', - }, - label: { - control: 'text', - }, - value: { - control: 'boolean', - }, - }, - component: CheckboxInput, - title: 'CheckboxInput', -} as ComponentMeta; - -export function Basic({ - defaultValue, - description, - disabled, - label, -}: Pick< - React.ComponentProps, - 'defaultValue' | 'description' | 'disabled' | 'label' ->) { - return ( - - ); -} - -Basic.args = { - description: 'I will be responsible for any mistakes', - disabled: false, - label: 'I have read the terms and conditions', -}; - -export function Controlled() { - const [value, setValue] = useState(true); - - return ( - { - setValue(newValue); - }} - /> - ); -} - -export function Disabled() { - return ( -
- - - - -
- ); -} - -export function ItemDescriptions() { - return ( - - ); -} diff --git a/apps/storybook/stories/checkbox-list.stories.tsx b/apps/storybook/stories/checkbox-list.stories.tsx deleted file mode 100644 index 5a4b0bea..00000000 --- a/apps/storybook/stories/checkbox-list.stories.tsx +++ /dev/null @@ -1,262 +0,0 @@ -import React, { useState } from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import type { CheckboxListOrientation } from '@tih/ui'; -import { HorizontalDivider } from '@tih/ui'; -import { CheckboxInput, CheckboxList } from '@tih/ui'; - -const CheckboxListOrientations: ReadonlyArray = [ - 'horizontal', - 'vertical', -]; - -export default { - argTypes: { - description: { - control: 'text', - }, - isLabelHidden: { - control: 'boolean', - }, - label: { - control: 'text', - }, - orientation: { - control: { type: 'select' }, - options: CheckboxListOrientations, - }, - }, - component: CheckboxList, - title: 'CheckboxList', -} as ComponentMeta; - -export function Basic({ - description, - label, - orientation, -}: Pick< - React.ComponentProps, - 'description' | 'label' | 'orientation' ->) { - const items = [ - { - label: 'Apple', - name: 'apple', - value: true, - }, - { - label: 'Banana', - name: 'banana', - value: true, - }, - { - label: 'Orange', - name: 'orange', - value: false, - }, - ]; - - return ( - - {items.map(({ label: itemLabel, name, value: itemValue }) => ( - - ))} - - ); -} - -Basic.args = { - description: 'Selected fruits will be served after dinner', - label: 'Select your favorite fruits', - orientation: 'vertical', -}; - -export function Controlled() { - const items = [ - { - label: 'Apple', - value: 'apple', - }, - { - label: 'Banana', - value: 'banana', - }, - { - label: 'Orange', - value: 'orange', - }, - ]; - - const [values, setValues] = useState(new Set(['apple'])); - - return ( - - {items.map(({ label: itemLabel, value: itemValue }) => ( - { - if (newValue) { - setValues(new Set([...Array.from(values), itemValue])); - } else { - setValues( - new Set(Array.from(values).filter((v) => v !== itemValue)), - ); - } - }} - /> - ))} - - ); -} - -export function Disabled() { - const items = [ - { - description: 'A red fruit', - disabled: false, - label: 'Apple', - value: 'apple', - }, - { - description: 'A yellow fruit', - disabled: true, - label: 'Banana', - value: 'banana', - }, - { - description: 'An orange fruit', - disabled: false, - label: 'Orange', - value: 'orange', - }, - ]; - - const [values, setValues] = useState(new Set(['apple', 'banana'])); - - return ( -
- - {items.map(({ disabled, label: itemLabel, value: itemValue }) => ( - { - if (newValue) { - setValues(new Set([...Array.from(values), itemValue])); - } else { - setValues( - new Set(Array.from(values).filter((v) => v !== itemValue)), - ); - } - }} - /> - ))} - -
- ); -} - -export function ItemDescriptions() { - const items = [ - { - description: 'A red fruit', - label: 'Apple', - value: 'apple', - }, - { - description: 'A yellow fruit', - label: 'Banana', - value: 'banana', - }, - { - description: 'An orange fruit', - label: 'Orange', - value: 'orange', - }, - ]; - - const [values, setValues] = useState(new Set(['apple', 'banana'])); - - return ( -
- - {items.map(({ description, label: itemLabel, value: itemValue }) => ( - { - if (newValue) { - setValues(new Set([...Array.from(values), itemValue])); - } else { - setValues( - new Set(Array.from(values).filter((v) => v !== itemValue)), - ); - } - }} - /> - ))} - -
- ); -} - -export function Orientation() { - const items = [ - { - label: 'Apple', - name: 'apple', - value: true, - }, - { - label: 'Banana', - name: 'banana', - value: false, - }, - { - label: 'Orange', - name: 'orange', - value: true, - }, - ]; - - return ( -
- - {items.map(({ label: itemLabel, name, value: itemValue }) => ( - - ))} - - - - {items.map(({ label: itemLabel, name, value: itemValue }) => ( - - ))} - -
- ); -} diff --git a/apps/storybook/stories/collapsible.stories.tsx b/apps/storybook/stories/collapsible.stories.tsx deleted file mode 100644 index 68826881..00000000 --- a/apps/storybook/stories/collapsible.stories.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import type { ComponentMeta } from '@storybook/react'; -import { Collapsible } from '@tih/ui'; - -export default { - argTypes: { - children: { - control: { type: 'text' }, - }, - label: { - control: { type: 'text' }, - }, - }, - component: Collapsible, - title: 'Collapsible', -} as ComponentMeta; - -export const Basic = { - args: { - children: - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', - label: 'Reveal more content below', - }, -}; - -export function AccordionLayout() { - return ( -
-
- - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad - minim veniam, quis nostrud exercitation ullamco laboris nisi ut - aliquip ex ea commodo consequat. - -
-
- - Duis aute irure dolor in reprehenderit in voluptate velit esse cillum - dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non - proident, sunt in culpa qui officia deserunt mollit anim id est - laborum. - -
-
- ); -} diff --git a/apps/storybook/stories/dialog.stories.tsx b/apps/storybook/stories/dialog.stories.tsx deleted file mode 100644 index de9a90d9..00000000 --- a/apps/storybook/stories/dialog.stories.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React, { useState } from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import { Button, Dialog } from '@tih/ui'; - -export default { - argTypes: { - title: { - control: 'text', - }, - }, - component: Dialog, - title: 'Dialog', -} as ComponentMeta; - -export function Basic({ - children, - title, -}: Pick, 'children' | 'title'>) { - const [isShown, setIsShown] = useState(false); - - return ( -
-
- ); -} - -Basic.args = { - children: ( -
- Lorem ipsum, dolor sit amet consectetur adipisicing elit. Eius aliquam - laudantium explicabo pariatur iste dolorem animi vitae error totam. At - sapiente aliquam accusamus facere veritatis. -
- ), - title: 'Lorem ipsum, dolor sit amet', -}; diff --git a/apps/storybook/stories/dropdown-menu.stories.tsx b/apps/storybook/stories/dropdown-menu.stories.tsx deleted file mode 100644 index 85cf20e0..00000000 --- a/apps/storybook/stories/dropdown-menu.stories.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import React, { useState } from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import type { DropdownMenuAlignment, DropdownMenuSize } from '@tih/ui'; -import { DropdownMenu } from '@tih/ui'; - -const DropdownMenuAlignments: ReadonlyArray = [ - 'start', - 'end', -]; -const DropdownMenuSizes: ReadonlyArray = ['sm', 'md', 'lg']; - -export default { - argTypes: { - align: { - control: { type: 'select' }, - options: DropdownMenuAlignments, - }, - label: { - control: 'text', - }, - size: { - control: { type: 'select' }, - options: DropdownMenuSizes, - }, - }, - component: DropdownMenu, - parameters: { - docs: { - iframeHeight: 300, - inlineStories: false, - }, - }, - title: 'DropdownMenu', -} as ComponentMeta; - -export function Basic({ - align, - label, - size, -}: Pick< - React.ComponentProps, - 'align' | 'label' | 'size' ->) { - const menuItems = [ - { - label: 'Profile', - value: 'profile', - }, - { - label: 'Settings', - value: 'settings', - }, - { - label: 'Sign Out', - value: 'sign-out', - }, - ]; - - const [selectedValue, setSelectedValue] = useState('apple'); - - return ( - - {menuItems.map(({ label: itemLabel, value }) => ( - { - setSelectedValue(value); - }} - /> - ))} - - ); -} - -Basic.args = { - align: 'start', - label: 'More actions', - size: 'md', -}; - -export function Align() { - const menuItems = [ - { - label: 'Profile', - value: 'profile', - }, - { - label: 'Settings', - value: 'settings', - }, - { - label: 'Sign Out', - value: 'sign-out', - }, - ]; - - const [selectedValue, setSelectedValue] = useState('apple'); - - return ( -
- - {menuItems.map(({ label, value }) => ( - { - setSelectedValue(value); - }} - /> - ))} - - - {menuItems.map(({ label, value }) => ( - { - setSelectedValue(value); - }} - /> - ))} - -
- ); -} diff --git a/apps/storybook/stories/horizontal-divider.stories.tsx b/apps/storybook/stories/horizontal-divider.stories.tsx deleted file mode 100644 index 7bee6bda..00000000 --- a/apps/storybook/stories/horizontal-divider.stories.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import { HorizontalDivider } from '@tih/ui'; - -export default { - argTypes: {}, - component: HorizontalDivider, - title: 'HorizontalDivider', -} as ComponentMeta; - -export function Basic() { - return ( -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod - tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim - veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea - commodo consequat. -

- -

- Duis aute irure dolor in reprehenderit in voluptate velit esse cillum - dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non - proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -

-
- ); -} diff --git a/apps/storybook/stories/pagination.stories.tsx b/apps/storybook/stories/pagination.stories.tsx deleted file mode 100644 index 435bed7b..00000000 --- a/apps/storybook/stories/pagination.stories.tsx +++ /dev/null @@ -1,234 +0,0 @@ -import React, { useState } from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import { Pagination } from '@tih/ui'; - -export default { - argTypes: {}, - component: Pagination, - title: 'Pagination', -} as ComponentMeta; - -// eslint-disable-next-line @typescript-eslint/no-empty-function -function emptyFunction() {} - -export function Basic({ - current, - end, - start, - pagePadding, -}: Pick< - React.ComponentProps, - 'current' | 'end' | 'pagePadding' | 'start' ->) { - return ( -
- -
- ); -} - -Basic.args = { - current: 3, - end: 10, - pagePadding: 1, - start: 1, -}; - -export function Interaction() { - const [currentPage, setCurrentPage] = useState(5); - - return ( -
-
- setCurrentPage(page)} - /> -
-
- ); -} - -export function PageRanges() { - return ( -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- ); -} - -export function PagePadding() { - return ( -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- ); -} diff --git a/apps/storybook/stories/radio-list.stories.tsx b/apps/storybook/stories/radio-list.stories.tsx deleted file mode 100644 index 91ca7b72..00000000 --- a/apps/storybook/stories/radio-list.stories.tsx +++ /dev/null @@ -1,256 +0,0 @@ -import React, { useState } from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import type { RadioListOrientation } from '@tih/ui'; -import { HorizontalDivider } from '@tih/ui'; -import { RadioList } from '@tih/ui'; - -const RadioListOrientations: ReadonlyArray = [ - 'horizontal', - 'vertical', -]; - -export default { - argTypes: { - description: { - control: 'text', - }, - label: { - control: 'text', - }, - orientation: { - control: { type: 'select' }, - options: RadioListOrientations, - }, - }, - component: RadioList, - title: 'RadioList', -} as ComponentMeta; - -export function Basic({ - description, - label, - orientation, -}: Pick< - React.ComponentProps, - 'description' | 'label' | 'orientation' ->) { - const items = [ - { - label: 'Apple', - value: 'apple', - }, - { - label: 'Banana', - value: 'banana', - }, - { - label: 'Orange', - value: 'orange', - }, - ]; - - return ( - - {items.map(({ label: itemLabel, value }) => ( - - ))} - - ); -} - -Basic.args = { - description: 'Your favorite fruit', - label: 'Choose a fruit', - orientation: 'vertical', -}; - -export function Controlled() { - const items = [ - { - label: 'Apple', - value: 'apple', - }, - { - label: 'Banana', - value: 'banana', - }, - { - label: 'Orange', - value: 'orange', - }, - ]; - - const [value, setValue] = useState('apple'); - - return ( - setValue(newValue)}> - {items.map(({ label: itemLabel, value: itemValue }) => ( - - ))} - - ); -} - -export function Required() { - const items = [ - { - label: 'Apple', - value: 'apple', - }, - { - label: 'Banana', - value: 'banana', - }, - { - label: 'Orange', - value: 'orange', - }, - ]; - - const [value, setValue] = useState('apple'); - - return ( - setValue(newValue)}> - {items.map(({ label: itemLabel, value: itemValue }) => ( - - ))} - - ); -} - -export function Disabled() { - const items = [ - { - description: 'A red fruit', - disabled: false, - label: 'Apple', - value: 'apple', - }, - { - description: 'A yellow fruit', - disabled: true, - label: 'Banana', - value: 'banana', - }, - { - description: 'An orange fruit', - disabled: false, - label: 'Orange', - value: 'orange', - }, - ]; - - return ( -
- - {items.map( - ({ description, label: itemLabel, value: itemValue, disabled }) => ( - - ), - )} - -
- ); -} - -export function ItemDescriptions() { - const items = [ - { - description: 'A red fruit', - label: 'Apple', - value: 'apple', - }, - { - description: 'A yellow fruit', - label: 'Banana', - value: 'banana', - }, - { - description: 'An orange fruit', - label: 'Orange', - value: 'orange', - }, - ]; - - const [value, setValue] = useState('apple'); - - return ( - setValue(newValue)}> - {items.map(({ description, label: itemLabel, value: itemValue }) => ( - - ))} - - ); -} - -export function Orientation() { - const items = [ - { - label: 'Apple', - value: 'apple', - }, - { - label: 'Banana', - value: 'banana', - }, - { - label: 'Orange', - value: 'orange', - }, - ]; - - return ( -
- - {items.map(({ label: itemLabel, value: itemValue }) => ( - - ))} - - - - {items.map(({ label: itemLabel, value: itemValue }) => ( - - ))} - -
- ); -} diff --git a/apps/storybook/stories/select.stories.tsx b/apps/storybook/stories/select.stories.tsx deleted file mode 100644 index 7cfe1187..00000000 --- a/apps/storybook/stories/select.stories.tsx +++ /dev/null @@ -1,288 +0,0 @@ -import React, { useState } from 'react'; -import type { ComponentMeta } from '@storybook/react'; -import type { SelectDisplay } from '@tih/ui'; -import { Select } from '@tih/ui'; - -const SelectDisplays: ReadonlyArray = ['inline', 'block']; - -export default { - argTypes: { - disabled: { - control: 'boolean', - }, - display: { - control: { type: 'select' }, - options: SelectDisplays, - }, - errorMessage: { - control: 'text', - }, - isLabelHidden: { - control: 'boolean', - }, - label: { - control: 'text', - }, - name: { - control: 'text', - }, - placeholder: { - control: 'text', - }, - }, - component: Select, - title: 'Select', -} as ComponentMeta; - -export function Basic({ - display, - isLabelHidden, - label, - name, -}: Pick< - React.ComponentProps, - 'display' | 'isLabelHidden' | 'label' | 'name' ->) { - const [value, setValue] = useState('apple'); - - return ( - - - - ); -} - -export function Disabled() { - const [value, setValue] = useState('apple'); - - return ( -
- - ); -} - -export function Placeholder() { - return ( - - ); -} - -export function Uncontrolled() { - return ( -
-