@arcblock/ux 2.12.0 → 2.12.1

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 (56) hide show
  1. package/lib/Header/demo/images/boards.svg +3 -0
  2. package/lib/Header/demo/images/chatbot.svg +3 -0
  3. package/lib/Header/demo/images/gallery.svg +3 -0
  4. package/lib/NavMenu/images/OCAP.svg +16 -0
  5. package/lib/NavMenu/images/abt-network.svg +18 -0
  6. package/lib/NavMenu/images/ai-kit.svg +46 -0
  7. package/lib/NavMenu/images/aigne.svg +8 -0
  8. package/lib/NavMenu/images/aistro.svg +14 -0
  9. package/lib/NavMenu/images/blocklet-framework.svg +25 -0
  10. package/lib/NavMenu/images/blocklet-launcher.svg +9 -0
  11. package/lib/NavMenu/images/blocklet-server.svg +19 -0
  12. package/lib/NavMenu/images/blocklet-store.svg +11 -0
  13. package/lib/NavMenu/images/creator-studio.svg +42 -0
  14. package/lib/NavMenu/images/did-connect.svg +26 -0
  15. package/lib/NavMenu/images/did-name-service.svg +3 -0
  16. package/lib/NavMenu/images/did-wallet.svg +33 -0
  17. package/lib/NavMenu/images/did.svg +3 -0
  18. package/lib/NavMenu/images/nft-studio.svg +19 -0
  19. package/lib/NavMenu/images/vc.svg +7 -0
  20. package/lib/NavMenu/images/web3-kit.svg +56 -0
  21. package/lib/NavMenu/index.d.ts +1 -0
  22. package/lib/NavMenu/index.js +2 -1
  23. package/lib/NavMenu/nav-menu-context.d.ts +17 -0
  24. package/lib/NavMenu/nav-menu-context.js +19 -0
  25. package/lib/NavMenu/nav-menu.d.ts +10 -5
  26. package/lib/NavMenu/nav-menu.js +76 -36
  27. package/lib/NavMenu/products.d.ts +5 -0
  28. package/lib/NavMenu/products.js +1639 -0
  29. package/lib/NavMenu/style.d.ts +8 -3
  30. package/lib/NavMenu/style.js +215 -175
  31. package/lib/NavMenu/sub-item-group.d.ts +5 -0
  32. package/lib/NavMenu/sub-item-group.js +44 -0
  33. package/package.json +5 -5
  34. package/src/NavMenu/images/OCAP.svg +16 -0
  35. package/src/NavMenu/images/abt-network.svg +18 -0
  36. package/src/NavMenu/images/ai-kit.svg +46 -0
  37. package/src/NavMenu/images/aigne.svg +8 -0
  38. package/src/NavMenu/images/aistro.svg +14 -0
  39. package/src/NavMenu/images/blocklet-framework.svg +25 -0
  40. package/src/NavMenu/images/blocklet-launcher.svg +9 -0
  41. package/src/NavMenu/images/blocklet-server.svg +19 -0
  42. package/src/NavMenu/images/blocklet-store.svg +11 -0
  43. package/src/NavMenu/images/creator-studio.svg +42 -0
  44. package/src/NavMenu/images/did-connect.svg +26 -0
  45. package/src/NavMenu/images/did-name-service.svg +3 -0
  46. package/src/NavMenu/images/did-wallet.svg +33 -0
  47. package/src/NavMenu/images/did.svg +3 -0
  48. package/src/NavMenu/images/nft-studio.svg +19 -0
  49. package/src/NavMenu/images/vc.svg +7 -0
  50. package/src/NavMenu/images/web3-kit.svg +56 -0
  51. package/src/NavMenu/index.ts +1 -0
  52. package/src/NavMenu/nav-menu-context.tsx +30 -0
  53. package/src/NavMenu/nav-menu.tsx +98 -61
  54. package/src/NavMenu/products.tsx +378 -0
  55. package/src/NavMenu/style.ts +220 -183
  56. package/src/NavMenu/sub-item-group.tsx +36 -0
