Skip to content

Commit

Permalink
refactor: add "use client" to all components (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuuKhoaHoc committed May 20, 2024
1 parent 9df7757 commit a847f99
Show file tree
Hide file tree
Showing 111 changed files with 222 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, useState } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Accordion/AccordionIcon/AccordionIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { ReactNode, forwardRef } from "react";
import { CaretUp } from "@phosphor-icons/react";
// Components
Expand Down
2 changes: 2 additions & 0 deletions src/components/Accordion/AccordionItem/AccordionItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Accordion/AccordionPanel/AccordionPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, useRef, useEffect, useState } from "react";
// Components
import Box from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/ActionButton/ActionButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Button, { ButtonProps } from "@components/Button";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, ReactNode, useState } from "react";
import {
Warning,
Expand Down
2 changes: 2 additions & 0 deletions src/components/Alert/AlertDescription/AlertDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Text, { TextProps } from "@components/Text";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Alert/AlertTitle/AlertTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Text, { TextProps } from "@components/Text";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Animation/Animation.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, useEffect, useState } from "react";
// Components
import Transition, { TransitionProps } from "@components/Transition";
Expand Down
2 changes: 2 additions & 0 deletions src/components/AspectRatio/AspectRatio.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/AutocompleteField/AutocompleteField.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, useState, useEffect } from "react";
// Components
import SelectField, { SelectFieldProps } from "@components/SelectField";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
import { UserCircle } from "@phosphor-icons/react";
// Components
Expand Down
2 changes: 2 additions & 0 deletions src/components/Backdrop/Backdrop.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Center, { CenterProps } from "@components/Center";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, ReactNode } from "react";
// Components
import Box from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Hooks
import useStyling from "./useStyling";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Breadcrumb/BreadcrumbItem/BreadcrumbItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, ReactNode } from "react";
// Components
import Transition, { TransitionProps } from "@components/Transition";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Component
import Paper, { PaperProps } from "@components/Paper";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Card/CardFooter/CardFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Card/CardHeader/CardHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Center/Center.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, ReactNode } from "react";
import { Check, Minus } from "@phosphor-icons/react";
// Components
Expand Down
2 changes: 2 additions & 0 deletions src/components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, ReactNode } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Circle/Circle.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Center, { CenterProps } from "@components/Center";
Expand Down
2 changes: 2 additions & 0 deletions src/components/CloseButton/CloseButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
import { X } from "@phosphor-icons/react";
// Components
Expand Down
2 changes: 2 additions & 0 deletions src/components/Collapse/Collapse.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, useRef } from "react";
// Components
import Animation, { AnimationProps } from "@components/Animation";
Expand Down
2 changes: 2 additions & 0 deletions src/components/ColorField/ColorField.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import SelectField, { SelectFieldProps } from "@components/SelectField";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Container/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, useEffect } from "react";
// Components
import Animation, { AnimationProps } from "@components/Animation";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Dialog/DialogFooter/DialogFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Dialog/DialogHeader/DialogHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Divider/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef, useEffect } from "react";
// Components
import Paper, { PaperProps } from "@components/Paper";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Drawer/DrawerFooter/DrawerFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Drawer/DrawerHeader/DrawerHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Field/Field.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Field/FieldAddon/FieldAddon.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Transition, { TransitionProps } from "@components/Transition";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Field/FieldError/FieldError.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Field/FieldLabel/FieldLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Text, { TextProps } from "@components/Text";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Field/FieldWrapper/FieldWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Flex/Flex.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Form/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Gradient/Gradient.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
import * as CSS from "csstype";
// Component
Expand Down
2 changes: 2 additions & 0 deletions src/components/Grid/Grid.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Grid/GridItem/GridItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Hidden/Hidden.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Hide/Hide.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Highlight/Highlight.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Square, { SquareProps } from "@components/Square";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Image/Image.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Initials/Initials.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { FC } from "react";

export type InitialsProps = {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Key/Key.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Text, { TextProps } from "@components/Text";
Expand Down
2 changes: 2 additions & 0 deletions src/components/List/List.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/List/ListIcon/ListIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Icon, { IconProps } from "@components/Icon";
Expand Down
2 changes: 2 additions & 0 deletions src/components/List/ListItem/ListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/List/ListOrdered/ListOrdered.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import List, { ListProps } from "@components/List";
Expand Down
2 changes: 2 additions & 0 deletions src/components/List/ListUnordered/ListUnordered.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import List, { ListProps } from "@components/List";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Main/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Paper, { PaperProps } from "@components/Paper";
Expand Down
2 changes: 2 additions & 0 deletions src/components/Menu/MenuIcon/MenuIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { forwardRef } from "react";
// Components
import Icon, { IconProps } from "@components/Icon";
Expand Down
Loading

0 comments on commit a847f99

Please sign in to comment.