diff --git a/package-lock.json b/package-lock.json index c260bce..390a382 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "react-paginate": "^8.3.0", "react-switch": "^7.1.0", "react-toastify": "^11.0.5", + "react-tooltip": "^5.29.1", "tailwind-merge": "^2.6.0", "zod": "^4.1.5" }, @@ -233,6 +234,31 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@floating-ui/core": { + "version": "1.7.3", + "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.7.3.tgz", + "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.7.4", + "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.7.4.tgz", + "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.7.3", + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.10", + "resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.10.tgz", + "integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==", + "license": "MIT" + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -2171,6 +2197,12 @@ "url": "https://polar.sh/cva" } }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmmirror.com/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "license": "MIT" + }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -5391,6 +5423,20 @@ "react-dom": "^18 || ^19" } }, + "node_modules/react-tooltip": { + "version": "5.29.1", + "resolved": "https://registry.npmmirror.com/react-tooltip/-/react-tooltip-5.29.1.tgz", + "integrity": "sha512-rmJmEb/p99xWhwmVT7F7riLG08wwKykjHiMGbDPloNJk3tdI73oHsVOwzZ4SRjqMdd5/xwb/4nmz0RcoMfY7Bw==", + "license": "MIT", + "dependencies": { + "@floating-ui/dom": "^1.6.1", + "classnames": "^2.3.0" + }, + "peerDependencies": { + "react": ">=16.14.0", + "react-dom": ">=16.14.0" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", diff --git a/package.json b/package.json index 6b4b741..90d2f31 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "react-paginate": "^8.3.0", "react-switch": "^7.1.0", "react-toastify": "^11.0.5", + "react-tooltip": "^5.29.1", "tailwind-merge": "^2.6.0", "zod": "^4.1.5" }, diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 26c9ba9..91ecfd1 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,5 +1,6 @@ import "@/css/satoshi.css"; import "@/css/style.css"; +import "react-tooltip/dist/react-tooltip.css"; import { ConditionalLayout } from "@/components/Layouts/conditional-layout"; import "flatpickr/dist/flatpickr.min.css"; diff --git a/src/components/Tables/admins/index.tsx b/src/components/Tables/admins/index.tsx index 92720a5..8afe283 100644 --- a/src/components/Tables/admins/index.tsx +++ b/src/components/Tables/admins/index.tsx @@ -3,6 +3,7 @@ import { PencilSquareIcon, TrashIcon, UserSettingIcon } from "@/assets/icons"; import ConfirmationModal from "@/components/ui/ConfirmationModal"; import Modal from "@/components/ui/modal"; +import { _TooltipDefaultParams } from "@/constants/tooltip"; import Status from "@/components/ui/Status"; import { Table, @@ -15,6 +16,7 @@ import { import TableSkeleton from "@/components/ui/TableSkeleton"; import { AdminStatus } from "@/constants/enums"; import Link from "next/link"; +import { Tooltip } from "react-tooltip"; import ChangeStatusModalContent from "./ChangeStatusModalContent"; import { useAdminsPresenter } from "./useAdminsPresenter"; @@ -82,29 +84,43 @@ const AdminsTable = () => {
diff --git a/src/components/Tables/companies/company-categories/index.tsx b/src/components/Tables/companies/company-categories/index.tsx index f8cc926..463fd81 100644 --- a/src/components/Tables/companies/company-categories/index.tsx +++ b/src/components/Tables/companies/company-categories/index.tsx @@ -2,6 +2,7 @@ import { PencilSquareIcon, TrashIcon } from "@/assets/icons"; import { Switch } from "@/components/FormElements/switch"; import ConfirmationModal from "@/components/ui/ConfirmationModal"; +import { _TooltipDefaultParams } from "@/constants/tooltip"; import IsVisible from "@/components/ui/IsVisible"; import { Table, @@ -14,6 +15,7 @@ import { import TableSkeleton from "@/components/ui/TableSkeleton"; import { unixToDate } from "@/utils/shared"; import Link from "next/link"; +import { Tooltip } from "react-tooltip"; import { Skeleton } from "../../../ui/skeleton"; import useCompanyCategoriesPresenter from "./useCompanyCategoriesPresenter"; @@ -87,21 +89,29 @@ const CompanyCategoriesTable = () => {
diff --git a/src/components/Tables/companies/index.tsx b/src/components/Tables/companies/index.tsx index f42c1ce..e2261a7 100644 --- a/src/components/Tables/companies/index.tsx +++ b/src/components/Tables/companies/index.tsx @@ -1,6 +1,7 @@ "use client"; import { ExclamationIcon, PencilSquareIcon, TrashIcon } from "@/assets/icons"; import ConfirmationModal from "@/components/ui/ConfirmationModal"; +import { _TooltipDefaultParams } from "@/constants/tooltip"; import { Table, TableBody, @@ -12,6 +13,7 @@ import { import TableSkeleton from "@/components/ui/TableSkeleton"; import { formatPhoneNumber } from "@/utils/shared"; import Link from "next/link"; +import { Tooltip } from "react-tooltip"; import { useCompanyListPresenter } from "./useCompanyListPresenter"; interface IProps {} @@ -88,30 +90,42 @@ const CompaniesTable = ({}: IProps) => {
diff --git a/src/components/Tables/customers/index.tsx b/src/components/Tables/customers/index.tsx index 0d0d4da..872e92a 100644 --- a/src/components/Tables/customers/index.tsx +++ b/src/components/Tables/customers/index.tsx @@ -1,6 +1,7 @@ "use client"; import { ExclamationIcon, PencilSquareIcon, TrashIcon } from "@/assets/icons"; import ConfirmationModal from "@/components/ui/ConfirmationModal"; +import { _TooltipDefaultParams } from "@/constants/tooltip"; import { Table, TableBody, @@ -17,6 +18,7 @@ import Modal from "@/components/ui/modal"; import Status from "@/components/ui/Status"; import TableSkeleton from "@/components/ui/TableSkeleton"; import { unixToDate } from "@/utils/shared"; +import { Tooltip } from "react-tooltip"; import { toast } from "react-toastify"; import AssignToCompanyModalContent from "./AssignToCompanyModalContent"; @@ -89,25 +91,36 @@ const CustomersTable = () => {
diff --git a/src/components/Tables/notification-history/index.tsx b/src/components/Tables/notification-history/index.tsx index edcb969..3f87fbe 100644 --- a/src/components/Tables/notification-history/index.tsx +++ b/src/components/Tables/notification-history/index.tsx @@ -2,6 +2,8 @@ import { EyeIcon } from "@/assets/icons"; import { ShowcaseSection } from "@/components/Layouts/showcase-section"; import Pagination from "@/components/ui/pagination"; +import { _TooltipDefaultParams } from "@/constants/tooltip"; +import { Tooltip } from "react-tooltip"; import Status from "@/components/ui/Status"; import { Table, @@ -73,10 +75,18 @@ const NotificationHistoryTable = () => {
diff --git a/src/components/Tables/tenders/index.tsx b/src/components/Tables/tenders/index.tsx index 547219a..a89295b 100644 --- a/src/components/Tables/tenders/index.tsx +++ b/src/components/Tables/tenders/index.tsx @@ -9,11 +9,13 @@ import { TableHeader, TableRow, } from "@/components/ui/table"; +import { Tooltip } from "react-tooltip"; import useTenderListPresenter from "./useTenderListPresenter"; import { ExclamationIcon, EyeIcon } from "@/assets/icons"; import Pagination from "@/components/ui/pagination"; import TableSkeleton from "@/components/ui/TableSkeleton"; +import { _TooltipDefaultParams } from "@/constants/tooltip"; import { cn } from "@/lib/utils"; import Link from "next/link"; const TendersTable = () => { @@ -70,18 +72,30 @@ const TendersTable = () => { colSpan={100} >
diff --git a/src/constants/tooltip.ts b/src/constants/tooltip.ts new file mode 100644 index 0000000..24cb35c --- /dev/null +++ b/src/constants/tooltip.ts @@ -0,0 +1,18 @@ +import { CSSProperties } from "react"; +import { VariantType } from "react-tooltip"; + +export const _TooltipDefaultParams = ({ + id, + variant = id === "delete" ? "error" : "info", + styles, +}: { + id: string; + variant?: VariantType; + styles?: CSSProperties; +}) => ({ + id, + delayShow: 500, + delayHide: 500, + variant, + style: { backgroundColor: variant === "error" ? "#F23030" : "", ...styles }, +}); diff --git a/src/css/style.css b/src/css/style.css index a79fe56..073e170 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -49,6 +49,9 @@ .tableCheckbox:checked ~ div span { @apply opacity-100; } +.react-tooltip { + @apply !rounded-full !transition-opacity !duration-500; +} .tableCheckbox:checked ~ div { @apply border-primary bg-primary; @@ -502,17 +505,17 @@ input[type="search"]::-webkit-search-cancel-button { } .Toastify__toast--success { - background: linear-gradient(to bottom right, #82E6AC, #1A8245) !important; + background: linear-gradient(to bottom right, #82e6ac, #1a8245) !important; } .Toastify__toast--error { - background: linear-gradient(to bottom right, #F89090, #E10E0E) !important; + background: linear-gradient(to bottom right, #f89090, #e10e0e) !important; } .Toastify__toast--warning { - background: linear-gradient(to bottom right, #F59E0B, #D97706) !important; + background: linear-gradient(to bottom right, #f59e0b, #d97706) !important; } .Toastify__toast--info { - background: linear-gradient(to bottom right, #8099EC, #1C3FB7) !important; + background: linear-gradient(to bottom right, #8099ec, #1c3fb7) !important; }