Skip to content

Commit

Permalink
[1.x] Remove "Breeze" component prefix (laravel#179)
Browse files Browse the repository at this point in the history
* Remove Breeze prefix from components

* Standardize layout components

* Rename components that conflict with HTML elements
  • Loading branch information
jessarcher authored and slimani-dev committed Jan 21, 2023
1 parent 11cd788 commit 70d50b6
Show file tree
Hide file tree
Showing 33 changed files with 212 additions and 212 deletions.
8 changes: 4 additions & 4 deletions stubs/default/resources/views/auth/confirm-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@

<!-- Password -->
<div>
<x-label for="password" :value="__('Password')" />
<x-input-label for="password" :value="__('Password')" />

<x-input id="password" class="block mt-1 w-full"
<x-text-input id="password" class="block mt-1 w-full"
type="password"
name="password"
required autocomplete="current-password" />
</div>

<div class="flex justify-end mt-4">
<x-button>
<x-primary-button>
{{ __('Confirm') }}
</x-button>
</x-primary-button>
</div>
</form>
</x-auth-card>
Expand Down
8 changes: 4 additions & 4 deletions stubs/default/resources/views/auth/forgot-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

<!-- Email Address -->
<div>
<x-label for="email" :value="__('Email')" />
<x-input-label for="email" :value="__('Email')" />

<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
</div>

<div class="flex items-center justify-end mt-4">
<x-button>
<x-primary-button>
{{ __('Email Password Reset Link') }}
</x-button>
</x-primary-button>
</div>
</form>
</x-auth-card>
Expand Down
12 changes: 6 additions & 6 deletions stubs/default/resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@

<!-- Email Address -->
<div>
<x-label for="email" :value="__('Email')" />
<x-input-label for="email" :value="__('Email')" />

<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
</div>

<!-- Password -->
<div class="mt-4">
<x-label for="password" :value="__('Password')" />
<x-input-label for="password" :value="__('Password')" />

<x-input id="password" class="block mt-1 w-full"
<x-text-input id="password" class="block mt-1 w-full"
type="password"
name="password"
required autocomplete="current-password" />
Expand All @@ -47,9 +47,9 @@
</a>
@endif

<x-button class="ml-3">
<x-primary-button class="ml-3">
{{ __('Log in') }}
</x-button>
</x-primary-button>
</div>
</form>
</x-auth-card>
Expand Down
20 changes: 10 additions & 10 deletions stubs/default/resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@

<!-- Name -->
<div>
<x-label for="name" :value="__('Name')" />
<x-input-label for="name" :value="__('Name')" />

<x-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus />
<x-text-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus />
</div>

<!-- Email Address -->
<div class="mt-4">
<x-label for="email" :value="__('Email')" />
<x-input-label for="email" :value="__('Email')" />

<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
</div>

<!-- Password -->
<div class="mt-4">
<x-label for="password" :value="__('Password')" />
<x-input-label for="password" :value="__('Password')" />

<x-input id="password" class="block mt-1 w-full"
<x-text-input id="password" class="block mt-1 w-full"
type="password"
name="password"
required autocomplete="new-password" />
</div>

<!-- Confirm Password -->
<div class="mt-4">
<x-label for="password_confirmation" :value="__('Confirm Password')" />
<x-input-label for="password_confirmation" :value="__('Confirm Password')" />

<x-input id="password_confirmation" class="block mt-1 w-full"
<x-text-input id="password_confirmation" class="block mt-1 w-full"
type="password"
name="password_confirmation" required />
</div>
Expand All @@ -50,9 +50,9 @@
{{ __('Already registered?') }}
</a>

<x-button class="ml-4">
<x-primary-button class="ml-4">
{{ __('Register') }}
</x-button>
</x-primary-button>
</div>
</form>
</x-auth-card>
Expand Down
16 changes: 8 additions & 8 deletions stubs/default/resources/views/auth/reset-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@

<!-- Email Address -->
<div>
<x-label for="email" :value="__('Email')" />
<x-input-label for="email" :value="__('Email')" />

<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email', $request->email)" required autofocus />
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email', $request->email)" required autofocus />
</div>

<!-- Password -->
<div class="mt-4">
<x-label for="password" :value="__('Password')" />
<x-input-label for="password" :value="__('Password')" />

<x-input id="password" class="block mt-1 w-full" type="password" name="password" required />
<x-text-input id="password" class="block mt-1 w-full" type="password" name="password" required />
</div>

<!-- Confirm Password -->
<div class="mt-4">
<x-label for="password_confirmation" :value="__('Confirm Password')" />
<x-input-label for="password_confirmation" :value="__('Confirm Password')" />

<x-input id="password_confirmation" class="block mt-1 w-full"
<x-text-input id="password_confirmation" class="block mt-1 w-full"
type="password"
name="password_confirmation" required />
</div>

<div class="flex items-center justify-end mt-4">
<x-button>
<x-primary-button>
{{ __('Reset Password') }}
</x-button>
</x-primary-button>
</div>
</form>
</x-auth-card>
Expand Down
4 changes: 2 additions & 2 deletions stubs/default/resources/views/auth/verify-email.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
@csrf

<div>
<x-button>
<x-primary-button>
{{ __('Resend Verification Email') }}
</x-button>
</x-primary-button>
</div>
</form>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

export default function Label({ forInput, value, className, children }) {
export default function InputLabel({ forInput, value, className, children }) {
return (
<label htmlFor={forInput} className={`block font-medium text-sm text-gray-700 ` + className}>
{value ? value : children}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

export default function Button({ type = 'submit', className = '', processing, children }) {
export default function PrimaryButton({ type = 'submit', className = '', processing, children }) {
return (
<button
type={type}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useRef } from 'react';

export default function Input({
export default function TextInput({
type = 'text',
name,
id,
Expand Down
20 changes: 10 additions & 10 deletions stubs/inertia-react/resources/js/Pages/Auth/ConfirmPassword.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect } from 'react';
import Button from '@/Components/Button';
import Guest from '@/Layouts/Guest';
import Input from '@/Components/Input';
import GuestLayout from '@/Layouts/GuestLayout';
import InputError from '@/Components/InputError';
import Label from '@/Components/Label';
import InputLabel from '@/Components/InputLabel';
import PrimaryButton from '@/Components/PrimaryButton';
import TextInput from '@/Components/TextInput';
import { Head, useForm } from '@inertiajs/inertia-react';

export default function ConfirmPassword() {
Expand All @@ -28,7 +28,7 @@ export default function ConfirmPassword() {
};

return (
<Guest>
<GuestLayout>
<Head title="Confirm Password" />

<div className="mb-4 text-sm text-gray-600">
Expand All @@ -37,9 +37,9 @@ export default function ConfirmPassword() {

<form onSubmit={submit}>
<div className="mt-4">
<Label forInput="password" value="Password" />
<InputLabel forInput="password" value="Password" />

<Input
<TextInput
type="password"
name="password"
value={data.password}
Expand All @@ -52,11 +52,11 @@ export default function ConfirmPassword() {
</div>

<div className="flex items-center justify-end mt-4">
<Button className="ml-4" processing={processing}>
<PrimaryButton className="ml-4" processing={processing}>
Confirm
</Button>
</PrimaryButton>
</div>
</form>
</Guest>
</GuestLayout>
);
}
16 changes: 8 additions & 8 deletions stubs/inertia-react/resources/js/Pages/Auth/ForgotPassword.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import Button from '@/Components/Button';
import Guest from '@/Layouts/Guest';
import Input from '@/Components/Input';
import GuestLayout from '@/Layouts/GuestLayout';
import InputError from '@/Components/InputError';
import PrimaryButton from '@/Components/PrimaryButton';
import TextInput from '@/Components/TextInput';
import { Head, useForm } from '@inertiajs/inertia-react';

export default function ForgotPassword({ status }) {
Expand All @@ -21,7 +21,7 @@ export default function ForgotPassword({ status }) {
};

return (
<Guest>
<GuestLayout>
<Head title="Forgot Password" />

<div className="mb-4 text-sm text-gray-500 leading-normal">
Expand All @@ -32,7 +32,7 @@ export default function ForgotPassword({ status }) {
{status && <div className="mb-4 font-medium text-sm text-green-600">{status}</div>}

<form onSubmit={submit}>
<Input
<TextInput
type="text"
name="email"
value={data.email}
Expand All @@ -44,11 +44,11 @@ export default function ForgotPassword({ status }) {
<InputError message={errors.email} className="mt-2" />

<div className="flex items-center justify-end mt-4">
<Button className="ml-4" processing={processing}>
<PrimaryButton className="ml-4" processing={processing}>
Email Password Reset Link
</Button>
</PrimaryButton>
</div>
</form>
</Guest>
</GuestLayout>
);
}
24 changes: 12 additions & 12 deletions stubs/inertia-react/resources/js/Pages/Auth/Login.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useEffect } from 'react';
import Button from '@/Components/Button';
import Checkbox from '@/Components/Checkbox';
import Guest from '@/Layouts/Guest';
import Input from '@/Components/Input';
import GuestLayout from '@/Layouts/GuestLayout';
import InputError from '@/Components/InputError';
import Label from '@/Components/Label';
import InputLabel from '@/Components/InputLabel';
import PrimaryButton from '@/Components/PrimaryButton';
import TextInput from '@/Components/TextInput';
import { Head, Link, useForm } from '@inertiajs/inertia-react';

export default function Login({ status, canResetPassword }) {
Expand All @@ -31,16 +31,16 @@ export default function Login({ status, canResetPassword }) {
};

return (
<Guest>
<GuestLayout>
<Head title="Log in" />

{status && <div className="mb-4 font-medium text-sm text-green-600">{status}</div>}

<form onSubmit={submit}>
<div>
<Label forInput="email" value="Email" />
<InputLabel forInput="email" value="Email" />

<Input
<TextInput
type="text"
id="email"
name="email"
Expand All @@ -55,9 +55,9 @@ export default function Login({ status, canResetPassword }) {
</div>

<div className="mt-4">
<Label forInput="password" value="Password" />
<InputLabel forInput="password" value="Password" />

<Input
<TextInput
type="password"
id="password"
name="password"
Expand Down Expand Up @@ -88,11 +88,11 @@ export default function Login({ status, canResetPassword }) {
</Link>
)}

<Button className="ml-4" processing={processing}>
<PrimaryButton className="ml-4" processing={processing}>
Log in
</Button>
</PrimaryButton>
</div>
</form>
</Guest>
</GuestLayout>
);
}
Loading

0 comments on commit 70d50b6

Please sign in to comment.