forked from jd-solanki/anu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2361093
commit 6cf77ae
Showing
32 changed files
with
545 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<script lang="ts" setup> | ||
</script> | ||
|
||
<template> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<script lang="ts" setup> | ||
import { toFormValidator } from '@vee-validate/zod' | ||
import { useField, useForm } from 'vee-validate' | ||
import * as zod from 'zod' | ||
const validationSchema = toFormValidator( | ||
zod.object({ | ||
email: zod.string({ required_error: 'Email is required' }).min(1).email({ message: 'Must be a valid email' }), | ||
password: zod.string({ required_error: 'Password is required' }).min(1).min(8, { message: 'Password is too short' }), | ||
}), | ||
) | ||
const { handleSubmit, errors } = useForm({ | ||
validationSchema, | ||
}) | ||
/* | ||
setting `validateOnValueUpdate: false` won't trigger validation on value change | ||
Docs: https://vee-validate.logaretm.com/v4/guide/composition-api/validation/#validation-behavior | ||
*/ | ||
const { value: email } = useField<string>('email', undefined, { | ||
validateOnValueUpdate: false, | ||
}) | ||
const { value: password } = useField<string>('password', undefined, { | ||
validateOnValueUpdate: false, | ||
}) | ||
const onSubmit = handleSubmit((values, { resetForm }) => { | ||
alert(JSON.stringify(values, null, 2)) | ||
resetForm() | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="cards-demo-container"> | ||
<ACard> | ||
<div class="a-card-body py-18"> | ||
<form | ||
class="grid-row mx-auto max-w-1/2 grid-flow-rows justify-items-stretch content-center" | ||
@submit="onSubmit" | ||
> | ||
<ATypography | ||
:title="['Hello Again!', 'text-2xl']" | ||
subtitle="Welcome back, You've been missed" | ||
class="mb-4" | ||
/> | ||
<AInput | ||
v-model="email" | ||
name="email" | ||
type="email" | ||
label="Email" | ||
:error="errors.email" | ||
/> | ||
<AInput | ||
v-model="password" | ||
name="password" | ||
type="password" | ||
label="Password" | ||
:error="errors.password" | ||
/> | ||
<ABtn>Submit</ABtn> | ||
</form> | ||
</div> | ||
</ACard> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as ABaseInput } from './ABaseInput.vue' | ||
export * from './props' | ||
export * from './slots' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const baseInputSlots = { | ||
'label': {}, | ||
'prepend': {}, | ||
'prepend-inner': {}, | ||
'append-inner': {}, | ||
'append': {}, | ||
'bottom': {}, | ||
'default': { | ||
id: String() as string | undefined, | ||
readonly: Boolean(), | ||
disabled: Boolean(), | ||
class: Object as any, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as ACard } from './ACard.vue' | ||
export * from './props' | ||
export * from './slots' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { typographySlots } from '@/components/typography/slots' | ||
import { removeKeys } from '@/utils/helpers' | ||
|
||
// TODO: Fix type | ||
|
||
export const cardOwnSlots = { | ||
default: {}, | ||
} as const | ||
export const cardTypographySlots = removeKeys(typographySlots, ['default']) | ||
|
||
export const cardSlots = { | ||
...cardOwnSlots, | ||
...cardTypographySlots, | ||
} as const |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { ListItemProps } from './props' | ||
|
||
export const listItemSlots = { | ||
default: { | ||
item: Object as unknown as ListItemProps, | ||
attrs: Object, | ||
}, | ||
prepend: { | ||
item: Object as unknown as ListItemProps, | ||
attrs: Object as unknown, | ||
}, | ||
item: { | ||
item: Object as unknown as ListItemProps, | ||
attrs: Object as unknown, | ||
}, | ||
append: { | ||
item: Object as unknown as ListItemProps, | ||
attrs: Object as unknown, | ||
}, | ||
} as const |
Oops, something went wrong.