kaze 0.14.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76266303b2438a2b8150e105b949336025535af3fd5333a6046b6cc304c1838f
4
- data.tar.gz: 93c6e63fbd507419b506721869aaf2624057a9e27baf53c111ea6318a8dd9a40
3
+ metadata.gz: 70692c92f436ae83178d631efa5e3b076b205af9fb38865643da09778b3dc5bd
4
+ data.tar.gz: 79e38f700d7725df90445290a1299f3a42c7eb09e44ccf225474cb359f268952
5
5
  SHA512:
6
- metadata.gz: 94150da33b21e62478df0c05903f3405e3c15d3753d566f145726dd61e773d5074f9ccd4bd68df1f531ae30fd51390eedd80ec4b1805689b3a432f3513c72f3e
7
- data.tar.gz: 0d14fa92c8c2929b6d1286acba751e62af9f807389b36ab9564e21b905bde434e186861b053e8367e04f21a26eb335b4aa5360abc876178b28c35241232e348d
6
+ metadata.gz: 9c9070cd7055e4a06f18193ad13f715fef0cf6e002eb60e7424ee7cd2fe2696155d30918d7b686aa1a5f40229d727c9a1ad374a521cd8c3ad074d6d1f82ac6c7
7
+ data.tar.gz: d23b59dc85ce9d0b974b2e15d2bdd7a2b92892e671c68af00b3d7ca695376985f6a06e8cbd10fdce2ed1acb4bf42e5223d82fb42cd9d558f7f59e9bd4406f4eb
data/lib/kaze/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kaze
2
- VERSION = '0.14.0'
2
+ VERSION = '0.16.0'
3
3
  end
@@ -3,15 +3,15 @@ import ApplicationLogo from '@/Components/ApplicationLogo'
3
3
  import Dropdown from '@/Components/Dropdown'
4
4
  import NavLink from '@/Components/NavLink'
5
5
  import ResponsiveNavLink from '@/Components/ResponsiveNavLink'
6
- import { Link } from '@inertiajs/react'
7
- import { User } from '@/types'
6
+ import { Link, usePage } from '@inertiajs/react'
8
7
  import { dashboard_path, logout_path, profile_edit_path } from '@/routes'
9
8
 
