Installed Laravel
This commit is contained in:
25
resources/js/components/ui/pin-input/PinInput.vue
Normal file
25
resources/js/components/ui/pin-input/PinInput.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts" generic="Type extends 'text' | 'number' = 'text'">
|
||||
import type { PinInputRootEmits, PinInputRootProps } from "reka-ui"
|
||||
import type { HTMLAttributes } from "vue"
|
||||
import { reactiveOmit } from "@vueuse/core"
|
||||
import { PinInputRoot, useForwardPropsEmits } from "reka-ui"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const props = withDefaults(defineProps<PinInputRootProps<Type> & { class?: HTMLAttributes["class"] }>(), {
|
||||
modelValue: () => [],
|
||||
})
|
||||
const emits = defineEmits<PinInputRootEmits<Type>>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, "class")
|
||||
|
||||
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PinInputRoot
|
||||
data-slot="pin-input"
|
||||
v-bind="forwarded" :class="cn('flex items-center gap-2 has-disabled:opacity-50 disabled:cursor-not-allowed', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</PinInputRoot>
|
||||
</template>
|
||||
21
resources/js/components/ui/pin-input/PinInputGroup.vue
Normal file
21
resources/js/components/ui/pin-input/PinInputGroup.vue
Normal file
@@ -0,0 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import type { PrimitiveProps } from "reka-ui"
|
||||
import type { HTMLAttributes } from "vue"
|
||||
import { reactiveOmit } from "@vueuse/core"
|
||||
import { Primitive, useForwardProps } from "reka-ui"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const props = defineProps<PrimitiveProps & { class?: HTMLAttributes["class"] }>()
|
||||
const delegatedProps = reactiveOmit(props, "class")
|
||||
const forwardedProps = useForwardProps(delegatedProps)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Primitive
|
||||
data-slot="pin-input-group"
|
||||
v-bind="forwardedProps"
|
||||
:class="cn('flex items-center', props.class)"
|
||||
>
|
||||
<slot />
|
||||
</Primitive>
|
||||
</template>
|
||||
19
resources/js/components/ui/pin-input/PinInputSeparator.vue
Normal file
19
resources/js/components/ui/pin-input/PinInputSeparator.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
import type { PrimitiveProps } from "reka-ui"
|
||||
import { Minus } from "lucide-vue-next"
|
||||
import { Primitive, useForwardProps } from "reka-ui"
|
||||
|
||||
const props = defineProps<PrimitiveProps>()
|
||||
const forwardedProps = useForwardProps(props)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Primitive
|
||||
data-slot="pin-input-separator"
|
||||
v-bind="forwardedProps"
|
||||
>
|
||||
<slot>
|
||||
<Minus />
|
||||
</slot>
|
||||
</Primitive>
|
||||
</template>
|
||||
21
resources/js/components/ui/pin-input/PinInputSlot.vue
Normal file
21
resources/js/components/ui/pin-input/PinInputSlot.vue
Normal file
@@ -0,0 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import type { PinInputInputProps } from "reka-ui"
|
||||
import type { HTMLAttributes } from "vue"
|
||||
import { reactiveOmit } from "@vueuse/core"
|
||||
import { PinInputInput, useForwardProps } from "reka-ui"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const props = defineProps<PinInputInputProps & { class?: HTMLAttributes["class"] }>()
|
||||
|
||||
const delegatedProps = reactiveOmit(props, "class")
|
||||
|
||||
const forwardedProps = useForwardProps(delegatedProps)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PinInputInput
|
||||
data-slot="pin-input-slot"
|
||||
v-bind="forwardedProps"
|
||||
:class="cn('border-input focus:border-ring focus:ring-ring/50 focus:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:focus:aria-invalid:ring-destructive/40 aria-invalid:border-destructive focus:aria-invalid:border-destructive relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none text-center first:rounded-l-md first:border-l last:rounded-r-md focus:z-10 focus:ring-[3px]', props.class)"
|
||||
/>
|
||||
</template>
|
||||
4
resources/js/components/ui/pin-input/index.ts
Normal file
4
resources/js/components/ui/pin-input/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export { default as PinInput } from "./PinInput.vue"
|
||||
export { default as PinInputGroup } from "./PinInputGroup.vue"
|
||||
export { default as PinInputSeparator } from "./PinInputSeparator.vue"
|
||||
export { default as PinInputSlot } from "./PinInputSlot.vue"
|
||||
Reference in New Issue
Block a user