Skip to content

Commit

Permalink
chore: Reorganize components (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
evadecker authored Nov 28, 2024
1 parent 422078e commit 199c48d
Show file tree
Hide file tree
Showing 173 changed files with 93 additions and 106 deletions.
9 changes: 6 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/components/app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "./AppContent";
export * from "./AppSidebar";
export * from "./Logo";
export * from "./PageHeader";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps } from "@/components/utils";
import { ChevronRight } from "lucide-react";
import {
Breadcrumb as AriaBreadcrumb,
Expand All @@ -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<T extends object>(props: BreadcrumbsProps<T>) {
return (
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { focusRing } from "@/components/utils";
import type { LucideIcon } from "lucide-react";
import {
Button as AriaButton,
type ButtonProps as AriaButtonProps,
composeRenderProps,
} from "react-aria-components";
import { tv } from "tailwind-variants";
import { focusRing } from "../utils";

export interface ButtonProps extends AriaButtonProps {
children?: React.ReactNode;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { focusRing } from "@/components/utils";
import { ArrowLeft, ArrowRight } from "lucide-react";
import {
Calendar as AriaCalendar,
Expand All @@ -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,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps, focusRing } from "@/components/utils";
import { Check, Minus } from "lucide-react";
import type { ReactNode } from "react";
import {
Expand All @@ -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<AriaCheckboxGroupProps, "children"> {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps } from "@/components/utils";
import { ChevronDown } from "lucide-react";
import type React from "react";
import {
Expand All @@ -21,7 +22,6 @@ import {
type DropdownSectionProps,
} from "../ListBox";
import { Popover } from "../Popover";
import { composeTailwindRenderProps } from "../utils";

export interface ComboBoxProps<T extends object>
extends Omit<AriaComboBoxProps<T>, "children"> {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps } from "@/components/utils";
import {
DateField as AriaDateField,
type DateFieldProps as AriaDateFieldProps,
Expand All @@ -14,7 +15,6 @@ import {
Label,
fieldGroupStyles,
} from "../Field";
import { composeTailwindRenderProps } from "../utils";

export interface DateFieldProps<T extends DateValue>
extends AriaDateFieldProps<T> {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps } from "@/components/utils";
import { Calendar as CalendarIcon } from "lucide-react";
import {
DatePicker as AriaDatePicker,
Expand All @@ -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<T extends DateValue>
extends AriaDatePickerProps<T> {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps } from "@/components/utils";
import { Calendar as CalendarIcon } from "lucide-react";
import {
DateRangePicker as AriaDateRangePicker,
Expand All @@ -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<T extends DateValue>
extends AriaDateRangePickerProps<T> {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps, focusRing } from "@/components/utils";
import {
FieldError as AriaFieldError,
Input as AriaInput,
Expand All @@ -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 (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps, focusRing } from "@/components/utils";
import {
GridList as AriaGridList,
GridListItem as AriaGridListItem,
Expand All @@ -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<T extends object>({
children,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { focusRing } from "@/components/utils";
import {
Link as AriaLink,
type LinkProps as AriaLinkProps,
composeRenderProps,
} 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";
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps, focusRing } from "@/components/utils";
import { Check } from "lucide-react";
import {
ListBox as AriaListBox,
Expand All @@ -11,7 +12,6 @@ import {
composeRenderProps,
} from "react-aria-components";
import { tv } from "tailwind-variants";
import { composeTailwindRenderProps, focusRing } from "../utils";

type ListBoxProps<T> = Omit<AriaListBoxProps<T>, "layout" | "orientation">;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps } from "@/components/utils";
import { ChevronDown, ChevronUp } from "lucide-react";
import {
NumberField as AriaNumberField,
Expand All @@ -14,7 +15,6 @@ import {
Label,
fieldBorderStyles,
} from "../Field";
import { composeTailwindRenderProps } from "../utils";

export interface NumberFieldProps extends AriaNumberFieldProps {
label?: string;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps, focusRing } from "@/components/utils";
import type { ReactNode } from "react";
import {
Radio as AriaRadio,
Expand All @@ -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<AriaRadioGroupProps, "children"> {
label?: string;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { focusRing } from "@/components/utils";
import {
RangeCalendar as AriaRangeCalendar,
type RangeCalendarProps as AriaRangeCalendarProps,
Expand All @@ -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<T extends DateValue>
extends Omit<AriaRangeCalendarProps<T>, "visibleDuration"> {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps } from "@/components/utils";
import { CircleX, Search } from "lucide-react";
import {
SearchField as AriaSearchField,
Expand All @@ -12,7 +13,6 @@ import {
Input,
Label,
} from "../Field";
import { composeTailwindRenderProps } from "../utils";

export interface SearchFieldProps extends AriaSearchFieldProps {
label?: string;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps, focusRing } from "@/components/utils";
import { ChevronDown } from "lucide-react";
import type React from "react";
import {
Expand All @@ -17,7 +18,6 @@ import {
type DropdownSectionProps,
} from "../ListBox";
import { Popover } from "../Popover";
import { composeTailwindRenderProps, focusRing } from "../utils";

const styles = tv({
extend: focusRing,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps, focusRing } from "@/components/utils";
import {
Slider as AriaSlider,
type SliderProps as AriaSliderProps,
Expand All @@ -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",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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<AriaSwitchProps, "children"> {
children: React.ReactNode;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { composeTailwindRenderProps, focusRing } from "@/components/utils";
import { ChevronUp } from "lucide-react";
import {
Cell as AriaCell,
Expand All @@ -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 (
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { focusRing } from "@/components/utils";
import {
Tab as AriaTab,
TabList as AriaTabList,
Expand All @@ -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",
Expand Down
File renamed without changes.
Loading

0 comments on commit 199c48d

Please sign in to comment.