Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(formkit): integration module #4435

Merged
merged 45 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
713a92c
raw
m0ksem Nov 13, 2024
308fd5e
chore: add more formkit types
m0ksem Nov 25, 2024
2fcc99c
minor
asvae Nov 25, 2024
8296709
feat(docs): set up the FormKit Integration page
raichev-dima Nov 27, 2024
ec47fe9
feat: visual tweaks
asvae Dec 2, 2024
04c7885
feat(FormKit): work on Button component
raichev-dima Dec 5, 2024
21cf5b4
feat(FormKit): work on Text component
raichev-dima Dec 5, 2024
43d8d2a
feat(FormKit): work on Color component
raichev-dima Dec 6, 2024
3aa60d7
feat: move examples to storybook
raichev-dima Dec 9, 2024
1864255
feat: remove vuestic wrapper and use compositions instead
raichev-dima Dec 12, 2024
c5946fc
feat: create VaFormKitWrapper to pass slots to Vuestic components
raichev-dima Dec 12, 2024
a0a5b9e
feat: create ColorPicker component
raichev-dima Dec 12, 2024
f74da47
feat: implement other input types
raichev-dima Dec 12, 2024
ff97591
feat: implement Date type
raichev-dima Dec 13, 2024
4a6372e
feat: implement Colorpicker type
raichev-dima Dec 17, 2024
d94d36b
feat: implement Datepicker type
raichev-dima Dec 17, 2024
9563b12
feat: implement Textarea and Dropdown type
raichev-dima Dec 17, 2024
d7edefa
feat: implement File type
raichev-dima Dec 17, 2024
92e6005
feat: implement DatetimeLocal type
raichev-dima Dec 18, 2024
edb3b26
feat: implement Month/Week type
raichev-dima Dec 18, 2024
22265a3
feat: implement Radio type
raichev-dima Dec 18, 2024
fa28866
feat: implement Range type
raichev-dima Dec 18, 2024
bc795d3
feat: implement Slider type
raichev-dima Dec 18, 2024
d863f20
feat: implement Rating type
raichev-dima Dec 18, 2024
cb154da
feat: implement Toggle type
raichev-dima Dec 18, 2024
592bc29
feat: implement ToggleButtons type
raichev-dima Dec 18, 2024
f83d64b
feat: implement Number type
raichev-dima Dec 18, 2024
d7d753d
fix: use proper Messages section
raichev-dima Dec 26, 2024
f3c1820
style: minor
raichev-dima Dec 26, 2024
a6cea59
fix: use `validationVisible` to map to the `dirty` state
raichev-dima Dec 26, 2024
82ebf45
feat: prepare package.json for beta release
raichev-dima Dec 26, 2024
d263946
fix(docs): remove redundant examples
raichev-dima Dec 26, 2024
bcb97d7
refactor: move storybook to the formkit package
raichev-dima Dec 27, 2024
543efd1
feat(storybook): add vuestic inputs in the plugin
raichev-dima Dec 30, 2024
222b853
feat(storybook): add MultiStep form to storybook
raichev-dima Dec 31, 2024
6fe8861
feat(storybook): add Time Picker, remove redundant inputs
raichev-dima Jan 3, 2025
5201b31
feat(docs): configure the formkit to use vuestic inputs
raichev-dima Jan 6, 2025
4fc584d
feat(docs): add the Advanced Form
raichev-dima Jan 6, 2025
6433bd8
fix(docs): work on the Advanced Form bugs
raichev-dima Jan 8, 2025
be96497
fix(inputs): correct error state for Radio and Slider
raichev-dima Jan 9, 2025
6a04ae1
fix(docs): comment out Timepicker field
raichev-dima Jan 9, 2025
4bc48f1
feat(docs): update AdvanedForm description
raichev-dima Jan 9, 2025
69569c8
minor
asvae Jan 21, 2025
7401c9b
minor
asvae Jan 22, 2025
f870e29
minor
asvae Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/docs/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ export default defineNuxtConfig({
nitro: {
// compressPublicAssets: true,
},

gtm: {
id: process.env.GTM_ID, // Your GTM single container ID, array of container ids ['GTM-xxxxxx', 'GTM-yyyyyy'] or array of objects [{id: 'GTM-xxxxxx', queryParams: { gtm_auth: 'abc123', gtm_preview: 'env-4', gtm_cookies_win: 'x'}}, {id: 'GTM-yyyyyy', queryParams: {gtm_auth: 'abc234', gtm_preview: 'env-5', gtm_cookies_win: 'x'}}], // Your GTM single container ID or array of container ids ['GTM-xxxxxx', 'GTM-yyyyyy']
enabled: process.env.GTM_ENABLED === 'true', // defaults to true. Plugin can be disabled by setting this to false for Ex: enabled: !!GDPR_Cookie (optional)
},

modules: [
'@formkit/nuxt',
'./modules/repl',
'./modules/banner',
'./modules/vuestic',
Expand Down Expand Up @@ -139,7 +141,6 @@ export default defineNuxtConfig({
},
},


css: [
'@/assets/css/tailwind.css',
],
Expand Down Expand Up @@ -183,6 +184,12 @@ export default defineNuxtConfig({
}
},

formkit: {
autoImport: true,
},

compatibilityDate: '2024-11-29',

devtools: {
enabled: false,
}
Expand Down
2 changes: 2 additions & 0 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
},
"dependencies": {
"@docsearch/js": "^3.2.1",
"@formkit/nuxt": "^1.6.9",
"@formkit/vue": "^1.6.9",
"@funken-studio/sitemap-nuxt-3": "^4.0.4",
"@nuxtjs/google-fonts": "^3.0.1",
"@types/acorn": "^6.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<template>
<h1 class="text-2xl font-bold mb-4">
Carbon Sequestration Grant
</h1>

<FormKit
v-slot="{ state: { loading } }"
v-model="formValue"
:type="types.form"
class="grid grid-cols-1 md:grid-cols-3 gap-6"
:submit-label="loading ? 'Submitting...' : ''"
@submit="submitApp"
>
<div>
<FormKit
:type="types.email"
name="email"
label="*Email address"
validation="required|email"
/>
</div>

<div>
<FormKit
:type="types.text"
name="organization_name"
label="*Organization name"
validation="required|length:3"
/>
</div>

<div>
<FormKit
:type="types.textarea"
name="money_use"
label="*How will you use the money?"
validation="required|length:5,10"
/>
</div>
</FormKit>

<VaCollapse
class="min-w-96 mt-4"
header="Form data"
>
<pre>{{ formValue }}</pre>
</VaCollapse>
</template>

<script setup>
import * as types from '@vuestic/formkit'

// NEW: submit handler, which posts to our fake backend.
const submitApp = async (_formData, node) => {
await new Promise(resolve => setTimeout(resolve, 1400))
node.clearErrors()
alert('Your application was submitted successfully!')
}

const formValue = ref({})
</script>

<style scoped>
details {
border: 1px solid #ccccd7;;
background: #eeeef4;
border-radius: .15em;
padding: 1em;
}
</style>
46 changes: 46 additions & 0 deletions packages/docs/page-config/extensions/formkit/examples/Button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script setup lang="ts">
import * as types from '@vuestic/formkit'

type HTMLElementEvent<T = HTMLElement> = Event & {
target: T;
}

const randomColor = (e: HTMLElementEvent) => {
const hex = Math
.floor(Math.random()*16777215)
.toString(16);

e.target!.setAttribute(
'style',
'background-color: #' + hex + '88;'
)
}
</script>

<template>
<div class="grid gap-6">
<FormKit
:type="types.button"
color="danger"
label="Checkout my label"
help="You can use the label prop."
/>

<FormKit
:type="types.button"
help="You can use the default slot."
prefix-icon="check"
>
I have slot content
</FormKit>

<FormKit
:type="types.button"
help="You can bind event listeners."
@click="randomColor"
>
Click me!
</FormKit>
</div>
</template>

15 changes: 15 additions & 0 deletions packages/docs/page-config/extensions/formkit/examples/Checkbox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<FormKit
:type="types.checkbox"
label="Terms and Conditions"
help="Do you agree to our terms of service?"
name="terms"
:value="true"
validation="accepted"
validation-visibility="dirty"
/>
</template>

<script setup lang="ts">
import * as types from '@vuestic/formkit'
</script>
Loading
Loading