Skip to content

Commit 0f93b6f

Browse files
authored
Merge pull request #3 from leamsigc/feature/form-transition
Add the missing "@morev/vue-transitions"
2 parents e29e432 + bfe9f55 commit 0f93b6f

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

src/comps.ts

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ export default [
22
{
33
name: "Accordion",
44
value: "accordion",
5-
instructions: ["Remember to add the accordion animations to your tailwind.config.js"],
5+
instructions: [
6+
"Remember to add the accordion animations to your tailwind.config.js",
7+
],
68
files: [
79
{
810
fileName: "Accordion/Accordion.vue",
@@ -349,7 +351,9 @@ export default [
349351
value: "calendar",
350352
devDeps: ["@samk-dev/nuxt-vcalendar"],
351353
nuxtModules: ["@samk-dev/nuxt-vcalendar"],
352-
instructions: ["You can customize the calendar by adding options to your nuxt.config.js file"],
354+
instructions: [
355+
"You can customize the calendar by adding options to your nuxt.config.js file",
356+
],
353357
files: [
354358
{
355359
fileName: "Calendar.vue",
@@ -1040,8 +1044,8 @@ export default [
10401044
{
10411045
name: "Form",
10421046
value: "form",
1043-
deps: ["@vee-validate/nuxt"],
1044-
nuxtModules: ["@vee-validate/nuxt"],
1047+
deps: ["@vee-validate/nuxt", "@morev/vue-transitions"],
1048+
nuxtModules: ["@vee-validate/nuxt", "@morev/vue-transitions/nuxt"],
10451049
composables: [
10461050
{
10471051
fileName: "useFormField.ts",
@@ -2230,7 +2234,9 @@ export default [
22302234
'import type { ToastProps } from "@/components/Ui/Toast/Toast.vue";\n\nconst TOAST_LIMIT = 3;\nconst TOAST_REMOVE_DELAY = 7000;\n\nexport type StringOrVNode = string | VNode | (() => VNode);\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: string;\n description?: StringOrVNode;\n action?: Component;\n icon?: string;\n};\n\nconst actionTypes = {\n ADD_TOAST: "ADD_TOAST",\n UPDATE_TOAST: "UPDATE_TOAST",\n DISMISS_TOAST: "DISMISS_TOAST",\n REMOVE_TOAST: "REMOVE_TOAST",\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_VALUE;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType["ADD_TOAST"];\n toast: ToasterToast;\n }\n | {\n type: ActionType["UPDATE_TOAST"];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType["DISMISS_TOAST"];\n toastId?: ToasterToast["id"];\n }\n | {\n type: ActionType["REMOVE_TOAST"];\n toastId?: ToasterToast["id"];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nfunction addToRemoveQueue(toastId: string) {\n if (toastTimeouts.has(toastId)) return;\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: actionTypes.REMOVE_TOAST,\n toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n}\n\nconst state = ref<State>({\n toasts: [],\n});\n\nfunction dispatch(action: Action) {\n switch (action.type) {\n case actionTypes.ADD_TOAST:\n state.value.toasts = [action.toast, ...state.value.toasts].slice(0, TOAST_LIMIT);\n break;\n\n case actionTypes.UPDATE_TOAST:\n state.value.toasts = state.value.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n );\n break;\n\n case actionTypes.DISMISS_TOAST: {\n const { toastId } = action;\n\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.value.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n state.value.toasts = state.value.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n );\n break;\n }\n\n case actionTypes.REMOVE_TOAST:\n if (action.toastId === undefined) state.value.toasts = [];\n else state.value.toasts = state.value.toasts.filter((t) => t.id !== action.toastId);\n\n break;\n }\n}\n\nfunction useToast() {\n return {\n toasts: computed(() => state.value.toasts),\n toast,\n dismiss: (toastId?: string) => dispatch({ type: actionTypes.DISMISS_TOAST, toastId }),\n };\n}\n\ntype Toast = Omit<ToasterToast, "id">;\n\nfunction toast(props: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: actionTypes.UPDATE_TOAST,\n toast: { ...props, id },\n });\n\n const dismiss = () => dispatch({ type: actionTypes.DISMISS_TOAST, toastId: id });\n\n dispatch({\n type: actionTypes.ADD_TOAST,\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open: boolean) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id,\n dismiss,\n update,\n };\n}\n\nexport { toast, useToast };\n',
22312235
},
22322236
],
2233-
instructions: ["Remeber to add <UiToastToaster /> to your app.vue/layout file."],
2237+
instructions: [
2238+
"Remeber to add <UiToastToaster /> to your app.vue/layout file.",
2239+
],
22342240
files: [
22352241
{
22362242
fileName: "Toast/Action.vue",
@@ -2406,7 +2412,11 @@ export default [
24062412
{
24072413
name: "VeeDateField",
24082414
value: "vee-date-field",
2409-
deps: ["@vee-validate/nuxt", "@morev/vue-transitions", "@internationalized/date"],
2415+
deps: [
2416+
"@vee-validate/nuxt",
2417+
"@morev/vue-transitions",
2418+
"@internationalized/date",
2419+
],
24102420
askValidator: true,
24112421
nuxtModules: ["@vee-validate/nuxt", "@morev/vue-transitions/nuxt"],
24122422
components: ["date-field", "label"],
@@ -2482,7 +2492,11 @@ export default [
24822492
{
24832493
name: "VeeMultiSelect",
24842494
value: "vee-multi-select",
2485-
deps: ["@vee-validate/nuxt", "@morev/vue-transitions", "@vueform/multiselect"],
2495+
deps: [
2496+
"@vee-validate/nuxt",
2497+
"@morev/vue-transitions",
2498+
"@vueform/multiselect",
2499+
],
24862500
askValidator: true,
24872501
nuxtModules: ["@vee-validate/nuxt", "@morev/vue-transitions/nuxt"],
24882502
components: ["label"],
@@ -2501,7 +2515,11 @@ export default [
25012515
{
25022516
name: "VeeNumberField",
25032517
value: "vee-number-field",
2504-
deps: ["@vee-validate/nuxt", "@morev/vue-transitions", "@internationalized/number"],
2518+
deps: [
2519+
"@vee-validate/nuxt",
2520+
"@morev/vue-transitions",
2521+
"@internationalized/number",
2522+
],
25052523
askValidator: true,
25062524
nuxtModules: ["@vee-validate/nuxt", "@morev/vue-transitions/nuxt"],
25072525
components: ["label", "number-field"],
@@ -2616,7 +2634,9 @@ export default [
26162634
name: "Vue Sonner",
26172635
value: "vue-sonner",
26182636
deps: ["vue-sonner"],
2619-
instructions: ["Remember to add the <UiVueSonner /> tag to your app.vue/layout file."],
2637+
instructions: [
2638+
"Remember to add the <UiVueSonner /> tag to your app.vue/layout file.",
2639+
],
26202640
files: [
26212641
{
26222642
fileName: "VueSonner.client.vue",

0 commit comments

Comments
 (0)