@@ -0,0 +1,3 @@
1
+ <svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M255.755 462.967C299.832 442.833 336.333 409.027 359.852 366.983C327.934 353.201 292.741 345.565 255.755 345.565C247.188 345.565 238.717 345.975 230.361 346.776L167.308 360.816C162.011 362.708 156.792 364.766 151.658 366.983C175.177 409.027 211.678 442.833 255.755 462.967ZM255.755 153.973C290.371 153.973 323.417 147.285 353.676 135.129C330.169 97.9025 296.143 67.9742 255.755 49.5256C215.367 67.9743 181.341 97.9025 157.834 135.129C188.092 147.285 221.137 153.973 255.755 153.973ZM307.765 54.5489C334.213 73.7632 356.736 98.0527 373.902 125.987C383.969 120.912 393.665 115.208 402.939 108.928C377.033 83.0455 344.343 63.9534 307.765 54.5489ZM256.835 26.0038C256.476 25.8547 256.116 25.7064 255.755 25.559C255.394 25.7064 255.034 25.8547 254.675 26.0038C128.011 26.5856 25.5098 129.446 25.5098 256.246C25.5098 383.047 128.011 485.907 254.675 486.489C255.034 486.638 255.394 486.786 255.755 486.934C256.115 486.786 256.476 486.638 256.835 486.489C383.499 485.907 486 383.047 486 256.246C486 129.446 383.499 26.5858 256.835 26.0038ZM307.765 457.944C347.911 447.622 383.375 425.63 410.324 395.799C400.599 388.715 390.369 382.282 379.699 376.565C361.946 408.694 337.304 436.484 307.765 457.944ZM424.211 378.699C449.236 344.332 464 302.013 464 256.246C464 206.69 446.69 161.177 417.786 125.423C407.218 132.746 396.13 139.372 384.588 145.235C401.252 178.661 410.626 216.359 410.626 256.246C410.626 292.046 403.075 326.082 389.48 356.848C401.606 363.308 413.21 370.618 424.211 378.699ZM203.745 457.944C174.206 436.484 149.564 408.694 131.811 376.565C121.141 382.282 110.911 388.715 101.185 395.799C128.135 425.63 163.599 447.622 203.745 457.944ZM87.299 378.7C98.3002 370.618 109.904 363.308 122.03 356.848C108.435 326.081 100.884 292.046 100.884 256.246C100.884 216.359 110.258 178.661 126.922 145.235C115.38 139.372 104.292 132.746 93.7235 125.423C64.8199 161.177 47.5098 206.69 47.5098 256.246C47.5098 302.013 62.2738 344.332 87.299 378.7ZM108.571 108.927C134.477 83.0454 167.167 63.9532 203.745 54.5488C177.297 73.7632 154.774 98.0527 137.608 125.987C127.541 120.912 117.845 115.208 108.571 108.927ZM269.649 193.786L282.837 186.172H330.843V327.034H283.105C282.929 327.034 282.757 326.988 282.605 326.9L231.235 297.242V215.965L237.351 212.434L248.118 218.651L242.003 222.181V291.025L285.722 316.266H320.075V196.94H285.722L280.417 200.003L269.649 193.786ZM275.698 222.181V291.025L269.599 294.546L280.367 300.763L286.466 297.242V215.965L234.864 186.172H186.858V327.034H234.864L248.068 319.411L237.3 313.194L231.979 316.266H197.626V196.94H231.979L275.698 222.181Z" fill="#3773F2"></path>
3
+ </svg>
@@ -0,0 +1,33 @@
1
+ <svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="9" y="9" width="102" height="102" rx="12" fill="url(#paint0_linear_3301_9425)"></rect>
3
+ <mask id="mask0_3301_9425" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="9" y="9" width="102" height="102">
4
+ <rect x="9" y="9" width="102" height="102" rx="12" fill="white"></rect>
5
+ </mask>
6
+ <g mask="url(#mask0_3301_9425)">
7
+ <rect x="9" y="9" width="102" height="102" rx="12" fill="url(#paint1_linear_3301_9425)"></rect>
8
+ <path d="M20.22 32.2688C20.22 27.8678 23.7877 24.3 28.1887 24.3H91.8112C96.2122 24.3 99.78 27.8678 99.78 32.2688V71.4113C99.78 75.8123 96.2122 79.3801 91.8112 79.3801H28.1887C23.7877 79.3801 20.22 75.8123 20.22 71.4113V32.2688Z" fill="#9FCBFF"></path>
9
+ <path d="M17.16 38.3888C17.16 33.9878 20.7278 30.42 25.1288 30.42H94.8713C99.2723 30.42 102.84 33.9878 102.84 38.3888V82.1213C102.84 86.5223 99.2723 90.09 94.8713 90.09H25.1288C20.7278 90.09 17.16 86.5223 17.16 82.1213V38.3888Z" fill="url(#paint2_linear_3301_9425)"></path>
10
+ <path d="M9 80.145L111 60.51V99C111 105.627 105.627 111 99 111H21C14.3726 111 9 105.627 9 99V80.145Z" fill="url(#paint3_linear_3301_9425)"></path>
11
+ </g>
12
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M21.8401 54.1526V39.4412H29.6212C31.6012 39.577 33.1488 41.2274 33.1488 43.2234V50.3614C33.1488 52.4552 31.4515 54.1526 29.3576 54.1526H21.8401ZM38.0412 39.4412H36.0209V54.175H38.0412V39.4412ZM23.8604 52.1323V41.4524H29.3576C30.3356 41.4524 31.1285 42.2453 31.1285 43.2233V50.3613C31.1285 51.3394 30.3356 52.1323 29.3576 52.1323H23.8604ZM40.8792 39.4412V54.1526H48.3967C50.4906 54.1526 52.188 52.4552 52.188 50.3614V43.2234C52.188 41.2274 50.6404 39.577 48.6603 39.4412H40.8792ZM54.759 42.8551H57.0177V45.1138H54.759V42.8551ZM57.0177 48.5023H54.759V50.761H57.0177V48.5023ZM42.8995 41.4524V52.1323H48.3967C49.3748 52.1323 50.1676 51.3394 50.1676 50.3613V43.2233C50.1676 42.2453 49.3748 41.4524 48.3967 41.4524H42.8995Z" fill="#4598FA"></path>
13
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M92.6519 87.2083V96.4742L91.8311 96.9482L93.2804 97.7849L94.1012 97.311V86.3716L87.1559 82.3617H80.6946V101.321H87.1559L88.9331 100.295L87.4838 99.458L86.7676 99.8716H82.1439V83.811H86.7676L92.6519 87.2083ZM93.6127 82.3617L91.8377 83.3865L93.287 84.2232L94.001 83.811H98.6248V99.8716H94.001L88.1167 96.4742V87.2083L88.9398 86.7331L87.4905 85.8964L86.6674 86.3716V97.311L93.3737 101.183C93.5303 101.273 93.7079 101.321 93.8887 101.321H100.074V82.3617H93.6127Z" fill="white"></path>
14
+ <defs>
15
+ <linearGradient id="paint0_linear_3301_9425" x1="9" y1="9" x2="9" y2="111" gradientUnits="userSpaceOnUse">
16
+ <stop stop-color="#4F9DF6"></stop>
17
+ <stop offset="1" stop-color="#0A79F8"></stop>
18
+ </linearGradient>
19
+ <linearGradient id="paint1_linear_3301_9425" x1="9" y1="9" x2="9" y2="111" gradientUnits="userSpaceOnUse">
20
+ <stop stop-color="#4F9DF6"></stop>
21
+ <stop offset="1" stop-color="#0A79F8"></stop>
22
+ </linearGradient>
23
+ <linearGradient id="paint2_linear_3301_9425" x1="17.16" y1="30.42" x2="17.16" y2="90.09" gradientUnits="userSpaceOnUse">
24
+ <stop stop-color="white"></stop>
25
+ <stop offset="1" stop-color="#ECEFFF"></stop>
26
+ </linearGradient>
27
+ <linearGradient id="paint3_linear_3301_9425" x1="20.1562" y1="77.5313" x2="26.7305" y2="110.104" gradientUnits="userSpaceOnUse">
28
+ <stop offset="0.00694981" stop-color="#77B2F6"></stop>
29
+ <stop offset="0.206385" stop-color="#4F9DF6"></stop>
30
+ <stop offset="1" stop-color="#4598FA"></stop>
31
+ </linearGradient>
32
+ </defs>
33
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="76" height="76" viewBox="0 0 76 76" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.32886 15.6177C5.22429 15.6177 4.32886 16.5131 4.32886 17.6177V20.7634H0.328857V17.6177C0.328857 14.304 3.01515 11.6177 6.32886 11.6177H69.2574C72.5711 11.6177 75.2574 14.304 75.2574 17.6177V59.4747C75.2574 62.7884 72.5712 65.4747 69.2574 65.4747H6.32887C3.01516 65.4747 0.328857 62.7884 0.328857 59.4747V56.5595H4.32886V59.4747C4.32886 60.5792 5.22429 61.4747 6.32887 61.4747H69.2574C70.362 61.4747 71.2574 60.5793 71.2574 59.4747V17.6177C71.2574 16.5131 70.362 15.6177 69.2574 15.6177H6.32886ZM40.4578 27.3455C42.8218 27.3455 44.8692 27.8372 46.6 28.8205C48.3519 29.7815 49.7133 31.1448 50.6842 32.9104C51.6552 34.6759 52.1407 36.7544 52.1407 39.1457C52.1407 41.5147 51.6552 43.5708 50.6842 45.314C49.7133 47.0572 48.3519 48.4093 46.6 49.3703C44.8692 50.3313 42.8218 50.8118 40.4578 50.8118H32.1943V27.3455H40.4578ZM40.3311 47.0237C42.7162 47.0237 44.5526 46.3309 45.8401 44.9452C47.1277 43.5373 47.7714 41.6041 47.7714 39.1457C47.7714 36.665 47.1277 34.7095 45.8401 33.2791C44.5526 31.8488 42.7162 31.1336 40.3311 31.1336H36.4685V47.0237H40.3311ZM27.501 27.3455H23.9811V50.8118H27.501V27.3455ZM8.77824 27.3455C11.1423 27.3455 13.1897 27.8372 14.9205 28.8205C16.6724 29.7815 18.0338 31.1448 19.0047 32.9104C19.9757 34.6759 20.4611 36.7544 20.4611 39.1457C20.4611 41.5147 19.9757 43.5708 19.0047 45.314C18.0338 47.0572 16.6724 48.4093 14.9205 49.3703C13.1897 50.3313 11.1423 50.8118 8.77824 50.8118H0.514743V27.3455H8.77824ZM8.6516 47.0237C11.0367 47.0237 12.8731 46.3309 14.1606 44.9452C15.4481 43.5373 16.0919 41.6041 16.0919 39.1457C16.0919 36.665 15.4481 34.7095 14.1606 33.2791C12.8731 31.8488 11.0367 31.1336 8.6516 31.1336H4.78897V47.0237H8.6516ZM62.2973 30.6486C62.2973 32.1114 61.1115 33.2972 59.6487 33.2972C58.186 33.2972 57.0001 32.1114 57.0001 30.6486C57.0001 29.1858 58.186 28 59.6487 28C61.1115 28 62.2973 29.1858 62.2973 30.6486ZM62.2972 46.5402C62.2972 48.003 61.1114 49.1888 59.6486 49.1888C58.1858 49.1888 57 48.003 57 46.5402C57 45.0774 58.1858 43.8916 59.6486 43.8916C61.1114 43.8916 62.2972 45.0774 62.2972 46.5402Z" fill="#4598FA"></path>
3
+ </svg>
@@ -0,0 +1,19 @@
1
+ <svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path opacity="0.8" d="M14.2915 102.867C14.2915 106.298 17.8809 108.047 20.0301 105.663L74.8921 44.8061L59.56 13.3167L14.2915 13.3167L14.2915 102.867Z" fill="url(#paint0_linear_3296_9308)"></path>
3
+ <path opacity="0.8" d="M105.709 17.8485C105.709 14.4202 102.124 12.6709 99.9734 15.0499L45.1025 75.758L60.4403 107.247H105.709V17.8485Z" fill="url(#paint1_linear_3296_9308)"></path>
4
+ <path opacity="0.8" d="M105.709 107.247L59.8421 13.3167L14.2915 13.3167L60.4403 107.247H105.709Z" fill="url(#paint2_linear_3296_9308)"></path>
5
+ <defs>
6
+ <linearGradient id="paint0_linear_3296_9308" x1="58.9505" y1="13.5628" x2="1.14816" y2="99.881" gradientUnits="userSpaceOnUse">
7
+ <stop stop-color="#FF44B4"></stop>
8
+ <stop offset="1" stop-color="#FFAB48"></stop>
9
+ </linearGradient>
10
+ <linearGradient id="paint1_linear_3296_9308" x1="105.788" y1="13.5629" x2="48.8613" y2="100.72" gradientUnits="userSpaceOnUse">
11
+ <stop stop-color="#44B3FF"></stop>
12
+ <stop offset="1" stop-color="#A448FF"></stop>
13
+ </linearGradient>
14
+ <linearGradient id="paint2_linear_3296_9308" x1="38.6355" y1="11.2955" x2="95.5184" y2="102.845" gradientUnits="userSpaceOnUse">
15
+ <stop stop-color="#FF44A9"></stop>
16
+ <stop offset="1" stop-color="#7452FA"></stop>
17
+ </linearGradient>
18
+ </defs>
19
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg width="76" height="76" viewBox="0 0 76 76" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6 15C4.89543 15 4 15.8954 4 17V20.1761H0V17C0 13.6863 2.68629 11 6 11H69.23C72.5437 11 75.23 13.6863 75.23 17V59.0689C75.23 62.3826 72.5437 65.0689 69.23 65.0689H6C2.6863 65.0689 0 62.3826 0 59.0689V56.1243H4V59.0689C4 60.1735 4.89543 61.0689 6 61.0689H69.23C70.3346 61.0689 71.23 60.1735 71.23 59.0689V17C71.23 15.8954 70.3346 15 69.23 15H6Z" fill="#4598FA"></path>
3
+ <circle cx="32" cy="31" r="10" stroke="#4598FA" stroke-width="4"></circle>
4
+ <path d="M40.6875 48.384L46.29 53.9864L56.633 43.6434" stroke="#4598FA" stroke-width="4"></path>
5
+ <path d="M49.6667 38.5692C52.9205 38.5692 55.5583 35.4039 55.5583 31.4994C55.5583 27.5948 52.9205 24.4295 49.6667 24.4295" stroke="#4598FA" stroke-width="4"></path>
6
+ <path d="M32 41L24.8527 41C20.9867 41 17.8527 44.134 17.8527 48L17.8527 55.0654" stroke="#4598FA" stroke-width="4"></path>
7
+ </svg>
@@ -0,0 +1,56 @@
1
+ <svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_3296_9286" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="120" height="120">
3
+ <rect width="119.883" height="119.883" fill="white"></rect>
4
+ </mask>
5
+ <g mask="url(#mask0_3296_9286)">
6
+ <path d="M62.0254 14.05C62.0254 11.261 64.2864 9 67.0754 9H91.0629C93.8519 9 96.1129 11.261 96.1129 14.05V74.65C96.1129 77.439 93.8519 79.7 91.0629 79.7H67.0754C64.2864 79.7 62.0254 77.439 62.0254 74.65V14.05Z" fill="url(#paint0_linear_3296_9286)"></path>
7
+ <path d="M24.1504 32.9875C24.1504 30.1985 26.4114 27.9375 29.2004 27.9375H69.6004C72.3894 27.9375 74.6504 30.1985 74.6504 32.9875V74.65C74.6504 77.439 72.3894 79.7 69.6004 79.7H29.2004C26.4114 79.7 24.1504 77.439 24.1504 74.65V32.9875Z" fill="url(#paint1_linear_3296_9286)"></path>
8
+ <g filter="url(#filter0_i_3296_9286)">
9
+ <path d="M16.5752 64.55C16.5752 58.9719 21.0971 54.45 26.6752 54.45H91.0627C96.6408 54.45 101.163 58.9719 101.163 64.55V99.8999C101.163 105.478 96.6408 110 91.0627 110H26.6752C21.0971 110 16.5752 105.478 16.5752 99.8999V64.55Z" fill="url(#paint2_linear_3296_9286)"></path>
10
+ </g>
11
+ <g filter="url(#filter1_i_3296_9286)">
12
+ <path d="M10.2627 55.7125C10.2627 51.5289 13.6541 48.1375 17.8377 48.1375H99.9002C104.084 48.1375 107.475 51.5289 107.475 55.7125V65.8124C107.475 69.996 104.084 73.3874 99.9002 73.3874H17.8377C13.6541 73.3874 10.2627 69.996 10.2627 65.8124V55.7125Z" fill="url(#paint3_linear_3296_9286)"></path>
13
+ </g>
14
+ <circle cx="58.869" cy="87.9063" r="6.94375" fill="#6BADFF"></circle>
15
+ </g>
16
+ <defs>
17
+ <filter id="filter0_i_3296_9286" x="16.5752" y="54.45" width="86.5874" height="57.55" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
18
+ <feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood>
19
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend>
20
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix>
21
+ <feMorphology radius="4" operator="erode" in="SourceAlpha" result="effect1_innerShadow_3296_9286"></feMorphology>
22
+ <feOffset dx="2" dy="2"></feOffset>
23
+ <feGaussianBlur stdDeviation="3"></feGaussianBlur>
24
+ <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite>
25
+ <feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"></feColorMatrix>
26
+ <feBlend mode="normal" in2="shape" result="effect1_innerShadow_3296_9286"></feBlend>
27
+ </filter>
28
+ <filter id="filter1_i_3296_9286" x="10.2627" y="48.1375" width="99.2124" height="27.25" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
29
+ <feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood>
30
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend>
31
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix>
32
+ <feMorphology radius="4" operator="erode" in="SourceAlpha" result="effect1_innerShadow_3296_9286"></feMorphology>
33
+ <feOffset dx="2" dy="2"></feOffset>
34
+ <feGaussianBlur stdDeviation="3"></feGaussianBlur>
35
+ <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"></feComposite>
36
+ <feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"></feColorMatrix>
37
+ <feBlend mode="normal" in2="shape" result="effect1_innerShadow_3296_9286"></feBlend>
38
+ </filter>
39
+ <linearGradient id="paint0_linear_3296_9286" x1="86.0129" y1="9" x2="86.6441" y2="46.875" gradientUnits="userSpaceOnUse">
40
+ <stop stop-color="#FF7575"></stop>
41
+ <stop offset="1" stop-color="#C91C1C"></stop>
42
+ </linearGradient>
43
+ <linearGradient id="paint1_linear_3296_9286" x1="49.4004" y1="56.975" x2="49.4004" y2="27.9375" gradientUnits="userSpaceOnUse">
44
+ <stop stop-color="#ED7F1A"></stop>
45
+ <stop offset="1" stop-color="#FFE074"></stop>
46
+ </linearGradient>
47
+ <linearGradient id="paint2_linear_3296_9286" x1="16.5752" y1="75.2812" x2="101.163" y2="114.419" gradientUnits="userSpaceOnUse">
48
+ <stop stop-color="#54A0FD"></stop>
49
+ <stop offset="1" stop-color="#136EDE"></stop>
50
+ </linearGradient>
51
+ <linearGradient id="paint3_linear_3296_9286" x1="16.5752" y1="55.7124" x2="58.7889" y2="111.945" gradientUnits="userSpaceOnUse">
52
+ <stop stop-color="#83BAFF"></stop>
53
+ <stop offset="1" stop-color="#2482F6"></stop>
54
+ </linearGradient>
55
+ </defs>
56
+ </svg>
@@ -1 +1,2 @@
1
1
  export { default } from './nav-menu';
