umwd-components 0.1.5 → 0.1.6
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/.storybook/main.js +2 -4
- package/.storybook/preview.js +1 -0
- package/aant.txt +10 -0
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/next.config.js +15 -0
- package/package.json +79 -73
- package/public/placeholders/fullscreen_1920X1080.png +0 -0
- package/public/placeholders/highres_2400X1600.png +0 -0
- package/public/placeholders/large_1200X800.png +0 -0
- package/public/placeholders/medium_600X400.png +0 -0
- package/public/placeholders/small_300X200.png +0 -0
- package/public/placeholders/thumbnail_100X100.png +0 -0
- package/readme.MD +0 -0
- package/{rollup.config.js → rollup.config.mjs} +5 -2
- package/src/components/DragAndDropList/DraggableItem.js +27 -0
- package/src/components/DragAndDropList/DroppableArea.js +13 -0
- package/src/components/DragAndDropList/index.js +30 -0
- package/src/components/NavBar/index.js +568 -0
- package/src/components/TextImageBlock/index.js +108 -0
- package/src/index.js +1 -0
- package/src/stories/Button.stories.js +7 -7
- package/src/stories/DragAndDropList.stories.js +15 -0
- package/src/stories/Navbar.stories.js +39 -0
- package/src/stories/TextImageBlock.stories.js +85 -0
- package/src/stories/styles.css +4 -0
- package/README.md +0 -70
package/.storybook/main.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
|
|
2
1
|
const config = {
|
|
3
2
|
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
4
3
|
addons: [
|
|
5
4
|
"@storybook/addon-links",
|
|
6
5
|
"@storybook/addon-essentials",
|
|
7
|
-
"@storybook/preset-create-react-app",
|
|
8
6
|
"@storybook/addon-onboarding",
|
|
9
7
|
"@storybook/addon-interactions",
|
|
10
8
|
],
|
|
11
9
|
framework: {
|
|
12
|
-
name:
|
|
10
|
+
name: '@storybook/nextjs',
|
|
13
11
|
options: {},
|
|
14
12
|
},
|
|
15
13
|
docs: {
|
|
16
14
|
autodocs: "tag",
|
|
17
15
|
},
|
|
18
|
-
staticDirs: ["..\\public"]
|
|
16
|
+
staticDirs: ["..\\public"]
|
|
19
17
|
};
|
|
20
18
|
export default config;
|
package/.storybook/preview.js
CHANGED
package/aant.txt
ADDED
package/dist/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{useState as
|
|
1
|
+
import e,{useState as t,useEffect as r,useCallback as a}from"react";import{TextField as n}from"@mui/material";import o from"prop-types";import"next/image";import"next/router";import"next/link";import"@mui/icons-material/Close";import"@mui/icons-material/MoreVert";!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".requirement{align-items:center;display:flex;height:35px}.requirement p{font-family:sans-serif;font-size:14px;font-weight:700;margin-left:10px}.invalid{color:red}.valid{color:#7ac142}.checkmark{stroke-width:5;stroke:#fff;stroke-miterlimit:10;animation:fill .4s ease-in-out .4s forwards,scale .3s ease-in-out .9s both;border-radius:50%;box-shadow:inset 0 0 0 #7ac142;display:block;height:15px;width:15px}.checkmark__circle{stroke-dasharray:166;stroke-dashoffset:166;stroke-width:2;stroke-miterlimit:10;stroke:#7ac142;fill:none;animation:stroke .6s cubic-bezier(.65,0,.45,1) forwards}.checkmark__check{stroke-dasharray:48;stroke-dashoffset:48;animation:stroke .2s cubic-bezier(.65,0,.45,1) .5s forwards;transform-origin:50% 50%}@keyframes stroke{to{stroke-dashoffset:0}}@keyframes scale{0%,to{transform:none}50%{transform:scale3d(1.1,1.1,1)}}@keyframes fill{to{box-shadow:inset 0 0 0 30px #7ac142}}");const i=()=>e.createElement("svg",{x:"0px",y:"0px",width:"15px",height:"15px",viewBox:"0 0 122.879 122.879",enableBackground:"new 0 0 122.879 122.879"},e.createElement("g",null,e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"#FF4141",d:"M61.44,0c33.933,0,61.439,27.507,61.439,61.439 s-27.506,61.439-61.439,61.439C27.507,122.879,0,95.372,0,61.439S27.507,0,61.44,0L61.44,0z M73.451,39.151 c2.75-2.793,7.221-2.805,9.986-0.027c2.764,2.776,2.775,7.292,0.027,10.083L71.4,61.445l12.076,12.249 c2.729,2.77,2.689,7.257-0.08,10.022c-2.773,2.765-7.23,2.758-9.955-0.013L61.446,71.54L49.428,83.728 c-2.75,2.793-7.22,2.805-9.986,0.027c-2.763-2.776-2.776-7.293-0.027-10.084L51.48,61.434L39.403,49.185 c-2.728-2.769-2.689-7.256,0.082-10.022c2.772-2.765,7.229-2.758,9.953,0.013l11.997,12.165L73.451,39.151L73.451,39.151z"}))),l=()=>e.createElement("svg",{className:"checkmark",viewBox:"0 0 52 52"},e.createElement("circle",{className:"checkmark__circle",cx:"26",cy:"26",r:"25",fill:"none"}),e.createElement("path",{className:"checkmark__check",fill:"none",d:"M14.1 27.2l7.1 7.2 16.7-16.8"})),c=({value:a,requirement:n})=>{const[o,c]=t();return r((()=>{c(n.validator(a))}),[a,n]),e.createElement("div",{className:"requirement"},o?e.createElement(l,null):e.createElement(i,null),e.createElement("p",{className:o?"valid":"invalid"},n.text))},s=({value:t,requirements:n,onValidChange:o})=>{const i=a(o,[]);return r((()=>{i(n.every((e=>e.validator(t))))}),[t,n,i]),n.map(((r,a)=>e.createElement(c,{key:a,value:t,requirement:r,onValidChange:o})))};function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},m.apply(this,arguments)}const d=t=>e.createElement(n,m({},t,{sx:{background:"linear-gradient(45deg, rgba(251,246,137,1) 30%, rgba(252,242,138,1) 90%)"}}));function p({label:t,backgroundColor:r="red",size:a="md",onClick:n}){let o=1;"sm"===a&&(o=.75),"lg"===a&&(o=1.25);const i={backgroundColor:r,padding:`${.5*o}rem ${1*o}rem`,border:"none"};return e.createElement("button",{style:i,onClick:n},t)}function f({children:t,spacing:r=2,direction:a="row",wrap:n=!1}){const o={display:"flex",gap:.25*r+"rem",flexWrap:n?"wrap":"nowrap",flexDirection:a};return e.createElement("div",{style:o},t)}p.propTypes={label:o.string,backgroundColor:o.string,size:o.oneOf(["sm","md","lg"]),onClick:o.func},f.propTypes={spacing:o.number,wrap:o.bool,direction:o.oneOf(["row","column"])};export{p as Button,d as NoteTextField,s as Requirements,f as Stack};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var e=require("react"),r=require("@mui/material"),t=require("prop-types");require("next/image"),require("next/router"),require("next/link"),require("@mui/icons-material/Close"),require("@mui/icons-material/MoreVert");!function(e,r){void 0===r&&(r={});var t=r.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}(".requirement{align-items:center;display:flex;height:35px}.requirement p{font-family:sans-serif;font-size:14px;font-weight:700;margin-left:10px}.invalid{color:red}.valid{color:#7ac142}.checkmark{stroke-width:5;stroke:#fff;stroke-miterlimit:10;animation:fill .4s ease-in-out .4s forwards,scale .3s ease-in-out .9s both;border-radius:50%;box-shadow:inset 0 0 0 #7ac142;display:block;height:15px;width:15px}.checkmark__circle{stroke-dasharray:166;stroke-dashoffset:166;stroke-width:2;stroke-miterlimit:10;stroke:#7ac142;fill:none;animation:stroke .6s cubic-bezier(.65,0,.45,1) forwards}.checkmark__check{stroke-dasharray:48;stroke-dashoffset:48;animation:stroke .2s cubic-bezier(.65,0,.45,1) .5s forwards;transform-origin:50% 50%}@keyframes stroke{to{stroke-dashoffset:0}}@keyframes scale{0%,to{transform:none}50%{transform:scale3d(1.1,1.1,1)}}@keyframes fill{to{box-shadow:inset 0 0 0 30px #7ac142}}");const a=()=>e.createElement("svg",{x:"0px",y:"0px",width:"15px",height:"15px",viewBox:"0 0 122.879 122.879",enableBackground:"new 0 0 122.879 122.879"},e.createElement("g",null,e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"#FF4141",d:"M61.44,0c33.933,0,61.439,27.507,61.439,61.439 s-27.506,61.439-61.439,61.439C27.507,122.879,0,95.372,0,61.439S27.507,0,61.44,0L61.44,0z M73.451,39.151 c2.75-2.793,7.221-2.805,9.986-0.027c2.764,2.776,2.775,7.292,0.027,10.083L71.4,61.445l12.076,12.249 c2.729,2.77,2.689,7.257-0.08,10.022c-2.773,2.765-7.23,2.758-9.955-0.013L61.446,71.54L49.428,83.728 c-2.75,2.793-7.22,2.805-9.986,0.027c-2.763-2.776-2.776-7.293-0.027-10.084L51.48,61.434L39.403,49.185 c-2.728-2.769-2.689-7.256,0.082-10.022c2.772-2.765,7.229-2.758,9.953,0.013l11.997,12.165L73.451,39.151L73.451,39.151z"}))),n=()=>e.createElement("svg",{className:"checkmark",viewBox:"0 0 52 52"},e.createElement("circle",{className:"checkmark__circle",cx:"26",cy:"26",r:"25",fill:"none"}),e.createElement("path",{className:"checkmark__check",fill:"none",d:"M14.1 27.2l7.1 7.2 16.7-16.8"})),i=({value:r,requirement:t})=>{const[i,o]=e.useState();return e.useEffect((()=>{o(t.validator(r))}),[r,t]),e.createElement("div",{className:"requirement"},i?e.createElement(n,null):e.createElement(a,null),e.createElement("p",{className:i?"valid":"invalid"},t.text))};function o(){return o=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},o.apply(this,arguments)}function s({label:r,backgroundColor:t="red",size:a="md",onClick:n}){let i=1;"sm"===a&&(i=.75),"lg"===a&&(i=1.25);const o={backgroundColor:t,padding:`${.5*i}rem ${1*i}rem`,border:"none"};return e.createElement("button",{style:o,onClick:n},r)}function l({children:r,spacing:t=2,direction:a="row",wrap:n=!1}){const i={display:"flex",gap:.25*t+"rem",flexWrap:n?"wrap":"nowrap",flexDirection:a};return e.createElement("div",{style:i},r)}s.propTypes={label:t.string,backgroundColor:t.string,size:t.oneOf(["sm","md","lg"]),onClick:t.func},l.propTypes={spacing:t.number,wrap:t.bool,direction:t.oneOf(["row","column"])},exports.Button=s,exports.NoteTextField=t=>e.createElement(r.TextField,o({},t,{sx:{background:"linear-gradient(45deg, rgba(251,246,137,1) 30%, rgba(252,242,138,1) 90%)"}})),exports.Requirements=({value:r,requirements:t,onValidChange:a})=>{const n=e.useCallback(a,[]);return e.useEffect((()=>{n(t.every((e=>e.validator(r))))}),[r,t,n]),t.map(((t,n)=>e.createElement(i,{key:n,value:r,requirement:t,onValidChange:a})))},exports.Stack=l;
|
package/next.config.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/** @type {import('next').NextConfig} */
|
|
4
|
+
const nextConfig = {
|
|
5
|
+
/* config options here */
|
|
6
|
+
images: {
|
|
7
|
+
remotePatterns: [{
|
|
8
|
+
protocol: 'https',
|
|
9
|
+
hostname: 'www.google.com',
|
|
10
|
+
pathname: '/images/**',
|
|
11
|
+
} ],
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = nextConfig
|
package/package.json
CHANGED
|
@@ -1,73 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "umwd-components",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "UMWD Component library",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.es.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"
|
|
9
|
-
"build": "
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"not
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"last 1
|
|
32
|
-
"last 1
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"@emotion/
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@rollup/plugin-
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@storybook/addon-
|
|
44
|
-
"@storybook/addon-
|
|
45
|
-
"@storybook/
|
|
46
|
-
"@storybook/
|
|
47
|
-
"@storybook/
|
|
48
|
-
"@storybook/
|
|
49
|
-
"@storybook/
|
|
50
|
-
"@testing-library
|
|
51
|
-
"@testing-library/
|
|
52
|
-
"@testing-library/
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"react
|
|
58
|
-
"react-
|
|
59
|
-
"rollup": "^
|
|
60
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
61
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"@mui/material": "^5.
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "umwd-components",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "UMWD Component library",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.es.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"storybook": "storybook dev -p 6006",
|
|
9
|
+
"build-storybook": "storybook build",
|
|
10
|
+
"build-lib": "rollup -c",
|
|
11
|
+
"build-next": "next build",
|
|
12
|
+
"develop": "next dev",
|
|
13
|
+
"dev": "next dev",
|
|
14
|
+
"start": "next start -p 3000",
|
|
15
|
+
"deploy": "next build && next export",
|
|
16
|
+
"lint": "next lint",
|
|
17
|
+
"lint:fix": "next lint --fix"
|
|
18
|
+
},
|
|
19
|
+
"eslintConfig": {
|
|
20
|
+
"extends": [
|
|
21
|
+
"next"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"browserslist": {
|
|
25
|
+
"production": [
|
|
26
|
+
">0.2%",
|
|
27
|
+
"not dead",
|
|
28
|
+
"not op_mini all"
|
|
29
|
+
],
|
|
30
|
+
"development": [
|
|
31
|
+
"last 1 chrome version",
|
|
32
|
+
"last 1 firefox version",
|
|
33
|
+
"last 1 safari version"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@emotion/react": "^11.11.3",
|
|
38
|
+
"@emotion/styled": "^11.11.0",
|
|
39
|
+
"@babel/preset-react": "7.23.3",
|
|
40
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
41
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
42
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
43
|
+
"@storybook/addon-essentials": "^7.6.7",
|
|
44
|
+
"@storybook/addon-interactions": "^7.6.7",
|
|
45
|
+
"@storybook/addon-links": "^7.6.7",
|
|
46
|
+
"@storybook/addon-onboarding": "^1.0.10",
|
|
47
|
+
"@storybook/blocks": "^7.6.7",
|
|
48
|
+
"@storybook/nextjs": "^7.6.16",
|
|
49
|
+
"@storybook/react": "^7.6.7",
|
|
50
|
+
"@storybook/testing-library": "^0.2.2",
|
|
51
|
+
"@testing-library/jest-dom": "^6.1.6",
|
|
52
|
+
"@testing-library/react": "^14.1.2",
|
|
53
|
+
"@testing-library/user-event": "^14.5.2",
|
|
54
|
+
"babel-plugin-named-exports-order": "^0.0.2",
|
|
55
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
56
|
+
"prop-types": "^15.8.1",
|
|
57
|
+
"react": "^18.2.0",
|
|
58
|
+
"react-dom": "^18.2.0",
|
|
59
|
+
"rollup": "^4.9.2",
|
|
60
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
61
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
62
|
+
"storybook": "^7.6.7",
|
|
63
|
+
"web-vitals": "^3.5.1",
|
|
64
|
+
"webpack": "^5.89.0"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@mui/icons-material": "^5.15.10",
|
|
68
|
+
"@mui/material": "^5.15.3",
|
|
69
|
+
"mui-markdown": "^1.1.13",
|
|
70
|
+
"next": "^14.1.0",
|
|
71
|
+
"prop-types": "^15.8.1",
|
|
72
|
+
"react": "^18.2.0",
|
|
73
|
+
"react-dom": "^18.2.0"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"react-dnd": "^16.0.1",
|
|
77
|
+
"react-dnd-html5-backend": "^16.0.1"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/readme.MD
ADDED
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import babel from "@rollup/plugin-babel";
|
|
2
2
|
import resolve from "@rollup/plugin-node-resolve";
|
|
3
3
|
import external from "rollup-plugin-peer-deps-external";
|
|
4
|
-
import
|
|
4
|
+
import terser from "@rollup/plugin-terser";
|
|
5
5
|
import postcss from "rollup-plugin-postcss";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const config = [
|
|
8
8
|
{
|
|
9
9
|
input: "./src/index.js",
|
|
10
10
|
output: [
|
|
@@ -33,3 +33,6 @@ export default [
|
|
|
33
33
|
],
|
|
34
34
|
},
|
|
35
35
|
];
|
|
36
|
+
|
|
37
|
+
export default config;
|
|
38
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useDrag } from "react-dnd";
|
|
3
|
+
|
|
4
|
+
const DraggableItem = ({ id, text }) => {
|
|
5
|
+
const [{ isDragging }, drag] = useDrag({
|
|
6
|
+
type: "item",
|
|
7
|
+
item: { id },
|
|
8
|
+
collect: (monitor) => ({
|
|
9
|
+
isDragging: !!monitor.isDragging(),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
ref={drag}
|
|
16
|
+
style={{
|
|
17
|
+
opacity: isDragging ? 0.5 : 1,
|
|
18
|
+
cursor: "grab",
|
|
19
|
+
border: isDragging ? "2px solid red" : "2px solid blue",
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
{text}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default DraggableItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useDrop } from "react-dnd";
|
|
3
|
+
|
|
4
|
+
const DroppableArea = ({ onDrop, children }) => {
|
|
5
|
+
const [, drop] = useDrop({
|
|
6
|
+
accept: "item",
|
|
7
|
+
drop: onDrop,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
return <div ref={drop}>{children}</div>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default DroppableArea;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { DndProvider } from "react-dnd";
|
|
3
|
+
import DraggableItem from "./DraggableItem";
|
|
4
|
+
import DroppableArea from "./DroppableArea";
|
|
5
|
+
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
6
|
+
|
|
7
|
+
const DragAndDropList = () => {
|
|
8
|
+
const [items, setItems] = useState([
|
|
9
|
+
{ id: 1, text: "Item 1" },
|
|
10
|
+
{ id: 2, text: "Item 2" },
|
|
11
|
+
{ id: 3, text: "Item 3" },
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
const handleDrop = (item) => {
|
|
15
|
+
// Implement logic to update the order of items after drop
|
|
16
|
+
console.log("Item dropped:", item);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<DndProvider backend={HTML5Backend}>
|
|
21
|
+
<DroppableArea onDrop={handleDrop}>
|
|
22
|
+
{items.map((item) => (
|
|
23
|
+
<DraggableItem key={item.id} id={item.id} text={item.text} />
|
|
24
|
+
))}
|
|
25
|
+
</DroppableArea>
|
|
26
|
+
</DndProvider>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { DragAndDropList };
|