Skip to content

Commit 2377a9b

Browse files
committed
bump
1 parent 7bf2638 commit 2377a9b

24 files changed

+373
-349
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### TL;DR
1+
### TL;DR
22

33
```bash
44
composer create-project justd/laravel your-project-name

bun.lockb

0 Bytes
Binary file not shown.

resources/css/app.css

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
@variant dark (&:is(.dark *));
55

66
@theme {
7-
--font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
8-
'Segoe UI Symbol', 'Noto Color Emoji';
7+
--font-sans:
8+
'Figtree', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
9+
'Noto Color Emoji';
910

1011
--color-border: var(--border);
1112
--color-input: var(--input);

resources/js/components/ui/avatar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { tv, type VariantProps } from 'tailwind-variants';
1+
import { type VariantProps, tv } from 'tailwind-variants';
22

33
const avatar = tv({
44
base: [

resources/js/components/ui/button.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ const buttonStyles = tv({
5454
plain: ['border-transparent data-hovered:bg-secondary data-pressed:bg-secondary']
5555
},
5656
size: {
57-
'extra-small': 'h-8 px-[calc(var(--spacing)*2.7)] text-xs/4 lg:text-[0.800rem]/4',
57+
'extra-small':
58+
'h-8 px-[calc(var(--spacing)*2.7)] text-xs/4 **:data-[slot=avatar]:*:size-3.5 **:data-[slot=avatar]:size-3.5 **:data-[slot=icon]:size-3 lg:text-[0.800rem]/4',
5859
small: 'h-9 px-3.5 text-sm/5 sm:text-sm/5',
5960
medium: 'h-10 px-4 text-base sm:text-sm/6',
6061
large: 'h-11 px-4.5 text-base *:data-[slot=icon]:mx-[-1.5px] sm:*:data-[slot=icon]:size-5 lg:text-base/7',
@@ -109,5 +110,5 @@ const Button = ({ className, intent, appearance, size, shape, ref, ...props }: B
109110
);
110111
};
111112

112-
export { Button, ButtonPrimitive, buttonStyles };
113+
export { Button, buttonStyles };
113114
export type { ButtonProps };

resources/js/components/ui/card.tsx

+45-37
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,68 @@
1-
import { tv } from 'tailwind-variants';
2-
1+
import { cn } from '@/utils/classes';
32
import { Heading } from './heading';
43

5-
const card = tv({
6-
slots: {
7-
root: [
8-
'xrkr xkd2 rounded-lg border bg-bg text-fg shadow-xs has-[table]:overflow-hidden **:data-[slot=table-header]:bg-muted/50 has-[table]:**:data-[slot=card-footer]:border-t **:[table]:overflow-hidden'
9-
],
10-
header: 'flex flex-col gap-y-1 px-6 py-5',
11-
title: 'font-semibold leading-none tracking-tight sm:leading-6',
12-
description: 'text-muted-fg text-sm',
13-
content:
14-
'px-6 pb-6 has-[table]:border-t has-[[data-slot=table-header]]:bg-muted/40 has-[table]:p-0 **:data-[slot=table-cell]:px-6 **:data-[slot=table-column]:px-6 [&:has(table)+[data-slot=card-footer]]:py-5',
15-
footer: 'flex items-center p-6 pt-0'
16-
}
17-
});
18-
19-
const { root, header, title, description, content, footer } = card();
20-
214
const Card = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => {
22-
return <div data-slot="card" className={root({ className })} {...props} />;
5+
return (
6+
<div
7+
data-slot="card"
8+
className={cn(
9+
'rounded-lg border bg-bg text-fg shadow-xs has-[table]:overflow-hidden **:data-[slot=table-header]:bg-muted/50 has-[table]:**:data-[slot=card-footer]:border-t **:[table]:overflow-hidden',
10+
className
11+
)}
12+
{...props}
13+
/>
14+
);
2315
};
2416

2517
interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
2618
title?: string;
2719
description?: string;
2820
}
2921

30-
const Header = ({ className, title, description, children, ...props }: HeaderProps) => (
31-
<div data-slot="card-header" className={header({ className })} {...props}>
32-
{title && <Title>{title}</Title>}
33-
{description && <Description>{description}</Description>}
34-
{!title && typeof children === 'string' ? <Title>{children}</Title> : children}
22+
const CardHeader = ({ className, title, description, children, ...props }: HeaderProps) => (
23+
<div data-slot="card-header" className={cn('flex flex-col gap-y-1 px-6 py-5', className)} {...props}>
24+
{title && <CardTitle>{title}</CardTitle>}
25+
{description && <CardDescription>{description}</CardDescription>}
26+
{!title && typeof children === 'string' ? <CardTitle>{children}</CardTitle> : children}
3527
</div>
3628
);
3729

38-
const Title = ({ className, level = 3, ...props }: React.ComponentProps<typeof Heading>) => {
39-
return <Heading data-slot="card-title" level={level} className={title({ className })} {...props} />;
30+
const CardTitle = ({ className, level = 3, ...props }: React.ComponentProps<typeof Heading>) => {
31+
return (
32+
<Heading
33+
data-slot="card-title"
34+
level={level}
35+
className={cn('font-semibold leading-none tracking-tight sm:leading-6', className)}
36+
{...props}
37+
/>
38+
);
4039
};
4140

42-
const Description = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => {
43-
return <div {...props} data-slot="description" className={description({ className })} {...props} />;
41+
const CardDescription = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => {
42+
return <div {...props} data-slot="description" className={cn('text-muted-fg text-sm', className)} {...props} />;
4443
};
4544

46-
const Content = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => {
47-
return <div data-slot="card-content" className={content({ className })} {...props} />;
45+
const CardContent = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => {
46+
return (
47+
<div
48+
data-slot="card-content"
49+
className={cn(
50+
'px-6 pb-6 has-[table]:border-t has-[[data-slot=table-header]]:bg-muted/40 has-[table]:p-0 **:data-[slot=table-cell]:px-6 **:data-[slot=table-column]:px-6 [&:has(table)+[data-slot=card-footer]]:py-5',
51+
className
52+
)}
53+
{...props}
54+
/>
55+
);
4856
};
4957

50-
const Footer = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => {
51-
return <div data-slot="card-footer" className={footer({ className })} {...props} />;
58+
const CardFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => {
59+
return <div data-slot="card-footer" className={cn('flex items-center p-6 pt-0', className)} {...props} />;
5260
};
5361

54-
Card.Content = Content;
55-
Card.Description = Description;
56-
Card.Footer = Footer;
57-
Card.Header = Header;
58-
Card.Title = Title;
62+
Card.Content = CardContent;
63+
Card.Description = CardDescription;
64+
Card.Footer = CardFooter;
65+
Card.Header = CardHeader;
66+
Card.Title = CardTitle;
5967

6068
export { Card };

resources/js/components/ui/checkbox.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface CheckboxGroupProps extends CheckboxGroupPrimitiveProps {
2424
const CheckboxGroup = ({ className, ...props }: CheckboxGroupProps) => {
2525
return (
2626
<CheckboxGroupPrimitive {...props} className={composeTailwindRenderProps(className, 'flex flex-col gap-y-2')}>
27-
<Label>{props.label}</Label>
27+
{props.label && <Label>{props.label}</Label>}
2828
{props.children as React.ReactNode}
2929
{props.description && <Description className="block">{props.description}</Description>}
3030
<FieldError>{props.errorMessage}</FieldError>
@@ -89,7 +89,11 @@ const Checkbox = ({ className, ...props }: CheckboxProps) => {
8989

9090
<div className="flex flex-col gap-1">
9191
<>
92-
{props.label ? <Label>{props.label}</Label> : (props.children as React.ReactNode)}
92+
{props.label ? (
93+
<Label className={cn(props.description && 'font-normal text-sm/4')}>{props.label}</Label>
94+
) : (
95+
(props.children as React.ReactNode)
96+
)}
9397
{props.description && <Description>{props.description}</Description>}
9498
</>
9599
</div>

resources/js/components/ui/dialog.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useEffect, useRef } from 'react';
22

33
import { IconX } from 'justd-icons';
4-
import type { ButtonProps as ButtonPrimitiveProps, DialogProps, HeadingProps } from 'react-aria-components';
5-
import { Button as ButtonPrimitive, Dialog as DialogPrimitive, Heading } from 'react-aria-components';
4+
import type { HeadingProps } from 'react-aria-components';
5+
import { Button as ButtonPrimitive, Dialog as DialogPrimitive, Heading, Text } from 'react-aria-components';
66
import { tv } from 'tailwind-variants';
77

88
import { useMediaQuery } from '@/utils/use-media-query';
@@ -17,22 +17,22 @@ const dialogStyles = tv({
1717
'relative flex flex-col gap-0.5 p-4 sm:gap-1 sm:p-6 [&[data-slot=dialog-header]:has(+[data-slot=dialog-footer])]:pb-0',
1818
description: 'text-muted-fg text-sm',
1919
body: [
20-
'isolate flex flex-1 flex-col overflow-auto px-4 sm:px-6',
20+
'isolate flex flex-1 flex-col overflow-auto px-4 py-1 sm:px-6',
2121
'max-h-[calc(var(--visual-viewport-height)-var(--visual-viewport-vertical-padding)-var(--dialog-header-height,0px)-var(--dialog-footer-height,0px))]'
2222
],
23-
footer: 'isolate mt-auto flex flex-col-reverse justify-between gap-3 p-4 sm:flex-row sm:p-6',
23+
footer: 'isolate mt-auto flex flex-col-reverse justify-between gap-3 p-4 pt-3 sm:flex-row sm:p-6 sm:pt-5',
2424
closeIndicator:
2525
'close absolute top-1 right-1 z-50 grid size-8 place-content-center rounded-xl data-focused:bg-secondary data-hovered:bg-secondary data-focused:outline-hidden data-focus-visible:ring-1 data-focus-visible:ring-primary sm:top-2 sm:right-2 sm:size-7 sm:rounded-md'
2626
}
2727
});
2828

2929
const { root, header, description, body, footer, closeIndicator } = dialogStyles();
3030

31-
const Dialog = ({ role, className, ...props }: DialogProps) => {
32-
return <DialogPrimitive role={role ?? 'dialog'} className={root({ className })} {...props} />;
31+
const Dialog = ({ role = 'dialog', className, ...props }: React.ComponentProps<typeof DialogPrimitive>) => {
32+
return <DialogPrimitive role={role} className={root({ className })} {...props} />;
3333
};
3434

35-
const Trigger = (props: ButtonPrimitiveProps) => <ButtonPrimitive slot="close" {...props} />;
35+
const Trigger = (props: React.ComponentProps<typeof ButtonPrimitive>) => <ButtonPrimitive {...props} />;
3636

3737
type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
3838
title?: string;
@@ -89,7 +89,7 @@ const Title = ({ level = 2, className, ref, ...props }: DialogTitleProps) => (
8989

9090
type DialogDescriptionProps = React.ComponentProps<'div'>;
9191
const Description = ({ className, ref, ...props }: DialogDescriptionProps) => (
92-
<div className={description({ className })} ref={ref} {...props} />
92+
<Text slot="description" className={description({ className })} ref={ref} {...props} />
9393
);
9494

9595
type DialogBodyProps = React.ComponentProps<'div'>;

resources/js/components/ui/dropdown.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { cn } from '@/utils/classes';
22
import { IconCheck } from 'justd-icons';
33
import {
44
Collection,
5-
composeRenderProps,
65
Header,
76
ListBoxItem as ListBoxItemPrimitive,
87
type ListBoxItemProps,
@@ -11,7 +10,8 @@ import {
1110
Separator,
1211
type SeparatorProps,
1312
Text,
14-
type TextProps
13+
type TextProps,
14+
composeRenderProps
1515
} from 'react-aria-components';
1616
import { tv } from 'tailwind-variants';
1717
import { Keyboard } from './keyboard';
@@ -145,11 +145,11 @@ const DropdownKeyboard = ({ className, ...props }: React.ComponentProps<typeof K
145145
export {
146146
DropdownItem,
147147
DropdownItemDetails,
148-
dropdownItemStyles,
149148
DropdownKeyboard,
150149
DropdownLabel,
151150
DropdownSection,
152-
dropdownSectionStyles,
153-
DropdownSeparator
151+
DropdownSeparator,
152+
dropdownItemStyles,
153+
dropdownSectionStyles
154154
};
155155
export type { DropdownItemDetailProps, DropdownItemProps, DropdownSectionProps };

resources/js/components/ui/field.tsx

+28-15
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import type {
88
ValidationResult
99
} from 'react-aria-components';
1010
import {
11-
composeRenderProps,
1211
FieldError as FieldErrorPrimitive,
1312
Group,
1413
Input as InputPrimitive,
1514
Label as LabelPrimitive,
16-
Text
15+
Text,
16+
composeRenderProps
1717
} from 'react-aria-components';
1818
import { tv } from 'tailwind-variants';
1919

@@ -31,15 +31,12 @@ interface FieldProps {
3131
const fieldStyles = tv({
3232
slots: {
3333
description: 'text-pretty text-muted-fg text-sm/6',
34-
label: 'w-fit cursor-default font-medium text-secondary-fg text-sm',
35-
fieldError: 'text-danger text-sm/6 forced-colors:text-[Mark]',
36-
input: [
37-
'w-full min-w-0 bg-transparent px-2.5 py-2 text-base text-fg placeholder-muted-fg outline-hidden data-focused:outline-hidden sm:text-sm [&::-ms-reveal]:hidden'
38-
]
34+
label: 'w-fit cursor-default font-medium text-secondary-fg text-sm/6',
35+
fieldError: 'text-danger text-sm/6 forced-colors:text-[Mark]'
3936
}
4037
});
4138

42-
const { description, label, fieldError, input } = fieldStyles();
39+
const { description, label, fieldError } = fieldStyles();
4340

4441
const Label = ({ className, ...props }: LabelProps) => {
4542
return <LabelPrimitive {...props} className={label({ className })} />;
@@ -71,12 +68,18 @@ const FieldError = ({ className, ref, ...props }: FieldErrorProps) => {
7168

7269
const fieldGroupStyles = tv({
7370
base: [
74-
'group flex h-10 items-center overflow-hidden rounded-lg border border-input transition duration-200 ease-out',
75-
'focus-within:ring-4 group-data-invalid:focus-within:border-danger group-data-invalid:focus-within:ring-danger/20',
76-
'[&>[role=progressbar]]:mr-2.5',
77-
'**:data-[slot=icon]:size-4 **:data-[slot=icon]:shrink-0',
78-
'*:data-[slot=suffix]:mr-2.5 *:data-[slot=suffix]:text-muted-fg',
79-
'*:data-[slot=prefix]:ml-2.5 *:data-[slot=prefix]:text-muted-fg'
71+
'group flex h-10 items-center overflow-hidden rounded-lg border border-input shadow-xs transition duration-200 ease-out',
72+
'relative focus-within:ring-4 group-data-invalid:focus-within:border-danger group-data-invalid:focus-within:ring-danger/20',
73+
'[&>[role=progressbar]:first-child]:ml-2.5 [&>[role=progressbar]:last-child]:mr-2.5',
74+
'**:data-[slot=icon]:size-4 **:data-[slot=icon]:shrink-0 **:[button]:shrink-0',
75+
'[&>button:has([data-slot=icon]):first-child]:left-0 [&>button:has([data-slot=icon]):last-child]:right-0 [&>button:has([data-slot=icon])]:absolute',
76+
'*:data-[slot=icon]:pointer-events-none *:data-[slot=icon]:absolute *:data-[slot=icon]:top-[calc(var(--spacing)*2.7)] *:data-[slot=icon]:z-10 *:data-[slot=icon]:size-4 *:data-[slot=icon]:text-muted-fg',
77+
'[&>[data-slot=icon]:first-child]:left-2.5 [&>[data-slot=icon]:last-child]:right-2.5',
78+
'[&:has([data-slot=icon]+input)]:pl-6 [&:has(input+[data-slot=icon])]:pr-6',
79+
'[&:has([data-slot=icon]+[role=group])]:pl-6 [&:has([role=group]+[data-slot=icon])]:pr-6',
80+
'has-[[data-slot=icon]:last-child]:[&_input]:pr-7',
81+
'*:[button]:h-8 *:[button]:rounded-[calc(var(--radius-sm)-1px)] *:[button]:px-2.5',
82+
'[&>button:first-child]:ml-[calc(var(--spacing)*0.7)] [&>button:last-child]:mr-[calc(var(--spacing)*0.7)]'
8083
],
8184
variants: {
8285
isFocusWithin: focusStyles.variants.isFocused,
@@ -104,8 +107,18 @@ const FieldGroup = ({ className, ...props }: GroupProps) => {
104107
interface InputProps extends InputPrimitiveProps {
105108
ref?: React.RefObject<HTMLInputElement>;
106109
}
110+
107111
const Input = ({ className, ref, ...props }: InputProps) => {
108-
return <InputPrimitive ref={ref} {...props} className={composeTailwindRenderProps(className, input())} />;
112+
return (
113+
<InputPrimitive
114+
ref={ref}
115+
{...props}
116+
className={composeTailwindRenderProps(
117+
className,
118+
'w-full min-w-0 bg-transparent px-2.5 py-2 text-base text-fg placeholder-muted-fg outline-hidden data-focused:outline-hidden sm:text-sm/6 [&::-ms-reveal]:hidden [&::-webkit-search-cancel-button]:hidden'
119+
)}
120+
/>
121+
);
109122
};
110123

111124
export { Description, FieldError, FieldGroup, Input, Label };

resources/js/components/ui/keyboard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants';
33

44
const keyboardStyles = tv({
55
slots: {
6-
base: 'hidden text-current/70 group-data-focused:text-fg group-data-hovered:text-fg group-data-disabled:opacity-50 group-data-focused:opacity-90 lg:inline-flex lg:inline-flex forced-colors:group-data-focused:text-[HighlightText]',
6+
base: 'hidden text-current/70 group-data-focused:text-fg group-data-hovered:text-fg group-data-disabled:opacity-50 group-data-focused:opacity-90 lg:inline-flex forced-colors:group-data-focused:text-[HighlightText]',
77
kbd: 'inline-grid min-h-5 min-w-[2ch] place-content-center rounded text-center font-sans text-[.75rem] uppercase'
88
}
99
});

resources/js/components/ui/link.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { composeRenderProps, Link as LinkPrimitive, type LinkProps as LinkPrimitiveProps } from 'react-aria-components';
1+
import { Link as LinkPrimitive, type LinkProps as LinkPrimitiveProps, composeRenderProps } from 'react-aria-components';
22
import { tv } from 'tailwind-variants';
33

44
import { focusButtonStyles } from './primitive';
@@ -37,5 +37,5 @@ const Link = ({ className, ref, ...props }: LinkProps) => {
3737
);
3838
};
3939

40-
export { Link };
40+
export { Link, linkStyles };
4141
export type { LinkProps };

0 commit comments

Comments
 (0)