Commit cfc13669982004854a512586bcfb40b21fcd6514

Authored by 张志伟
1 parent 06cbb4a3

🐱 feat(*): 新增组件库

package.json
... ... @@ -23,6 +23,7 @@
23 23 "dist/"
24 24 ],
25 25 "dependencies": {
  26 + "@feewee/h5app-common": "^0.1.5",
26 27 "@modern-js/plugin-tailwindcss": "2.48.5",
27 28 "@modern-js/runtime": "2.48.5",
28 29 "ahooks": "^3.7.11",
... ...
pnpm-lock.yaml
... ... @@ -5,6 +5,9 @@ settings:
5 5 excludeLinksFromLockfile: false
6 6  
7 7 dependencies:
  8 + '@feewee/h5app-common':
  9 + specifier: ^0.1.5
  10 + version: 0.1.5(react-dom@18.2.0)(react@18.2.0)(tailwindcss@3.4.3)
8 11 '@modern-js/plugin-tailwindcss':
9 12 specifier: 2.48.5
10 13 version: 2.48.5(@modern-js/runtime@2.48.5)(tailwindcss@3.4.3)
... ... @@ -1826,6 +1829,22 @@ packages:
1826 1829 - supports-color
1827 1830 dev: true
1828 1831  
  1832 + /@feewee/h5app-common@0.1.5(react-dom@18.2.0)(react@18.2.0)(tailwindcss@3.4.3):
  1833 + resolution: {integrity: sha512-x2ow9qBrPZcQfFKI83XHD1vIOsPNcn6vzqb6t2DrDNVUCsnzufpk+a1BNSLVgCndHxhfCt2QHpPfwb5gXnMteg==}
  1834 + engines: {node: '>=18', npm: '>=6.9.0'}
  1835 + peerDependencies:
  1836 + react: '>=18'
  1837 + react-dom: '>=18'
  1838 + tailwindcss: ~3.3.3
  1839 + dependencies:
  1840 + '@nutui/icons-react': 1.0.4
  1841 + '@nutui/nutui-react': 2.6.0(react-dom@18.2.0)(react@18.2.0)
  1842 + clsx: 2.1.0
  1843 + react: 18.2.0
  1844 + react-dom: 18.2.0(react@18.2.0)
  1845 + tailwindcss: 3.4.3
  1846 + dev: false
  1847 +
1829 1848 /@humanwhocodes/config-array@0.11.14:
1830 1849 resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==}
1831 1850 engines: {node: '>=10.10.0'}
... ... @@ -2536,6 +2555,34 @@ packages:
2536 2555 '@nodelib/fs.scandir': 2.1.5
2537 2556 fastq: 1.17.1
2538 2557  
  2558 + /@nutui/icons-react@1.0.4:
  2559 + resolution: {integrity: sha512-nLFYpJvMBkKzT+PpfMaYoO6vJXMTM0yxAragTkEHt9HAFNjdTdvByCSRfUazHHdLdr1AJxS9h62VB1+jmBEtWA==}
  2560 + dev: false
  2561 +
  2562 + /@nutui/nutui-react@2.6.0(react-dom@18.2.0)(react@18.2.0):
  2563 + resolution: {integrity: sha512-4/nfZ/br4mu7m+8qm4EsaO++Mxlxr5tpAEmEsgFghaxeZ2lZLcftJ7e7INzk8tV3IJuKMq7eA/J/BLbbrJldIA==}
  2564 + peerDependencies:
  2565 + react: ^16.8.0 || ^17.0.0 || ^18.0.0
  2566 + dependencies:
  2567 + '@babel/runtime': 7.24.4
  2568 + '@nutui/icons-react': 1.0.4
  2569 + '@nutui/touch-emulator': 1.0.0
  2570 + '@react-spring/web': 9.6.1(react-dom@18.2.0)(react@18.2.0)
  2571 + '@use-gesture/react': 10.2.20(react@18.2.0)
  2572 + async-validator: 4.2.5
  2573 + classnames: 2.5.1
  2574 + lodash.isequal: 4.5.0
  2575 + lodash.kebabcase: 4.1.1
  2576 + react: 18.2.0
  2577 + react-transition-group: 4.4.5(react-dom@18.2.0)(react@18.2.0)
  2578 + transitivePeerDependencies:
  2579 + - react-dom
  2580 + dev: false
  2581 +
  2582 + /@nutui/touch-emulator@1.0.0:
  2583 + resolution: {integrity: sha512-k2hvI/9LlRA7Ph1Chni27pTuvPmKPt+/I10sWWd2sWzqiCOYRerD79eIwCMRGUF/q6WVDEKVnv00t9CEUL4sPA==}
  2584 + dev: false
  2585 +
