Skip to content

Commit

Permalink
chore: import primitives with full path
Browse files Browse the repository at this point in the history
  • Loading branch information
hussedev committed Jan 8, 2025
1 parent 3e93fee commit 038d93c
Show file tree
Hide file tree
Showing 43 changed files with 99 additions and 31 deletions.
4 changes: 3 additions & 1 deletion src/components/EvaluationForm/EvaluationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import * as React from "react";
import { tv } from "tailwind-variants";

import { RadioGroupList } from "@/components";
import { Button, Icon, IconType, TextArea } from "@/primitives";
import { Button } from "@/primitives/Button";
import { Icon, IconType } from "@/primitives/Icon";
import { TextArea } from "@/primitives/TextArea";

const formVariants = tv({
base: "flex flex-col gap-6 p-5",
Expand Down
2 changes: 1 addition & 1 deletion src/components/IconLabel/IconLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { match } from "ts-pattern";

import { formatDate, DateFormat } from "@/lib/dates/formatDate";
import { getAddressLabel } from "@/lib/utils";
import { Skeleton } from "@/primitives";
import { Icon, IconType } from "@/primitives/Icon";
import { Skeleton } from "@/primitives/Skeleton";

import { IconLabelContainer } from "./IconLabelContainer";
import { IconLabelProps } from "./types";
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProgressModal/ProgressModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ProgressModal.tsx
import { Check, X } from "lucide-react";

import { Modal } from "@/primitives";
import { Modal } from "@/primitives/Modal";
import { Dialog, DialogHeader, DialogTitle, DialogDescription } from "@/ui-shadcn/dialog";

import { ProgressStatus, Step } from "./types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from "react";
import { tv } from "tailwind-variants";
import { match } from "ts-pattern";

import { Badge } from "@/primitives";
import { Badge } from "@/primitives/Badge";

export enum ApplicationBadgeStatus {
Pending = "pending",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { IconLabel } from "@/components";
import { DateFormat, formatDate } from "@/lib/dates/formatDate";
import { Accordion, IconType, ListGrid, ListGridColumn, Markdown } from "@/primitives";
import { Accordion } from "@/primitives/Accordion";
import { IconType } from "@/primitives/Icon";
import { ListGrid, ListGridColumn } from "@/primitives/ListGrid";
import { Markdown } from "@/primitives/Markdown";

import { PastApplication, ProjectApplication, ProjectMetadata } from "~checker/services/allo/types";
import { ProjectSummary } from "~project/components";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from "react";

import { match } from "ts-pattern";

import { Button, Skeleton } from "@/primitives";
import { Button } from "@/primitives/Button";
import { Skeleton } from "@/primitives/Skeleton";

import { ProjectReviewList } from "~checker/components";
import { useCheckerContext } from "~checker/store";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IconLabel } from "@/components/IconLabel";
import { capitalizeWord, getAddressLabel } from "@/lib/utils";
import { IconType, ListGrid, ListGridColumn } from "@/primitives";
import { IconType } from "@/primitives/Icon";
import { ListGrid, ListGridColumn } from "@/primitives/ListGrid";

import { Evaluation } from "~checker/types";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Address } from "viem";

import { DefaultLogo } from "@/assets";
import { IconLabel } from "@/components/IconLabel";
import { Skeleton } from "@/primitives";
import { Button } from "@/primitives/Button";
import { CircleStat } from "@/primitives/Indicators";
import { ListGridColumn } from "@/primitives/ListGrid";
import { Skeleton } from "@/primitives/Skeleton";

import { ReviewsCounterLabelWithTooltip } from "~checker/components";
import { ProjectReview } from "~checker/types";
Expand Down
2 changes: 1 addition & 1 deletion src/features/checker/constants/defaultStatCardProps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StatCardProps } from "@/primitives";
import { StatCardProps } from "@/primitives/StatCard";

export const DefaultStatCardsProps = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Hex } from "viem";

import { Button, Icon, IconType } from "@/primitives";
import { Button } from "@/primitives/Button";
import { Icon, IconType } from "@/primitives/Icon";

import { EvaluationList } from "~checker/components";
import { useApplicationOverviewEvaluations, useInitialize } from "~checker/hooks";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useMemo } from "react";

import { Button, Icon, IconType, StatCardGroup, StatCardProps } from "@/primitives";
import { Button } from "@/primitives/Button";
import { Icon, IconType } from "@/primitives/Icon";
import { StatCardProps } from "@/primitives/StatCard";
import { StatCardGroup } from "@/primitives/StatCardGroup";

import { ApplicationsSection } from "~checker/components";
import { useGetApplicationsReviewPage } from "~checker/hooks";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import React from "react";