2
+ export { default as Products } from './products';
@@ -1,2 +1,3 @@
1
1
  // eslint-disable-next-line no-restricted-exports
2
- export { default } from './nav-menu';
2
+ export { default } from './nav-menu';
3
+ export { default as Products } from './products';
@@ -0,0 +1,17 @@
1
+ export type NavMenuContextValue = {
2
+ activeId: string | null;
3
+ openedIds: string[];
4
+ hiddenItemCount: number;
5
+ mode: 'horizontal' | 'vertical' | 'inline';
6
+ textColor: string;
7
+ activeTextColor: string;
8
+ bgColor: string;
9
+ activate: (id: string) => void;
10
+ open: (id: string) => void;
11
+ close: (id: string) => void;
12
+ };
13
+ export declare function NavMenuProvider({ value, children }: {
14
+ value: NavMenuContextValue;
15
+ children: React.ReactNode;
16
+ }): import("react/jsx-runtime").JSX.Element;
17
+ export declare function useNavMenuContext(): NavMenuContextValue;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from 'react';
3
+ const NavMenuContext = /*#__PURE__*/createContext(null);
4
+ export function NavMenuProvider({
5
+ value,
6
+ children
7
+ }) {
8
+ return /*#__PURE__*/_jsx(NavMenuContext.Provider, {
9
+ value: value,
10
+ children: children
11
+ });
12
+ }
13
+ export function useNavMenuContext() {
14
+ const context = useContext(NavMenuContext);
15
+ if (!context) {
16
+ throw new Error('NavMenuContext is not found');
17
+ }
18
+ return context;
19
+ }
@@ -3,7 +3,9 @@ export type ItemOptions = {
3
3
  id?: string;
4
4
  icon?: React.ReactNode;
5
5
  label?: React.ReactNode;
6
+ description?: React.ReactNode;
6
7
  active?: boolean;
8
+ variant?: 'default' | 'panel';
7
9
  children?: ItemOptions[];
8
10
  };
