diff --git a/.lintstagedrc.js b/.lintstagedrc.js index d69773e..a2abec4 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,14 +1,14 @@ export default { - "packages/ui-universal/**/*.{js,cjs,ts,json,css,scss,tsx,sass}": () => [ + "packages/ui-universal/**/**.{js,cjs,ts,json,css,scss,tsx,sass}": () => [ "pnpm --filter @sast/ui-universal lint", "pnpm --filter @sast/ui-universal build", "git add ." ], - "docs/**/*.{js,cjs,ts,html,json,css,scss,tsx,sass,md,mdx}": () => [ + "docs/**/**.{js,cjs,ts,html,json,css,scss,tsx,sass,md,mdx}": () => [ "pnpm --filter @sast/ui-docs build", "git add ." ], - "packages/ui-react/**/*.{js,cjs,ts,html,json,css,scss,tsx,sass}": () => [ + "packages/ui-react/**/**.{js,cjs,ts,html,json,css,scss,tsx,sass}": () => [ // "pnpm --filter @sast/ui-react test", "pnpm --filter @sast/ui-react format", "pnpm --filter @sast/ui-react lint", diff --git a/docs/package.json b/docs/package.json index eab6542..33a369f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "@ui-aurora/react": "workspace:^", - "@sast/ui-universal": "workspace:^", + "@ui-aurora/universal": "workspace:^", "@theguild/remark-mermaid": "^0.0.6", "rspress": "^1.16.0" }, diff --git a/packages/ui-react/lib/Calendar/Calendar.tsx b/packages/ui-react/lib/Calendar/Calendar.tsx index 26971c4..98ecfa7 100644 --- a/packages/ui-react/lib/Calendar/Calendar.tsx +++ b/packages/ui-react/lib/Calendar/Calendar.tsx @@ -90,6 +90,8 @@ export const Calendar = React.forwardRef( return weekdaysFlex; }); + Weekdays.displayName = 'Weekdays'; + const calendarClass = classNames(`${styles['base']} ${styles[`shadow-${shadow}`]}`); const changeMonth = useCallback( diff --git a/packages/ui-react/lib/Calendar/DayItem.tsx b/packages/ui-react/lib/Calendar/DayItem.tsx index ef8a590..0d2c915 100644 --- a/packages/ui-react/lib/Calendar/DayItem.tsx +++ b/packages/ui-react/lib/Calendar/DayItem.tsx @@ -11,7 +11,8 @@ interface DayItemProps { selectMonth: number; } -const DayItem = memo(function otherMonthItem({ +const DayItem = memo(function DayItem({ + // Change the function name here index, isOtherMonth, selectDate, diff --git a/packages/ui-react/lib/Carousel/Carousel.tsx b/packages/ui-react/lib/Carousel/Carousel.tsx index b73f5d6..fe00340 100644 --- a/packages/ui-react/lib/Carousel/Carousel.tsx +++ b/packages/ui-react/lib/Carousel/Carousel.tsx @@ -1,4 +1,4 @@ -import React, { memo, useEffect, useMemo, useRef, useState, type HtmlHTMLAttributes } from 'react'; +import React, { useEffect, useRef, useState, type HtmlHTMLAttributes } from 'react'; import { type CarouselItemProps, CarouselItem } from '..'; import classNames from 'classnames'; import styles from './Carousel.module.scss'; diff --git a/packages/ui-react/lib/Checkbox/Checkbox.tsx b/packages/ui-react/lib/Checkbox/Checkbox.tsx index 8c30fc5..64e2f42 100644 --- a/packages/ui-react/lib/Checkbox/Checkbox.tsx +++ b/packages/ui-react/lib/Checkbox/Checkbox.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import styles from './Checkbox.module.scss'; import classNames from 'classnames'; import { Check } from 'lucide-react'; diff --git a/packages/ui-react/lib/CheckboxGroup/CheckboxGroup.tsx b/packages/ui-react/lib/CheckboxGroup/CheckboxGroup.tsx index 39981f7..f4f6898 100644 --- a/packages/ui-react/lib/CheckboxGroup/CheckboxGroup.tsx +++ b/packages/ui-react/lib/CheckboxGroup/CheckboxGroup.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useState, type HtmlHTMLAttributes } from 'react'; +import React, { useCallback, useState, type HtmlHTMLAttributes } from 'react'; import { type CheckboxProps } from '..'; import { Content } from './Content'; diff --git a/packages/ui-react/lib/DatePicker/DatePicker.tsx b/packages/ui-react/lib/DatePicker/DatePicker.tsx index 5dc8abc..3dd40b8 100644 --- a/packages/ui-react/lib/DatePicker/DatePicker.tsx +++ b/packages/ui-react/lib/DatePicker/DatePicker.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useState } from 'react'; +import React, { useMemo, useState } from 'react'; import { Button, Calendar } from '..'; import styles from './DatePicker.module.scss'; import { CalendarDays } from 'lucide-react'; diff --git a/packages/ui-react/lib/Dialog/Dialog.tsx b/packages/ui-react/lib/Dialog/Dialog.tsx index bf909ac..e2f11b4 100644 --- a/packages/ui-react/lib/Dialog/Dialog.tsx +++ b/packages/ui-react/lib/Dialog/Dialog.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useLayoutEffect, useState, type CSSProperties } from 'react'; +import React, { useLayoutEffect, useState, type CSSProperties } from 'react'; import styles from './Dialog.module.scss'; import { Button, Card } from '..'; import { createPortal } from 'react-dom'; diff --git a/packages/ui-react/lib/Navbar/Navbar.stories.tsx b/packages/ui-react/lib/Navbar/Navbar.stories.tsx index 3d17c4b..c0e1e06 100644 --- a/packages/ui-react/lib/Navbar/Navbar.stories.tsx +++ b/packages/ui-react/lib/Navbar/Navbar.stories.tsx @@ -5,7 +5,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import React from 'react'; import { Navbar, type NavbarProps } from './Navbar'; import logoSvg from '../assets/Logo.svg'; -import { Home, LayoutList, Award } from 'lucide-react'; +import { Home, LayoutList } from 'lucide-react'; const test = (value: string) => { console.log(value); diff --git a/packages/ui-react/lib/Pagination/Pagination.tsx b/packages/ui-react/lib/Pagination/Pagination.tsx index a6e9c6b..cb6319f 100644 --- a/packages/ui-react/lib/Pagination/Pagination.tsx +++ b/packages/ui-react/lib/Pagination/Pagination.tsx @@ -1,4 +1,4 @@ -import React, { createContext, memo, useEffect, useState, type ReactNode } from 'react'; +import React, { createContext, useEffect, useState, type ReactNode } from 'react'; import styles from './Pagination.module.scss'; import classNames from 'classnames'; import { PaginationItem } from './PaginationItem'; diff --git a/packages/ui-react/lib/Pagination/PaginationItem.tsx b/packages/ui-react/lib/Pagination/PaginationItem.tsx index 660dfe5..d541f94 100644 --- a/packages/ui-react/lib/Pagination/PaginationItem.tsx +++ b/packages/ui-react/lib/Pagination/PaginationItem.tsx @@ -1,4 +1,4 @@ -import React, { memo, useCallback, useContext, useEffect, type ReactNode } from 'react'; +import React, { memo, useCallback, useContext, type ReactNode } from 'react'; import { Button, PaginationStoreContext } from '..'; import styles from './Pagination.module.scss'; import { useCurrentPageStore } from './useCurrentPageStore'; @@ -31,7 +31,7 @@ export const PaginationItemImpl = ({ const paginationStoreContext = useContext(PaginationStoreContext); const handleClick = useCallback((type: 'select' | 'add' | 'delete' | 'none', index?: number) => { - const activePage = paginationStoreContext?.activePage!; + const activePage = paginationStoreContext?.activePage ?? 0; if (type === 'select' && index !== undefined) { !activePage && changeCurrentPage(index + 1); @@ -50,7 +50,7 @@ export const PaginationItemImpl = ({ return (