kaze 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70692c92f436ae83178d631efa5e3b076b205af9fb38865643da09778b3dc5bd
4
- data.tar.gz: 79e38f700d7725df90445290a1299f3a42c7eb09e44ccf225474cb359f268952
3
+ metadata.gz: deab98e2901b74f1056b04a39e951332f3a3347238c62e8e1b0920549bbe1a9c
4
+ data.tar.gz: b3a619c385c93bffe717de05af412bf49f839172c5c6a057d5c7004a43df2445
5
5
  SHA512:
6
- metadata.gz: 9c9070cd7055e4a06f18193ad13f715fef0cf6e002eb60e7424ee7cd2fe2696155d30918d7b686aa1a5f40229d727c9a1ad374a521cd8c3ad074d6d1f82ac6c7
7
- data.tar.gz: d23b59dc85ce9d0b974b2e15d2bdd7a2b92892e671c68af00b3d7ca695376985f6a06e8cbd10fdce2ed1acb4bf42e5223d82fb42cd9d558f7f59e9bd4406f4eb
6
+ metadata.gz: d0a65dc77ee49890cccf9936a00f0c7e4c4486fe9452723af63e893272c674f0de187321b20ebca67aac3177c93bf40352108365846d573f78b0b6f215ba9d92
7
+ data.tar.gz: 4c7ca90584170c7cbc09f1028851484bdbb5e42e7a9abd314eb99a4fe435583624631057ad47ff183e92bcb4e7c558325477335226ee35bc9c36b0ad40348519
data/lib/kaze/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kaze
2
- VERSION = '0.16.0'
2
+ VERSION = '0.17.0'
3
3
  end
@@ -6,10 +6,7 @@ import ResponsiveNavLink from '@/Components/ResponsiveNavLink'
6
6
  import { Link, usePage } from '@inertiajs/react'
7
7
  import { dashboard_path, logout_path, profile_edit_path } from '@/routes'
8
8
 