9
11
  export interface NavMenuProps extends React.HTMLAttributes<HTMLElement> {
@@ -29,16 +31,19 @@ export interface ItemProps extends React.HTMLAttributes<HTMLLIElement> {
29
31
  id?: string;
30
32
  icon?: React.ReactNode;
31
33
  label?: React.ReactNode;
34
+ description?: React.ReactNode;
32
35
  active?: boolean;
36
+ variant?: 'default' | 'panel';
33
37
  onClick?: () => void;
34
38
  }
35
- export interface SubProps extends React.HTMLAttributes<HTMLLIElement> {
36
- id?: string;
37
- icon?: React.ReactNode;
38
- label?: React.ReactNode;
39
- children?: Array<React.ReactElement>;
39
+ export declare const Item: import("react").ForwardRefExoticComponent<ItemProps & import("react").RefAttributes<HTMLLIElement>>;
40
+ export interface SubProps extends Omit<ItemProps, 'children' | 'active'> {
41
+ children?: Array<React.ReactElement> | ((props: {
42
+ isOpen: boolean;
43
+ }) => React.ReactElement | null);
40
44
  expandIcon?: React.ReactNode | ((props: {
41
45
  isOpen: boolean;
42
46
  }) => React.ReactNode);
43
47
  }
48
+ export declare const Sub: import("react").ForwardRefExoticComponent<SubProps & import("react").RefAttributes<HTMLLIElement>>;
44
49
  export default NavMenu;
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Children, cloneElement, useEffect, createContext, useContext, useRef, forwardRef, useLayoutEffect, isValidElement } from 'react';
2
+ import { Children, cloneElement, useEffect, useRef, forwardRef, useLayoutEffect, isValidElement } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { MoreHoriz as MoreHorizIcon, ExpandMore as ExpandMoreIcon, Menu as MenuIcon } from '@mui/icons-material';
5
+ import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
5
6
  import { useCreation, useMemoizedFn, useReactive, useSize, useThrottleFn } from 'ahooks';
6
- import { HorizontalStyle, InlineStyle } from './style';
7
- const NavMenuContext = /*#__PURE__*/createContext(null);
7
+ import { NavMenuProvider, useNavMenuContext } from './nav-menu-context';
8
+ import { NavMenuRoot, NavMenuList, NavMenuItem, NavMenuSub, NavMenuSubList } from './style';
8
9
 
9
10
  // 过滤 children 中的 Item/Sub, 忽略其它类型的 element
10
11
  function filterItems(children) {
@@ -61,11 +62,14 @@ function NavMenu({
61
62
  return {
62
63
  ...currentState,
63
64
  mode,
65
+ textColor,
66
+ activeTextColor,
67
+ bgColor,
64
68
  activate,
65
69
  open,
66
70
  close
67
71
  };
68
- }, [currentState.activeId, currentState.hiddenItemCount, currentState.openedIds, mode, activate, open, close]);
72
+ }, [currentState.activeId, currentState.hiddenItemCount, currentState.openedIds, mode, textColor, activeTextColor, bgColor, activate, open, close]);
69
73
  const navMenuRef = useRef(null);
