diff --git a/.eslintrc.js b/.eslintrc.js
index 934a04b..b7954f1 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -17,6 +17,17 @@ module.exports = {
ecmaVersion: "latest",
sourceType: "module",
},
- plugins: ["react", "@typescript-eslint"],
- rules: {},
+ plugins: ["react", "@typescript-eslint", "sort-keys-fix"],
+ rules: {
+ "react/jsx-sort-props": 1,
+ "sort-keys-fix/sort-keys-fix": "warn",
+ "sort-keys": [
+ "error",
+ "asc",
+ {
+ caseSensitive: true,
+ natural: true,
+ },
+ ],
+ },
};
diff --git a/package.json b/package.json
index 1c110c9..c1d9a58 100644
--- a/package.json
+++ b/package.json
@@ -119,6 +119,7 @@
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-security": "^1.5.0",
+ "eslint-plugin-sort-keys-fix": "^1.1.2",
"husky": "^8.0.1",
"jsdom": "^20.0.0",
"mini-css-extract-plugin": "^2.6.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index cf9c389..0466b7b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -30,6 +30,7 @@ specifiers:
eslint-plugin-promise: ^6.0.0
eslint-plugin-react: ^7.30.0
eslint-plugin-security: ^1.5.0
+ eslint-plugin-sort-keys-fix: ^1.1.2
husky: ^8.0.1
jsdom: ^20.0.0
mini-css-extract-plugin: ^2.6.1
@@ -89,6 +90,7 @@ devDependencies:
eslint-plugin-promise: 6.0.0_eslint@8.18.0
eslint-plugin-react: 7.30.0_eslint@8.18.0
eslint-plugin-security: 1.5.0
+ eslint-plugin-sort-keys-fix: 1.1.2
husky: 8.0.1
jsdom: 20.0.0
mini-css-extract-plugin: 2.6.1_webpack@5.73.0
@@ -2338,6 +2340,14 @@ packages:
acorn: 8.7.1
dev: true
+ /acorn-jsx/5.3.2_acorn@7.4.1:
+ resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
+ peerDependencies:
+ acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
+ dependencies:
+ acorn: 7.4.1
+ dev: true
+
/acorn-jsx/5.3.2_acorn@8.7.1:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies:
@@ -4444,6 +4454,16 @@ packages:
safe-regex: 2.1.1
dev: true
+ /eslint-plugin-sort-keys-fix/1.1.2:
+ resolution: {integrity: sha512-DNPHFGCA0/hZIsfODbeLZqaGY/+q3vgtshF85r+YWDNCQ2apd9PNs/zL6ttKm0nD1IFwvxyg3YOTI7FHl4unrw==}
+ engines: {node: '>=0.10.0'}
+ dependencies:
+ espree: 6.2.1
+ esutils: 2.0.3
+ natural-compare: 1.4.0
+ requireindex: 1.2.0
+ dev: true
+
/eslint-scope/5.1.1:
resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
engines: {node: '>=8.0.0'}
@@ -4536,6 +4556,15 @@ packages:
- supports-color
dev: true
+ /espree/6.2.1:
+ resolution: {integrity: sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==}
+ engines: {node: '>=6.0.0'}
+ dependencies:
+ acorn: 7.4.1
+ acorn-jsx: 5.3.2_acorn@7.4.1
+ eslint-visitor-keys: 1.3.0
+ dev: true
+
/espree/9.3.2:
resolution: {integrity: sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -8046,6 +8075,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
+ /requireindex/1.2.0:
+ resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==}
+ engines: {node: '>=0.10.5'}
+ dev: true
+
/resolve-cwd/3.0.0:
resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==}
engines: {node: '>=8'}
diff --git a/src/App.tsx b/src/App.tsx
index 16472b5..1e40022 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,50 +1,27 @@
import "./App.css";
import { Wizard } from "./components/wizard";
-import { Box, Dollar, Twitter, User } from "./example-assets";
function App() {
return (
,
- ,
- ,
- ,
- ]}
bodyHeight={750}
highlightFieldsOnValidation
- validationDelay={100}
+ noPageTitle
strict={false}
- // RTL
onFinish={(val) => console.log(val)}
pages={[
{
- title: "Introduction",
fields: [
{
+ isRequired: true,
label: "First Name",
name: "firstName",
- type: "text",
- isRequired: true,
placeholder: "Enter your first name",
+ type: "text",
validationMessage: "You cannot leave this field empty",
},
{
@@ -53,26 +30,26 @@ function App() {
type: "text",
},
{
+ label: "Date of Birth",
name: "dateOfBirth",
type: "date",
- label: "Date of Birth",
},
{
+ isRequired: true,
label: "Email",
name: "email",
type: "email",
- isRequired: true,
validationMessage: "Incorrect email id. example: xxxx@yyy.com",
},
{
- name: "Phone number",
label: "Phone",
+ name: "Phone number",
type: "phone",
},
],
+ title: "Introduction",
},
{
- title: "Employment",
fields: [
{
label: "Company Name",
@@ -90,42 +67,42 @@ function App() {
type: "textarea",
},
{
+ isRequired: true,
label: "Are you currently working?",
name: "employed",
- type: "radio",
- isRequired: true,
options: [
{ name: "yes", value: true },
{ name: "no", value: false },
],
+ type: "radio",
},
{
+ isRequired: true,
label: "Choose your skills",
name: "skills",
- type: "checkbox",
- isRequired: true,
options: [
{ name: "HTML", value: "html" },
{ name: "CSS", value: "css" },
{ name: "JavaScript", value: "javascript" },
{ name: "React", value: "react" },
],
+ type: "checkbox",
},
],
+ title: "Employment",
},
{
- title: "CV & Social Links",
fields: [
{
- name: "CV",
label: "Upload your CV",
+ name: "CV",
type: "file",
},
{
+ isRequired: true,
label: "Portfolio URL",
name: "Portfolio",
type: "url",
- isRequired: true,
},
{
label: "Linkedin URL",
@@ -138,25 +115,25 @@ function App() {
type: "url",
},
{
- name: "twitter",
label: "Twitter URL",
+ name: "twitter",
type: "url",
},
],
+ title: "CV & Social Links",
},
{
- title: "salary",
fields: [
{
+ isRequired: true,
label: "Select your current salary range",
name: "salaryRange",
- type: "select",
- isRequired: true,
-
options: [
{ name: "10,000$ - 50,000$", value: "10-50k" },
{ name: "50,000$ - 100,000$", value: "50-100k" },
],
+
+ type: "select",
},
{
label: "Expected Salary",
@@ -164,8 +141,35 @@ function App() {
type: "text",
},
],
+ title: "salary",
},
]}
+ // noPageTitle
+ // icons={[
+ // ,
+ // ,
+ // ,
+ // ,
+ // ]}
+ showStepperTitles
+ silent
+ // silent
+ // strict={false}
+ // RTL
+ theme={{
+ background: "#000",
+ fail: "#cf352e",
+ formFieldBackground: "#282828",
+ formFieldBorder: "#000",
+ inputBackground: "#464646",
+ inputTextColor: "#fff",
+ primary: "#007fff",
+ success: "#519259",
+ tabColor: "#7d7d7d",
+ tabLineColor: "#464646",
+ textColor: "#fff",
+ }}
+ validationDelay={100}
/>
);
diff --git a/src/components/form-field/form-field-input.tsx b/src/components/form-field/form-field-input.tsx
index 6b29a8d..5e64093 100644
--- a/src/components/form-field/form-field-input.tsx
+++ b/src/components/form-field/form-field-input.tsx
@@ -1,7 +1,7 @@
import classNames from "classnames";
import { FunctionComponent, useContext, useMemo } from "react";
import Asterisk from "../../icons/asterisk";
-import { WizardContext } from "../wizard";
+import { WizardContext } from "../wizard-context";
import { FormChangeEvent, FormFieldProps } from "./form-field.model";
import styles from "./form-field.module.scss";
@@ -39,21 +39,21 @@ const FormFieldInput: FunctionComponent = ({
if (isTextField) {
return (
);
} else if (type === "select") {
return (