diff --git a/lib/app-setup/root.tsx b/lib/app-setup/root.tsx index 55824610f..f959a4f38 100644 --- a/lib/app-setup/root.tsx +++ b/lib/app-setup/root.tsx @@ -15,7 +15,6 @@ import { ReactNode, useEffect } from 'react'; import skeletonCSS from 'react-loading-skeleton/dist/skeleton.css'; import styleReactPulsable from 'react-pulsable/index.css'; import reactToast from 'react-toastify/dist/ReactToastify.css'; -import styleZenerSelect from '@oshq/react-select/index.css'; import rcss from 'react-highlightjs-logs/dist/index.css'; import Container from '~/components/atoms/container'; import ProgressContainer, { @@ -42,7 +41,6 @@ export const links: LinksFunction = () => [ { rel: 'stylesheet', href: skeletonCSS }, { rel: 'stylesheet', href: rcSlide }, { rel: 'stylesheet', href: styleReactPulsable }, - { rel: 'stylesheet', href: styleZenerSelect }, { rel: 'stylesheet', href: rcss }, { rel: 'stylesheet', diff --git a/package.json b/package.json index 2f6cb2ad0..247b0e0d2 100644 --- a/package.json +++ b/package.json @@ -1,143 +1,143 @@ { - "name": "kloudlite.github.io", - "private": true, - "version": "0.0.0", - "homepage": "https://kloudlite.github.io", - "type": "module", - "scripts": { - "postinstall": "cd src/generated && pnpm i", - "fake": "esbuild fake-data-generator/gen.ts --format=cjs --outfile=public/dist/fake-data-generator.cjs --platform=node && node public/dist/fake-data-generator.cjs", - "dev": "remix dev", - "serve": "remix-serve ./public/${APP}/server", - "watch": "nodemon --watch lib --watch src/${APP} --exec \"pnpm typecheck\"", - "start": "sh scripts/run.sh", - "build:ts": "pnpm fake && pnpm typecheck && remix build", - "build": "remix build", - "dbuild": "docker build --build-arg APP=${APP} . -t ghcr.io/kloudlite/web/${APP}:${IMAGE_TAG}", - "dpush": "docker push ghcr.io/kloudlite/web/${APP}:${IMAGE_TAG}", - "typecheck:watch": "tsc -w --p tsconfig-compile.json", - "typecheck": "tsc --p tsconfig-compile.json", - "typecheck:withtsgen": "pnpm tsgen && pnpm typecheck", - "gql:parse": "esbuild gql-queries-generator/index.ts --bundle --format=cjs --outfile=public/dist/gql-generator.cjs --platform=node && node public/dist/gql-generator.cjs", - "tsgen": "pnpm gql:parse && cd src/generated && pnpm tsgen", - "tsc": "tsc /Users/piyush/workspace/kloudlite/web/src/apps/iot-console/utils/commons.tsx" - }, - "dependencies": { - "@jengaicons/react": "1.6.0", - "@mdx-js/react": "^2.3.0", - "@monaco-editor/react": "^4.6.0", - "@oshq/react-select": "^1.4.4", - "@radix-ui/primitive": "^1.0.1", - "@radix-ui/react-alert-dialog": "1.0.4", - "@radix-ui/react-checkbox": "^1.0.4", - "@radix-ui/react-collection": "^1.0.3", - "@radix-ui/react-compose-refs": "^1.0.1", - "@radix-ui/react-context": "^1.0.1", - "@radix-ui/react-dialog": "1.0.4", - "@radix-ui/react-direction": "1.0.1", - "@radix-ui/react-dismissable-layer": "^1.0.5", - "@radix-ui/react-dropdown-menu": "^2.0.6", - "@radix-ui/react-focus-guards": "^1.0.1", - "@radix-ui/react-focus-scope": "^1.0.4", - "@radix-ui/react-id": "^1.0.1", - "@radix-ui/react-menu": "2.0.5", - "@radix-ui/react-navigation-menu": "^1.1.4", - "@radix-ui/react-popover": "1.0.6", - "@radix-ui/react-popper": "^1.1.3", - "@radix-ui/react-portal": "^1.0.4", - "@radix-ui/react-presence": "^1.0.1", - "@radix-ui/react-primitive": "^1.0.3", - "@radix-ui/react-radio-group": "1.1.3", - "@radix-ui/react-roving-focus": "^1.0.4", - "@radix-ui/react-select": "^2.0.0", - "@radix-ui/react-separator": "^1.0.3", - "@radix-ui/react-slot": "^1.0.2", - "@radix-ui/react-switch": "^1.0.3", - "@radix-ui/react-toast": "^1.1.5", - "@radix-ui/react-toggle-group": "^1.0.4", - "@radix-ui/react-tooltip": "^1.0.7", - "@radix-ui/react-use-callback-ref": "^1.0.1", - "@radix-ui/react-use-controllable-state": "^1.0.1", - "@react-aria/focus": "^3.16.0", - "@react-aria/gridlist": "^3.7.3", - "@react-types/shared": "^3.22.0", - "@remix-run/node": "^1.19.3", - "@remix-run/react": "^1.19.3", - "anser": "^2.1.1", - "apexcharts": "^3.45.2", - "aria-hidden": "^1.2.3", - "axios": "^1.6.3", - "classnames": "^2.5.1", - "cookie": "^0.5.0", - "dayjs": "^1.11.10", - "framer-motion": "^11.0.23", - "fuse.js": "^6.6.2", - "graphql": "^16.8.1", - "graphql-tag": "^2.12.6", - "highlight.js": "^11.9.0", - "isbot": "^3.8.0", - "js-cookie": "^3.0.5", - "js-yaml": "^4.1.0", - "pino": "^8.17.2", - "rc-slider": "^10.5.0", - "react": "18.2.0", - "react-diff-viewer-continued": "^3.4.0", - "react-dom": "^18.2.0", - "react-google-recaptcha-v3": "^1.10.1", - "react-highlightjs-logs": "^1.1.0", - "react-hook-form": "^7.49.2", - "react-loading-skeleton": "^3.3.1", - "react-pulsable": "^1.0.17", - "react-qr-code": "^2.0.12", - "react-remove-scroll": "^2.5.7", - "react-router-dom": "^6.21.1", - "react-toastify": "^9.1.3", - "react-tooltip": "^5.27.0", - "react-viewport-list": "^7.1.2", - "reconnecting-websocket": "^4.4.0", - "remix": "^1.19.3", - "search-in-json": "^1.0.67", - "swr": "^2.2.4", - "use-immer": "^0.9.0", - "uuid": "^9.0.1", - "yup": "^1.3.3" - }, - "devDependencies": { - "@babel/core": "^7.23.7", - "@babel/preset-env": "^7.23.7", - "@faker-js/faker": "^8.3.1", - "@remix-run/dev": "^1.19.3", - "@remix-run/serve": "^1.19.3", - "@types/cookie": "^0.5.4", - "@types/js-cookie": "^3.0.6", - "@types/js-yaml": "^4.0.9", - "@types/react": "^18.2.46", - "@types/react-dom": "^18.2.18", - "@types/react-ranger": "^2.0.4", - "@types/uuid": "^9.0.7", - "@typescript-eslint/eslint-plugin": "^6.17.0", - "@typescript-eslint/parser": "^6.17.0", - "autoprefixer": "^10.4.16", - "esbuild": "^0.19.11", - "eslint": "^8.56.0", - "eslint-config-airbnb": "19.0.4", - "eslint-config-prettier": "^8.10.0", - "eslint-import-resolver-jsconfig": "^1.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jsx-a11y": "^6.8.0", - "eslint-plugin-prefer-arrow-functions": "^3.2.4", - "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-hooks": "^4.6.0", - "faker": "^5.5.3", - "json-schema-faker": "^0.5.4", - "nodemon": "^2.0.22", - "prettier": "^2.8.8", - "remix-flat-routes": "^0.6.4", - "tailwindcss": "^3.4.0", - "typescript": "^5.3.3", - "typescript-json-schema": "^0.62.0" - } + "name": "kloudlite.github.io", + "private": true, + "version": "0.0.0", + "homepage": "https://kloudlite.github.io", + "type": "module", + "scripts": { + "postinstall": "cd src/generated && pnpm i", + "fake": "esbuild fake-data-generator/gen.ts --format=cjs --outfile=public/dist/fake-data-generator.cjs --platform=node && node public/dist/fake-data-generator.cjs", + "dev": "remix dev", + "serve": "remix-serve ./public/${APP}/server", + "watch": "nodemon --watch lib --watch src/${APP} --exec \"pnpm typecheck\"", + "start": "sh scripts/run.sh", + "build:ts": "pnpm fake && pnpm typecheck && remix build", + "build": "remix build", + "dbuild": "docker build --build-arg APP=${APP} . -t ghcr.io/kloudlite/web/${APP}:${IMAGE_TAG}", + "dpush": "docker push ghcr.io/kloudlite/web/${APP}:${IMAGE_TAG}", + "typecheck:watch": "tsc -w --p tsconfig-compile.json", + "typecheck": "tsc --p tsconfig-compile.json", + "typecheck:withtsgen": "pnpm tsgen && pnpm typecheck", + "gql:parse": "esbuild gql-queries-generator/index.ts --bundle --format=cjs --outfile=public/dist/gql-generator.cjs --platform=node && node public/dist/gql-generator.cjs", + "tsgen": "pnpm gql:parse && cd src/generated && pnpm tsgen", + "tsc": "tsc /Users/piyush/workspace/kloudlite/web/src/apps/iot-console/utils/commons.tsx" + }, + "dependencies": { + "@jengaicons/react": "1.6.0", + "@mdx-js/react": "^2.3.0", + "@monaco-editor/react": "^4.6.0", + "@oshq/react-select": "^1.4.6", + "@radix-ui/primitive": "^1.0.1", + "@radix-ui/react-alert-dialog": "1.0.4", + "@radix-ui/react-checkbox": "^1.0.4", + "@radix-ui/react-collection": "^1.0.3", + "@radix-ui/react-compose-refs": "^1.0.1", + "@radix-ui/react-context": "^1.0.1", + "@radix-ui/react-dialog": "1.0.4", + "@radix-ui/react-direction": "1.0.1", + "@radix-ui/react-dismissable-layer": "^1.0.5", + "@radix-ui/react-dropdown-menu": "^2.0.6", + "@radix-ui/react-focus-guards": "^1.0.1", + "@radix-ui/react-focus-scope": "^1.0.4", + "@radix-ui/react-id": "^1.0.1", + "@radix-ui/react-menu": "2.0.5", + "@radix-ui/react-navigation-menu": "^1.1.4", + "@radix-ui/react-popover": "1.0.6", + "@radix-ui/react-popper": "^1.1.3", + "@radix-ui/react-portal": "^1.0.4", + "@radix-ui/react-presence": "^1.0.1", + "@radix-ui/react-primitive": "^1.0.3", + "@radix-ui/react-radio-group": "1.1.3", + "@radix-ui/react-roving-focus": "^1.0.4", + "@radix-ui/react-select": "^2.0.0", + "@radix-ui/react-separator": "^1.0.3", + "@radix-ui/react-slot": "^1.0.2", + "@radix-ui/react-switch": "^1.0.3", + "@radix-ui/react-toast": "^1.1.5", + "@radix-ui/react-toggle-group": "^1.0.4", + "@radix-ui/react-tooltip": "^1.0.7", + "@radix-ui/react-use-callback-ref": "^1.0.1", + "@radix-ui/react-use-controllable-state": "^1.0.1", + "@react-aria/focus": "^3.16.0", + "@react-aria/gridlist": "^3.7.3", + "@react-types/shared": "^3.22.0", + "@remix-run/node": "^1.19.3", + "@remix-run/react": "^1.19.3", + "anser": "^2.1.1", + "apexcharts": "^3.45.2", + "aria-hidden": "^1.2.3", + "axios": "^1.6.3", + "classnames": "^2.5.1", + "cookie": "^0.5.0", + "dayjs": "^1.11.10", + "framer-motion": "^11.0.23", + "fuse.js": "^6.6.2", + "graphql": "^16.8.1", + "graphql-tag": "^2.12.6", + "highlight.js": "^11.9.0", + "isbot": "^3.8.0", + "js-cookie": "^3.0.5", + "js-yaml": "^4.1.0", + "pino": "^8.17.2", + "rc-slider": "^10.5.0", + "react": "18.2.0", + "react-diff-viewer-continued": "^3.4.0", + "react-dom": "^18.2.0", + "react-google-recaptcha-v3": "^1.10.1", + "react-highlightjs-logs": "^1.1.0", + "react-hook-form": "^7.49.2", + "react-loading-skeleton": "^3.3.1", + "react-pulsable": "^1.0.17", + "react-qr-code": "^2.0.12", + "react-remove-scroll": "^2.5.7", + "react-router-dom": "^6.21.1", + "react-toastify": "^9.1.3", + "react-tooltip": "^5.27.0", + "react-viewport-list": "^7.1.2", + "reconnecting-websocket": "^4.4.0", + "remix": "^1.19.3", + "search-in-json": "^1.0.67", + "swr": "^2.2.4", + "use-immer": "^0.9.0", + "uuid": "^9.0.1", + "yup": "^1.3.3" + }, + "devDependencies": { + "@babel/core": "^7.23.7", + "@babel/preset-env": "^7.23.7", + "@faker-js/faker": "^8.3.1", + "@remix-run/dev": "^1.19.3", + "@remix-run/serve": "^1.19.3", + "@types/cookie": "^0.5.4", + "@types/js-cookie": "^3.0.6", + "@types/js-yaml": "^4.0.9", + "@types/react": "^18.2.46", + "@types/react-dom": "^18.2.18", + "@types/react-ranger": "^2.0.4", + "@types/uuid": "^9.0.7", + "@typescript-eslint/eslint-plugin": "^6.17.0", + "@typescript-eslint/parser": "^6.17.0", + "autoprefixer": "^10.4.16", + "esbuild": "^0.19.11", + "eslint": "^8.56.0", + "eslint-config-airbnb": "19.0.4", + "eslint-config-prettier": "^8.10.0", + "eslint-import-resolver-jsconfig": "^1.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsx-a11y": "^6.8.0", + "eslint-plugin-prefer-arrow-functions": "^3.2.4", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.6.0", + "faker": "^5.5.3", + "json-schema-faker": "^0.5.4", + "nodemon": "^2.0.22", + "prettier": "^2.8.8", + "remix-flat-routes": "^0.6.4", + "tailwindcss": "^3.4.0", + "typescript": "^5.3.3", + "typescript-json-schema": "^0.62.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 19ab52d3e..fd3d30c30 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ dependencies: specifier: ^4.6.0 version: 4.6.0(monaco-editor@0.49.0)(react-dom@18.3.1)(react@18.2.0) '@oshq/react-select': - specifier: ^1.4.4 - version: 1.4.4(@radix-ui/react-portal@1.0.4)(classnames@2.5.1)(framer-motion@11.2.9)(rc-virtual-list@3.14.2)(react@18.2.0) + specifier: ^1.4.6 + version: 1.4.6(@radix-ui/react-portal@1.0.4)(classnames@2.5.1)(framer-motion@11.2.9)(rc-virtual-list@3.14.2)(react@18.2.0) '@radix-ui/primitive': specifier: ^1.0.1 version: 1.0.1 @@ -2557,8 +2557,8 @@ packages: json-parse-even-better-errors: 2.3.1 dev: true - /@oshq/react-select@1.4.4(@radix-ui/react-portal@1.0.4)(classnames@2.5.1)(framer-motion@11.2.9)(rc-virtual-list@3.14.2)(react@18.2.0): - resolution: {integrity: sha512-jfMSnookesY0ge/q1amjpj16cmG09MU6YAjfHlpJ3GDxB5vjo/60I+cv9pWzTUcKNlZd1tuRZd9zKjggALz3IA==} + /@oshq/react-select@1.4.6(@radix-ui/react-portal@1.0.4)(classnames@2.5.1)(framer-motion@11.2.9)(rc-virtual-list@3.14.2)(react@18.2.0): + resolution: {integrity: sha512-3hB9XHPeyr4HNOVp9YriCd2GduChrEUkc17aa6cAi9sNn62eNHPdRlVRS+1CUibc31H2Gu5z2CqGaeFAovJzCQ==} peerDependencies: '@radix-ui/react-portal': ^1.0.4 classnames: ^2.3.2 diff --git a/src/apps/devdoc/.npmrc b/src/apps/devdoc/.npmrc new file mode 100644 index 000000000..6c59086d8 --- /dev/null +++ b/src/apps/devdoc/.npmrc @@ -0,0 +1 @@ +enable-pre-post-scripts=true diff --git a/src/apps/devdoc/app/components/footer.tsx b/src/apps/devdoc/app/components/footer.tsx index d2502bcc2..fec99081f 100644 --- a/src/apps/devdoc/app/components/footer.tsx +++ b/src/apps/devdoc/app/components/footer.tsx @@ -20,6 +20,7 @@ const FooterLink = ({ to, children }: { to: string; children: ReactNode }) => { interface IFooterMenu { className?: string; + title?: ReactNode; items: { title: string; to: string; @@ -36,28 +37,44 @@ const FooterMobile = ({ brand, extra, menu }: IFooterItem) => {
-
- {menu[0].items.map((item) => ( - - {item.title} - - ))} +
+
+ {menu[0].title} +
+
+ {menu[0].items.map((item) => ( + + {item.title} + + ))} +
+
+
+
+ {menu[1].title} +
+
+ {menu[1].items.map((item) => ( + + {item.title} + + ))} +
+
+
+ +
+
+ {menu[2].title}
-
- {menu[1].items.map((item) => ( +
+ {menu[2].items.map((item) => ( {item.title} ))}
-
- {menu[2].items.map((item) => ( - - {item.title} - - ))} -
@@ -78,13 +95,18 @@ const FooterMd = ({ brand, extra, menu }: IFooterItem) => { return (
- {menu.items.map((item) => ( - - {item.title} - - ))} +
+ {menu.title} +
+
+ {menu.items.map((item) => ( + + {item.title} + + ))} +
); })} @@ -104,27 +126,37 @@ const FooterLg = ({ brand, extra, menu }: IFooterItem) => {
{brand}
-
+
{menu.slice(0, 2).map((m, index) => { const i = index; return ( -
- {m.items.map((item) => ( - - {item.title} - - ))} +
+
+ {m.title} +
+
+ {m.items.map((item) => ( + + {item.title} + + ))} +
); })}
-
-
- {menu[2].items.map((item) => ( - - {item.title} - - ))} +
+
+
+ {menu[2].title} +
+
+ {menu[2].items.map((item) => ( + + {item.title} + + ))} +
@@ -146,13 +178,18 @@ const FooterXlAndUp = ({ brand, extra, menu }: IFooterItem) => { return (
- {m.items.map((item) => ( - - {item.title} - - ))} +
+ {m.title} +
+
+ {m.items.map((item) => ( + + {item.title} + + ))} +
); })} diff --git a/src/apps/devdoc/app/components/page/contact-us.tsx b/src/apps/devdoc/app/components/page/contact-us.tsx index fa2b6e2df..0648dbe78 100644 --- a/src/apps/devdoc/app/components/page/contact-us.tsx +++ b/src/apps/devdoc/app/components/page/contact-us.tsx @@ -1,14 +1,22 @@ import { TextInput, TextArea } from 'kl-design-system/atoms/input'; +import Select from 'kl-design-system/atoms/select'; import Link from 'next/link'; -import { ComponentProps, useState } from 'react'; +import { ComponentProps, useEffect, useRef, useState } from 'react'; import { addDoc, collection, getFirestore } from '@firebase/firestore'; import { FirebaseApp } from 'firebase/app'; -import { useForm } from 'react-hook-form'; +import { Controller, useForm } from 'react-hook-form'; import { useFirebase } from '~/app/utils/useFirebase'; import { supportEmail } from '~/app/utils/config'; -import { toast } from 'kl-design-system/molecule/toast'; import Wrapper from '../wrapper'; import Button from '../button'; +import countries from '~/app/utils/countries.json'; +import { GraphItem } from '../graph'; +import { CollapseItem, autoSize } from '~/app/utils/commons'; +import consts from '~/app/utils/const'; +import OptionList from 'kl-design-system/atoms/option-list'; +import * as Accordion from '@radix-ui/react-accordion'; +import { getCookie, setCookie } from 'cookies-next'; +import { Block } from '../commons'; const SupportIcon = (props: ComponentProps<'svg'>) => { const { height, width } = props; @@ -85,14 +93,12 @@ const addContact = async ( } const firestore = getFirestore(app); const col = collection(firestore, 'web-contact-form'); - const contactData = { ...data, createdAt: new Date(), }; await addDoc(col, contactData); - toast.info('Request for demo has been sent successfully.'); }; type Inputs = { @@ -104,159 +110,327 @@ type Inputs = { companyName: string; }; +const getContries = (mode?: 'code' | 'normal') => { + return (countries || []).map((c) => ({ + label: c.name, + value: c.name, + render: () => ( +
+ {c.emoji} + {mode === 'code' && {c.dial_code}} + {c.name} +
+ ), + country: c, + })); +}; + +const valueRender = (value: any) => ( +
+ {value.country.emoji} + {value.label} +
+); + +const valueRenderCountryCode = (value: any) => ( +
+ {value?.country?.dial_code} +
+); + +const valueRenderFaq = (value: any) => ( +
+ {value?.item?.icon ? : null} + {value.label} +
+); + +type IItem = keyof typeof consts.helpandsupport.kloudliteOverviewFaqs; + +const FAQSection = () => { + const [selected, setSelected] = useState('general'); + + const ref = useRef(null); + + const items = Object.entries(consts.helpandsupport.kloudliteOverviewFaqs); + + useEffect(() => { + if (ref.current?.parentElement) + autoSize(ref.current?.parentElement, 'animationend'); + }, [ref.current]); + return ( + +
+ + { + onChange(val.label); + }} + options={async () => getContries()} + valueRender={valueRender} + error={!!errors.country} + message={errors.country?.message} + /> + )} + /> +
+
+ +