@akinon/projectzero 1.32.0 → 1.33.0
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/CHANGELOG.md +6 -0
- package/app-template/.editorconfig +7 -0
- package/app-template/.env.example +9 -0
- package/app-template/.eslintignore +1 -0
- package/app-template/.eslintrc.js +31 -0
- package/app-template/.gitattributes +18 -0
- package/app-template/.husky/pre-commit +4 -0
- package/app-template/.lintstagedrc.js +12 -0
- package/app-template/.prettierrc +13 -0
- package/app-template/.releaserc.json +49 -0
- package/app-template/.stylelintrc.json +37 -0
- package/app-template/.vscode/extensions.json +11 -0
- package/app-template/.vscode/launch.json +29 -0
- package/app-template/.yarnrc +1 -0
- package/app-template/CHANGELOG.md +636 -0
- package/app-template/LICENSE +21 -0
- package/app-template/Procfile +1 -0
- package/app-template/README.md +29 -0
- package/app-template/akinon.json +28 -0
- package/app-template/bitbucket-pipelines.yml +54 -0
- package/app-template/build.sh +7 -0
- package/app-template/docs/CHANGELOG.md +85 -0
- package/app-template/docs/advanced-usage.md +43 -0
- package/app-template/docs/basic-setup.md +59 -0
- package/app-template/docs/data-fetching/client/account.md +1064 -0
- package/app-template/docs/data-fetching/client/address.md +805 -0
- package/app-template/docs/data-fetching/client/basket.md +107 -0
- package/app-template/docs/data-fetching/client/checkout.md +904 -0
- package/app-template/docs/data-fetching/client/misc.md +135 -0
- package/app-template/docs/data-fetching/client/product.md +284 -0
- package/app-template/docs/data-fetching/client/user.md +56 -0
- package/app-template/docs/data-fetching/client/wishlist.md +111 -0
- package/app-template/docs/data-fetching/server/category.md +324 -0
- package/app-template/docs/data-fetching/server/flat-page.md +42 -0
- package/app-template/docs/data-fetching/server/list.md +353 -0
- package/app-template/docs/data-fetching/server/menu.md +363 -0
- package/app-template/docs/data-fetching/server/product.md +131 -0
- package/app-template/docs/data-fetching/server/seo.md +44 -0
- package/app-template/docs/data-fetching/server/special-page.md +79 -0
- package/app-template/docs/data-fetching/server/widget.md +218 -0
- package/app-template/docs/delete-account.md +25 -0
- package/app-template/docs/deployment.md +46 -0
- package/app-template/docs/dynamic-route.md +33 -0
- package/app-template/docs/icons.md +52 -0
- package/app-template/docs/localization.md +204 -0
- package/app-template/docs/logging.md +48 -0
- package/app-template/docs/plugins.md +76 -0
- package/app-template/docs/seo-management.md +125 -0
- package/app-template/docs/static-assets.md +36 -0
- package/app-template/docs/widgets.md +127 -0
- package/app-template/global.d.ts +1 -0
- package/app-template/jest.config.ts +34 -0
- package/app-template/next-env.d.ts +6 -0
- package/app-template/next.config.mjs +34 -0
- package/app-template/package.json +97 -0
- package/app-template/plugins.d.ts +1 -0
- package/app-template/postcss.config.js +6 -0
- package/app-template/public/404.png +0 -0
- package/app-template/public/500.png +0 -0
- package/app-template/public/apple-splash-1125-2436.jpg +0 -0
- package/app-template/public/apple-splash-1136-640.jpg +0 -0
- package/app-template/public/apple-splash-1170-2532.jpg +0 -0
- package/app-template/public/apple-splash-1242-2208.jpg +0 -0
- package/app-template/public/apple-splash-1242-2688.jpg +0 -0
- package/app-template/public/apple-splash-1284-2778.jpg +0 -0
- package/app-template/public/apple-splash-1334-750.jpg +0 -0
- package/app-template/public/apple-splash-1536-2048.jpg +0 -0
- package/app-template/public/apple-splash-1620-2160.jpg +0 -0
- package/app-template/public/apple-splash-1668-2224.jpg +0 -0
- package/app-template/public/apple-splash-1668-2388.jpg +0 -0
- package/app-template/public/apple-splash-1792-828.jpg +0 -0
- package/app-template/public/apple-splash-2048-1536.jpg +0 -0
- package/app-template/public/apple-splash-2048-2732.jpg +0 -0
- package/app-template/public/apple-splash-2160-1620.jpg +0 -0
- package/app-template/public/apple-splash-2208-1242.jpg +0 -0
- package/app-template/public/apple-splash-2224-1668.jpg +0 -0
- package/app-template/public/apple-splash-2388-1668.jpg +0 -0
- package/app-template/public/apple-splash-2436-1125.jpg +0 -0
- package/app-template/public/apple-splash-2532-1170.jpg +0 -0
- package/app-template/public/apple-splash-2688-1242.jpg +0 -0
- package/app-template/public/apple-splash-2732-2048.jpg +0 -0
- package/app-template/public/apple-splash-2778-1284.jpg +0 -0
- package/app-template/public/apple-splash-640-1136.jpg +0 -0
- package/app-template/public/apple-splash-750-1334.jpg +0 -0
- package/app-template/public/apple-splash-828-1792.jpg +0 -0
- package/app-template/public/apple-touch-icon-152x152.png +0 -0
- package/app-template/public/apple-touch-icon-167x167.png +0 -0
- package/app-template/public/apple-touch-icon-180x180.png +0 -0
- package/app-template/public/apple-touch-icon.png +0 -0
- package/app-template/public/apple.svg +47 -0
- package/app-template/public/cvv.jpg +0 -0
- package/app-template/public/facebook.svg +3 -0
- package/app-template/public/google.svg +12 -0
- package/app-template/public/icon-192x192.png +0 -0
- package/app-template/public/icon-256x256.png +0 -0
- package/app-template/public/icon-384x384.png +0 -0
- package/app-template/public/icon-512x512.png +0 -0
- package/app-template/public/icon-sprite.svg +528 -0
- package/app-template/public/locales/en/account.json +490 -0
- package/app-template/public/locales/en/auth.json +100 -0
- package/app-template/public/locales/en/basket.json +50 -0
- package/app-template/public/locales/en/category.json +26 -0
- package/app-template/public/locales/en/checkout.json +152 -0
- package/app-template/public/locales/en/common.json +65 -0
- package/app-template/public/locales/en/forgot_password.json +41 -0
- package/app-template/public/locales/en/form.json +5 -0
- package/app-template/public/locales/en/product.json +39 -0
- package/app-template/public/locales/tr/account.json +490 -0
- package/app-template/public/locales/tr/auth.json +100 -0
- package/app-template/public/locales/tr/basket.json +50 -0
- package/app-template/public/locales/tr/category.json +26 -0
- package/app-template/public/locales/tr/checkout.json +152 -0
- package/app-template/public/locales/tr/common.json +65 -0
- package/app-template/public/locales/tr/forgot_password.json +41 -0
- package/app-template/public/locales/tr/form.json +5 -0
- package/app-template/public/locales/tr/product.json +39 -0
- package/app-template/public/logo.svg +29 -0
- package/app-template/public/manifest.json +35 -0
- package/app-template/public/mastercard.png +0 -0
- package/app-template/public/mastersecure.png +0 -0
- package/app-template/public/mfs-client.min.js +3 -0
- package/app-template/public/noimage.jpg +0 -0
- package/app-template/public/safari-pinned-tab.svg +320 -0
- package/app-template/public/ssl-secure.png +0 -0
- package/app-template/public/vbv.png +0 -0
- package/app-template/public/visa.png +0 -0
- package/app-template/public/zepto.min.js +2 -0
- package/app-template/sentry.client.config.ts +16 -0
- package/app-template/sentry.edge.config.ts +3 -0
- package/app-template/sentry.properties +4 -0
- package/app-template/sentry.server.config.ts +3 -0
- package/app-template/setupTests.ts +4 -0
- package/app-template/src/__tests__/index.test.tsx +7 -0
- package/app-template/src/__tests__/tsconfig.json +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/address/page.tsx +74 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/change-email/page.tsx +174 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/change-password/page.tsx +206 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/contact/page.tsx +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/coupons/page.tsx +210 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/email-verification/page.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/faq/page.tsx +23 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/favourite-products/page.tsx +32 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/layout.tsx +28 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/my-quotations/page.tsx +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/cancellation/page.tsx +255 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/layout.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/page.tsx +309 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/page.tsx +137 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/page.tsx +226 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/profile/page.tsx +399 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/address/stores/page.tsx +271 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/anonymous-tracking/page.tsx +33 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/auth/oauth-login/page.tsx +3 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/auth/page.tsx +76 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket/page.tsx +77 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket-b2b/page.tsx +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/loading.tsx +53 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +16 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/client-root.tsx +9 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/contact-us/page.tsx +11 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/error.tsx +20 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/loading.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +18 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/forms/[pk]/generate/page.tsx +48 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/loading.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +72 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/loading.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/page.tsx +23 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/layout.tsx +78 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/list/loading.tsx +53 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/list/page.tsx +16 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/checkout/page.tsx +140 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/layout.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/page.tsx +284 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/page.tsx +50 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/loading.tsx +67 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +81 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/loading.tsx +53 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +25 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/template.tsx +75 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/email-set-primary/[[...id]]/page.tsx +43 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/password/reset/page.tsx +79 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/registration/account-confirm-email/[[...id]]/page.tsx +43 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/reset/[[...id]]/page.tsx +110 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/[node]/route.ts +25 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/route.ts +37 -0
- package/app-template/src/app/api/cache/route.ts +1 -0
- package/app-template/src/app/api/client/[...slug]/route.ts +1 -0
- package/app-template/src/app/api/form/[...id]/route.ts +7 -0
- package/app-template/src/app/api/logout/route.ts +1 -0
- package/app-template/src/app/api/sentry/route.ts +9 -0
- package/app-template/src/app/api/web-vitals/route.ts +1 -0
- package/app-template/src/app/favicon.ico +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/index.scss +269 -0
- package/app-template/src/assets/fonts/index.scss +1 -0
- package/app-template/src/assets/fonts/pz-icon.css +154 -0
- package/app-template/src/assets/fonts/pz-icon.eot +0 -0
- package/app-template/src/assets/fonts/pz-icon.html +456 -0
- package/app-template/src/assets/fonts/pz-icon.scss +300 -0
- package/app-template/src/assets/fonts/pz-icon.svg +144 -0
- package/app-template/src/assets/fonts/pz-icon.ttf +0 -0
- package/app-template/src/assets/fonts/pz-icon.woff +0 -0
- package/app-template/src/assets/fonts/pz-icon.woff2 +0 -0
- package/app-template/src/assets/globals.scss +65 -0
- package/app-template/src/assets/icons/akinon.svg +11 -0
- package/app-template/src/assets/icons/arrow-up.svg +11 -0
- package/app-template/src/assets/icons/bell.svg +1 -0
- package/app-template/src/assets/icons/cart.svg +13 -0
- package/app-template/src/assets/icons/check.svg +19 -0
- package/app-template/src/assets/icons/chevron-down.svg +8 -0
- package/app-template/src/assets/icons/chevron-end.svg +8 -0
- package/app-template/src/assets/icons/chevron-start.svg +8 -0
- package/app-template/src/assets/icons/chevron-up.svg +8 -0
- package/app-template/src/assets/icons/close.svg +12 -0
- package/app-template/src/assets/icons/cvc.svg +54 -0
- package/app-template/src/assets/icons/default.svg +6 -0
- package/app-template/src/assets/icons/directions.svg +14 -0
- package/app-template/src/assets/icons/eye-off.svg +10 -0
- package/app-template/src/assets/icons/eye-on.svg +17 -0
- package/app-template/src/assets/icons/facebook-login.svg +11 -0
- package/app-template/src/assets/icons/facebook.svg +9 -0
- package/app-template/src/assets/icons/giftbox.svg +22 -0
- package/app-template/src/assets/icons/globe.svg +12 -0
- package/app-template/src/assets/icons/google-login.svg +19 -0
- package/app-template/src/assets/icons/google.svg +9 -0
- package/app-template/src/assets/icons/hamburger.svg +5 -0
- package/app-template/src/assets/icons/heart-full.svg +20 -0
- package/app-template/src/assets/icons/heart-stroke.svg +22 -0
- package/app-template/src/assets/icons/info.svg +1 -0
- package/app-template/src/assets/icons/instagram.svg +14 -0
- package/app-template/src/assets/icons/layout-2.svg +7 -0
- package/app-template/src/assets/icons/layout-3.svg +4 -0
- package/app-template/src/assets/icons/logo.svg +24 -0
- package/app-template/src/assets/icons/mail.svg +1 -0
- package/app-template/src/assets/icons/minus.svg +4 -0
- package/app-template/src/assets/icons/money.svg +4 -0
- package/app-template/src/assets/icons/mp-otp.svg +1 -0
- package/app-template/src/assets/icons/pin.svg +16 -0
- package/app-template/src/assets/icons/pinterest.svg +12 -0
- package/app-template/src/assets/icons/plus.svg +5 -0
- package/app-template/src/assets/icons/search.svg +13 -0
- package/app-template/src/assets/icons/share.svg +10 -0
- package/app-template/src/assets/icons/spinner.svg +6 -0
- package/app-template/src/assets/icons/store-pin.svg +14 -0
- package/app-template/src/assets/icons/track-order.svg +1 -0
- package/app-template/src/assets/icons/twitter.svg +11 -0
- package/app-template/src/assets/icons/user.svg +14 -0
- package/app-template/src/assets/icons/whatsapp.svg +45 -0
- package/app-template/src/components/__tests__/Modal.test.tsx +103 -0
- package/app-template/src/components/__tests__/accordion.test.tsx +65 -0
- package/app-template/src/components/__tests__/badge.test.tsx +20 -0
- package/app-template/src/components/__tests__/button.test.tsx +59 -0
- package/app-template/src/components/__tests__/checkbox.test.tsx +57 -0
- package/app-template/src/components/__tests__/file-input.test.tsx +42 -0
- package/app-template/src/components/__tests__/icon.test.tsx +39 -0
- package/app-template/src/components/__tests__/input.test.tsx +69 -0
- package/app-template/src/components/__tests__/language-select.test.tsx +81 -0
- package/app-template/src/components/__tests__/link.test.tsx +65 -0
- package/app-template/src/components/__tests__/price.test.tsx +72 -0
- package/app-template/src/components/__tests__/radio.test.tsx +52 -0
- package/app-template/src/components/__tests__/select.test.tsx +115 -0
- package/app-template/src/components/__tests__/tab.test.tsx +101 -0
- package/app-template/src/components/accordion.tsx +64 -0
- package/app-template/src/components/badge.tsx +21 -0
- package/app-template/src/components/button.tsx +46 -0
- package/app-template/src/components/canonical-url.tsx +21 -0
- package/app-template/src/components/carousel-core.tsx +42 -0
- package/app-template/src/components/checkbox.tsx +28 -0
- package/app-template/src/components/currency-select.tsx +81 -0
- package/app-template/src/components/custom-loader.tsx +21 -0
- package/app-template/src/components/dynamic-form.tsx +17 -0
- package/app-template/src/components/file-input.tsx +8 -0
- package/app-template/src/components/generate-form-fields.tsx +349 -0
- package/app-template/src/components/icon.tsx +18 -0
- package/app-template/src/components/index.ts +41 -0
- package/app-template/src/components/input.tsx +110 -0
- package/app-template/src/components/language-select.tsx +33 -0
- package/app-template/src/components/link.tsx +53 -0
- package/app-template/src/components/loader-spinner.tsx +23 -0
- package/app-template/src/components/modal.tsx +66 -0
- package/app-template/src/components/pagination.tsx +267 -0
- package/app-template/src/components/password-rules-feedback.tsx +60 -0
- package/app-template/src/components/price.tsx +54 -0
- package/app-template/src/components/pwa-tags.tsx +233 -0
- package/app-template/src/components/radio.tsx +18 -0
- package/app-template/src/components/react-portal.tsx +47 -0
- package/app-template/src/components/select.tsx +70 -0
- package/app-template/src/components/shimmer.tsx +21 -0
- package/app-template/src/components/skeleton-article.tsx +15 -0
- package/app-template/src/components/skeleton-product.tsx +14 -0
- package/app-template/src/components/skeleton-profile.tsx +19 -0
- package/app-template/src/components/skeleton-wrapper.tsx +19 -0
- package/app-template/src/components/skeleton.tsx +37 -0
- package/app-template/src/components/source.tsx +12 -0
- package/app-template/src/components/tab-panel.tsx +10 -0
- package/app-template/src/components/tab.tsx +58 -0
- package/app-template/src/components/tabs.tsx +58 -0
- package/app-template/src/components/types/index.ts +89 -0
- package/app-template/src/hooks/index.ts +1 -0
- package/app-template/src/hooks/use-add-product-to-basket.ts +48 -0
- package/app-template/src/hooks/use-contract.tsx +58 -0
- package/app-template/src/hooks/use-fav-button.tsx +99 -0
- package/app-template/src/instrumentation.ts +1 -0
- package/app-template/src/middleware.ts +33 -0
- package/app-template/src/pages/_error.js +14 -0
- package/app-template/src/pages/api/auth/[...nextauth].ts +3 -0
- package/app-template/src/plugins.js +14 -0
- package/app-template/src/redux/middlewares/category.ts +42 -0
- package/app-template/src/redux/reducers/category.ts +67 -0
- package/app-template/src/redux/store.ts +47 -0
- package/app-template/src/routes/index.ts +46 -0
- package/app-template/src/settings.js +62 -0
- package/app-template/src/theme.js +1 -0
- package/app-template/src/types/index.ts +72 -0
- package/app-template/src/types/next-auth.d.ts +24 -0
- package/app-template/src/types/widgets.ts +115 -0
- package/app-template/src/utils/convert-facet-search-params.ts +15 -0
- package/app-template/src/utils/generate-jsonld.ts +23 -0
- package/app-template/src/utils/gtm.ts +247 -0
- package/app-template/src/utils/index.ts +60 -0
- package/app-template/src/views/account/account-menu.tsx +117 -0
- package/app-template/src/views/account/address-card.tsx +157 -0
- package/app-template/src/views/account/address-form.tsx +374 -0
- package/app-template/src/views/account/back-button.tsx +27 -0
- package/app-template/src/views/account/contact-form.tsx +283 -0
- package/app-template/src/views/account/content-header.tsx +52 -0
- package/app-template/src/views/account/faq/faq-footer.tsx +30 -0
- package/app-template/src/views/account/faq/faq-search.tsx +35 -0
- package/app-template/src/views/account/faq/faq-tabs.tsx +54 -0
- package/app-template/src/views/account/faq/index.ts +3 -0
- package/app-template/src/views/account/favorite-item.tsx +191 -0
- package/app-template/src/views/account/favourite-products/favourite-products-list.tsx +65 -0
- package/app-template/src/views/account/index.ts +4 -0
- package/app-template/src/views/account/order.tsx +89 -0
- package/app-template/src/views/account/orders/order-cancellation-item.tsx +99 -0
- package/app-template/src/views/account/orders/order-detail-header.tsx +39 -0
- package/app-template/src/views/anonymous-tracking/index.tsx +109 -0
- package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +318 -0
- package/app-template/src/views/basket/basket-item.tsx +231 -0
- package/app-template/src/views/basket/index.ts +2 -0
- package/app-template/src/views/basket/summary.tsx +220 -0
- package/app-template/src/views/breadcrumb.tsx +35 -0
- package/app-template/src/views/category/category-active-filters.tsx +98 -0
- package/app-template/src/views/category/category-banner.tsx +34 -0
- package/app-template/src/views/category/category-header.tsx +143 -0
- package/app-template/src/views/category/category-info.tsx +123 -0
- package/app-template/src/views/category/filters/index.tsx +163 -0
- package/app-template/src/views/category/filters/size-filter.tsx +27 -0
- package/app-template/src/views/category/layout.tsx +38 -0
- package/app-template/src/views/checkout/auth.tsx +54 -0
- package/app-template/src/views/checkout/index.tsx +3 -0
- package/app-template/src/views/checkout/layout/footer.tsx +48 -0
- package/app-template/src/views/checkout/layout/header.tsx +38 -0
- package/app-template/src/views/checkout/step-button.tsx +69 -0
- package/app-template/src/views/checkout/step-list.tsx +51 -0
- package/app-template/src/views/checkout/steps/payment/agreements.tsx +42 -0
- package/app-template/src/views/checkout/steps/payment/index.tsx +31 -0
- package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +382 -0
- package/app-template/src/views/checkout/steps/payment/options/credit-card/installments.tsx +100 -0
- package/app-template/src/views/checkout/steps/payment/options/credit-payment.tsx +14 -0
- package/app-template/src/views/checkout/steps/payment/options/funds-transfer.tsx +174 -0
- package/app-template/src/views/checkout/steps/payment/options/loyalty.tsx +19 -0
- package/app-template/src/views/checkout/steps/payment/options/pay-on-delivery.tsx +15 -0
- package/app-template/src/views/checkout/steps/payment/options/redirection.tsx +94 -0
- package/app-template/src/views/checkout/steps/payment/payment-header.tsx +17 -0
- package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +73 -0
- package/app-template/src/views/checkout/steps/shipping/address-box.tsx +244 -0
- package/app-template/src/views/checkout/steps/shipping/addresses.tsx +189 -0
- package/app-template/src/views/checkout/steps/shipping/index.tsx +27 -0
- package/app-template/src/views/checkout/steps/shipping/shipping-options.tsx +72 -0
- package/app-template/src/views/checkout/summary.tsx +181 -0
- package/app-template/src/views/coupon-item/index.tsx +80 -0
- package/app-template/src/views/find-in-store/index.tsx +183 -0
- package/app-template/src/views/footer.tsx +21 -0
- package/app-template/src/views/guest-login/index.tsx +130 -0
- package/app-template/src/views/header/action-menu.tsx +117 -0
- package/app-template/src/views/header/band.tsx +32 -0
- package/app-template/src/views/header/index.tsx +66 -0
- package/app-template/src/views/header/mini-basket.tsx +267 -0
- package/app-template/src/views/header/mobile-hamburger-button.tsx +35 -0
- package/app-template/src/views/header/mobile-menu.tsx +144 -0
- package/app-template/src/views/header/navbar.tsx +186 -0
- package/app-template/src/views/header/pwa-back-button.tsx +60 -0
- package/app-template/src/views/header/search/index.tsx +82 -0
- package/app-template/src/views/header/search/results.tsx +123 -0
- package/app-template/src/views/header/user-menu.tsx +72 -0
- package/app-template/src/views/index.tsx +2 -0
- package/app-template/src/views/installment-options/index.tsx +127 -0
- package/app-template/src/views/login/index.tsx +233 -0
- package/app-template/src/views/otp-login/index.tsx +152 -0
- package/app-template/src/views/page-loader-spinner/index.tsx +9 -0
- package/app-template/src/views/product/accordion-wrapper.tsx +59 -0
- package/app-template/src/views/product/combine-product-card.tsx +82 -0
- package/app-template/src/views/product/index.ts +8 -0
- package/app-template/src/views/product/layout.tsx +40 -0
- package/app-template/src/views/product/misc-buttons.tsx +65 -0
- package/app-template/src/views/product/price-wrapper.tsx +41 -0
- package/app-template/src/views/product/product-group-info.tsx +63 -0
- package/app-template/src/views/product/product-info.tsx +273 -0
- package/app-template/src/views/product/slider.tsx +124 -0
- package/app-template/src/views/product/variant.tsx +104 -0
- package/app-template/src/views/product-item/index.tsx +96 -0
- package/app-template/src/views/product-pointer-banner-item.tsx +243 -0
- package/app-template/src/views/register/index.tsx +417 -0
- package/app-template/src/views/root-modal.tsx +21 -0
- package/app-template/src/views/sales-contract-modal/index.tsx +288 -0
- package/app-template/src/views/share/index.tsx +71 -0
- package/app-template/src/views/widgets/home-hero-slider-content.tsx +54 -0
- package/app-template/src/views/widgets/recommendation-content.tsx +86 -0
- package/app-template/src/widgets/footer-copyright.tsx +25 -0
- package/app-template/src/widgets/footer-info.tsx +78 -0
- package/app-template/src/widgets/footer-menu.tsx +258 -0
- package/app-template/src/widgets/footer-social.tsx +53 -0
- package/app-template/src/widgets/footer-subscription/footer-subscription-form.tsx +110 -0
- package/app-template/src/widgets/footer-subscription/index.tsx +30 -0
- package/app-template/src/widgets/header-band-text.tsx +21 -0
- package/app-template/src/widgets/home-discovery.tsx +191 -0
- package/app-template/src/widgets/home-hero-slider.tsx +36 -0
- package/app-template/src/widgets/home-product-recommendation.tsx +18 -0
- package/app-template/src/widgets/home-single-banner.tsx +87 -0
- package/app-template/src/widgets/home-stories-eng.tsx +112 -0
- package/app-template/src/widgets/index.ts +25 -0
- package/app-template/src/widgets/product-pointer-banners.tsx +35 -0
- package/app-template/src/widgets/special-page-banner.tsx +49 -0
- package/app-template/src/widgets/special-page-carousel.tsx +68 -0
- package/app-template/src/widgets/widget-order.tsx +1 -0
- package/app-template/tailwind.config.js +170 -0
- package/app-template/tsconfig.json +44 -0
- package/app-template/tsconfig.test.json +6 -0
- package/app-template/yarn.lock +11278 -0
- package/commands/create.ts +49 -118
- package/dist/commands/create.js +32 -68
- package/package.json +1 -1
- package/tsconfig.json +9 -8
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 34 34" style="enable-background:new 0 0 34 34;" space="preserve">
|
|
2
|
+
<style type="text/css">
|
|
3
|
+
.st0{fill:#E95151;}
|
|
4
|
+
</style>
|
|
5
|
+
<g>
|
|
6
|
+
<g>
|
|
7
|
+
<circle class="st0" cx="17" cy="11.6" r="3.1"></circle>
|
|
8
|
+
<path class="st0" d="M8.1,19.5L17,31.6l8.9-12.1c3.4-4.3,2.9-11.2-1-14.9c-2.1-2-4.9-3.1-7.9-3.1s-5.8,1.1-7.9,3.1
|
|
9
|
+
C5.2,8.2,4.8,15.2,8.1,19.5z M17,7.2c2.4,0,4.4,2,4.4,4.4c0,2.4-2,4.4-4.4,4.4s-4.4-2-4.4-4.4C12.6,9.2,14.6,7.2,17,7.2z"></path>
|
|
10
|
+
</g>
|
|
11
|
+
<path d="M17,16c2.4,0,4.4-2,4.4-4.4s-2-4.4-4.4-4.4s-4.4,2-4.4,4.4S14.6,16,17,16z M17,8.5c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1
|
|
12
|
+
s-3.1-1.4-3.1-3.1S15.3,8.5,17,8.5z M17,33.8l9.9-13.6c3.7-4.7,3.2-12.4-1.2-16.5c-2.3-2.2-5.5-3.4-8.8-3.4s-6.4,1.2-8.8,3.4
|
|
13
|
+
C3.9,7.8,3.4,15.5,7.1,20.2L17,33.8z M9.1,4.5c2.1-2,4.9-3.1,7.9-3.1s5.8,1.1,7.9,3.1c3.9,3.7,4.4,10.7,1,14.9L17,31.6L8.1,19.5
|
|
14
|
+
C4.8,15.2,5.2,8.2,9.1,4.5z"></path>
|
|
15
|
+
</g>
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 15 15" style="enable-background:new 0 0 15 15;" space="preserve">
|
|
2
|
+
<style type="text/css">
|
|
3
|
+
.st0{enable-background:new ;}
|
|
4
|
+
</style>
|
|
5
|
+
<g class="st0">
|
|
6
|
+
<path d="M7.5,14.8c-0.8,0-1.5-0.1-2.2-0.3c0.3-0.5,0.7-1.3,0.9-1.9c0.1-0.3,0.5-1.7,0.5-1.7c0.2,0.5,0.9,0.8,1.7,0.8
|
|
7
|
+
c2.2,0,3.8-2,3.8-4.5c0-2.4-2-4.2-4.5-4.2C4.5,2.9,2.9,5,2.9,7.3c0,1.1,0.6,2.4,1.5,2.8c0.1,0.1,0.2,0,0.2-0.1
|
|
8
|
+
c0-0.1,0.1-0.6,0.2-0.8c0-0.1,0-0.1,0-0.2C4.4,8.6,4.2,8,4.2,7.4c0-1.6,1.2-3.2,3.3-3.2c1.8,0,3,1.2,3,3c0,2-1,3.3-2.3,3.3
|
|
9
|
+
c-0.7,0-1.2-0.6-1.1-1.3c0.2-0.9,0.6-1.8,0.6-2.4c0-0.6-0.3-1-0.9-1c-0.7,0-1.3,0.8-1.3,1.8c0,0.6,0.2,1.1,0.2,1.1s-0.7,3-0.8,3.6
|
|
10
|
+
c-0.1,0.6-0.1,1.5,0,2.1c-2.7-1.1-4.6-3.7-4.6-6.8c0-4,3.3-7.3,7.3-7.3s7.3,3.3,7.3,7.3S11.5,14.8,7.5,14.8z"></path>
|
|
11
|
+
</g>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" space="preserve">
|
|
2
|
+
<title>Group 3</title>
|
|
3
|
+
<path d="M17.2,8H10V0.8C10,0.4,9.6,0,9.2,0H8.8C8.4,0,8,0.4,8,0.8V8H0.8C0.4,8,0,8.4,0,8.8v0.4C0,9.6,0.4,10,0.8,10H8v7.2
|
|
4
|
+
C8,17.6,8.4,18,8.8,18h0.4c0.4,0,0.8-0.4,0.8-0.8V10h7.2c0.4,0,0.8-0.4,0.8-0.8V8.8C18,8.4,17.6,8,17.2,8z"></path>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink">
|
|
2
|
+
<title>Group 3</title>
|
|
3
|
+
|
|
4
|
+
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g id="header/mobile" transform="translate(-262.000000, -16.000000)">
|
|
6
|
+
<g id="Group-3" transform="translate(262.000000, 16.000000)">
|
|
7
|
+
|
|
8
|
+
<g id="Clip-2"></g>
|
|
9
|
+
<path d="M1.01537308,6.41537308 C1.01537308,3.43779231 3.43779231,1.01537308 6.41537308,1.01537308 C9.39295385,1.01537308 11.8153731,3.43779231 11.8153731,6.41537308 C11.8153731,9.39295385 9.39295385,11.8153731 6.41537308,11.8153731 C3.43779231,11.8153731 1.01537308,9.39295385 1.01537308,6.41537308 M17.8508769,17.13375 L11.2938577,10.5766962 C12.2515615,9.45560769 12.8307462,8.00193462 12.8307462,6.41537308 C12.8307462,2.87792308 9.95282308,0 6.41537308,0 C2.87792308,0 0,2.87792308 0,6.41537308 C0,9.95282308 2.87792308,12.8307462 6.41537308,12.8307462 C8.00158846,12.8307462 9.45491538,12.2518038 10.5759,11.2945154 L17.1334731,17.8521577 C17.2298769,17.9474885 17.3572962,18 17.4922962,18 C17.6278846,18 17.7552346,17.9473154 17.8508769,17.8516038 C18.0488077,17.6536731 18.0488077,17.3316462 17.8508769,17.13375" id="Fill-1" fill="#000000" mask="url(#mask-2)"></path>
|
|
10
|
+
</g>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 31 31" style="enable-background:new 0 0 31 31;" space="preserve">
|
|
2
|
+
<path d="M24.1,19.9c-1.4,0-2.7,0.5-3.6,1.5c-0.2,0.2-0.4,0.4-0.6,0.7l-8.1-4.9c0.2-0.6,0.3-1.1,0.3-1.7c0-0.6-0.1-1.2-0.3-1.7
|
|
3
|
+
l8.1-4.9c1,1.4,2.5,2.2,4.2,2.2c2.8,0,5.2-2.3,5.2-5.2c0-2.8-2.3-5.2-5.2-5.2s-5.2,2.3-5.2,5.2c0,0.6,0.1,1.1,0.3,1.6l-8.1,4.9
|
|
4
|
+
c-1-1.3-2.5-2.1-4.2-2.1c-2.8,0-5.2,2.3-5.2,5.2c0,2.8,2.3,5.2,5.2,5.2c1.7,0,3.2-0.8,4.2-2.1l8.1,4.9c-0.2,0.5-0.3,1.1-0.3,1.6
|
|
5
|
+
c0,1.4,0.5,2.7,1.5,3.7c1,1,2.3,1.5,3.6,1.5c1.4,0,2.7-0.5,3.6-1.5c1-1,1.5-2.3,1.5-3.7c0-1.4-0.5-2.7-1.5-3.7
|
|
6
|
+
C26.8,20.5,25.5,19.9,24.1,19.9z M27.8,25.1c0,1-0.4,1.9-1.1,2.6c-0.7,0.7-1.6,1.1-2.6,1.1c0,0,0,0,0,0c-1,0-1.9-0.4-2.6-1.1
|
|
7
|
+
c-0.7-0.7-1.1-1.6-1.1-2.6s0.4-1.9,1.1-2.6c0.7-0.7,1.6-1.1,2.6-1.1c1,0,1.9,0.4,2.6,1.1C27.4,23.2,27.8,24.1,27.8,25.1z M20.4,5.9
|
|
8
|
+
c0-2,1.6-3.7,3.7-3.7c2,0,3.7,1.7,3.7,3.7c0,2-1.6,3.7-3.7,3.7C22.1,9.6,20.4,7.9,20.4,5.9z M10.6,15.5c0,2-1.6,3.7-3.7,3.7
|
|
9
|
+
s-3.7-1.7-3.7-3.7c0-2,1.6-3.7,3.7-3.7S10.6,13.4,10.6,15.5z"></path>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" style="enable-background:new 0 0 18 18;" space="preserve">
|
|
2
|
+
<title>Group 3</title>
|
|
3
|
+
<path d="M14.9,3.1l-0.6,0.6c-0.2,0.2-0.2,0.6,0,0.8c2.4,2.8,2.2,7-0.5,9.6c-2.7,2.6-7.1,2.6-9.8,0c-2.7-2.6-2.8-6.8-0.5-9.6
|
|
4
|
+
c0.2-0.2,0.2-0.6,0-0.8L3.1,3.1c-0.2-0.2-0.6-0.2-0.9,0c-3.1,3.6-2.9,9.1,0.6,12.5c3.4,3.2,8.9,3.2,12.4,0c3.5-3.4,3.7-8.9,0.6-12.5
|
|
5
|
+
C15.6,2.8,15.2,2.8,14.9,3.1z"></path>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg width="17px" height="17px" viewBox="0 0 17 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink">
|
|
2
|
+
<title>placeholder (1)</title>
|
|
3
|
+
<g id="03-urun-detay" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
4
|
+
<g id="03_urundetay" transform="translate(-1186.000000, -628.000000)" fill="#000000" fill-rule="nonzero">
|
|
5
|
+
<g id="Group-5" transform="translate(906.000000, 624.000000)">
|
|
6
|
+
<g id="placeholder-(1)" transform="translate(280.000000, 4.000000)">
|
|
7
|
+
<path d="M8.5,7.36666667 C9.59366667,7.36666667 10.4833333,6.47671667 10.4833333,5.38333333 C10.4833333,4.28995 9.59366667,3.4 8.5,3.4 C7.40633333,3.4 6.51666667,4.28995 6.51666667,5.38333333 C6.51666667,6.47671667 7.40633333,7.36666667 8.5,7.36666667 Z M8.5,3.96666667 C9.28115,3.96666667 9.91666667,4.60218333 9.91666667,5.38333333 C9.91666667,6.16448333 9.28115,6.8 8.5,6.8 C7.71885,6.8 7.08333333,6.16448333 7.08333333,5.38333333 C7.08333333,4.60218333 7.71885,3.96666667 8.5,3.96666667 Z" id="Shape"></path>
|
|
8
|
+
<path d="M8.44985,15.5144833 L12.7964667,9.23666667 C14.4267667,7.06321667 14.1910333,3.49066667 12.29185,1.59176667 C11.2656167,0.56525 9.90108333,0 8.44985,0 C6.99861667,0 5.63408333,0.56525 4.60785,1.59148333 C2.70866667,3.49038333 2.47293333,7.06293333 4.09671667,9.22788333 L8.44985,15.5144833 Z M5.00848333,1.99211667 C5.9279,1.07298333 7.14991667,0.566666667 8.44985,0.566666667 C9.74978333,0.566666667 10.9718,1.07298333 11.8912167,1.99211667 C13.6053833,3.706 13.8164667,6.9326 12.3369,8.90516667 L8.44985,14.51885 L4.55656667,8.89666667 C3.08323333,6.9326 3.2946,3.706 5.00848333,1.99211667 Z" id="Shape"></path>
|
|
9
|
+
<path d="M11.93315,12.1853167 C11.7773167,12.1663333 11.6367833,12.2779667 11.61865,12.4335167 C11.6005167,12.5890667 11.7115833,12.7298833 11.86685,12.7480167 C14.8463833,13.0987833 16.4333333,14.0439833 16.4333333,14.5916667 C16.4333333,15.3606333 13.4152667,16.4333333 8.5,16.4333333 C3.58473333,16.4333333 0.566666667,15.3606333 0.566666667,14.5916667 C0.566666667,14.0439833 2.15361667,13.0987833 5.13315,12.7480167 C5.28841667,12.7298833 5.39948333,12.5887833 5.38135,12.4335167 C5.36293333,12.2779667 5.2224,12.1657667 5.06685,12.1853167 C2.08363333,12.53665 0,13.52605 0,14.5916667 C0,15.7884667 2.91975,17 8.5,17 C14.08025,17 17,15.7884667 17,14.5916667 C17,13.52605 14.9163667,12.53665 11.93315,12.1853167 Z" id="Path"></path>
|
|
10
|
+
</g>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg height="480pt" viewBox="0 -72 480 480" width="480pt" xmlns="http://www.w3.org/2000/svg"><path d="m120 224c-30.929688 0-56 25.070312-56 56s25.070312 56 56 56 56-25.070312 56-56-25.070312-56-56-56zm0 96c-22.089844 0-40-17.910156-40-40s17.910156-40 40-40 40 17.910156 40 40-17.910156 40-40 40zm0 0"></path><path d="m120 256c-13.253906 0-24 10.746094-24 24s10.746094 24 24 24 24-10.746094 24-24-10.746094-24-24-24zm0 32c-4.417969 0-8-3.582031-8-8s3.582031-8 8-8 8 3.582031 8 8-3.582031 8-8 8zm0 0"></path><path d="m376 224c-30.929688 0-56 25.070312-56 56s25.070312 56 56 56 56-25.070312 56-56-25.070312-56-56-56zm0 96c-22.089844 0-40-17.910156-40-40s17.910156-40 40-40 40 17.910156 40 40-17.910156 40-40 40zm0 0"></path><path d="m376 256c-13.253906 0-24 10.746094-24 24s10.746094 24 24 24 24-10.746094 24-24-10.746094-24-24-24zm0 32c-4.417969 0-8-3.582031-8-8s3.582031-8 8-8 8 3.582031 8 8-3.582031 8-8 8zm0 0"></path><path d="m384 160h-16v-32c0-4.417969-3.582031-8-8-8s-8 3.582031-8 8v32c0 8.835938 7.164062 16 16 16h16c4.417969 0 8-3.582031 8-8s-3.582031-8-8-8zm0 0"></path><path d="m144 48c-30.929688 0-56 25.070312-56 56 0 27.679688 22.320312 96 56 96s56-68.320312 56-96c0-30.929688-25.070312-56-56-56zm0 136c-18.398438 0-40-52.878906-40-80 0-22.089844 17.910156-40 40-40s40 17.910156 40 40c0 27.121094-21.601562 80-40 80zm0 0"></path><path d="m144 80c-13.253906 0-24 10.746094-24 24s10.746094 24 24 24 24-10.746094 24-24-10.746094-24-24-24zm0 32c-4.417969 0-8-3.582031-8-8s3.582031-8 8-8 8 3.582031 8 8-3.582031 8-8 8zm0 0"></path><path d="m192 184c0 4.417969 3.582031 8 8 8h32c4.417969 0 8-3.582031 8-8s-3.582031-8-8-8h-32c-4.417969 0-8 3.582031-8 8zm0 0"></path><path d="m96 184c0-4.417969-3.582031-8-8-8h-32c-4.417969 0-8 3.582031-8 8s3.582031 8 8 8h32c4.417969 0 8-3.582031 8-8zm0 0"></path><path d="m440 192h-10l-26.960938-94.640625c-2.964843-10.300781-12.402343-17.382813-23.117187-17.359375h-91.921875v-40c0-22.089844-17.910156-40-40-40h-216c-17.671875 0-32 14.328125-32 32v224c0 17.671875 14.328125 32 32 32h8c4.417969 0 8-3.582031 8-8s-3.582031-8-8-8h-8c-8.835938 0-16-7.164062-16-16v-224c0-8.835938 7.164062-16 16-16h216c13.253906 0 24 10.746094 24 24v232h-72c-4.417969 0-8 3.582031-8 8s3.582031 8 8 8h96c4.417969 0 8-3.582031 8-8s-3.582031-8-8-8h-8v-64h152c13.253906 0 24 10.746094 24 24v40h-8c-4.417969 0-8 3.582031-8 8s3.582031 8 8 8h16c4.417969 0 8-3.582031 8-8v-48c0-22.089844-17.910156-40-40-40zm-152-96h32v72c0 4.417969 3.582031 8 8 8s8-3.582031 8-8v-72h43.921875c3.671875-.144531 6.972656 2.230469 8 5.761719l25.4375 90.238281h-125.359375zm0 0"></path></svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 15 15" style="enable-background:new 0 0 15 15;" space="preserve">
|
|
2
|
+
<style type="text/css">
|
|
3
|
+
.st0{enable-background:new ;}
|
|
4
|
+
</style>
|
|
5
|
+
<g class="st0">
|
|
6
|
+
<path d="M13.5,4.8c0,4.1-3.1,8.7-8.7,8.7c-1.7,0-3.4-0.5-4.7-1.4c0.2,0,0.5,0,0.7,0c1.4,0,2.8-0.5,3.8-1.3c-1.4,0-2.5-0.9-2.9-2.1
|
|
7
|
+
c0.2,0,0.4,0,0.6,0c0.3,0,0.6,0,0.8-0.1c-1.4-0.3-2.5-1.5-2.5-3v0C1,5.9,1.5,6.1,2,6.1C1.2,5.5,0.6,4.6,0.6,3.5C0.6,3,0.8,2.4,1,2
|
|
8
|
+
c1.5,1.9,3.8,3.1,6.3,3.2c0-0.2-0.1-0.5-0.1-0.7c0-1.7,1.4-3.1,3.1-3.1c0.9,0,1.7,0.4,2.2,1c0.7-0.1,1.4-0.4,2-0.7
|
|
9
|
+
c-0.2,0.7-0.7,1.3-1.4,1.7c0.6-0.1,1.2-0.2,1.8-0.5c-0.4,0.6-0.9,1.2-1.5,1.6C13.5,4.6,13.5,4.7,13.5,4.8z"></path>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" space="preserve">
|
|
2
|
+
<g id="_x30_7-hesabim">
|
|
3
|
+
<g id="_x30_6_x5F_hesabim_x5F_03_x5F_mobil" transform="translate(-58.000000, -95.000000)">
|
|
4
|
+
<g id="Group" transform="translate(39.000000, 95.000000)">
|
|
5
|
+
<g id="Group-2" transform="translate(19.000000, 0.000000)">
|
|
6
|
+
<path id="Path" d="M21.6,24h-1.2v-5.4c0-1.7-1.3-3-3-3H6.6c-1.7,0-3,1.3-3,3V24H2.4v-5.4c0-2.3,1.9-4.2,4.2-4.2h10.8
|
|
7
|
+
c2.3,0,4.2,1.9,4.2,4.2V24z"></path>
|
|
8
|
+
<path id="Shape" d="M12,13.2c-3.6,0-6.6-3-6.6-6.6S8.4,0,12,0s6.6,3,6.6,6.6c0,1.7-0.7,3.4-1.9,4.7S13.7,13.2,12,13.2z M12,1.2
|
|
9
|
+
c-3,0-5.4,2.4-5.4,5.4S9,12,12,12s5.4-2.4,5.4-5.4S15,1.2,12,1.2z"></path>
|
|
10
|
+
</g>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" space="preserve">
|
|
2
|
+
<g>
|
|
3
|
+
<g>
|
|
4
|
+
<path d="M256.064,0h-0.128C114.784,0,0,114.816,0,256c0,56,18.048,107.904,48.736,150.048l-31.904,95.104l98.4-31.456
|
|
5
|
+
C155.712,496.512,204,512,256.064,512C397.216,512,512,397.152,512,256S397.216,0,256.064,0z M405.024,361.504
|
|
6
|
+
c-6.176,17.44-30.688,31.904-50.24,36.128c-13.376,2.848-30.848,5.12-89.664-19.264C189.888,347.2,141.44,270.752,137.664,265.792
|
|
7
|
+
c-3.616-4.96-30.4-40.48-30.4-77.216s18.656-54.624,26.176-62.304c6.176-6.304,16.384-9.184,26.176-9.184
|
|
8
|
+
c3.168,0,6.016,0.16,8.576,0.288c7.52,0.32,11.296,0.768,16.256,12.64c6.176,14.88,21.216,51.616,23.008,55.392
|
|
9
|
+
c1.824,3.776,3.648,8.896,1.088,13.856c-2.4,5.12-4.512,7.392-8.288,11.744c-3.776,4.352-7.36,7.68-11.136,12.352
|
|
10
|
+
c-3.456,4.064-7.36,8.416-3.008,15.936c4.352,7.36,19.392,31.904,41.536,51.616c28.576,25.44,51.744,33.568,60.032,37.024
|
|
11
|
+
c6.176,2.56,13.536,1.952,18.048-2.848c5.728-6.176,12.8-16.416,20-26.496c5.12-7.232,11.584-8.128,18.368-5.568
|
|
12
|
+
c6.912,2.4,43.488,20.48,51.008,24.224c7.52,3.776,12.48,5.568,14.304,8.736C411.2,329.152,411.2,344.032,405.024,361.504z"></path>
|
|
13
|
+
</g>
|
|
14
|
+
</g>
|
|
15
|
+
<g>
|
|
16
|
+
</g>
|
|
17
|
+
<g>
|
|
18
|
+
</g>
|
|
19
|
+
<g>
|
|
20
|
+
</g>
|
|
21
|
+
<g>
|
|
22
|
+
</g>
|
|
23
|
+
<g>
|
|
24
|
+
</g>
|
|
25
|
+
<g>
|
|
26
|
+
</g>
|
|
27
|
+
<g>
|
|
28
|
+
</g>
|
|
29
|
+
<g>
|
|
30
|
+
</g>
|
|
31
|
+
<g>
|
|
32
|
+
</g>
|
|
33
|
+
<g>
|
|
34
|
+
</g>
|
|
35
|
+
<g>
|
|
36
|
+
</g>
|
|
37
|
+
<g>
|
|
38
|
+
</g>
|
|
39
|
+
<g>
|
|
40
|
+
</g>
|
|
41
|
+
<g>
|
|
42
|
+
</g>
|
|
43
|
+
<g>
|
|
44
|
+
</g>
|
|
45
|
+
</svg>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { Modal } from '../modal';
|
|
4
|
+
|
|
5
|
+
describe('Modal Component', () => {
|
|
6
|
+
it('should render as expected when modal is true', () => {
|
|
7
|
+
const closeFn = jest.fn();
|
|
8
|
+
|
|
9
|
+
const { getByText } = render(
|
|
10
|
+
<Modal portalId="example-modal" open={true} setOpen={closeFn}>
|
|
11
|
+
This modal is so cool!
|
|
12
|
+
</Modal>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
expect(getByText('This modal is so cool!')).toBeTruthy();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should render as expected when modal is false', () => {
|
|
19
|
+
const closeFn = jest.fn();
|
|
20
|
+
|
|
21
|
+
render(
|
|
22
|
+
<Modal portalId="example-modal" open={false} setOpen={closeFn}>
|
|
23
|
+
This modal is so cool!
|
|
24
|
+
</Modal>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const text = screen.queryByText('This modal is so cool!');
|
|
28
|
+
expect(text).not.toBeInTheDocument();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should have portalId', () => {
|
|
32
|
+
const portalId = 'example-modal';
|
|
33
|
+
|
|
34
|
+
const closeFn = jest.fn();
|
|
35
|
+
|
|
36
|
+
render(
|
|
37
|
+
<Modal portalId={portalId} open={true} setOpen={closeFn}>
|
|
38
|
+
This modal is so cool!
|
|
39
|
+
</Modal>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const element = document.getElementById(portalId);
|
|
43
|
+
|
|
44
|
+
expect(element.getAttribute('id')).toBe(portalId);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('has given class names', () => {
|
|
48
|
+
const closeFn = jest.fn();
|
|
49
|
+
|
|
50
|
+
render(
|
|
51
|
+
<Modal
|
|
52
|
+
portalId="example-modal"
|
|
53
|
+
open={true}
|
|
54
|
+
setOpen={closeFn}
|
|
55
|
+
className="accent-primary"
|
|
56
|
+
>
|
|
57
|
+
This modal is so cool!
|
|
58
|
+
</Modal>
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const section = document.querySelector('section');
|
|
62
|
+
|
|
63
|
+
expect(section).toHaveClass('accent-primary');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should have title', () => {
|
|
67
|
+
const closeFn = jest.fn();
|
|
68
|
+
|
|
69
|
+
render(
|
|
70
|
+
<Modal
|
|
71
|
+
portalId="example-modal"
|
|
72
|
+
open={true}
|
|
73
|
+
setOpen={closeFn}
|
|
74
|
+
title="Example Title"
|
|
75
|
+
>
|
|
76
|
+
This modal is so cool!
|
|
77
|
+
</Modal>
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const title = document.querySelector('h3');
|
|
81
|
+
|
|
82
|
+
expect(title).toHaveTextContent('Example Title');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('should have close button', () => {
|
|
86
|
+
const closeFn = jest.fn();
|
|
87
|
+
|
|
88
|
+
render(
|
|
89
|
+
<Modal
|
|
90
|
+
portalId="example-modal"
|
|
91
|
+
open={true}
|
|
92
|
+
setOpen={closeFn}
|
|
93
|
+
showCloseButton
|
|
94
|
+
>
|
|
95
|
+
This modal is so cool!
|
|
96
|
+
</Modal>
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const button = document.querySelector('use');
|
|
100
|
+
|
|
101
|
+
expect(button.getAttribute('xlink:href')).toBe('/icon-sprite.svg#close');
|
|
102
|
+
});
|
|
103
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Accordion } from '../accordion';
|
|
3
|
+
|
|
4
|
+
const accordionContent = {
|
|
5
|
+
title: 'test-title',
|
|
6
|
+
subTitle: 'test-subtitle',
|
|
7
|
+
content: 'Test-content',
|
|
8
|
+
className: 'test-class',
|
|
9
|
+
icons: ['globe'],
|
|
10
|
+
iconColor: '#D02B2F'
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe('Accordion Component', () => {
|
|
14
|
+
it('should give class names correctly', () => {
|
|
15
|
+
const { container } = render(
|
|
16
|
+
<Accordion className={accordionContent.className}></Accordion>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
expect(container.firstChild).toHaveClass(accordionContent.className);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should be icon and icon color', () => {
|
|
23
|
+
const { container } = render(
|
|
24
|
+
<Accordion
|
|
25
|
+
isCollapse={true}
|
|
26
|
+
icons={accordionContent.icons}
|
|
27
|
+
iconColor={accordionContent.iconColor}
|
|
28
|
+
></Accordion>
|
|
29
|
+
);
|
|
30
|
+
const svg = container.querySelector('svg');
|
|
31
|
+
|
|
32
|
+
expect(svg).toHaveClass(`fill-[${accordionContent.iconColor}]}`);
|
|
33
|
+
expect(svg).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should render a accordion content correctly', () => {
|
|
37
|
+
render(
|
|
38
|
+
<Accordion isCollapse={true}>
|
|
39
|
+
<div>{accordionContent.content}</div>
|
|
40
|
+
</Accordion>
|
|
41
|
+
);
|
|
42
|
+
const accordion = screen.getByText(accordionContent.content);
|
|
43
|
+
|
|
44
|
+
expect(accordion).toBeInTheDocument();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should render a accordion title and title class correctly', () => {
|
|
48
|
+
render(
|
|
49
|
+
<Accordion
|
|
50
|
+
titleClassName={accordionContent.className}
|
|
51
|
+
title={accordionContent.title}
|
|
52
|
+
></Accordion>
|
|
53
|
+
);
|
|
54
|
+
const accordion = screen.getByText(accordionContent.title);
|
|
55
|
+
|
|
56
|
+
expect(accordion).toHaveClass(accordionContent.className);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should render a accordion sub title correctly', () => {
|
|
60
|
+
render(<Accordion subTitle={accordionContent.subTitle}></Accordion>);
|
|
61
|
+
const accordion = screen.getByText(accordionContent.subTitle);
|
|
62
|
+
|
|
63
|
+
expect(accordion).toBeTruthy();
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Badge } from '../badge';
|
|
3
|
+
|
|
4
|
+
describe('Badge Component', () => {
|
|
5
|
+
let badge;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
render(<Badge className="text-md rounded-sm">%90 off</Badge>);
|
|
9
|
+
|
|
10
|
+
badge = screen.getByText('%90 off');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should render without throwing an error', () => {
|
|
14
|
+
expect(badge).toBeInTheDocument();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should be classname checked', () => {
|
|
18
|
+
expect(badge).toHaveClass('text-md rounded-sm');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
+
import { Button } from '../button';
|
|
3
|
+
|
|
4
|
+
describe('Button Component', () => {
|
|
5
|
+
it('should render without throwing an error', () => {
|
|
6
|
+
render(<Button>Button</Button>);
|
|
7
|
+
|
|
8
|
+
const button = screen.getByRole('button', {
|
|
9
|
+
name: /button/i
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
expect(button).toBeTruthy();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should work outlined appearance without error', () => {
|
|
16
|
+
render(<Button appearance="outlined">Outlined Button</Button>);
|
|
17
|
+
|
|
18
|
+
const button = screen.getByRole('button', {
|
|
19
|
+
name: /outlined/i
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
expect(button).toHaveAttribute('appearance', 'outlined');
|
|
23
|
+
expect(button).toHaveClass(
|
|
24
|
+
'bg-transparent text-primary hover:bg-primary hover:text-primary-foreground'
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should render a disabled button', () => {
|
|
29
|
+
render(<Button disabled />);
|
|
30
|
+
|
|
31
|
+
const button = screen.getByRole('button');
|
|
32
|
+
|
|
33
|
+
expect(button).toHaveAttribute('disabled');
|
|
34
|
+
expect(button).toBeDisabled();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should invoke an onClick handler when passed', () => {
|
|
38
|
+
const handleClick = jest.fn();
|
|
39
|
+
|
|
40
|
+
render(<Button onClick={handleClick}>Click Me</Button>);
|
|
41
|
+
|
|
42
|
+
fireEvent.click(screen.getByText(/click me/i));
|
|
43
|
+
|
|
44
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should work ghost appearance without error', () => {
|
|
48
|
+
render(<Button appearance="ghost">Ghost Button</Button>);
|
|
49
|
+
|
|
50
|
+
const button = screen.getByRole('button', {
|
|
51
|
+
name: /ghost button/i
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
expect(button).toHaveAttribute('appearance', 'ghost');
|
|
55
|
+
expect(button).toHaveClass(
|
|
56
|
+
'bg-transparent border-transparent text-primary hover:bg-primary hover:text-primary-foreground'
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
2
|
+
import { Checkbox } from '../checkbox';
|
|
3
|
+
|
|
4
|
+
describe('Checkbox input', () => {
|
|
5
|
+
it('should render without throwing an error', () => {
|
|
6
|
+
render(<Checkbox />);
|
|
7
|
+
|
|
8
|
+
const checkbox = screen.getByRole('checkbox');
|
|
9
|
+
|
|
10
|
+
expect(checkbox).toBeTruthy();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be checked when clicked', () => {
|
|
14
|
+
render(<Checkbox />);
|
|
15
|
+
|
|
16
|
+
const checkbox = screen.getByRole('checkbox');
|
|
17
|
+
|
|
18
|
+
expect(checkbox).not.toBeChecked();
|
|
19
|
+
|
|
20
|
+
fireEvent.click(checkbox);
|
|
21
|
+
|
|
22
|
+
expect(checkbox).toBeChecked();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should be label checked', () => {
|
|
26
|
+
render(<Checkbox>Checkbox</Checkbox>);
|
|
27
|
+
|
|
28
|
+
const checkbox = screen.getByRole('checkbox', {
|
|
29
|
+
name: /checkbox/i
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
expect(checkbox).toBeTruthy();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should be label classname checked', () => {
|
|
36
|
+
const { container } = render(
|
|
37
|
+
<Checkbox className="accent-primary">Checkbox</Checkbox>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const label = container.querySelector('label');
|
|
41
|
+
|
|
42
|
+
expect(label).toHaveClass('accent-primary');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should be error message checked', () => {
|
|
46
|
+
const error = {
|
|
47
|
+
type: '',
|
|
48
|
+
message: 'Error message'
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
render(<Checkbox error={error} />);
|
|
52
|
+
|
|
53
|
+
const errorMessage = screen.getByText(error.message);
|
|
54
|
+
|
|
55
|
+
expect(errorMessage).toBeTruthy();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { render, screen, fireEvent, waitFor} from '@testing-library/react';
|
|
2
|
+
import { FileInput} from '../file-input';
|
|
3
|
+
|
|
4
|
+
describe('File Input Component', () => {
|
|
5
|
+
let input;
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
render(
|
|
9
|
+
<>
|
|
10
|
+
<label htmlFor="fileUpload">Upload file</label>
|
|
11
|
+
<FileInput className="bg-primary" id="fileUpload" />
|
|
12
|
+
</>
|
|
13
|
+
);
|
|
14
|
+
input = screen.getByLabelText('Upload file');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should be file selected without getting an error', async () => {
|
|
18
|
+
const file = new File(["logo"], "logo.png", { type: "image/png" });
|
|
19
|
+
|
|
20
|
+
expect(input.files.length).toBe(0);
|
|
21
|
+
|
|
22
|
+
await waitFor(() =>
|
|
23
|
+
fireEvent.change(input, {
|
|
24
|
+
target: { files: [file] },
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
expect(input.files[0].name).toBe("logo.png");
|
|
29
|
+
expect(input.files.length).toBe(1);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should be classname checked', () => {
|
|
33
|
+
expect(input).toHaveClass('bg-primary');
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should render a disabled', () => {
|
|
37
|
+
input.setAttribute('disabled', 'true');
|
|
38
|
+
|
|
39
|
+
expect(input).toHaveAttribute('disabled');
|
|
40
|
+
expect(input).toBeDisabled();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { Icon } from '../icon';
|
|
3
|
+
|
|
4
|
+
describe('Icon Component', () => {
|
|
5
|
+
it('Should successfully render icon component', () => {
|
|
6
|
+
render(<Icon name="cart" data-testid="icon" />);
|
|
7
|
+
|
|
8
|
+
const icon = screen.getByTestId('icon');
|
|
9
|
+
|
|
10
|
+
expect(icon).toHaveAttribute('height', '18');
|
|
11
|
+
expect(icon).toHaveAttribute('viewBox', '0 0 18 18');
|
|
12
|
+
expect(icon.querySelector('use')).toHaveAttribute(
|
|
13
|
+
'xlink:href',
|
|
14
|
+
'/icon-sprite.svg#cart'
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('Can change the size', () => {
|
|
19
|
+
const size = 33;
|
|
20
|
+
|
|
21
|
+
render(<Icon name="cart" size={size} data-testid="icon" />);
|
|
22
|
+
|
|
23
|
+
const icon = screen.getByTestId('icon');
|
|
24
|
+
|
|
25
|
+
expect(icon).toHaveAttribute('height', String(size));
|
|
26
|
+
expect(icon).toHaveAttribute('viewBox', `0 0 ${size} ${size}`);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('Can change the color', async () => {
|
|
30
|
+
render(<Icon name="cart" className="fill-[#ff0000]" data-testid="icon" />);
|
|
31
|
+
|
|
32
|
+
const icon = screen.getByTestId('icon');
|
|
33
|
+
const fillColor = getComputedStyle(icon).getPropertyValue('fill');
|
|
34
|
+
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
expect(fillColor).toBe('rgb(255, 0, 0)');
|
|
37
|
+
}, 0);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent, screen } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
4
|
+
import { Input } from '../input';
|
|
5
|
+
|
|
6
|
+
describe('Input Component', () => {
|
|
7
|
+
it('rendered input', () => {
|
|
8
|
+
render(<Input />);
|
|
9
|
+
const input = screen.getByRole('textbox');
|
|
10
|
+
|
|
11
|
+
expect(input).toBeTruthy();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('should render a placeholder input correctly', () => {
|
|
15
|
+
render(<Input placeholder="Test placeholder" />);
|
|
16
|
+
const input = screen.getByPlaceholderText('Test placeholder');
|
|
17
|
+
|
|
18
|
+
expect(input).toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('has given class names', () => {
|
|
22
|
+
render(<Input className="test-class" />);
|
|
23
|
+
const input = screen.getByRole('textbox');
|
|
24
|
+
|
|
25
|
+
expect(input).toHaveClass('test-class');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should render a disabled input correctly', () => {
|
|
29
|
+
render(<Input disabled />);
|
|
30
|
+
const input = screen.getByRole('textbox');
|
|
31
|
+
|
|
32
|
+
expect(input).toHaveAttribute('disabled');
|
|
33
|
+
expect(input).toBeDisabled();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should be focus correctly', () => {
|
|
37
|
+
render(<Input />);
|
|
38
|
+
const input = screen.getByRole('textbox');
|
|
39
|
+
|
|
40
|
+
setTimeout(() => expect(input.focus).toHaveBeenCalled(), 250);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should be label', () => {
|
|
44
|
+
const { getByText } = render(<Input label="Example Label" />);
|
|
45
|
+
expect(getByText('Example Label')).toBeTruthy();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should be error message', () => {
|
|
49
|
+
const error = {
|
|
50
|
+
type: '',
|
|
51
|
+
message: 'Error message'
|
|
52
|
+
};
|
|
53
|
+
render(<Input error={error} />);
|
|
54
|
+
const errorMessage = screen.getByText(error.message);
|
|
55
|
+
expect(errorMessage).toBeTruthy();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('should change the value without error', () => {
|
|
59
|
+
render(<Input />);
|
|
60
|
+
const input = screen.getByRole('textbox');
|
|
61
|
+
fireEvent.change(input, {
|
|
62
|
+
target: {
|
|
63
|
+
value: 'test'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
expect(input).toHaveValue('test');
|
|
68
|
+
});
|
|
69
|
+
});
|