9
- export default function AuthenticatedLayout({
10
- header,
11
- children,
12
- }: PropsWithChildren<{ header?: ReactNode }>) {
9
+ export default function AuthenticatedLayout({ header, children }: PropsWithChildren<{ header?: ReactNode }>) {
13
10
  const user = usePage().props.auth.user
14
11
 
15
12
  const [showingNavigationDropdown, setShowingNavigationDropdown] = useState(false)
@@ -5,10 +5,7 @@ import UpdateProfileInformationForm from './Partials/UpdateProfileInformationFor
5
5
  import { Head } from '@inertiajs/react'
6
6
  import { PageProps } from '@/types'
7
7
 
8
- export default function Edit({
9
- mustVerifyEmail,
10
- status,
11
- }: PageProps<{ mustVerifyEmail: boolean; status?: string }>) {
8
+ export default function Edit({ mustVerifyEmail, status }: PageProps<{ mustVerifyEmail: boolean; status?: string }>) {
12
9
  return (
13
10
  <AuthenticatedLayout
14
11
  header={<h2 className="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Profile</h2>}
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { computed, onMounted, onUnmounted, watch } from 'vue'
2
+ import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
3
3
 
4
4
  const props = withDefaults(
5
5
  defineProps<{
@@ -15,14 +15,24 @@ const props = withDefaults(
15
15
  )
16
16
 
17
17
  const emit = defineEmits(['close'])
18
+ const dialog = ref()
19
+ const showSlot = ref(props.show)
18
20
 
19
21
  watch(
20
22
  () => props.show,
21
23
  () => {
22
24
  if (props.show) {
23
25
  document.body.style.overflow = 'hidden'
26
+ showSlot.value = true
27
+
28
+ dialog.value?.showModal()
24
29
  } else {
25
- document.body.style.overflow = 'visible'
30
+ document.body.style.overflow = ''
31
+
32
+ setTimeout(() => {
33
+ dialog.value?.close()
34
+ showSlot.value = false
35
+ }, 200)
26
36
  }
27
37
  },
28
38
  )
@@ -34,8 +44,12 @@ const close = () => {
34
44
  }
35
45
 
36
46
  const closeOnEscape = (e: KeyboardEvent) => {
37
- if (e.key === 'Escape' && props.show) {
38
- close()
47
+ if (e.key === 'Escape') {
48
+ e.preventDefault()
49
+
50
+ if (props.show) {
51
+ close()
52
+ }
39
53
  }
40
54
  }
41
55
 
@@ -43,7 +57,8 @@ onMounted(() => document.addEventListener('keydown', closeOnEscape))
43
57
 
44
58
  onUnmounted(() => {
45
59
  document.removeEventListener('keydown', closeOnEscape)
46
- document.body.style.overflow = 'visible'
60
+
61
+ document.body.style.overflow = ''
47
62
  })
48
63
 
49
64
  const maxWidthClass = computed(() => {
@@ -58,39 +73,37 @@ const maxWidthClass = computed(() => {
58
73
  </script>
59
74
 
60
75
  <template>
61
- <Teleport to="body">
62
- <Transition leave-active-class="duration-200">
63
- <div v-show="show" class="fixed inset-0 overflow-y-auto px-4 py-6 sm:px-0 z-50" scroll-region>
64
- <Transition
65
- enter-active-class="ease-out duration-300"
66
- enter-from-class="opacity-0"
67
- enter-to-class="opacity-100"
68
- leave-active-class="ease-in duration-200"
69
- leave-from-class="opacity-100"
70
- leave-to-class="opacity-0"
71
- >
72
- <div v-show="show" class="fixed inset-0 transform transition-all" @click="close">
73
- <div class="absolute inset-0 bg-gray-500 dark:bg-gray-900 opacity-75" />
74
- </div>
75
- </Transition>
76
+ <dialog class="z-50 m-0 min-h-full min-w-full overflow-y-auto bg-transparent backdrop:bg-transparent" ref="dialog">
77
+ <div class="fixed inset-0 z-50 overflow-y-auto px-4 py-6 sm:px-0" scroll-region>
78
+ <Transition
79
+ enter-active-class="ease-out duration-300"
80
+ enter-from-class="opacity-0"
81
+ enter-to-class="opacity-100"
82
+ leave-active-class="ease-in duration-200"
83
+ leave-from-class="opacity-100"
84
+ leave-to-class="opacity-0"
85
+ >
86
+ <div v-show="show" class="fixed inset-0 transform transition-all" @click="close">
87
+ <div class="absolute inset-0 bg-gray-500 opacity-75 dark:bg-gray-900" />
88
+ </div>
89
+ </Transition>
76
90
 
77
- <Transition
78
- enter-active-class="ease-out duration-300"
79
- enter-from-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
80
- enter-to-class="opacity-100 translate-y-0 sm:scale-100"
81
- leave-active-class="ease-in duration-200"
82
- leave-from-class="opacity-100 translate-y-0 sm:scale-100"
83
- leave-to-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
91
+ <Transition
92
+ enter-active-class="ease-out duration-300"
93
+ enter-from-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
94
+ enter-to-class="opacity-100 translate-y-0 sm:scale-100"
95
+ leave-active-class="ease-in duration-200"
96
+ leave-from-class="opacity-100 translate-y-0 sm:scale-100"
97
+ leave-to-class="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
98
+ >
99
+ <div
100
+ v-show="show"
101
+ class="mb-6 transform overflow-hidden rounded-lg bg-white shadow-xl transition-all sm:mx-auto sm:w-full dark:bg-gray-800"
102
+ :class="maxWidthClass"
84
103
  >
85
- <div
86
- v-show="show"
87
- class="mb-6 bg-white dark:bg-gray-800 rounded-lg overflow-hidden shadow-xl transform transition-all sm:w-full sm:mx-auto"
88
- :class="maxWidthClass"
89
- >
90
- <slot v-if="show" />
91
- </div>
92
- </Transition>
93
- </div>
94
- </Transition>
95
- </Teleport>
104
+ <slot v-if="showSlot" />
105
+ </div>
106
+ </Transition>
107
+ </div>
108
+ </dialog>
96
109
  </template>
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.16.0
4
+ version: 0.17.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-10-16 00:00:00.000000000 Z
11
+ date: 2024-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor