@ieee-ui/ui 0.0.2 → 0.0.3

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.
Binary file
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>ieee-ui</title>
8
+ <script type="module" crossorigin src="/assets/index-RGyfg9nZ.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-C37uuph3.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.0.2",
6
+ "version": "0.0.3",
7
7
  "type": "module",
8
8
  "main": "./dist/ieee-ui.cjs.js",
9
9
  "module": "./dist/ieee-ui.es.js",
@@ -32,8 +32,9 @@
32
32
  "react-dom": "^19.0.0"
33
33
  },
34
34
  "dependencies": {
35
- "react": "^19.2.0",
36
- "react-dom": "^19.2.0"
35
+ "react": "^19.0.0",
36
+ "react-dom": "^19.0.0",
37
+ "react-icons": "^5.5.0"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@eslint/js": "^9.39.1",
@@ -1,91 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react");var L={exports:{}},D={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Q;function re(){if(Q)return D;Q=1;var m=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function c(p,d,i){var g=null;if(i!==void 0&&(g=""+i),d.key!==void 0&&(g=""+d.key),"key"in d){i={};for(var h in d)h!=="key"&&(i[h]=d[h])}else i=d;return d=i.ref,{$$typeof:m,type:p,key:g,ref:d!==void 0?d:null,props:i}}return D.Fragment=f,D.jsx=c,D.jsxs=c,D}var F={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var K;function ne(){return K||(K=1,process.env.NODE_ENV!=="production"&&(function(){function m(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===G?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case W:return"Profiler";case O:return"StrictMode";case J:return"Suspense";case U:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case S:return"Portal";case z:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case V:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return n=e.displayName||null,n!==null?n:m(e.type)||"Memo";case P:n=e._payload,e=e._init;try{return m(e(n))}catch{}}return null}function f(e){return""+e}function c(e){try{f(e);var n=!1}catch{n=!0}if(n){n=console;var s=n.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),f(e)}}function p(e){if(e===N)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===P)return"<...>";try{var n=m(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function d(){var e=Y.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function g(e){if(M.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function h(e,n){function s(){C||(C=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function T(){var e=m(this.type);return $[e]||($[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function y(e,n,s,l,j,v){var u=s.ref;return e={$$typeof:w,type:e,key:n,props:s,_owner:l},(u!==void 0?u:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:T}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:j}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:v}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function b(e,n,s,l,j,v){var u=n.children;if(u!==void 0)if(l)if(X(u)){for(l=0;l<u.length;l++)x(u[l]);Object.freeze&&Object.freeze(u)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else x(u);if(M.call(n,"key")){u=m(e);var R=Object.keys(n).filter(function(te){return te!=="key"});l=0<R.length?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}",k[u+l]||(R=0<R.length?"{"+R.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
- let props = %s;
19
- <%s {...props} />
20
- React keys must be passed directly to JSX without using spread:
21
- let props = %s;
22
- <%s key={someKey} {...props} />`,l,u,R,u),k[u+l]=!0)}if(u=null,s!==void 0&&(c(s),u=""+s),g(n)&&(c(n.key),u=""+n.key),"key"in n){s={};for(var H in n)H!=="key"&&(s[H]=n[H])}else s=n;return u&&h(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),y(e,u,s,d(),j,v)}function x(e){_(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===P&&(e._payload.status==="fulfilled"?_(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function _(e){return typeof e=="object"&&e!==null&&e.$$typeof===w}var a=E,w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),z=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),G=Symbol.for("react.client.reference"),Y=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,X=Array.isArray,A=console.createTask?console.createTask:function(){return null};a={react_stack_bottom_frame:function(e){return e()}};var C,$={},t=a.react_stack_bottom_frame.bind(a,i)(),o=A(p(i)),k={};F.Fragment=N,F.jsx=function(e,n,s){var l=1e4>Y.recentlyCreatedOwnerStacks++;return b(e,n,s,!1,l?Error("react-stack-top-frame"):t,l?A(p(e)):o)},F.jsxs=function(e,n,s){var l=1e4>Y.recentlyCreatedOwnerStacks++;return b(e,n,s,!0,l?Error("react-stack-top-frame"):t,l?A(p(e)):o)}})()),F}var ee;function oe(){return ee||(ee=1,process.env.NODE_ENV==="production"?L.exports=re():L.exports=ne()),L.exports}var r=oe();const Z=({children:m,variant:f="primary",size:c="medium",isLoading:p=!1,leftIcon:d,rightIcon:i,disabled:g,className:h="",...T})=>{const y=`
23
- inline-flex items-center justify-center gap-2
24
- font-semibold rounded-lg
25
- transition-all duration-200
26
- focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
27
- disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none
28
- `,b={primary:`
29
- bg-primary text-primary-foreground
30
- hover:bg-primary/90 active:bg-primary/80
31
- shadow-sm hover:shadow
32
- `,secondary:`
33
- bg-secondary text-secondary-foreground
34
- hover:bg-secondary/90 active:bg-secondary/80
35
- shadow-sm hover:shadow
36
- `,accent:`
37
- bg-accent text-accent-foreground
38
- hover:bg-accent/90 active:bg-accent/80
39
- shadow-sm hover:shadow
40
- `,danger:`
41
- bg-destructive text-destructive-foreground
42
- hover:bg-destructive/90 active:bg-destructive/80
43
- shadow-sm hover:shadow
44
- `,success:`
45
- bg-success text-success-foreground
46
- hover:bg-success/90 active:bg-success/80
47
- shadow-sm hover:shadow
48
- `,info:`
49
- bg-info text-info-foreground
50
- hover:bg-info/90 active:bg-info/80
51
- shadow-sm hover:shadow
52
- `,highlight:`
53
- bg-highlight text-highlight-foreground
54
- hover:bg-highlight/90 active:bg-highlight/80
55
- shadow-sm hover:shadow
56
- `,outline:`
57
- bg-transparent border-2 border-primary text-primary
58
- hover:bg-primary/5 active:bg-primary/10
59
- `,ghost:`
60
- bg-transparent text-primary
61
- hover:bg-muted active:bg-muted/80
62
- `},x={small:"px-3 py-1.5 text-sm",medium:"px-5 py-2.5 text-base",large:"px-7 py-3.5 text-lg"};return r.jsxs("button",{className:`
63
- ${y}
64
- ${b[f]}
65
- ${x[c]}
66
- ${h}
67
- `,disabled:g||p,...T,children:[p&&r.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),!p&&d&&r.jsx("span",{children:d}),m,!p&&i&&r.jsx("span",{children:i})]})},se=({label:m,error:f,className:c="",...p})=>r.jsxs("div",{className:"flex flex-col gap-1",children:[m&&r.jsx("label",{className:"text-sm font-medium text-gray-700",children:m}),r.jsx("input",{className:`px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 ${f?"border-red-500":"border-gray-300"} ${c}`,...p}),f&&r.jsx("span",{className:"text-xs text-red-500",children:f})]}),ae=({label:m,value:f,onChange:c,placeholder:p="Select date",error:d,disabled:i=!1,minDate:g,maxDate:h,className:T=""})=>{const[y,b]=E.useState(!1),[x,_]=E.useState(f),[a,w]=E.useState(f?new Date(f.getFullYear(),f.getMonth(),1):new Date(new Date().getFullYear(),new Date().getMonth(),1)),[S,N]=E.useState(!1),O=E.useRef(null);E.useEffect(()=>{const t=o=>{O.current&&!O.current.contains(o.target)&&b(!1)};return y&&document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[y]);const W=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],I=["January","February","March","April","May","June","July","August","September","October","November","December"],z=t=>{const o=t.getFullYear(),k=t.getMonth(),e=new Date(o,k,1),s=new Date(o,k+1,0).getDate(),l=e.getDay(),j=[];for(let v=0;v<l;v++)j.push(null);for(let v=1;v<=s;v++)j.push(v);return j},V=()=>{w(new Date(a.getFullYear(),a.getMonth()-1,1))},J=()=>{w(new Date(a.getFullYear(),a.getMonth()+1,1))},U=t=>{w(new Date(a.getFullYear(),t,1))},q=t=>{w(new Date(t,a.getMonth(),1)),N(!1)},P=()=>{const t=new Date().getFullYear(),o=g?g.getFullYear():t-100,k=h?h.getFullYear():t+100,e=[];for(let n=o;n<=k;n++)e.push(n);return e},B=t=>{const o=new Date(a.getFullYear(),a.getMonth(),t);g&&o<g||h&&o>h||(_(o),c==null||c(o),b(!1))},G=()=>{const t=new Date;w(new Date(t.getFullYear(),t.getMonth(),1)),_(t),c==null||c(t),b(!1)},Y=()=>{_(void 0),c==null||c(void 0)},M=t=>{const o=new Date(a.getFullYear(),a.getMonth(),t);return!!(g&&o<g||h&&o>h)},X=t=>{const o=new Date;return t===o.getDate()&&a.getMonth()===o.getMonth()&&a.getFullYear()===o.getFullYear()},A=t=>x?t===x.getDate()&&a.getMonth()===x.getMonth()&&a.getFullYear()===x.getFullYear():!1,C=t=>t?t.toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"}):"",$=z(a);return r.jsxs("div",{className:`relative ${T}`,ref:O,children:[r.jsxs("div",{className:"flex flex-col gap-1",children:[m&&r.jsx("label",{className:"text-xs font-medium text-text-muted tracking-wide uppercase",children:m}),r.jsxs("div",{className:`
68
- relative flex items-center gap-2 px-4 py-3
69
- bg-surface border-b-2 transition-all cursor-pointer
70
- rounded-t-lg
71
- ${y?"border-primary bg-background-light":"border-border"}
72
- ${d?"border-destructive":""}
73
- ${i?"opacity-50 cursor-not-allowed":"hover:bg-background-light"}
74
- `,onClick:()=>!i&&b(!y),children:[r.jsx("input",{type:"text",value:C(x),placeholder:p,readOnly:!0,disabled:i,className:`
75
- flex-1 bg-transparent outline-none cursor-pointer
76
- text-text-primary placeholder:text-muted-foreground
77
- ${i?"cursor-not-allowed":""}
78
- `}),r.jsx("svg",{className:"w-5 h-5 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),x&&!i&&r.jsx("button",{onClick:t=>{t.stopPropagation(),Y()},className:"p-1 rounded-full hover:bg-muted transition-colors",type:"button",children:r.jsx("svg",{className:"w-4 h-4 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d&&r.jsx("span",{className:"text-xs text-destructive tracking-wide",children:d})]}),y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"md:hidden fixed inset-0 bg-black/20 z-40"}),r.jsxs("div",{className:`
79
- fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 w-[90vw] max-w-sm
80
- md:absolute md:top-full md:left-0 md:mt-1 md:z-10 md:w-80 md:translate-x-0 md:translate-y-0
81
- bg-card shadow-2xl rounded-lg overflow-hidden border border-border
82
- `,children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 md:px-4 md:py-3 bg-primary text-primary-foreground",children:[r.jsx("button",{onClick:V,className:"p-1.5 md:p-2 rounded-full hover:bg-white/10 transition-colors",type:"button","aria-label":"Previous month",children:r.jsx("svg",{className:"w-4 h-4 md:w-5 md:h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),r.jsxs("div",{className:"flex items-center gap-1.5 md:gap-2",children:[r.jsx("select",{value:a.getMonth(),onChange:t=>U(Number(t.target.value)),className:"bg-white/10 hover:bg-white/20 px-1.5 py-0.5 md:px-2 md:py-1 rounded text-xs md:text-sm font-medium cursor-pointer outline-none focus:ring-2 focus:ring-white/30 transition-colors",onClick:t=>t.stopPropagation(),children:I.map((t,o)=>r.jsx("option",{value:o,className:"bg-card text-text-primary",children:t},t))}),r.jsxs("button",{onClick:()=>N(!S),className:"bg-white/10 hover:bg-white/20 px-1.5 py-0.5 md:px-2 md:py-1 rounded text-xs md:text-sm font-medium transition-colors",type:"button",children:[a.getFullYear(),r.jsx("svg",{className:`w-3 h-3 inline-block ml-0.5 md:ml-1 transition-transform ${S?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),r.jsx("button",{onClick:J,className:"p-1.5 md:p-2 rounded-full hover:bg-white/10 transition-colors",type:"button","aria-label":"Next month",children:r.jsx("svg",{className:"w-4 h-4 md:w-5 md:h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),S?r.jsx("div",{className:"p-3 md:p-4 bg-card max-h-64 overflow-y-auto",children:r.jsx("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-1.5 md:gap-2",children:P().map(t=>r.jsx("button",{onClick:()=>q(t),type:"button",className:`
83
- px-2 py-1.5 md:px-3 md:py-2 rounded-lg text-xs md:text-sm font-medium transition-all
84
- ${t===a.getFullYear()?"bg-primary text-primary-foreground shadow-md scale-105 hover:bg-primary/90":t===new Date().getFullYear()?"bg-accent/20 text-accent-foreground font-bold hover:bg-accent/30":"text-text-primary hover:bg-muted hover:scale-105"}
85
- `,children:t},t))})}):r.jsxs("div",{className:"p-3 md:p-4 bg-card",children:[r.jsx("div",{className:"grid grid-cols-7 gap-0.5 md:gap-1 mb-1.5 md:mb-2",children:W.map(t=>r.jsx("div",{className:"text-center text-[10px] md:text-xs font-medium text-muted-foreground py-1.5 md:py-2",children:t},t))}),r.jsx("div",{className:"grid grid-cols-7 gap-0.5 md:gap-1",children:$.map((t,o)=>r.jsx("button",{onClick:()=>{t&&!M(t)&&B(t)},type:"button",className:`
86
- aspect-square flex items-center justify-center rounded-full
87
- text-xs md:text-sm font-medium transition-all
88
- ${t?"":"invisible"}
89
- ${t&&A(t)?"bg-primary text-primary-foreground shadow-md scale-105 hover:bg-primary/90":t&&X(t)?"bg-accent text-accent-foreground font-bold hover:bg-accent/90 hover:scale-105":"text-text-primary hover:bg-muted hover:scale-110"}
90
- ${t&&M(t)?"opacity-30 cursor-not-allowed":"cursor-pointer"}
91
- `,children:t},o))})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 md:px-4 md:py-3 bg-surface border-t border-border gap-2",children:[r.jsx(Z,{variant:"outline",size:"small",onClick:G,type:"button",className:"text-xs md:text-sm px-2 md:px-3",children:"Today"}),r.jsx(Z,{variant:"primary",size:"small",onClick:()=>b(!1),type:"button",className:"text-xs md:text-sm px-2 md:px-3",children:"Done"})]})]})]})]})};exports.Button=Z;exports.DatePicker=ae;exports.Input=se;