@zimyo/ui 1.15.0 → 1.15.2

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.
Files changed (136) hide show
  1. package/dist/chunks/Heading-cefb898e.esm.js +1 -0
  2. package/dist/chunks/Heading-ff5c771d.js +1 -0
  3. package/dist/chunks/Muted-d00b328e.esm.js +1 -0
  4. package/dist/chunks/Muted-d2dbaba3.js +1 -0
  5. package/dist/chunks/Text-5b99f7f4.esm.js +1 -0
  6. package/dist/chunks/Text-e9636dd7.js +1 -0
  7. package/dist/chunks/_commonjsHelpers-02d3be64.esm.js +1 -0
  8. package/dist/chunks/_commonjsHelpers-3d4c1909.js +1 -0
  9. package/dist/chunks/assertThisInitialized-03efc53b.esm.js +1 -0
  10. package/dist/chunks/assertThisInitialized-9901ca61.js +1 -0
  11. package/dist/chunks/createSuper-a71d2b5b.esm.js +1 -0
  12. package/dist/chunks/createSuper-c9c5c00c.js +1 -0
  13. package/dist/chunks/dayjs.min-5e22609b.js +1 -0
  14. package/dist/chunks/dayjs.min-ccb12949.esm.js +1 -0
  15. package/dist/chunks/extends-77a6284f.js +1 -0
  16. package/dist/chunks/extends-bb693bd1.esm.js +1 -0
  17. package/dist/chunks/index-1d613f26.js +1 -0
  18. package/dist/chunks/index-3cd5487e.esm.js +1 -0
  19. package/dist/chunks/index-46a2254a.js +1 -0
  20. package/dist/chunks/index-4d90f67d.js +1 -0
  21. package/dist/chunks/index-6d90ff6c.esm.js +1 -0
  22. package/dist/chunks/index-92dc1820.esm.js +1 -0
  23. package/dist/chunks/index-9d477012.js +1 -0
  24. package/dist/chunks/index-e5b56c03.esm.js +1 -0
  25. package/dist/chunks/lucide-1d5a9cda.esm.js +26 -0
  26. package/dist/chunks/lucide-937248a9.js +26 -0
  27. package/dist/chunks/moment-1102cd58.js +3 -0
  28. package/dist/chunks/moment-df993c05.esm.js +3 -0
  29. package/dist/chunks/react-virtualized-auto-sizer.esm-8dfcb62e.js +1 -0
  30. package/dist/chunks/react-virtualized-auto-sizer.esm-9ede76fe.esm.js +1 -0
  31. package/dist/chunks/tslib.es6-4974c96c.esm.js +1 -0
  32. package/dist/chunks/tslib.es6-a3dc1f53.js +1 -0
  33. package/dist/components/Accordion/index.d.ts +34 -0
  34. package/dist/components/Accordion/index.esm.js +1 -0
  35. package/dist/components/Accordion/index.js +1 -0
  36. package/dist/components/AppList/index.d.ts +27 -0
  37. package/dist/components/AppList/index.esm.js +1 -0
  38. package/dist/components/AppList/index.js +1 -0
  39. package/dist/components/Badge/index.d.ts +29 -0
  40. package/dist/components/Badge/index.esm.js +1 -0
  41. package/dist/components/Badge/index.js +1 -0
  42. package/dist/components/BulkActionsBar/index.d.ts +23 -0
  43. package/dist/components/BulkActionsBar/index.esm.js +1 -0
  44. package/dist/components/BulkActionsBar/index.js +1 -0
  45. package/dist/components/Button/index.d.ts +15 -0
  46. package/dist/components/Button/index.esm.js +1 -0
  47. package/dist/components/Button/index.js +1 -0
  48. package/dist/components/Card/index.d.ts +73 -0
  49. package/dist/components/Card/index.esm.js +1 -0
  50. package/dist/components/Card/index.js +1 -0
  51. package/dist/components/Charts/index.d.ts +62 -0
  52. package/dist/components/Charts/index.esm.js +10 -0
  53. package/dist/components/Charts/index.js +10 -0
  54. package/dist/components/Checkbox/index.d.ts +14 -0
  55. package/dist/components/Checkbox/index.esm.js +1 -0
  56. package/dist/components/Checkbox/index.js +1 -0
  57. package/dist/components/CheckboxGroup/index.d.ts +31 -0
  58. package/dist/components/CheckboxGroup/index.esm.js +1 -0
  59. package/dist/components/CheckboxGroup/index.js +1 -0
  60. package/dist/components/DataTable/index.d.ts +77 -0
  61. package/dist/components/DataTable/index.esm.js +23 -0
  62. package/dist/components/DataTable/index.js +22 -0
  63. package/dist/components/DatePicker/index.d.ts +43 -0
  64. package/dist/components/DatePicker/index.esm.js +1 -0
  65. package/dist/components/DatePicker/index.js +1 -0
  66. package/dist/components/DateRangePicker/index.d.ts +32 -0
  67. package/dist/components/DateRangePicker/index.esm.js +1 -0
  68. package/dist/components/DateRangePicker/index.js +1 -0
  69. package/dist/components/Form/index.d.ts +35 -0
  70. package/dist/components/Form/index.esm.js +1 -0
  71. package/dist/components/Form/index.js +1 -0
  72. package/dist/components/GlobalMenuSearch/index.d.ts +16 -0
  73. package/dist/components/GlobalMenuSearch/index.esm.js +1 -0
  74. package/dist/components/GlobalMenuSearch/index.js +1 -0
  75. package/dist/components/Input/index.d.ts +2 -0
  76. package/dist/components/Input/index.esm.js +1 -0
  77. package/dist/components/Input/index.js +1 -0
  78. package/dist/components/LottiePlayer/index.d.ts +16 -0
  79. package/dist/components/LottiePlayer/index.esm.js +3 -0
  80. package/dist/components/LottiePlayer/index.js +3 -0
  81. package/dist/components/Modal/index.d.ts +20 -0
  82. package/dist/components/Modal/index.esm.js +1 -0
  83. package/dist/components/Modal/index.js +1 -0
  84. package/dist/components/Notice/index.d.ts +19 -0
  85. package/dist/components/Notice/index.esm.js +1 -0
  86. package/dist/components/Notice/index.js +1 -0
  87. package/dist/components/Popover/index.d.ts +19 -0
  88. package/dist/components/Popover/index.esm.js +1 -0
  89. package/dist/components/Popover/index.js +1 -0
  90. package/dist/components/PopupConfirm/index.d.ts +36 -0
  91. package/dist/components/PopupConfirm/index.esm.js +1 -0
  92. package/dist/components/PopupConfirm/index.js +1 -0
  93. package/dist/components/Progress/index.d.ts +24 -0
  94. package/dist/components/Progress/index.esm.js +1 -0
  95. package/dist/components/Progress/index.js +1 -0
  96. package/dist/components/Radio/index.d.ts +24 -0
  97. package/dist/components/Radio/index.esm.js +1 -0
  98. package/dist/components/Radio/index.js +1 -0
  99. package/dist/components/RadioGroup/index.d.ts +31 -0
  100. package/dist/components/RadioGroup/index.esm.js +1 -0
  101. package/dist/components/RadioGroup/index.js +1 -0
  102. package/dist/components/SearchInput/index.d.ts +20 -0
  103. package/dist/components/SearchInput/index.esm.js +9 -0
  104. package/dist/components/SearchInput/index.js +9 -0
  105. package/dist/components/Select/index.d.ts +36 -0
  106. package/dist/components/Select/index.esm.js +1 -0
  107. package/dist/components/Select/index.js +1 -0
  108. package/dist/components/Stepper/index.d.ts +72 -0
  109. package/dist/components/Stepper/index.esm.js +1 -0
  110. package/dist/components/Stepper/index.js +1 -0
  111. package/dist/components/Switch/index.d.ts +15 -0
  112. package/dist/components/Switch/index.esm.js +1 -0
  113. package/dist/components/Switch/index.js +1 -0
  114. package/dist/components/Tab/index.d.ts +40 -0
  115. package/dist/components/Tab/index.esm.js +1 -0
  116. package/dist/components/Tab/index.js +1 -0
  117. package/dist/components/Table/index.d.ts +80 -0
  118. package/dist/components/Table/index.esm.js +1 -0
  119. package/dist/components/Table/index.js +1 -0
  120. package/dist/components/TimePicker/index.d.ts +40 -0
  121. package/dist/components/TimePicker/index.esm.js +1 -0
  122. package/dist/components/TimePicker/index.js +1 -0
  123. package/dist/components/Timeline/index.d.ts +26 -0
  124. package/dist/components/Timeline/index.esm.js +1 -0
  125. package/dist/components/Timeline/index.js +1 -0
  126. package/dist/components/Typography/index.d.ts +30 -0
  127. package/dist/components/Typography/index.esm.js +1 -0
  128. package/dist/components/Typography/index.js +1 -0
  129. package/dist/index-5f6a7a1d.d.ts +25 -0
  130. package/dist/index.d.ts +1052 -0
  131. package/dist/index.esm.js +1 -0
  132. package/dist/index.js +1 -0
  133. package/dist/theme/index.d.ts +93 -0
  134. package/dist/theme/index.esm.js +1 -0
  135. package/dist/theme/index.js +1 -0
  136. package/package.json +3 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../../chunks/tslib.es6-a3dc1f53.js"),e=require("react/jsx-runtime"),n=require("react"),t=require("../../chunks/react-virtualized-auto-sizer.esm-8dfcb62e.js"),r=require("../Checkbox/index.js"),u=require("../../chunks/lucide-937248a9.js");require("../../chunks/extends-77a6284f.js"),require("../../chunks/assertThisInitialized-9901ca61.js"),require("../../chunks/index-4d90f67d.js");var s=150,o=function(n){var t,r=n.column,u=n.width,s=n.sticky,o=n.stickyPosition,l=s?((t={position:"sticky"})[s]="".concat(o||0,"px"),t.zIndex=25,t.backgroundColor="white",t):{},a="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return e.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(a),style:i.__assign({width:"".concat(u,"px"),minWidth:"".concat(u,"px"),maxWidth:"".concat(u,"px")},l),children:e.jsx("div",{className:"zui:h-4 zui:bg-gray-200 zui:rounded zui:animate-pulse zui:w-3/4"})})},l=function(i){var n=i.leftStickyColumns,t=i.rightStickyColumns,r=i.regularColumns,u=i.selection,l=i.calculateStickyPosition,a=i.rowIndex;return e.jsxs("div",{className:"zui:flex zui:min-w-full zui:border-b zui:border-gray-200 zui:bg-white",children:[(null==u?void 0:u.enabled)&&e.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:e.jsx("div",{className:"zui:w-4 zui:h-4 zui:bg-gray-200 zui:rounded zui:animate-pulse"})}),n.map(function(i,t){return e.jsx(o,{column:i,width:i.width||s,sticky:"left",stickyPosition:l(n,t,"left")},"left-".concat(i.id,"-").concat(a))}),r.map(function(i,n){return e.jsx(o,{column:i,width:i.width||s},"regular-".concat(i.id,"-").concat(a))}),t.map(function(i,n){return e.jsx(o,{column:i,width:i.width||s,sticky:"right",stickyPosition:l(t,n,"right")},"right-".concat(i.id,"-").concat(a))})]})},a=function(i){var n=i.columns,t=i.leftStickyColumns,r=i.rightStickyColumns,u=i.regularColumns,s=i.selection,o=i.calculateStickyPosition,a=i.totalWidth;return e.jsx("div",{style:{minWidth:"".concat(a,"px")},children:Array.from({length:10},function(i,a){return e.jsx(l,{columns:n,leftStickyColumns:t,rightStickyColumns:r,regularColumns:u,selection:s,calculateStickyPosition:o,rowIndex:a},"skeleton-row-".concat(a))})})},c=function(o){var l,c,h=o.columns,x=o.data,f=o.loading,g=void 0!==f&&f,m=o.stickyColumns,y=o.pagination,b=o.selection,p=o.sorting,v=o.filtering,w=o.expansion,j=o.virtualization,k=void 0===j?{enabled:!1}:j,C=o.onRowClick;o.bulkActions;var N=o.isRowSelectable,S=o.className,_=void 0===S?"":S;o.variant;var R=n.useState(h),P=R[0],M=R[1],E=n.useState(""),L=E[0];E[1];var A=n.useState(!1),I=A[0];A[1];var W=n.useRef(null),q=n.useRef(null),O=n.useRef(null),B=n.useMemo(function(){return P.map(function(e){var n,t,r=e.sticky;return(null===(n=null==m?void 0:m.left)||void 0===n?void 0:n.includes(e.id))?r="left":(null===(t=null==m?void 0:m.right)||void 0===t?void 0:t.includes(e.id))&&(r="right"),i.__assign(i.__assign({},e),{sticky:r})})},[P,m]),F=n.useMemo(function(){return B.filter(function(i){return!i.hidden})},[B]),T=null!==(l=null==m?void 0:m.left)&&void 0!==l?l:[],D=null!==(c=null==m?void 0:m.right)&&void 0!==c?c:[],H=F.filter(function(i){return T.includes(i.id)}),U=F.filter(function(i){return D.includes(i.id)}),G=F.filter(function(i){return!T.includes(i.id)&&!D.includes(i.id)}),J=n.useMemo(function(){return G.reduce(function(i,e){return i+(e.width||s)},0)},[G]),K=n.useMemo(function(){var i=0;return(null==b?void 0:b.enabled)&&(i+=48),F.forEach(function(e){i+=e.width||s}),Math.max(i,800)},[F,b]),Q=n.useMemo(function(){var e=i.__spreadArray([],x,!0);return L&&(e=e.filter(function(i){return Object.values(i).some(function(i){return String(i).toLowerCase().includes(L.toLowerCase())})})),(null==v?void 0:v.filters)&&Object.entries(v.filters).forEach(function(i){var n=i[0],t=i[1];t&&(e=e.filter(function(i){return String(i[n]).toLowerCase().includes(String(t).toLowerCase())}))}),(null==p?void 0:p.sortBy)&&e.sort(function(i,e){var n=i[p.sortBy],t=e[p.sortBy];return n<t?"asc"===p.sortOrder?-1:1:n>t?"asc"===p.sortOrder?1:-1:0}),e},[x,L,null==v?void 0:v.filters,p]);n.useEffect(function(){var i=q.current,e=O.current;if(i&&e){var n=!1,t=!1,r=function(){t||(n=!0,e.scrollLeft=i.scrollLeft,setTimeout(function(){n=!1},0))},u=function(){n||(t=!0,i.scrollLeft=e.scrollLeft,setTimeout(function(){t=!1},0))};return i.addEventListener("scroll",r),e.addEventListener("scroll",u),function(){i.removeEventListener("scroll",r),e.removeEventListener("scroll",u)}}},[]);var V=n.useCallback(function(){if((null==b?void 0:b.enabled)&&Q){var e=Q.filter(function(i){return!N||N(i)}).map(function(i){return i.id});if(e.every(function(i){return b.selectedRows.includes(i)}))b.onSelectionChange(b.selectedRows.filter(function(i){return!e.includes(i)}));else{var n=Array.from(new Set(i.__spreadArray(i.__spreadArray([],b.selectedRows.filter(function(i){return!e.includes(i)}),!0),e,!0)));b.onSelectionChange(n)}}},[Q,b,N]),X=n.useCallback(function(e){if(null==b?void 0:b.enabled){var n=b.selectedRows;n.includes(e)?b.onSelectionChange(n.filter(function(i){return i!==e})):b.onSelectionChange(i.__spreadArray(i.__spreadArray([],n,!0),[e],!1))}},[b]),Y=n.useCallback(function(e){if(w){var n=w.expandedRows;n.includes(e)?w.onExpansionChange(n.filter(function(i){return i!==e})):w.onExpansionChange(i.__spreadArray(i.__spreadArray([],n,!0),[e],!1))}},[w]),Z=n.useCallback(function(e){M(function(n){return n.map(function(n){return n.id===e?i.__assign(i.__assign({},n),{hidden:!n.hidden}):n})})},[]),$=n.useCallback(function(i,n,t){var r=n[i.accessor];return i.render?i.render(r,n,t):e.jsx("span",{className:"zui:truncate",children:String(r||"")})},[]),ii=n.useCallback(function(i,e,n){var t=0;return"left"===n?((null==b?void 0:b.enabled)&&(t+=48),i.slice(0,e).forEach(function(i){t+=i.width||s})):i.slice(e+1).forEach(function(i){t+=i.width||s}),t},[b]);return e.jsxs("div",{className:"zui:w-full zui:h-full zui:bg-white zui:flex zui:flex-col ".concat(_),children:[I&&!g&&e.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:[e.jsx("h3",{className:"zui:text-sm zui:font-medium zui:text-gray-900 zui:mb-3",children:"Show/Hide Columns"}),h.map(function(i){return e.jsxs("label",{className:"zui:flex zui:items-center zui:space-x-2 zui:mb-2",children:[e.jsx("input",{type:"checkbox",checked:!i.hidden,onChange:function(){return Z(i.id)},className:"zui:rounded zui:border-gray-300"}),e.jsx("span",{className:"zui:text-sm zui:text-gray-700",children:i.header})]},i.id)})]}),e.jsxs("div",{ref:W,className:"zui:relative zui:flex-1 zui:min-h-0 zui:overflow-hidden",children:[e.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==b?void 0:b.enabled)&&e.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:e.jsx(r.Checkbox,{checked:!g&&Q.length>0&&Q.every(function(i){return b.selectedRows.includes(i.id)}),onChange:V,disabled:g,className:"zui:rounded zui:border-gray-300 zui:w-4 zui:h-4 zui:disabled:opacity-50"})}),H.map(function(i,n){return e.jsx(d,{column:i,width:i.width||s,sticky:"left",stickyPosition:ii(H,n,"left"),sorting:p,loading:g},i.id)}),e.jsx("div",{ref:q,className:"zui:flex-1 zui:overflow-x-auto zui:scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.jsx("div",{className:"zui:flex",style:{minWidth:"".concat(J,"px")},children:G.map(function(i){return e.jsx(d,{column:i,width:i.width||s,sorting:p,loading:g},i.id)})})}),U.map(function(i,n){return e.jsx(d,{column:i,width:i.width||s,sticky:"right",stickyPosition:ii(U,n,"right"),sorting:p,loading:g},i.id)})]}),e.jsx("div",{ref:O,className:"zui:flex-1 zui:overflow-auto zui:h-[calc(100%_-_2.75rem)]",style:{minHeight:"200px"},children:(null==k?void 0:k.enabled)?e.jsx(t.AutoSizer,{children:function(i){var n=i.height,r=i.width;return e.jsx(t.FixedSizeList,{height:n,width:r,itemCount:Q.length,itemSize:k.rowHeight||60,overscanCount:k.overscan||5,children:function(i){var n=i.index,t=i.style;return e.jsx("div",{style:t,children:e.jsx(z,{row:Q[n],rowIndex:n,columns:F,leftStickyColumns:H,rightStickyColumns:U,regularColumns:G,selection:b,expansion:w,onRowClick:C,onRowSelection:X,onRowExpansion:Y,renderCell:$,calculateStickyPosition:ii,isRowSelectable:N})},Q[n].id)}})}}):g?e.jsx(a,{columns:F,leftStickyColumns:H,rightStickyColumns:U,regularColumns:G,selection:b,calculateStickyPosition:ii,totalWidth:K}):0===Q.length?e.jsxs("div",{className:"zui:flex zui:flex-col zui:items-center zui:justify-center zui:py-12",children:[e.jsx("div",{className:"zui:text-gray-400 zui:text-lg zui:mb-2",children:"No data found"}),e.jsx("div",{className:"zui:text-gray-500 zui:text-sm",children:"Try adjusting your search or filters"})]}):e.jsx("div",{style:{minWidth:"".concat(K,"px")},children:Q.map(function(i,n){return e.jsx(z,{row:i,rowIndex:n,columns:F,leftStickyColumns:H,rightStickyColumns:U,regularColumns:G,selection:b,expansion:w,onRowClick:C,onRowSelection:X,onRowExpansion:Y,renderCell:$,calculateStickyPosition:ii,isRowSelectable:N},i.id)})})})]}),y&&e.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:[g?"Loading...":function(){Math.max(1,Math.ceil(y.total/y.pageSize));var i=Math.min((y.page-1)*y.pageSize+1,Math.max(0,y.total)),e=Math.min(y.page*y.pageSize,y.total);return"Showing ".concat(0===y.total?0:i,"-").concat(e," of ").concat(y.total," entries")}(),e.jsx("div",{className:"zui:flex zui:items-center zui:space-x-2",children:g?e.jsx(e.Fragment,{children:Array.from({length:4},function(i,n){return e.jsx("div",{className:"zui:w-8 zui:h-8 zui:bg-gray-200 zui:rounded zui:animate-pulse"},n)})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"zui:flex zui:items-center zui:space-x-1 zui:ml-2",children:[e.jsx("span",{className:"zui:text-sm zui:text-gray-700",children:"Per page:"}),e.jsx("select",{value:y.pageSize,onChange:function(i){var e=Number(i.target.value);y.onPageSizeChange(e),y.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(i){return e.jsx("option",{value:i,children:i},i)})})]}),e.jsx("button",{onClick:function(){return y.onPageChange(1)},disabled:1===y.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:e.jsx(u.ChevronFirst,{size:18})}),e.jsx("button",{onClick:function(){return y.onPageChange(Math.max(1,y.page-1))},disabled:1===y.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:e.jsx(u.ChevronLeft,{size:18})}),e.jsx("button",{onClick:function(){return y.onPageChange(Math.min(Math.max(1,Math.ceil(y.total/y.pageSize)),y.page+1))},disabled:y.page>=Math.max(1,Math.ceil(y.total/y.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:e.jsx(u.ChevronRight,{size:18})}),e.jsx("button",{onClick:function(){return y.onPageChange(Math.max(1,Math.ceil(y.total/y.pageSize)))},disabled:y.page>=Math.max(1,Math.ceil(y.total/y.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:e.jsx(u.ChevronLast,{size:18})})]})})]})]})},d=function(n){var t,r=n.column,s=n.width,o=n.sticky,l=n.stickyPosition,a=n.sorting,c=n.loading,d=void 0!==c&&c,z=o?((t={position:"sticky"})[o]="".concat(l||0,"px"),t.zIndex=45,t.backgroundColor="#f9fafb",t):{},h="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return e.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(h),style:i.__assign({width:"".concat(s,"px"),minWidth:"".concat(s,"px"),maxWidth:"".concat(s,"px")},z),children:e.jsxs("div",{className:"zui:flex zui:items-center zui:space-x-1 zui:flex-1 zui:min-w-0",children:[e.jsx("span",{className:"zui:truncate zui:flex-1",children:r.header}),r.sortable&&e.jsx("button",{onClick:function(){if(r.sortable&&a&&!d){var i="asc";a.sortBy===r.id&&(i="asc"===a.sortOrder?"desc":"asc"),a.onSortChange(r.id,i)}},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==a?void 0:a.sortBy)!==r.id?e.jsx(u.ArrowUpDown,{className:"zui:w-4 zui:h-4 zui:text-gray-400"}):"asc"===a.sortOrder?e.jsx(u.ArrowUp,{className:"zui:w-4 zui:h-4 zui:text-blue-600"}):e.jsx(u.ArrowDown,{className:"zui:w-4 zui:h-4 zui:text-blue-600"})})]})})},z=function(i){var t=i.row,o=i.rowIndex,l=i.leftStickyColumns,a=i.rightStickyColumns,c=i.regularColumns,d=i.selection,z=i.expansion,x=i.onRowClick,f=i.onRowSelection,g=i.onRowExpansion,m=i.renderCell,y=i.calculateStickyPosition,b=i.isRowSelectable,p=(null==d?void 0:d.selectedRows.includes(t.id))||!1,v=(null==z?void 0:z.expandedRows.includes(t.id))||!1,w=t._children&&t._children.length>0,j=n.useCallback(function(){f(t.id)},[t.id,f]),k=n.useCallback(function(){g(t.id)},[t.id,g]),C=n.useCallback(function(i,n,t){var r=i.render?i.render(n[i.accessor],n,t):e.jsx("span",{className:"zui:truncate",children:String(n[i.accessor]||"")});return e.jsxs("div",{className:"zui:flex zui:items-center zui:w-full",children:[z&&e.jsx("div",{className:"zui:flex-shrink-0 zui:mr-2",children:w?e.jsx("button",{onClick:function(i){i.stopPropagation(),k()},className:"zui:p-1 zui:hover:bg-gray-200 zui:rounded zui:transition-colors",children:v?e.jsx(u.ChevronDown,{className:"zui:w-4 zui:h-4"}):e.jsx(u.ChevronRight,{className:"zui:w-4 zui:h-4"})}):e.jsx("div",{className:"zui:w-6 zui:h-6"})}),e.jsx("div",{className:"zui:flex-1 zui:min-w-0",children:r})]})},[z,w,v,k]);return e.jsxs(e.Fragment,{children:[e.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(p?"zui:bg-blue-50":"zui:bg-white"),onClick:function(){return null==x?void 0:x(t)},children:[(null==d?void 0:d.enabled)&&(!b||b(t)?e.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:e.jsx(r.Checkbox,{checked:p,onChange:function(i){i.stopPropagation(),j()},className:"zui:rounded zui:border-gray-300 zui:w-4 zui:h-4"})}):e.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(i,n){return e.jsx(h,{column:i,row:t,rowIndex:o,width:i.width||s,sticky:"left",stickyPosition:y(l,n,"left"),renderCell:0===n?C:m},i.id)}),c.map(function(i,n){return e.jsx(h,{column:i,row:t,rowIndex:o,width:i.width||s,renderCell:0===l.length&&0===n?C:m},i.id)}),a.map(function(i,n){return e.jsx(h,{column:i,row:t,rowIndex:o,width:i.width||s,sticky:"right",stickyPosition:y(a,n,"right"),renderCell:m},i.id)})]}),v&&(null==z?void 0:z.renderExpandedRow)&&e.jsx("div",{className:"zui:border-b zui:border-gray-200 zui:bg-gray-50",children:z.renderExpandedRow(t)})]})},h=function(n){var t,r=n.column,u=n.row,s=n.rowIndex,o=n.width,l=n.sticky,a=n.stickyPosition,c=n.renderCell,d=l?((t={position:"sticky"})[l]="".concat(a||0,"px"),t.zIndex=25,t.backgroundColor="inherit",t):{},z="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return e.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(z),style:i.__assign({width:"".concat(o,"px"),minWidth:"".concat(o,"px"),maxWidth:"".concat(o,"px")},d),children:e.jsx("div",{className:"zui:w-full zui:min-w-0",children:c(r,u,s)})})};exports.Table=c,exports.default=c;
@@ -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 i}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsxs as t,jsx as u}from"react/jsx-runtime";import*as n from"react";import r from"@mui/material/Popover";import{d as o}from"../../chunks/dayjs.min-ccb12949.esm.js";import{c as a,g as l}from"../../chunks/_commonjsHelpers-02d3be64.esm.js";import{a as s}from"../../chunks/index-6d90ff6c.esm.js";import{X as c,m as d}from"../../chunks/lucide-1d5a9cda.esm.js";var z={exports:{}},f=l(z.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"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,t=/\d/,u=/\d\d/,n=/\d\d?/,r=/\d*[^-_:/,()\s\d]+/,o={},a=function(e){return(e=+e)+(e>68?1900:2e3)},l=function(e){return function(i){this[e]=+i}},s=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var i=e.match(/([+-]|\d\d)/g),t=60*i[1]+(+i[2]||0);return 0===t?0:"+"===i[0]?-t:t}(e)}],c=function(e){var i=o[e];return i&&(i.indexOf?i:i.s.concat(i.f))},d=function(e,i){var t,u=o.meridiem;if(u){for(var n=1;n<=24;n+=1)if(e.indexOf(u(n,0,i))>-1){t=n>12;break}}else t=e===(i?"pm":"PM");return t},z={A:[r,function(e){this.afternoon=d(e,!1)}],a:[r,function(e){this.afternoon=d(e,!0)}],Q:[t,function(e){this.month=3*(e-1)+1}],S:[t,function(e){this.milliseconds=100*+e}],SS:[u,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[n,l("seconds")],ss:[n,l("seconds")],m:[n,l("minutes")],mm:[n,l("minutes")],H:[n,l("hours")],h:[n,l("hours")],HH:[n,l("hours")],hh:[n,l("hours")],D:[n,l("day")],DD:[u,l("day")],Do:[r,function(e){var i=o.ordinal,t=e.match(/\d+/);if(this.day=t[0],i)for(var u=1;u<=31;u+=1)i(u).replace(/\[|\]/g,"")===e&&(this.day=u)}],w:[n,l("week")],ww:[u,l("week")],M:[n,l("month")],MM:[u,l("month")],MMM:[r,function(e){var i=c("months"),t=(c("monthsShort")||i.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],MMMM:[r,function(e){var i=c("months").indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],Y:[/[+-]?\d+/,l("year")],YY:[u,function(e){this.year=a(e)}],YYYY:[/\d{4}/,l("year")],Z:s,ZZ:s};function f(t){var u,n;u=t,n=o&&o.formats;for(var r=(t=u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(i,t,u){var r=u&&u.toUpperCase();return t||n[u]||e[u]||n[r].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,i,t){return i||t.slice(1)})})).match(i),a=r.length,l=0;l<a;l+=1){var s=r[l],c=z[s],d=c&&c[0],f=c&&c[1];r[l]=f?{regex:d,parser:f}:s.replace(/^\[|\]$/g,"")}return function(e){for(var i={},t=0,u=0;t<a;t+=1){var n=r[t];if("string"==typeof n)u+=n.length;else{var o=n.regex,l=n.parser,s=e.slice(u),c=o.exec(s)[0];l.call(i,c),e=e.replace(c,"")}}return function(e){var i=e.afternoon;if(void 0!==i){var t=e.hours;i?t<12&&(e.hours+=12):12===t&&(e.hours=0),delete e.afternoon}}(i),i}}return function(e,i,t){t.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var u=i.prototype,n=u.parse;u.parse=function(e){var i=e.date,u=e.utc,r=e.args;this.$u=u;var a=r[1];if("string"==typeof a){var l=!0===r[2],s=!0===r[3],c=l||s,d=r[2];s&&(d=r[2]),o=this.$locale(),!l&&d&&(o=t.Ls[d]),this.$d=function(e,i,t,u){try{if(["x","X"].indexOf(i)>-1)return new Date(("X"===i?1e3:1)*e);var n=f(i)(e),r=n.year,o=n.month,a=n.day,l=n.hours,s=n.minutes,c=n.seconds,d=n.milliseconds,z=n.zone,m=n.week,h=new Date,p=a||(r||o?1:h.getDate()),v=r||h.getFullYear(),b=0;r&&!o||(b=o>0?o-1:h.getMonth());var g,x=l||0,y=s||0,w=c||0,M=d||0;return z?new Date(Date.UTC(v,b,p,x,y,w,M+60*z.offset*1e3)):t?new Date(Date.UTC(v,b,p,x,y,w,M)):(g=new Date(v,b,p,x,y,w,M),m&&(g=u(g).week(m).toDate()),g)}catch(e){return new Date("")}}(i,a,u,t),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),c&&i!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var z=a.length,m=1;m<=z;m+=1){r[1]=a[m-1];var h=t.apply(this,r);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===z&&(this.$d=new Date(""))}else n.call(this,e)}}}());o.extend(f);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"},h={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]"},b=function(e){return"contained"===e?"zui:bg-muted":"zui:bg-background"};function g(e){return e<10?"0".concat(e):"".concat(e)}function x(e,i,t){void 0===t&&(t=0);for(var u=[],n=t;n<=i;n+=e)u.push(n);return u}var y=n.forwardRef(function(a,l){var z,f,y,w=a.label,M=a.floatingLabel,D=void 0!==M&&M,k=a.description,N=a.error,Y=a.size,S=void 0===Y?"md":Y,L=a.variant,C=void 0===L?"outlined":L,T=a.focusOutline,H=void 0===T||T,A=a.className,P=a.value,$=a.defaultValue,j=void 0===$?null:$,E=a.onChange,O=a.format,R=void 0===O?"HH:mm":O,Z=a.use12Hours,F=a.hourStep,K=void 0===F?1:F,V=a.minuteStep,q=void 0===V?1:V,U=a.secondStep,_=void 0===U?1:U,B=a.needConfirm,Q=void 0===B||B,X=a.showNow,I=void 0===X||X,G=a.okText,J=void 0===G?"OK":G,W=a.closeText,ee=void 0===W?"Close":W,ie=a.nowText,te=void 0===ie?"Now":ie,ue=a.amText,ne=void 0===ue?"AM":ue,re=a.pmText,oe=void 0===re?"PM":re,ae=a.hourLabel,le=void 0===ae?"Hour":ae,se=a.minuteLabel,ce=void 0===se?"Minute":se,de=a.secondLabel,ze=void 0===de?"Second":de,fe=a.disabledHours,me=a.disabledMinutes,he=a.disabledSeconds,pe=a.disabled,ve=a.placeholder,be=a.required,ge=a.allowClear,xe=void 0===ge||ge,ye=a.id,we=e(a,["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=ye||function(e){void 0===e&&(e="timepicker");var i=n.useRef();return i.current||(i.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),i.current}("timepicker"),De=(f=R,"boolean"==typeof(y=Z)?y:/(^|[^H])h/.test(f)||/(\sa\b|\sA\b|a\b|A\b)/.test(f)),ke=function(e){return/\bss\b/.test(e)}(R),Ne=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),Ye=n.useRef(void 0!==P).current,Se=n.useState(j),Le=Se[0],Ce=Se[1],Te=Ye?null!=P?P:null:null!=Le?Le:null,He=Te?Te.format(R):"",Ae=n.useState(He),Pe=Ae[0],$e=Ae[1],je=n.useState(!1);je[0];var Ee=je[1];n.useEffect(function(){$e(He)},[He]);var Oe=n.useState(null),Re=Oe[0],Ze=Oe[1],Fe=Boolean(Re),Ke=n.useRef(null),Ve=n.useRef(!1);function qe(e,i){var t;Ze(e&&null!==(t=null!=i?i:Ke.current)&&void 0!==t?t:null)}function Ue(){Ve.current=!0,qe(!1),Q&&($e(He),Qe(Te)),Promise.resolve().then(function(){Ve.current=!1})}n.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 _e=n.useState(Te),Be=_e[0],Qe=_e[1];n.useEffect(function(){Fe&&(Qe(Te),$e(He))},[Fe,Te,He]);var Xe=n.useMemo(function(){return De?x(K,12,1):x(K,23,0)},[De,K]),Ie=n.useMemo(function(){return x(q,59,0)},[q]),Ge=n.useMemo(function(){return x(_,59,0)},[_]);function Je(e){var i=e?e.format(R):"";null==E||E(e,i),Ye||Ce(e)}function We(e,i,t,u){var n;if(!(null==fe?void 0:fe(De?e%12||12:e))&&!((null==me?void 0:me(i))||ke&&(null==he?void 0:he(t)))){var r=De?function(e,i){return i?"am"===i?12===e?0:e:12===e?12:e+12:e}(e,u):e,a=(null!==(n=null!=Be?Be:Te)&&void 0!==n?n:o()).hour(r).minute(i).second(ke?t:0).millisecond(0);Qe(a),$e(a.format(R)),Q||Je(a)}}var ei=Be?Be.format(R):"",ii=Fe&&""!==ei.trim()?ei:He;var ti=n.useRef(null),ui=n.useRef(null),ni=n.useRef(null);function ri(e,i){var t=e.current;if(t){var u=Array.from(t.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==u.length){var n=u.findIndex(function(e){return e===document.activeElement});u[n<0?0:Math.max(0,Math.min(u.length-1,n+i))].focus()}}}function oi(e,i){"ArrowDown"===e.key?(e.preventDefault(),ri(i,1)):"ArrowUp"===e.key&&(e.preventDefault(),ri(i,-1))}var ai="lg"===S?18:16,li=w||"Time picker",si=Boolean(ii)&&!pe&&!!xe,ci=null!==(z=null!=Be?Be:Te)&&void 0!==z?z:null,di=ci?ci.hour():De?12:0,zi=ci?ci.minute():0,fi=ci?ci.second():0,mi=di>=12?"pm":"am",hi=di%12==0?12:di%12;return t("div",{className:s("zui:w-full",Ne.container,v[S],A),children:[!D&&w&&t("label",{htmlFor:Me,className:s("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",Ne.label),children:[w,be&&u("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),t("div",{className:s("zui:relative zui:w-full zui:rounded-sm zui:border zui:bg-background zui:text-sm zui:transition-colors",H&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===C&&"zui:border-input","contained"===C&&"zui:bg-muted zui:border-transparent",Ne.input,N&&"zui:border-destructive",N&&H&&"zui:focus-within:ring-destructive"),children:[D&&w&&t("label",{htmlFor:Me,className:s("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",b(C),Ne.label),children:[w,be&&u("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),u("input",i({id:Me,ref:function(e){"function"==typeof l?l(e):l&&(l.current=e),Ke.current=e},value:ii,onChange:function(e){var i;$e(null!==(i=e.target.value)&&void 0!==i?i:"")},onBlur:function(){Ee(!1);var e=(null!=Pe?Pe:"").trim();if(Q){if(!e)return Qe(null),void $e(He);(i=o(e,R,!0)).isValid()?Qe(i.millisecond(0)):($e(He),Qe(Te))}else{if(!e)return void Je(null);var i;(i=o(e,R,!0)).isValid()?Je(i.millisecond(0)):$e(He)}},onFocus:function(e){Ee(!0),pe||Ve.current||qe(!0,Ke.current||e.currentTarget)},onClick:function(e){pe||Ve.current||qe(!0,Ke.current||e.currentTarget)},placeholder:null!=ve?ve:De?ke?"h:mm:ss a":"h:mm a":ke?"HH:mm:ss":"HH:mm","aria-label":li,disabled:pe,required:be,className:s("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[S],h[S],si?"zui:pr-20":"zui:pr-10")},we)),si?u("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),Qe(null),$e(""),Je(null),Ve.current=!0,qe(!1),Promise.resolve().then(function(){Ve.current=!1})},className:s("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[S]),"aria-label":"Clear time",children:u(c,{size:ai})}):null,u("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){pe||qe(!Fe,e.currentTarget)}(e)},className:s("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[S]),disabled:pe,"aria-label":"Toggle time panel",children:u(d,{size:ai})})]}),t("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[k&&!N&&!pe&&u("p",{className:"zui:text-xs zui:text-muted-foreground",children:k}),N&&u("p",{className:"zui:text-xs zui:text-destructive",children:N})]}),u(r,{open:Fe,anchorEl:Re,onClose:function(e,i){"backdropClick"!==i&&"escapeKeyDown"!==i&&Ue()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:s("zui:rounded-sm zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:t("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[t("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:[u("div",{className:"zui:text-center",children:le}),u("div",{className:"zui:text-center",children:ce}),u("div",{className:"zui:text-center",children:ke?ze:De?"AM/PM":""})]}),t("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[u("div",{ref:ti,onKeyDown:function(e){return oi(e,ti)},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:Xe.map(function(e){var i,t=De?hi===e:di===e,n=null!==(i=null==fe?void 0:fe(De?e%12||12:e))&&void 0!==i&&i;return u("button",{type:"button",role:"option","aria-selected":t,"aria-disabled":n,disabled:n,onClick:function(){n||We(e,zi,fi,De?mi:void 0)},className:s("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",n&&"zui:opacity-40 zui:cursor-not-allowed"),children:g(e)},e)})}),u("div",{ref:ui,onKeyDown:function(e){return oi(e,ui)},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,t=zi===e,n=null!==(i=null==me?void 0:me(e))&&void 0!==i&&i;return u("button",{type:"button",role:"option","aria-selected":t,"aria-disabled":n,disabled:n,onClick:function(){n||We(De?hi:di,e,fi,De?mi:void 0)},className:s("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",n&&"zui:opacity-40 zui:cursor-not-allowed"),children:g(e)},e)})}),ke?u("div",{ref:ni,onKeyDown:function(e){return oi(e,ni)},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:Ge.map(function(e){var i,t=fi===e,n=null!==(i=null==he?void 0:he(e))&&void 0!==i&&i;return u("button",{type:"button",role:"option","aria-selected":t,"aria-disabled":n,disabled:n,onClick:function(){n||We(De?hi:di,zi,e,De?mi:void 0)},className:s("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",n&&"zui:opacity-40 zui:cursor-not-allowed"),children:g(e)},e)})}):De?u("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=mi===e;return u("button",{type:"button",role:"option","aria-selected":i,onClick:function(){We(hi||12,zi,fi,e)},className:s("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?ne:oe},e)})}):null]}),t("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[I?u("button",{type:"button",onClick:function(){var e=o(),i=e.second(ke?e.second():0).millisecond(0);Qe(i),$e(i.format(R)),Je(i),Ve.current=!0,qe(!1),Promise.resolve().then(function(){Ve.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:te}):u("span",{}),t("div",{className:"zui:flex zui:gap-2",children:[u("button",{type:"button",onClick:Ue,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-sm zui:px-2 zui:py-1",children:ee}),Q&&u("button",{type:"button",onClick:function(){Je(null!=Be?Be:null),Ve.current=!0,qe(!1),Promise.resolve().then(function(){Ve.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-sm zui:px-3 zui:py-1",children:J})]})]})]})})]})});export{y as TimePicker,y as default};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),i=require("react/jsx-runtime"),t=require("react"),n=require("@mui/material/Popover"),u=require("../../chunks/dayjs.min-5e22609b.js"),r=require("../../chunks/_commonjsHelpers-3d4c1909.js"),o=require("../../chunks/index-4d90f67d.js"),s=require("../../chunks/lucide-937248a9.js");function a(e){var i=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),i.default=e,Object.freeze(i)}var l,c=a(t),d={exports:{}};l=d,r.commonjsGlobal,l.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"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,t=/\d/,n=/\d\d/,u=/\d\d?/,r=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(i){this[e]=+i}},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 i=e.match(/([+-]|\d\d)/g),t=60*i[1]+(+i[2]||0);return 0===t?0:"+"===i[0]?-t:t}(e)}],c=function(e){var i=o[e];return i&&(i.indexOf?i:i.s.concat(i.f))},d=function(e,i){var t,n=o.meridiem;if(n){for(var u=1;u<=24;u+=1)if(e.indexOf(n(u,0,i))>-1){t=u>12;break}}else t=e===(i?"pm":"PM");return t},z={A:[r,function(e){this.afternoon=d(e,!1)}],a:[r,function(e){this.afternoon=d(e,!0)}],Q:[t,function(e){this.month=3*(e-1)+1}],S:[t,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[u,a("seconds")],ss:[u,a("seconds")],m:[u,a("minutes")],mm:[u,a("minutes")],H:[u,a("hours")],h:[u,a("hours")],HH:[u,a("hours")],hh:[u,a("hours")],D:[u,a("day")],DD:[n,a("day")],Do:[r,function(e){var i=o.ordinal,t=e.match(/\d+/);if(this.day=t[0],i)for(var n=1;n<=31;n+=1)i(n).replace(/\[|\]/g,"")===e&&(this.day=n)}],w:[u,a("week")],ww:[n,a("week")],M:[u,a("month")],MM:[n,a("month")],MMM:[r,function(e){var i=c("months"),t=(c("monthsShort")||i.map(function(e){return e.slice(0,3)})).indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],MMMM:[r,function(e){var i=c("months").indexOf(e)+1;if(i<1)throw new Error;this.month=i%12||i}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function f(t){var n,u;n=t,u=o&&o.formats;for(var r=(t=n.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(i,t,n){var r=n&&n.toUpperCase();return t||u[n]||e[n]||u[r].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e,i,t){return i||t.slice(1)})})).match(i),s=r.length,a=0;a<s;a+=1){var l=r[a],c=z[l],d=c&&c[0],f=c&&c[1];r[a]=f?{regex:d,parser:f}:l.replace(/^\[|\]$/g,"")}return function(e){for(var i={},t=0,n=0;t<s;t+=1){var u=r[t];if("string"==typeof u)n+=u.length;else{var o=u.regex,a=u.parser,l=e.slice(n),c=o.exec(l)[0];a.call(i,c),e=e.replace(c,"")}}return function(e){var i=e.afternoon;if(void 0!==i){var t=e.hours;i?t<12&&(e.hours+=12):12===t&&(e.hours=0),delete e.afternoon}}(i),i}}return function(e,i,t){t.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var n=i.prototype,u=n.parse;n.parse=function(e){var i=e.date,n=e.utc,r=e.args;this.$u=n;var s=r[1];if("string"==typeof s){var a=!0===r[2],l=!0===r[3],c=a||l,d=r[2];l&&(d=r[2]),o=this.$locale(),!a&&d&&(o=t.Ls[d]),this.$d=function(e,i,t,n){try{if(["x","X"].indexOf(i)>-1)return new Date(("X"===i?1e3:1)*e);var u=f(i)(e),r=u.year,o=u.month,s=u.day,a=u.hours,l=u.minutes,c=u.seconds,d=u.milliseconds,z=u.zone,m=u.week,h=new Date,p=s||(r||o?1:h.getDate()),v=r||h.getFullYear(),x=0;r&&!o||(x=o>0?o-1:h.getMonth());var b,g=a||0,y=l||0,w=c||0,j=d||0;return z?new Date(Date.UTC(v,x,p,g,y,w,j+60*z.offset*1e3)):t?new Date(Date.UTC(v,x,p,g,y,w,j)):(b=new Date(v,x,p,g,y,w,j),m&&(b=n(b).week(m).toDate()),b)}catch(e){return new Date("")}}(i,s,n,t),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),c&&i!=this.format(s)&&(this.$d=new Date("")),o={}}else if(s instanceof Array)for(var z=s.length,m=1;m<=z;m+=1){r[1]=s[m-1];var h=t.apply(this,r);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===z&&(this.$d=new Date(""))}else u.call(this,e)}}}();var z=d.exports,f=r.getDefaultExportFromCjs(z);u.dayjs.extend(f);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"},h={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]"},x=function(e){return"contained"===e?"zui:bg-muted":"zui:bg-background"};function b(e){return e<10?"0".concat(e):"".concat(e)}function g(e,i,t){void 0===t&&(t=0);for(var n=[],u=t;u<=i;u+=e)n.push(u);return n}var y=c.forwardRef(function(t,r){var a,l,d,z=t.label,f=t.floatingLabel,y=void 0!==f&&f,w=t.description,j=t.error,M=t.size,D=void 0===M?"md":M,k=t.variant,N=void 0===k?"outlined":k,Y=t.focusOutline,S=void 0===Y||Y,L=t.className,C=t.value,T=t.defaultValue,H=void 0===T?null:T,P=t.onChange,O=t.format,A=void 0===O?"HH:mm":O,q=t.use12Hours,E=t.hourStep,$=void 0===E?1:E,_=t.minuteStep,R=void 0===_?1:_,Z=t.secondStep,F=void 0===Z?1:Z,K=t.needConfirm,V=void 0===K||K,U=t.showNow,B=void 0===U||U,X=t.okText,Q=void 0===X?"OK":X,G=t.closeText,I=void 0===G?"Close":G,J=t.nowText,W=void 0===J?"Now":J,ee=t.amText,ie=void 0===ee?"AM":ee,te=t.pmText,ne=void 0===te?"PM":te,ue=t.hourLabel,re=void 0===ue?"Hour":ue,oe=t.minuteLabel,se=void 0===oe?"Minute":oe,ae=t.secondLabel,le=void 0===ae?"Second":ae,ce=t.disabledHours,de=t.disabledMinutes,ze=t.disabledSeconds,fe=t.disabled,me=t.placeholder,he=t.required,pe=t.allowClear,ve=void 0===pe||pe,xe=t.id,be=e.__rest(t,["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"]),ge=xe||function(e){void 0===e&&(e="timepicker");var i=c.useRef();return i.current||(i.current="".concat(e,"-").concat(Math.random().toString(36).slice(2,9))),i.current}("timepicker"),ye=(l=A,"boolean"==typeof(d=q)?d:/(^|[^H])h/.test(l)||/(\sa\b|\sA\b|a\b|A\b)/.test(l)),we=function(e){return/\bss\b/.test(e)}(A),je=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":""}}(fe||!1),Me=c.useRef(void 0!==C).current,De=c.useState(H),ke=De[0],Ne=De[1],Ye=Me?null!=C?C:null:null!=ke?ke:null,Se=Ye?Ye.format(A):"",Le=c.useState(Se),Ce=Le[0],Te=Le[1],He=c.useState(!1);He[0];var Pe=He[1];c.useEffect(function(){Te(Se)},[Se]);var Oe=c.useState(null),Ae=Oe[0],qe=Oe[1],Ee=Boolean(Ae),$e=c.useRef(null),_e=c.useRef(!1);function Re(e,i){var t;qe(e&&null!==(t=null!=i?i:$e.current)&&void 0!==t?t:null)}function Ze(){_e.current=!0,Re(!1),V&&(Te(Se),Ve(Ye)),Promise.resolve().then(function(){_e.current=!1})}c.useEffect(function(){function e(e){"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),Ee&&qe(null))}return Ee&&document.addEventListener("keydown",e,!0),function(){return document.removeEventListener("keydown",e,!0)}},[Ee]);var Fe=c.useState(Ye),Ke=Fe[0],Ve=Fe[1];c.useEffect(function(){Ee&&(Ve(Ye),Te(Se))},[Ee,Ye,Se]);var Ue=c.useMemo(function(){return ye?g($,12,1):g($,23,0)},[ye,$]),Be=c.useMemo(function(){return g(R,59,0)},[R]),Xe=c.useMemo(function(){return g(F,59,0)},[F]);function Qe(e){var i=e?e.format(A):"";null==P||P(e,i),Me||Ne(e)}function Ge(e,i,t,n){var r;if(!(null==ce?void 0:ce(ye?e%12||12:e))&&!((null==de?void 0:de(i))||we&&(null==ze?void 0:ze(t)))){var o=ye?function(e,i){return i?"am"===i?12===e?0:e:12===e?12:e+12:e}(e,n):e,s=(null!==(r=null!=Ke?Ke:Ye)&&void 0!==r?r:u.dayjs()).hour(o).minute(i).second(we?t:0).millisecond(0);Ve(s),Te(s.format(A)),V||Qe(s)}}var Ie=Ke?Ke.format(A):"",Je=Ee&&""!==Ie.trim()?Ie:Se;var We=c.useRef(null),ei=c.useRef(null),ii=c.useRef(null);function ti(e,i){var t=e.current;if(t){var n=Array.from(t.querySelectorAll('button[role="option"]:not([aria-disabled="true"])'));if(0!==n.length){var u=n.findIndex(function(e){return e===document.activeElement});n[u<0?0:Math.max(0,Math.min(n.length-1,u+i))].focus()}}}function ni(e,i){"ArrowDown"===e.key?(e.preventDefault(),ti(i,1)):"ArrowUp"===e.key&&(e.preventDefault(),ti(i,-1))}var ui="lg"===D?18:16,ri=z||"Time picker",oi=Boolean(Je)&&!fe&&!!ve,si=null!==(a=null!=Ke?Ke:Ye)&&void 0!==a?a:null,ai=si?si.hour():ye?12:0,li=si?si.minute():0,ci=si?si.second():0,di=ai>=12?"pm":"am",zi=ai%12==0?12:ai%12;return i.jsxs("div",{className:o.cn("zui:w-full",je.container,v[D],L),children:[!y&&z&&i.jsxs("label",{htmlFor:ge,className:o.cn("zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",je.label),children:[z,he&&i.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i.jsxs("div",{className:o.cn("zui:relative zui:w-full zui:rounded-sm zui:border zui:bg-background zui:text-sm zui:transition-colors",S&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===N&&"zui:border-input","contained"===N&&"zui:bg-muted zui:border-transparent",je.input,j&&"zui:border-destructive",j&&S&&"zui:focus-within:ring-destructive"),children:[y&&z&&i.jsxs("label",{htmlFor:ge,className:o.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",x(N),je.label),children:[z,he&&i.jsx("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i.jsx("input",e.__assign({id:ge,ref:function(e){"function"==typeof r?r(e):r&&(r.current=e),$e.current=e},value:Je,onChange:function(e){var i;Te(null!==(i=e.target.value)&&void 0!==i?i:"")},onBlur:function(){Pe(!1);var e=(null!=Ce?Ce:"").trim();if(V){if(!e)return Ve(null),void Te(Se);(i=u.dayjs(e,A,!0)).isValid()?Ve(i.millisecond(0)):(Te(Se),Ve(Ye))}else{if(!e)return void Qe(null);var i;(i=u.dayjs(e,A,!0)).isValid()?Qe(i.millisecond(0)):Te(Se)}},onFocus:function(e){Pe(!0),fe||_e.current||Re(!0,$e.current||e.currentTarget)},onClick:function(e){fe||_e.current||Re(!0,$e.current||e.currentTarget)},placeholder:null!=me?me:ye?we?"h:mm:ss a":"h:mm a":we?"HH:mm:ss":"HH:mm","aria-label":ri,disabled:fe,required:he,className:o.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",m[D],h[D],oi?"zui:pr-20":"zui:pr-10")},be)),oi?i.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),Ve(null),Te(""),Qe(null),_e.current=!0,Re(!1),Promise.resolve().then(function(){_e.current=!1})},className:o.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",p[D]),"aria-label":"Clear time",children:i.jsx(s.X,{size:ui})}):null,i.jsx("button",{type:"button",onMouseDown:function(e){return e.preventDefault()},onClick:function(e){e.stopPropagation(),function(e){fe||Re(!Ee,e.currentTarget)}(e)},className:o.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",p[D]),disabled:fe,"aria-label":"Toggle time panel",children:i.jsx(s.Clock,{size:ui})})]}),i.jsxs("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[w&&!j&&!fe&&i.jsx("p",{className:"zui:text-xs zui:text-muted-foreground",children:w}),j&&i.jsx("p",{className:"zui:text-xs zui:text-destructive",children:j})]}),i.jsx(n,{open:Ee,anchorEl:Ae,onClose:function(e,i){"backdropClick"!==i&&"escapeKeyDown"!==i&&Ze()},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{className:o.cn("zui:rounded-sm zui:border zui:border-gray-200 zui:shadow-lg zui:bg-white zui:p-2","zui:w-[22rem] sm:zui:w-[24rem]")}},children:i.jsxs("div",{className:"zui:flex zui:flex-col zui:gap-2",children:[i.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:[i.jsx("div",{className:"zui:text-center",children:re}),i.jsx("div",{className:"zui:text-center",children:se}),i.jsx("div",{className:"zui:text-center",children:we?le:ye?"AM/PM":""})]}),i.jsxs("div",{className:"zui:grid zui:grid-cols-3 zui:gap-2",children:[i.jsx("div",{ref:We,onKeyDown:function(e){return ni(e,We)},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:Ue.map(function(e){var t,n=ye?zi===e:ai===e,u=null!==(t=null==ce?void 0:ce(ye?e%12||12:e))&&void 0!==t&&t;return i.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":u,disabled:u,onClick:function(){u||Ge(e,li,ci,ye?di:void 0)},className:o.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:b(e)},e)})}),i.jsx("div",{ref:ei,onKeyDown:function(e){return ni(e,ei)},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:Be.map(function(e){var t,n=li===e,u=null!==(t=null==de?void 0:de(e))&&void 0!==t&&t;return i.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":u,disabled:u,onClick:function(){u||Ge(ye?zi:ai,e,ci,ye?di:void 0)},className:o.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:b(e)},e)})}),we?i.jsx("div",{ref:ii,onKeyDown:function(e){return ni(e,ii)},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:Xe.map(function(e){var t,n=ci===e,u=null!==(t=null==ze?void 0:ze(e))&&void 0!==t&&t;return i.jsx("button",{type:"button",role:"option","aria-selected":n,"aria-disabled":u,disabled:u,onClick:function(){u||Ge(ye?zi:ai,li,e,ye?di:void 0)},className:o.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:b(e)},e)})}):ye?i.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 t=di===e;return i.jsx("button",{type:"button",role:"option","aria-selected":t,onClick:function(){Ge(zi||12,li,ci,e)},className:o.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",t&&"zui:bg-blue-50 zui:text-blue-700 zui:font-medium"),"aria-pressed":t,children:"am"===e?ie:ne},e)})}):null]}),i.jsxs("div",{className:"zui:flex zui:items-center zui:justify-between zui:pt-1",children:[B?i.jsx("button",{type:"button",onClick:function(){var e=u.dayjs(),i=e.second(we?e.second():0).millisecond(0);Ve(i),Te(i.format(A)),Qe(i),_e.current=!0,Re(!1),Promise.resolve().then(function(){_e.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:W}):i.jsx("span",{}),i.jsxs("div",{className:"zui:flex zui:gap-2",children:[i.jsx("button",{type:"button",onClick:Ze,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-sm zui:px-2 zui:py-1",children:I}),V&&i.jsx("button",{type:"button",onClick:function(){Qe(null!=Ke?Ke:null),_e.current=!0,Re(!1),Promise.resolve().then(function(){_e.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-sm zui:px-3 zui:py-1",children:Q})]})]})]})})]})});exports.TimePicker=y,exports.default=y;
@@ -0,0 +1,26 @@
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
+ secondary?: ReactNode;
11
+ }
12
+ interface TimelineProps {
13
+ items?: TimelineItem[];
14
+ children?: ReactNode;
15
+ pending?: boolean | ReactNode;
16
+ pendingDot?: ReactNode;
17
+ reverse?: boolean;
18
+ mode?: 'left' | 'right' | 'alternate';
19
+ className?: string;
20
+ style?: CSSProperties;
21
+ linePosition?: number;
22
+ }
23
+ declare const Timeline: React__default.FC<TimelineProps>;
24
+
25
+ export { Timeline, Timeline as default };
26
+ export type { TimelineItem as TimelineItemProps, TimelineProps };
@@ -0,0 +1 @@
1
+ import{a as i,b as e}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsxs as u,jsx as l}from"react/jsx-runtime";import t from"react";var r=function(r){var a=r.items,z=void 0===a?[]:a,s=r.children,n=r.pending,d=void 0!==n&&n,c=r.pendingDot,o=r.reverse,m=void 0!==o&&o,h=r.mode,g=void 0===h?"left":h,v=r.className,b=void 0===v?"":v,f=r.style,y=r.linePosition,p=void 0===y?50:y,x=[];z&&z.length>0?x=z:s&&(x=t.Children.map(s,function(e,u){return t.isValidElement(e)&&e.type===TimelineItem?i({key:e.key||u},e.props):{key:u,children:e}})||[]),m&&(x=e([],x,!0).reverse());var N=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?l("div",{className:"zui:flex zui:items-center zui:justify-center zui:w-6 zui:h-6 zui:p-0.5",children:i.dot}):l("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(b),style:f,children:[x.map(function(i,e){return function(i,e,t){var r="right"===g||"alternate"===g&&e%2!=0,a=i.position||(r?"right":"left");return u("div",{className:"zui:relative zui:flex zui:min-h-[32px] ".concat(t?"":"zui:pb-8"),children:[l("div",{className:"zui:relative zui:pr-6",style:{width:"".concat(p,"%")},children:"left"===a?u("div",{className:"zui:text-left",children:[l("div",{className:"zui:text-gray-900 zui:text-sm",children:i.children}),i.label&&l("div",{className:"zui:text-xs zui:text-gray-500 zui:mt-1",children:i.label})]}):i.secondary}),l("div",{className:"zui:relative zui:pl-6",style:{width:"".concat(100-p,"%")},children:"right"===a?u("div",{className:"zui:text-left",children:[l("div",{className:"zui:text-gray-900 zui:text-sm",children:i.children}),i.label&&l("div",{className:"zui:text-xs zui:text-gray-500 zui:mt-1",children:i.label})]}):i.secondary}),u("div",{className:"zui:absolute zui:flex zui:flex-col zui:items-center zui:pt-1 zui:h-full",style:{left:"".concat(p,"%"),transform:"translateX(-50%)"},children:[l("div",{className:"zui:z-10",children:N?N(i):l("div",{className:"zui:w-3 zui:h-3 zui-rounded-full zui-bg-gray-400"})}),!t&&l("div",{className:"zui:absolute zui:top-6 zui:bottom-0 zui:w-[1px] zui:bg-gray-300 zui:z-20 zui:min-h-[30px]"})]})]},i.key||e)}(i,e,e===x.length-1)}),d&&u("div",{className:"zui:relative zui:flex zui:items-start zui:min-h-[32px] zui:pt-2",children:[l("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:c||l("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:l("div",{className:"zui:w-full zui:h-full zui:rounded-full zui:bg-gray-300 zui:animate-pulse"})})}),l("div",{className:"zui:flex-1 zui:text-gray-500 zui:text-sm",children:"boolean"==typeof d?"Loading...":d})]})]})};export{r as Timeline,r as default};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),i=require("react/jsx-runtime"),u=require("react"),s=function(s){var l=s.items,t=void 0===l?[]:l,r=s.children,a=s.pending,z=void 0!==a&&a,n=s.pendingDot,d=s.reverse,c=void 0!==d&&d,o=s.mode,m=void 0===o?"left":o,x=s.className,h=void 0===x?"":x,g=s.style,v=s.linePosition,y=void 0===v?50:v,b=[];t&&t.length>0?b=t:r&&(b=u.Children.map(r,function(i,s){return u.isValidElement(i)&&i.type===TimelineItem?e.__assign({key:i.key||s},i.props):{key:s,children:i}})||[]),c&&(b=e.__spreadArray([],b,!0).reverse());var p=function(e,u){var s={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"}[e.color]||"zui:bg-blue-500";return e.dot?i.jsx("div",{className:"zui:flex zui:items-center zui:justify-center zui:w-6 zui:h-6 zui:p-0.5",children:e.dot}):i.jsx("div",{className:"zui:w-3 zui:h-3 zui:rounded-full zui:border-2 zui:border-white zui:shadow-sm ".concat(s)})};return i.jsxs("div",{className:"zui:timeline ".concat(h),style:g,children:[b.map(function(e,u){return function(e,u,s){var l="right"===m||"alternate"===m&&u%2!=0,t=e.position||(l?"right":"left");return i.jsxs("div",{className:"zui:relative zui:flex zui:min-h-[32px] ".concat(s?"":"zui:pb-8"),children:[i.jsx("div",{className:"zui:relative zui:pr-6",style:{width:"".concat(y,"%")},children:"left"===t?i.jsxs("div",{className:"zui:text-left",children:[i.jsx("div",{className:"zui:text-gray-900 zui:text-sm",children:e.children}),e.label&&i.jsx("div",{className:"zui:text-xs zui:text-gray-500 zui:mt-1",children:e.label})]}):e.secondary}),i.jsx("div",{className:"zui:relative zui:pl-6",style:{width:"".concat(100-y,"%")},children:"right"===t?i.jsxs("div",{className:"zui:text-left",children:[i.jsx("div",{className:"zui:text-gray-900 zui:text-sm",children:e.children}),e.label&&i.jsx("div",{className:"zui:text-xs zui:text-gray-500 zui:mt-1",children:e.label})]}):e.secondary}),i.jsxs("div",{className:"zui:absolute zui:flex zui:flex-col zui:items-center zui:pt-1 zui:h-full",style:{left:"".concat(y,"%"),transform:"translateX(-50%)"},children:[i.jsx("div",{className:"zui:z-10",children:p?p(e):i.jsx("div",{className:"zui:w-3 zui:h-3 zui-rounded-full zui-bg-gray-400"})}),!s&&i.jsx("div",{className:"zui:absolute zui:top-6 zui:bottom-0 zui:w-[1px] zui:bg-gray-300 zui:z-20 zui:min-h-[30px]"})]})]},e.key||u)}(e,u,u===b.length-1)}),z&&i.jsxs("div",{className:"zui:relative zui:flex zui:items-start zui:min-h-[32px] zui:pt-2",children:[i.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||i.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:i.jsx("div",{className:"zui:w-full zui:h-full zui:rounded-full zui:bg-gray-300 zui:animate-pulse"})})}),i.jsx("div",{className:"zui:flex-1 zui:text-gray-500 zui:text-sm",children:"boolean"==typeof z?"Loading...":z})]})]})};exports.Timeline=s,exports.default=s;
@@ -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-cefb898e.esm.js";export{T as Text}from"../../chunks/Text-5b99f7f4.esm.js";import{a as o}from"../../chunks/tslib.es6-4974c96c.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-d00b328e.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-ff5c771d.js"),o=require("../../chunks/Text-e9636dd7.js"),r=require("../../chunks/tslib.es6-a3dc1f53.js"),n=require("react/jsx-runtime"),t=require("@mui/material"),s=require("../../chunks/Muted-d2dbaba3.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))};
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+
3
+ type InputSize = "xs" | "sm" | "md" | "lg";
4
+ type InputVariant = "outlined" | "contained";
5
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
6
+ label?: string;
7
+ floatingLabel?: boolean;
8
+ description?: string;
9
+ error?: string;
10
+ leftIcon?: React.ReactNode;
11
+ rightIcon?: React.ReactNode;
12
+ size?: InputSize;
13
+ variant?: InputVariant;
14
+ allowedPattern?: "number" | "alpha" | RegExp;
15
+ onLeftIconClick?: () => void;
16
+ onRightIconClick?: () => void;
17
+ debounceDelay?: number;
18
+ onDebouncedChange?: (value: string) => void;
19
+ wordLimit?: number;
20
+ focusOutline?: boolean;
21
+ }
22
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
23
+
24
+ export { Input as a };
25
+ export type { InputSize as I, InputProps as b };