10
- export default function Authenticated({
11
- user,
9
+ export default function AuthenticatedLayout({
12
10
  header,
13
11
  children,
14
- }: PropsWithChildren<{ user: User; header?: ReactNode }>) {
12
+ }: PropsWithChildren<{ header?: ReactNode }>) {
13
+ const user = usePage().props.auth.user
14
+
15
15
  const [showingNavigationDropdown, setShowingNavigationDropdown] = useState(false)
16
16
 
17
17
  const { pathname = '' } = typeof window !== 'undefined' ? window.location : {}
@@ -2,7 +2,7 @@ import ApplicationLogo from '@/Components/ApplicationLogo'
2
2
  import { Link } from '@inertiajs/react'
3
3
  import { PropsWithChildren } from 'react'
4
4
 
5
- export default function Guest({ children }: PropsWithChildren) {
5
+ export default function GuestLayout({ children }: PropsWithChildren) {
6
6
  return (
7
7
  <div className="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100">
8
8
  <div>
@@ -1,4 +1,4 @@
1
- import { useEffect, FormEventHandler } from 'react'
1
+ import { FormEventHandler } from 'react'
2
2
  import Checkbox from '@/Components/Checkbox'
3
3
  import GuestLayout from '@/Layouts/GuestLayout'
4
4
  import InputError from '@/Components/InputError'
@@ -15,16 +15,12 @@ export default function Login({ status }: { status?: string }) {
15
15
  remember: false,
16
16
  })
17
17
 
18
- useEffect(() => {
19
- return () => {
20
- reset('password')
21
- }
22
- }, [])
23
-
24
18
  const submit: FormEventHandler = (e) => {
25
19
  e.preventDefault()
26
20
 
27
- post(login_path())
21
+ post(login_path(), {
22
+ onFinish: () => reset('password'),
23
+ })
28
24
  }
29
25
 
30
26
  return (
@@ -1,4 +1,4 @@
1
- import { useEffect, FormEventHandler } from 'react'
1
+ import { FormEventHandler } from 'react'
2
2
  import GuestLayout from '@/Layouts/GuestLayout'
3
3
  import InputError from '@/Components/InputError'
4
4
  import InputLabel from '@/Components/InputLabel'
@@ -15,16 +15,12 @@ export default function Register() {
15
15
  password_confirmation: '',
16
16
  })
17
17
 
18
- useEffect(() => {
19
- return () => {
20
- reset('password', 'password_confirmation')
21
- }
22
- }, [])
23
-
24
18
  const submit: FormEventHandler = (e) => {
25
19
  e.preventDefault()
26
20
 
27
- post(register_path())
21
+ post(register_path(), {
22
+ onFinish: () => reset('password', 'password_confirmation'),
23
+ })
28
24
  }
29
25
 
30
26
  return (
@@ -1,4 +1,4 @@
1
- import { useEffect, FormEventHandler } from 'react'
1
+ import { FormEventHandler } from 'react'
2
2
  import GuestLayout from '@/Layouts/GuestLayout'
3
3
  import InputError from '@/Components/InputError'
4
4
  import InputLabel from '@/Components/InputLabel'
@@ -14,16 +14,12 @@ export default function ResetPassword({ token }: { token: string }) {
14
14
  password_confirmation: '',
15
15
  })
16
16
 
17
- useEffect(() => {
18
- return () => {
19
- reset('password', 'password_confirmation')
20
- }
21
- }, [])
22
-
23
17
  const submit: FormEventHandler = (e) => {
24
18
  e.preventDefault()
25
19
 
26
- post(password_store_path())
20
+ post(password_store_path(), {
21
+ onFinish: () => reset('password', 'password_confirmation'),
22
+ })
27
23
  }
28
24
 
29
25
  return (
@@ -1,11 +1,9 @@
1
1
  import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout'
2
2
  import { Head } from '@inertiajs/react'
3
- import { PageProps } from '@/types'
4
3
 
5
- export default function Dashboard({ auth }: PageProps) {
4
+ export default function Dashboard() {
6
5
  return (
7
6
  <AuthenticatedLayout
8
- user={auth.user}
9
7
  header={<h2 className="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Dashboard</h2>}
10
8
  >
11
9
  <Head title="Dashboard" />
@@ -6,13 +6,11 @@ import { Head } from '@inertiajs/react'
6
6
  import { PageProps } from '@/types'
7
7
 
8
8
  export default function Edit({
9
- auth,
10
9
  mustVerifyEmail,
11
10
  status,
12
11
  }: PageProps<{ mustVerifyEmail: boolean; status?: string }>) {
13
12
  return (
14
13
  <AuthenticatedLayout
15
- user={auth.user}
16
14
  header={<h2 className="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Profile</h2>}
17
15
  >
18
16
  <Head title="Profile" />
@@ -19,6 +19,7 @@ export default function DeleteUserForm({ className = '' }: { className?: string
19
19
  processing,
20
20
  reset,
21
21
  errors,
22
+ clearErrors,
22
23
  } = useForm({
23
24
  password: '',
24
25
  })
@@ -41,6 +42,7 @@ export default function DeleteUserForm({ className = '' }: { className?: string
41
42
  const closeModal = () => {
42
43
  setConfirmingUserDeletion(false)
43
44
 
45
+ clearErrors()
44
46
  reset()
45
47
  }
46
48
 
@@ -5,7 +5,6 @@ import TextInput from '@/Components/TextInput'
5
5
  import { Link, useForm, usePage } from '@inertiajs/react'
6
6
  import { Transition } from '@headlessui/react'
7
7
  import { FormEventHandler } from 'react'
8
- import { PageProps } from '@/types'
9
8
  import { profile_update_path, verification_send_path } from '@/routes'
10
9
 
11
10
  export default function UpdateProfileInformation({
@@ -17,7 +16,7 @@ export default function UpdateProfileInformation({
17
16
  status?: string
18
17
  className?: string
19
18
  }) {
20
- const user = usePage<PageProps>().props.auth.user
19
+ const user = usePage().props.auth.user
21
20
 
22
21
  const { data, setData, patch, errors, processing, recentlySuccessful } = useForm({
23
22
  name: user.name,
@@ -1,12 +1,13 @@
1
1
  import { dashboard_path, login_path, register_path } from '@/routes'
2
2
  import { PageProps } from '@/types'
3
- import { Head, Link } from '@inertiajs/react'
3
+ import { Head, Link, usePage } from '@inertiajs/react'
4
4
 
5
5
  export default function Welcome({
6
- auth,
7
6
  railsVersion,
8
7
  rubyVersion,
9
8
  }: PageProps<{ railsVersion: string; rubyVersion: string }>) {
9
+ const user = usePage().props.auth.user
10
+
10
11
  return (
11
12
  <>
12
13
  <Head title="Welcome" />
@@ -21,7 +22,7 @@ export default function Welcome({
21
22
  >
22
23
  <header className="absolute top-0 right-0 grid grid-cols-2 items-center gap-2 py-10 lg:grid-cols-3">
23
24
  <div className="-mx-3 flex flex-1 justify-end">
24
- {auth.user ? (
25
+ {user ? (
25
26
  <Link
26
27
  href={dashboard_path()}
27
28
  className="rounded-md px-3 py-2 text-black ring-1 ring-transparent transition hover:text-black/70 focus:outline-none focus-visible:ring-[#FF2D20] dark:text-white dark:hover:text-white/80 dark:focus-visible:ring-white"
@@ -1,7 +1,13 @@
1
+ import { PageProps as InertiaPageProps } from '@inertiajs/core';
1
2
  import { AxiosInstance } from 'axios'
3
+ import { PageProps as AppPageProps } from './';
2
4
 
3
5
  declare global {
4
6
  interface Window {
5
7
  axios: AxiosInstance
6
8
  }
7
9
  }
10
+
11
+ declare module '@inertiajs/core' {
12
+ interface PageProps extends InertiaPageProps, AppPageProps {}
13
+ }
@@ -2,7 +2,7 @@ export interface User {
2
2
  id: number
3
3
  name: string
4
4
  email: string
5
- email_verified_at: string
5
+ email_verified_at?: string
6
6
  }
7
7
 
8
8
  export type PageProps<T extends Record<string, unknown> = Record<string, unknown>> = T & {
@@ -36,6 +36,7 @@ const deleteUser = () => {
36
36
  const closeModal = () => {
37
37
  confirmingUserDeletion.value = false
38
38
 
39
+ form.clearErrors()
39
40
  form.reset()
40
41
  }
41
42
  </script>
@@ -2,7 +2,7 @@ export interface User {
2
2
  id: number
3
3
  name: string
4
4
  email: string
5
- email_verified_at: string
5
+ email_verified_at?: string
6
6
  }
7
7
 
8
8
  export type PageProps<T extends Record<string, unknown> = Record<string, unknown>> = T & {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaze
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cuong Giang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2024-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
272
  - !ruby/object:Gem::Version
273
273
  version: '0'
274
274
  requirements: []
275
- rubygems_version: 3.5.14
275
+ rubygems_version: 3.5.11
276
276
  signing_key:
277
277
  specification_version: 4
278
278
  summary: Opinionated minimal Rails authentication scaffolding with Hotwire, React,