dishui 0.0.1 → 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.
- package/dist/dishui.css +1 -1
- package/dist/dishui.es.js +346 -294
- package/dist/dishui.umd.js +4 -4
- package/package.json +20 -14
package/dist/dishui.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(y,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(y=typeof globalThis<"u"?globalThis:y||self,x(y.DiShUI={},y.React))})(this,function(y,x){"use strict";var K={exports:{}},J={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var te;function le(){if(te)return
|
|
9
|
+
*/var te;function le(){if(te)return J;te=1;var f=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function p(n,u,t){var v=null;if(t!==void 0&&(v=""+t),u.key!==void 0&&(v=""+u.key),"key"in u){t={};for(var c in u)c!=="key"&&(t[c]=u[c])}else t=u;return u=t.ref,{$$typeof:f,type:n,key:v,ref:u!==void 0?u:null,props:t}}return J.Fragment=i,J.jsx=p,J.jsxs=p,J}var X={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var re;function ie(){return re||(re=1,process.env.NODE_ENV!=="production"&&function(){function
|
|
17
|
+
*/var re;function ie(){return re||(re=1,process.env.NODE_ENV!=="production"&&function(){function f(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case I:return"Profiler";case $:return"StrictMode";case q:return"Suspense";case M:return"SuspenseList";case z: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 a:return"Portal";case Y:return(e.displayName||"Context")+".Provider";case S:return(e._context.displayName||"Context")+".Consumer";case A:var s=e.render;return e=e.displayName,e||(e=s.displayName||s.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return s=e.displayName||null,s!==null?s:f(e.type)||"Memo";case L:s=e._payload,e=e._init;try{return f(e(s))}catch{}}return null}function i(e){return""+e}function p(e){try{i(e);var s=!1}catch{s=!0}if(s){s=console;var l=s.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return l.call(s,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),i(e)}}function n(e){if(e===R)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===L)return"<...>";try{var s=f(e);return s?"<"+s+">":"<...>"}catch{return"<...>"}}function u(){var e=j.A;return e===null?null:e.getOwner()}function t(){return Error("react-stack-top-frame")}function v(e){if(N.call(e,"key")){var s=Object.getOwnPropertyDescriptor(e,"key").get;if(s&&s.isReactWarning)return!1}return e.key!==void 0}function c(e,s){function l(){U||(U=!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)",s))}l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,configurable:!0})}function g(){var e=f(this.type);return B[e]||(B[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 E(e,s,l,b,O,h,k,P){return l=h.ref,e={$$typeof:o,type:e,key:s,props:h,_owner:O},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:g}):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:k}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function w(e,s,l,b,O,h,k,P){var m=s.children;if(m!==void 0)if(b)if(G(m)){for(b=0;b<m.length;b++)T(m[b]);Object.freeze&&Object.freeze(m)}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 T(m);if(N.call(s,"key")){m=f(e);var F=Object.keys(s).filter(function(se){return se!=="key"});b=0<F.length?"{key: someKey, "+F.join(": ..., ")+": ...}":"{key: someKey}",Q[m+b]||(F=0<F.length?"{"+F.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,b,m,F,m),Q[m+b]=!0)}if(m=null,l!==void 0&&(p(l),m=""+l),v(s)&&(p(s.key),m=""+s.key),"key"in s){l={};for(var H in s)H!=="key"&&(l[H]=s[H])}else l=s;return m&&c(l,typeof e=="function"?e.displayName||e.name||"Unknown":e),E(e,m,h,O,u(),l,k,P)}function T(e){typeof e=="object"&&e!==null&&e.$$typeof===o&&e._store&&(e._store.validated=1)}var d=x,o=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),_=Symbol.for("react.client.reference"),j=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,G=Array.isArray,W=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(e){return e()}};var U,B={},D=d["react-stack-bottom-frame"].bind(d,t)(),Z=W(n(t)),Q={};X.Fragment=R,X.jsx=function(e,s,l,b,O){var h=1e4>j.recentlyCreatedOwnerStacks++;return w(e,s,l,!1,b,O,h?Error("react-stack-top-frame"):D,h?W(n(e)):Z)},X.jsxs=function(e,s,l,b,O){var h=1e4>j.recentlyCreatedOwnerStacks++;return w(e,s,l,!0,b,O,h?Error("react-stack-top-frame"):D,h?W(n(e)):Z)}}()),X}var ne;function ce(){return ne||(ne=1,process.env.NODE_ENV==="production"?K.exports=le():K.exports=ie()),K.exports}var r=ce();const ue=({children:f,variant:i="primary",size:p="md",outline:n=!1,dash:u=!1,soft:t=!1,active:v=!1,disabled:c=!1,wide:g=!1,block:E=!1,square:w=!1,circle:T=!1,leftSection:d,rightSection:o,onClick:a,className:R=""})=>{const $="btn",I=i?`btn-${i}`:"",S=p?`btn-${p}`:"",j=[$,I,S,n?"btn-outline":"",u?"btn-dash":"",t?"btn-soft":"",v?"btn-active":"",g?"btn-wide":"",E?"btn-block":"",w?"btn-square":"",T?"btn-circle":"",R].filter(Boolean).join(" ");return r.jsxs("button",{className:j,disabled:c,onClick:a,children:[d&&r.jsx("span",{className:"mr-2",children:d}),f,o&&r.jsx("span",{className:"ml-2",children:o})]})},fe=({children:f,vertical:i=!1,className:p="",rounded:n="none",radius:u="full",roundedStyle:t})=>{const v=["join",i?"join-vertical":"join-horizontal",p].filter(Boolean).join(" "),c=n!=="none"?"full":u;return r.jsx("div",{className:v,children:x.Children.map(f,(g,E)=>{if(!x.isValidElement(g))return g;const w=g,T=w.props.className||"",d=E===0,o=E===x.Children.count(f)-1;let a="";t?i?n==="left"&&d&&t.top?a=t.top:n==="right"&&o&&t.bottom?a=t.bottom:n==="both"&&(d&&t.top&&(a=t.top),o&&t.bottom&&(a=t.bottom)):n==="left"&&d&&t.left?a=t.left:n==="right"&&o&&t.right?a=t.right:n==="both"&&(d&&t.left&&(a=t.left),o&&t.right&&(a=t.right)):i?n==="left"&&d?a=`rounded-t-${c}`:n==="right"&&o?a=`rounded-b-${c}`:n==="both"&&(d&&(a=`rounded-t-${c}`),o&&(a=`rounded-b-${c}`)):n==="left"&&d?a=`rounded-l-${c}`:n==="right"&&o?a=`rounded-r-${c}`:n==="both"&&(d&&(a=`rounded-l-${c}`),o&&(a=`rounded-r-${c}`));const R=`${T} join-item ${a}`.trim();return x.cloneElement(w,{className:R})})})},de=({children:f,className:i=""})=>{const p=["join-item","flex","items-center","px-4","bg-base-200","border","border-base-300",i].filter(Boolean).join(" ");return r.jsx("div",{className:p,children:f})},ee=ue;ee.Group=fe,ee.GroupSection=de;const me=({children:f,variant:i="primary",size:p="md",outline:n=!1,className:u=""})=>{const t="badge",v=i?`badge-${i}`:"",c=p?`badge-${p}`:"",E=[t,v,c,n?"badge-outline":"",u].filter(Boolean).join(" ");return r.jsx("div",{className:E,children:f})},pe=({placeholder:f,value:i,onChange:p,type:n="text",variant:u,size:t="md",disabled:v=!1,required:c=!1,label:g,leftSection:E,rightSection:w,pattern:T,className:d="",validator:o=!1,validatorHint:a,validationRules:R=[]})=>{const[$,I]=x.useState(!1),[S,Y]=x.useState(""),[A,q]=x.useState(null),[M,V]=x.useState(!1),[L,z]=x.useState([]),_=x.useRef(null),j=n==="password"&&$?"text":n,N=h=>{const k=h.target.value;if(n==="password"&&k.length>(i||"").length){const P=k.slice((i||"").length);Y(P),setTimeout(()=>{Y("")},1e3)}o&&_.current&&G(k),p&&p(h)},G=h=>{if(!_.current)return;const k=_.current.checkValidity(),P=[];R.length>0&&R.forEach(m=>{m.pattern.test(h)||P.push(m.message)}),z(P),q(k&&P.length===0)},W=()=>{I(!$)},U=()=>{o&&!A&&V(!0)},B=()=>{V(!1)};let D="";o&&A!==null&&(D=A?"input-success":"input-error");const Z="input",Q=u&&!D?`input-${u}`:"",e=t?`input-${t}`:"",l=[Z,Q,e,o?"validator":"",D,d].filter(Boolean).join(" "),b=n==="password"&&r.jsx("span",{className:"cursor-pointer opacity-70 hover:opacity-100",onClick:W,children:$?r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[r.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),r.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),r.jsx("path",{d:"M1 1l22 22"}),r.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"})]}):r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[r.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),r.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}),O=r.jsx("div",{className:"validation-tooltip",children:L.length>0?r.jsx("ul",{className:"text-xs list-disc pl-4 py-1",children:L.map((h,k)=>r.jsx("li",{children:h},k))}):a?r.jsx("p",{className:"text-xs py-1",children:a}):null});return g||E||w||n==="password"?r.jsxs("div",{className:"relative",onMouseEnter:U,onMouseLeave:B,children:[r.jsxs("label",{className:l,children:[E&&r.jsx("span",{children:E}),g&&r.jsx("span",{children:g}),r.jsx("input",{ref:_,type:j,placeholder:f,value:i,onChange:N,disabled:v,required:c,className:"grow",pattern:T}),n==="password"&&S&&r.jsx("span",{className:"password-recent absolute right-10 font-mono",children:S}),n==="password"?r.jsx("span",{children:b}):w?r.jsx("span",{children:w}):null]}),o&&a&&!M&&r.jsx("p",{className:"validator-hint text-xs mt-1 opacity-70",children:a}),M&&o&&!A&&r.jsx("div",{className:"absolute z-10 mt-1 bg-base-200 border border-error rounded shadow-lg text-error px-3 py-1",children:O})]}):r.jsxs("div",{className:"relative",onMouseEnter:U,onMouseLeave:B,children:[r.jsx("input",{ref:_,type:j,placeholder:f,value:i,onChange:N,disabled:v,required:c,className:l,pattern:T}),o&&a&&!M&&r.jsx("p",{className:"validator-hint text-xs mt-1 opacity-70",children:a}),M&&o&&!A&&r.jsx("div",{className:"absolute z-10 mt-1 bg-base-200 border border-error rounded shadow-lg text-error px-3 py-1",children:O})]})},be=({children:f,variant:i="neutral",size:p="md",outline:n=!1,dash:u=!1,soft:t=!1,bold:v=!1,italic:c=!1,underline:g=!1,ellipsis:E=!1,maxWidth:w,stateTimeout:T,styleConfig:d={},state:o,onStateChange:a,onClick:R,onDoubleClick:$,onMouseEnter:I,onMouseLeave:S,onDragStart:Y,onDragEnd:A,draggable:q=!1,className:M="",style:V={}})=>{var ae,oe;const[L,z]=x.useState("default"),_=o!==void 0?o:L,j=x.useRef(null),N=C=>{o===void 0&&z(C),a&&a(C),G(C)},G=(C=_)=>{j.current&&(clearTimeout(j.current),j.current=null),T&&C!=="default"&&o===void 0&&(j.current=setTimeout(()=>{z("default"),a&&a("default")},T))};x.useEffect(()=>(G(),()=>{j.current&&clearTimeout(j.current)}),[_,T,o]);const W="label",U=i?`text-${i}`:"",B={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl"},D=B[p]||B.md,h=[W,U,D,n?"border border-current px-2 py-1 rounded":"",u?"border border-dashed border-current px-2 py-1 rounded":"",t?"bg-opacity-10 bg-current px-2 py-1 rounded":"",v?"font-bold":"",c?"italic":"",g?"underline":"",E?"truncate":"",M].filter(Boolean).join(" "),k=C=>{N("clicked"),R&&R(C)},P=C=>{N("doubleClicked"),$&&$(C)},m=C=>{N("hover"),I&&I(C)},F=C=>{N("default"),S&&S(C)},H=C=>{N("dragging"),Y&&Y(C)},se=C=>{N("default"),A&&A(C)},he=((ae=d[_])==null?void 0:ae.style)||{},xe=((oe=d[_])==null?void 0:oe.className)||"",Ce={...V,...he,...w?{maxWidth:w}:{},...E?{display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:{}},ve=`${h} ${xe}`.trim();return r.jsx("span",{className:ve,style:Ce,onClick:k,onDoubleClick:P,onMouseEnter:m,onMouseLeave:F,onDragStart:H,onDragEnd:se,draggable:q,children:f})};y.Badge=me,y.Button=ee,y.Input=pe,y.Label=be,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dishui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "一个基于React的vibe coding出来的UI组件库",
|
|
5
5
|
"main": "dist/dishui.umd.js",
|
|
6
6
|
"module": "dist/dishui.es.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
8
|
+
"style": "dist/dishui.css",
|
|
8
9
|
"files": [
|
|
9
10
|
"dist"
|
|
10
11
|
],
|
|
@@ -17,27 +18,32 @@
|
|
|
17
18
|
"storybook": "storybook dev -p 6006",
|
|
18
19
|
"build-storybook": "storybook build"
|
|
19
20
|
},
|
|
20
|
-
"keywords": [],
|
|
21
|
+
"keywords": ["react", "ui", "components", "tailwindcss", "css"],
|
|
21
22
|
"author": "",
|
|
22
23
|
"license": "ISC",
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"@tailwindcss/postcss": "^4.1.
|
|
25
|
-
"@types/node": "^22.
|
|
26
|
-
"@types/react": "^19.1.
|
|
27
|
-
"@types/react-dom": "^19.1.
|
|
28
|
-
"@
|
|
25
|
+
"@tailwindcss/postcss": "^4.1.6",
|
|
26
|
+
"@types/node": "^22.15.17",
|
|
27
|
+
"@types/react": "^19.1.3",
|
|
28
|
+
"@types/react-dom": "^19.1.3",
|
|
29
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
30
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
29
31
|
"autoprefixer": "^10.4.21",
|
|
30
|
-
"daisyui": "^5.0.
|
|
32
|
+
"daisyui": "^5.0.35",
|
|
31
33
|
"postcss": "^8.5.3",
|
|
32
|
-
"tailwindcss": "^4.1.
|
|
34
|
+
"tailwindcss": "^4.1.6",
|
|
33
35
|
"tslib": "^2.8.1",
|
|
34
|
-
"typescript": "^5.8.
|
|
35
|
-
"vite": "^6.
|
|
36
|
+
"typescript": "^5.8.3",
|
|
37
|
+
"vite": "^6.3.5"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"@tailwindcss/vite": "^4.1.
|
|
39
|
-
"@tanstack/
|
|
40
|
+
"@tailwindcss/vite": "^4.1.6",
|
|
41
|
+
"@tanstack/match-sorter-utils": "^8.19.4",
|
|
42
|
+
"@tanstack/react-router": "^1.120.3",
|
|
43
|
+
"@tanstack/react-table": "^8.21.3",
|
|
40
44
|
"react": "^19.1.0",
|
|
41
|
-
"react-dom": "^19.1.0"
|
|
45
|
+
"react-dom": "^19.1.0",
|
|
46
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
47
|
+
"recharts": "^2.15.3"
|
|
42
48
|
}
|
|
43
49
|
}
|