kaze 0.15.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: a44c66f7525581cd33d1fab5a820c60eea40817aa3c312ee06933c60fed20fb4
4
- data.tar.gz: 0fd2a38cc0d061c040dcf3159f4128565bc108e8d027b24b6cede84d7fde810d
3
+ metadata.gz: 70692c92f436ae83178d631efa5e3b076b205af9fb38865643da09778b3dc5bd
4
+ data.tar.gz: 79e38f700d7725df90445290a1299f3a42c7eb09e44ccf225474cb359f268952
5
5
  SHA512:
6
- metadata.gz: 72ade6f9944a454c4f4b618ad03fac989cea4b0860242195dd386f04333761ff3d8e520777ea05e22ca7e96c50792c4d8757f24150545d3efec0be417e02605f
7
- data.tar.gz: 36bf2356230cba133ef344012dee99a8729c41474c43392498e148e333f6b21229d5e26635201dc05ef68a34577f418fb10aa955ad23a731fac89a9e1915999a
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.15.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,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.15.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-18 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,