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.
@@ -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: "@storybook/react-webpack5",
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;
@@ -8,6 +8,7 @@ const preview = {
8
8
  date: /Date$/i,
9
9
  },
10
10
  },
11
+ layout: "fullscreen",
11
12
  },
12
13
  };
13
14
 
package/aant.txt ADDED
@@ -0,0 +1,10 @@
1
+ publishing to npm
2
+
3
+ package version ++
4
+
5
+ npm login
6
+
7
+ jellepa
8
+ ueHs/fW%&66BNs)
9
+
10
+ npm publish
package/dist/index.es.js CHANGED
@@ -1 +1 @@
1
- import e,{useState as r,useEffect as t,useCallback as a}from"react";import{TextField as n}from"@mui/material";import o from"prop-types";!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 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]=r();return t((()=>{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:r,requirements:n,onValidChange:o})=>{const i=a(o,[]);return t((()=>{i(n.every((e=>e.validator(r))))}),[r,n,i]),n.map(((t,a)=>e.createElement(c,{key:a,value:r,requirement:t,onValidChange:o})))};function m(){return m=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},m.apply(this,arguments)}const d=r=>e.createElement(n,m({},r,{sx:{background:"linear-gradient(45deg, rgba(251,246,137,1) 30%, rgba(252,242,138,1) 90%)"}}));function f({label:r,backgroundColor:t="red",size:a="md",onClick:n}){let o=1;"sm"===a&&(o=.75),"lg"===a&&(o=1.25);const i={backgroundColor:t,padding:`${.5*o}rem ${1*o}rem`,border:"none"};return e.createElement("button",{style:i,onClick:n},r)}function p({children:r,spacing:t=2,direction:a="row",wrap:n=!1}){const o={display:"flex",gap:.25*t+"rem",flexWrap:n?"wrap":"nowrap",flexDirection:a};return e.createElement("div",{style:o},r)}f.propTypes={label:o.string,backgroundColor:o.string,size:o.oneOf(["sm","md","lg"]),onClick:o.func},p.propTypes={spacing:o.number,wrap:o.bool,direction:o.oneOf(["row","column"])};export{f as Button,d as NoteTextField,s as Requirements,p as Stack};
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";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material"),r=require("prop-types");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(e),n=a(r);!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===r&&a.firstChild?a.insertBefore(l,a.firstChild):a.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.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 o=()=>l.default.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"},l.default.createElement("g",null,l.default.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"}))),i=()=>l.default.createElement("svg",{className:"checkmark",viewBox:"0 0 52 52"},l.default.createElement("circle",{className:"checkmark__circle",cx:"26",cy:"26",r:"25",fill:"none"}),l.default.createElement("path",{className:"checkmark__check",fill:"none",d:"M14.1 27.2l7.1 7.2 16.7-16.8"})),s=({value:t,requirement:r})=>{const[a,n]=e.useState();return e.useEffect((()=>{n(r.validator(t))}),[t,r]),l.default.createElement("div",{className:"requirement"},a?l.default.createElement(i,null):l.default.createElement(o,null),l.default.createElement("p",{className:a?"valid":"invalid"},r.text))};function c(){return c=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},c.apply(this,arguments)}function d({label:e,backgroundColor:t="red",size:r="md",onClick:a}){let n=1;"sm"===r&&(n=.75),"lg"===r&&(n=1.25);const o={backgroundColor:t,padding:`${.5*n}rem ${1*n}rem`,border:"none"};return l.default.createElement("button",{style:o,onClick:a},e)}function u({children:e,spacing:t=2,direction:r="row",wrap:a=!1}){const n={display:"flex",gap:.25*t+"rem",flexWrap:a?"wrap":"nowrap",flexDirection:r};return l.default.createElement("div",{style:n},e)}d.propTypes={label:n.default.string,backgroundColor:n.default.string,size:n.default.oneOf(["sm","md","lg"]),onClick:n.default.func},u.propTypes={spacing:n.default.number,wrap:n.default.bool,direction:n.default.oneOf(["row","column"])},exports.Button=d,exports.NoteTextField=e=>l.default.createElement(t.TextField,c({},e,{sx:{background:"linear-gradient(45deg, rgba(251,246,137,1) 30%, rgba(252,242,138,1) 90%)"}})),exports.Requirements=({value:t,requirements:r,onValidChange:a})=>{const n=e.useCallback(a,[]);return e.useEffect((()=>{n(r.every((e=>e.validator(t))))}),[t,r,n]),r.map(((e,r)=>l.default.createElement(s,{key:r,value:t,requirement:e,onValidChange:a})))},exports.Stack=u;
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.5",
4
- "description": "UMWD Component library",
5
- "main": "dist/index.js",
6
- "module": "dist/index.es.js",
7
- "scripts": {
8
- "start": "react-scripts start",
9
- "build": "react-scripts build",
10
- "test": "react-scripts test",
11
- "eject": "react-scripts eject",
12
- "storybook": "storybook dev -p 6006",
13
- "build-storybook": "storybook build",
14
- "build-lib": "rollup -c"
15
- },
16
- "eslintConfig": {
17
- "extends": [
18
- "react-app",
19
- "react-app/jest",
20
- "plugin:storybook/recommended"
21
- ]
22
- },
23
- "browserslist": {
24
- "production": [
25
- ">0.2%",
26
- "not dead",
27
- "not op_mini all"
28
- ],
29
- "development": [
30
- "last 1 chrome version",
31
- "last 1 firefox version",
32
- "last 1 safari version"
33
- ]
34
- },
35
- "devDependencies": {
36
- "@emotion/react": "^11.11.1",
37
- "@emotion/styled": "^11.11.0",
38
- "@mui/material": "^5.14.18",
39
- "@rollup/plugin-babel": "^6.0.4",
40
- "@rollup/plugin-node-resolve": "^15.2.3",
41
- "@storybook/addon-essentials": "^7.5.3",
42
- "@storybook/addon-interactions": "^7.5.3",
43
- "@storybook/addon-links": "^7.5.3",
44
- "@storybook/addon-onboarding": "^1.0.8",
45
- "@storybook/blocks": "^7.5.3",
46
- "@storybook/preset-create-react-app": "^7.5.3",
47
- "@storybook/react": "^7.5.3",
48
- "@storybook/react-webpack5": "^7.5.3",
49
- "@storybook/testing-library": "^0.2.2",
50
- "@testing-library/jest-dom": "^5.17.0",
51
- "@testing-library/react": "^13.4.0",
52
- "@testing-library/user-event": "^13.5.0",
53
- "babel-plugin-named-exports-order": "^0.0.2",
54
- "eslint-plugin-storybook": "^0.6.15",
55
- "prop-types": "^15.8.1",
56
- "react": "^18.2.0",
57
- "react-dom": "^18.2.0",
58
- "react-scripts": "5.0.1",
59
- "rollup": "^2.79.1",
60
- "rollup-plugin-peer-deps-external": "^2.2.4",
61
- "rollup-plugin-postcss": "^4.0.2",
62
- "rollup-plugin-terser": "^7.0.2",
63
- "storybook": "^7.5.3",
64
- "web-vitals": "^2.1.4",
65
- "webpack": "^5.89.0"
66
- },
67
- "peerDependencies": {
68
- "@mui/material": "^5.14.18",
69
- "prop-types": "^15.8.1",
70
- "react": "^18.2.0",
71
- "react-dom": "^18.2.0"
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
+ }
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 { terser } from "rollup-plugin-terser";
4
+ import terser from "@rollup/plugin-terser";
5
5
  import postcss from "rollup-plugin-postcss";
6
6
 
7
- export default [
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 };