Skip to content

Commit c7717bc

Browse files
authored
Merge pull request #80 from justdlabs/laravel-11.x
Laravel 11.x
2 parents 6a63966 + 8f83e39 commit c7717bc

File tree

9 files changed

+78
-83
lines changed

9 files changed

+78
-83
lines changed

bun.lockb

1.86 KB
Binary file not shown.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "laravel/laravel",
2+
"name": "justd/inertia.tswip",
33
"type": "project",
44
"description": "The skeleton application for the Laravel framework.",
55
"keywords": [

composer.lock

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

justd.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"$schema": "http://justd.co",
23
"ui": "resources/js/components/ui"
34
}

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"devDependencies": {
1010
"@inertiajs/react": "^1.2.0",
1111
"@tailwindcss/forms": "^0.5.7",
12-
"@types/node": "^18.19.42",
12+
"@types/node": "^18.19.43",
1313
"@types/react": "^18.3.3",
1414
"@types/react-dom": "^18.3.0",
1515
"@vitejs/plugin-react": "^4.3.1",
16-
"autoprefixer": "^10.4.19",
17-
"axios": "^1.7.2",
16+
"autoprefixer": "^10.4.20",
17+
"axios": "^1.7.3",
1818
"laravel-vite-plugin": "^1.0.5",
1919
"postcss": "^8.4.40",
2020
"prettier": "^3.3.3",
@@ -28,9 +28,9 @@
2828
"vite-plugin-watch": "^0.3.1"
2929
},
3030
"dependencies": {
31-
"@irsyadadl/paranoid": "^1.4.11",
31+
"@irsyadadl/paranoid": "^1.4.12",
3232
"clsx": "^2.1.1",
33-
"framer-motion": "^11.3.19",
33+
"framer-motion": "^11.3.21",
3434
"react-aria-components": "^1.3.1",
3535
"sonner": "^1.5.0",
3636
"tailwind-merge": "^2.4.0",

resources/js/components/ui/avatar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ interface AvatarProps extends React.ComponentPropsWithoutRef<'span'>, VariantPro
4747
alt?: string
4848
status?: Status
4949
className?: string
50+
role?: string
5051
}
5152

