From 406cfad31a49af235c3f0631d7e2de5eccdd57bf Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Mon, 20 Oct 2025 10:14:04 +0700 Subject: [PATCH 01/92] chore(FE-140): adjust border radius --- src/components/Button.tsx | 2 +- src/components/input/SelectInput.tsx | 39 +++++++---------- src/components/input/TextArea.tsx | 62 +++++++++++++--------------- src/components/input/TextInput.tsx | 2 +- 4 files changed, 45 insertions(+), 60 deletions(-) diff --git a/src/components/Button.tsx b/src/components/Button.tsx index c67a29c2..5da6e5ad 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -43,7 +43,7 @@ const Button = ({ 'btn-warning': color === 'warning', 'btn-error': color === 'error', }, - 'h-fit justify-center items-center gap-2 rounded-xl p-2 text-base transition-all' + 'h-fit justify-center items-center gap-2 rounded p-2 text-base transition-all' ); return ( diff --git a/src/components/input/SelectInput.tsx b/src/components/input/SelectInput.tsx index 43a3f622..f6cef527 100644 --- a/src/components/input/SelectInput.tsx +++ b/src/components/input/SelectInput.tsx @@ -1,12 +1,6 @@ 'use client'; -import { - ComponentType, - ReactNode, - useEffect, - useMemo, - useState, -} from 'react'; +import { ComponentType, ReactNode, useEffect, useMemo, useState } from 'react'; import Select, { OptionProps, GroupBase, @@ -98,10 +92,7 @@ const SelectInput = (props: SelectInputProps) => { return { ...base, IndicatorSeparator: () => null }; }, [isAnimated]); - const internalInputChangeHandler = ( - val: string, - meta: InputActionMeta - ) => { + const internalInputChangeHandler = (val: string, meta: InputActionMeta) => { if (meta.action === 'input-change') setInternalInputValue(val); if (meta.action === 'menu-close') setInternalInputValue(''); }; @@ -113,9 +104,7 @@ const SelectInput = (props: SelectInputProps) => { const SelectComponent = createables ? CreatableSelect : Select; /** 🎯 handleChange tanpa any */ - const handleChange = ( - val: MultiValue | SingleValue - ): void => { + const handleChange = (val: MultiValue | SingleValue): void => { if (!val) { onChange?.(null); return; @@ -145,15 +134,15 @@ const SelectInput = (props: SelectInputProps) => { > {label} {required && ( - - * + + * )} )} > - instanceId="select" + instanceId='select' value={value ?? (isMulti ? [] : null)} onChange={handleChange} options={options} @@ -171,7 +160,7 @@ const SelectInput = (props: SelectInputProps) => { classNames={{ control: ({ isFocused, isDisabled }) => cn( - 'w-full min-h-12! rounded-lg! border bg-white transition-shadow cursor-pointer!', + 'w-full min-h-12! rounded! border bg-base-100 transition-shadow cursor-pointer!', { 'border-red-500! ring-2 ring-red-200': isError, 'border-indigo-500 ring-2 ring-indigo-200': isFocused, @@ -187,24 +176,24 @@ const SelectInput = (props: SelectInputProps) => { input: () => cn('text-gray-900'), indicatorsContainer: () => cn('flex items-center gap-1 pr-2'), dropdownIndicator: ({ isFocused }) => - cn('p-1 rounded-md hover:bg-gray-100', { + cn('p-1 rounded hover:bg-gray-100', { 'text-gray-900': isFocused, 'text-gray-500': !isFocused, 'text-error!': isError, }), menu: () => - cn('border border-gray-200 rounded-lg bg-white shadow-lg!'), + cn('border border-gray-200 rounded! bg-base-100 shadow-lg!'), menuList: () => cn('p-2! max-h-60 overflow-auto'), option: ({ isFocused, isSelected }) => - cn('mt-1 px-3 py-2 rounded-md cursor-pointer!', { - 'bg-indigo-600 text-white': isFocused, + cn('mt-1 px-3 py-2 rounded cursor-pointer!', { + 'bg-indigo-600 text-base-100': isFocused, 'bg-blue-500!': isSelected, 'text-gray-700': !isFocused && !isSelected, }), multiValue: ({ getValue, index }) => { const selectedValues = getValue() as T[]; return cn( - 'bg-indigo-50 rounded-md py-0.5 pl-2 pr-1 flex items-center gap-1!', + 'bg-indigo-50 rounded py-0.5 pl-2 pr-1 flex items-center gap-1!', selectedValues[index]?.className ); }, @@ -225,9 +214,9 @@ const SelectInput = (props: SelectInputProps) => { }} /> - {isError &&

{errorMessage}

} + {isError &&

{errorMessage}

} {!isError && bottomLabel && ( -

{bottomLabel}

+

{bottomLabel}

)} ); diff --git a/src/components/input/TextArea.tsx b/src/components/input/TextArea.tsx index e9517277..fbb1637a 100644 --- a/src/components/input/TextArea.tsx +++ b/src/components/input/TextArea.tsx @@ -1,10 +1,6 @@ 'use client'; -import { - ChangeEventHandler, - FocusEventHandler, - ReactNode, -} from 'react'; +import { ChangeEventHandler, FocusEventHandler, ReactNode } from 'react'; import { cn } from '@/lib/helper'; @@ -52,7 +48,7 @@ const TextArea = ({ onBlur, readOnly = false, isLoading = false, - rows = 3 + rows = 3, }: TextAreaProps) => { return (
)} - {startAdornment && startAdornment} + {startAdornment && startAdornment} -