@hashrytech/quick-components-kit 0.18.0 → 0.19.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/button/Button.svelte +6 -5
  3. package/dist/components/button/Button.svelte.d.ts +3 -2
  4. package/dist/components/button/index.d.ts +1 -1
  5. package/dist/components/hamburger-menu/HamburgerMenu.svelte +2 -2
  6. package/dist/components/hamburger-menu/HamburgerMenu.svelte.d.ts +1 -1
  7. package/dist/components/select/Select.svelte +52 -19
  8. package/dist/components/select/Select.svelte.d.ts +7 -2
  9. package/dist/components/text-input/TextInput.svelte +88 -18
  10. package/dist/components/text-input/TextInput.svelte.d.ts +13 -3
  11. package/dist/index.d.ts +4 -0
  12. package/dist/index.js +4 -0
  13. package/dist/ui/banners/banner-1/Banner1.svelte +47 -0
  14. package/dist/ui/banners/banner-1/Banner1.svelte.d.ts +14 -0
  15. package/dist/ui/banners/banner-1/index.d.ts +1 -0
  16. package/dist/ui/banners/banner-1/index.js +1 -0
  17. package/dist/ui/breadcrumbs/breadcrumbs-1/Breadcrumbs1.svelte +30 -0
  18. package/dist/ui/breadcrumbs/breadcrumbs-1/Breadcrumbs1.svelte.d.ts +13 -0
  19. package/dist/ui/breadcrumbs/breadcrumbs-1/index.d.ts +1 -0
  20. package/dist/ui/breadcrumbs/breadcrumbs-1/index.js +1 -0
  21. package/dist/ui/featured-products/featured-products-1/FeaturedProducts1.svelte +56 -0
  22. package/dist/ui/featured-products/featured-products-1/FeaturedProducts1.svelte.d.ts +22 -0
  23. package/dist/ui/featured-products/featured-products-1/index.d.ts +1 -0
  24. package/dist/ui/featured-products/featured-products-1/index.js +1 -0
  25. package/dist/ui/footers/footer-1/Footer1.svelte +81 -0
  26. package/dist/ui/footers/footer-1/Footer1.svelte.d.ts +18 -0
  27. package/dist/ui/footers/footer-1/index.d.ts +1 -0
  28. package/dist/ui/footers/footer-1/index.js +1 -0
  29. package/dist/ui/headers/header-1/Header1.svelte +94 -0
  30. package/dist/ui/headers/header-1/Header1.svelte.d.ts +15 -0
  31. package/dist/ui/headers/header-1/index.d.ts +1 -0
  32. package/dist/ui/headers/header-1/index.js +1 -0
  33. package/dist/ui/product-filters/product-filter-1/ProductFilter1.svelte +42 -0
  34. package/dist/ui/product-filters/product-filter-1/ProductFilter1.svelte.d.ts +26 -0
  35. package/dist/ui/product-filters/product-filter-1/ProductFilterBlock.svelte +49 -0
  36. package/dist/ui/product-filters/product-filter-1/ProductFilterBlock.svelte.d.ts +17 -0
  37. package/dist/ui/product-filters/product-filter-1/index.d.ts +1 -0
  38. package/dist/ui/product-filters/product-filter-1/index.js +1 -0
  39. package/dist/ui/product-list/product-list-1/ProductList1.svelte +76 -0
  40. package/dist/ui/product-list/product-list-1/ProductList1.svelte.d.ts +24 -0
  41. package/dist/ui/product-list/product-list-1/index.d.ts +1 -0
  42. package/dist/ui/product-list/product-list-1/index.js +1 -0
  43. package/dist/ui/product-list-navigation/product-list-navigation-1/ProductListNavigation1.svelte +51 -0
  44. package/dist/ui/product-list-navigation/product-list-navigation-1/ProductListNavigation1.svelte.d.ts +12 -0
  45. package/dist/ui/product-list-navigation/product-list-navigation-1/index.d.ts +1 -0
  46. package/dist/ui/product-list-navigation/product-list-navigation-1/index.js +1 -0
  47. package/dist/ui/searchbox/Searchbox.svelte +46 -0
  48. package/dist/ui/searchbox/Searchbox.svelte.d.ts +13 -0
  49. package/dist/ui/searchbox/index.d.ts +1 -0
  50. package/dist/ui/searchbox/index.js +1 -0
  51. package/package.json +1 -1
@@ -0,0 +1,81 @@
1
+ <script lang="ts" module>
2
+ import {twMerge} from 'tailwind-merge';
3
+ import type { ClassNameValue } from 'tailwind-merge';
4
+
5
+ export type Footer1Props = {
6
+ links?: {title : string, items: { text: string, href: string }[]}[];
7
+ title: string;
8
+ logo?: string;
9
+ tagline?: string;
10
+ copyright?: string;
11
+ class?: ClassNameValue;
12
+ };
13
+
14
+ </script>
15
+
16
+ <script lang="ts">
17
+ let { links=[], logo, title, tagline, copyright, ...restProps }: Footer1Props = $props();
18
+
19
+ const year = new Date().getFullYear();
20
+ const facebookSVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 13.5H16.5L17.5 9.5H14V7.5C14 6.47062 14 5.5 16 5.5H17.5V2.1401C17.1743 2.09685 15.943 2 14.6429 2C11.9284 2 10 3.65686 10 6.69971V9.5H7V13.5H10V22H14V13.5Z"></path></svg>`;
21
+ const twitterSVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10.4883 14.651L15.25 21H22.25L14.3917 10.5223L20.9308 3H18.2808L13.1643 8.88578L8.75 3H1.75L9.26086 13.0145L2.31915 21H4.96917L10.4883 14.651ZM16.25 19L5.75 5H7.75L18.25 19H16.25Z"></path></svg>`;
22
+ const instagramSVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.001 9C10.3436 9 9.00098 10.3431 9.00098 12C9.00098 13.6573 10.3441 15 12.001 15C13.6583 15 15.001 13.6569 15.001 12C15.001 10.3427 13.6579 9 12.001 9ZM12.001 7C14.7614 7 17.001 9.2371 17.001 12C17.001 14.7605 14.7639 17 12.001 17C9.24051 17 7.00098 14.7629 7.00098 12C7.00098 9.23953 9.23808 7 12.001 7ZM18.501 6.74915C18.501 7.43926 17.9402 7.99917 17.251 7.99917C16.5609 7.99917 16.001 7.4384 16.001 6.74915C16.001 6.0599 16.5617 5.5 17.251 5.5C17.9393 5.49913 18.501 6.0599 18.501 6.74915ZM12.001 4C9.5265 4 9.12318 4.00655 7.97227 4.0578C7.18815 4.09461 6.66253 4.20007 6.17416 4.38967C5.74016 4.55799 5.42709 4.75898 5.09352 5.09255C4.75867 5.4274 4.55804 5.73963 4.3904 6.17383C4.20036 6.66332 4.09493 7.18811 4.05878 7.97115C4.00703 9.0752 4.00098 9.46105 4.00098 12C4.00098 14.4745 4.00753 14.8778 4.05877 16.0286C4.0956 16.8124 4.2012 17.3388 4.39034 17.826C4.5591 18.2606 4.7605 18.5744 5.09246 18.9064C5.42863 19.2421 5.74179 19.4434 6.17187 19.6094C6.66619 19.8005 7.19148 19.9061 7.97212 19.9422C9.07618 19.9939 9.46203 20 12.001 20C14.4755 20 14.8788 19.9934 16.0296 19.9422C16.8117 19.9055 17.3385 19.7996 17.827 19.6106C18.2604 19.4423 18.5752 19.2402 18.9074 18.9085C19.2436 18.5718 19.4445 18.2594 19.6107 17.8283C19.8013 17.3358 19.9071 16.8098 19.9432 16.0289C19.9949 14.9248 20.001 14.5389 20.001 12C20.001 9.52552 19.9944 9.12221 19.9432 7.97137C19.9064 7.18906 19.8005 6.66149 19.6113 6.17318C19.4434 5.74038 19.2417 5.42635 18.9084 5.09255C18.573 4.75715 18.2616 4.55693 17.8271 4.38942C17.338 4.19954 16.8124 4.09396 16.0298 4.05781C14.9258 4.00605 14.5399 4 12.001 4ZM12.001 2C14.7176 2 15.0568 2.01 16.1235 2.06C17.1876 2.10917 17.9135 2.2775 18.551 2.525C19.2101 2.77917 19.7668 3.1225 20.3226 3.67833C20.8776 4.23417 21.221 4.7925 21.476 5.45C21.7226 6.08667 21.891 6.81333 21.941 7.8775C21.9885 8.94417 22.001 9.28333 22.001 12C22.001 14.7167 21.991 15.0558 21.941 16.1225C21.8918 17.1867 21.7226 17.9125 21.476 18.55C21.2218 19.2092 20.8776 19.7658 20.3226 20.3217C19.7668 20.8767 19.2076 21.22 18.551 21.475C17.9135 21.7217 17.1876 21.89 16.1235 21.94C15.0568 21.9875 14.7176 22 12.001 22C9.28431 22 8.94514 21.99 7.87848 21.94C6.81431 21.8908 6.08931 21.7217 5.45098 21.475C4.79264 21.2208 4.23514 20.8767 3.67931 20.3217C3.12348 19.7658 2.78098 19.2067 2.52598 18.55C2.27848 17.9125 2.11098 17.1867 2.06098 16.1225C2.01348 15.0558 2.00098 14.7167 2.00098 12C2.00098 9.28333 2.01098 8.94417 2.06098 7.8775C2.11014 6.8125 2.27848 6.0875 2.52598 5.45C2.78014 4.79167 3.12348 4.23417 3.67931 3.67833C4.23514 3.1225 4.79348 2.78 5.45098 2.525C6.08848 2.2775 6.81348 2.11 7.87848 2.06C8.94514 2.0125 9.28431 2 12.001 2Z"></path></svg>`;
23
+
24
+ </script>
25
+
26
+ <footer class={twMerge("bg-neutral-900 text-white flex flex-col justify-center items", restProps.class)}>
27
+ <div class="px-4 py-6 w-full max-w-5xl mx-auto flex flex-row flex-wrap gap-7">
28
+
29
+ <!-- Branding -->
30
+ {#if logo || title }
31
+ <div class="space-y-4">
32
+ <div class="flex items-center gap-2">
33
+ {#if logo}<a href="/"><img src={logo} alt="Logo" class="h-8 w-auto" /></a>{/if}
34
+ {#if title}<a href="/"><span class="text-lg font-semibold">{title}</span></a>{/if}
35
+ </div>
36
+ {#if tagline}<p class="text-sm text-neutral-400 w-full max-w-sm">{tagline}</p>{/if}
37
+ </div>
38
+ {/if}
39
+
40
+ <div class="flex flex-row flex-wrap gap-10">
41
+
42
+ {#snippet footerLinks(title: string, items: { text: string, href: string }[])}
43
+ <div class="w-fit">
44
+ <h4 class="text-sm font-semibold mb-3">{title}</h4>
45
+ <ul class="space-y-2 text-sm text-neutral-300">
46
+ {#each items as { text, href }}
47
+ <li><a href={href} class="hover:text-primary-button-hover">{text}</a></li>
48
+ {/each}
49
+ </ul>
50
+ </div>
51
+ {/snippet}
52
+
53
+ {#each links as { title, items }}
54
+ {@render footerLinks(title, items)}
55
+ {/each}
56
+
57
+ <!-- Social & Legal -->
58
+ <div class="space-y-4 w-fit ring bg-red-500/10 hidden">
59
+ <h4 class="text-sm font-semibold">Follow Us</h4>
60
+ <div class="flex gap-4">
61
+ <a href="https://facebook.com" aria-label="Facebook" class="hover:text-primary-button-hover size-5">
62
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M14 13.5H16.5L17.5 9.5H14V7.5C14 6.47062 14 5.5 16 5.5H17.5V2.1401C17.1743 2.09685 15.943 2 14.6429 2C11.9284 2 10 3.65686 10 6.69971V9.5H7V13.5H10V22H14V13.5Z"></path></svg>
63
+ </a>
64
+ <a href="https://x.com" aria-label="X" class="hover:text-primary-button-hover size-5">
65
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10.4883 14.651L15.25 21H22.25L14.3917 10.5223L20.9308 3H18.2808L13.1643 8.88578L8.75 3H1.75L9.26086 13.0145L2.31915 21H4.96917L10.4883 14.651ZM16.25 19L5.75 5H7.75L18.25 19H16.25Z"></path></svg>
66
+ </a>
67
+ <a href="https://instagram.com" aria-label="Instagram" class="hover:text-primary-button-hover size-5">
68
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.001 9C10.3436 9 9.00098 10.3431 9.00098 12C9.00098 13.6573 10.3441 15 12.001 15C13.6583 15 15.001 13.6569 15.001 12C15.001 10.3427 13.6579 9 12.001 9ZM12.001 7C14.7614 7 17.001 9.2371 17.001 12C17.001 14.7605 14.7639 17 12.001 17C9.24051 17 7.00098 14.7629 7.00098 12C7.00098 9.23953 9.23808 7 12.001 7ZM18.501 6.74915C18.501 7.43926 17.9402 7.99917 17.251 7.99917C16.5609 7.99917 16.001 7.4384 16.001 6.74915C16.001 6.0599 16.5617 5.5 17.251 5.5C17.9393 5.49913 18.501 6.0599 18.501 6.74915ZM12.001 4C9.5265 4 9.12318 4.00655 7.97227 4.0578C7.18815 4.09461 6.66253 4.20007 6.17416 4.38967C5.74016 4.55799 5.42709 4.75898 5.09352 5.09255C4.75867 5.4274 4.55804 5.73963 4.3904 6.17383C4.20036 6.66332 4.09493 7.18811 4.05878 7.97115C4.00703 9.0752 4.00098 9.46105 4.00098 12C4.00098 14.4745 4.00753 14.8778 4.05877 16.0286C4.0956 16.8124 4.2012 17.3388 4.39034 17.826C4.5591 18.2606 4.7605 18.5744 5.09246 18.9064C5.42863 19.2421 5.74179 19.4434 6.17187 19.6094C6.66619 19.8005 7.19148 19.9061 7.97212 19.9422C9.07618 19.9939 9.46203 20 12.001 20C14.4755 20 14.8788 19.9934 16.0296 19.9422C16.8117 19.9055 17.3385 19.7996 17.827 19.6106C18.2604 19.4423 18.5752 19.2402 18.9074 18.9085C19.2436 18.5718 19.4445 18.2594 19.6107 17.8283C19.8013 17.3358 19.9071 16.8098 19.9432 16.0289C19.9949 14.9248 20.001 14.5389 20.001 12C20.001 9.52552 19.9944 9.12221 19.9432 7.97137C19.9064 7.18906 19.8005 6.66149 19.6113 6.17318C19.4434 5.74038 19.2417 5.42635 18.9084 5.09255C18.573 4.75715 18.2616 4.55693 17.8271 4.38942C17.338 4.19954 16.8124 4.09396 16.0298 4.05781C14.9258 4.00605 14.5399 4 12.001 4ZM12.001 2C14.7176 2 15.0568 2.01 16.1235 2.06C17.1876 2.10917 17.9135 2.2775 18.551 2.525C19.2101 2.77917 19.7668 3.1225 20.3226 3.67833C20.8776 4.23417 21.221 4.7925 21.476 5.45C21.7226 6.08667 21.891 6.81333 21.941 7.8775C21.9885 8.94417 22.001 9.28333 22.001 12C22.001 14.7167 21.991 15.0558 21.941 16.1225C21.8918 17.1867 21.7226 17.9125 21.476 18.55C21.2218 19.2092 20.8776 19.7658 20.3226 20.3217C19.7668 20.8767 19.2076 21.22 18.551 21.475C17.9135 21.7217 17.1876 21.89 16.1235 21.94C15.0568 21.9875 14.7176 22 12.001 22C9.28431 22 8.94514 21.99 7.87848 21.94C6.81431 21.8908 6.08931 21.7217 5.45098 21.475C4.79264 21.2208 4.23514 20.8767 3.67931 20.3217C3.12348 19.7658 2.78098 19.2067 2.52598 18.55C2.27848 17.9125 2.11098 17.1867 2.06098 16.1225C2.01348 15.0558 2.00098 14.7167 2.00098 12C2.00098 9.28333 2.01098 8.94417 2.06098 7.8775C2.11014 6.8125 2.27848 6.0875 2.52598 5.45C2.78014 4.79167 3.12348 4.23417 3.67931 3.67833C4.23514 3.1225 4.79348 2.78 5.45098 2.525C6.08848 2.2775 6.81348 2.11 7.87848 2.06C8.94514 2.0125 9.28431 2 12.001 2Z"></path></svg>
69
+ </a>
70
+ </div>
71
+
72
+ <ul class="text-sm text-neutral-300 space-y-1">
73
+ <li><a href="/privacy" class="hover:text-primary-button-hover">Privacy Policy</a></li>
74
+ <li><a href="/terms" class="hover:text-primary-button-hover">Terms of Service</a></li>
75
+ </ul>
76
+ </div>
77
+ </div>
78
+ </div>
79
+
80
+ <div class="text-center text-sm text-neutral-300 py-4 border-t border-neutral-700">{copyright}</div>
81
+ </footer>
@@ -0,0 +1,18 @@
1
+ import type { ClassNameValue } from 'tailwind-merge';
2
+ export type Footer1Props = {
3
+ links?: {
4
+ title: string;
5
+ items: {
6
+ text: string;
7
+ href: string;
8
+ }[];
9
+ }[];
10
+ title: string;
11
+ logo?: string;
12
+ tagline?: string;
13
+ copyright?: string;
14
+ class?: ClassNameValue;
15
+ };
16
+ declare const Footer1: import("svelte").Component<Footer1Props, {}, "">;
17
+ type Footer1 = ReturnType<typeof Footer1>;
18
+ export default Footer1;
@@ -0,0 +1 @@
1
+ export { default as Footer1 } from './Footer1.svelte';
@@ -0,0 +1 @@
1
+ export { default as Footer1 } from './Footer1.svelte';
@@ -0,0 +1,94 @@
1
+ <script lang="ts" module>
2
+ import type { ClassNameValue } from 'tailwind-merge';
3
+
4
+ export type Header1Props = {
5
+ title: string;
6
+ logo?: string;
7
+ links?: { text : string, href: string}[];
8
+ cartLink?: string;
9
+ accountLink?: string;
10
+ class?: ClassNameValue;
11
+ };
12
+
13
+ </script>
14
+
15
+ <script lang="ts">
16
+ import { HamburgerMenu, onKeydown, Overlay } from "../../../index.js";
17
+ import { fly } from 'svelte/transition';
18
+ import { twMerge } from "tailwind-merge";
19
+
20
+ let { logo, title, links=[], cartLink, accountLink, ...restProps }: Header1Props = $props();
21
+
22
+ let mobileMenuOpen = $state(false);
23
+
24
+ function closeMobileMenu() {
25
+ mobileMenuOpen = false;
26
+ };
27
+
28
+ </script>
29
+
30
+ <header class="px-4 shadow-sm">
31
+
32
+ <div class={twMerge("flex min-h-16 justify-between items-center w-full max-w-7xl mx-auto", restProps.class)}>
33
+ {#if logo || title}
34
+ <div class="flex items-center gap-2">
35
+ {#if logo}<a href="/"><img src={logo} alt="Logo" class="h-8 w-auto" /></a>{/if}
36
+ {#if title}<a href="/"><span class="text-lg font-semibold">{title}</span></a>{/if}
37
+ </div>
38
+ {/if}
39
+
40
+ {#if links}
41
+ <nav class="hidden md:flex gap-6 text-base font-medium text-neutral-700">
42
+ {#each links as { text, href } }
43
+ <a href={href} class="hover:text-primary-button-hover">{text}</a>
44
+ {/each}
45
+ </nav>
46
+ {/if}
47
+
48
+ {#if cartLink || accountLink}
49
+ <div class="flex items-center gap-4">
50
+ <a href={cartLink} class="text-neutral-700 hover:text-primary-button-hover size-6" aria-label="Shopping Cart">
51
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
52
+ <path d="M6.00488 9H19.9433L20.4433 7H8.00488V5H21.7241C22.2764 5 22.7241 5.44772 22.7241 6C22.7241 6.08176 22.7141
53
+ 6.16322 22.6942 6.24254L20.1942 16.2425C20.083 16.6877 19.683 17 19.2241 17H5.00488C4.4526 17 4.00488 16.5523 4.00488
54
+ 16V4H2.00488V2H5.00488C5.55717 2 6.00488 2.44772 6.00488 3V9ZM6.00488 23C4.90031 23 4.00488 22.1046 4.00488 21C4.00488
55
+ 19.8954 4.90031 19 6.00488 19C7.10945 19 8.00488 19.8954 8.00488 21C8.00488 22.1046 7.10945 23 6.00488 23ZM18.0049
56
+ 23C16.9003 23 16.0049 22.1046 16.0049 21C16.0049 19.8954 16.9003 19 18.0049 19C19.1095 19 20.0049 19.8954 20.0049
57
+ 21C20.0049 22.1046 19.1095 23 18.0049 23Z">
58
+ </path>
59
+ </svg>
60
+ </a>
61
+ <a href={accountLink} aria-label="Account" class="text-neutral-700 hover:text-primary-button-hover size-6">
62
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
63
+ <path d="M4 22C4 17.5817 7.58172 14 12 14C16.4183 14 20 17.5817 20 22H18C18 18.6863 15.3137 16 12 16C8.68629 16 6
64
+ 18.6863 6 22H4ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12
65
+ 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11Z">
66
+ </path>
67
+ </svg>
68
+ </a>
69
+ <HamburgerMenu bind:open={mobileMenuOpen} onclick={() => (mobileMenuOpen = !mobileMenuOpen)} class="md:hidden"/>
70
+ </div>
71
+ {/if}
72
+
73
+ </div>
74
+
75
+ {#if mobileMenuOpen}
76
+ <Overlay transitionDuration={150} onclick={()=> mobileMenuOpen = false} />
77
+ <div transition:fly={{ duration: 150, x: -64 }} class="w-64 fixed top-0 bottom-0 left-0 h-fit rounded-b shadow-primary overflow-y-auto" use:onKeydown={{ key: 'Escape', callback: closeMobileMenu }}>
78
+
79
+ {#if logo || title}
80
+ <div class="text-neutral-700 border-b-2 border-neutral-100 bg-white gap-3 flex flex-row items-center h-16 shadow-2xl px-4">
81
+ {#if logo}<img src={logo} alt="Logo" class="size-8" />{/if}
82
+ {#if title}<span class="text-lg font-bold text-neutral-800">{title}</span>{/if}
83
+ </div>
84
+ {/if}
85
+
86
+ <nav class="flex flex-col items-start text-white text-base min-h-screen bg-white shadow-primary px-2 pt-2">
87
+ {#each links as { text, href } }
88
+ <a {href} class="py-2 text-neutral-700 hover:bg-primary-100 px-4 rounded-primary w-full" onclick={closeMobileMenu}>{text}</a>
89
+ {/each}
90
+ </nav>
91
+ </div>
92
+ {/if}
93
+
94
+ </header>
@@ -0,0 +1,15 @@
1
+ import type { ClassNameValue } from 'tailwind-merge';
2
+ export type Header1Props = {
3
+ title: string;
4
+ logo?: string;
5
+ links?: {
6
+ text: string;
7
+ href: string;
8
+ }[];
9
+ cartLink?: string;
10
+ accountLink?: string;
11
+ class?: ClassNameValue;
12
+ };
13
+ declare const Header1: import("svelte").Component<Header1Props, {}, "">;
14
+ type Header1 = ReturnType<typeof Header1>;
15
+ export default Header1;
@@ -0,0 +1 @@
1
+ export { default as Header1 } from './Header1.svelte';
@@ -0,0 +1 @@
1
+ export { default as Header1 } from './Header1.svelte';
@@ -0,0 +1,42 @@
1
+ <script lang="ts" module>
2
+ import type { ClassNameValue } from 'tailwind-merge';
3
+
4
+ export type ProductFilter1List = {
5
+ title: string;
6
+ values: ProductFilter1Value[];
7
+ };
8
+
9
+ export type ProductFilter1Value = {
10
+ key: string;
11
+ value: string;
12
+ count?: number;
13
+ };
14
+
15
+ export type ProductFilter1Props = {
16
+ filters: ProductFilter1List[];
17
+ path?: string;
18
+ startExpanded?: boolean;
19
+ expandAlways?: boolean;
20
+ selectedValues?: {key: string, value: string}[];
21
+ showCounts?: boolean;
22
+ onFilter?: (key: string, value: string) => void;
23
+ class?: ClassNameValue;
24
+ };
25
+
26
+ </script>
27
+
28
+ <script lang="ts">
29
+ import { twMerge } from "tailwind-merge";
30
+ import ProductFilterBlock from './ProductFilterBlock.svelte';
31
+
32
+ let { filters=$bindable([]), expandAlways=false, startExpanded=true, selectedValues=$bindable([]), showCounts=false, path="/products", onFilter, ...restProps }: ProductFilter1Props = $props();
33
+
34
+ </script>
35
+
36
+ <div class={twMerge("", restProps.class)}>
37
+ <div class={twMerge("w-64 flex flex-col space-y-4 p-2 divide-y divide-neutral-300")}>
38
+ {#each filters as filter}
39
+ <ProductFilterBlock filter={filter} open={startExpanded} {expandAlways} {onFilter} bind:selectedValues {showCounts} />
40
+ {/each}
41
+ </div>
42
+ </div>
@@ -0,0 +1,26 @@
1
+ import type { ClassNameValue } from 'tailwind-merge';
2
+ export type ProductFilter1List = {
3
+ title: string;
4
+ values: ProductFilter1Value[];
5
+ };
6
+ export type ProductFilter1Value = {
7
+ key: string;
8
+ value: string;
9
+ count?: number;
10
+ };
11
+ export type ProductFilter1Props = {
12
+ filters: ProductFilter1List[];
13
+ path?: string;
14
+ startExpanded?: boolean;
15
+ expandAlways?: boolean;
16
+ selectedValues?: {
17
+ key: string;
18
+ value: string;
19
+ }[];
20
+ showCounts?: boolean;
21
+ onFilter?: (key: string, value: string) => void;
22
+ class?: ClassNameValue;
23
+ };
24
+ declare const ProductFilter1: import("svelte").Component<ProductFilter1Props, {}, "filters" | "selectedValues">;
25
+ type ProductFilter1 = ReturnType<typeof ProductFilter1>;
26
+ export default ProductFilter1;
@@ -0,0 +1,49 @@
1
+
2
+
3
+ <script lang="ts">
4
+ import Checkbox from "../../../components/checkbox/Checkbox.svelte";
5
+ import { twMerge, type ClassNameValue } from "tailwind-merge";
6
+ //import { twMerge } from "tailwind-merge";
7
+ import type { ProductFilter1List } from "./ProductFilter1.svelte";
8
+ import { slide } from "svelte/transition";
9
+
10
+ let { open=$bindable(false), filter=$bindable(), expandAlways=false, showCounts=true, countsClass, selectedValues=$bindable([]), onFilter }:
11
+ {open?: boolean, filter: ProductFilter1List, expandAlways?: boolean, showCounts?: boolean, countsClass?: ClassNameValue, selectedValues?: {key: string, value: string}[], onFilter?: (key: string, value: string) => void } = $props();
12
+
13
+ /*let hasKeyValue = $derived.by(() => {
14
+ return selectedValues?.some(item => item.key === filter.title && item.value === value);
15
+ }); */
16
+
17
+ function hasSelectedValue(arr: { key: string; value: string }[] | undefined, key: string, value: string): boolean {
18
+ return !!arr?.some(item => item.key === key && item.value === value);
19
+ }
20
+
21
+
22
+ </script>
23
+
24
+ <div class="flex flex-col gap-4 pb-4">
25
+ <button class="flex flex-row justify-between items-center ml-1 cursor-pointer" onclick={() => open = !open}>
26
+ <h4 class="truncate font-medium text-neutral-700">{filter.title}</h4>
27
+ {#if !expandAlways}
28
+ {#if open}
29
+ <svg xmlns="http://www.w3.org/2000/svg" class="size-5 text-neutral-500" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11V13H19V11H5Z"></path></svg>
30
+ {:else}
31
+ <svg xmlns="http://www.w3.org/2000/svg" class="size-5 text-neutral-500" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>
32
+ {/if}
33
+ {/if}
34
+ </button>
35
+
36
+ {#if open}
37
+ <div transition:slide={{ duration: 100, axis: "y" }} class="flex flex-col gap-2 ml-1.5">
38
+ {#each filter.values as keyValue}
39
+ {@const isChecked = hasSelectedValue(selectedValues, filter.title, keyValue.value)}
40
+ <div class="flex flex-row gap-2 items-center">
41
+ <Checkbox checked={isChecked} id={keyValue.key} value={keyValue.value} label={keyValue.value} class="size-4" onchange={()=> onFilter?.(filter.title, keyValue.value)} />
42
+ {#if showCounts}
43
+ <p class={twMerge("text-sm", countsClass)}>({keyValue.count})</p>
44
+ {/if}
45
+ </div>
46
+ {/each}
47
+ </div>
48
+ {/if}
49
+ </div>
@@ -0,0 +1,17 @@
1
+ import { type ClassNameValue } from "tailwind-merge";
2
+ import type { ProductFilter1List } from "./ProductFilter1.svelte";
3
+ type $$ComponentProps = {
4
+ open?: boolean;
5
+ filter: ProductFilter1List;
6
+ expandAlways?: boolean;
7
+ showCounts?: boolean;
8
+ countsClass?: ClassNameValue;
9
+ selectedValues?: {
10
+ key: string;
11
+ value: string;
12
+ }[];
13
+ onFilter?: (key: string, value: string) => void;
14
+ };
15
+ declare const ProductFilterBlock: import("svelte").Component<$$ComponentProps, {}, "open" | "filter" | "selectedValues">;
16
+ type ProductFilterBlock = ReturnType<typeof ProductFilterBlock>;
17
+ export default ProductFilterBlock;
@@ -0,0 +1 @@
1
+ export { default as ProductFilter1 } from './ProductFilter1.svelte';
@@ -0,0 +1 @@
1
+ export { default as ProductFilter1 } from './ProductFilter1.svelte';
@@ -0,0 +1,76 @@
1
+ <script lang="ts" module>
2
+ import { Button } from '../../../components/button/index.js';
3
+ import type { ClassNameValue } from 'tailwind-merge';
4
+
5
+ export type Product = {
6
+ uid: string;
7
+ title: string;
8
+ description?: string;
9
+ price: string;
10
+ price_compare?: string;
11
+ image: string;
12
+ badges?: string[];
13
+ swatches?: string[];
14
+ }
15
+
16
+ export type ProductList1Props = {
17
+ products: Product[];
18
+ titleClass?: ClassNameValue;
19
+ imageClass?: ClassNameValue;
20
+ priceClass?: ClassNameValue;
21
+ priceCompareClass?: ClassNameValue;
22
+ onShowMore?: () => void;
23
+ onAddToCart?: (product: Product) => void;
24
+ class?: ClassNameValue;
25
+ };
26
+
27
+ </script>
28
+
29
+ <script lang="ts">
30
+ import { twMerge } from "tailwind-merge";
31
+ let { products, titleClass, imageClass, priceClass, priceCompareClass, onShowMore, onAddToCart, ...restProps }: ProductList1Props = $props();
32
+
33
+ </script>
34
+
35
+ <section class="flex flex-col gap-16">
36
+ <div class="mx-auto p-2">
37
+ <div class={twMerge("grid [grid-template-columns:repeat(auto-fit,minmax(260px,1fr))] gap-4 mx-auto", restProps.class)}>
38
+ {#each products as product}
39
+ <div class="border border-primary-card-border shadow-primary rounded-primary overflow-hidden bg-white">
40
+ <a href="/products/{product.uid}" class="aspect-[4/3] rounded-primary">
41
+ <img src={product.image} alt={product.title} class={twMerge("object-cover w-full h-[250px]", imageClass)} />
42
+ </a>
43
+ <div class="p-3 flex flex-col gap-2">
44
+ <h3 class={twMerge("text-base font-medium", titleClass)}>{product.title}</h3>
45
+ <p class={twMerge("text-sm font-normal line-clamp-3", titleClass)}>{product.description}</p>
46
+ <div class="mt-1 flex items-center gap-2">
47
+ <span class={twMerge("font-semibold", priceClass)}>${product.price}</span>
48
+ {#if product.price_compare}
49
+ <span class={twMerge("text-base text-neutral-500 line-through", priceCompareClass)}>${product.price_compare}</span>
50
+ {/if}
51
+ </div>
52
+ </div>
53
+ <Button class="py-1 w-full !rounded-none text-white text-sm justify-center" onclick={()=> {onAddToCart?.(product)}}>
54
+ {#snippet icon()}
55
+ <svg xmlns="http://www.w3.org/2000/svg" class="size-5" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>
56
+ {/snippet}
57
+ Add to cart
58
+ </Button>
59
+ </div>
60
+ {/each}
61
+ </div>
62
+ </div>
63
+
64
+
65
+ <Button class="py-2 px-4 w-fit text-white text-sm justify-center mx-auto font-semibold" onclick={onShowMore}>
66
+ {#snippet loadingIcon()}
67
+ <svg xmlns="http://www.w3.org/2000/svg" class="size-5" viewBox="0 0 24 24" fill="currentColor"><path d="M3.05469 13H5.07065C5.55588 16.3923 8.47329 19 11.9998 19C15.5262 19 18.4436 16.3923 18.9289 13H20.9448C20.4474 17.5 16.6323 21 11.9998 21C7.36721 21 3.55213 17.5 3.05469 13ZM3.05469 11C3.55213 6.50005 7.36721 3 11.9998 3C16.6323 3 20.4474 6.50005 20.9448 11H18.9289C18.4436 7.60771 15.5262 5 11.9998 5C8.47329 5 5.55588 7.60771 5.07065 11H3.05469Z"></path></svg>
68
+ {/snippet}
69
+
70
+ {#snippet icon()}
71
+ <svg xmlns="http://www.w3.org/2000/svg" class="size-5" viewBox="0 0 24 24" fill="currentColor"><path d="M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"></path></svg>
72
+ {/snippet}
73
+ Show More
74
+ </Button>
75
+
76
+ </section>
@@ -0,0 +1,24 @@
1
+ import type { ClassNameValue } from 'tailwind-merge';
2
+ export type Product = {
3
+ uid: string;
4
+ title: string;
5
+ description?: string;
6
+ price: string;
7
+ price_compare?: string;
8
+ image: string;
9
+ badges?: string[];
10
+ swatches?: string[];
11
+ };
12
+ export type ProductList1Props = {
13
+ products: Product[];
14
+ titleClass?: ClassNameValue;
15
+ imageClass?: ClassNameValue;
16
+ priceClass?: ClassNameValue;
17
+ priceCompareClass?: ClassNameValue;
18
+ onShowMore?: () => void;
19
+ onAddToCart?: (product: Product) => void;
20
+ class?: ClassNameValue;
21
+ };
22
+ declare const ProductList1: import("svelte").Component<ProductList1Props, {}, "">;
23
+ type ProductList1 = ReturnType<typeof ProductList1>;
24
+ export default ProductList1;
@@ -0,0 +1 @@
1
+ export { default as ProductList1 } from './ProductList1.svelte';
@@ -0,0 +1 @@
1
+ export { default as ProductList1 } from './ProductList1.svelte';
@@ -0,0 +1,51 @@
1
+ <script lang="ts" module>
2
+ import Select from '../../../components/select/Select.svelte';
3
+ import Breadcrumbs1 from '../../breadcrumbs/breadcrumbs-1/Breadcrumbs1.svelte';
4
+ import type { ClassNameValue } from 'tailwind-merge';
5
+
6
+ export type ProductListNavigation1Props = {
7
+ filters: { key: string; value: string }[];
8
+ searchTerm: string;
9
+ class?: ClassNameValue;
10
+ };
11
+
12
+ /*let filters = $state([
13
+ { key: 'brand', value: 'Nike' },
14
+ { key: 'category', value: 'Shoes' },
15
+ { key: 'size', value: '10' },
16
+ { key: 'color', value: 'Red' },
17
+ { key: 'material', value: 'Leather' },
18
+ { key: 'style', value: 'Sporty' },
19
+ { key: 'fitadjjadjadkjadkjadlkjadlkad', value: 'Regularad;kjadkadjkadjadlkjadlkjadlkjad' },
20
+ { key: 'length', value: 'Medium' },
21
+ { key: 'width', value: 'Standard' },
22
+ { key: 'height', value: 'Regular' }
23
+ ]);*/
24
+
25
+ </script>
26
+
27
+ <script lang="ts">
28
+ import { twMerge } from "tailwind-merge";
29
+
30
+ let { filters=$bindable([]), searchTerm=$bindable(""), ...restProps }: ProductListNavigation1Props = $props();
31
+
32
+ function removeFilter(key: string, value: string) {
33
+ filters = filters.filter(f => !(f.key === key && f.value === value));
34
+ }
35
+
36
+ function clearFilters() {
37
+ filters = [];
38
+ }
39
+
40
+ </script>
41
+
42
+ <section class={twMerge("min-h-10 px-2 flex flex-row flex-wrap justify-between gap-10", restProps.class)}>
43
+ <div class="flex flex-row gap-2 items-center justify-end w-full">
44
+ <button class="cursor-pointer px-2 sm:hidden" aria-label="Filter Product List">
45
+ <svg xmlns="http://www.w3.org/2000/svg" class="size-7 text-neutral-600" viewBox="0 0 24 24" fill="currentColor">
46
+ <path d="M10 14L4 5V3H20V5L14 14V20L10 22V14Z"></path>
47
+ </svg>
48
+ </button>
49
+
50
+ </div>
51
+ </section>
@@ -0,0 +1,12 @@
1
+ import type { ClassNameValue } from 'tailwind-merge';
2
+ export type ProductListNavigation1Props = {
3
+ filters: {
4
+ key: string;
5
+ value: string;
6
+ }[];
7
+ searchTerm: string;
8
+ class?: ClassNameValue;
9
+ };
10
+ declare const ProductListNavigation1: import("svelte").Component<ProductListNavigation1Props, {}, "filters" | "searchTerm">;
11
+ type ProductListNavigation1 = ReturnType<typeof ProductListNavigation1>;
12
+ export default ProductListNavigation1;
@@ -0,0 +1 @@
1
+ export { default as ProductListNavigation1 } from './ProductListNavigation1.svelte';
@@ -0,0 +1 @@
1
+ export { default as ProductListNavigation1 } from './ProductListNavigation1.svelte';
@@ -0,0 +1,46 @@
1
+ <script lang="ts" module>
2
+ import TextInput from '../../components/text-input/TextInput.svelte';
3
+ import type { ClassNameValue } from 'tailwind-merge';
4
+
5
+ export type ProductListNavigation1Props = {
6
+ searchTerm?: string;
7
+ firstDivClass?: string;
8
+ secondDivClass?: string;
9
+ thirdDivClass?: string;
10
+ class?: ClassNameValue;
11
+ onclick?: (event: Event) => void;
12
+ onInput?: (value: string) => void;
13
+ };
14
+
15
+ </script>
16
+
17
+ <script lang="ts">
18
+ import { twMerge } from "tailwind-merge";
19
+
20
+ let { searchTerm = $bindable(""), firstDivClass, secondDivClass, thirdDivClass, onclick, onInput, ...restProps }: ProductListNavigation1Props = $props();
21
+
22
+ </script>
23
+
24
+ <TextInput id="searchBox" placeholder="Product search..." bind:value={searchTerm} type="search" {onInput} {firstDivClass} {secondDivClass} {thirdDivClass} class={"pl-3 " + restProps.class} autocomplete="off">
25
+
26
+ <!--{#snippet leftIcon()}
27
+ <button aria-label="Search" class="w-fit ml-2 h-full hover:bg-primary-100 cursor-pointer hidden" {onclick}>
28
+ <svg xmlns="http://www.w3.org/2000/svg" class="size-5 mx-auto text-neutral-400" viewBox="0 0 256 256">
29
+ <rect width="256" height="256" fill="none"/>
30
+ <circle cx="112" cy="112" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
31
+ <line x1="168.57" y1="168.57" x2="224" y2="224" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
32
+ </svg>
33
+ </button>
34
+ {/snippet}
35
+ -->
36
+
37
+ {#snippet rightIcon()}
38
+ <button aria-label="Search" class="size-10 hover:bg-primary-100 border-l-2 border-primary-500 cursor-pointer" {onclick}>
39
+ <svg xmlns="http://www.w3.org/2000/svg" class="size-5 mx-auto text-neutral-400" viewBox="0 0 256 256">
40
+ <rect width="256" height="256" fill="none"/>
41
+ <circle cx="112" cy="112" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
42
+ <line x1="168.57" y1="168.57" x2="224" y2="224" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
43
+ </svg>
44
+ </button>
45
+ {/snippet}
46
+ </TextInput>
@@ -0,0 +1,13 @@
1
+ import type { ClassNameValue } from 'tailwind-merge';
2
+ export type ProductListNavigation1Props = {
3
+ searchTerm?: string;
4
+ firstDivClass?: string;
5
+ secondDivClass?: string;
6
+ thirdDivClass?: string;
7
+ class?: ClassNameValue;
8
+ onclick?: (event: Event) => void;
9
+ onInput?: (value: string) => void;
10
+ };
11
+ declare const Searchbox: import("svelte").Component<ProductListNavigation1Props, {}, "searchTerm">;
12
+ type Searchbox = ReturnType<typeof Searchbox>;
13
+ export default Searchbox;
@@ -0,0 +1 @@
1
+ export { default as Searchbox } from './Searchbox.svelte';
@@ -0,0 +1 @@
1
+ export { default as Searchbox } from './Searchbox.svelte';
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hashrytech/quick-components-kit.git"
7
7
  },
8
- "version": "0.18.0",
8
+ "version": "0.19.0",
9
9
  "license": "MIT",
10
10
  "author": "Hashry Tech",
11
11
  "files": [