@zimyo/ui 1.10.10 → 1.10.12
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/chunks/Calender-3809e0ed.js +1 -0
- package/dist/chunks/Calender-af2588bc.esm.js +1 -0
- package/dist/chunks/Heading-54a5488c.js +1 -0
- package/dist/chunks/Heading-b91e2c5f.esm.js +1 -0
- package/dist/chunks/Muted-619e3b72.js +1 -0
- package/dist/chunks/Muted-bfc4985b.esm.js +1 -0
- package/dist/chunks/Text-8c4fb3f8.js +1 -0
- package/dist/chunks/Text-f18219bd.esm.js +1 -0
- package/dist/chunks/assertThisInitialized-406be690.esm.js +1 -0
- package/dist/chunks/assertThisInitialized-d31798d4.js +1 -0
- package/dist/chunks/index-32c3a4e2.esm.js +1 -0
- package/dist/chunks/index-5b35e7d9.esm.js +1 -0
- package/dist/chunks/index-76f24a60.js +1 -0
- package/dist/chunks/index-90b71f01.js +1 -0
- package/dist/chunks/index-a7c3d9a4.esm.js +1 -0
- package/dist/chunks/index-ca2c3710.js +1 -0
- package/dist/chunks/lucide-493ccaad.js +26 -0
- package/dist/chunks/lucide-8c9441ea.esm.js +26 -0
- package/dist/chunks/tslib.es6-49e5b83c.esm.js +1 -0
- package/dist/chunks/tslib.es6-fa3b2784.js +1 -0
- package/dist/chunks/typeof-b30b964a.js +1 -0
- package/dist/chunks/typeof-cc63ab7d.esm.js +1 -0
- package/dist/components/Accordion/index.d.ts +34 -0
- package/dist/components/Accordion/index.esm.js +1 -0
- package/dist/components/Accordion/index.js +1 -0
- package/dist/components/AppList/index.d.ts +27 -0
- package/dist/components/AppList/index.esm.js +1 -0
- package/dist/components/AppList/index.js +1 -0
- package/dist/components/Badge/index.d.ts +29 -0
- package/dist/components/Badge/index.esm.js +1 -0
- package/dist/components/Badge/index.js +1 -0
- package/dist/components/BulkActionsBar/index.d.ts +23 -0
- package/dist/components/BulkActionsBar/index.esm.js +1 -0
- package/dist/components/BulkActionsBar/index.js +1 -0
- package/dist/components/Button/index.d.ts +15 -0
- package/dist/components/Button/index.esm.js +1 -0
- package/dist/components/Button/index.js +1 -0
- package/dist/components/Card/index.d.ts +73 -0
- package/dist/components/Card/index.esm.js +1 -0
- package/dist/components/Card/index.js +1 -0
- package/dist/components/Checkbox/index.d.ts +14 -0
- package/dist/components/Checkbox/index.esm.js +1 -0
- package/dist/components/Checkbox/index.js +1 -0
- package/dist/components/CheckboxGroup/index.d.ts +31 -0
- package/dist/components/CheckboxGroup/index.esm.js +1 -0
- package/dist/components/CheckboxGroup/index.js +1 -0
- package/dist/components/DataTable/index.d.ts +70 -0
- package/dist/components/DataTable/index.esm.js +23 -0
- package/dist/components/DataTable/index.js +22 -0
- package/dist/components/DatePicker/index.d.ts +40 -0
- package/dist/components/DatePicker/index.esm.js +1 -0
- package/dist/components/DatePicker/index.js +1 -0
- package/dist/components/DateRangePicker/index.d.ts +28 -0
- package/dist/components/DateRangePicker/index.esm.js +1 -0
- package/dist/components/DateRangePicker/index.js +1 -0
- package/dist/components/Form/index.d.ts +35 -0
- package/dist/components/Form/index.esm.js +1 -0
- package/dist/components/Form/index.js +1 -0
- package/dist/components/GlobalMenuSearch/index.d.ts +16 -0
- package/dist/components/GlobalMenuSearch/index.esm.js +1 -0
- package/dist/components/GlobalMenuSearch/index.js +1 -0
- package/dist/components/Input/index.d.ts +25 -0
- package/dist/components/Input/index.esm.js +1 -0
- package/dist/components/Input/index.js +1 -0
- package/dist/components/Modal/index.d.ts +20 -0
- package/dist/components/Modal/index.esm.js +1 -0
- package/dist/components/Modal/index.js +1 -0
- package/dist/components/Notice/index.d.ts +19 -0
- package/dist/components/Notice/index.esm.js +1 -0
- package/dist/components/Notice/index.js +1 -0
- package/dist/components/Popover/index.d.ts +19 -0
- package/dist/components/Popover/index.esm.js +1 -0
- package/dist/components/Popover/index.js +1 -0
- package/dist/components/PopupConfirm/index.d.ts +36 -0
- package/dist/components/PopupConfirm/index.esm.js +1 -0
- package/dist/components/PopupConfirm/index.js +1 -0
- package/dist/components/Radio/index.d.ts +24 -0
- package/dist/components/Radio/index.esm.js +1 -0
- package/dist/components/Radio/index.js +1 -0
- package/dist/components/RadioGroup/index.d.ts +31 -0
- package/dist/components/RadioGroup/index.esm.js +1 -0
- package/dist/components/RadioGroup/index.js +1 -0
- package/dist/components/Select/index.d.ts +36 -0
- package/dist/components/Select/index.esm.js +1 -0
- package/dist/components/Select/index.js +1 -0
- package/dist/components/Switch/index.d.ts +15 -0
- package/dist/components/Switch/index.esm.js +1 -0
- package/dist/components/Switch/index.js +1 -0
- package/dist/components/Tab/index.d.ts +40 -0
- package/dist/components/Tab/index.esm.js +1 -0
- package/dist/components/Tab/index.js +1 -0
- package/dist/components/Table/index.d.ts +80 -0
- package/dist/components/Table/index.esm.js +1 -0
- package/dist/components/Table/index.js +1 -0
- package/dist/components/TimePicker/index.d.ts +40 -0
- package/dist/components/TimePicker/index.esm.js +1 -0
- package/dist/components/TimePicker/index.js +1 -0
- package/dist/components/Timeline/index.d.ts +24 -0
- package/dist/components/Timeline/index.esm.js +1 -0
- package/dist/components/Timeline/index.js +1 -0
- package/dist/components/Typography/index.d.ts +30 -0
- package/dist/components/Typography/index.esm.js +1 -0
- package/dist/components/Typography/index.js +1 -0
- package/dist/index.d.ts +839 -0
- package/dist/index.esm.js +1 -0
- package/dist/index.js +1 -0
- package/dist/theme/index.d.ts +96 -0
- package/dist/theme/index.esm.js +1 -0
- package/dist/theme/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-fa3b2784.js"),i=require("react/jsx-runtime"),t=require("react"),n=require("../../chunks/assertThisInitialized-d31798d4.js"),r=require("../Checkbox/index.js"),o=require("../../chunks/lucide-493ccaad.js");require("../../chunks/index-90b71f01.js");var s=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function l(e,i){return e===i||!(!s(e)||!s(i))}function a(e,i){if(e.length!==i.length)return!1;for(var t=0;t<e.length;t++)if(!l(e[t],i[t]))return!1;return!0}function u(e,i){var t;void 0===i&&(i=a);var n,r=[],o=!1;return function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return o&&t===this&&i(s,r)||(n=e.apply(this,s),o=!0,t=this,r=s),n}}var c="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function d(e){cancelAnimationFrame(e.id)}var h=-1;function f(e){if(void 0===e&&(e=!1),-1===h||e){var i=document.createElement("div"),t=i.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(i),h=i.offsetWidth-i.clientWidth,document.body.removeChild(i)}return h}var z=null;function m(e){if(void 0===e&&(e=!1),null===z||e){var i=document.createElement("div"),t=i.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var n=document.createElement("div"),r=n.style;return r.width="100px",r.height="100px",i.appendChild(n),document.body.appendChild(i),i.scrollLeft>0?z="positive-descending":(i.scrollLeft=1,z=0===i.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(i),z}return z}process.env.NODE_ENV;var g=function(e,i){return e},p=null,v=null;function x(e){var i,r=e.getItemOffset,o=e.getEstimatedTotalSize,s=e.getItemSize,l=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,h=e.getStopIndexForStartIndex,z=e.initInstanceProps,p=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return i=function(e){var i,x;function y(i){var t;return(t=e.call(this,i)||this)._instanceProps=z(t.props,n._assertThisInitialized(t)),t._outerRef=void 0,t._resetIsScrollingTimeoutId=null,t.state={instance:n._assertThisInitialized(t),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof t.props.initialScrollOffset?t.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},t._callOnItemsRendered=void 0,t._callOnItemsRendered=u(function(e,i,n,r){return t.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:i,visibleStartIndex:n,visibleStopIndex:r})}),t._callOnScroll=void 0,t._callOnScroll=u(function(e,i,n){return t.props.onScroll({scrollDirection:e,scrollOffset:i,scrollUpdateWasRequested:n})}),t._getItemStyle=void 0,t._getItemStyle=function(e){var i,n=t.props,o=n.direction,l=n.itemSize,a=n.layout,u=t._getItemStyleCache(p&&l,p&&a,p&&o);if(u.hasOwnProperty(e))i=u[e];else{var c=r(t.props,e,t._instanceProps),d=s(t.props,e,t._instanceProps),h="horizontal"===o||"horizontal"===a,f="rtl"===o,z=h?c:0;u[e]=i={position:"absolute",left:f?void 0:z,right:f?z:void 0,top:h?0:c,height:h?"100%":d,width:h?d:"100%"}}return i},t._getItemStyleCache=void 0,t._getItemStyleCache=u(function(e,i,t){return{}}),t._onScrollHorizontal=function(e){var i=e.currentTarget,n=i.clientWidth,r=i.scrollLeft,o=i.scrollWidth;t.setState(function(e){if(e.scrollOffset===r)return null;var i=t.props.direction,s=r;if("rtl"===i)switch(m()){case"negative":s=-r;break;case"positive-descending":s=o-n-r}return s=Math.max(0,Math.min(s,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<s?"forward":"backward",scrollOffset:s,scrollUpdateWasRequested:!1}},t._resetIsScrollingDebounced)},t._onScrollVertical=function(e){var i=e.currentTarget,n=i.clientHeight,r=i.scrollHeight,o=i.scrollTop;t.setState(function(e){if(e.scrollOffset===o)return null;var i=Math.max(0,Math.min(o,r-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<i?"forward":"backward",scrollOffset:i,scrollUpdateWasRequested:!1}},t._resetIsScrollingDebounced)},t._outerRefSetter=function(e){var i=t.props.outerRef;t._outerRef=e,"function"==typeof i?i(e):null!=i&&"object"==typeof i&&i.hasOwnProperty("current")&&(i.current=e)},t._resetIsScrollingDebounced=function(){var e,i,n,r;null!==t._resetIsScrollingTimeoutId&&d(t._resetIsScrollingTimeoutId),t._resetIsScrollingTimeoutId=(e=t._resetIsScrolling,i=150,n=c(),r={id:requestAnimationFrame(function t(){c()-n>=i?e.call(null):r.id=requestAnimationFrame(t)})})},t._resetIsScrolling=function(){t._resetIsScrollingTimeoutId=null,t.setState({isScrolling:!1},function(){t._getItemStyleCache(-1,null)})},t}x=e,(i=y).prototype=Object.create(x.prototype),i.prototype.constructor=i,n._setPrototypeOf(i,x),y.getDerivedStateFromProps=function(e,i){return _(e,i),v(e),null};var w=y.prototype;return w.scrollTo=function(e){e=Math.max(0,e),this.setState(function(i){return i.scrollOffset===e?null:{scrollDirection:i.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},w.scrollToItem=function(e,i){void 0===i&&(i="auto");var t=this.props,n=t.itemCount,r=t.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,n-1));var s=0;if(this._outerRef){var a=this._outerRef;s="vertical"===r?a.scrollWidth>a.clientWidth?f():0:a.scrollHeight>a.clientHeight?f():0}this.scrollTo(l(this.props,e,i,o,this._instanceProps,s))},w.componentDidMount=function(){var e=this.props,i=e.direction,t=e.initialScrollOffset,n=e.layout;if("number"==typeof t&&null!=this._outerRef){var r=this._outerRef;"horizontal"===i||"horizontal"===n?r.scrollLeft=t:r.scrollTop=t}this._callPropsCallbacks()},w.componentDidUpdate=function(){var e=this.props,i=e.direction,t=e.layout,n=this.state,r=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===i||"horizontal"===t)if("rtl"===i)switch(m()){case"negative":o.scrollLeft=-r;break;case"positive-ascending":o.scrollLeft=r;break;default:var s=o.clientWidth,l=o.scrollWidth;o.scrollLeft=l-s-r}else o.scrollLeft=r;else o.scrollTop=r}this._callPropsCallbacks()},w.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&d(this._resetIsScrollingTimeoutId)},w.render=function(){var e=this.props,i=e.children,r=e.className,s=e.direction,l=e.height,a=e.innerRef,u=e.innerElementType,c=e.innerTagName,d=e.itemCount,h=e.itemData,f=e.itemKey,z=void 0===f?g:f,m=e.layout,p=e.outerElementType,v=e.outerTagName,x=e.style,_=e.useIsScrolling,y=e.width,w=this.state.isScrolling,b="horizontal"===s||"horizontal"===m,S=b?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),k=C[0],j=C[1],N=[];if(d>0)for(var R=k;R<=j;R++)N.push(t.createElement(i,{data:h,key:z(R,h),index:R,isScrolling:_?w:void 0,style:this._getItemStyle(R)}));var I=o(this.props,this._instanceProps);return t.createElement(p||v||"div",{className:r,onScroll:S,ref:this._outerRefSetter,style:n._extends({position:"relative",height:l,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:s},x)},t.createElement(u||c||"div",{children:N,ref:a,style:{height:b?"100%":I,pointerEvents:w?"none":void 0,width:b?I:"100%"}}))},w._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),i=e[0],t=e[1],n=e[2],r=e[3];this._callOnItemsRendered(i,t,n,r)}if("function"==typeof this.props.onScroll){var o=this.state,s=o.scrollDirection,l=o.scrollOffset,a=o.scrollUpdateWasRequested;this._callOnScroll(s,l,a)}},w._getRangeToRender=function(){var e=this.props,i=e.itemCount,t=e.overscanCount,n=this.state,r=n.isScrolling,o=n.scrollDirection,s=n.scrollOffset;if(0===i)return[0,0,0,0];var l=a(this.props,s,this._instanceProps),u=h(this.props,l,s,this._instanceProps),c=r&&"backward"!==o?1:Math.max(1,t),d=r&&"forward"!==o?1:Math.max(1,t);return[Math.max(0,l-c),Math.max(0,Math.min(i-1,u+d)),l,u]},y}(t.PureComponent),i.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},i}"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&void 0!==window.WeakSet&&(p=new WeakSet,v=new WeakSet);var _=function(e,i){var t=e.children,n=e.direction,r=e.height,o=e.layout,s=e.innerTagName,l=e.outerTagName,a=e.width,u=i.instance;if("production"!==process.env.NODE_ENV){null==s&&null==l||v&&!v.has(u)&&(v.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var c="horizontal"===n||"horizontal"===o;switch(n){case"horizontal":case"vertical":p&&!p.has(u)&&(p.add(u),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+n+'" was specified.')}switch(o){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". "'+o+'" was specified.')}if(null==t)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===t?"null":typeof t)+'" was specified.');if(c&&"number"!=typeof a)throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. "'+(null===a?"null":typeof a)+'" was specified.');if(!c&&"number"!=typeof r)throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. "'+(null===r?"null":typeof r)+'" was specified.')}},y=x({getItemOffset:function(e,i){return i*e.itemSize},getItemSize:function(e,i){return e.itemSize},getEstimatedTotalSize:function(e){var i=e.itemCount;return e.itemSize*i},getOffsetForIndexAndAlignment:function(e,i,t,n,r,o){var s=e.direction,l=e.height,a=e.itemCount,u=e.itemSize,c=e.layout,d=e.width,h="horizontal"===s||"horizontal"===c?d:l,f=Math.max(0,a*u-h),z=Math.min(f,i*u),m=Math.max(0,i*u-h+u+o);switch("smart"===t&&(t=n>=m-h&&n<=z+h?"auto":"center"),t){case"start":return z;case"end":return m;case"center":var g=Math.round(m+(z-m)/2);return g<Math.ceil(h/2)?0:g>f+Math.floor(h/2)?f:g;default:return n>=m&&n<=z?n:n<m?m:z}},getStartIndexForOffset:function(e,i){var t=e.itemCount,n=e.itemSize;return Math.max(0,Math.min(t-1,Math.floor(i/n)))},getStopIndexForStartIndex:function(e,i,t){var n=e.direction,r=e.height,o=e.itemCount,s=e.itemSize,l=e.layout,a=e.width,u=i*s,c="horizontal"===n||"horizontal"===l?a:r,d=Math.ceil((c+t-u)/s);return Math.max(0,Math.min(o-1,i+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var i=e.itemSize;if("production"!==process.env.NODE_ENV&&"number"!=typeof i)throw Error('An invalid "itemSize" prop has been specified. Value should be a number. "'+(null===i?"null":typeof i)+'" was specified.')}});let w;w="undefined"!=typeof window?window:"undefined"!=typeof self?self:global;let b=null,S=null;const C=w.clearTimeout,k=w.setTimeout,j=w.cancelAnimationFrame||w.mozCancelAnimationFrame||w.webkitCancelAnimationFrame,N=w.requestAnimationFrame||w.mozRequestAnimationFrame||w.webkitRequestAnimationFrame;function R(e){let i,t,n,r,o,s,l;const a="undefined"!=typeof document&&document.attachEvent;if(!a){s=function(e){const i=e.__resizeTriggers__,t=i.firstElementChild,n=i.lastElementChild,r=t.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,r.style.width=t.offsetWidth+1+"px",r.style.height=t.offsetHeight+1+"px",t.scrollLeft=t.scrollWidth,t.scrollTop=t.scrollHeight},o=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},l=function(e){if(e.target.className&&"function"==typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)return;const i=this;s(this),this.__resizeRAF__&&b(this.__resizeRAF__),this.__resizeRAF__=S(function(){o(i)&&(i.__resizeLast__.width=i.offsetWidth,i.__resizeLast__.height=i.offsetHeight,i.__resizeListeners__.forEach(function(t){t.call(i,e)}))})};let e=!1,a="";n="animationstart";const u="Webkit Moz O ms".split(" ");let c="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),d="";{const i=document.createElement("fakeelement");if(void 0!==i.style.animationName&&(e=!0),!1===e)for(let t=0;t<u.length;t++)if(void 0!==i.style[u[t]+"AnimationName"]){d=u[t],a="-"+d.toLowerCase()+"-",n=c[t],e=!0;break}}t="resizeanim",i="@"+a+"keyframes "+t+" { from { opacity: 0; } to { opacity: 0; } } ",r=a+"animation: 1ms "+t+"; "}return{addResizeListener:function(o,u){if(a)o.attachEvent("onresize",u);else{if(!o.__resizeTriggers__){const a=o.ownerDocument,u=w.getComputedStyle(o);u&&"static"===u.position&&(o.style.position="relative"),function(t){if(!t.getElementById("detectElementResize")){const n=(i||"")+".resize-triggers { "+(r||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',o=t.head||t.getElementsByTagName("head")[0],s=t.createElement("style");s.id="detectElementResize",s.type="text/css",null!=e&&s.setAttribute("nonce",e),s.styleSheet?s.styleSheet.cssText=n:s.appendChild(t.createTextNode(n)),o.appendChild(s)}}(a),o.__resizeLast__={},o.__resizeListeners__=[],(o.__resizeTriggers__=a.createElement("div")).className="resize-triggers";const c=a.createElement("div");c.className="expand-trigger",c.appendChild(a.createElement("div"));const d=a.createElement("div");d.className="contract-trigger",o.__resizeTriggers__.appendChild(c),o.__resizeTriggers__.appendChild(d),o.appendChild(o.__resizeTriggers__),s(o),o.addEventListener("scroll",l,!0),n&&(o.__resizeTriggers__.__animationListener__=function(e){e.animationName===t&&s(o)},o.__resizeTriggers__.addEventListener(n,o.__resizeTriggers__.__animationListener__))}o.__resizeListeners__.push(u)}},removeResizeListener:function(e,i){if(a)e.detachEvent("onresize",i);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(i),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",l,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(n,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}null==j||null==N?(b=C,S=function(e){return k(e,20)}):(b=function([e,i]){j(e),C(i)},S=function(e){const i=N(function(){C(t),e()}),t=k(function(){j(i),e()},20);return[i,t]});class I extends t.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._didLogDeprecationWarning=!1,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:e,disableWidth:i,onResize:t}=this.props;if(this._parentNode){const n=window.getComputedStyle(this._parentNode)||{},r=parseFloat(n.paddingLeft||"0"),o=parseFloat(n.paddingRight||"0"),s=parseFloat(n.paddingTop||"0"),l=parseFloat(n.paddingBottom||"0"),a=this._parentNode.getBoundingClientRect(),u=a.height-s-l,c=a.width-r-o;if(!e&&this.state.height!==u||!i&&this.state.width!==c){this.setState({height:u,width:c});const e=()=>{this._didLogDeprecationWarning||(this._didLogDeprecationWarning=!0,console.warn("scaledWidth and scaledHeight parameters have been deprecated; use width and height instead"))};"function"==typeof t&&t({height:u,width:c,get scaledHeight(){return e(),u},get scaledWidth(){return e(),c}})}}},this._setRef=e=>{this._autoSizer=e}}componentDidMount(){const{nonce:e}=this.props,i=this._autoSizer?this._autoSizer.parentNode:null;if(null!=i&&i.ownerDocument&&i.ownerDocument.defaultView&&i instanceof i.ownerDocument.defaultView.HTMLElement){this._parentNode=i;const t=i.ownerDocument.defaultView.ResizeObserver;null!=t?(this._resizeObserver=new t(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(i)):(this._detectElementResize=R(e),this._detectElementResize.addResizeListener(i,this._onResize)),this._onResize()}}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),null!==this._timeoutId&&clearTimeout(this._timeoutId),this._resizeObserver&&this._resizeObserver.disconnect())}render(){const{children:e,defaultHeight:i,defaultWidth:n,disableHeight:r=!1,disableWidth:o=!1,doNotBailOutOnEmptyChildren:s=!1,nonce:l,onResize:a,style:u={},tagName:c="div",...d}=this.props,{height:h,width:f}=this.state,z={overflow:"visible"},m={};let g=!1;return r||(0===h&&(g=!0),z.height=0,m.height=h,m.scaledHeight=h),o||(0===f&&(g=!0),z.width=0,m.width=f,m.scaledWidth=f),s&&(g=!1),t.createElement(c,{ref:this._setRef,style:{...z,...u},...d},!g&&e(m))}}var E=150,T=function(t){var n,r=t.column,o=t.width,s=t.sticky,l=t.stickyPosition,a=s?((n={position:"sticky"})[s]="".concat(l||0,"px"),n.zIndex=25,n.backgroundColor="white",n):{},u="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return i.jsx("div",{className:"zui:flex zui:items-center zui:px-4 zui:py-4 zui:border-r zui:border-gray-200 zui:flex-shrink-0 zui:min-h-[60px] ".concat(u),style:e.__assign({width:"".concat(o,"px"),minWidth:"".concat(o,"px"),maxWidth:"".concat(o,"px")},a),children:i.jsx("div",{className:"zui:h-4 zui:bg-gray-200 zui:rounded zui:animate-pulse zui:w-3/4"})})},O=function(e){var t=e.leftStickyColumns,n=e.rightStickyColumns,r=e.regularColumns,o=e.selection,s=e.calculateStickyPosition,l=e.rowIndex;return i.jsxs("div",{className:"zui:flex zui:min-w-full zui:border-b zui:border-gray-200 zui:bg-white",children:[(null==o?void 0:o.enabled)&&i.jsx("div",{className:"zui:sticky zui:left-0 zui:z-30 zui:bg-white zui:border-r zui:border-gray-200 zui:w-12 zui:flex zui:items-center zui:justify-center zui:px-3 zui:py-4 zui:flex-shrink-0",children:i.jsx("div",{className:"zui:w-4 zui:h-4 zui:bg-gray-200 zui:rounded zui:animate-pulse"})}),t.map(function(e,n){return i.jsx(T,{column:e,width:e.width||E,sticky:"left",stickyPosition:s(t,n,"left")},"left-".concat(e.id,"-").concat(l))}),r.map(function(e,t){return i.jsx(T,{column:e,width:e.width||E},"regular-".concat(e.id,"-").concat(l))}),n.map(function(e,t){return i.jsx(T,{column:e,width:e.width||E,sticky:"right",stickyPosition:s(n,t,"right")},"right-".concat(e.id,"-").concat(l))})]})},L=function(e){var t=e.columns,n=e.leftStickyColumns,r=e.rightStickyColumns,o=e.regularColumns,s=e.selection,l=e.calculateStickyPosition,a=e.totalWidth;return i.jsx("div",{style:{minWidth:"".concat(a,"px")},children:Array.from({length:10},function(e,a){return i.jsx(O,{columns:t,leftStickyColumns:n,rightStickyColumns:r,regularColumns:o,selection:s,calculateStickyPosition:l,rowIndex:a},"skeleton-row-".concat(a))})})},M=function(n){var s,l,a=n.columns,u=n.data,c=n.loading,d=void 0!==c&&c,h=n.stickyColumns,f=n.pagination,z=n.selection,m=n.sorting,g=n.filtering,p=n.expansion,v=n.virtualization,x=void 0===v?{enabled:!1}:v,_=n.onRowClick;n.bulkActions;var w=n.isRowSelectable,b=n.className,S=void 0===b?"":b;n.variant;var C=t.useState(a),k=C[0],j=C[1],N=t.useState(""),R=N[0];N[1];var T=t.useState(!1),O=T[0];T[1];var M=t.useRef(null),A=t.useRef(null),D=t.useRef(null),F=t.useMemo(function(){return k.map(function(i){var t,n,r=i.sticky;return(null===(t=null==h?void 0:h.left)||void 0===t?void 0:t.includes(i.id))?r="left":(null===(n=null==h?void 0:h.right)||void 0===n?void 0:n.includes(i.id))&&(r="right"),e.__assign(e.__assign({},i),{sticky:r})})},[k,h]),H=t.useMemo(function(){return F.filter(function(e){return!e.hidden})},[F]),q=null!==(s=null==h?void 0:h.left)&&void 0!==s?s:[],V=null!==(l=null==h?void 0:h.right)&&void 0!==l?l:[],U=H.filter(function(e){return q.includes(e.id)}),B=H.filter(function(e){return V.includes(e.id)}),K=H.filter(function(e){return!q.includes(e.id)&&!V.includes(e.id)}),G=t.useMemo(function(){return K.reduce(function(e,i){return e+(i.width||E)},0)},[K]),J=t.useMemo(function(){var e=0;return(null==z?void 0:z.enabled)&&(e+=48),H.forEach(function(i){e+=i.width||E}),Math.max(e,800)},[H,z]),Q=t.useMemo(function(){var i=e.__spreadArray([],u,!0);return R&&(i=i.filter(function(e){return Object.values(e).some(function(e){return String(e).toLowerCase().includes(R.toLowerCase())})})),(null==g?void 0:g.filters)&&Object.entries(g.filters).forEach(function(e){var t=e[0],n=e[1];n&&(i=i.filter(function(e){return String(e[t]).toLowerCase().includes(String(n).toLowerCase())}))}),(null==m?void 0:m.sortBy)&&i.sort(function(e,i){var t=e[m.sortBy],n=i[m.sortBy];return t<n?"asc"===m.sortOrder?-1:1:t>n?"asc"===m.sortOrder?1:-1:0}),i},[u,R,null==g?void 0:g.filters,m]);t.useEffect(function(){var e=A.current,i=D.current;if(e&&i){var t=!1,n=!1,r=function(){n||(t=!0,i.scrollLeft=e.scrollLeft,setTimeout(function(){t=!1},0))},o=function(){t||(n=!0,e.scrollLeft=i.scrollLeft,setTimeout(function(){n=!1},0))};return e.addEventListener("scroll",r),i.addEventListener("scroll",o),function(){e.removeEventListener("scroll",r),i.removeEventListener("scroll",o)}}},[]);var X=t.useCallback(function(){if((null==z?void 0:z.enabled)&&Q){var i=Q.filter(function(e){return!w||w(e)}).map(function(e){return e.id});if(i.every(function(e){return z.selectedRows.includes(e)}))z.onSelectionChange(z.selectedRows.filter(function(e){return!i.includes(e)}));else{var t=Array.from(new Set(e.__spreadArray(e.__spreadArray([],z.selectedRows.filter(function(e){return!i.includes(e)}),!0),i,!0)));z.onSelectionChange(t)}}},[Q,z,w]),Y=t.useCallback(function(i){if(null==z?void 0:z.enabled){var t=z.selectedRows;t.includes(i)?z.onSelectionChange(t.filter(function(e){return e!==i})):z.onSelectionChange(e.__spreadArray(e.__spreadArray([],t,!0),[i],!1))}},[z]),Z=t.useCallback(function(i){if(p){var t=p.expandedRows;t.includes(i)?p.onExpansionChange(t.filter(function(e){return e!==i})):p.onExpansionChange(e.__spreadArray(e.__spreadArray([],t,!0),[i],!1))}},[p]),$=t.useCallback(function(i){j(function(t){return t.map(function(t){return t.id===i?e.__assign(e.__assign({},t),{hidden:!t.hidden}):t})})},[]),ee=t.useCallback(function(e,t,n){var r=t[e.accessor];return e.render?e.render(r,t,n):i.jsx("span",{className:"zui:truncate",children:String(r||"")})},[]),ie=t.useCallback(function(e,i,t){var n=0;return"left"===t?((null==z?void 0:z.enabled)&&(n+=48),e.slice(0,i).forEach(function(e){n+=e.width||E})):e.slice(i+1).forEach(function(e){n+=e.width||E}),n},[z]);return i.jsxs("div",{className:"zui:w-full zui:h-full zui:bg-white zui:flex zui:flex-col ".concat(S),children:[O&&!d&&i.jsxs("div",{className:"zui:absolute zui:right-4 zui:top-16 zui:z-50 zui:w-64 zui:bg-white zui:border zui:border-gray-200 zui:rounded-lg zui:shadow-lg zui:p-4",children:[i.jsx("h3",{className:"zui:text-sm zui:font-medium zui:text-gray-900 zui:mb-3",children:"Show/Hide Columns"}),a.map(function(e){return i.jsxs("label",{className:"zui:flex zui:items-center zui:space-x-2 zui:mb-2",children:[i.jsx("input",{type:"checkbox",checked:!e.hidden,onChange:function(){return $(e.id)},className:"zui:rounded zui:border-gray-300"}),i.jsx("span",{className:"zui:text-sm zui:text-gray-700",children:e.header})]},e.id)})]}),i.jsxs("div",{ref:M,className:"zui:relative zui:flex-1 zui:min-h-0 zui:overflow-hidden",children:[i.jsxs("div",{className:"zui:sticky zui:top-0 zui:z-40 zui:bg-gray-50 zui:border-b zui:border-gray-200 zui:flex",children:[(null==z?void 0:z.enabled)&&i.jsx("div",{className:"zui:sticky zui:left-0 zui:z-50 zui:bg-gray-200 zui:border-r zui:border-gray-200 zui:w-12 zui:flex zui:items-center zui:justify-center zui:px-2 zui:py-2 zui:flex-shrink-0",children:i.jsx(r.Checkbox,{checked:!d&&Q.length>0&&Q.every(function(e){return z.selectedRows.includes(e.id)}),onChange:X,disabled:d,className:"zui:rounded zui:border-gray-300 zui:w-4 zui:h-4 zui:disabled:opacity-50"})}),U.map(function(e,t){return i.jsx(W,{column:e,width:e.width||E,sticky:"left",stickyPosition:ie(U,t,"left"),sorting:m,loading:d},e.id)}),i.jsx("div",{ref:A,className:"zui:flex-1 zui:overflow-x-auto zui:scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:i.jsx("div",{className:"zui:flex",style:{minWidth:"".concat(G,"px")},children:K.map(function(e){return i.jsx(W,{column:e,width:e.width||E,sorting:m,loading:d},e.id)})})}),B.map(function(e,t){return i.jsx(W,{column:e,width:e.width||E,sticky:"right",stickyPosition:ie(B,t,"right"),sorting:m,loading:d},e.id)})]}),i.jsx("div",{ref:D,className:"zui:flex-1 zui:overflow-auto zui:h-[calc(100%_-_2.75rem)]",style:{minHeight:"200px"},children:(null==x?void 0:x.enabled)?i.jsx(I,{children:function(e){var t=e.height,n=e.width;return i.jsx(y,{height:t,width:n,itemCount:Q.length,itemSize:x.rowHeight||60,overscanCount:x.overscan||5,children:function(e){var t=e.index,n=e.style;return i.jsx("div",{style:n,children:i.jsx(P,{row:Q[t],rowIndex:t,columns:H,leftStickyColumns:U,rightStickyColumns:B,regularColumns:K,selection:z,expansion:p,onRowClick:_,onRowSelection:Y,onRowExpansion:Z,renderCell:ee,calculateStickyPosition:ie,isRowSelectable:w})},Q[t].id)}})}}):d?i.jsx(L,{columns:H,leftStickyColumns:U,rightStickyColumns:B,regularColumns:K,selection:z,calculateStickyPosition:ie,totalWidth:J}):0===Q.length?i.jsxs("div",{className:"zui:flex zui:flex-col zui:items-center zui:justify-center zui:py-12",children:[i.jsx("div",{className:"zui:text-gray-400 zui:text-lg zui:mb-2",children:"No data found"}),i.jsx("div",{className:"zui:text-gray-500 zui:text-sm",children:"Try adjusting your search or filters"})]}):i.jsx("div",{style:{minWidth:"".concat(J,"px")},children:Q.map(function(e,t){return i.jsx(P,{row:e,rowIndex:t,columns:H,leftStickyColumns:U,rightStickyColumns:B,regularColumns:K,selection:z,expansion:p,onRowClick:_,onRowSelection:Y,onRowExpansion:Z,renderCell:ee,calculateStickyPosition:ie,isRowSelectable:w},e.id)})})})]}),f&&i.jsxs("div",{className:"zui:flex zui:items-center zui:justify-between zui:px-4 zui:py-3 zui:border-t zui:border-gray-200 zui:flex-shrink-0 zui:bg-white",children:[d?"Loading...":function(){Math.max(1,Math.ceil(f.total/f.pageSize));var e=Math.min((f.page-1)*f.pageSize+1,Math.max(0,f.total)),i=Math.min(f.page*f.pageSize,f.total);return"Showing ".concat(0===f.total?0:e,"-").concat(i," of ").concat(f.total," entries")}(),i.jsx("div",{className:"zui:flex zui:items-center zui:space-x-2",children:d?i.jsx(i.Fragment,{children:Array.from({length:4},function(e,t){return i.jsx("div",{className:"zui:w-8 zui:h-8 zui:bg-gray-200 zui:rounded zui:animate-pulse"},t)})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"zui:flex zui:items-center zui:space-x-1 zui:ml-2",children:[i.jsx("span",{className:"zui:text-sm zui:text-gray-700",children:"Per page:"}),i.jsx("select",{value:f.pageSize,onChange:function(e){var i=Number(e.target.value);f.onPageSizeChange(i),f.onPageChange(1)},className:"zui:border zui:border-gray-300 zui:rounded zui:px-2 zui:py-1 zui:text-sm",children:[5,10,20,50,100].map(function(e){return i.jsx("option",{value:e,children:e},e)})})]}),i.jsx("button",{onClick:function(){return f.onPageChange(1)},disabled:1===f.page,className:"zui:px-2 zui:py-1 zui:text-sm zui:border zui:rounded zui:disabled:opacity-50 zui:bg-white zui:text-gray-700 zui:border-gray-300 zui:hover:bg-gray-50",children:i.jsx(o.ChevronFirst,{size:18})}),i.jsx("button",{onClick:function(){return f.onPageChange(Math.max(1,f.page-1))},disabled:1===f.page,className:"zui:px-2 zui:py-1 zui:text-sm zui:border zui:rounded zui:disabled:opacity-50 zui:bg-white zui:text-gray-700 zui:border-gray-300 zui:hover:bg-gray-50",children:i.jsx(o.ChevronLeft,{size:18})}),i.jsx("button",{onClick:function(){return f.onPageChange(Math.min(Math.max(1,Math.ceil(f.total/f.pageSize)),f.page+1))},disabled:f.page>=Math.max(1,Math.ceil(f.total/f.pageSize)),className:"zui:px-2 zui:py-1 zui:text-sm zui:border zui:rounded zui:disabled:opacity-50 zui:bg-white zui:text-gray-700 zui:border-gray-300 zui:hover:bg-gray-50",children:i.jsx(o.ChevronRight,{size:18})}),i.jsx("button",{onClick:function(){return f.onPageChange(Math.max(1,Math.ceil(f.total/f.pageSize)))},disabled:f.page>=Math.max(1,Math.ceil(f.total/f.pageSize)),className:"zui:px-2 zui:py-1 zui:text-sm zui:border zui:rounded zui:disabled:opacity-50 zui:bg-white zui:text-gray-700 zui:border-gray-300 zui:hover:bg-gray-50",children:i.jsx(o.ChevronLast,{size:18})})]})})]})]})},W=function(t){var n,r=t.column,s=t.width,l=t.sticky,a=t.stickyPosition,u=t.sorting,c=t.loading,d=void 0!==c&&c,h=l?((n={position:"sticky"})[l]="".concat(a||0,"px"),n.zIndex=45,n.backgroundColor="#f9fafb",n):{},f="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return i.jsx("div",{className:"zui:flex zui:items-center zui:px-2 zui:py-2 zui:text-left zui:text-sm zui:font-medium zui:text-gray-600 zui:tracking-wider zui:border-r zui:border-gray-300 zui:bg-gray-200 zui:flex-shrink-0 ".concat(f),style:e.__assign({width:"".concat(s,"px"),minWidth:"".concat(s,"px"),maxWidth:"".concat(s,"px")},h),children:i.jsxs("div",{className:"zui:flex zui:items-center zui:space-x-1 zui:flex-1 zui:min-w-0",children:[i.jsx("span",{className:"zui:truncate zui:flex-1",children:r.header}),r.sortable&&i.jsx("button",{onClick:function(){if(r.sortable&&u&&!d){var e="asc";u.sortBy===r.id&&(e="asc"===u.sortOrder?"desc":"asc"),u.onSortChange(r.id,e)}},disabled:d,className:"zui:p-1 zui:hover:bg-gray-200 zui:rounded zui:transition-colors zui:flex-shrink-0 zui:disabled:opacity-50 zui:disabled:cursor-not-allowed",children:d||(null==u?void 0:u.sortBy)!==r.id?i.jsx(o.ArrowUpDown,{className:"zui:w-4 zui:h-4 zui:text-gray-400"}):"asc"===u.sortOrder?i.jsx(o.ArrowUp,{className:"zui:w-4 zui:h-4 zui:text-blue-600"}):i.jsx(o.ArrowDown,{className:"zui:w-4 zui:h-4 zui:text-blue-600"})})]})})},P=function(e){var n=e.row,s=e.rowIndex,l=e.leftStickyColumns,a=e.rightStickyColumns,u=e.regularColumns,c=e.selection,d=e.expansion,h=e.onRowClick,f=e.onRowSelection,z=e.onRowExpansion,m=e.renderCell,g=e.calculateStickyPosition,p=e.isRowSelectable,v=(null==c?void 0:c.selectedRows.includes(n.id))||!1,x=(null==d?void 0:d.expandedRows.includes(n.id))||!1,_=n._children&&n._children.length>0,y=t.useCallback(function(){f(n.id)},[n.id,f]),w=t.useCallback(function(){z(n.id)},[n.id,z]),b=t.useCallback(function(e,t,n){var r=e.render?e.render(t[e.accessor],t,n):i.jsx("span",{className:"zui:truncate",children:String(t[e.accessor]||"")});return i.jsxs("div",{className:"zui:flex zui:items-center zui:w-full",children:[d&&i.jsx("div",{className:"zui:flex-shrink-0 zui:mr-2",children:_?i.jsx("button",{onClick:function(e){e.stopPropagation(),w()},className:"zui:p-1 zui:hover:bg-gray-200 zui:rounded zui:transition-colors",children:x?i.jsx(o.ChevronDown,{className:"zui:w-4 zui:h-4"}):i.jsx(o.ChevronRight,{className:"zui:w-4 zui:h-4"})}):i.jsx("div",{className:"zui:w-6 zui:h-6"})}),i.jsx("div",{className:"zui:flex-1 zui:min-w-0",children:r})]})},[d,_,x,w]);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"zui:flex zui:min-w-full zui:border-b zui:border-gray-200 zui:hover:bg-gray-50 zui:transition-colors zui:cursor-pointer ".concat(v?"zui:bg-blue-50":"zui:bg-white"),onClick:function(){return null==h?void 0:h(n)},children:[(null==c?void 0:c.enabled)&&(!p||p(n)?i.jsx("div",{className:"zui:sticky zui:left-0 zui:z-30 zui:bg-inherit zui:border-r zui:border-gray-200 zui:w-12 zui:flex zui:items-center zui:justify-center zui:px-3 zui:py-4 zui:flex-shrink-0",children:i.jsx(r.Checkbox,{checked:v,onChange:function(e){e.stopPropagation(),y()},className:"zui:rounded zui:border-gray-300 zui:w-4 zui:h-4"})}):i.jsx("div",{className:"zui:sticky zui:left-0 zui:z-30 zui:bg-inherit zui:border-r zui:border-gray-200 zui:w-12 zui:flex zui:items-center zui:justify-center zui:px-3 zui:py-4 zui:flex-shrink-0"})),l.map(function(e,t){return i.jsx(A,{column:e,row:n,rowIndex:s,width:e.width||E,sticky:"left",stickyPosition:g(l,t,"left"),renderCell:0===t?b:m},e.id)}),u.map(function(e,t){return i.jsx(A,{column:e,row:n,rowIndex:s,width:e.width||E,renderCell:0===l.length&&0===t?b:m},e.id)}),a.map(function(e,t){return i.jsx(A,{column:e,row:n,rowIndex:s,width:e.width||E,sticky:"right",stickyPosition:g(a,t,"right"),renderCell:m},e.id)})]}),x&&(null==d?void 0:d.renderExpandedRow)&&i.jsx("div",{className:"zui:border-b zui:border-gray-200 zui:bg-gray-50",children:d.renderExpandedRow(n)})]})},A=function(t){var n,r=t.column,o=t.row,s=t.rowIndex,l=t.width,a=t.sticky,u=t.stickyPosition,c=t.renderCell,d=a?((n={position:"sticky"})[a]="".concat(u||0,"px"),n.zIndex=25,n.backgroundColor="inherit",n):{},h="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return i.jsx("div",{className:"zui:flex zui:items-center zui:px-3 zui:py-1 zui:text-sm zui:text-gray-900 zui:border-r zui:border-gray-200 zui:flex-shrink-0 zui:min-h-[50px] ".concat(h),style:e.__assign({width:"".concat(l,"px"),minWidth:"".concat(l,"px"),maxWidth:"".concat(l,"px")},d),children:i.jsx("div",{className:"zui:w-full zui:min-w-0",children:c(r,o,s)})})};exports.Table=M,exports.default=M;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dayjs } from 'dayjs';
|
|
3
|
+
|
|
4
|
+
type InputSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
+
type InputVariant = 'outlined' | 'contained';
|
|
6
|
+
interface TimePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'defaultValue'> {
|
|
7
|
+
label?: string;
|
|
8
|
+
floatingLabel?: boolean;
|
|
9
|
+
description?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
size?: InputSize;
|
|
12
|
+
variant?: InputVariant;
|
|
13
|
+
focusOutline?: boolean;
|
|
14
|
+
value?: Dayjs | null;
|
|
15
|
+
defaultValue?: Dayjs | null;
|
|
16
|
+
onChange?: (time: Dayjs | null, timeString: string) => void;
|
|
17
|
+
format?: string;
|
|
18
|
+
use12Hours?: boolean;
|
|
19
|
+
hourStep?: number;
|
|
20
|
+
minuteStep?: number;
|
|
21
|
+
secondStep?: number;
|
|
22
|
+
needConfirm?: boolean;
|
|
23
|
+
showNow?: boolean;
|
|
24
|
+
okText?: string;
|
|
25
|
+
closeText?: string;
|
|
26
|
+
nowText?: string;
|
|
27
|
+
amText?: string;
|
|
28
|
+
pmText?: string;
|
|
29
|
+
hourLabel?: string;
|
|
30
|
+
minuteLabel?: string;
|
|
31
|
+
secondLabel?: string;
|
|
32
|
+
disabledHours?: (h: number) => boolean;
|
|
33
|
+
disabledMinutes?: (m: number) => boolean;
|
|
34
|
+
disabledSeconds?: (s: number) => boolean;
|
|
35
|
+
allowClear?: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
38
|
+
|
|
39
|
+
export { TimePicker, TimePicker as default };
|
|
40
|
+
export type { TimePickerProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,a as t}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as i,jsx as n}from"react/jsx-runtime";import*as r from"react";import u from"@mui/material/Popover";import{a as o}from"../../chunks/index-32c3a4e2.esm.js";import{X as a,m as s}from"../../chunks/lucide-8c9441ea.esm.js";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c={exports:{}},d=l(c.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",u="minute",o="hour",a="day",s="week",l="month",c="quarter",d="year",f="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},v=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},g={s:v,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+v(n,2,"0")+":"+v(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,l),u=i-r<0,o=t.clone().add(n+(u?-1:1),l);return+(-(n+(i-r)/(u?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:s,d:a,D:f,h:o,m:u,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",y={};y[b]=p;var x="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[x])},M=function e(t,i,n){var r;if(!t)return b;if("string"==typeof t){var u=t.toLowerCase();y[u]&&(r=u),i&&(y[u]=i,r=u);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var a=t.name;y[a]=t,r=a}return!n&&r&&(b=r),r||!n&&b},$=function(e,t){if(w(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new S(i)},D=g;D.l=M,D.i=w,D.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function p(e){this.$L=M(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var v=p.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(m);if(n){var r=n[2]-1||0,u=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)}}return new Date(t)}(e),this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return D},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(e,t){var i=$(e);return this.startOf(t)<=i&&i<=this.endOf(t)},v.isAfter=function(e,t){return $(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<$(e)},v.$g=function(e,t,i){return D.u(e)?this[t]:this.set(i,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var i=this,n=!!D.u(t)||t,c=D.p(e),h=function(e,t){var r=D.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(a)},m=function(e,t){return D.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},z=this.$W,p=this.$M,v=this.$D,g="set"+(this.$u?"UTC":"");switch(c){case d:return n?h(1,0):h(31,11);case l:return n?h(1,p):h(0,p+1);case s:var b=this.$locale().weekStart||0,y=(z<b?z+7:z)-b;return h(n?v-y:v+(6-y),p);case a:case f:return m(g+"Hours",0);case o:return m(g+"Minutes",1);case u:return m(g+"Seconds",2);case r:return m(g+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var i,s=D.p(e),c="set"+(this.$u?"UTC":""),h=(i={},i[a]=c+"Date",i[f]=c+"Date",i[l]=c+"Month",i[d]=c+"FullYear",i[o]=c+"Hours",i[u]=c+"Minutes",i[r]=c+"Seconds",i[n]=c+"Milliseconds",i)[s],m=s===a?this.$D+(t-this.$W):t;if(s===l||s===d){var z=this.clone().set(f,1);z.$d[h](m),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else h&&this.$d[h](m);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[D.p(e)]()},v.add=function(n,c){var f,h=this;n=Number(n);var m=D.p(c),z=function(e){var t=$(h);return D.w(t.date(t.date()+Math.round(e*n)),h)};if(m===l)return this.set(l,this.$M+n);if(m===d)return this.set(d,this.$y+n);if(m===a)return z(1);if(m===s)return z(7);var p=(f={},f[u]=t,f[o]=i,f[r]=e,f)[m]||1,v=this.$d.getTime()+n*p;return D.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=D.z(this),u=this.$H,o=this.$m,a=this.$M,s=i.weekdays,l=i.months,c=i.meridiem,d=function(e,i,r,u){return e&&(e[i]||e(t,n))||r[i].slice(0,u)},f=function(e){return D.s(u%12||12,e,"0")},m=c||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(z,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return a+1;case"MM":return D.s(a+1,2,"0");case"MMM":return d(i.monthsShort,a,l,3);case"MMMM":return d(l,a);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(i.weekdaysMin,t.$W,s,2);case"ddd":return d(i.weekdaysShort,t.$W,s,3);case"dddd":return s[t.$W];case"H":return String(u);case"HH":return D.s(u,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return m(u,o,!0);case"A":return m(u,o,!1);case"m":return String(o);case"mm":return D.s(o,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(n,f,h){var m,z=this,p=D.p(f),v=$(n),g=(v.utcOffset()-this.utcOffset())*t,b=this-v,y=function(){return D.m(z,v)};switch(p){case d:m=y()/12;break;case l:m=y();break;case c:m=y()/3;break;case s:m=(b-g)/6048e5;break;case a:m=(b-g)/864e5;break;case o:m=b/i;break;case u:m=b/t;break;case r:m=b/e;break;default:m=b}return h?m:D.a(m)},v.daysInMonth=function(){return this.endOf(l).$D},v.$locale=function(){return y[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=M(e,t,!0);return n&&(i.$L=n),i},v.clone=function(){return D.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},p}(),k=S.prototype;return $.prototype=k,[["$ms",n],["$s",r],["$m",u],["$H",o],["$W",a],["$M",l],["$y",d],["$D",f]].forEach(function(e){k[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=M,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=y[b],$.Ls=y,$.p={},$}()),f={exports:{}},h=l(f.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,n=/\d\d/,r=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,o={},a=function(e){return(e=+e)+(e>68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),i=60*t[1]+(+t[2]||0);return 0===i?0:"+"===t[0]?-i:i}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var i,n=o.meridiem;if(n){for(var r=1;r<=24;r+=1)if(e.indexOf(n(r,0,t))>-1){i=r>12;break}}else i=e===(t?"pm":"PM");return i},f={A:[u,function(e){this.afternoon=d(e,!1)}],a:[u,function(e){this.afternoon=d(e,!0)}],Q:[i,function(e){this.month=3*(e-1)+1}],S:[i,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,s("seconds")],ss:[r,s("seconds")],m:[r,s("minutes")],mm:[r,s("minutes")],H:[r,s("hours")],h:[r,s("hours")],HH:[r,s("hours")],hh:[r,s("hours")],D:[r,s("day")],DD:[n,s("day")],Do:[u,function(e){var t=o.ordinal,i=e.match(/\d+/);if(this.day=i[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[r,s("week")],ww:[n,s("week")],M:[r,s("month")],MM:[n,s("month")],MMM:[u,function(e){var t=c("months"),i=(c("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],MMMM:[u,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(e){this.year=a(e)}],YYYY:[/\d{4}/,s("year")],Z:l,ZZ:l};function h(i){var n,r;n=i,r=o&&o.formats;for(var u=(i=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,i,n){var u=n&&n.toUpperCase();return i||r[n]||e[n]||r[u].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})).match(t),a=u.length,s=0;s<a;s+=1){var l=u[s],c=f[l],d=c&&c[0],h=c&&c[1];u[s]=h?{regex:d,parser:h}:l.replace(/^\[|\]$/g,"")}return function(e){for(var t={},i=0,n=0;i<a;i+=1){var r=u[i];if("string"==typeof r)n+=r.length;else{var o=r.regex,s=r.parser,l=e.slice(n),c=o.exec(l)[0];s.call(t,c),e=e.replace(c,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var i=e.hours;t?i<12&&(e.hours+=12):12===i&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,i){i.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var n=t.prototype,r=n.parse;n.parse=function(e){var t=e.date,n=e.utc,u=e.args;this.$u=n;var a=u[1];if("string"==typeof a){var s=!0===u[2],l=!0===u[3],c=s||l,d=u[2];l&&(d=u[2]),o=this.$locale(),!s&&d&&(o=i.Ls[d]),this.$d=function(e,t,i,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),u=r.year,o=r.month,a=r.day,s=r.hours,l=r.minutes,c=r.seconds,d=r.milliseconds,f=r.zone,m=r.week,z=new Date,p=a||(u||o?1:z.getDate()),v=u||z.getFullYear(),g=0;u&&!o||(g=o>0?o-1:z.getMonth());var b,y=s||0,x=l||0,w=c||0,M=d||0;return f?new Date(Date.UTC(v,g,p,y,x,w,M+60*f.offset*1e3)):i?new Date(Date.UTC(v,g,p,y,x,w,M)):(b=new Date(v,g,p,y,x,w,M),m&&(b=n(b).week(m).toDate()),b)}catch(e){return new Date("")}}(t,a,n,i),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),c&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var f=a.length,m=1;m<=f;m+=1){u[1]=a[m-1];var z=i.apply(this,u);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}m===f&&(this.$d=new Date(""))}else r.call(this,e)}}}());d.extend(h);var m={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},z={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},p={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},v={xs:"zui:min-w-[10rem]",sm:"zui:min-w-[12rem]",md:"zui:min-w-[12rem]",lg:"zui:min-w-[14rem]"},g=function(e){return"contained"===e?"zui:bg-muted":"zui:bg-background"};function b(e){return e<10?"0".concat(e):"".concat(e)}function y(e,t,i){void 0===i&&(i=0);for(var n=[],r=i;r<=t;r+=e)n.push(r);return n}var x=r.forwardRef(function(l,c){var f,h,x,w=l.label,M=l.floatingLabel,$=void 0!==M&&M,D=l.description,S=l.error,k=l.size,Y=void 0===k?"md":k,N=l.variant,L=void 0===N?"outlined":N,T=l.focusOutline,O=void 0===T||T,C=l.className,H=l.value,_=l.defaultValue,A=void 0===_?null:_,P=l.onChange,j=l.format,E=void 0===j?"HH:mm":j,Z=l.use12Hours,F=l.hourStep,U=void 0===F?1:F,W=l.minuteStep,R=void 0===W?1:W,V=l.secondStep,I=void 0===V?1:V,q=l.needConfirm,K=void 0===q||q,B=l.showNow,J=void 0===B||B,Q=l.okText,X=void 0===Q?"OK":Q,G=l.closeText,ee=void 0===G?"Close":G,te=l.nowText,ie=void 0===te?"Now":te,ne=l.amText,re=void 0===ne?"AM":ne,ue=l.pmText,oe=void 0===ue?"PM":ue,ae=l.hourLabel,se=void 0===ae?"Hour":ae,le=l.minuteLabel,ce=void 0===le?"Minute":le,de=l.secondLabel,fe=void 0===de?"Second":de,he=l.disabledHours,me=l.disabledMinutes,ze=l.disabledSeconds,pe=l.disabled,ve=l.placeholder,ge=l.required,be=l.allowClear,ye=void 0===be||be,xe=l.id,we=e(l,["label","floatingLabel","description","error","size","variant","focusOutline","className","value","defaultValue","onChange","format","use12Hours","hourStep","minuteStep","secondStep","needConfirm","showNow","okText","closeText","nowText","amText","pmText","hourLabel","minuteLabel","secondLabel","disabledHours","disabledMinutes","disabledSeconds","disabled","placeholder","required","allowClear","id"]),Me=xe||function(e){void 0===e&&(e="timepicker");var t=r.useRef();return t.current||(t.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),t.current}("timepicker"),$e=(h=E,"boolean"==typeof(x=Z)?x:/(^|[^H])h/.test(h)||/(\sa\b|\sA\b|a\b|A\b)/.test(h)),De=function(e){return/\bss\b/.test(e)}(E),Se=function(e){return{container:e?"zui:opacity-80":"",label:e?"zui:text-gray-500":"zui:text-gray-700",input:e?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""}}(pe||!1),ke=r.useRef(void 0!==H).current,Ye=r.useState(A),Ne=Ye[0],Le=Ye[1],Te=ke?null!=H?H:null:null!=Ne?Ne:null,Oe=Te?Te.format(E):"",Ce=r.useState(Oe),He=Ce[0],_e=Ce[1],Ae=r.useState(!1);Ae[0];var Pe=Ae[1];r.useEffect(function(){_e(Oe)},[Oe]);var je=r.useState(null),Ee=je[0],Ze=je[1],Fe=Boolean(Ee),Ue=r.useRef(null),We=r.useRef(!1);function Re(e,t){var i;Ze(e&&null!==(i=null!=t?t:Ue.current)&&void 0!==i?i:null)}function Ve(){We.current=!0,Re(!1),K&&(_e(Oe),Ke(Te)),Promise.resolve().then(function(){We.current=!1})}r.useEffect(function(){function e(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),Fe&&Ze(null))}return Fe&&document.addEventListener("keydown",e,!0),function(){return document.removeEventListener("keydown",e,!0)}},[Fe]);var Ie=r.useState(Te),qe=Ie[0],Ke=Ie[1];r.useEffect(function(){Fe&&(Ke(Te),_e(Oe))},[Fe,Te,Oe]);var Be=r.useMemo(function(){return $e?y(U,12,1):y(U,23,0)},[$e,U]),Je=r.useMemo(function(){return y(R,59,0)},[R]),Qe=r.useMemo(function(){return y(I,59,0)},[I]);function Xe(e){var t=e?e.format(E):"";null==P||P(e,t),ke||Le(e)}function Ge(e,t,i,n){var r;if(!(null==he?void 0:he($e?e%12||12:e))&&!((null==me?void 0:me(t))||De&&(null==ze?void 0:ze(i)))){var u=$e?function(e,t){return t?"am"===t?12===e?0:e:12===e?12:e+12:e}(e,n):e,o=(null!==(r=null!=qe?qe:Te)&&void 0!==r?r:d()).hour(u).minute(t).second(De?i:0).millisecond(0);Ke(o),_e(o.format(E)),K||Xe(o)}}var et=qe?qe.format(E):"",tt=Fe&&""!==et.trim()?et:Oe;var it=r.useRef(null),nt=r.useRef(null),rt=r.useRef(null);function ut(e,t){var i=e.current;if(i){var n=Array.from(i.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==n.length){var r=n.findIndex(function(e){return e===document.activeElement});n[r<0?0:Math.max(0,Math.min(n.length-1,r+t))].focus()}}}function ot(e,t){"ArrowDown"===e.key?(e.preventDefault(),ut(t,1)):"ArrowUp"===e.key&&(e.preventDefault(),ut(t,-1))}var at="lg"===Y?18:16,st=w||"Time picker",lt=Boolean(tt)&&!pe&&!!ye,ct=null!==(f=null!=qe?qe:Te)&&void 0!==f?f:null,dt=ct?ct.hour():$e?12:0,ft=ct?ct.minute():0,ht=ct?ct.second():0,mt=dt>=12?"pm":"am",zt=dt%12==0?12:dt%12;return i("div",{className:o("zui:w-full",Se.container,v[Y],C),children:[!$&&w&&i("label",{htmlFor:Me,className:o("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",Se.label),children:[w,ge&&n("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i("div",{className:o("zui:relative zui:w-full zui:rounded-md zui:border zui:bg-background zui:text-sm zui:transition-colors",O&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===L&&"zui:border-input","contained"===L&&"zui:bg-muted zui:border-transparent",Se.input,S&&"zui:border-destructive",S&&O&&"zui:focus-within:ring-destructive"),children:[$&&w&&i("label",{htmlFor:Me,className:o("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",g(L),Se.label),children:[w,ge&&n("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),n("input",t({id:Me,ref:function(e){"function"==typeof c?c(e):c&&(c.current=e),Ue.current=e},value:tt,onChange:function(e){var t;_e(null!==(t=e.target.value)&&void 0!==t?t:"")},onBlur:function(){Pe(!1);var e=(null!=He?He:"").trim();if(K){if(!e)return Ke(null),void _e(Oe);(t=d(e,E,!0)).isValid()?Ke(t.millisecond(0)):(_e(Oe),Ke(Te))}else{if(!e)return void Xe(null);var t;(t=d(e,E,!0)).isValid()?Xe(t.millisecond(0)):_e(Oe)}},onFocus:function(e){Pe(!0),pe||We.current||Re(!0,Ue.current||e.currentTarget)},onClick:function(e){pe||We.current||Re(!0,Ue.current||e.currentTarget)},placeholder:null!=ve?ve:$e?De?"h:mm:ss a":"h:mm a":De?"HH:mm:ss":"HH:mm","aria-label":st,disabled:pe,required:ge,className:o("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",m[Y],z[Y],lt?"zui:pr-20":"zui:pr-10")},we)),lt?n("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),Ke(null),_e(""),Xe(null),We.current=!0,Re(!1),Promise.resolve().then(function(){We.current=!1})},className:o("zui:absolute zui:inset-y-0 zui:right-9 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 focus:zui:outline-none",p[Y]),"aria-label":"Clear time",children:n(a,{size:at})}):null,n("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){pe||Re(!Fe,e.currentTarget)}(e)},className:o("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 disabled:zui:opacity-50",p[Y]),disabled:pe,"aria-label":"Toggle time panel",children:n(s,{size:at})})]}),i("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[D&&!S&&!pe&&n("p",{className:"zui:text-xs zui:text-muted-foreground",children:D}),S&&n("p",{className:"zui:text-xs zui:text-destructive",children:S})]}),n(u,{open:Fe,anchorEl:Ee,onClose:function(e,t){"backdropClick"!==t&&"escapeKeyDown"!==t&&Ve()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:o("zui:rounded-md zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:i("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[i("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2 zui:text-xs zui:text-gray-500 zui:sticky zui:top-0 zui:bg-white zui:z-10",children:[n("div",{className:"zui:text-center",children:se}),n("div",{className:"zui:text-center",children:ce}),n("div",{className:"zui:text-center",children:De?fe:$e?"AM/PM":""})]}),i("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[n("div",{ref:it,onKeyDown:function(e){return ot(e,it)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select hour",children:Be.map(function(e){var t,i=$e?zt===e:dt===e,r=null!==(t=null==he?void 0:he($e?e%12||12:e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ge(e,ft,ht,$e?mt:void 0)},className:o("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:b(e)},e)})}),n("div",{ref:nt,onKeyDown:function(e){return ot(e,nt)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select minute",children:Je.map(function(e){var t,i=ft===e,r=null!==(t=null==me?void 0:me(e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ge($e?zt:dt,e,ht,$e?mt:void 0)},className:o("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:b(e)},e)})}),De?n("div",{ref:rt,onKeyDown:function(e){return ot(e,rt)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select second",children:Qe.map(function(e){var t,i=ht===e,r=null!==(t=null==ze?void 0:ze(e))&&void 0!==t&&t;return n("button",{type:"button",role:"option","aria-selected":i,"aria-disabled":r,disabled:r,onClick:function(){r||Ge($e?zt:dt,ft,e,$e?mt:void 0)},className:o("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",r&&"zui:opacity-40 zui:cursor-not-allowed"),children:b(e)},e)})}):$e?n("div",{className:"zui:flex zui:flex-col zui:gap-1",role:"listbox","aria-label":"Select AM/PM",children:["am","pm"].map(function(e){var t=mt===e;return n("button",{type:"button",role:"option","aria-selected":t,onClick:function(){Ge(zt||12,ft,ht,e)},className:o("zui:flex-1 zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",t&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium"),"aria-pressed":t,children:"am"===e?re:oe},e)})}):null]}),i("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[J?n("button",{type:"button",onClick:function(){var e=d(),t=e.second(De?e.second():0).millisecond(0);Ke(t),_e(t.format(E)),Xe(t),We.current=!0,Re(!1),Promise.resolve().then(function(){We.current=!1})},className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:ie}):n("span",{}),i("div",{className:"zui:flex zui:gap-2",children:[n("button",{type:"button",onClick:Ve,className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:ee}),K&&n("button",{type:"button",onClick:function(){Xe(null!=qe?qe:null),We.current=!0,Re(!1),Promise.resolve().then(function(){We.current=!1})},className:"zui:text-white zui:bg-blue-600 hover:zui:bg-blue-700 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-3 zui:py-1",children:X})]})]})]})})]})});export{x as TimePicker,x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-fa3b2784.js"),t=require("react/jsx-runtime"),i=require("react"),n=require("@mui/material/Popover"),r=require("../../chunks/index-90b71f01.js"),u=require("../../chunks/lucide-493ccaad.js");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}}),t.default=e,Object.freeze(t)}var s=o(i);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l={exports:{}},c=a(l.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",u="minute",o="hour",s="day",a="week",l="month",c="quarter",d="year",f="date",h="Invalid Date",z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},p=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},g={s:p,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+p(n,2,"0")+":"+p(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,l),u=i-r<0,o=t.clone().add(n+(u?-1:1),l);return+(-(n+(i-r)/(u?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:a,d:s,D:f,h:o,m:u,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",x={};x[b]=v;var y="$isDayjsObject",w=function(e){return e instanceof S||!(!e||!e[y])},M=function e(t,i,n){var r;if(!t)return b;if("string"==typeof t){var u=t.toLowerCase();x[u]&&(r=u),i&&(x[u]=i,r=u);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var s=t.name;x[s]=t,r=s}return!n&&r&&(b=r),r||!n&&b},$=function(e,t){if(w(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new S(i)},D=g;D.l=M,D.i=w,D.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function v(e){this.$L=M(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[y]=!0}var p=v.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(D.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(z);if(n){var r=n[2]-1||0,u=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,u)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return D},p.isValid=function(){return!(this.$d.toString()===h)},p.isSame=function(e,t){var i=$(e);return this.startOf(t)<=i&&i<=this.endOf(t)},p.isAfter=function(e,t){return $(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<$(e)},p.$g=function(e,t,i){return D.u(e)?this[t]:this.set(i,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,t){var i=this,n=!!D.u(t)||t,c=D.p(e),h=function(e,t){var r=D.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(s)},z=function(e,t){return D.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},m=this.$W,v=this.$M,p=this.$D,g="set"+(this.$u?"UTC":"");switch(c){case d:return n?h(1,0):h(31,11);case l:return n?h(1,v):h(0,v+1);case a:var b=this.$locale().weekStart||0,x=(m<b?m+7:m)-b;return h(n?p-x:p+(6-x),v);case s:case f:return z(g+"Hours",0);case o:return z(g+"Minutes",1);case u:return z(g+"Seconds",2);case r:return z(g+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(e,t){var i,a=D.p(e),c="set"+(this.$u?"UTC":""),h=(i={},i[s]=c+"Date",i[f]=c+"Date",i[l]=c+"Month",i[d]=c+"FullYear",i[o]=c+"Hours",i[u]=c+"Minutes",i[r]=c+"Seconds",i[n]=c+"Milliseconds",i)[a],z=a===s?this.$D+(t-this.$W):t;if(a===l||a===d){var m=this.clone().set(f,1);m.$d[h](z),m.init(),this.$d=m.set(f,Math.min(this.$D,m.daysInMonth())).$d}else h&&this.$d[h](z);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[D.p(e)]()},p.add=function(n,c){var f,h=this;n=Number(n);var z=D.p(c),m=function(e){var t=$(h);return D.w(t.date(t.date()+Math.round(e*n)),h)};if(z===l)return this.set(l,this.$M+n);if(z===d)return this.set(d,this.$y+n);if(z===s)return m(1);if(z===a)return m(7);var v=(f={},f[u]=t,f[o]=i,f[r]=e,f)[z]||1,p=this.$d.getTime()+n*v;return D.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=D.z(this),u=this.$H,o=this.$m,s=this.$M,a=i.weekdays,l=i.months,c=i.meridiem,d=function(e,i,r,u){return e&&(e[i]||e(t,n))||r[i].slice(0,u)},f=function(e){return D.s(u%12||12,e,"0")},z=c||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(m,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return D.s(t.$y,4,"0");case"M":return s+1;case"MM":return D.s(s+1,2,"0");case"MMM":return d(i.monthsShort,s,l,3);case"MMMM":return d(l,s);case"D":return t.$D;case"DD":return D.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(i.weekdaysMin,t.$W,a,2);case"ddd":return d(i.weekdaysShort,t.$W,a,3);case"dddd":return a[t.$W];case"H":return String(u);case"HH":return D.s(u,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return z(u,o,!0);case"A":return z(u,o,!1);case"m":return String(o);case"mm":return D.s(o,2,"0");case"s":return String(t.$s);case"ss":return D.s(t.$s,2,"0");case"SSS":return D.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(n,f,h){var z,m=this,v=D.p(f),p=$(n),g=(p.utcOffset()-this.utcOffset())*t,b=this-p,x=function(){return D.m(m,p)};switch(v){case d:z=x()/12;break;case l:z=x();break;case c:z=x()/3;break;case a:z=(b-g)/6048e5;break;case s:z=(b-g)/864e5;break;case o:z=b/i;break;case u:z=b/t;break;case r:z=b/e;break;default:z=b}return h?z:D.a(z)},p.daysInMonth=function(){return this.endOf(l).$D},p.$locale=function(){return x[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=M(e,t,!0);return n&&(i.$L=n),i},p.clone=function(){return D.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},v}(),j=S.prototype;return $.prototype=j,[["$ms",n],["$s",r],["$m",u],["$H",o],["$W",s],["$M",l],["$y",d],["$D",f]].forEach(function(e){j[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,S,$),e.$i=!0),$},$.locale=M,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=x[b],$.Ls=x,$.p={},$}()),d={exports:{}},f=a(d.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,n=/\d\d/,r=/\d\d?/,u=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),i=60*t[1]+(+t[2]||0);return 0===i?0:"+"===t[0]?-i:i}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var i,n=o.meridiem;if(n){for(var r=1;r<=24;r+=1)if(e.indexOf(n(r,0,t))>-1){i=r>12;break}}else i=e===(t?"pm":"PM");return i},f={A:[u,function(e){this.afternoon=d(e,!1)}],a:[u,function(e){this.afternoon=d(e,!0)}],Q:[i,function(e){this.month=3*(e-1)+1}],S:[i,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[u,function(e){var t=o.ordinal,i=e.match(/\d+/);if(this.day=i[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[r,a("week")],ww:[n,a("week")],M:[r,a("month")],MM:[n,a("month")],MMM:[u,function(e){var t=c("months"),i=(c("monthsShort")||t.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],MMMM:[u,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(i){var n,r;n=i,r=o&&o.formats;for(var u=(i=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,i,n){var u=n&&n.toUpperCase();return i||r[n]||e[n]||r[u].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,t,i){return t||i.slice(1)})})).match(t),s=u.length,a=0;a<s;a+=1){var l=u[a],c=f[l],d=c&&c[0],h=c&&c[1];u[a]=h?{regex:d,parser:h}:l.replace(/^\[|\]$/g,"")}return function(e){for(var t={},i=0,n=0;i<s;i+=1){var r=u[i];if("string"==typeof r)n+=r.length;else{var o=r.regex,a=r.parser,l=e.slice(n),c=o.exec(l)[0];a.call(t,c),e=e.replace(c,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var i=e.hours;t?i<12&&(e.hours+=12):12===i&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,i){i.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var n=t.prototype,r=n.parse;n.parse=function(e){var t=e.date,n=e.utc,u=e.args;this.$u=n;var s=u[1];if("string"==typeof s){var a=!0===u[2],l=!0===u[3],c=a||l,d=u[2];l&&(d=u[2]),o=this.$locale(),!a&&d&&(o=i.Ls[d]),this.$d=function(e,t,i,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),u=r.year,o=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,d=r.milliseconds,f=r.zone,z=r.week,m=new Date,v=s||(u||o?1:m.getDate()),p=u||m.getFullYear(),g=0;u&&!o||(g=o>0?o-1:m.getMonth());var b,x=a||0,y=l||0,w=c||0,M=d||0;return f?new Date(Date.UTC(p,g,v,x,y,w,M+60*f.offset*1e3)):i?new Date(Date.UTC(p,g,v,x,y,w,M)):(b=new Date(p,g,v,x,y,w,M),z&&(b=n(b).week(z).toDate()),b)}catch(e){return new Date("")}}(t,s,n,i),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),c&&t!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var f=s.length,z=1;z<=f;z+=1){u[1]=s[z-1];var m=i.apply(this,u);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}z===f&&(this.$d=new Date(""))}else r.call(this,e)}}}());c.extend(f);var h={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},z={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},m={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},v={xs:"zui:min-w-[10rem]",sm:"zui:min-w-[12rem]",md:"zui:min-w-[12rem]",lg:"zui:min-w-[14rem]"},p=function(e){return"contained"===e?"zui:bg-muted":"zui:bg-background"};function g(e){return e<10?"0".concat(e):"".concat(e)}function b(e,t,i){void 0===i&&(i=0);for(var n=[],r=i;r<=t;r+=e)n.push(r);return n}var x=s.forwardRef(function(i,o){var a,l,d,f=i.label,x=i.floatingLabel,y=void 0!==x&&x,w=i.description,M=i.error,$=i.size,D=void 0===$?"md":$,S=i.variant,j=void 0===S?"outlined":S,k=i.focusOutline,Y=void 0===k||k,N=i.className,O=i.value,L=i.defaultValue,T=void 0===L?null:L,C=i.onChange,H=i.format,_=void 0===H?"HH:mm":H,A=i.use12Hours,P=i.hourStep,E=void 0===P?1:P,q=i.minuteStep,Z=void 0===q?1:q,F=i.secondStep,U=void 0===F?1:F,W=i.needConfirm,R=void 0===W||W,V=i.showNow,I=void 0===V||V,K=i.okText,B=void 0===K?"OK":K,J=i.closeText,Q=void 0===J?"Close":J,X=i.nowText,G=void 0===X?"Now":X,ee=i.amText,te=void 0===ee?"AM":ee,ie=i.pmText,ne=void 0===ie?"PM":ie,re=i.hourLabel,ue=void 0===re?"Hour":re,oe=i.minuteLabel,se=void 0===oe?"Minute":oe,ae=i.secondLabel,le=void 0===ae?"Second":ae,ce=i.disabledHours,de=i.disabledMinutes,fe=i.disabledSeconds,he=i.disabled,ze=i.placeholder,me=i.required,ve=i.allowClear,pe=void 0===ve||ve,ge=i.id,be=e.__rest(i,["label","floatingLabel","description","error","size","variant","focusOutline","className","value","defaultValue","onChange","format","use12Hours","hourStep","minuteStep","secondStep","needConfirm","showNow","okText","closeText","nowText","amText","pmText","hourLabel","minuteLabel","secondLabel","disabledHours","disabledMinutes","disabledSeconds","disabled","placeholder","required","allowClear","id"]),xe=ge||function(e){void 0===e&&(e="timepicker");var t=s.useRef();return t.current||(t.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),t.current}("timepicker"),ye=(l=_,"boolean"==typeof(d=A)?d:/(^|[^H])h/.test(l)||/(\sa\b|\sA\b|a\b|A\b)/.test(l)),we=function(e){return/\bss\b/.test(e)}(_),Me=function(e){return{container:e?"zui:opacity-80":"",label:e?"zui:text-gray-500":"zui:text-gray-700",input:e?" zui:cursor-not-allowed zui:opacity-90 zui:text-gray-900 zui:bg-gray-50 zui:border zui:border-gray-300":""}}(he||!1),$e=s.useRef(void 0!==O).current,De=s.useState(T),Se=De[0],je=De[1],ke=$e?null!=O?O:null:null!=Se?Se:null,Ye=ke?ke.format(_):"",Ne=s.useState(Ye),Oe=Ne[0],Le=Ne[1],Te=s.useState(!1);Te[0];var Ce=Te[1];s.useEffect(function(){Le(Ye)},[Ye]);var He=s.useState(null),_e=He[0],Ae=He[1],Pe=Boolean(_e),Ee=s.useRef(null),qe=s.useRef(!1);function Ze(e,t){var i;Ae(e&&null!==(i=null!=t?t:Ee.current)&&void 0!==i?i:null)}function Fe(){qe.current=!0,Ze(!1),R&&(Le(Ye),Re(ke)),Promise.resolve().then(function(){qe.current=!1})}s.useEffect(function(){function e(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),Pe&&Ae(null))}return Pe&&document.addEventListener("keydown",e,!0),function(){return document.removeEventListener("keydown",e,!0)}},[Pe]);var Ue=s.useState(ke),We=Ue[0],Re=Ue[1];s.useEffect(function(){Pe&&(Re(ke),Le(Ye))},[Pe,ke,Ye]);var Ve=s.useMemo(function(){return ye?b(E,12,1):b(E,23,0)},[ye,E]),Ie=s.useMemo(function(){return b(Z,59,0)},[Z]),Ke=s.useMemo(function(){return b(U,59,0)},[U]);function Be(e){var t=e?e.format(_):"";null==C||C(e,t),$e||je(e)}function Je(e,t,i,n){var r;if(!(null==ce?void 0:ce(ye?e%12||12:e))&&!((null==de?void 0:de(t))||we&&(null==fe?void 0:fe(i)))){var u=ye?function(e,t){return t?"am"===t?12===e?0:e:12===e?12:e+12:e}(e,n):e,o=(null!==(r=null!=We?We:ke)&&void 0!==r?r:c()).hour(u).minute(t).second(we?i:0).millisecond(0);Re(o),Le(o.format(_)),R||Be(o)}}var Qe=We?We.format(_):"",Xe=Pe&&""!==Qe.trim()?Qe:Ye;var Ge=s.useRef(null),et=s.useRef(null),tt=s.useRef(null);function it(e,t){var i=e.current;if(i){var n=Array.from(i.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==n.length){var r=n.findIndex(function(e){return e===document.activeElement});n[r<0?0:Math.max(0,Math.min(n.length-1,r+t))].focus()}}}function nt(e,t){"ArrowDown"===e.key?(e.preventDefault(),it(t,1)):"ArrowUp"===e.key&&(e.preventDefault(),it(t,-1))}var rt="lg"===D?18:16,ut=f||"Time picker",ot=Boolean(Xe)&&!he&&!!pe,st=null!==(a=null!=We?We:ke)&&void 0!==a?a:null,at=st?st.hour():ye?12:0,lt=st?st.minute():0,ct=st?st.second():0,dt=at>=12?"pm":"am",ft=at%12==0?12:at%12;return t.jsxs("div",{className:r.cn("zui:w-full",Me.container,v[D],N),children:[!y&&f&&t.jsxs("label",{htmlFor:xe,className:r.cn("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",Me.label),children:[f,me&&t.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t.jsxs("div",{className:r.cn("zui:relative zui:w-full zui:rounded-md zui:border zui:bg-background zui:text-sm zui:transition-colors",Y&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===j&&"zui:border-input","contained"===j&&"zui:bg-muted zui:border-transparent",Me.input,M&&"zui:border-destructive",M&&Y&&"zui:focus-within:ring-destructive"),children:[y&&f&&t.jsxs("label",{htmlFor:xe,className:r.cn("zui:absolute zui:left-3 zui:top-0 zui:-translate-y-1/2 zui:px-1 zui:text-xs zui:pointer-events-none zui:transition-colors zui:z-10",p(j),Me.label),children:[f,me&&t.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t.jsx("input",e.__assign({id:xe,ref:function(e){"function"==typeof o?o(e):o&&(o.current=e),Ee.current=e},value:Xe,onChange:function(e){var t;Le(null!==(t=e.target.value)&&void 0!==t?t:"")},onBlur:function(){Ce(!1);var e=(null!=Oe?Oe:"").trim();if(R){if(!e)return Re(null),void Le(Ye);(t=c(e,_,!0)).isValid()?Re(t.millisecond(0)):(Le(Ye),Re(ke))}else{if(!e)return void Be(null);var t;(t=c(e,_,!0)).isValid()?Be(t.millisecond(0)):Le(Ye)}},onFocus:function(e){Ce(!0),he||qe.current||Ze(!0,Ee.current||e.currentTarget)},onClick:function(e){he||qe.current||Ze(!0,Ee.current||e.currentTarget)},placeholder:null!=ze?ze:ye?we?"h:mm:ss a":"h:mm a":we?"HH:mm:ss":"HH:mm","aria-label":ut,disabled:he,required:me,className:r.cn("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",h[D],z[D],ot?"zui:pr-20":"zui:pr-10")},be)),ot?t.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),Re(null),Le(""),Be(null),qe.current=!0,Ze(!1),Promise.resolve().then(function(){qe.current=!1})},className:r.cn("zui:absolute zui:inset-y-0 zui:right-9 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 focus:zui:outline-none",m[D]),"aria-label":"Clear time",children:t.jsx(u.X,{size:rt})}):null,t.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){he||Ze(!Pe,e.currentTarget)}(e)},className:r.cn("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground hover:zui:text-gray-700 disabled:zui:opacity-50",m[D]),disabled:he,"aria-label":"Toggle time panel",children:t.jsx(u.Clock,{size:rt})})]}),t.jsxs("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[w&&!M&&!he&&t.jsx("p",{className:"zui:text-xs zui:text-muted-foreground",children:w}),M&&t.jsx("p",{className:"zui:text-xs zui:text-destructive",children:M})]}),t.jsx(n,{open:Pe,anchorEl:_e,onClose:function(e,t){"backdropClick"!==t&&"escapeKeyDown"!==t&&Fe()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:r.cn("zui:rounded-md zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:t.jsxs("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[t.jsxs("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2 zui:text-xs zui:text-gray-500 zui:sticky zui:top-0 zui:bg-white zui:z-10",children:[t.jsx("div",{className:"zui:text-center",children:ue}),t.jsx("div",{className:"zui:text-center",children:se}),t.jsx("div",{className:"zui:text-center",children:we?le:ye?"AM/PM":""})]}),t.jsxs("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[t.jsx("div",{ref:Ge,onKeyDown:function(e){return nt(e,Ge)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select hour",children:Ve.map(function(e){var i,n=ye?ft===e:at===e,u=null!==(i=null==ce?void 0:ce(ye?e%12||12:e))&&void 0!==i&&i;return t.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":u,disabled:u,onClick:function(){u||Je(e,lt,ct,ye?dt:void 0)},className:r.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",u&&"zui:opacity-40 zui:cursor-not-allowed"),children:g(e)},e)})}),t.jsx("div",{ref:et,onKeyDown:function(e){return nt(e,et)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select minute",children:Ie.map(function(e){var i,n=lt===e,u=null!==(i=null==de?void 0:de(e))&&void 0!==i&&i;return t.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":u,disabled:u,onClick:function(){u||Je(ye?ft:at,e,ct,ye?dt:void 0)},className:r.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",u&&"zui:opacity-40 zui:cursor-not-allowed"),children:g(e)},e)})}),we?t.jsx("div",{ref:tt,onKeyDown:function(e){return nt(e,tt)},className:"zui:max-h-44 zui:overflow-auto zui:p-1 zui:grid zui:grid-cols-3 zui:gap-1",role:"listbox","aria-label":"Select second",children:Ke.map(function(e){var i,n=ct===e,u=null!==(i=null==fe?void 0:fe(e))&&void 0!==i&&i;return t.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":u,disabled:u,onClick:function(){u||Je(ye?ft:at,lt,e,ye?dt:void 0)},className:r.cn("zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",n&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium",u&&"zui:opacity-40 zui:cursor-not-allowed"),children:g(e)},e)})}):ye?t.jsx("div",{className:"zui:flex zui:flex-col zui:gap-1",role:"listbox","aria-label":"Select AM/PM",children:["am","pm"].map(function(e){var i=dt===e;return t.jsx("button",{type:"button",role:"option","aria-selected":i,onClick:function(){Je(ft||12,lt,ct,e)},className:r.cn("zui:flex-1 zui:px-2 zui:py-1 zui:rounded zui:text-sm zui:transition","hover:zui:bg-gray-100 focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500",i&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium"),"aria-pressed":i,children:"am"===e?te:ne},e)})}):null]}),t.jsxs("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[I?t.jsx("button",{type:"button",onClick:function(){var e=c(),t=e.second(we?e.second():0).millisecond(0);Re(t),Le(t.format(_)),Be(t),qe.current=!0,Ze(!1),Promise.resolve().then(function(){qe.current=!1})},className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:G}):t.jsx("span",{}),t.jsxs("div",{className:"zui:flex zui:gap-2",children:[t.jsx("button",{type:"button",onClick:Fe,className:"zui:text-gray-700 hover:zui:text-gray-900 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-2 zui:py-1",children:Q}),R&&t.jsx("button",{type:"button",onClick:function(){Be(null!=We?We:null),qe.current=!0,Ze(!1),Promise.resolve().then(function(){qe.current=!1})},className:"zui:text-white zui:bg-blue-600 hover:zui:bg-blue-700 zui:text-sm focus:zui:outline-none focus:zui:ring-2 focus:zui:ring-blue-500 zui:rounded zui:px-3 zui:py-1",children:B})]})]})]})})]})});exports.TimePicker=x,exports.default=x;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
interface TimelineItem {
|
|
4
|
+
key?: string | number;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
color?: 'blue' | 'green' | 'red' | 'gray' | 'yellow' | 'purple' | string;
|
|
7
|
+
dot?: ReactNode;
|
|
8
|
+
label?: ReactNode;
|
|
9
|
+
position?: 'left' | 'right';
|
|
10
|
+
}
|
|
11
|
+
interface TimelineProps {
|
|
12
|
+
items?: TimelineItem[];
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
pending?: boolean | ReactNode;
|
|
15
|
+
pendingDot?: ReactNode;
|
|
16
|
+
reverse?: boolean;
|
|
17
|
+
mode?: 'left' | 'right' | 'alternate';
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
declare const Timeline: React__default.FC<TimelineProps>;
|
|
22
|
+
|
|
23
|
+
export { Timeline, Timeline as default };
|
|
24
|
+
export type { TimelineItem as TimelineItemProps, TimelineProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,b as e}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as u,jsx as t}from"react/jsx-runtime";import r from"react";var l=function(l){var z=l.items,a=void 0===z?[]:z,n=l.children,s=l.pending,c=void 0!==s&&s,d=l.pendingDot,o=l.reverse,m=void 0!==o&&o,g=l.mode,h=void 0===g?"left":g,f=l.className,v=void 0===f?"":f,b=l.style,x=[];a&&a.length>0?x=a:n&&(x=r.Children.map(n,function(e,u){return r.isValidElement(e)&&e.type===TimelineItem?i({key:e.key||u},e.props):{key:u,children:e}})||[]),m&&(x=e([],x,!0).reverse());var p=function(i,e){var u={blue:"zui:bg-blue-500",green:"zui:bg-green-500",red:"zui:bg-red-500",gray:"zui:bg-gray-400",grey:"zui:bg-gray-400",yellow:"zui:bg-yellow-500",orange:"zui:bg-orange-500",purple:"zui:bg-purple-500",pink:"zui:bg-pink-500",cyan:"zui:bg-cyan-500"}[i.color]||"zui:bg-blue-500";return i.dot?t("div",{className:"zui:flex zui:items-center zui:justify-center zui:w-6 zui:h-6 zui:p-0.5",children:i.dot}):t("div",{className:"zui:w-3 zui:h-3 zui:rounded-full zui:border-2 zui:border-white zui:shadow-sm ".concat(u)})};return u("div",{className:"zui:timeline ".concat(v),style:b,children:[x.map(function(i,e){return function(i,e,r){var l="right"===h||"alternate"===h&&e%2!=0,z="right"===(i.position||(l?"right":"left"));return u("div",{className:"zui:relative zui:flex zui:items-start zui:min-h-[32px] ".concat(r?"":"zui:pb-6"),children:[!r&&t("div",{className:"zui:absolute zui:w-px zui:bg-gray-300 zui:top-6 zui:bottom-0 ".concat(z?"zui:right-1.5":"zui:left-1.5")}),u("div",{className:"zui:flex zui:w-full zui:items-start ".concat(z?"zui:flex-row-reverse":"zui:flex-row"),children:[t("div",{className:"zui:relative zui:flex zui:items-center zui:justify-center zui:w-3 zui:h-3 zui:mt-1.5 zui:flex-shrink-0 ".concat(z?"zui:ml-4":"zui:mr-4"),children:p(i)}),u("div",{className:"zui:flex-1 zui:min-w-0 ".concat(z?"zui:text-right":"zui:text-left"),children:[t("div",{className:"zui:text-gray-900 zui:text-sm zui:leading-relaxed",children:i.children}),i.label&&t("div",{className:"zui:text-xs zui:text-gray-500 zui:mt-1 ".concat(z?"zui:text-right":"zui:text-left"),children:i.label})]})]})]},i.key||e)}(i,e,e===x.length-1)}),c&&u("div",{className:"zui:relative zui:flex zui:items-start zui:min-h-[32px] zui:pt-2",children:[t("div",{className:"zui:relative zui:flex zui:items-center zui:justify-center zui:w-3 zui:h-3 zui:mt-1.5 zui:mr-4",children:d||t("div",{className:"zui:w-3 zui:h-3 zui:rounded-full zui:border-2 zui:border-gray-300 zui:bg-white zui:shadow-sm",children:t("div",{className:"zui:w-full zui:h-full zui:rounded-full zui:bg-gray-300 zui:animate-pulse"})})}),t("div",{className:"zui:flex-1 zui:text-gray-500 zui:text-sm",children:"boolean"==typeof c?"Loading...":c})]})]})};export{l as Timeline,l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../../chunks/tslib.es6-fa3b2784.js"),e=require("react/jsx-runtime"),u=require("react"),t=function(t){var r=t.items,l=void 0===r?[]:r,s=t.children,z=t.pending,a=void 0!==z&&z,n=t.pendingDot,c=t.reverse,d=void 0!==c&&c,o=t.mode,m=void 0===o?"left":o,x=t.className,g=void 0===x?"":x,h=t.style,f=[];l&&l.length>0?f=l:s&&(f=u.Children.map(s,function(e,t){return u.isValidElement(e)&&e.type===TimelineItem?i.__assign({key:e.key||t},e.props):{key:t,children:e}})||[]),d&&(f=i.__spreadArray([],f,!0).reverse());var v=function(i,u){var t={blue:"zui:bg-blue-500",green:"zui:bg-green-500",red:"zui:bg-red-500",gray:"zui:bg-gray-400",grey:"zui:bg-gray-400",yellow:"zui:bg-yellow-500",orange:"zui:bg-orange-500",purple:"zui:bg-purple-500",pink:"zui:bg-pink-500",cyan:"zui:bg-cyan-500"}[i.color]||"zui:bg-blue-500";return i.dot?e.jsx("div",{className:"zui:flex zui:items-center zui:justify-center zui:w-6 zui:h-6 zui:p-0.5",children:i.dot}):e.jsx("div",{className:"zui:w-3 zui:h-3 zui:rounded-full zui:border-2 zui:border-white zui:shadow-sm ".concat(t)})};return e.jsxs("div",{className:"zui:timeline ".concat(g),style:h,children:[f.map(function(i,u){return function(i,u,t){var r="right"===m||"alternate"===m&&u%2!=0,l="right"===(i.position||(r?"right":"left"));return e.jsxs("div",{className:"zui:relative zui:flex zui:items-start zui:min-h-[32px] ".concat(t?"":"zui:pb-6"),children:[!t&&e.jsx("div",{className:"zui:absolute zui:w-px zui:bg-gray-300 zui:top-6 zui:bottom-0 ".concat(l?"zui:right-1.5":"zui:left-1.5")}),e.jsxs("div",{className:"zui:flex zui:w-full zui:items-start ".concat(l?"zui:flex-row-reverse":"zui:flex-row"),children:[e.jsx("div",{className:"zui:relative zui:flex zui:items-center zui:justify-center zui:w-3 zui:h-3 zui:mt-1.5 zui:flex-shrink-0 ".concat(l?"zui:ml-4":"zui:mr-4"),children:v(i)}),e.jsxs("div",{className:"zui:flex-1 zui:min-w-0 ".concat(l?"zui:text-right":"zui:text-left"),children:[e.jsx("div",{className:"zui:text-gray-900 zui:text-sm zui:leading-relaxed",children:i.children}),i.label&&e.jsx("div",{className:"zui:text-xs zui:text-gray-500 zui:mt-1 ".concat(l?"zui:text-right":"zui:text-left"),children:i.label})]})]})]},i.key||u)}(i,u,u===f.length-1)}),a&&e.jsxs("div",{className:"zui:relative zui:flex zui:items-start zui:min-h-[32px] zui:pt-2",children:[e.jsx("div",{className:"zui:relative zui:flex zui:items-center zui:justify-center zui:w-3 zui:h-3 zui:mt-1.5 zui:mr-4",children:n||e.jsx("div",{className:"zui:w-3 zui:h-3 zui:rounded-full zui:border-2 zui:border-gray-300 zui:bg-white zui:shadow-sm",children:e.jsx("div",{className:"zui:w-full zui:h-full zui:rounded-full zui:bg-gray-300 zui:animate-pulse"})})}),e.jsx("div",{className:"zui:flex-1 zui:text-gray-500 zui:text-sm",children:"boolean"==typeof a?"Loading...":a})]})]})};exports.Timeline=t,exports.default=t;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { TypographyProps, SxProps } from '@mui/material';
|
|
3
|
+
|
|
4
|
+
interface HeadingProps extends TypographyProps {
|
|
5
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
}
|
|
7
|
+
declare const Heading: ({ level, ...props }: HeadingProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
|
|
9
|
+
interface TextProps extends TypographyProps {
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
}
|
|
12
|
+
declare const Text: ({ size, ...props }: TextProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
declare const Lead: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
declare const Muted: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare const Strong: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
declare const Caption: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
declare const Blockquote: (props: TypographyProps) => react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
interface CodeProps {
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
sx?: SxProps;
|
|
27
|
+
}
|
|
28
|
+
declare const Code: ({ children, sx }: CodeProps) => react_jsx_runtime.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { Blockquote, Caption, Code, Heading, Lead, Muted, Strong, Text };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{H as Heading}from"../../chunks/Heading-b91e2c5f.esm.js";export{T as Text}from"../../chunks/Text-f18219bd.esm.js";import{a as o}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsx as n}from"react/jsx-runtime";import{Typography as t,Box as e}from"@mui/material";export{M as Muted}from"../../chunks/Muted-bfc4985b.esm.js";var r=function(e){return n(t,o({variant:"subtitle1",component:e.component||"p",fontWeight:400,color:"text.secondary"},e))},i=function(e){return n(t,o({component:e.component||"strong",fontWeight:500,display:"inline"},e))},c=function(e){return n(t,o({variant:"caption",color:"text.secondary",component:e.component||"span"},e))},s=function(e){return n(t,o({component:"blockquote",sx:{borderLeft:"4px solid",borderColor:"divider",pl:2,color:"text.secondary",fontStyle:"italic"}},e))},a=function(t){var r=t.children,i=t.sx;return n(e,{component:"code",sx:o({fontFamily:"monospace",backgroundColor:"grey.100",color:"primary.main",px:.5,py:.25,borderRadius:1,fontSize:"0.875rem"},i),children:r})};export{s as Blockquote,c as Caption,a as Code,r as Lead,i as Strong};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../chunks/Heading-54a5488c.js"),o=require("../../chunks/Text-8c4fb3f8.js"),r=require("../../chunks/tslib.es6-fa3b2784.js"),n=require("react/jsx-runtime"),t=require("@mui/material"),s=require("../../chunks/Muted-619e3b72.js");exports.Heading=e.Heading,exports.Text=o.Text,exports.Muted=s.Muted,exports.Blockquote=function(e){return n.jsx(t.Typography,r.__assign({component:"blockquote",sx:{borderLeft:"4px solid",borderColor:"divider",pl:2,color:"text.secondary",fontStyle:"italic"}},e))},exports.Caption=function(e){return n.jsx(t.Typography,r.__assign({variant:"caption",color:"text.secondary",component:e.component||"span"},e))},exports.Code=function(e){var o=e.children,s=e.sx;return n.jsx(t.Box,{component:"code",sx:r.__assign({fontFamily:"monospace",backgroundColor:"grey.100",color:"primary.main",px:.5,py:.25,borderRadius:1,fontSize:"0.875rem"},s),children:o})},exports.Lead=function(e){return n.jsx(t.Typography,r.__assign({variant:"subtitle1",component:e.component||"p",fontWeight:400,color:"text.secondary"},e))},exports.Strong=function(e){return n.jsx(t.Typography,r.__assign({component:e.component||"strong",fontWeight:500,display:"inline"},e))};
|