diff --git a/package.json b/package.json index eb4a90f..8f027c4 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "@testing-library/jest-dom": "^6.4.6", "@testing-library/react": "^16.0.0", "@types/eslint": "^9", + "@types/prop-types": "^15", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@typescript-eslint/eslint-plugin": "^8.4.0", @@ -84,6 +85,7 @@ "jest-environment-jsdom": "^29.7.0", "postcss": "^8.4.38", "prettier": "^3.3.3", + "prop-types": "^15.8.1", "react": "^17.0.0 || ^18.0.0", "react-dom": "^17.0.0 || ^18.0.0", "semantic-release": "^24.0.0", diff --git a/src/components/search/Search.stories.tsx b/src/components/search/Search.stories.tsx index c08e89e..583e27c 100644 --- a/src/components/search/Search.stories.tsx +++ b/src/components/search/Search.stories.tsx @@ -1,4 +1,3 @@ -import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { Search } from "./Search"; @@ -124,9 +123,9 @@ export const AllStates: Story = { parameters: { docs: { description: { - story: "This story shows the search component in its default state. You can interact with it to see hover and focus states.", + story: + "This story shows the search component in its default state. You can interact with it to see hover and focus states.", }, }, }, }; - diff --git a/src/components/search/Search.tsx b/src/components/search/Search.tsx index fb24922..27c117a 100644 --- a/src/components/search/Search.tsx +++ b/src/components/search/Search.tsx @@ -1,4 +1,5 @@ import React, { forwardRef, useState } from "react"; +import PropTypes from "prop-types"; import { cn } from "../../utils/cn"; import searchIcon from "../../assets/search-icon.svg"; @@ -108,3 +109,14 @@ export const Search = forwardRef( Search.displayName = "Search"; +Search.propTypes = { + containerClassName: PropTypes.string, + inputClassName: PropTypes.string, + iconClassName: PropTypes.string, + showIcon: PropTypes.bool, + size: PropTypes.oneOf(["small", "default", "large"]), + placeholder: PropTypes.string, + className: PropTypes.string, + onFocus: PropTypes.func, + onBlur: PropTypes.func, +}; diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx index 1f72604..35e06d6 100644 --- a/src/components/search/index.tsx +++ b/src/components/search/index.tsx @@ -1,3 +1,2 @@ export { Search } from "./Search"; export type { SearchProps } from "./Search"; - diff --git a/src/components/select/useSelectNavigate.tsx b/src/components/select/useSelectNavigate.tsx index 844ab1b..f33cab2 100644 --- a/src/components/select/useSelectNavigate.tsx +++ b/src/components/select/useSelectNavigate.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from "react"; import { isInViewport } from "../../utils/navigation"; -type ChekboxNavigateProps = { +type CheckboxNavigateProps = { checkboxContainer: React.MutableRefObject | null; searchEl: React.MutableRefObject | null; // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -12,7 +12,7 @@ const useCheckboxNavigate = ({ checkboxContainer, searchEl, options, -}: ChekboxNavigateProps) => { +}: CheckboxNavigateProps) => { const checkboxNavIndex = useRef(null); const [currentNavigateCheckbox, setcurrentNavigateCheckbox] = useState(""); diff --git a/src/stories/Configure.mdx b/src/stories/Configure.mdx index 5157090..717600a 100644 --- a/src/stories/Configure.mdx +++ b/src/stories/Configure.mdx @@ -15,21 +15,23 @@ import Accessibility from "./assets/accessibility.png"; import Theming from "./assets/theming.png"; import AddonLibrary from "./assets/addon-library.png"; -export const RightArrow = () => ( + - - + > + + +); @@ -38,6 +40,7 @@ export const RightArrow = () =>
@@ -84,6 +87,7 @@ export const RightArrow = () =>
@@ -203,6 +207,7 @@ export const RightArrow = () => Discover tutorials
+