diff --git a/packages/common/business_components/package.json b/packages/common/business_components/package.json index 9618ff295..eb3c0e8cb 100644 --- a/packages/common/business_components/package.json +++ b/packages/common/business_components/package.json @@ -28,6 +28,7 @@ "@common/components": "workspace:*", "@hookform/resolvers": "^4.1.3", "@radix-ui/react-label": "^2.1.2", + "@radix-ui/react-scroll-area": "^1.2.3", "@radix-ui/react-select": "^2.1.6", "@radix-ui/react-slot": "^1.1.2", "class-variance-authority": "^0.7.1", diff --git a/packages/common/business_components/src/ui/index.ts b/packages/common/business_components/src/ui/index.ts index 1876f2b50..fba8a76ad 100644 --- a/packages/common/business_components/src/ui/index.ts +++ b/packages/common/business_components/src/ui/index.ts @@ -2,5 +2,8 @@ export * from "./chart"; export * from "./file-upload"; export * from "./form"; export * from "./search_form"; +export * from "./search_input"; +export * from "./search_input_select"; export * from "./select"; export * from "./table"; +export * from "./scroll" diff --git a/packages/common/business_components/src/ui/scroll/index.tsx b/packages/common/business_components/src/ui/scroll/index.tsx new file mode 100644 index 000000000..cf253cf17 --- /dev/null +++ b/packages/common/business_components/src/ui/scroll/index.tsx @@ -0,0 +1,46 @@ +import * as React from "react" +import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area" + +import { cn } from "@/lib/utils" + +const ScrollArea = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + {children} + + + + +)) +ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName + +const ScrollBar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, orientation = "vertical", ...props }, ref) => ( + + + +)) +ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName + +export { ScrollArea, ScrollBar } diff --git a/packages/common/business_components/src/ui/search_input/index.tsx b/packages/common/business_components/src/ui/search_input/index.tsx new file mode 100644 index 000000000..f933428fc --- /dev/null +++ b/packages/common/business_components/src/ui/search_input/index.tsx @@ -0,0 +1,16 @@ +import { Input, Label } from "@common/components"; +import React from "react"; + +const SearchInput = React.forwardRef< + HTMLDivElement& HTMLInputElement, + React.HTMLAttributes & {className:string, label:string}> +(({className, label}, ref) => { + console.log(ref); + return ( +
+ {label && } + +
+ ) +}); +export { SearchInput }; diff --git a/packages/common/business_components/src/ui/search_input_select/index.tsx b/packages/common/business_components/src/ui/search_input_select/index.tsx new file mode 100644 index 000000000..b00615e4b --- /dev/null +++ b/packages/common/business_components/src/ui/search_input_select/index.tsx @@ -0,0 +1,38 @@ +import { Input, Label } from "@common/components"; +import React from "react"; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select/lib/selectBox"; +export type SelectDataType = { + text: string; + val: string; +} +/** + * 검색 입력 및 선택 컴포넌트 + * @param className - string tailwindcss class + * @param label - string label + * @param selectData - SelectDataType[] 선택 데이터 + * @param onSelectValue - (val:string)=>void 선택 값 콜백 + * @param refs - React.forwardRef | null 입력값 ref + * @returns React.FC + */ +const SearchInputSelect = React.forwardRefvoid}>(({className, label, selectData, onSelectValue}, refs) => { + return ( +
+ {label && } +
+ + +
+
+ ) +}); +export { SearchInputSelect }; diff --git a/packages/common/business_components/src/ui/select/index.tsx b/packages/common/business_components/src/ui/select/index.tsx index d1adbb970..9f5f6d25c 100644 --- a/packages/common/business_components/src/ui/select/index.tsx +++ b/packages/common/business_components/src/ui/select/index.tsx @@ -11,15 +11,15 @@ interface SelectBox1 { const SelectBox = React.forwardRef< HTMLDivElement, - React.HTMLAttributes & {label:string, className:string, selectArray:SelectBox1[]} ->(({ label, className, selectArray }, ref)=>{ + React.HTMLAttributes & {label:string, className:string, selectArray:SelectBox1[], onSelectValue:(val:string)=>void} +>(({ label, className, selectArray, onSelectValue }, ref)=>{ const placeHolder = selectArray?.[0]?.text ?? ""; return ( -
- {label && } - +