70
74
  const itemRefs = useRef([]);
71
75
  const moreIconRef = useRef(null);
@@ -147,10 +151,14 @@ function NavMenu({
147
151
  id: item.id,
148
152
  icon: item.icon,
149
153
  label: item.label,
154
+ variant: isTopLevel ? 'default' : 'panel',
150
155
  ref: isTopLevel ? el => {
151
156
  itemRefs.current[index] = el;
152
157
  } : undefined,
153
- children: item.children.map((childItem, childIndex) => renderItem(childItem, childIndex, false))
158
+ children: typeof item.children === 'function' ? item.children : item.children.map((childItem, childIndex) => renderItem({
159
+ ...childItem,
160
+ variant: 'panel'
161
+ }, childIndex, false))
154
162
  }, item.id);
155
163
  }
156
164
 
@@ -159,24 +167,24 @@ function NavMenu({
159
167
  id: item.id,
160
168
  icon: item.icon,
161
169
  label: item.label,
170
+ description: item.description,
162
171
  active: item.active,
172
+ variant: item.variant,
163
173
  ref: isTopLevel ? el => {
164
174
  itemRefs.current[index] = el;
165
175
  } : undefined
166
176
  }, item.id);
167
177
  };
168
178
  const content = items ? items?.slice(-currentState.hiddenItemCount).map((item, index) => renderItem(item, index)) : children?.slice(-currentState.hiddenItemCount);