import { useToast } from "@/hooks/use-toast";
import { capitalizeWord } from "@/lib/utils";
import { Badge, Button, Icon, IconType } from "@/primitives";
import { Badge } from "@/primitives/Badge";
import { Button } from "@/primitives/Button";
import { Icon, IconType } from "@/primitives/Icon";

import { ApplicationSummary, SummaryAccordians } from "~application/components";
import { ReviewDropdownList } from "~checker/components";
Expand Down
2 changes: 1 addition & 1 deletion src/features/pool/components/PoolBadge/PoolBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react";

import { match, P } from "ts-pattern";

import { Badge } from "@/primitives";
import { Badge } from "@/primitives/Badge";
import { isPoolStatus, isPoolType, PoolStatus, PoolType } from "@/types";

import { PoolStatusBadge } from "../PoolStatusBadge";
Expand Down
3 changes: 2 additions & 1 deletion src/features/pool/components/PoolCard/PoolCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { UseQueryResult } from "@tanstack/react-query";
import { match, P } from "ts-pattern";

import { Badge, Skeleton } from "@/primitives";
import { Badge } from "@/primitives/Badge";
import { Skeleton } from "@/primitives/Skeleton";
import { PoolData } from "@/types";

import { PoolDataCard } from "./PoolDataCard";
Expand Down
2 changes: 1 addition & 1 deletion src/features/pool/components/PoolCard/PoolDataCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IconLabel } from "@/components";
import { getChainInfo } from "@/lib";
import { IconType } from "@/primitives";
import { IconType } from "@/primitives/Icon";
import { PoolData } from "@/types";

import { PoolBadge } from "../PoolBadge";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tv } from "tailwind-variants";
import { match, P } from "ts-pattern";

import { cn } from "@/lib/utils";
import { Badge } from "@/primitives";
import { Badge } from "@/primitives/Badge";
import { isPoolStatus, PoolStatus } from "@/types";

