From 199c48d2d41f8b646787456c8454f28071c3fa2b Mon Sep 17 00:00:00 2001 From: Eva Decker Date: Wed, 27 Nov 2024 19:15:31 -0500 Subject: [PATCH] chore: Reorganize components (#230) --- CONTRIBUTING.md | 9 ++++--- .../{ => app}/AppContent/AppContent.tsx | 0 src/components/{ => app}/AppContent/index.ts | 0 .../{ => app}/AppSidebar/AppSidebar.tsx | 26 +++++++++---------- src/components/{ => app}/AppSidebar/index.ts | 0 .../{ => app}/Logo/Logo.stories.tsx | 0 src/components/{ => app}/Logo/Logo.tsx | 0 src/components/{ => app}/Logo/index.ts | 0 .../PageHeader/PageHeader.stories.tsx | 3 +-- .../{ => app}/PageHeader/PageHeader.tsx | 0 src/components/{ => app}/PageHeader/index.ts | 0 src/components/app/index.ts | 4 +++ .../AlertDialog/AlertDialog.stories.tsx | 0 .../{ => common}/AlertDialog/AlertDialog.tsx | 0 .../{ => common}/AlertDialog/index.ts | 0 .../AnimateChangeInHeight.tsx | 0 .../AnimateChangeInHeight/index.ts | 0 .../{ => common}/Badge/Badge.stories.tsx | 0 src/components/{ => common}/Badge/Badge.tsx | 0 src/components/{ => common}/Badge/index.ts | 0 .../{ => common}/Banner/Banner.stories.tsx | 0 src/components/{ => common}/Banner/Banner.tsx | 0 src/components/{ => common}/Banner/index.ts | 0 .../Breadcrumbs/Breadcrumbs.stories.tsx | 0 .../{ => common}/Breadcrumbs/Breadcrumbs.tsx | 2 +- .../{ => common}/Breadcrumbs/index.ts | 0 .../{ => common}/Button/Button.stories.tsx | 0 src/components/{ => common}/Button/Button.tsx | 2 +- src/components/{ => common}/Button/index.ts | 0 .../Calendar/Calendar.stories.tsx | 0 .../{ => common}/Calendar/Calendar.tsx | 2 +- src/components/{ => common}/Calendar/index.ts | 0 .../{ => common}/Card/Card.stories.tsx | 0 src/components/{ => common}/Card/Card.tsx | 0 src/components/{ => common}/Card/index.ts | 0 .../Checkbox/Checkbox.stories.tsx | 0 .../{ => common}/Checkbox/Checkbox.tsx | 2 +- src/components/{ => common}/Checkbox/index.ts | 0 .../ComboBox/ComboBox.stories.tsx | 0 .../{ => common}/ComboBox/ComboBox.tsx | 2 +- src/components/{ => common}/ComboBox/index.ts | 0 .../{ => common}/Container/Container.tsx | 0 .../{ => common}/Container/index.ts | 0 .../DateField/DateField.stories.tsx | 0 .../{ => common}/DateField/DateField.tsx | 2 +- .../{ => common}/DateField/index.ts | 0 .../DatePicker/DatePicker.stories.tsx | 0 .../{ => common}/DatePicker/DatePicker.tsx | 2 +- .../{ => common}/DatePicker/index.ts | 0 .../DateRangePicker.stories.tsx | 0 .../DateRangePicker/DateRangePicker.tsx | 2 +- .../{ => common}/DateRangePicker/index.ts | 0 src/components/{ => common}/Dialog/Dialog.tsx | 0 src/components/{ => common}/Dialog/index.ts | 0 .../Disclosure/Disclosure.stories.tsx | 0 .../{ => common}/Disclosure/Disclosure.tsx | 0 .../{ => common}/Disclosure/index.ts | 0 .../{ => common}/Empty/Empty.stories.tsx | 0 src/components/{ => common}/Empty/Empty.tsx | 0 src/components/{ => common}/Empty/index.ts | 0 src/components/{ => common}/Field/Field.tsx | 2 +- src/components/{ => common}/Field/index.ts | 0 .../FileTrigger/FileTrigger.stories.tsx | 0 .../{ => common}/FileTrigger/FileTrigger.tsx | 0 .../{ => common}/FileTrigger/index.ts | 0 .../{ => common}/Form/Form.stories.tsx | 0 src/components/{ => common}/Form/Form.tsx | 0 src/components/{ => common}/Form/index.ts | 0 .../GridList/GridList.stories.tsx | 0 .../{ => common}/GridList/GridList.tsx | 2 +- src/components/{ => common}/GridList/index.ts | 0 .../{ => common}/Link/Link.stories.tsx | 0 src/components/{ => common}/Link/Link.tsx | 2 +- src/components/{ => common}/Link/index.ts | 0 .../{ => common}/ListBox/ListBox.stories.tsx | 0 .../{ => common}/ListBox/ListBox.tsx | 2 +- src/components/{ => common}/ListBox/index.ts | 0 .../{ => common}/Menu/Menu.stories.tsx | 0 src/components/{ => common}/Menu/Menu.tsx | 0 src/components/{ => common}/Menu/index.ts | 0 .../{ => common}/Meter/Meter.stories.tsx | 0 src/components/{ => common}/Meter/Meter.tsx | 2 +- src/components/{ => common}/Meter/index.ts | 0 src/components/{ => common}/Modal/Modal.tsx | 0 src/components/{ => common}/Modal/index.ts | 0 src/components/{ => common}/Nav/Nav.tsx | 2 +- src/components/{ => common}/Nav/index.ts | 0 .../NumberField/NumberField.stories.tsx | 0 .../{ => common}/NumberField/NumberField.tsx | 2 +- .../{ => common}/NumberField/index.ts | 0 .../{ => common}/Popover/Popover.stories.tsx | 0 .../{ => common}/Popover/Popover.tsx | 0 src/components/{ => common}/Popover/index.ts | 0 .../ProgressBar/ProgressBar.stories.tsx | 0 .../{ => common}/ProgressBar/ProgressBar.tsx | 2 +- .../{ => common}/ProgressBar/index.ts | 0 .../RadioGroup/RadioGroup.stories.tsx | 0 .../{ => common}/RadioGroup/RadioGroup.tsx | 2 +- .../{ => common}/RadioGroup/index.ts | 0 .../RangeCalendar/RangeCalendar.stories.tsx | 0 .../RangeCalendar/RangeCalendar.tsx | 2 +- .../{ => common}/RangeCalendar/index.ts | 0 .../RichText/RichText.stories.tsx | 0 .../{ => common}/RichText/RichText.tsx | 2 +- src/components/{ => common}/RichText/index.ts | 0 .../SearchField/SearchField.stories.tsx | 0 .../{ => common}/SearchField/SearchField.tsx | 2 +- .../{ => common}/SearchField/index.ts | 0 .../{ => common}/Select/Select.stories.tsx | 0 src/components/{ => common}/Select/Select.tsx | 2 +- src/components/{ => common}/Select/index.ts | 0 .../{ => common}/Separator/Separator.tsx | 0 .../{ => common}/Separator/index.ts | 0 .../{ => common}/Slider/Slider.stories.tsx | 0 src/components/{ => common}/Slider/Slider.tsx | 2 +- src/components/{ => common}/Slider/index.ts | 0 .../{ => common}/Switch/Switch.stories.tsx | 0 src/components/{ => common}/Switch/Switch.tsx | 2 +- src/components/{ => common}/Switch/index.ts | 0 .../{ => common}/Table/Table.stories.tsx | 0 src/components/{ => common}/Table/Table.tsx | 2 +- src/components/{ => common}/Table/index.ts | 0 .../{ => common}/Tabs/Tabs.stories.tsx | 0 src/components/{ => common}/Tabs/Tabs.tsx | 2 +- src/components/{ => common}/Tabs/index.ts | 0 .../TagGroup/TagGroup.stories.tsx | 0 .../{ => common}/TagGroup/TagGroup.tsx | 2 +- src/components/{ => common}/TagGroup/index.ts | 0 .../TextArea/TextArea.stories.tsx | 0 .../{ => common}/TextArea/TextArea.tsx | 2 +- src/components/{ => common}/TextArea/index.ts | 0 .../TextField/TextField.stories.tsx | 0 .../{ => common}/TextField/TextField.tsx | 2 +- .../{ => common}/TextField/index.ts | 0 .../TimeField/TimeField.stories.tsx | 0 .../{ => common}/TimeField/TimeField.tsx | 0 .../{ => common}/TimeField/index.ts | 0 .../ToggleButton/ToggleButton.stories.tsx | 0 .../ToggleButton/ToggleButton.tsx | 2 +- .../{ => common}/ToggleButton/index.ts | 0 .../ToggleButtonGroup.stories.tsx | 0 .../ToggleButtonGroup/ToggleButtonGroup.tsx | 0 .../{ => common}/ToggleButtonGroup/index.ts | 0 .../{ => common}/Toolbar/Toolbar.stories.tsx | 0 .../{ => common}/Toolbar/Toolbar.tsx | 0 src/components/{ => common}/Toolbar/index.ts | 0 .../{ => common}/Tooltip/Tooltip.stories.tsx | 0 .../{ => common}/Tooltip/Tooltip.tsx | 0 src/components/{ => common}/Tooltip/index.ts | 0 src/components/{ => common}/index.ts | 7 ----- .../DocumentCard/DocumentCard.tsx | 3 +-- .../{ => quests}/DocumentCard/index.ts | 0 .../ReadingScore/ReadingScore.stories.tsx | 0 .../ReadingScore/ReadingScore.tsx | 2 +- .../{ => quests}/ReadingScore/index.ts | 0 .../StatusSelect/StatusSelect.stories.tsx | 0 .../StatusSelect/StatusSelect.tsx | 12 ++++----- .../{ => quests}/StatusSelect/index.ts | 0 src/components/quests/index.ts | 3 +++ src/main.tsx | 2 +- src/routes/_authenticated/_home.tsx | 6 ++--- .../_authenticated/_home/quests.$questId.tsx | 8 +++--- .../_authenticated/admin/fields/index.tsx | 4 +-- .../_authenticated/admin/forms/$formId.tsx | 3 ++- .../_authenticated/admin/forms/index.tsx | 4 +-- .../_authenticated/admin/quests/$questId.tsx | 4 +-- .../_authenticated/admin/quests/index.tsx | 4 +-- src/routes/_authenticated/admin/route.tsx | 10 ++----- src/routes/_authenticated/browse/index.tsx | 6 ++--- .../_authenticated/settings/account.tsx | 4 +-- src/routes/_authenticated/settings/data.tsx | 3 ++- src/routes/_authenticated/settings/route.tsx | 10 ++----- src/routes/_unauthenticated/signin.tsx | 4 +-- 173 files changed, 93 insertions(+), 106 deletions(-) rename src/components/{ => app}/AppContent/AppContent.tsx (100%) rename src/components/{ => app}/AppContent/index.ts (100%) rename src/components/{ => app}/AppSidebar/AppSidebar.tsx (93%) rename src/components/{ => app}/AppSidebar/index.ts (100%) rename src/components/{ => app}/Logo/Logo.stories.tsx (100%) rename src/components/{ => app}/Logo/Logo.tsx (100%) rename src/components/{ => app}/Logo/index.ts (100%) rename src/components/{ => app}/PageHeader/PageHeader.stories.tsx (89%) rename src/components/{ => app}/PageHeader/PageHeader.tsx (100%) rename src/components/{ => app}/PageHeader/index.ts (100%) create mode 100644 src/components/app/index.ts rename src/components/{ => common}/AlertDialog/AlertDialog.stories.tsx (100%) rename src/components/{ => common}/AlertDialog/AlertDialog.tsx (100%) rename src/components/{ => common}/AlertDialog/index.ts (100%) rename src/components/{ => common}/AnimateChangeInHeight/AnimateChangeInHeight.tsx (100%) rename src/components/{ => common}/AnimateChangeInHeight/index.ts (100%) rename src/components/{ => common}/Badge/Badge.stories.tsx (100%) rename src/components/{ => common}/Badge/Badge.tsx (100%) rename src/components/{ => common}/Badge/index.ts (100%) rename src/components/{ => common}/Banner/Banner.stories.tsx (100%) rename src/components/{ => common}/Banner/Banner.tsx (100%) rename src/components/{ => common}/Banner/index.ts (100%) rename src/components/{ => common}/Breadcrumbs/Breadcrumbs.stories.tsx (100%) rename src/components/{ => common}/Breadcrumbs/Breadcrumbs.tsx (93%) rename src/components/{ => common}/Breadcrumbs/index.ts (100%) rename src/components/{ => common}/Button/Button.stories.tsx (100%) rename src/components/{ => common}/Button/Button.tsx (97%) rename src/components/{ => common}/Button/index.ts (100%) rename src/components/{ => common}/Calendar/Calendar.stories.tsx (100%) rename src/components/{ => common}/Calendar/Calendar.tsx (98%) rename src/components/{ => common}/Calendar/index.ts (100%) rename src/components/{ => common}/Card/Card.stories.tsx (100%) rename src/components/{ => common}/Card/Card.tsx (100%) rename src/components/{ => common}/Card/index.ts (100%) rename src/components/{ => common}/Checkbox/Checkbox.stories.tsx (100%) rename src/components/{ => common}/Checkbox/Checkbox.tsx (97%) rename src/components/{ => common}/Checkbox/index.ts (100%) rename src/components/{ => common}/ComboBox/ComboBox.stories.tsx (100%) rename src/components/{ => common}/ComboBox/ComboBox.tsx (96%) rename src/components/{ => common}/ComboBox/index.ts (100%) rename src/components/{ => common}/Container/Container.tsx (100%) rename src/components/{ => common}/Container/index.ts (100%) rename src/components/{ => common}/DateField/DateField.stories.tsx (100%) rename src/components/{ => common}/DateField/DateField.tsx (96%) rename src/components/{ => common}/DateField/index.ts (100%) rename src/components/{ => common}/DatePicker/DatePicker.stories.tsx (100%) rename src/components/{ => common}/DatePicker/DatePicker.tsx (96%) rename src/components/{ => common}/DatePicker/index.ts (100%) rename src/components/{ => common}/DateRangePicker/DateRangePicker.stories.tsx (100%) rename src/components/{ => common}/DateRangePicker/DateRangePicker.tsx (96%) rename src/components/{ => common}/DateRangePicker/index.ts (100%) rename src/components/{ => common}/Dialog/Dialog.tsx (100%) rename src/components/{ => common}/Dialog/index.ts (100%) rename src/components/{ => common}/Disclosure/Disclosure.stories.tsx (100%) rename src/components/{ => common}/Disclosure/Disclosure.tsx (100%) rename src/components/{ => common}/Disclosure/index.ts (100%) rename src/components/{ => common}/Empty/Empty.stories.tsx (100%) rename src/components/{ => common}/Empty/Empty.tsx (100%) rename src/components/{ => common}/Empty/index.ts (100%) rename src/components/{ => common}/Field/Field.tsx (96%) rename src/components/{ => common}/Field/index.ts (100%) rename src/components/{ => common}/FileTrigger/FileTrigger.stories.tsx (100%) rename src/components/{ => common}/FileTrigger/FileTrigger.tsx (100%) rename src/components/{ => common}/FileTrigger/index.ts (100%) rename src/components/{ => common}/Form/Form.stories.tsx (100%) rename src/components/{ => common}/Form/Form.tsx (100%) rename src/components/{ => common}/Form/index.ts (100%) rename src/components/{ => common}/GridList/GridList.stories.tsx (100%) rename src/components/{ => common}/GridList/GridList.tsx (95%) rename src/components/{ => common}/GridList/index.ts (100%) rename src/components/{ => common}/Link/Link.stories.tsx (100%) rename src/components/{ => common}/Link/Link.tsx (96%) rename src/components/{ => common}/Link/index.ts (100%) rename src/components/{ => common}/ListBox/ListBox.stories.tsx (100%) rename src/components/{ => common}/ListBox/ListBox.tsx (98%) rename src/components/{ => common}/ListBox/index.ts (100%) rename src/components/{ => common}/Menu/Menu.stories.tsx (100%) rename src/components/{ => common}/Menu/Menu.tsx (100%) rename src/components/{ => common}/Menu/index.ts (100%) rename src/components/{ => common}/Meter/Meter.stories.tsx (100%) rename src/components/{ => common}/Meter/Meter.tsx (96%) rename src/components/{ => common}/Meter/index.ts (100%) rename src/components/{ => common}/Modal/Modal.tsx (100%) rename src/components/{ => common}/Modal/index.ts (100%) rename src/components/{ => common}/Nav/Nav.tsx (98%) rename src/components/{ => common}/Nav/index.ts (100%) rename src/components/{ => common}/NumberField/NumberField.stories.tsx (100%) rename src/components/{ => common}/NumberField/NumberField.tsx (97%) rename src/components/{ => common}/NumberField/index.ts (100%) rename src/components/{ => common}/Popover/Popover.stories.tsx (100%) rename src/components/{ => common}/Popover/Popover.tsx (100%) rename src/components/{ => common}/Popover/index.ts (100%) rename src/components/{ => common}/ProgressBar/ProgressBar.stories.tsx (100%) rename src/components/{ => common}/ProgressBar/ProgressBar.tsx (96%) rename src/components/{ => common}/ProgressBar/index.ts (100%) rename src/components/{ => common}/RadioGroup/RadioGroup.stories.tsx (100%) rename src/components/{ => common}/RadioGroup/RadioGroup.tsx (96%) rename src/components/{ => common}/RadioGroup/index.ts (100%) rename src/components/{ => common}/RangeCalendar/RangeCalendar.stories.tsx (100%) rename src/components/{ => common}/RangeCalendar/RangeCalendar.tsx (98%) rename src/components/{ => common}/RangeCalendar/index.ts (100%) rename src/components/{ => common}/RichText/RichText.stories.tsx (100%) rename src/components/{ => common}/RichText/RichText.tsx (97%) rename src/components/{ => common}/RichText/index.ts (100%) rename src/components/{ => common}/SearchField/SearchField.stories.tsx (100%) rename src/components/{ => common}/SearchField/SearchField.tsx (95%) rename src/components/{ => common}/SearchField/index.ts (100%) rename src/components/{ => common}/Select/Select.stories.tsx (100%) rename src/components/{ => common}/Select/Select.tsx (97%) rename src/components/{ => common}/Select/index.ts (100%) rename src/components/{ => common}/Separator/Separator.tsx (100%) rename src/components/{ => common}/Separator/index.ts (100%) rename src/components/{ => common}/Slider/Slider.stories.tsx (100%) rename src/components/{ => common}/Slider/Slider.tsx (96%) rename src/components/{ => common}/Slider/index.ts (100%) rename src/components/{ => common}/Switch/Switch.stories.tsx (100%) rename src/components/{ => common}/Switch/Switch.tsx (95%) rename src/components/{ => common}/Switch/index.ts (100%) rename src/components/{ => common}/Table/Table.stories.tsx (100%) rename src/components/{ => common}/Table/Table.tsx (98%) rename src/components/{ => common}/Table/index.ts (100%) rename src/components/{ => common}/Tabs/Tabs.stories.tsx (100%) rename src/components/{ => common}/Tabs/Tabs.tsx (98%) rename src/components/{ => common}/Tabs/index.ts (100%) rename src/components/{ => common}/TagGroup/TagGroup.stories.tsx (100%) rename src/components/{ => common}/TagGroup/TagGroup.tsx (98%) rename src/components/{ => common}/TagGroup/index.ts (100%) rename src/components/{ => common}/TextArea/TextArea.stories.tsx (100%) rename src/components/{ => common}/TextArea/TextArea.tsx (93%) rename src/components/{ => common}/TextArea/index.ts (100%) rename src/components/{ => common}/TextField/TextField.stories.tsx (100%) rename src/components/{ => common}/TextField/TextField.tsx (96%) rename src/components/{ => common}/TextField/index.ts (100%) rename src/components/{ => common}/TimeField/TimeField.stories.tsx (100%) rename src/components/{ => common}/TimeField/TimeField.tsx (100%) rename src/components/{ => common}/TimeField/index.ts (100%) rename src/components/{ => common}/ToggleButton/ToggleButton.stories.tsx (100%) rename src/components/{ => common}/ToggleButton/ToggleButton.tsx (96%) rename src/components/{ => common}/ToggleButton/index.ts (100%) rename src/components/{ => common}/ToggleButtonGroup/ToggleButtonGroup.stories.tsx (100%) rename src/components/{ => common}/ToggleButtonGroup/ToggleButtonGroup.tsx (100%) rename src/components/{ => common}/ToggleButtonGroup/index.ts (100%) rename src/components/{ => common}/Toolbar/Toolbar.stories.tsx (100%) rename src/components/{ => common}/Toolbar/Toolbar.tsx (100%) rename src/components/{ => common}/Toolbar/index.ts (100%) rename src/components/{ => common}/Tooltip/Tooltip.stories.tsx (100%) rename src/components/{ => common}/Tooltip/Tooltip.tsx (100%) rename src/components/{ => common}/Tooltip/index.ts (100%) rename src/components/{ => common}/index.ts (86%) rename src/components/{ => quests}/DocumentCard/DocumentCard.tsx (92%) rename src/components/{ => quests}/DocumentCard/index.ts (100%) rename src/components/{ => quests}/ReadingScore/ReadingScore.stories.tsx (100%) rename src/components/{ => quests}/ReadingScore/ReadingScore.tsx (96%) rename src/components/{ => quests}/ReadingScore/index.ts (100%) rename src/components/{ => quests}/StatusSelect/StatusSelect.stories.tsx (100%) rename src/components/{ => quests}/StatusSelect/StatusSelect.tsx (98%) rename src/components/{ => quests}/StatusSelect/index.ts (100%) create mode 100644 src/components/quests/index.ts diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 81e1a9a..01027ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,10 +65,13 @@ Now that the development app is running, let's get familiar with what's inside. 📂 e2e # End-to-end Playwright tests 📂 public # Images, favicons, and other unprocessed assets 📂 src # Frontend application -├── 📂 components # Shared components +└── 📂 components # Shared components + ├── 📂 app # App-related global components (logos, sidebar, etc.) + ├── 📂 common # Design system components from React Aria + └── 📂 quests # Feature-specific quest components ├── 📂 routes # File-based routing using TanStack Router -├── 📂 styles # Global CSS (not much here, most of it's in Tailwind!) -└── main.tsx # Base of the project including common Providers +├── 📂 styles # Global CSS (not much here; most of it's in Tailwind!) +└── 📄 main.tsx # Base of the project including common Providers ``` ## Dependencies diff --git a/src/components/AppContent/AppContent.tsx b/src/components/app/AppContent/AppContent.tsx similarity index 100% rename from src/components/AppContent/AppContent.tsx rename to src/components/app/AppContent/AppContent.tsx diff --git a/src/components/AppContent/index.ts b/src/components/app/AppContent/index.ts similarity index 100% rename from src/components/AppContent/index.ts rename to src/components/app/AppContent/index.ts diff --git a/src/components/AppSidebar/AppSidebar.tsx b/src/components/app/AppSidebar/AppSidebar.tsx similarity index 93% rename from src/components/AppSidebar/AppSidebar.tsx rename to src/components/app/AppSidebar/AppSidebar.tsx index 0d26cbd..78777a7 100644 --- a/src/components/AppSidebar/AppSidebar.tsx +++ b/src/components/app/AppSidebar/AppSidebar.tsx @@ -1,23 +1,23 @@ +import { + Badge, + Button, + Link, + Menu, + MenuItem, + MenuSeparator, + MenuTrigger, + Popover, + SubmenuTrigger, + Tooltip, + TooltipTrigger, +} from "@/components/common"; import { useTheme } from "@/utils/useTheme"; import { useAuthActions } from "@convex-dev/auth/react"; import { api } from "@convex/_generated/api"; import { THEMES, type Theme } from "@convex/constants"; import { Authenticated, useQuery } from "convex/react"; import { CircleUser, Cog, GlobeLock, LogOut, Plus } from "lucide-react"; -import { Badge } from "../Badge"; -import { Button } from "../Button"; -import { Link } from "../Link"; import { Logo } from "../Logo"; -import { - Menu, - MenuItem, - MenuSeparator, - MenuTrigger, - SubmenuTrigger, -} from "../Menu"; -import { Popover } from "../Popover"; -import { Tooltip } from "../Tooltip"; -import { TooltipTrigger } from "../Tooltip"; type AppSidebarProps = { children: React.ReactNode; diff --git a/src/components/AppSidebar/index.ts b/src/components/app/AppSidebar/index.ts similarity index 100% rename from src/components/AppSidebar/index.ts rename to src/components/app/AppSidebar/index.ts diff --git a/src/components/Logo/Logo.stories.tsx b/src/components/app/Logo/Logo.stories.tsx similarity index 100% rename from src/components/Logo/Logo.stories.tsx rename to src/components/app/Logo/Logo.stories.tsx diff --git a/src/components/Logo/Logo.tsx b/src/components/app/Logo/Logo.tsx similarity index 100% rename from src/components/Logo/Logo.tsx rename to src/components/app/Logo/Logo.tsx diff --git a/src/components/Logo/index.ts b/src/components/app/Logo/index.ts similarity index 100% rename from src/components/Logo/index.ts rename to src/components/app/Logo/index.ts diff --git a/src/components/PageHeader/PageHeader.stories.tsx b/src/components/app/PageHeader/PageHeader.stories.tsx similarity index 89% rename from src/components/PageHeader/PageHeader.stories.tsx rename to src/components/app/PageHeader/PageHeader.stories.tsx index 6682d4f..830690c 100644 --- a/src/components/PageHeader/PageHeader.stories.tsx +++ b/src/components/app/PageHeader/PageHeader.stories.tsx @@ -1,7 +1,6 @@ import type { Meta, StoryObj } from "@storybook/react"; -import { Badge } from "../Badge"; -import { Button } from "../Button"; +import { Badge, Button } from "@/components/common"; import { PageHeader } from "./PageHeader"; const meta = { diff --git a/src/components/PageHeader/PageHeader.tsx b/src/components/app/PageHeader/PageHeader.tsx similarity index 100% rename from src/components/PageHeader/PageHeader.tsx rename to src/components/app/PageHeader/PageHeader.tsx diff --git a/src/components/PageHeader/index.ts b/src/components/app/PageHeader/index.ts similarity index 100% rename from src/components/PageHeader/index.ts rename to src/components/app/PageHeader/index.ts diff --git a/src/components/app/index.ts b/src/components/app/index.ts new file mode 100644 index 0000000..ae8399c --- /dev/null +++ b/src/components/app/index.ts @@ -0,0 +1,4 @@ +export * from "./AppContent"; +export * from "./AppSidebar"; +export * from "./Logo"; +export * from "./PageHeader"; diff --git a/src/components/AlertDialog/AlertDialog.stories.tsx b/src/components/common/AlertDialog/AlertDialog.stories.tsx similarity index 100% rename from src/components/AlertDialog/AlertDialog.stories.tsx rename to src/components/common/AlertDialog/AlertDialog.stories.tsx diff --git a/src/components/AlertDialog/AlertDialog.tsx b/src/components/common/AlertDialog/AlertDialog.tsx similarity index 100% rename from src/components/AlertDialog/AlertDialog.tsx rename to src/components/common/AlertDialog/AlertDialog.tsx diff --git a/src/components/AlertDialog/index.ts b/src/components/common/AlertDialog/index.ts similarity index 100% rename from src/components/AlertDialog/index.ts rename to src/components/common/AlertDialog/index.ts diff --git a/src/components/AnimateChangeInHeight/AnimateChangeInHeight.tsx b/src/components/common/AnimateChangeInHeight/AnimateChangeInHeight.tsx similarity index 100% rename from src/components/AnimateChangeInHeight/AnimateChangeInHeight.tsx rename to src/components/common/AnimateChangeInHeight/AnimateChangeInHeight.tsx diff --git a/src/components/AnimateChangeInHeight/index.ts b/src/components/common/AnimateChangeInHeight/index.ts similarity index 100% rename from src/components/AnimateChangeInHeight/index.ts rename to src/components/common/AnimateChangeInHeight/index.ts diff --git a/src/components/Badge/Badge.stories.tsx b/src/components/common/Badge/Badge.stories.tsx similarity index 100% rename from src/components/Badge/Badge.stories.tsx rename to src/components/common/Badge/Badge.stories.tsx diff --git a/src/components/Badge/Badge.tsx b/src/components/common/Badge/Badge.tsx similarity index 100% rename from src/components/Badge/Badge.tsx rename to src/components/common/Badge/Badge.tsx diff --git a/src/components/Badge/index.ts b/src/components/common/Badge/index.ts similarity index 100% rename from src/components/Badge/index.ts rename to src/components/common/Badge/index.ts diff --git a/src/components/Banner/Banner.stories.tsx b/src/components/common/Banner/Banner.stories.tsx similarity index 100% rename from src/components/Banner/Banner.stories.tsx rename to src/components/common/Banner/Banner.stories.tsx diff --git a/src/components/Banner/Banner.tsx b/src/components/common/Banner/Banner.tsx similarity index 100% rename from src/components/Banner/Banner.tsx rename to src/components/common/Banner/Banner.tsx diff --git a/src/components/Banner/index.ts b/src/components/common/Banner/index.ts similarity index 100% rename from src/components/Banner/index.ts rename to src/components/common/Banner/index.ts diff --git a/src/components/Breadcrumbs/Breadcrumbs.stories.tsx b/src/components/common/Breadcrumbs/Breadcrumbs.stories.tsx similarity index 100% rename from src/components/Breadcrumbs/Breadcrumbs.stories.tsx rename to src/components/common/Breadcrumbs/Breadcrumbs.stories.tsx diff --git a/src/components/Breadcrumbs/Breadcrumbs.tsx b/src/components/common/Breadcrumbs/Breadcrumbs.tsx similarity index 93% rename from src/components/Breadcrumbs/Breadcrumbs.tsx rename to src/components/common/Breadcrumbs/Breadcrumbs.tsx index 93627d1..093328b 100644 --- a/src/components/Breadcrumbs/Breadcrumbs.tsx +++ b/src/components/common/Breadcrumbs/Breadcrumbs.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { ChevronRight } from "lucide-react"; import { Breadcrumb as AriaBreadcrumb, @@ -8,7 +9,6 @@ import { } from "react-aria-components"; import { twMerge } from "tailwind-merge"; import { Link } from "../Link"; -import { composeTailwindRenderProps } from "../utils"; export function Breadcrumbs(props: BreadcrumbsProps) { return ( diff --git a/src/components/Breadcrumbs/index.ts b/src/components/common/Breadcrumbs/index.ts similarity index 100% rename from src/components/Breadcrumbs/index.ts rename to src/components/common/Breadcrumbs/index.ts diff --git a/src/components/Button/Button.stories.tsx b/src/components/common/Button/Button.stories.tsx similarity index 100% rename from src/components/Button/Button.stories.tsx rename to src/components/common/Button/Button.stories.tsx diff --git a/src/components/Button/Button.tsx b/src/components/common/Button/Button.tsx similarity index 97% rename from src/components/Button/Button.tsx rename to src/components/common/Button/Button.tsx index ca71977..7c3150a 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/common/Button/Button.tsx @@ -1,3 +1,4 @@ +import { focusRing } from "@/components/utils"; import type { LucideIcon } from "lucide-react"; import { Button as AriaButton, @@ -5,7 +6,6 @@ import { composeRenderProps, } from "react-aria-components"; import { tv } from "tailwind-variants"; -import { focusRing } from "../utils"; export interface ButtonProps extends AriaButtonProps { children?: React.ReactNode; diff --git a/src/components/Button/index.ts b/src/components/common/Button/index.ts similarity index 100% rename from src/components/Button/index.ts rename to src/components/common/Button/index.ts diff --git a/src/components/Calendar/Calendar.stories.tsx b/src/components/common/Calendar/Calendar.stories.tsx similarity index 100% rename from src/components/Calendar/Calendar.stories.tsx rename to src/components/common/Calendar/Calendar.stories.tsx diff --git a/src/components/Calendar/Calendar.tsx b/src/components/common/Calendar/Calendar.tsx similarity index 98% rename from src/components/Calendar/Calendar.tsx rename to src/components/common/Calendar/Calendar.tsx index 03bd004..5e723d6 100644 --- a/src/components/Calendar/Calendar.tsx +++ b/src/components/common/Calendar/Calendar.tsx @@ -1,3 +1,4 @@ +import { focusRing } from "@/components/utils"; import { ArrowLeft, ArrowRight } from "lucide-react"; import { Calendar as AriaCalendar, @@ -14,7 +15,6 @@ import { } from "react-aria-components"; import { tv } from "tailwind-variants"; import { Button } from "../Button"; -import { focusRing } from "../utils"; const cellStyles = tv({ extend: focusRing, diff --git a/src/components/Calendar/index.ts b/src/components/common/Calendar/index.ts similarity index 100% rename from src/components/Calendar/index.ts rename to src/components/common/Calendar/index.ts diff --git a/src/components/Card/Card.stories.tsx b/src/components/common/Card/Card.stories.tsx similarity index 100% rename from src/components/Card/Card.stories.tsx rename to src/components/common/Card/Card.stories.tsx diff --git a/src/components/Card/Card.tsx b/src/components/common/Card/Card.tsx similarity index 100% rename from src/components/Card/Card.tsx rename to src/components/common/Card/Card.tsx diff --git a/src/components/Card/index.ts b/src/components/common/Card/index.ts similarity index 100% rename from src/components/Card/index.ts rename to src/components/common/Card/index.ts diff --git a/src/components/Checkbox/Checkbox.stories.tsx b/src/components/common/Checkbox/Checkbox.stories.tsx similarity index 100% rename from src/components/Checkbox/Checkbox.stories.tsx rename to src/components/common/Checkbox/Checkbox.stories.tsx diff --git a/src/components/Checkbox/Checkbox.tsx b/src/components/common/Checkbox/Checkbox.tsx similarity index 97% rename from src/components/Checkbox/Checkbox.tsx rename to src/components/common/Checkbox/Checkbox.tsx index 1a1d057..a1e7a8c 100644 --- a/src/components/Checkbox/Checkbox.tsx +++ b/src/components/common/Checkbox/Checkbox.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import { Check, Minus } from "lucide-react"; import type { ReactNode } from "react"; import { @@ -10,7 +11,6 @@ import { } from "react-aria-components"; import { tv } from "tailwind-variants"; import { FieldDescription, FieldError, Label } from "../Field"; -import { composeTailwindRenderProps, focusRing } from "../utils"; export interface CheckboxGroupProps extends Omit { diff --git a/src/components/Checkbox/index.ts b/src/components/common/Checkbox/index.ts similarity index 100% rename from src/components/Checkbox/index.ts rename to src/components/common/Checkbox/index.ts diff --git a/src/components/ComboBox/ComboBox.stories.tsx b/src/components/common/ComboBox/ComboBox.stories.tsx similarity index 100% rename from src/components/ComboBox/ComboBox.stories.tsx rename to src/components/common/ComboBox/ComboBox.stories.tsx diff --git a/src/components/ComboBox/ComboBox.tsx b/src/components/common/ComboBox/ComboBox.tsx similarity index 96% rename from src/components/ComboBox/ComboBox.tsx rename to src/components/common/ComboBox/ComboBox.tsx index 0044f4b..26d5150 100644 --- a/src/components/ComboBox/ComboBox.tsx +++ b/src/components/common/ComboBox/ComboBox.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { ChevronDown } from "lucide-react"; import type React from "react"; import { @@ -21,7 +22,6 @@ import { type DropdownSectionProps, } from "../ListBox"; import { Popover } from "../Popover"; -import { composeTailwindRenderProps } from "../utils"; export interface ComboBoxProps extends Omit, "children"> { diff --git a/src/components/ComboBox/index.ts b/src/components/common/ComboBox/index.ts similarity index 100% rename from src/components/ComboBox/index.ts rename to src/components/common/ComboBox/index.ts diff --git a/src/components/Container/Container.tsx b/src/components/common/Container/Container.tsx similarity index 100% rename from src/components/Container/Container.tsx rename to src/components/common/Container/Container.tsx diff --git a/src/components/Container/index.ts b/src/components/common/Container/index.ts similarity index 100% rename from src/components/Container/index.ts rename to src/components/common/Container/index.ts diff --git a/src/components/DateField/DateField.stories.tsx b/src/components/common/DateField/DateField.stories.tsx similarity index 100% rename from src/components/DateField/DateField.stories.tsx rename to src/components/common/DateField/DateField.stories.tsx diff --git a/src/components/DateField/DateField.tsx b/src/components/common/DateField/DateField.tsx similarity index 96% rename from src/components/DateField/DateField.tsx rename to src/components/common/DateField/DateField.tsx index 3d3dd6e..7e5330b 100644 --- a/src/components/DateField/DateField.tsx +++ b/src/components/common/DateField/DateField.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { DateField as AriaDateField, type DateFieldProps as AriaDateFieldProps, @@ -14,7 +15,6 @@ import { Label, fieldGroupStyles, } from "../Field"; -import { composeTailwindRenderProps } from "../utils"; export interface DateFieldProps extends AriaDateFieldProps { diff --git a/src/components/DateField/index.ts b/src/components/common/DateField/index.ts similarity index 100% rename from src/components/DateField/index.ts rename to src/components/common/DateField/index.ts diff --git a/src/components/DatePicker/DatePicker.stories.tsx b/src/components/common/DatePicker/DatePicker.stories.tsx similarity index 100% rename from src/components/DatePicker/DatePicker.stories.tsx rename to src/components/common/DatePicker/DatePicker.stories.tsx diff --git a/src/components/DatePicker/DatePicker.tsx b/src/components/common/DatePicker/DatePicker.tsx similarity index 96% rename from src/components/DatePicker/DatePicker.tsx rename to src/components/common/DatePicker/DatePicker.tsx index 98800b3..89e7eff 100644 --- a/src/components/DatePicker/DatePicker.tsx +++ b/src/components/common/DatePicker/DatePicker.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { Calendar as CalendarIcon } from "lucide-react"; import { DatePicker as AriaDatePicker, @@ -11,7 +12,6 @@ import { DateInput } from "../DateField"; import { Dialog } from "../Dialog"; import { FieldDescription, FieldError, FieldGroup, Label } from "../Field"; import { Popover } from "../Popover"; -import { composeTailwindRenderProps } from "../utils"; export interface DatePickerProps extends AriaDatePickerProps { diff --git a/src/components/DatePicker/index.ts b/src/components/common/DatePicker/index.ts similarity index 100% rename from src/components/DatePicker/index.ts rename to src/components/common/DatePicker/index.ts diff --git a/src/components/DateRangePicker/DateRangePicker.stories.tsx b/src/components/common/DateRangePicker/DateRangePicker.stories.tsx similarity index 100% rename from src/components/DateRangePicker/DateRangePicker.stories.tsx rename to src/components/common/DateRangePicker/DateRangePicker.stories.tsx diff --git a/src/components/DateRangePicker/DateRangePicker.tsx b/src/components/common/DateRangePicker/DateRangePicker.tsx similarity index 96% rename from src/components/DateRangePicker/DateRangePicker.tsx rename to src/components/common/DateRangePicker/DateRangePicker.tsx index 9855c29..ffced7b 100644 --- a/src/components/DateRangePicker/DateRangePicker.tsx +++ b/src/components/common/DateRangePicker/DateRangePicker.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { Calendar as CalendarIcon } from "lucide-react"; import { DateRangePicker as AriaDateRangePicker, @@ -11,7 +12,6 @@ import { Dialog } from "../Dialog"; import { FieldDescription, FieldError, FieldGroup, Label } from "../Field"; import { Popover } from "../Popover"; import { RangeCalendar } from "../RangeCalendar"; -import { composeTailwindRenderProps } from "../utils"; export interface DateRangePickerProps extends AriaDateRangePickerProps { diff --git a/src/components/DateRangePicker/index.ts b/src/components/common/DateRangePicker/index.ts similarity index 100% rename from src/components/DateRangePicker/index.ts rename to src/components/common/DateRangePicker/index.ts diff --git a/src/components/Dialog/Dialog.tsx b/src/components/common/Dialog/Dialog.tsx similarity index 100% rename from src/components/Dialog/Dialog.tsx rename to src/components/common/Dialog/Dialog.tsx diff --git a/src/components/Dialog/index.ts b/src/components/common/Dialog/index.ts similarity index 100% rename from src/components/Dialog/index.ts rename to src/components/common/Dialog/index.ts diff --git a/src/components/Disclosure/Disclosure.stories.tsx b/src/components/common/Disclosure/Disclosure.stories.tsx similarity index 100% rename from src/components/Disclosure/Disclosure.stories.tsx rename to src/components/common/Disclosure/Disclosure.stories.tsx diff --git a/src/components/Disclosure/Disclosure.tsx b/src/components/common/Disclosure/Disclosure.tsx similarity index 100% rename from src/components/Disclosure/Disclosure.tsx rename to src/components/common/Disclosure/Disclosure.tsx diff --git a/src/components/Disclosure/index.ts b/src/components/common/Disclosure/index.ts similarity index 100% rename from src/components/Disclosure/index.ts rename to src/components/common/Disclosure/index.ts diff --git a/src/components/Empty/Empty.stories.tsx b/src/components/common/Empty/Empty.stories.tsx similarity index 100% rename from src/components/Empty/Empty.stories.tsx rename to src/components/common/Empty/Empty.stories.tsx diff --git a/src/components/Empty/Empty.tsx b/src/components/common/Empty/Empty.tsx similarity index 100% rename from src/components/Empty/Empty.tsx rename to src/components/common/Empty/Empty.tsx diff --git a/src/components/Empty/index.ts b/src/components/common/Empty/index.ts similarity index 100% rename from src/components/Empty/index.ts rename to src/components/common/Empty/index.ts diff --git a/src/components/Field/Field.tsx b/src/components/common/Field/Field.tsx similarity index 96% rename from src/components/Field/Field.tsx rename to src/components/common/Field/Field.tsx index d180f3f..e7a1075 100644 --- a/src/components/Field/Field.tsx +++ b/src/components/common/Field/Field.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import { FieldError as AriaFieldError, Input as AriaInput, @@ -15,7 +16,6 @@ import { } from "react-aria-components"; import { twMerge } from "tailwind-merge"; import { tv } from "tailwind-variants"; -import { composeTailwindRenderProps, focusRing } from "../utils"; export function Label(props: LabelProps) { return ( diff --git a/src/components/Field/index.ts b/src/components/common/Field/index.ts similarity index 100% rename from src/components/Field/index.ts rename to src/components/common/Field/index.ts diff --git a/src/components/FileTrigger/FileTrigger.stories.tsx b/src/components/common/FileTrigger/FileTrigger.stories.tsx similarity index 100% rename from src/components/FileTrigger/FileTrigger.stories.tsx rename to src/components/common/FileTrigger/FileTrigger.stories.tsx diff --git a/src/components/FileTrigger/FileTrigger.tsx b/src/components/common/FileTrigger/FileTrigger.tsx similarity index 100% rename from src/components/FileTrigger/FileTrigger.tsx rename to src/components/common/FileTrigger/FileTrigger.tsx diff --git a/src/components/FileTrigger/index.ts b/src/components/common/FileTrigger/index.ts similarity index 100% rename from src/components/FileTrigger/index.ts rename to src/components/common/FileTrigger/index.ts diff --git a/src/components/Form/Form.stories.tsx b/src/components/common/Form/Form.stories.tsx similarity index 100% rename from src/components/Form/Form.stories.tsx rename to src/components/common/Form/Form.stories.tsx diff --git a/src/components/Form/Form.tsx b/src/components/common/Form/Form.tsx similarity index 100% rename from src/components/Form/Form.tsx rename to src/components/common/Form/Form.tsx diff --git a/src/components/Form/index.ts b/src/components/common/Form/index.ts similarity index 100% rename from src/components/Form/index.ts rename to src/components/common/Form/index.ts diff --git a/src/components/GridList/GridList.stories.tsx b/src/components/common/GridList/GridList.stories.tsx similarity index 100% rename from src/components/GridList/GridList.stories.tsx rename to src/components/common/GridList/GridList.stories.tsx diff --git a/src/components/GridList/GridList.tsx b/src/components/common/GridList/GridList.tsx similarity index 95% rename from src/components/GridList/GridList.tsx rename to src/components/common/GridList/GridList.tsx index 7222d90..7f4ccd9 100644 --- a/src/components/GridList/GridList.tsx +++ b/src/components/common/GridList/GridList.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import { GridList as AriaGridList, GridListItem as AriaGridListItem, @@ -7,7 +8,6 @@ import { } from "react-aria-components"; import { tv } from "tailwind-variants"; import { Checkbox } from "../Checkbox"; -import { composeTailwindRenderProps, focusRing } from "../utils"; export function GridList({ children, diff --git a/src/components/GridList/index.ts b/src/components/common/GridList/index.ts similarity index 100% rename from src/components/GridList/index.ts rename to src/components/common/GridList/index.ts diff --git a/src/components/Link/Link.stories.tsx b/src/components/common/Link/Link.stories.tsx similarity index 100% rename from src/components/Link/Link.stories.tsx rename to src/components/common/Link/Link.stories.tsx diff --git a/src/components/Link/Link.tsx b/src/components/common/Link/Link.tsx similarity index 96% rename from src/components/Link/Link.tsx rename to src/components/common/Link/Link.tsx index 758916a..17e3fc1 100644 --- a/src/components/Link/Link.tsx +++ b/src/components/common/Link/Link.tsx @@ -1,3 +1,4 @@ +import { focusRing } from "@/components/utils"; import { Link as AriaLink, type LinkProps as AriaLinkProps, @@ -5,7 +6,6 @@ import { } from "react-aria-components"; import { tv } from "tailwind-variants"; import { type ButtonProps, buttonStyles } from "../Button"; -import { focusRing } from "../utils"; export interface LinkProps extends AriaLinkProps { variant?: "primary" | "secondary"; diff --git a/src/components/Link/index.ts b/src/components/common/Link/index.ts similarity index 100% rename from src/components/Link/index.ts rename to src/components/common/Link/index.ts diff --git a/src/components/ListBox/ListBox.stories.tsx b/src/components/common/ListBox/ListBox.stories.tsx similarity index 100% rename from src/components/ListBox/ListBox.stories.tsx rename to src/components/common/ListBox/ListBox.stories.tsx diff --git a/src/components/ListBox/ListBox.tsx b/src/components/common/ListBox/ListBox.tsx similarity index 98% rename from src/components/ListBox/ListBox.tsx rename to src/components/common/ListBox/ListBox.tsx index bc200bd..979d60c 100644 --- a/src/components/ListBox/ListBox.tsx +++ b/src/components/common/ListBox/ListBox.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import { Check } from "lucide-react"; import { ListBox as AriaListBox, @@ -11,7 +12,6 @@ import { composeRenderProps, } from "react-aria-components"; import { tv } from "tailwind-variants"; -import { composeTailwindRenderProps, focusRing } from "../utils"; type ListBoxProps = Omit, "layout" | "orientation">; diff --git a/src/components/ListBox/index.ts b/src/components/common/ListBox/index.ts similarity index 100% rename from src/components/ListBox/index.ts rename to src/components/common/ListBox/index.ts diff --git a/src/components/Menu/Menu.stories.tsx b/src/components/common/Menu/Menu.stories.tsx similarity index 100% rename from src/components/Menu/Menu.stories.tsx rename to src/components/common/Menu/Menu.stories.tsx diff --git a/src/components/Menu/Menu.tsx b/src/components/common/Menu/Menu.tsx similarity index 100% rename from src/components/Menu/Menu.tsx rename to src/components/common/Menu/Menu.tsx diff --git a/src/components/Menu/index.ts b/src/components/common/Menu/index.ts similarity index 100% rename from src/components/Menu/index.ts rename to src/components/common/Menu/index.ts diff --git a/src/components/Meter/Meter.stories.tsx b/src/components/common/Meter/Meter.stories.tsx similarity index 100% rename from src/components/Meter/Meter.stories.tsx rename to src/components/common/Meter/Meter.stories.tsx diff --git a/src/components/Meter/Meter.tsx b/src/components/common/Meter/Meter.tsx similarity index 96% rename from src/components/Meter/Meter.tsx rename to src/components/common/Meter/Meter.tsx index b6ce9fd..34dc82d 100644 --- a/src/components/Meter/Meter.tsx +++ b/src/components/common/Meter/Meter.tsx @@ -1,10 +1,10 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { AlertTriangle } from "lucide-react"; import { Meter as AriaMeter, type MeterProps as AriaMeterProps, } from "react-aria-components"; import { Label } from "../Field"; -import { composeTailwindRenderProps } from "../utils"; export interface MeterProps extends AriaMeterProps { label?: string; diff --git a/src/components/Meter/index.ts b/src/components/common/Meter/index.ts similarity index 100% rename from src/components/Meter/index.ts rename to src/components/common/Meter/index.ts diff --git a/src/components/Modal/Modal.tsx b/src/components/common/Modal/Modal.tsx similarity index 100% rename from src/components/Modal/Modal.tsx rename to src/components/common/Modal/Modal.tsx diff --git a/src/components/Modal/index.ts b/src/components/common/Modal/index.ts similarity index 100% rename from src/components/Modal/index.ts rename to src/components/common/Modal/index.ts diff --git a/src/components/Nav/Nav.tsx b/src/components/common/Nav/Nav.tsx similarity index 98% rename from src/components/Nav/Nav.tsx rename to src/components/common/Nav/Nav.tsx index 98f540f..b97a397 100644 --- a/src/components/Nav/Nav.tsx +++ b/src/components/common/Nav/Nav.tsx @@ -1,10 +1,10 @@ +import { focusRing } from "@/components/utils"; import { useMatchRoute } from "@tanstack/react-router"; import { ExternalLink, type LucideIcon } from "lucide-react"; import { Header } from "react-aria-components"; import { tv } from "tailwind-variants"; import { Badge } from "../Badge"; import { Link, type LinkProps } from "../Link"; -import { focusRing } from "../utils"; interface NavItemProps extends LinkProps { icon?: LucideIcon; diff --git a/src/components/Nav/index.ts b/src/components/common/Nav/index.ts similarity index 100% rename from src/components/Nav/index.ts rename to src/components/common/Nav/index.ts diff --git a/src/components/NumberField/NumberField.stories.tsx b/src/components/common/NumberField/NumberField.stories.tsx similarity index 100% rename from src/components/NumberField/NumberField.stories.tsx rename to src/components/common/NumberField/NumberField.stories.tsx diff --git a/src/components/NumberField/NumberField.tsx b/src/components/common/NumberField/NumberField.tsx similarity index 97% rename from src/components/NumberField/NumberField.tsx rename to src/components/common/NumberField/NumberField.tsx index 7d1008a..eb27cea 100644 --- a/src/components/NumberField/NumberField.tsx +++ b/src/components/common/NumberField/NumberField.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { ChevronDown, ChevronUp } from "lucide-react"; import { NumberField as AriaNumberField, @@ -14,7 +15,6 @@ import { Label, fieldBorderStyles, } from "../Field"; -import { composeTailwindRenderProps } from "../utils"; export interface NumberFieldProps extends AriaNumberFieldProps { label?: string; diff --git a/src/components/NumberField/index.ts b/src/components/common/NumberField/index.ts similarity index 100% rename from src/components/NumberField/index.ts rename to src/components/common/NumberField/index.ts diff --git a/src/components/Popover/Popover.stories.tsx b/src/components/common/Popover/Popover.stories.tsx similarity index 100% rename from src/components/Popover/Popover.stories.tsx rename to src/components/common/Popover/Popover.stories.tsx diff --git a/src/components/Popover/Popover.tsx b/src/components/common/Popover/Popover.tsx similarity index 100% rename from src/components/Popover/Popover.tsx rename to src/components/common/Popover/Popover.tsx diff --git a/src/components/Popover/index.ts b/src/components/common/Popover/index.ts similarity index 100% rename from src/components/Popover/index.ts rename to src/components/common/Popover/index.ts diff --git a/src/components/ProgressBar/ProgressBar.stories.tsx b/src/components/common/ProgressBar/ProgressBar.stories.tsx similarity index 100% rename from src/components/ProgressBar/ProgressBar.stories.tsx rename to src/components/common/ProgressBar/ProgressBar.stories.tsx diff --git a/src/components/ProgressBar/ProgressBar.tsx b/src/components/common/ProgressBar/ProgressBar.tsx similarity index 96% rename from src/components/ProgressBar/ProgressBar.tsx rename to src/components/common/ProgressBar/ProgressBar.tsx index f19b560..79fa734 100644 --- a/src/components/ProgressBar/ProgressBar.tsx +++ b/src/components/common/ProgressBar/ProgressBar.tsx @@ -1,10 +1,10 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { ProgressBar as AriaProgressBar, type ProgressBarProps as AriaProgressBarProps, } from "react-aria-components"; import { twMerge } from "tailwind-merge"; import { Label } from "../Field"; -import { composeTailwindRenderProps } from "../utils"; export interface ProgressBarProps extends AriaProgressBarProps { label: string; diff --git a/src/components/ProgressBar/index.ts b/src/components/common/ProgressBar/index.ts similarity index 100% rename from src/components/ProgressBar/index.ts rename to src/components/common/ProgressBar/index.ts diff --git a/src/components/RadioGroup/RadioGroup.stories.tsx b/src/components/common/RadioGroup/RadioGroup.stories.tsx similarity index 100% rename from src/components/RadioGroup/RadioGroup.stories.tsx rename to src/components/common/RadioGroup/RadioGroup.stories.tsx diff --git a/src/components/RadioGroup/RadioGroup.tsx b/src/components/common/RadioGroup/RadioGroup.tsx similarity index 96% rename from src/components/RadioGroup/RadioGroup.tsx rename to src/components/common/RadioGroup/RadioGroup.tsx index 2a95749..b474c06 100644 --- a/src/components/RadioGroup/RadioGroup.tsx +++ b/src/components/common/RadioGroup/RadioGroup.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import type { ReactNode } from "react"; import { Radio as AriaRadio, @@ -8,7 +9,6 @@ import { } from "react-aria-components"; import { tv } from "tailwind-variants"; import { FieldDescription, FieldError, Label } from "../Field"; -import { composeTailwindRenderProps, focusRing } from "../utils"; export interface RadioGroupProps extends Omit { label?: string; diff --git a/src/components/RadioGroup/index.ts b/src/components/common/RadioGroup/index.ts similarity index 100% rename from src/components/RadioGroup/index.ts rename to src/components/common/RadioGroup/index.ts diff --git a/src/components/RangeCalendar/RangeCalendar.stories.tsx b/src/components/common/RangeCalendar/RangeCalendar.stories.tsx similarity index 100% rename from src/components/RangeCalendar/RangeCalendar.stories.tsx rename to src/components/common/RangeCalendar/RangeCalendar.stories.tsx diff --git a/src/components/RangeCalendar/RangeCalendar.tsx b/src/components/common/RangeCalendar/RangeCalendar.tsx similarity index 98% rename from src/components/RangeCalendar/RangeCalendar.tsx rename to src/components/common/RangeCalendar/RangeCalendar.tsx index e3ef169..fcb1bd9 100644 --- a/src/components/RangeCalendar/RangeCalendar.tsx +++ b/src/components/common/RangeCalendar/RangeCalendar.tsx @@ -1,3 +1,4 @@ +import { focusRing } from "@/components/utils"; import { RangeCalendar as AriaRangeCalendar, type RangeCalendarProps as AriaRangeCalendarProps, @@ -9,7 +10,6 @@ import { } from "react-aria-components"; import { tv } from "tailwind-variants"; import { CalendarGridHeader, CalendarHeader } from "../Calendar"; -import { focusRing } from "../utils"; export interface RangeCalendarProps extends Omit, "visibleDuration"> { diff --git a/src/components/RangeCalendar/index.ts b/src/components/common/RangeCalendar/index.ts similarity index 100% rename from src/components/RangeCalendar/index.ts rename to src/components/common/RangeCalendar/index.ts diff --git a/src/components/RichText/RichText.stories.tsx b/src/components/common/RichText/RichText.stories.tsx similarity index 100% rename from src/components/RichText/RichText.stories.tsx rename to src/components/common/RichText/RichText.stories.tsx diff --git a/src/components/RichText/RichText.tsx b/src/components/common/RichText/RichText.tsx similarity index 97% rename from src/components/RichText/RichText.tsx rename to src/components/common/RichText/RichText.tsx index 5523735..da942f7 100644 --- a/src/components/RichText/RichText.tsx +++ b/src/components/common/RichText/RichText.tsx @@ -1,10 +1,10 @@ +import { ReadingScore } from "@/components/quests/ReadingScore"; import { BubbleMenu, EditorContent, useEditor } from "@tiptap/react"; import StarterKit from "@tiptap/starter-kit"; import { Bold, Italic } from "lucide-react"; import { useEffect } from "react"; import { twMerge } from "tailwind-merge"; import { tv } from "tailwind-variants"; -import { ReadingScore } from "../ReadingScore"; import { ToggleButton } from "../ToggleButton"; export interface RichTextProps { diff --git a/src/components/RichText/index.ts b/src/components/common/RichText/index.ts similarity index 100% rename from src/components/RichText/index.ts rename to src/components/common/RichText/index.ts diff --git a/src/components/SearchField/SearchField.stories.tsx b/src/components/common/SearchField/SearchField.stories.tsx similarity index 100% rename from src/components/SearchField/SearchField.stories.tsx rename to src/components/common/SearchField/SearchField.stories.tsx diff --git a/src/components/SearchField/SearchField.tsx b/src/components/common/SearchField/SearchField.tsx similarity index 95% rename from src/components/SearchField/SearchField.tsx rename to src/components/common/SearchField/SearchField.tsx index 9617bd9..2701a9e 100644 --- a/src/components/SearchField/SearchField.tsx +++ b/src/components/common/SearchField/SearchField.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { CircleX, Search } from "lucide-react"; import { SearchField as AriaSearchField, @@ -12,7 +13,6 @@ import { Input, Label, } from "../Field"; -import { composeTailwindRenderProps } from "../utils"; export interface SearchFieldProps extends AriaSearchFieldProps { label?: string; diff --git a/src/components/SearchField/index.ts b/src/components/common/SearchField/index.ts similarity index 100% rename from src/components/SearchField/index.ts rename to src/components/common/SearchField/index.ts diff --git a/src/components/Select/Select.stories.tsx b/src/components/common/Select/Select.stories.tsx similarity index 100% rename from src/components/Select/Select.stories.tsx rename to src/components/common/Select/Select.stories.tsx diff --git a/src/components/Select/Select.tsx b/src/components/common/Select/Select.tsx similarity index 97% rename from src/components/Select/Select.tsx rename to src/components/common/Select/Select.tsx index 8876e99..0e00fa8 100644 --- a/src/components/Select/Select.tsx +++ b/src/components/common/Select/Select.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import { ChevronDown } from "lucide-react"; import type React from "react"; import { @@ -17,7 +18,6 @@ import { type DropdownSectionProps, } from "../ListBox"; import { Popover } from "../Popover"; -import { composeTailwindRenderProps, focusRing } from "../utils"; const styles = tv({ extend: focusRing, diff --git a/src/components/Select/index.ts b/src/components/common/Select/index.ts similarity index 100% rename from src/components/Select/index.ts rename to src/components/common/Select/index.ts diff --git a/src/components/Separator/Separator.tsx b/src/components/common/Separator/Separator.tsx similarity index 100% rename from src/components/Separator/Separator.tsx rename to src/components/common/Separator/Separator.tsx diff --git a/src/components/Separator/index.ts b/src/components/common/Separator/index.ts similarity index 100% rename from src/components/Separator/index.ts rename to src/components/common/Separator/index.ts diff --git a/src/components/Slider/Slider.stories.tsx b/src/components/common/Slider/Slider.stories.tsx similarity index 100% rename from src/components/Slider/Slider.stories.tsx rename to src/components/common/Slider/Slider.stories.tsx diff --git a/src/components/Slider/Slider.tsx b/src/components/common/Slider/Slider.tsx similarity index 96% rename from src/components/Slider/Slider.tsx rename to src/components/common/Slider/Slider.tsx index b1ecbe2..e8e4086 100644 --- a/src/components/Slider/Slider.tsx +++ b/src/components/common/Slider/Slider.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import { Slider as AriaSlider, type SliderProps as AriaSliderProps, @@ -7,7 +8,6 @@ import { } from "react-aria-components"; import { tv } from "tailwind-variants"; import { Label } from "../Field"; -import { composeTailwindRenderProps, focusRing } from "../utils"; const trackStyles = tv({ base: "rounded-full", diff --git a/src/components/Slider/index.ts b/src/components/common/Slider/index.ts similarity index 100% rename from src/components/Slider/index.ts rename to src/components/common/Slider/index.ts diff --git a/src/components/Switch/Switch.stories.tsx b/src/components/common/Switch/Switch.stories.tsx similarity index 100% rename from src/components/Switch/Switch.stories.tsx rename to src/components/common/Switch/Switch.stories.tsx diff --git a/src/components/Switch/Switch.tsx b/src/components/common/Switch/Switch.tsx similarity index 95% rename from src/components/Switch/Switch.tsx rename to src/components/common/Switch/Switch.tsx index ffcf51b..c4103ac 100644 --- a/src/components/Switch/Switch.tsx +++ b/src/components/common/Switch/Switch.tsx @@ -1,10 +1,10 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import type React from "react"; import { Switch as AriaSwitch, type SwitchProps as AriaSwitchProps, } from "react-aria-components"; import { tv } from "tailwind-variants"; -import { composeTailwindRenderProps, focusRing } from "../utils"; export interface SwitchProps extends Omit { children: React.ReactNode; diff --git a/src/components/Switch/index.ts b/src/components/common/Switch/index.ts similarity index 100% rename from src/components/Switch/index.ts rename to src/components/common/Switch/index.ts diff --git a/src/components/Table/Table.stories.tsx b/src/components/common/Table/Table.stories.tsx similarity index 100% rename from src/components/Table/Table.stories.tsx rename to src/components/common/Table/Table.stories.tsx diff --git a/src/components/Table/Table.tsx b/src/components/common/Table/Table.tsx similarity index 98% rename from src/components/Table/Table.tsx rename to src/components/common/Table/Table.tsx index 32223a4..638bed8 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/common/Table/Table.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import { ChevronUp } from "lucide-react"; import { Cell as AriaCell, @@ -22,7 +23,6 @@ import { } from "react-aria-components"; import { tv } from "tailwind-variants"; import { Checkbox } from "../Checkbox"; -import { composeTailwindRenderProps, focusRing } from "../utils"; export function Table(props: TableProps) { return ( diff --git a/src/components/Table/index.ts b/src/components/common/Table/index.ts similarity index 100% rename from src/components/Table/index.ts rename to src/components/common/Table/index.ts diff --git a/src/components/Tabs/Tabs.stories.tsx b/src/components/common/Tabs/Tabs.stories.tsx similarity index 100% rename from src/components/Tabs/Tabs.stories.tsx rename to src/components/common/Tabs/Tabs.stories.tsx diff --git a/src/components/Tabs/Tabs.tsx b/src/components/common/Tabs/Tabs.tsx similarity index 98% rename from src/components/Tabs/Tabs.tsx rename to src/components/common/Tabs/Tabs.tsx index 7c9e181..e989ecf 100644 --- a/src/components/Tabs/Tabs.tsx +++ b/src/components/common/Tabs/Tabs.tsx @@ -1,3 +1,4 @@ +import { focusRing } from "@/components/utils"; import { Tab as AriaTab, TabList as AriaTabList, @@ -10,7 +11,6 @@ import { composeRenderProps, } from "react-aria-components"; import { tv } from "tailwind-variants"; -import { focusRing } from "../utils"; const tabsStyles = tv({ base: "flex gap-4", diff --git a/src/components/Tabs/index.ts b/src/components/common/Tabs/index.ts similarity index 100% rename from src/components/Tabs/index.ts rename to src/components/common/Tabs/index.ts diff --git a/src/components/TagGroup/TagGroup.stories.tsx b/src/components/common/TagGroup/TagGroup.stories.tsx similarity index 100% rename from src/components/TagGroup/TagGroup.stories.tsx rename to src/components/common/TagGroup/TagGroup.stories.tsx diff --git a/src/components/TagGroup/TagGroup.tsx b/src/components/common/TagGroup/TagGroup.tsx similarity index 98% rename from src/components/TagGroup/TagGroup.tsx rename to src/components/common/TagGroup/TagGroup.tsx index 2c6ee73..b75a4c6 100644 --- a/src/components/TagGroup/TagGroup.tsx +++ b/src/components/common/TagGroup/TagGroup.tsx @@ -1,3 +1,4 @@ +import { focusRing } from "@/components/utils"; import { X } from "lucide-react"; import { Tag as AriaTag, @@ -13,7 +14,6 @@ import { import { twMerge } from "tailwind-merge"; import { tv } from "tailwind-variants"; import { FieldDescription, Label } from "../Field"; -import { focusRing } from "../utils"; const tagStyles = tv({ extend: focusRing, diff --git a/src/components/TagGroup/index.ts b/src/components/common/TagGroup/index.ts similarity index 100% rename from src/components/TagGroup/index.ts rename to src/components/common/TagGroup/index.ts diff --git a/src/components/TextArea/TextArea.stories.tsx b/src/components/common/TextArea/TextArea.stories.tsx similarity index 100% rename from src/components/TextArea/TextArea.stories.tsx rename to src/components/common/TextArea/TextArea.stories.tsx diff --git a/src/components/TextArea/TextArea.tsx b/src/components/common/TextArea/TextArea.tsx similarity index 93% rename from src/components/TextArea/TextArea.tsx rename to src/components/common/TextArea/TextArea.tsx index 547d7fe..3b10b70 100644 --- a/src/components/TextArea/TextArea.tsx +++ b/src/components/common/TextArea/TextArea.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps, focusRing } from "@/components/utils"; import { TextField as AriaTextField, type TextFieldProps as AriaTextFieldProps, @@ -11,7 +12,6 @@ import { Label, fieldBorderStyles, } from "../Field"; -import { composeTailwindRenderProps, focusRing } from "../utils"; const inputStyles = tv({ extend: focusRing, diff --git a/src/components/TextArea/index.ts b/src/components/common/TextArea/index.ts similarity index 100% rename from src/components/TextArea/index.ts rename to src/components/common/TextArea/index.ts diff --git a/src/components/TextField/TextField.stories.tsx b/src/components/common/TextField/TextField.stories.tsx similarity index 100% rename from src/components/TextField/TextField.stories.tsx rename to src/components/common/TextField/TextField.stories.tsx diff --git a/src/components/TextField/TextField.tsx b/src/components/common/TextField/TextField.tsx similarity index 96% rename from src/components/TextField/TextField.tsx rename to src/components/common/TextField/TextField.tsx index b68e450..085a43e 100644 --- a/src/components/TextField/TextField.tsx +++ b/src/components/common/TextField/TextField.tsx @@ -1,3 +1,4 @@ +import { composeTailwindRenderProps } from "@/components/utils"; import { Eye, EyeOff } from "lucide-react"; import { useState } from "react"; import { @@ -14,7 +15,6 @@ import { Label, } from "../Field"; import { Tooltip, TooltipTrigger } from "../Tooltip"; -import { composeTailwindRenderProps } from "../utils"; export interface TextFieldProps extends AriaTextFieldProps { label?: string; diff --git a/src/components/TextField/index.ts b/src/components/common/TextField/index.ts similarity index 100% rename from src/components/TextField/index.ts rename to src/components/common/TextField/index.ts diff --git a/src/components/TimeField/TimeField.stories.tsx b/src/components/common/TimeField/TimeField.stories.tsx similarity index 100% rename from src/components/TimeField/TimeField.stories.tsx rename to src/components/common/TimeField/TimeField.stories.tsx diff --git a/src/components/TimeField/TimeField.tsx b/src/components/common/TimeField/TimeField.tsx similarity index 100% rename from src/components/TimeField/TimeField.tsx rename to src/components/common/TimeField/TimeField.tsx diff --git a/src/components/TimeField/index.ts b/src/components/common/TimeField/index.ts similarity index 100% rename from src/components/TimeField/index.ts rename to src/components/common/TimeField/index.ts diff --git a/src/components/ToggleButton/ToggleButton.stories.tsx b/src/components/common/ToggleButton/ToggleButton.stories.tsx similarity index 100% rename from src/components/ToggleButton/ToggleButton.stories.tsx rename to src/components/common/ToggleButton/ToggleButton.stories.tsx diff --git a/src/components/ToggleButton/ToggleButton.tsx b/src/components/common/ToggleButton/ToggleButton.tsx similarity index 96% rename from src/components/ToggleButton/ToggleButton.tsx rename to src/components/common/ToggleButton/ToggleButton.tsx index e305b25..8c3447e 100644 --- a/src/components/ToggleButton/ToggleButton.tsx +++ b/src/components/common/ToggleButton/ToggleButton.tsx @@ -1,3 +1,4 @@ +import { focusRing } from "@/components/utils"; import type { LucideIcon } from "lucide-react"; import { ToggleButton as AriaToggleButton, @@ -6,7 +7,6 @@ import { } from "react-aria-components"; import { tv } from "tailwind-variants"; import { buttonStyles } from "../Button"; -import { focusRing } from "../utils"; export interface ToggleButtonProps extends AriaToggleButtonProps { children?: React.ReactNode; diff --git a/src/components/ToggleButton/index.ts b/src/components/common/ToggleButton/index.ts similarity index 100% rename from src/components/ToggleButton/index.ts rename to src/components/common/ToggleButton/index.ts diff --git a/src/components/ToggleButtonGroup/ToggleButtonGroup.stories.tsx b/src/components/common/ToggleButtonGroup/ToggleButtonGroup.stories.tsx similarity index 100% rename from src/components/ToggleButtonGroup/ToggleButtonGroup.stories.tsx rename to src/components/common/ToggleButtonGroup/ToggleButtonGroup.stories.tsx diff --git a/src/components/ToggleButtonGroup/ToggleButtonGroup.tsx b/src/components/common/ToggleButtonGroup/ToggleButtonGroup.tsx similarity index 100% rename from src/components/ToggleButtonGroup/ToggleButtonGroup.tsx rename to src/components/common/ToggleButtonGroup/ToggleButtonGroup.tsx diff --git a/src/components/ToggleButtonGroup/index.ts b/src/components/common/ToggleButtonGroup/index.ts similarity index 100% rename from src/components/ToggleButtonGroup/index.ts rename to src/components/common/ToggleButtonGroup/index.ts diff --git a/src/components/Toolbar/Toolbar.stories.tsx b/src/components/common/Toolbar/Toolbar.stories.tsx similarity index 100% rename from src/components/Toolbar/Toolbar.stories.tsx rename to src/components/common/Toolbar/Toolbar.stories.tsx diff --git a/src/components/Toolbar/Toolbar.tsx b/src/components/common/Toolbar/Toolbar.tsx similarity index 100% rename from src/components/Toolbar/Toolbar.tsx rename to src/components/common/Toolbar/Toolbar.tsx diff --git a/src/components/Toolbar/index.ts b/src/components/common/Toolbar/index.ts similarity index 100% rename from src/components/Toolbar/index.ts rename to src/components/common/Toolbar/index.ts diff --git a/src/components/Tooltip/Tooltip.stories.tsx b/src/components/common/Tooltip/Tooltip.stories.tsx similarity index 100% rename from src/components/Tooltip/Tooltip.stories.tsx rename to src/components/common/Tooltip/Tooltip.stories.tsx diff --git a/src/components/Tooltip/Tooltip.tsx b/src/components/common/Tooltip/Tooltip.tsx similarity index 100% rename from src/components/Tooltip/Tooltip.tsx rename to src/components/common/Tooltip/Tooltip.tsx diff --git a/src/components/Tooltip/index.ts b/src/components/common/Tooltip/index.ts similarity index 100% rename from src/components/Tooltip/index.ts rename to src/components/common/Tooltip/index.ts diff --git a/src/components/index.ts b/src/components/common/index.ts similarity index 86% rename from src/components/index.ts rename to src/components/common/index.ts index 336bd56..e400a1d 100644 --- a/src/components/index.ts +++ b/src/components/common/index.ts @@ -1,7 +1,5 @@ export * from "./AlertDialog"; export * from "./AnimateChangeInHeight"; -export * from "./AppContent"; -export * from "./AppSidebar"; export * from "./Badge"; export * from "./Banner"; export * from "./Breadcrumbs"; @@ -16,7 +14,6 @@ export * from "./DatePicker"; export * from "./DateRangePicker"; export * from "./Dialog"; export * from "./Disclosure"; -export * from "./DocumentCard"; export * from "./Empty"; export * from "./Field"; export * from "./FileTrigger"; @@ -24,24 +21,20 @@ export * from "./Form"; export * from "./GridList"; export * from "./Link"; export * from "./ListBox"; -export * from "./Logo"; export * from "./Menu"; export * from "./Meter"; export * from "./Modal"; export * from "./Nav"; export * from "./NumberField"; -export * from "./PageHeader"; export * from "./Popover"; export * from "./ProgressBar"; export * from "./RadioGroup"; export * from "./RangeCalendar"; -export * from "./ReadingScore"; export * from "./RichText"; export * from "./SearchField"; export * from "./Select"; export * from "./Separator"; export * from "./Slider"; -export * from "./StatusSelect"; export * from "./Switch"; export * from "./Table"; export * from "./Tabs"; diff --git a/src/components/DocumentCard/DocumentCard.tsx b/src/components/quests/DocumentCard/DocumentCard.tsx similarity index 92% rename from src/components/DocumentCard/DocumentCard.tsx rename to src/components/quests/DocumentCard/DocumentCard.tsx index 328b69b..67bed94 100644 --- a/src/components/DocumentCard/DocumentCard.tsx +++ b/src/components/quests/DocumentCard/DocumentCard.tsx @@ -1,6 +1,5 @@ +import { Link, Tooltip, TooltipTrigger } from "@/components/common"; import { CircleArrowDown } from "lucide-react"; -import { Link } from "../Link"; -import { Tooltip, TooltipTrigger } from "../Tooltip"; export type DocumentCardProps = { title: string; diff --git a/src/components/DocumentCard/index.ts b/src/components/quests/DocumentCard/index.ts similarity index 100% rename from src/components/DocumentCard/index.ts rename to src/components/quests/DocumentCard/index.ts diff --git a/src/components/ReadingScore/ReadingScore.stories.tsx b/src/components/quests/ReadingScore/ReadingScore.stories.tsx similarity index 100% rename from src/components/ReadingScore/ReadingScore.stories.tsx rename to src/components/quests/ReadingScore/ReadingScore.stories.tsx diff --git a/src/components/ReadingScore/ReadingScore.tsx b/src/components/quests/ReadingScore/ReadingScore.tsx similarity index 96% rename from src/components/ReadingScore/ReadingScore.tsx rename to src/components/quests/ReadingScore/ReadingScore.tsx index e1660de..966f0d2 100644 --- a/src/components/ReadingScore/ReadingScore.tsx +++ b/src/components/quests/ReadingScore/ReadingScore.tsx @@ -1,6 +1,6 @@ +import { Badge } from "@/components/common"; import { Frown, Meh, Smile } from "lucide-react"; import rs from "text-readability"; -import { Badge } from "../Badge"; /** * A badge that displays a grade-level readability score of a given text. diff --git a/src/components/ReadingScore/index.ts b/src/components/quests/ReadingScore/index.ts similarity index 100% rename from src/components/ReadingScore/index.ts rename to src/components/quests/ReadingScore/index.ts diff --git a/src/components/StatusSelect/StatusSelect.stories.tsx b/src/components/quests/StatusSelect/StatusSelect.stories.tsx similarity index 100% rename from src/components/StatusSelect/StatusSelect.stories.tsx rename to src/components/quests/StatusSelect/StatusSelect.stories.tsx diff --git a/src/components/StatusSelect/StatusSelect.tsx b/src/components/quests/StatusSelect/StatusSelect.tsx similarity index 98% rename from src/components/StatusSelect/StatusSelect.tsx rename to src/components/quests/StatusSelect/StatusSelect.tsx index 79e3771..f693fdf 100644 --- a/src/components/StatusSelect/StatusSelect.tsx +++ b/src/components/quests/StatusSelect/StatusSelect.tsx @@ -1,8 +1,3 @@ -import { STATUS, type Status } from "@convex/constants"; -import { ChevronDown } from "lucide-react"; -import { useState } from "react"; -import type { Selection } from "react-aria-components"; -import { tv } from "tailwind-variants"; import { Badge, type BadgeProps, @@ -13,7 +8,12 @@ import { MenuTrigger, Tooltip, TooltipTrigger, -} from "../"; +} from "@/components/common"; +import { STATUS, type Status } from "@convex/constants"; +import { ChevronDown } from "lucide-react"; +import { useState } from "react"; +import type { Selection } from "react-aria-components"; +import { tv } from "tailwind-variants"; interface StatusBadgeProps extends Omit { status: Status; diff --git a/src/components/StatusSelect/index.ts b/src/components/quests/StatusSelect/index.ts similarity index 100% rename from src/components/StatusSelect/index.ts rename to src/components/quests/StatusSelect/index.ts diff --git a/src/components/quests/index.ts b/src/components/quests/index.ts new file mode 100644 index 0000000..055ff0d --- /dev/null +++ b/src/components/quests/index.ts @@ -0,0 +1,3 @@ +export * from "./DocumentCard"; +export * from "./ReadingScore"; +export * from "./StatusSelect"; diff --git a/src/main.tsx b/src/main.tsx index ba2a638..e3480a2 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,4 +1,5 @@ import "./styles/index.css"; +import { Empty } from "@/components/common"; import { ConvexAuthProvider } from "@convex-dev/auth/react"; import { api } from "@convex/_generated/api"; import { RouterProvider, createRouter } from "@tanstack/react-router"; @@ -13,7 +14,6 @@ import { ThemeProvider } from "next-themes"; import { StrictMode, useEffect } from "react"; import { createRoot } from "react-dom/client"; import { HelmetProvider } from "react-helmet-async"; -import { Empty } from "./components"; import { routeTree } from "./routeTree.gen"; const convex = new ConvexReactClient(import.meta.env.VITE_CONVEX_URL); diff --git a/src/routes/_authenticated/_home.tsx b/src/routes/_authenticated/_home.tsx index f706936..6ab9ea0 100644 --- a/src/routes/_authenticated/_home.tsx +++ b/src/routes/_authenticated/_home.tsx @@ -1,3 +1,4 @@ +import { AppSidebar } from "@/components/app"; import { Badge, Container, @@ -6,13 +7,12 @@ import { NavGroup, NavItem, ProgressBar, - StatusBadge, ToggleButton, ToggleButtonGroup, Tooltip, TooltipTrigger, -} from "@/components"; -import { AppSidebar } from "@/components/AppSidebar/AppSidebar"; +} from "@/components/common"; +import { StatusBadge } from "@/components/quests"; import { api } from "@convex/_generated/api"; import { CATEGORIES, diff --git a/src/routes/_authenticated/_home/quests.$questId.tsx b/src/routes/_authenticated/_home/quests.$questId.tsx index 2bd35db..9ca2e74 100644 --- a/src/routes/_authenticated/_home/quests.$questId.tsx +++ b/src/routes/_authenticated/_home/quests.$questId.tsx @@ -1,21 +1,19 @@ +import { AppContent, PageHeader } from "@/components/app"; import { - AppContent, Badge, Button, DialogTrigger, - DocumentCard, Empty, Link, Menu, MenuItem, MenuTrigger, - PageHeader, Popover, RichText, - StatusSelect, Tooltip, TooltipTrigger, -} from "@/components"; +} from "@/components/common"; +import { DocumentCard, StatusSelect } from "@/components/quests"; import { api } from "@convex/_generated/api"; import type { Id } from "@convex/_generated/dataModel"; import type { Cost, Status, TimeRequired } from "@convex/constants"; diff --git a/src/routes/_authenticated/admin/fields/index.tsx b/src/routes/_authenticated/admin/fields/index.tsx index d37d844..3a0f0d5 100644 --- a/src/routes/_authenticated/admin/fields/index.tsx +++ b/src/routes/_authenticated/admin/fields/index.tsx @@ -1,9 +1,9 @@ +import { PageHeader } from "@/components/app"; import { Button, Empty, Form, Modal, - PageHeader, Select, SelectItem, Table, @@ -13,7 +13,7 @@ import { TableHeader, TableRow, TextField, -} from "@/components"; +} from "@/components/common"; import { api } from "@convex/_generated/api"; import type { DataModel, Id } from "@convex/_generated/dataModel"; import { FIELDS, type Field } from "@convex/constants"; diff --git a/src/routes/_authenticated/admin/forms/$formId.tsx b/src/routes/_authenticated/admin/forms/$formId.tsx index 695364d..bd20576 100644 --- a/src/routes/_authenticated/admin/forms/$formId.tsx +++ b/src/routes/_authenticated/admin/forms/$formId.tsx @@ -1,4 +1,5 @@ -import { Badge, Link, PageHeader } from "@/components"; +import { PageHeader } from "@/components/app"; +import { Badge, Link } from "@/components/common"; import { api } from "@convex/_generated/api"; import type { Id } from "@convex/_generated/dataModel"; import { createFileRoute } from "@tanstack/react-router"; diff --git a/src/routes/_authenticated/admin/forms/index.tsx b/src/routes/_authenticated/admin/forms/index.tsx index b06a999..d6cf2b2 100644 --- a/src/routes/_authenticated/admin/forms/index.tsx +++ b/src/routes/_authenticated/admin/forms/index.tsx @@ -1,3 +1,4 @@ +import { PageHeader } from "@/components/app"; import { Badge, Button, @@ -9,7 +10,6 @@ import { MenuItem, MenuTrigger, Modal, - PageHeader, Select, SelectItem, Table, @@ -19,7 +19,7 @@ import { TableHeader, TableRow, TextField, -} from "@/components"; +} from "@/components/common"; import { api } from "@convex/_generated/api"; import type { DataModel, Id } from "@convex/_generated/dataModel"; import { JURISDICTIONS, type Jurisdiction } from "@convex/constants"; diff --git a/src/routes/_authenticated/admin/quests/$questId.tsx b/src/routes/_authenticated/admin/quests/$questId.tsx index 0561547..7773d6a 100644 --- a/src/routes/_authenticated/admin/quests/$questId.tsx +++ b/src/routes/_authenticated/admin/quests/$questId.tsx @@ -1,15 +1,15 @@ +import { PageHeader } from "@/components/app"; import { AnimateChangeInHeight, Button, Checkbox, Form, NumberField, - PageHeader, RichText, Select, SelectItem, TextField, -} from "@/components"; +} from "@/components/common"; import { api } from "@convex/_generated/api"; import type { Id } from "@convex/_generated/dataModel"; import { diff --git a/src/routes/_authenticated/admin/quests/index.tsx b/src/routes/_authenticated/admin/quests/index.tsx index cb1c564..ad39967 100644 --- a/src/routes/_authenticated/admin/quests/index.tsx +++ b/src/routes/_authenticated/admin/quests/index.tsx @@ -1,3 +1,4 @@ +import { PageHeader } from "@/components/app"; import { Badge, Button, @@ -7,7 +8,6 @@ import { MenuItem, MenuTrigger, Modal, - PageHeader, Select, SelectItem, Table, @@ -17,7 +17,7 @@ import { TableHeader, TableRow, TextField, -} from "@/components"; +} from "@/components/common"; import { api } from "@convex/_generated/api"; import type { DataModel } from "@convex/_generated/dataModel"; import { diff --git a/src/routes/_authenticated/admin/route.tsx b/src/routes/_authenticated/admin/route.tsx index 1724c58..d69766c 100644 --- a/src/routes/_authenticated/admin/route.tsx +++ b/src/routes/_authenticated/admin/route.tsx @@ -1,11 +1,5 @@ -import { - AppContent, - AppSidebar, - Container, - Nav, - NavGroup, - NavItem, -} from "@/components"; +import { AppContent, AppSidebar } from "@/components/app"; +import { Container, Nav, NavGroup, NavItem } from "@/components/common"; import { Outlet, createFileRoute, redirect } from "@tanstack/react-router"; import { FileText, Milestone, RectangleEllipsis } from "lucide-react"; diff --git a/src/routes/_authenticated/browse/index.tsx b/src/routes/_authenticated/browse/index.tsx index 6cf1e51..a35c775 100644 --- a/src/routes/_authenticated/browse/index.tsx +++ b/src/routes/_authenticated/browse/index.tsx @@ -1,14 +1,12 @@ +import { AppContent, AppSidebar, PageHeader } from "@/components/app"; import { - AppContent, - AppSidebar, Badge, Button, Card, Container, Link, - PageHeader, SearchField, -} from "@/components"; +} from "@/components/common"; import { api } from "@convex/_generated/api"; import type { Doc } from "@convex/_generated/dataModel"; import { CATEGORIES, type Category } from "@convex/constants"; diff --git a/src/routes/_authenticated/settings/account.tsx b/src/routes/_authenticated/settings/account.tsx index 040f4ad..10d38ef 100644 --- a/src/routes/_authenticated/settings/account.tsx +++ b/src/routes/_authenticated/settings/account.tsx @@ -1,16 +1,16 @@ +import { PageHeader } from "@/components/app"; import { Button, Card, Form, Modal, - PageHeader, Select, SelectItem, Switch, TextField, ToggleButton, ToggleButtonGroup, -} from "@/components"; +} from "@/components/common"; import { useTheme } from "@/utils/useTheme"; import { useAuthActions } from "@convex-dev/auth/react"; import { api } from "@convex/_generated/api"; diff --git a/src/routes/_authenticated/settings/data.tsx b/src/routes/_authenticated/settings/data.tsx index 090c559..1dd0577 100644 --- a/src/routes/_authenticated/settings/data.tsx +++ b/src/routes/_authenticated/settings/data.tsx @@ -1,4 +1,5 @@ -import { Banner, PageHeader } from "@/components"; +import { PageHeader } from "@/components/app"; +import { Banner } from "@/components/common"; import { createFileRoute } from "@tanstack/react-router"; import { Lock } from "lucide-react"; diff --git a/src/routes/_authenticated/settings/route.tsx b/src/routes/_authenticated/settings/route.tsx index 50b6462..fa53bdd 100644 --- a/src/routes/_authenticated/settings/route.tsx +++ b/src/routes/_authenticated/settings/route.tsx @@ -1,11 +1,5 @@ -import { - AppContent, - AppSidebar, - Container, - Nav, - NavGroup, - NavItem, -} from "@/components"; +import { AppContent, AppSidebar } from "@/components/app"; +import { Container, Nav, NavGroup, NavItem } from "@/components/common"; import { Outlet, createFileRoute } from "@tanstack/react-router"; import { Bug, diff --git a/src/routes/_unauthenticated/signin.tsx b/src/routes/_unauthenticated/signin.tsx index d8f89cc..959b985 100644 --- a/src/routes/_unauthenticated/signin.tsx +++ b/src/routes/_unauthenticated/signin.tsx @@ -1,3 +1,4 @@ +import { Logo } from "@/components/app"; import { AnimateChangeInHeight, Banner, @@ -5,7 +6,6 @@ import { Card, Form, Link, - Logo, Tab, TabList, TabPanel, @@ -13,7 +13,7 @@ import { TextField, Tooltip, TooltipTrigger, -} from "@/components"; +} from "@/components/common"; import { useAuthActions } from "@convex-dev/auth/react"; import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { ConvexError } from "convex/values";