2539 2586 /@pkgjs/parseargs@0.11.0:
2540 2587 resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
2541 2588 engines: {node: '>=14'}
... ... @@ -2581,6 +2628,60 @@ packages:
2581 2628 webpack: 5.91.0(esbuild@0.17.19)
2582 2629 dev: true
2583 2630  
  2631 + /@react-spring/animated@9.6.1(react@18.2.0):
  2632 + resolution: {integrity: sha512-ls/rJBrAqiAYozjLo5EPPLLOb1LM0lNVQcXODTC1SMtS6DbuBCPaKco5svFUQFMP2dso3O+qcC4k9FsKc0KxMQ==}
  2633 + peerDependencies:
  2634 + react: ^16.8.0 || ^17.0.0 || ^18.0.0
  2635 + dependencies:
  2636 + '@react-spring/shared': 9.6.1(react@18.2.0)
  2637 + '@react-spring/types': 9.6.1
  2638 + react: 18.2.0
  2639 + dev: false
  2640 +
  2641 + /@react-spring/core@9.6.1(react@18.2.0):
  2642 + resolution: {integrity: sha512-3HAAinAyCPessyQNNXe5W0OHzRfa8Yo5P748paPcmMowZ/4sMfaZ2ZB6e5x5khQI8NusOHj8nquoutd6FRY5WQ==}
  2643 + peerDependencies:
  2644 + react: ^16.8.0 || ^17.0.0 || ^18.0.0
  2645 + dependencies:
  2646 + '@react-spring/animated': 9.6.1(react@18.2.0)
  2647 + '@react-spring/rafz': 9.6.1
  2648 + '@react-spring/shared': 9.6.1(react@18.2.0)
  2649 + '@react-spring/types': 9.6.1
  2650 + react: 18.2.0
  2651 + dev: false
  2652 +
  2653 + /@react-spring/rafz@9.6.1:
  2654 + resolution: {integrity: sha512-v6qbgNRpztJFFfSE3e2W1Uz+g8KnIBs6SmzCzcVVF61GdGfGOuBrbjIcp+nUz301awVmREKi4eMQb2Ab2gGgyQ==}
  2655 + dev: false
  2656 +
  2657 + /@react-spring/shared@9.6.1(react@18.2.0):
  2658 + resolution: {integrity: sha512-PBFBXabxFEuF8enNLkVqMC9h5uLRBo6GQhRMQT/nRTnemVENimgRd+0ZT4yFnAQ0AxWNiJfX3qux+bW2LbG6Bw==}
  2659 + peerDependencies:
  2660 + react: ^16.8.0 || ^17.0.0 || ^18.0.0
  2661 + dependencies:
  2662 + '@react-spring/rafz': 9.6.1
  2663 + '@react-spring/types': 9.6.1
  2664 + react: 18.2.0
  2665 + dev: false
  2666 +
  2667 + /@react-spring/types@9.6.1:
  2668 + resolution: {integrity: sha512-POu8Mk0hIU3lRXB3bGIGe4VHIwwDsQyoD1F394OK7STTiX9w4dG3cTLljjYswkQN+hDSHRrj4O36kuVa7KPU8Q==}
  2669 + dev: false
  2670 +
  2671 + /@react-spring/web@9.6.1(react-dom@18.2.0)(react@18.2.0):
  2672 + resolution: {integrity: sha512-X2zR6q2Z+FjsWfGAmAXlQaoUHbPmfuCaXpuM6TcwXPpLE1ZD4A1eys/wpXboFQmDkjnrlTmKvpVna1MjWpZ5Hw==}
  2673 + peerDependencies:
  2674 + react: ^16.8.0 || ^17.0.0 || ^18.0.0
  2675 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
  2676 + dependencies:
  2677 + '@react-spring/animated': 9.6.1(react@18.2.0)
  2678 + '@react-spring/core': 9.6.1(react@18.2.0)
  2679 + '@react-spring/shared': 9.6.1(react@18.2.0)
  2680 + '@react-spring/types': 9.6.1
  2681 + react: 18.2.0
  2682 + react-dom: 18.2.0(react@18.2.0)
  2683 + dev: false
  2684 +