const variants = tv({
Expand Down
4 changes: 3 additions & 1 deletion src/features/pool/components/PoolSummary/PoolSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { IconLabel } from "@/components";
import { useToast } from "@/hooks";
import { getChainInfo } from "@/lib";
import { cn } from "@/lib/utils";
import { Breadcrumb, Button, Icon, IconType } from "@/primitives";
import { Breadcrumb } from "@/primitives/Breadcrumb";
import { Button } from "@/primitives/Button";
import { Icon, IconType } from "@/primitives/Icon";
import { PoolStatus, PoolType } from "@/types";

import { getManagerUrl, getBuilderUrl, getExplorerUrl } from "~checker/utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { tv } from "tailwind-variants";
import { match, P } from "ts-pattern";

import { cn } from "@/lib/utils";
import { Badge } from "@/primitives";
import { Badge } from "@/primitives/Badge";
import { isPoolType, PoolType } from "@/types";

const variants = tv({
Expand Down
4 changes: 3 additions & 1 deletion src/features/program/components/ProgramCard/ProgramCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { match, P } from "ts-pattern";

import { IconLabel } from "@/components/IconLabel";
import { getChainInfo } from "@/lib";
import { Badge, IconType, Skeleton } from "@/primitives";
import { Badge } from "@/primitives/Badge";
import { IconType } from "@/primitives/Icon";
import { Skeleton } from "@/primitives/Skeleton";
import { Card, CardContent } from "@/ui-shadcn/card";

export interface ProgramCardProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as React from "react";

import { tv, type VariantProps } from "tailwind-variants";

import { Avatar, BannerImage } from "@/primitives";
import { Avatar } from "@/primitives/Avatar";
import { BannerImage } from "@/primitives/BannerImage";

const bannerVariants = tv({
slots: {
Expand Down
4 changes: 3 additions & 1 deletion src/features/project/components/ProjectCard/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import { UseQueryResult } from "@tanstack/react-query";
import { match, P } from "ts-pattern";

import { Avatar, BannerImage, Skeleton } from "@/primitives";
import { Avatar } from "@/primitives/Avatar";
import { BannerImage } from "@/primitives/BannerImage";
import { Skeleton } from "@/primitives/Skeleton";
import { Card, CardContent } from "@/ui-shadcn/card";

import { ProjectData } from "../../types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { StoryObj, Meta } from "@storybook/react";
import { Button } from "@/primitives";

import { Button } from "@/primitives/Button";

import { MetricCard } from "./MetricCard";

export default {
Expand Down Expand Up @@ -98,4 +100,4 @@ export const Loading: Story = {
isLoading
/>
),
};
};
16 changes: 12 additions & 4 deletions src/features/retrofunding/components/MetricCard/MetricCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { tv } from "tailwind-variants";
import { match } from "ts-pattern";

import { cn } from "@/lib";
import { Button, Icon, IconType, Skeleton } from "@/primitives";
import { Button } from "@/primitives/Button";
import { Icon, IconType } from "@/primitives/Icon";
import { Skeleton } from "@/primitives/Skeleton";

const metricCardVariants = tv({
slots: {
Expand Down Expand Up @@ -57,15 +59,21 @@ const MetricCardLoading: React.FC<{ hideButton: boolean }> = ({ hideButton }) =>
<h3 className={headingClass()}>
<Skeleton className="h-6 w-1/3 rounded-md" />
</h3>
<div className={cn(paragraphClass(), "flex flex-col gap-3 mt-2")}>
<div className={cn(paragraphClass(), "mt-2 flex flex-col gap-3")}>
<Skeleton className="h-4 w-3/4 rounded-md" />
<Skeleton className="h-4 w-3/4 rounded-md" />
<Skeleton className="h-4 w-2/3 rounded-md" />
</div>
</div>
{!hideButton && <div className={cn(buttonContainer(), "w-1/3")}><Skeleton className="h-8 w-2/3 rounded-md" /></div>}
{!hideButton && (
<div className={cn(buttonContainer(), "w-1/3")}>
<Skeleton className="h-8 w-2/3 rounded-md" />
</div>
)}
</div>
<div className={bottomLeftSection()}>
<Skeleton className="h-3 w-1/6 rounded-md" />
</div>
<div className={bottomLeftSection()}><Skeleton className="h-3 w-1/6 rounded-md" /></div>
</div>
);
};
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import * as React from "react";

import * as AccordionPrimitive from "@radix-ui/react-accordion";
Expand Down
4 changes: 3 additions & 1 deletion src/primitives/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import { useMemo } from "react";

import { tv } from "tailwind-variants";
Expand All @@ -20,7 +22,7 @@ export interface AvatarProps {
const avatarVariants = tv({
variants: {
variant: {
default: "bg-white shadow-md shadow-slate-600",
default: "shadow-slate-600 bg-white shadow-md",
bordered: "border-4 border-white bg-white",
},
},
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Badge/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import * as React from "react";

import { tv, type VariantProps } from "tailwind-variants";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/BannerImage/BannerImage.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { useMemo } from "react";

import { tv } from "tailwind-variants";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

// src/ui-shadcn/ModularBreadcrumb.tsx
import * as React from "react";

Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import * as React from "react";

import { Slot } from "@radix-ui/react-slot";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/FileUpload/FileUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React, { useEffect, useMemo, useRef, useState } from "react";

import { CloudUpload, Image } from "lucide-react";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

// Status Icons
import {
customIconComponents,
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Indicators/CircleStat/CircleStat.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import React from "react";

import { tv } from "tailwind-variants";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/ListGrid/ListGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import React from "react";

import { tv } from "tailwind-variants";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Markdown/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import MarkdownPreview from "@uiw/react-markdown-preview";

export const Markdown = ({ children }: { children: string }) => {
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/MarkdownEditor/MarkdownEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { ComponentProps, forwardRef, Ref, useContext } from "react";

import MDEditor, { commands, EditorContext } from "@uiw/react-md-editor";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Modal/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import React from "react";

import { tv } from "tailwind-variants";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import * as React from "react";

import { tv } from "tailwind-variants";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import { Progress, ProgressVariants } from "@/ui-shadcn/progress";

export interface ProgressBarProps {
Expand Down
4 changes: 3 additions & 1 deletion src/primitives/RadioGroup/RadioGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import * as React from "react";

import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
Expand All @@ -15,7 +17,7 @@ const radioGroup = tv({
indicatorWrapperDisabled: "bg-grey-300",
indicator: "absolute left-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full",
text: "font-ui-sans text-[16px] leading-[24px]",
circle: "fill-current size-2 text-black",
circle: "size-2 fill-current text-black",
header: "font-ui-sans text-[16px] font-bold leading-[24px]",
},
variants: {
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import * as React from "react";

import { SelectGroup } from "@radix-ui/react-select";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use server";

import { cn } from "@/lib/utils";

function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
Expand Down
3 changes: 2 additions & 1 deletion src/primitives/Toast/Toast.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// components/ui/Toast.tsx
"use client";

import * as React from "react";

import * as ToastPrimitives from "@radix-ui/react-toast";
Expand Down
2 changes: 1 addition & 1 deletion templates/component.tsx.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Skeleton } from "@/primitives";
import { Skeleton } from "@/primitives/Skeleton";
import { tv } from 'tailwind-variants';
import { cn } from "@/lib/utils";
import { match } from "ts-pattern";
Expand Down

0 comments on commit 038d93c

Please sign in to comment.