Skip to content

Commit 8db006a

Browse files
authored
Merge pull request #25 from AdventureX-RGE/dev
Dev
2 parents 0205b2a + 71490e4 commit 8db006a

File tree

12 files changed

+197
-188
lines changed

12 files changed

+197
-188
lines changed

apps/ui/components/navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function Navbar() {
126126
intent="outline"
127127
className="h-9 items-center"
128128
>
129-
<div className="font-patika-medium text-[1rem] leading-[1.5rem] flex items-center gap-2">
129+
<div className="flex items-center gap-2 font-patika-medium text-[1rem] leading-[1.5rem]">
130130
<IconSearch className="size-4" />
131131
<span className="text-muted-fg">Search...</span>
132132
<Keyboard keys={["⌘", "K"]} className="-mr-1" />

apps/ui/components/ui/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import { tv } from "tailwind-variants"
1010

1111
import { focusButtonStyles } from "./primitive"
12-
import { Typography } from "./typography";
12+
import { Typography } from "./typography"
1313

1414
const buttonStyles = tv({
1515
extend: focusButtonStyles,

apps/ui/components/ui/calendar.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ const SelectYear = ({ state }: { state: CalendarState }) => {
170170
aria-label="Select year"
171171
selectedKey={20}
172172
onSelectionChange={(value) => {
173-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
174-
state.setFocusedDate(years[Number(value)]?.value)
173+
state.setFocusedDate(years[Number(value)]?.value!)
175174
}}
176175
>
177176
<Select.Trigger className="h-8 w-24 text-xs data-focused:ring-3 **:data-[slot=select-value]:inline-block **:data-[slot=select-value]:truncate group-data-open:ring-3" />
@@ -199,4 +198,4 @@ const CalendarGridHeader = () => {
199198
}
200199

201200
export type { CalendarProps }
202-
export { Calendar, CalendarHeader, CalendarGridHeader }
201+
export { Calendar, CalendarGridHeader, CalendarHeader }

apps/ui/components/ui/date-picker.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,33 +97,33 @@ const DatePicker = <T extends DateValue>({
9797
{...props}
9898
className={composeTailwindRenderProps(className, "group flex w-full flex-col gap-y-1")}
9999
>
100-
{label &&
100+
{label && (
101101
<Typography as="div">
102102
<Label isRequired={props.isRequired}>{label}</Label>
103103
</Typography>
104-
}
105-
<FieldGroup className="min-w-40 h-10">
104+
)}
105+
<FieldGroup className="h-10 min-w-40">
106106
<DateInput className="w-full px-2 text-base sm:text-sm" />
107107
<DatePickerIcon />
108108
</FieldGroup>
109-
{description &&
109+
{description && (
110110
<Typography as="div">
111111
<Description>{description}</Description>
112112
</Typography>
113-
}
114-
113+
)}
114+
115115
{(leftDescription || errorMessage || rightDescription) && (
116116
<Typography as="div">
117-
<div className="mt-1 flex justify-between text-sm text-muted-fg">
117+
<div className="mt-1 flex justify-between text-muted-fg text-sm">
118118
<div>{errorMessage ? <FieldError>{errorMessage}</FieldError> : leftDescription}</div>
119119
<div>{rightDescription}</div>
120120
</div>
121121
</Typography>
122122
)}
123-
123+
124124
<DatePickerOverlay />
125125
</DatePickerPrimitive>
126126
)
127127
}
128128
export type { DatePickerProps, DateValue, ValidationResult }
129-
export { DatePicker, DatePickerIcon, DatePickerOverlay }
129+
export { DatePicker, DatePickerIcon, DatePickerOverlay }

apps/ui/components/ui/dropdown.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ const DropdownItem = ({ className, ...props }: DropdownItemProps) => {
8585
>
8686
{composeRenderProps(props.children, (children, { isSelected }) => (
8787
<>
88-
{isSelected && <IconCheck className="-mx-0.5 mr-2" data-slot="checked-icon" />}
8988
{typeof children === "string" ? <DropdownLabel>{children}</DropdownLabel> : children}
89+
{isSelected && <IconCheck className="mr-2 ml-auto" data-slot="checked-icon" />}
9090
</>
9191
))}
9292
</ListBoxItemPrimitive>
@@ -169,14 +169,14 @@ const DropdownKeyboard = ({ className, ...props }: React.ComponentProps<typeof K
169169
* Note: This is not exposed component, but it's used in other components to render dropdowns.
170170
* @internal
171171
*/
172-
export type { DropdownSectionProps, DropdownLabelProps, DropdownItemProps, DropdownItemDetailProps }
172+
export type { DropdownItemDetailProps, DropdownItemProps, DropdownLabelProps, DropdownSectionProps }
173173
export {
174-
DropdownSeparator,
175174
DropdownItem,
176-
DropdownLabel,
177-
DropdownKeyboard,
178-
dropdownItemStyles,
179175
DropdownItemDetails,
176+
dropdownItemStyles,
177+
DropdownKeyboard,
178+
DropdownLabel,
180179
DropdownSection,
181180
dropdownSectionStyles,
181+
DropdownSeparator,
182182
}

apps/ui/components/ui/field.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
import { tv } from "tailwind-variants"
2121

2222
import { composeTailwindRenderProps, focusStyles } from "./primitive"
23-
import { Typography } from "./typography";
23+
import { Typography } from "./typography"
2424

2525
interface FieldProps {
2626
label?: string
@@ -116,13 +116,13 @@ const FieldGroup = ({ className, ...props }: GroupProps) => {
116116
return (
117117
<Typography as="div">
118118
<Group
119-
{...props}
120-
className={composeRenderProps(className, (className, renderProps) =>
121-
fieldGroupStyles({
122-
...renderProps,
123-
className,
124-
}),
125-
)}
119+
{...props}
120+
className={composeRenderProps(className, (className, renderProps) =>
121+
fieldGroupStyles({
122+
...renderProps,
123+
className,
124+
}),
125+
)}
126126
/>
127127
</Typography>
128128
)

apps/ui/components/ui/keyboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { tv } from "tailwind-variants"
55

66
const keyboardStyles = tv({
77
slots: {
8-
base: "hidden text-current/70 group-hover:text-fg group-disabled:opacity-50 group-data-focused:text-fg group-data-focused:opacity-90 lg:inline-flex items-center forced-colors:group-data-focused:text-[HighlightText]",
8+
base: "hidden items-center text-current/70 group-hover:text-fg group-disabled:opacity-50 group-data-focused:text-fg group-data-focused:opacity-90 lg:inline-flex forced-colors:group-data-focused:text-[HighlightText]",
99
kbd: "inline-grid min-h-5 min-w-[2ch] place-content-center rounded text-center font-sans text-[.75rem] uppercase",
1010
},
1111
})

apps/ui/components/ui/list-box.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const ListBox = <T extends object>({ className, ...props }: ListBoxProps<T>) =>
2020
{...props}
2121
className={composeTailwindRenderProps(
2222
className,
23-
"flex grid max-h-96 w-full min-w-56 grid-cols-[auto_1fr] flex-col gap-y-1 overflow-auto overflow-y-auto rounded-xl border p-1 shadow-lg outline-hidden [scrollbar-width:thin] [&::-webkit-scrollbar]:size-0.5 *:[[role='group']+[role=group]]:mt-4 *:[[role='group']+[role=separator]]:mt-1",
23+
"grid max-h-96 w-full min-w-56 grid-cols-[auto_1fr] flex-col gap-y-1 overflow-auto overflow-y-auto rounded-xl border p-1 shadow-lg outline-hidden [scrollbar-width:thin] [&::-webkit-scrollbar]:size-0.5 *:[[role='group']+[role=group]]:mt-4 *:[[role='group']+[role=separator]]:mt-1",
2424
)}
2525
/>
2626
)

apps/ui/components/ui/select.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,24 @@ const Select = <T extends object>({
6868
>
6969
{(values) => (
7070
<>
71-
{label &&
71+
{label && (
7272
<Typography as="div">
7373
<Label isRequired={props.isRequired}>{label}</Label>
7474
</Typography>
75-
}
75+
)}
7676
{typeof props.children === "function" ? props.children(values) : props.children}
77-
{description &&
77+
{description && (
7878
<Typography as="div">
7979
<Description>{description}</Description>
8080
</Typography>
81-
}
82-
81+
)}
82+
8383
{(leftDescription || errorMessage || rightDescription) && (
8484
<Typography as="div">
85-
<div className="mt-1 flex justify-between text-sm text-muted-fg">
86-
<div>{errorMessage ? <FieldError>{errorMessage}</FieldError> : leftDescription}</div>
85+
<div className="mt-1 flex justify-between text-muted-fg text-sm">
86+
<div>
87+
{errorMessage ? <FieldError>{errorMessage}</FieldError> : leftDescription}
88+
</div>
8789
<div>{rightDescription}</div>
8890
</div>
8991
</Typography>
@@ -169,4 +171,4 @@ Select.Trigger = SelectTrigger
169171
Select.List = SelectList
170172

171173
export type { SelectProps, SelectTriggerProps }
172-
export { Select }
174+
export { Select }

apps/ui/components/ui/text-field.tsx

Lines changed: 79 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import {
1010
type TextFieldProps as TextFieldPrimitiveProps,
1111
} from "react-aria-components"
1212

13-
import {FieldError, FieldProps} from "./field"
13+
import { FieldError, type FieldProps } from "./field"
1414
import { Description, FieldGroup, Input, Label } from "./field"
1515
import { Loader } from "./loader"
1616
import { composeTailwindRenderProps } from "./primitive"
17-
import {Typography} from "./typography";
17+
import { Typography } from "./typography"
1818

1919
type InputType = Exclude<TextInputDOMProps["type"], "password">
2020

@@ -40,20 +40,20 @@ interface NonRevealableTextFieldProps extends BaseTextFieldProps {
4040
type TextFieldProps = RevealableTextFieldProps | NonRevealableTextFieldProps
4141

4242
const TextField = ({
43-
placeholder,
44-
label,
45-
description,
46-
errorMessage,
47-
prefix,
48-
suffix,
49-
isPending,
50-
className,
51-
isRevealable,
52-
type,
53-
leftDescription,
54-
rightDescription,
55-
...props
56-
}: TextFieldProps) => {
43+
placeholder,
44+
label,
45+
description,
46+
errorMessage,
47+
prefix,
48+
suffix,
49+
isPending,
50+
className,
51+
isRevealable,
52+
type,
53+
leftDescription,
54+
rightDescription,
55+
...props
56+
}: TextFieldProps) => {
5757
const [isPasswordVisible, setIsPasswordVisible] = useState(false)
5858
const [autoError, setAutoError] = useState<string | null>(null)
5959

@@ -76,68 +76,70 @@ const TextField = ({
7676
}
7777

7878
return (
79-
<TextFieldPrimitive
80-
type={inputType}
81-
{...props}
82-
className={composeTailwindRenderProps(className, "group flex flex-col gap-y-1")}
83-
>
84-
{!props.children ? (
85-
<>
86-
{label &&
87-
<Typography as="div">
88-
<Label isRequired={props.isRequired}>{label}</Label>
89-
</Typography>
90-
}
91-
<FieldGroup
92-
isDisabled={props.isDisabled}
93-
isInvalid={!!errorMessage || !!autoError}
94-
data-loading={isPending ? "true" : undefined}
79+
<TextFieldPrimitive
80+
type={inputType}
81+
{...props}
82+
className={composeTailwindRenderProps(className, "group flex flex-col gap-y-1")}
83+
>
84+
{!props.children ? (
85+
<>
86+
{label && (
87+
<Typography as="div">
88+
<Label isRequired={props.isRequired}>{label}</Label>
89+
</Typography>
90+
)}
91+
<FieldGroup
92+
isDisabled={props.isDisabled}
93+
isInvalid={!!errorMessage || !!autoError}
94+
data-loading={isPending ? "true" : undefined}
95+
>
96+
{prefix && typeof prefix === "string" ? (
97+
<Typography as="div">
98+
<span className="ml-2 text-muted-fg">{prefix}</span>
99+
</Typography>
100+
) : (
101+
<Typography as="div">{prefix}</Typography>
102+
)}
103+
<Input placeholder={placeholder} onInvalid={handleInvalid} onInput={handleInput} />
104+
{isRevealable ? (
105+
<ButtonPrimitive
106+
type="button"
107+
aria-label="Toggle password visibility"
108+
onPress={handleTogglePasswordVisibility}
109+
className="relative mr-1 grid shrink-0 place-content-center rounded-sm border-transparent outline-hidden data-focus-visible:*:data-[slot=icon]:text-primary *:data-[slot=icon]:text-muted-fg"
95110
>
96-
{prefix && typeof prefix === "string" ? (
97-
<Typography as="div"><span className="ml-2 text-muted-fg">{prefix}</span></Typography>
98-
) : (
99-
<Typography as="div">{prefix}</Typography>
100-
)}
101-
<Input
102-
placeholder={placeholder}
103-
onInvalid={handleInvalid}
104-
onInput={handleInput}
105-
/>
106-
{isRevealable ? (
107-
<ButtonPrimitive
108-
type="button"
109-
aria-label="Toggle password visibility"
110-
onPress={handleTogglePasswordVisibility}
111-
className="relative mr-1 grid shrink-0 place-content-center rounded-sm border-transparent outline-hidden data-focus-visible:*:data-[slot=icon]:text-primary *:data-[slot=icon]:text-muted-fg"
112-
>
113-
{isPasswordVisible ? <IconEyeClosed /> : <IconEye />}
114-
</ButtonPrimitive>
115-
) : isPending ? (
116-
<Loader variant="spin" />
117-
) : suffix ? (
118-
typeof suffix === "string" ? (
119-
<span className="mr-2 text-muted-fg">{suffix}</span>
120-
) : (
121-
suffix
122-
)
123-
) : null}
124-
</FieldGroup>
125-
126-
{description && <Typography as="div"><Description>{description}</Description></Typography>}
127-
128-
{(leftDescription || autoError || rightDescription) && (
129-
<Typography as="div">
130-
<div className="mt-1 flex justify-between text-sm text-muted-fg">
131-
<div>{autoError ? <FieldError>{autoError}</FieldError> : leftDescription}</div>
132-
<div>{rightDescription}</div>
133-
</div>
134-
</Typography>
135-
)}
136-
</>
137-
) : (
138-
props.children
139-
)}
140-
</TextFieldPrimitive>
111+
{isPasswordVisible ? <IconEyeClosed /> : <IconEye />}
112+
</ButtonPrimitive>
113+
) : isPending ? (
114+
<Loader variant="spin" />
115+
) : suffix ? (
116+
typeof suffix === "string" ? (
117+
<span className="mr-2 text-muted-fg">{suffix}</span>
118+
) : (
119+
suffix
120+
)
121+
) : null}
122+
</FieldGroup>
123+
124+
{description && (
125+
<Typography as="div">
126+
<Description>{description}</Description>
127+
</Typography>
128+
)}
129+
130+
{(leftDescription || autoError || rightDescription) && (
131+
<Typography as="div">
132+
<div className="mt-1 flex justify-between text-muted-fg text-sm">
133+
<div>{autoError ? <FieldError>{autoError}</FieldError> : leftDescription}</div>
134+
<div>{rightDescription}</div>
135+
</div>
136+
</Typography>
137+
)}
138+
</>
139+
) : (
140+
props.children
141+
)}
142+
</TextFieldPrimitive>
141143
)
142144
}
143145

0 commit comments

Comments
 (0)