2584 2685 /@redux-devtools/extension@3.3.0(redux@4.2.1):
2585 2686 resolution: {integrity: sha512-X34S/rC8S/M1BIrkYD1mJ5f8vlH0BDqxXrs96cvxSBo4FhMdbhU+GUGsmNYov1xjSyLMHgo8NYrUG8bNX7525g==}
2586 2687 peerDependencies:
... ... @@ -3564,6 +3665,19 @@ packages:
3564 3665 resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
3565 3666 dev: true
3566 3667  
  3668 + /@use-gesture/core@10.2.20:
  3669 + resolution: {integrity: sha512-4lFhHc8so4yIHkBEs641DnEsBxPyhJ5GEjB4PURFDH4p/FcZriH6w99knZgI63zN/MBFfylMyb8+PDuj6RIXKQ==}
  3670 + dev: false
  3671 +
  3672 + /@use-gesture/react@10.2.20(react@18.2.0):
  3673 + resolution: {integrity: sha512-KnJq9ZSqprWA6uNhWTUHZqTCh+rfa0j8ehTzqeBhktUPrmTj7yVOBvEQ/vSFU/7d72cGgWSsJ0f5T6GQCHXnvg==}
  3674 + peerDependencies:
  3675 + react: '>= 16.8.0'
  3676 + dependencies:
  3677 + '@use-gesture/core': 10.2.20
  3678 + react: 18.2.0
  3679 + dev: false
  3680 +
3567 3681 /@web3-storage/multipart-parser@1.0.0:
3568 3682 resolution: {integrity: sha512-BEO6al7BYqcnfX15W2cnGR+Q566ACXAT9UQykORCWW80lmkpWsnEob6zJS1ZVBKsSJC8+7vJkHwlp+lXG1UCdw==}
3569 3683  
... ... @@ -3970,6 +4084,10 @@ packages:
3970 4084 engines: {node: '>=8'}
3971 4085 dev: true
3972 4086  
  4087 + /async-validator@4.2.5:
  4088 + resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==}
  4089 + dev: false
  4090 +
3973 4091 /asynckit@0.4.0:
3974 4092 resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
3975 4093 dev: true
... ... @@ -4378,6 +4496,10 @@ packages:
4378 4496 safe-buffer: 5.2.1
4379 4497 dev: true
4380 4498  
  4499 + /classnames@2.5.1:
  4500 + resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==}
  4501 + dev: false
  4502 +
4381 4503 /clean-css@5.3.3:
4382 4504 resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==}
4383 4505 engines: {node: '>= 10.0'}
... ... @@ -5004,6 +5126,13 @@ packages:
5004 5126 utila: 0.4.0
5005 5127 dev: true
5006 5128  
  5129 + /dom-helpers@5.2.1:
  5130 + resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==}
  5131 + dependencies:
  5132 + '@babel/runtime': 7.24.4
  5133 + csstype: 3.1.3
  5134 + dev: false
  5135 +
5007 5136 /dom-serializer@1.4.1:
5008 5137 resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==}
5009 5138 dependencies:
... ... @@ -7108,9 +7237,12 @@ packages:
7108 7237 resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==}
7109 7238 dev: true
7110 7239  
  7240 + /lodash.isequal@4.5.0:
  7241 + resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==}
  7242 + dev: false
  7243 +
7111 7244 /lodash.kebabcase@4.1.1:
7112 7245 resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==}
7113   - dev: true
7114 7246  
7115 7247 /lodash.memoize@4.1.2:
7116 7248 resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==}
... ... @@ -8649,6 +8781,20 @@ packages:
8649 8781 react: 18.2.0
8650 8782 dev: false
8651 8783  
  8784 + /react-transition-group@4.4.5(react-dom@18.2.0)(react@18.2.0):
  8785 + resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==}
  8786 + peerDependencies:
  8787 + react: '>=16.6.0'
  8788 + react-dom: '>=16.6.0'
  8789 + dependencies:
  8790 + '@babel/runtime': 7.24.4
  8791 + dom-helpers: 5.2.1
  8792 + loose-envify: 1.4.0
  8793 + prop-types: 15.8.1
  8794 + react: 18.2.0
  8795 + react-dom: 18.2.0(react@18.2.0)
  8796 + dev: false
  8797 +
