Skip to content

Commit ff900ff

Browse files
fix: Input paddings (#527)
1 parent 7e07470 commit ff900ff

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

src/components/FormItem/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FormItemOrientation } from '@/types/form-item';
22

3-
export const containerBaseClassName = 'w-full flex';
3+
export const containerBaseClassName = 'w-full flex gap-2';
44
export const orientationClassMap: Record<FormItemOrientation, string> = {
55
[FormItemOrientation.Vertical]: 'flex-col',
66
[FormItemOrientation.Horizontal]: 'flex-row items-end',

src/components/Icon/Icon.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export interface DialIconProps {
1818
* @param [icon] - The icon element to render
1919
* @param [className] - Additional CSS classes to apply to the icon wrapper
2020
*/
21+
22+
// TODO: really need?
2123
export const DialIcon: FC<DialIconProps> = ({ icon, className }) => {
2224
if (!icon) {
2325
return null;

src/components/Input/Input.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111

1212
import { useMergeRefs } from '@floating-ui/react';
1313

14-
import { DialIcon } from '@/components/Icon/Icon';
1514
import { mergeClasses } from '@/utils/merge-classes';
1615
import { DialErrorText } from '@/components/ErrorText/ErrorText';
1716
import { DialLabel, type DialLabelProps } from '@/components/Label/Label';
@@ -71,7 +70,7 @@ export const DialInput: FC<DialInputProps> = ({
7170
...props
7271
}) => {
7372
return (
74-
<div className={mergeClasses('flex flex-col gap-y-1', containerClassName)}>
73+
<div className={mergeClasses('flex flex-col gap-y-2', containerClassName)}>
7574
{labelProps && <DialLabel {...labelProps} htmlFor={id} />}
7675

7776
<InputWrapper id={id} {...props} />
@@ -180,7 +179,7 @@ const InputWrapper: FC<InputWrapperProps> = ({
180179
</div>
181180
)}
182181

183-
<DialIcon icon={iconBefore} />
182+
{iconBefore}
184183

185184
<input
186185
ref={ref}
@@ -200,7 +199,7 @@ const InputWrapper: FC<InputWrapperProps> = ({
200199

201200
{postfix && <p className="text-secondary dial-small-text"> {postfix}</p>}
202201

203-
<DialIcon icon={iconAfter} />
202+
{iconAfter}
204203

205204
{inputButtonIcon && <div className="">{inputButtonIcon}</div>}
206205
</div>

src/components/RadioGroupPopupField/RadioGroupPopupField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export const DialRadioGroupPopupField: FC<RadioGroupPopupFieldProps> = ({
126126
}, [onApply, onClosePopup]);
127127

128128
return (
129-
<div className="flex flex-col">
129+
<div className="flex flex-col gap-2">
130130
<DialLabel label={label} htmlFor={htmlFor} />
131131
<DialInputPopup
132132
disabled={disabled}

src/components/Select/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ export const DialSelect: FC<DialSelectProps> = ({
593593
? 'min-h-[25px] px-1.5 py-1'
594594
: 'min-h-[38px] px-3 py-2',
595595
invalid && 'dial-input-error',
596-
variant === SelectVariant.Secondary ? '!bg-layer-4' : '',
596+
variant === SelectVariant.Secondary ? '!bg-layer-4 !h-auto' : '',
597597
className,
598598
)}
599599
onMouseDown={(e) => {

src/components/Textarea/Textarea.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface DialTextareaProps
3838
* - {@link HTMLTextAreaElement} - The underlying HTML textarea element type
3939
*
4040
* @param [onChange] - Callback function called when the textarea value changes
41-
* @param [labelProps] - Props for the field label, including `fieldLabel` (label text) and `required` (whether to show required indicator)
41+
* @param [labelProps] - Props for the field label, including `label` (label text) and `required` (whether to show required indicator)
4242
* @param [className=""] - Additional CSS classes to apply to the textarea element
4343
* @param [containerClassName=""] - Additional CSS classes to apply to the container div
4444
* @param [invalid=false] - Whether the textarea has validation errors (applies error styling)
@@ -65,7 +65,7 @@ export const DialTextarea: FC<DialTextareaProps> = ({
6565
);
6666

6767
return (
68-
<div className={mergeClasses('flex flex-col gap-y-1', containerClassName)}>
68+
<div className={mergeClasses('flex flex-col gap-y-2', containerClassName)}>
6969
{labelProps && <DialLabel {...labelProps} htmlFor={id} />}
7070
<textarea
7171
id={id}

0 commit comments

Comments
 (0)