@stackshift-ui/form 1.0.0 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@stackshift-ui/form",
3
3
  "description": "",
4
- "version": "1.0.0",
4
+ "version": "6.0.3",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.mjs",
9
9
  "types": "./dist/index.d.ts",
10
10
  "files": [
11
- "dist/**"
11
+ "dist/**",
12
+ "src"
12
13
  ],
13
14
  "author": "WebriQ <info@webriq.com>",
14
15
  "devDependencies": {
@@ -28,13 +29,13 @@
28
29
  "typescript": "^5.6.2",
29
30
  "vite-tsconfig-paths": "^5.0.1",
30
31
  "vitest": "^2.1.1",
31
- "@stackshift-ui/eslint-config": "1.0.0",
32
- "@stackshift-ui/typescript-config": "2.0.0"
32
+ "@stackshift-ui/eslint-config": "6.0.2",
33
+ "@stackshift-ui/typescript-config": "6.0.2"
33
34
  },
34
35
  "dependencies": {
35
- "@stackshift-ui/scripts": "1.0.0",
36
- "@stackshift-ui/system": "2.0.0",
37
- "@stackshift-ui/webriq-form": "1.0.0"
36
+ "@stackshift-ui/system": "6.0.3",
37
+ "@stackshift-ui/scripts": "6.0.2",
38
+ "@stackshift-ui/webriq-form": "6.0.3"
38
39
  },
39
40
  "peerDependencies": {
40
41
  "@types/react": "16.8 - 19",
@@ -0,0 +1,13 @@
1
+ import { cleanup, render, screen } from "@testing-library/react";
2
+ import { afterEach, describe, test } from "vitest";
3
+ import { Form } from "./form";
4
+
5
+ describe.concurrent("form", () => {
6
+ afterEach(cleanup);
7
+
8
+ test("Common: Form - test if renders without errors", ({ expect }) => {
9
+ const clx = "form-class";
10
+ render(<Form className={clx} />);
11
+ expect(screen.getByTestId("stackshift-form").classList).toContain(clx);
12
+ });
13
+ });
package/src/form.tsx ADDED
@@ -0,0 +1,26 @@
1
+ import { WebriQForm } from "@stackshift-ui/webriq-form";
2
+ import React from "react";
3
+ import { LabeledRoute } from "./types";
4
+
5
+ export type FormProps = {
6
+ className?: string;
7
+ id?: string;
8
+ name?: string;
9
+ children?: React.ReactNode;
10
+ thankyouPage?: LabeledRoute;
11
+ };
12
+
13
+ export const Form = ({ id, name, thankyouPage, className, children }: FormProps) => {
14
+ return (
15
+ <WebriQForm
16
+ method="POST"
17
+ data-form-id={id}
18
+ data-testid="stackshift-form"
19
+ name={name ?? "Form"}
20
+ className={className}
21
+ data-thankyou-url={thankyouPage}
22
+ scriptsrc="https://pagebuilderforms.webriq.com/js/initReactForms">
23
+ {children}
24
+ </WebriQForm>
25
+ );
26
+ };
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ "use client";
2
+
3
+ // component exports
4
+ export * from "./form";
package/src/types.ts ADDED
@@ -0,0 +1,14 @@
1
+ export interface LabeledRoute extends ConditionalLink {
2
+ ariaLabel?: string;
3
+ label?: string;
4
+ linkTarget?: string;
5
+ linkType?: string;
6
+ _type?: string;
7
+ linkInternal?: any;
8
+ }
9
+
10
+ export interface ConditionalLink {
11
+ type?: string;
12
+ internalLink?: string | null;
13
+ externalLink?: string | null;
14
+ }