8652 8798 /react@18.2.0:
8653 8799 resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==}
8654 8800 engines: {node: '>=0.10.0'}
... ...
src/routes/demo/page.tsx 0 → 100644
  1 +import { Helmet } from '@modern-js/runtime/head';
  2 +import { ListRow } from '@feewee/h5app-common';
  3 +
  4 +const Index = () => (
  5 + <>
  6 + <Helmet>
  7 + <link rel="icon" type="image/x-icon" href="https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/favicon.ico" />
  8 + </Helmet>
  9 + <main className="p-4">
  10 + <div>demo 页面</div>
  11 + <ListRow title="标题" description="副标题" extra="描述文字" radius={6} align="center" onClick={() => console.info('点击事件')} />
  12 + </main>
  13 + </>
  14 +);
  15 +
  16 +export default Index;
... ...
src/routes/page.tsx
... ... @@ -4,11 +4,7 @@ import &#39;./index.css&#39;;
4 4 const Index = () => (
5 5 <div className="container-box">
6 6 <Helmet>
7   - <link
8   - rel="icon"
9   - type="image/x-icon"
10   - href="https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/favicon.ico"
11   - />
  7 + <link rel="icon" type="image/x-icon" href="https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/favicon.ico" />
12 8 </Helmet>
13 9 <main>
14 10 <div className="title">
... ... @@ -24,63 +20,31 @@ const Index = () =&gt; (
24 20 Get started by editing <code className="code">src/routes/page.tsx</code>
25 21 </p>
26 22 <div className="grid">
27   - <a
28   - href="https://modernjs.dev/guides/get-started/introduction.html"
29   - target="_blank"
30   - rel="noopener noreferrer"
31   - className="card"
32   - >
  23 + <a href="https://modernjs.dev/guides/get-started/introduction.html" target="_blank" rel="noopener noreferrer" className="card">
33 24 <h2>
34 25 Guide
35   - <img
36   - className="arrow-right"
37   - src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
38   - />
  26 + <img className="arrow-right" src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg" />
39 27 </h2>
40 28 <p>Follow the guides to use all features of Modern.js.</p>
41 29 </a>
42   - <a
43   - href="https://modernjs.dev/tutorials/foundations/introduction.html"
44   - target="_blank"
45   - className="card"
46   - rel="noreferrer"
47   - >
  30 + <a href="https://modernjs.dev/tutorials/foundations/introduction.html" target="_blank" className="card" rel="noreferrer">
48 31 <h2>
49 32 Tutorials
50   - <img
51   - className="arrow-right"
52   - src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
53   - />
  33 + <img className="arrow-right" src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg" />
54 34 </h2>
55 35 <p>Learn to use Modern.js to create your first application.</p>
56 36 </a>
57   - <a
58   - href="https://modernjs.dev/configure/app/usage.html"
59   - target="_blank"
60   - className="card"
61   - rel="noreferrer"
62   - >
  37 + <a href="https://modernjs.dev/configure/app/usage.html" target="_blank" className="card" rel="noreferrer">
63 38 <h2>
64 39 Config
65   - <img
66   - className="arrow-right"
67   - src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
68   - />
  40 + <img className="arrow-right" src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg" />
69 41 </h2>
70 42 <p>Find all configuration options provided by Modern.js.</p>
71 43 </a>
72   - <a
73   - href="https://github.com/web-infra-dev/modern.js"
74   - target="_blank"
75   - rel="noopener noreferrer"
76   - className="card"
77   - >
  44 + <a href="https://github.com/web-infra-dev/modern.js" target="_blank" rel="noopener noreferrer" className="card">
78 45 <h2>
79 46 Github
80   - <img
81   - className="arrow-right"
82   - src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"
83   - />
  47 + <img className="arrow-right" src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg" />
84 48 </h2>
85 49 <p>View the source code of Github, feel free to contribute.</p>
86 50 </a>
... ...