Added auth functionality, initial work with views and field types
This commit is contained in:
14
frontend/components/ui/input-group/InputGroup.vue
Normal file
14
frontend/components/ui/input-group/InputGroup.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="cn('relative flex w-full flex-col gap-2', props.class)">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
22
frontend/components/ui/input-group/InputGroupAddon.vue
Normal file
22
frontend/components/ui/input-group/InputGroupAddon.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
align?: 'start' | 'end' | 'center' | 'block-end'
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
|
||||
const alignClasses = {
|
||||
start: 'justify-start',
|
||||
end: 'justify-end',
|
||||
center: 'justify-center',
|
||||
'block-end': 'justify-end items-end',
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="cn('flex flex-wrap items-center gap-2', alignClasses[props.align || 'start'], props.class)">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
28
frontend/components/ui/input-group/InputGroupButton.vue
Normal file
28
frontend/components/ui/input-group/InputGroupButton.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import type { ButtonVariants } from '../button'
|
||||
import { Button } from '../button'
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
|
||||
interface Props {
|
||||
variant?: ButtonVariants['variant']
|
||||
size?: ButtonVariants['size']
|
||||
class?: HTMLAttributes['class']
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
variant: 'default',
|
||||
size: 'default',
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Button
|
||||
:variant="props.variant"
|
||||
:size="props.size"
|
||||
:class="props.class"
|
||||
:disabled="props.disabled"
|
||||
>
|
||||
<slot />
|
||||
</Button>
|
||||
</template>
|
||||
14
frontend/components/ui/input-group/InputGroupText.vue
Normal file
14
frontend/components/ui/input-group/InputGroupText.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span :class="cn('text-sm text-muted-foreground', props.class)">
|
||||
<slot />
|
||||
</span>
|
||||
</template>
|
||||
22
frontend/components/ui/input-group/InputGroupTextarea.vue
Normal file
22
frontend/components/ui/input-group/InputGroupTextarea.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
placeholder?: string
|
||||
class?: HTMLAttributes['class']
|
||||
}>()
|
||||
|
||||
const model = defineModel<string>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<textarea
|
||||
v-model="model"
|
||||
:placeholder="props.placeholder"
|
||||
:class="cn(
|
||||
'flex min-h-[80px] w-full rounded-lg border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none',
|
||||
props.class
|
||||
)"
|
||||
/>
|
||||
</template>
|
||||
5
frontend/components/ui/input-group/index.ts
Normal file
5
frontend/components/ui/input-group/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export { default as InputGroup } from './InputGroup.vue'
|
||||
export { default as InputGroupTextarea } from './InputGroupTextarea.vue'
|
||||
export { default as InputGroupAddon } from './InputGroupAddon.vue'
|
||||
export { default as InputGroupButton } from './InputGroupButton.vue'
|
||||
export { default as InputGroupText } from './InputGroupText.vue'
|
||||
Reference in New Issue
Block a user