5253
const Avatar = ({
@@ -58,14 +59,15 @@ const Avatar = ({
5859
className,
5960
shape,
6061
size,
62+
role = 'avatar',
6163
...props
6264
}: AvatarProps) => {
6365
const badgeId = React.useId()
6466
const ariaLabelledby = [badgeId, children ? badgeId : ''].join(' ')
6567
return (
6668
<span
6769
aria-labelledby={ariaLabelledby}
68-
role="avatar"
70+
role={role}
6971
data-slot="avatar"
7072
{...props}
7173
className={avatarStyles({ shape, size, className })}

resources/js/components/ui/field.tsx

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import {
1313
Text,
1414
type TextProps
1515
} from 'react-aria-components'
16-
import { twMerge } from 'tailwind-merge'
1716
import { tv } from 'tailwind-variants'
1817

1918
import { ctr } from './primitive'
2019

20+
// primitive styles
21+
22+
// primitive styles
2123
const fieldBorderStyles = tv({
2224
base: 'group-focus-within:border-primary forced-colors:border-[Highlight]',
2325
variants: {
@@ -27,26 +29,38 @@ const fieldBorderStyles = tv({
2729
}
2830
})
2931

30-
const Label = (props: LabelProps) => {
31-
return (
32-
<LabelPrimitive
33-
{...props}
34-
className={twMerge('w-fit cursor-default font-medium text-secondary-fg text-sm', props.className)}
35-
/>
36-
)
32+
const fieldGroupPrefixStyles = tv({
33+
base: [
34+
'flex group-invalid:border-danger group-disabled:bg-secondary group-disabled:opacity-50 items-center group-invalid:focus-within:ring-danger/20',
35+
'[&>.x2e2>.kbt32x]:size-7 [&>.x2e2>.kbt32x]:rounded-sm [&>.x2e2:has(.kbt32x)]:size-9 [&>.x2e2:has(.kbt32x)]:grid [&>.x2e2:has(.kbt32x)]:place-items-center',
36+
'[&>.x2e2>.kbt32x]:before:rounded-[calc(theme(borderRadius.sm)-1px)] [&>.x2e2>.kbt32x]:after:rounded-[calc(theme(borderRadius.sm)-1px)] dark:[&>.x2e2>.kbt32x]:after:rounded-sm',
37+
'[&>.isSfx:has(.kbt32x)]:-mr-2 [&>.isPfx:has(.kbt32x)]:-ml-2 [&>.isSfx>.kbt32x]:mr-0.5 [&>.isPfx>.kbt32x]:ml-0.5'
38+
]
39+
})
40+
41+
const fieldStyles = tv({
42+
slots: {
43+
description: 'text-sm text-muted-fg',
44+
label: 'w-fit cursor-default font-medium text-secondary-fg text-sm',
45+
fieldError: 'text-sm text-danger forced-colors:text-[Mark]',
46+
input: [
47+
'w-full min-w-0 bg-transparent p-2 text-base text-fg placeholder-muted-fg focus:outline-none lg:text-sm'
48+
]
49+
}
50+
})
51+
52+
const { description, label, fieldError, input } = fieldStyles()
53+
54+
const Label = ({ className, ...props }: LabelProps) => {
55+
return <LabelPrimitive {...props} className={label({ className })} />
3756
}
3857

39-
const Description = (props: TextProps) => {
40-
return <Text {...props} slot="description" className={twMerge('text-sm text-muted-fg', props.className)} />
58+
const Description = ({ className, ...props }: TextProps) => {
59+
return <Text {...props} slot="description" className={description({ className })} />
4160
}
4261

43-
const FieldError = (props: FieldErrorProps) => {
44-
return (
45-
<FieldErrorPrimitive
46-
{...props}
47-
className={ctr(props.className, 'text-sm text-danger forced-colors:text-[Mark]')}
48-
/>
49-
)
62+
const FieldError = ({ className, ...props }: FieldErrorProps) => {
63+
return <FieldErrorPrimitive {...props} className={ctr(className, fieldError())} />
5064
}
5165

5266
const fieldGroupStyles = tv({
@@ -59,15 +73,6 @@ const fieldGroupStyles = tv({
5973
]
6074
})
6175

62-
const fieldGroupPrefixStyles = tv({
63-
base: [
64-
'flex group-invalid:border-danger group-disabled:bg-secondary group-disabled:opacity-50 items-center group-invalid:focus-within:ring-danger/20',
65-
'[&>.x2e2>.kbt32x]:size-7 [&>.x2e2>.kbt32x]:rounded-sm [&>.x2e2:has(.kbt32x)]:size-9 [&>.x2e2:has(.kbt32x)]:grid [&>.x2e2:has(.kbt32x)]:place-items-center',
66-
'[&>.x2e2>.kbt32x]:before:rounded-[calc(theme(borderRadius.sm)-1px)] [&>.x2e2>.kbt32x]:after:rounded-[calc(theme(borderRadius.sm)-1px)] dark:[&>.x2e2>.kbt32x]:after:rounded-sm',
67-
'[&>.isSfx:has(.kbt32x)]:-mr-2 [&>.isPfx:has(.kbt32x)]:-ml-2 [&>.isSfx>.kbt32x]:mr-0.5 [&>.isPfx>.kbt32x]:ml-0.5'
68-
]
69-
})
70-
7176
const FieldGroup = (props: GroupProps) => {
7277
return (
7378
<Group
@@ -80,16 +85,7 @@ const FieldGroup = (props: GroupProps) => {
8085
}
8186

8287
const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref) => {
83-
return (
84-
<InputPrimitive
85-
ref={ref}
86-
{...props}
87-
className={ctr(
88-
props.className,
89-
'w-full min-w-0 bg-transparent p-2 text-base text-fg placeholder-muted-fg focus:outline-none lg:text-sm'
90-
)}
91-
/>
92-
)
88+
return <InputPrimitive ref={ref} {...props} className={ctr(props.className, input())} />
9389
})
9490
Input.displayName = 'Input'
9591

resources/js/components/ui/text-field.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,8 @@ const TextField = ({
3434
}: TextFieldProps) => {
3535
return (
3636
<TextFieldPrimitive {...props} className={ctr(props.className, 'group flex flex-col gap-1')}>
37-
{label && <Label id="x21z-id">{label}</Label>}
38-
<FieldGroup
39-
aria-labelledby={label ? 'x21z-id' : undefined}
40-
data-loading={isLoading ? 'true' : undefined}
41-
className={fieldGroupPrefixStyles()}
42-
>
37+
{label && <Label>{label}</Label>}
38+
<FieldGroup data-loading={isLoading ? 'true' : undefined} className={fieldGroupPrefixStyles()}>
4339
{isLoading && indicatorPlace === 'prefix' ? (
4440
<IconLoader className="animate-spin isPfx" />
4541
) : prefix ? (

resources/js/components/ui/toast.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { useTheme } from '@/components/theme-provider'
12
import { IconCheck, IconCircleInfoFill, IconLoader, IconTriangleInfoFill } from '@irsyadadl/paranoid'
23
import { Toaster as ToasterPrimitive, type ToasterProps } from 'sonner'
34
import { twJoin } from 'tailwind-merge'
45

5-
import { useTheme } from 'components/theme-provider'
66
import { buttonStyles } from './button'
77

88
const Toast = ({ ...props }: ToasterProps) => {
@@ -23,11 +23,11 @@ const Toast = ({ ...props }: ToasterProps) => {
2323
closeButton: true,
2424
classNames: {
2525
toast: twJoin(
26-
'bg-background ring-1 ring-border dark:ring-inset min-w-[22rem] rounded-xl text-fg overflow-hidden text-[0.925rem] backdrop-blur-xl px-4 py-3 font-normal sm:px-5 sm:py-5',
26+
'bg-background ring-1 ring-border dark:ring-inset sm:min-w-[22rem] rounded-xl text-fg overflow-hidden text-[0.925rem] backdrop-blur-xl px-4 py-3 font-normal sm:px-5 sm:py-5',
2727
'[&:has([data-icon])_[data-content]]:ml-5',
2828
'[&:has([data-button])_[data-close-button="true"]]:hidden',
2929
'[&:not([data-description])_[data-title]]:font-normal',
30-
'[&:has([data-description])_[data-title]]:!font-medium',
30+
'[&:has([data-description])_[data-title]]:!font-medium [&:has([data-description])_[data-title]]:!text-lg',
3131
'[&>[data-button]]:absolute [&>[data-button=true]]:bottom-4',
3232
'[&>[data-action=true]]:right-4',
3333
'[&>[data-cancel=true]]:left-4'

0 commit comments

Comments
 (0)