169
- const StyledRoot = mode === 'inline' ? InlineStyle : HorizontalStyle;
170
- return /*#__PURE__*/_jsx(NavMenuContext.Provider, {
179
+ return /*#__PURE__*/_jsx(NavMenuProvider, {
171
180
  value: contextValue,
172
- children: /*#__PURE__*/_jsx(StyledRoot, {
181
+ children: /*#__PURE__*/_jsx(NavMenuRoot, {
173
182
  ...rest,
174
183
  className: classes,
175
184
  $textColor: textColor,
176
- $activeTextColor: activeTextColor,
177
185
  $bgColor: bgColor,
178
- children: /*#__PURE__*/_jsxs("ul", {
179
- className: "navmenu-root",
186
+ children: /*#__PURE__*/_jsxs(NavMenuList, {
187
+ className: clsx('navmenu-list', `navmenu-list--${mode}`),
180
188
  ref: navMenuRef,
181
189
  children: [items ? items.map((item, index) => renderItem(item, index, true)) : renderChildrenWithRef(children || []), currentState.hiddenItemCount > 0 && /*#__PURE__*/_jsx(Sub, {
182
190
  expandIcon: false,
@@ -190,22 +198,26 @@ function NavMenu({
190
198
  })
191
199
  });
192
200
  }
193
- const Item = /*#__PURE__*/forwardRef(({
201
+ export const Item = /*#__PURE__*/forwardRef(({
194
202
  id: _id = '',
195
203
  icon = null,
196
204
  label = '',
205
+ description,
197
206
  active = false,
207
+ variant = 'default',
198
208
  onClick = null,
199
209
  ...rest
200
210
  }, ref) => {
201
211
  const id = useUniqueId(_id);
202
212
  const {
213
+ mode,
203
214
  activeId,
204
- activate
205
- } = useContext(NavMenuContext) || {};
215
+ activate,
216
+ activeTextColor
217
+ } = useNavMenuContext();
206
218
  const classes = clsx('navmenu-item', {
207
219
  'navmenu-item--active': activeId === id
208
- }, rest.className);
220
+ }, `navmenu-item--${mode}`, `navmenu-item--${variant}`, rest.className);
209
221
  useEffect(() => {
210
222
  if (active) {
211
223
  activate?.(id);
@@ -219,25 +231,37 @@ const Item = /*#__PURE__*/forwardRef(({
219
231
  return (
220
232
  /*#__PURE__*/
221
233
  // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
222
- _jsxs("li", {
234
+ _jsxs(NavMenuItem, {
223
235
  ...rest,
224
236
  className: classes,
225
- onClick: handleClick,
226
237
  ref: ref,
238
+ $activeTextColor: activeTextColor,
239
+ onClick: handleClick,
227
240
  children: [icon && /*#__PURE__*/_jsx("span", {
228
- className: "navmenu-item-icon",
241
+ className: "navmenu-item__icon",
229
242
  children: icon
230
- }), /*#__PURE__*/_jsx("span", {
231
- className: "navmenu-item-label",
232
- children: label
243
+ }), /*#__PURE__*/_jsxs("div", {
244
+ className: "navmenu-item__content",
245
+ children: [/*#__PURE__*/_jsxs("span", {
246
+ className: "navmenu-item__label",
247
+ children: [label, " ", /*#__PURE__*/_jsx(ArrowForwardIcon, {
248
+ className: "navmenu-item__label-arrow"
249
+ })]
250
+ }), description && /*#__PURE__*/_jsx("span", {
251
+ className: "navmenu-item__desc",
252
+ children: description
253
+ })]
233
254
  })]
234
255
  })
235
256
  );
236
257
  });
237
- const Sub = /*#__PURE__*/forwardRef(({
258
+ Item.displayName = 'NavMenu.Item';
259
+ export const Sub = /*#__PURE__*/forwardRef(({
238
260
  id: _id = '',
239
261
  icon = null,
240
262
  label = null,
263
+ description,
264
+ variant = 'default',
241
265
  children,
242
266
  expandIcon = ({
243
267
  isOpen
@@ -253,13 +277,18 @@ const Sub = /*#__PURE__*/forwardRef(({
253
277
  openedIds,
254
278
  open,
255
279
  close,
256
- mode
257
- } = useContext(NavMenuContext) || {};
280
+ mode,
281
+ activeTextColor
282
+ } = useNavMenuContext();
258
283
  const isOpen = openedIds?.includes(id) ?? false;
259
- const classes = clsx('navmenu-sub', {
260
- 'navmenu-sub--opened': isOpen
261
- }, rest.className);
262
284
  const isInlineMode = mode === 'inline';
285
+ const classes = clsx('navmenu-sub', 'navmenu-item', {
286
+ 'navmenu-item--panel': variant === 'panel'
287
+ }, {
288
+ 'navmenu-sub--opened': isOpen,
289
+ 'navmenu-item--inline': isInlineMode
290
+ }, rest.className);
291
+
263
292
  // inline mode 时使用 click 事件控制收缩/伸展子菜单
264
293
  const props = isInlineMode ? {
265
294
  onClick: () => {
@@ -277,32 +306,43 @@ const Sub = /*#__PURE__*/forwardRef(({
277
306
  const containerProps = isInlineMode ? {
278
307
  onClick: e => e.stopPropagation()
279
308
  } : {};
280
- return /*#__PURE__*/_jsxs("li", {
309
+ return /*#__PURE__*/_jsxs(NavMenuSub, {
281
310
  ...rest,
282
311
  className: classes,
283
312
  ...props,
284
313
  ref: ref,
314
+ $activeTextColor: activeTextColor,
285
315
  children: [icon && /*#__PURE__*/_jsx("span", {
286
- className: "navmenu-sub-icon",
316
+ className: "navmenu-item__icon",
287
317
  children: icon
288
- }), /*#__PURE__*/_jsx("span", {
289
- className: "navmenu-sub-label",
290
- children: label
318
+ }), /*#__PURE__*/_jsxs("div", {
319
+ className: "navmenu-item__content",
320
+ children: [/*#__PURE__*/_jsx("span", {
321
+ className: "navmenu-item__label",
322
+ children: label
323
+ }), description && /*#__PURE__*/_jsx("span", {
324
+ className: "navmenu-item__desc",
325
+ children: description
326
+ })]
291
327
  }), expandIcon && /*#__PURE__*/_jsx("span", {
292
- className: "navmenu-sub-expand-icon",
328
+ className: "navmenu-sub__expand-icon",
293
329
  children: typeof expandIcon === 'function' ? expandIcon({
294
330
  isOpen
295
331
  }) : expandIcon
296
332
  }), /*#__PURE__*/_jsx("div", {
297
- className: "navmenu-sub-container",
333
+ className: "navmenu-sub__container",
298
334
  ...containerProps,
299
- children: /*#__PURE__*/_jsx("ul", {
300
- className: "navmenu-sub-list",
335
+ children: typeof children === 'function' ? children({
336
+ isOpen
337
+ }) // 自定义渲染
338
+ : /*#__PURE__*/_jsx(NavMenuSubList, {
339
+ className: "navmenu-sub__list",
301
340
  children: filterItems(children)
302
341
  })
303
342
  })]
304
343
  });
305
344
  });
345
+ Sub.displayName = 'NavMenu.Sub';
306
346
  NavMenu.Item = Item;
307
347
  NavMenu.Sub = Sub;
308
348
  export default NavMenu;
@@ -0,0 +1,5 @@
1
+ import { BoxProps } from '@mui/material';
2
+ export interface ProductsProps extends BoxProps {
3
+ isOpen?: boolean;
4
+ }
5
+ export default function Products({ className, isOpen, ...rest }: ProductsProps): import("react/jsx-runtime").JSX.Element;