@zimyo/ui 1.14.3 → 1.15.0

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 (131) hide show
  1. package/package.json +7 -1
  2. package/dist/chunks/Heading-cefb898e.esm.js +0 -1
  3. package/dist/chunks/Heading-ff5c771d.js +0 -1
  4. package/dist/chunks/Muted-d00b328e.esm.js +0 -1
  5. package/dist/chunks/Muted-d2dbaba3.js +0 -1
  6. package/dist/chunks/Text-5b99f7f4.esm.js +0 -1
  7. package/dist/chunks/Text-e9636dd7.js +0 -1
  8. package/dist/chunks/_commonjsHelpers-02d3be64.esm.js +0 -1
  9. package/dist/chunks/_commonjsHelpers-3d4c1909.js +0 -1
  10. package/dist/chunks/assertThisInitialized-03efc53b.esm.js +0 -1
  11. package/dist/chunks/assertThisInitialized-9901ca61.js +0 -1
  12. package/dist/chunks/createSuper-a71d2b5b.esm.js +0 -1
  13. package/dist/chunks/createSuper-c9c5c00c.js +0 -1
  14. package/dist/chunks/dayjs.min-5e22609b.js +0 -1
  15. package/dist/chunks/dayjs.min-ccb12949.esm.js +0 -1
  16. package/dist/chunks/extends-77a6284f.js +0 -1
  17. package/dist/chunks/extends-bb693bd1.esm.js +0 -1
  18. package/dist/chunks/index-1d613f26.js +0 -1
  19. package/dist/chunks/index-3cd5487e.esm.js +0 -1
  20. package/dist/chunks/index-4d90f67d.js +0 -1
  21. package/dist/chunks/index-6d90ff6c.esm.js +0 -1
  22. package/dist/chunks/index-92dc1820.esm.js +0 -1
  23. package/dist/chunks/index-9d477012.js +0 -1
  24. package/dist/chunks/lucide-1d5a9cda.esm.js +0 -26
  25. package/dist/chunks/lucide-937248a9.js +0 -26
  26. package/dist/chunks/moment-1102cd58.js +0 -3
  27. package/dist/chunks/moment-df993c05.esm.js +0 -3
  28. package/dist/chunks/react-virtualized-auto-sizer.esm-8dfcb62e.js +0 -1
  29. package/dist/chunks/react-virtualized-auto-sizer.esm-9ede76fe.esm.js +0 -1
  30. package/dist/chunks/tslib.es6-4974c96c.esm.js +0 -1
  31. package/dist/chunks/tslib.es6-a3dc1f53.js +0 -1
  32. package/dist/components/Accordion/index.d.ts +0 -34
  33. package/dist/components/Accordion/index.esm.js +0 -1
  34. package/dist/components/Accordion/index.js +0 -1
  35. package/dist/components/AppList/index.d.ts +0 -27
  36. package/dist/components/AppList/index.esm.js +0 -1
  37. package/dist/components/AppList/index.js +0 -1
  38. package/dist/components/Badge/index.d.ts +0 -29
  39. package/dist/components/Badge/index.esm.js +0 -1
  40. package/dist/components/Badge/index.js +0 -1
  41. package/dist/components/BulkActionsBar/index.d.ts +0 -23
  42. package/dist/components/BulkActionsBar/index.esm.js +0 -1
  43. package/dist/components/BulkActionsBar/index.js +0 -1
  44. package/dist/components/Button/index.d.ts +0 -15
  45. package/dist/components/Button/index.esm.js +0 -1
  46. package/dist/components/Button/index.js +0 -1
  47. package/dist/components/Card/index.d.ts +0 -73
  48. package/dist/components/Card/index.esm.js +0 -1
  49. package/dist/components/Card/index.js +0 -1
  50. package/dist/components/Charts/index.d.ts +0 -62
  51. package/dist/components/Charts/index.esm.js +0 -10
  52. package/dist/components/Charts/index.js +0 -10
  53. package/dist/components/Checkbox/index.d.ts +0 -14
  54. package/dist/components/Checkbox/index.esm.js +0 -1
  55. package/dist/components/Checkbox/index.js +0 -1
  56. package/dist/components/CheckboxGroup/index.d.ts +0 -31
  57. package/dist/components/CheckboxGroup/index.esm.js +0 -1
  58. package/dist/components/CheckboxGroup/index.js +0 -1
  59. package/dist/components/DataTable/index.d.ts +0 -77
  60. package/dist/components/DataTable/index.esm.js +0 -23
  61. package/dist/components/DataTable/index.js +0 -22
  62. package/dist/components/DatePicker/index.d.ts +0 -43
  63. package/dist/components/DatePicker/index.esm.js +0 -1
  64. package/dist/components/DatePicker/index.js +0 -1
  65. package/dist/components/DateRangePicker/index.d.ts +0 -32
  66. package/dist/components/DateRangePicker/index.esm.js +0 -1
  67. package/dist/components/DateRangePicker/index.js +0 -1
  68. package/dist/components/Form/index.d.ts +0 -35
  69. package/dist/components/Form/index.esm.js +0 -1
  70. package/dist/components/Form/index.js +0 -1
  71. package/dist/components/GlobalMenuSearch/index.d.ts +0 -16
  72. package/dist/components/GlobalMenuSearch/index.esm.js +0 -1
  73. package/dist/components/GlobalMenuSearch/index.js +0 -1
  74. package/dist/components/Input/index.d.ts +0 -2
  75. package/dist/components/Input/index.esm.js +0 -1
  76. package/dist/components/Input/index.js +0 -1
  77. package/dist/components/Modal/index.d.ts +0 -20
  78. package/dist/components/Modal/index.esm.js +0 -1
  79. package/dist/components/Modal/index.js +0 -1
  80. package/dist/components/Notice/index.d.ts +0 -19
  81. package/dist/components/Notice/index.esm.js +0 -1
  82. package/dist/components/Notice/index.js +0 -1
  83. package/dist/components/Popover/index.d.ts +0 -19
  84. package/dist/components/Popover/index.esm.js +0 -1
  85. package/dist/components/Popover/index.js +0 -1
  86. package/dist/components/PopupConfirm/index.d.ts +0 -36
  87. package/dist/components/PopupConfirm/index.esm.js +0 -1
  88. package/dist/components/PopupConfirm/index.js +0 -1
  89. package/dist/components/Progress/index.d.ts +0 -24
  90. package/dist/components/Progress/index.esm.js +0 -1
  91. package/dist/components/Progress/index.js +0 -1
  92. package/dist/components/Radio/index.d.ts +0 -24
  93. package/dist/components/Radio/index.esm.js +0 -1
  94. package/dist/components/Radio/index.js +0 -1
  95. package/dist/components/RadioGroup/index.d.ts +0 -31
  96. package/dist/components/RadioGroup/index.esm.js +0 -1
  97. package/dist/components/RadioGroup/index.js +0 -1
  98. package/dist/components/SearchInput/index.d.ts +0 -20
  99. package/dist/components/SearchInput/index.esm.js +0 -9
  100. package/dist/components/SearchInput/index.js +0 -9
  101. package/dist/components/Select/index.d.ts +0 -36
  102. package/dist/components/Select/index.esm.js +0 -1
  103. package/dist/components/Select/index.js +0 -1
  104. package/dist/components/Stepper/index.d.ts +0 -72
  105. package/dist/components/Stepper/index.esm.js +0 -1
  106. package/dist/components/Stepper/index.js +0 -1
  107. package/dist/components/Switch/index.d.ts +0 -15
  108. package/dist/components/Switch/index.esm.js +0 -1
  109. package/dist/components/Switch/index.js +0 -1
  110. package/dist/components/Tab/index.d.ts +0 -40
  111. package/dist/components/Tab/index.esm.js +0 -1
  112. package/dist/components/Tab/index.js +0 -1
  113. package/dist/components/Table/index.d.ts +0 -80
  114. package/dist/components/Table/index.esm.js +0 -1
  115. package/dist/components/Table/index.js +0 -1
  116. package/dist/components/TimePicker/index.d.ts +0 -40
  117. package/dist/components/TimePicker/index.esm.js +0 -1
  118. package/dist/components/TimePicker/index.js +0 -1
  119. package/dist/components/Timeline/index.d.ts +0 -26
  120. package/dist/components/Timeline/index.esm.js +0 -1
  121. package/dist/components/Timeline/index.js +0 -1
  122. package/dist/components/Typography/index.d.ts +0 -30
  123. package/dist/components/Typography/index.esm.js +0 -1
  124. package/dist/components/Typography/index.js +0 -1
  125. package/dist/index-5f6a7a1d.d.ts +0 -25
  126. package/dist/index.d.ts +0 -1040
  127. package/dist/index.esm.js +0 -1
  128. package/dist/index.js +0 -1
  129. package/dist/theme/index.d.ts +0 -93
  130. package/dist/theme/index.esm.js +0 -1
  131. package/dist/theme/index.js +0 -1
@@ -1,72 +0,0 @@
1
- import React__default from 'react';
2
-
3
- /**************** Common Types ****************/
4
- type Nullable<T> = T | null | undefined;
5
- type ComponentType = Nullable<JSX.Element>;
6
- type CSSPropertiesT = React.CSSProperties;
7
- interface StepperLabel {
8
- /** Step name label */
9
- name: string;
10
- /** Optional step description or custom content */
11
- description?: React.ReactNode | string;
12
- /** Whether the step can expand to show extra content */
13
- expand?: boolean;
14
- /** Whether the step is clickable */
15
- isClickable?: boolean;
16
- /** Whether the step is disabled */
17
- isDisabled?: boolean;
18
- /** Custom icon component for the step */
19
- stepperIcon?: ComponentType;
20
- }
21
- /**************** Common Props ****************/
22
- interface CommonProps {
23
- /** Connector color for completed steps */
24
- connectorColorOnComplete?: string;
25
- /** Custom connector CSS style */
26
- connectorStyle?: CSSPropertiesT;
27
- }
28
- /**************** Main Stepper Props ****************/
29
- interface CustomStepperProps extends CommonProps {
30
- /** Array of step labels and related info */
31
- stepperLabels: StepperLabel[];
32
- /** Currently active step index */
33
- activeStep: number;
34
- /** Custom icon shown when a step is completed */
35
- onCompleteIcon?: ComponentType;
36
- /** Color for completed steps */
37
- onCompleteColor?: string;
38
- /** Custom icon shown for the active step */
39
- onActiveIcon?: ComponentType;
40
- /** Color for the active step */
41
- onActiveColor?: string;
42
- /** Whether the labels are displayed below the icons */
43
- alternativeLabel?: boolean;
44
- /** Size of each step indicator */
45
- stepperSize?: number;
46
- /** Optional class name for the root container */
47
- className?: string;
48
- /** Custom inline styles for the root container */
49
- styles?: CSSPropertiesT;
50
- /** Layout orientation for the stepper */
51
- orientation?: 'horizontal' | 'vertical';
52
- /** Border color for the active step */
53
- activeBorderColor?: string;
54
- /** Style overrides for the stepper wrapper */
55
- stepperStyle?: CSSPropertiesT;
56
- }
57
- /**************** Supporting Props ****************/
58
- interface IconStyleProps {
59
- iconStyleProps: {
60
- active: boolean;
61
- completed: boolean;
62
- activeBorderColor?: string;
63
- };
64
- }
65
- interface ConnectorProps extends CommonProps {
66
- stepperSize?: number;
67
- }
68
-
69
- declare const ZUIStepper: React__default.FC<CustomStepperProps>;
70
-
71
- export { ZUIStepper as Stepper, ZUIStepper as default };
72
- export type { ConnectorProps, CustomStepperProps, IconStyleProps, StepperLabel };
@@ -1 +0,0 @@
1
- import{a as e}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{styled as o,StepConnector as n,stepConnectorClasses as r,Stepper as a,Step as c,StepLabel as l}from"@mui/material";import{r as s}from"../../chunks/lucide-1d5a9cda.esm.js";import"react";var d=o(n)(function(t){var i,o=t.theme,n=t.ownerState,a=n.orientation,c=n.stepperSize,l=void 0===c?40:c,s=n.activeStep,d=void 0===s?0:s,p=n.index,m=void 0===p?0:p,u=n.connectorColorOnComplete,v=void 0===u?"#4caf50":u,h="dark"===o.palette.mode?"#555":"#e0e0e0",f=v;return(i={})["&.".concat(r.alternativeLabel)]={top:l/2,left:"calc(-50% + ".concat(l/2,"px)"),right:"calc(50% + ".concat(l/2,"px)")},i["& .".concat(r.line)]=e(e({border:0,transition:"all 0.3s ease"},"horizontal"===a&&{height:1,width:"100%",backgroundColor:m<d?f:h}),"vertical"===a&&{width:1,minHeight:40,marginLeft:l/2-12,backgroundColor:m<d?f:h}),i}),p=function(e){var i=e.index,o=e.active,n=e.completed,r=e.props,a=r.stepperLabels,c=r.onCompleteIcon,l=r.onActiveIcon,d=r.onActiveColor,p=void 0===d?"#1976d2":d,m=r.onCompleteColor,u=void 0===m?"#4caf50":m,v=r.stepperSize,h=void 0===v?36:v,f=r.activeBorderColor,x=void 0===f?"#1976d2":f,z=a[i],g=(null==z?void 0:z.stepperIcon)||t("span",{children:i+1}),C="#9e9e9e",S="#e0e0e0",b="transparent";return n?(C=u,S=u,b="".concat(u,"20")):o&&(C=p,S=x),t("div",{style:{width:h,height:h,minWidth:h,minHeight:h,borderRadius:"50%",border:"2px solid ".concat(S),display:"flex",alignItems:"center",justifyContent:"center",color:C,backgroundColor:b,transition:"all 0.3s ease",flexShrink:0,position:"relative",zIndex:1},children:n?c||t(s,{size:18,color:u}):o&&l||g})},m=function(o){var n=o.stepperLabels,r=o.activeStep,s=void 0===r?0:r,m=o.orientation,u=void 0===m?"horizontal":m,v=o.alternativeLabel,h=void 0!==v&&v,f=o.styles,x=void 0===f?{}:f,z=o.stepperSize,g=void 0===z?36:z,C="vertical"===u;return t("div",{style:e({width:"100%",display:"flex",justifyContent:C?"flex-start":"center"},x),children:t(a,{activeStep:s,orientation:u,alternativeLabel:!C&&h,connector:t(d,{ownerState:{activeStep:s,orientation:u,connectorColorOnComplete:o.connectorColorOnComplete,stepperSize:g}}),sx:{width:C?"auto":"100%","& .MuiStep-root":{alignItems:C?"flex-start":"center",paddingBottom:C?2:0},"& .MuiStepLabel-iconContainer":{paddingRight:C?2:0},"& .MuiStepLabel-label":{marginTop:!C&&h?1:0}},children:n.map(function(e,n){return t(c,{children:t(l,{StepIconComponent:function(){return t(p,{index:n,active:n===s,completed:n<s,props:o})},children:i("div",{className:"zui:flex zui:flex-col ".concat(C?"zui:items-start":"zui:items-center"," zui:gap-1"),children:[t("span",{className:"zui:text-sm zui:font-medium zui:text-gray-900",children:e.name}),e.description&&t("span",{className:"zui:text-xs zui:text-gray-500 ".concat(C?"zui:text-left":"zui:text-center"),children:e.description})]})})},n)})})})};export{m as Stepper,m as default};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),t=require("react/jsx-runtime"),i=require("@mui/material"),o=require("../../chunks/lucide-937248a9.js");require("react");var n=i.styled(i.StepConnector)(function(t){var o,n=t.theme,r=t.ownerState,a=r.orientation,s=r.stepperSize,c=void 0===s?40:s,l=r.activeStep,p=void 0===l?0:l,d=r.index,u=void 0===d?0:d,v=r.connectorColorOnComplete,x=void 0===v?"#4caf50":v,m="dark"===n.palette.mode?"#555":"#e0e0e0",h=x;return(o={})["&.".concat(i.stepConnectorClasses.alternativeLabel)]={top:c/2,left:"calc(-50% + ".concat(c/2,"px)"),right:"calc(50% + ".concat(c/2,"px)")},o["& .".concat(i.stepConnectorClasses.line)]=e.__assign(e.__assign({border:0,transition:"all 0.3s ease"},"horizontal"===a&&{height:1,width:"100%",backgroundColor:u<p?h:m}),"vertical"===a&&{width:1,minHeight:40,marginLeft:c/2-12,backgroundColor:u<p?h:m}),o}),r=function(e){var i=e.index,n=e.active,r=e.completed,a=e.props,s=a.stepperLabels,c=a.onCompleteIcon,l=a.onActiveIcon,p=a.onActiveColor,d=void 0===p?"#1976d2":p,u=a.onCompleteColor,v=void 0===u?"#4caf50":u,x=a.stepperSize,m=void 0===x?36:x,h=a.activeBorderColor,C=void 0===h?"#1976d2":h,f=s[i],g=(null==f?void 0:f.stepperIcon)||t.jsx("span",{children:i+1}),z="#9e9e9e",S="#e0e0e0",j="transparent";return r?(z=v,S=v,j="".concat(v,"20")):n&&(z=d,S=C),t.jsx("div",{style:{width:m,height:m,minWidth:m,minHeight:m,borderRadius:"50%",border:"2px solid ".concat(S),display:"flex",alignItems:"center",justifyContent:"center",color:z,backgroundColor:j,transition:"all 0.3s ease",flexShrink:0,position:"relative",zIndex:1},children:r?c||t.jsx(o.CircleCheckBig,{size:18,color:v}):n&&l||g})},a=function(o){var a=o.stepperLabels,s=o.activeStep,c=void 0===s?0:s,l=o.orientation,p=void 0===l?"horizontal":l,d=o.alternativeLabel,u=void 0!==d&&d,v=o.styles,x=void 0===v?{}:v,m=o.stepperSize,h=void 0===m?36:m,C="vertical"===p;return t.jsx("div",{style:e.__assign({width:"100%",display:"flex",justifyContent:C?"flex-start":"center"},x),children:t.jsx(i.Stepper,{activeStep:c,orientation:p,alternativeLabel:!C&&u,connector:t.jsx(n,{ownerState:{activeStep:c,orientation:p,connectorColorOnComplete:o.connectorColorOnComplete,stepperSize:h}}),sx:{width:C?"auto":"100%","& .MuiStep-root":{alignItems:C?"flex-start":"center",paddingBottom:C?2:0},"& .MuiStepLabel-iconContainer":{paddingRight:C?2:0},"& .MuiStepLabel-label":{marginTop:!C&&u?1:0}},children:a.map(function(e,n){return t.jsx(i.Step,{children:t.jsx(i.StepLabel,{StepIconComponent:function(){return t.jsx(r,{index:n,active:n===c,completed:n<c,props:o})},children:t.jsxs("div",{className:"zui:flex zui:flex-col ".concat(C?"zui:items-start":"zui:items-center"," zui:gap-1"),children:[t.jsx("span",{className:"zui:text-sm zui:font-medium zui:text-gray-900",children:e.name}),e.description&&t.jsx("span",{className:"zui:text-xs zui:text-gray-500 ".concat(C?"zui:text-left":"zui:text-center"),children:e.description})]})})},n)})})})};exports.Stepper=a,exports.default=a;
@@ -1,15 +0,0 @@
1
- import React__default from 'react';
2
- import { SwitchProps as SwitchProps$1 } from '@mui/material';
3
-
4
- interface SwitchProps extends Omit<SwitchProps$1, 'onChange'> {
5
- label?: string;
6
- helperText?: string;
7
- error?: boolean;
8
- required?: boolean | number;
9
- labelPlacement?: 'end' | 'start' | 'bottom' | 'top';
10
- onChange?: (event: React__default.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
11
- }
12
- declare const Switch: React__default.ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & React__default.RefAttributes<HTMLButtonElement>>;
13
-
14
- export { Switch, Switch as default };
15
- export type { SwitchProps };
@@ -1 +0,0 @@
1
- import{_ as e,a as r}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsxs as a,jsx as l}from"react/jsx-runtime";import i from"react";import{FormControl as o,FormControlLabel as d,Switch as n,FormHelperText as t}from"@mui/material";var c=i.forwardRef(function(i,c){var s=i.label,m=void 0===s?"":s,u=i.helperText,h=void 0===u?"":u,b=i.error,f=void 0!==b&&b,p=i.onChange,v=i.checked,k=i.required,x=void 0!==k&&k,g=i.disabled,q=void 0!==g&&g,C=i.className,N=i.labelPlacement,P=void 0===N?"end":N,j=e(i,["label","helperText","error","onChange","checked","required","disabled","className","labelPlacement"]);return a(o,{className:C,error:f,disabled:q,component:"fieldset",children:[l(d,{control:l(n,r({inputRef:c,checked:v,onChange:function(e,r){return null==p?void 0:p(e,r)},disabled:q,required:1==x||!0===x},j)),labelPlacement:P||"end",label:m}),h&&l(t,{children:h})]})});export{c as Switch,c as default};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../chunks/tslib.es6-a3dc1f53.js"),r=require("react/jsx-runtime"),l=require("react"),a=require("@mui/material"),i=l.forwardRef(function(l,i){var o=l.label,t=void 0===o?"":o,d=l.helperText,n=void 0===d?"":d,s=l.error,c=void 0!==s&&s,u=l.onChange,b=l.checked,h=l.required,m=void 0!==h&&h,x=l.disabled,v=void 0!==x&&x,p=l.className,f=l.labelPlacement,j=void 0===f?"end":f,q=e.__rest(l,["label","helperText","error","onChange","checked","required","disabled","className","labelPlacement"]);return r.jsxs(a.FormControl,{className:p,error:c,disabled:v,component:"fieldset",children:[r.jsx(a.FormControlLabel,{control:r.jsx(a.Switch,e.__assign({inputRef:i,checked:b,onChange:function(e,r){return null==u?void 0:u(e,r)},disabled:v,required:1==m||!0===m},q)),labelPlacement:j||"end",label:t}),n&&r.jsx(a.FormHelperText,{children:n})]})});exports.Switch=i,exports.default=i;
@@ -1,40 +0,0 @@
1
- import React__default from 'react';
2
- import { LucideIcon } from 'lucide-react';
3
-
4
- type TabVariant = 'default' | 'pills' | 'outline' | 'underline' | 'ghost' | 'bordered';
5
- type TabSize = 'sm' | 'md' | 'lg' | 'xl';
6
- interface TabProviderProps {
7
- children: React__default.ReactNode;
8
- defaultValue?: string;
9
- value?: string;
10
- onValueChange?: (value: string) => void;
11
- variant?: TabVariant;
12
- size?: TabSize;
13
- orientation?: 'horizontal' | 'vertical';
14
- }
15
- interface TabListProps extends React__default.HTMLAttributes<HTMLDivElement> {
16
- children: React__default.ReactNode;
17
- }
18
- interface TabTriggerProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
19
- value: string;
20
- icon?: LucideIcon;
21
- iconPosition?: 'left' | 'right';
22
- badge?: number | string;
23
- badgeVariant?: 'default' | 'secondary' | 'success' | 'warning' | 'error';
24
- loading?: boolean;
25
- children: React__default.ReactNode;
26
- }
27
- interface TabContentProps extends React__default.HTMLAttributes<HTMLDivElement> {
28
- value: string;
29
- children: React__default.ReactNode;
30
- forceMount?: boolean;
31
- }
32
- declare const Tab: {
33
- Provider: React__default.FC<TabProviderProps>;
34
- List: React__default.FC<TabListProps>;
35
- Trigger: React__default.FC<TabTriggerProps>;
36
- Content: React__default.FC<TabContentProps>;
37
- };
38
-
39
- export { Tab, Tab as default };
40
- export type { TabSize, TabTriggerProps, TabVariant };
@@ -1 +0,0 @@
1
- import{_ as i,a as e}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsx as u,jsxs as r}from"react/jsx-runtime";import{createContext as a,useState as t,useContext as n}from"react";import{c as z}from"../../chunks/index-3cd5487e.esm.js";import{a as d}from"../../chunks/index-6d90ff6c.esm.js";var o=a(void 0),l=function(){var i=n(o);if(!i)throw new Error("Tab components must be used within TabProvider");return i},s=z("zui:flex zui:gap-1",{variants:{variant:{default:"zui:bg-gray-100 zui:p-1 zui:rounded-sm",pills:"zui:gap-2",outline:"zui:border zui:border-gray-200 zui:rounded-sm zui:p-1",underline:"zui:border-b zui:border-gray-200",ghost:"",bordered:"zui:border zui:border-gray-200 zui:rounded-sm"},orientation:{horizontal:"zui:flex-row",vertical:"zui:flex-col zui:w-fit"},size:{sm:"zui:text-sm",md:"zui:text-base",lg:"zui:text-lg",xl:"zui:text-xl"}},defaultVariants:{variant:"default",orientation:"horizontal",size:"md"}}),c=z("zui:inline-flex zui:items-center zui:justify-center zui:gap-2 zui:font-medium zui:transition-all zui:duration-200 zui:cursor-pointer zui:select-none zui:whitespace-nowrap disabled:zui:cursor-not-allowed disabled:zui:opacity-50",{variants:{variant:{default:"zui:rounded-md zui:px-3 zui:py-1.5 hover:zui:bg-gray-200/70",pills:"zui:rounded-full zui:px-4 zui:py-2 zui:bg-gray-100 hover:zui:bg-gray-200",outline:"zui:rounded-md zui:px-3 zui:py-1.5 zui:border zui:border-transparent hover:zui:border-gray-300",underline:"zui:px-3 zui:py-2 zui:border-b-2 zui:border-transparent hover:zui:border-gray-300",ghost:"zui:rounded-md zui:px-3 zui:py-1.5 hover:zui:bg-gray-100",bordered:"zui:px-3 zui:py-1.5 zui:border-r zui:border-gray-200 last:zui:border-r-0 hover:zui:bg-gray-50"},size:{sm:"zui:text-sm zui:px-2 zui:py-1",md:"zui:text-sm zui:px-3 zui:py-1.5",lg:"zui:text-base zui:px-4 zui:py-2",xl:"zui:text-lg zui:px-6 zui:py-3"}},defaultVariants:{variant:"default",size:"md"}}),b=z("",{variants:{variant:{default:"zui:bg-white zui:rounded-sm zui:text-gray-900 zui:shadow-sm",pills:"zui:bg-blue-500 zui:rounded-full zui:text-white",outline:"zui:border-blue-500 zui:rounded-sm zui:bg-blue-50",underline:"zui:border-blue-500 zui:text-blue-600",ghost:"zui:bg-gray-100 zui:text-gray-900 zui:rounded-sm",bordered:"zui:bg-blue-50 zui:text-blue-600 zui:rounded-sm"}},defaultVariants:{variant:"default"}}),m=function(i){var e=i.children,r=i.variant,a=void 0===r?"default":r,t=i.size,n=void 0===t?"sm":t,d=z("zui:inline-flex zui:items-center zui:justify-center zui:rounded-full zui:font-medium",{variants:{variant:{default:"zui:bg-gray-100 zui:text-gray-800",secondary:"zui:bg-blue-100 zui:text-blue-800",success:"zui:bg-green-100 zui:text-green-800",warning:"zui:bg-yellow-100 zui:text-yellow-800",error:"zui:bg-red-100 zui:text-red-800"},size:{sm:"zui:px-1.5 zui:py-0.5 zui:text-xs zui:min-w-[1.25rem] zui:h-5",md:"zui:px-2 zui:py-1 zui:text-sm zui:min-w-[1.5rem] zui:h-6",lg:"zui:px-2.5 zui:py-1.5 zui:text-sm zui:min-w-[2rem] zui:h-8"}},defaultVariants:{variant:"default",size:"sm"}});return u("span",{className:d({variant:a,size:n}),children:e})},v={Provider:function(i){var e=i.children,r=i.defaultValue,a=void 0===r?"":r,n=i.value,z=i.onValueChange,d=i.variant,l=void 0===d?"default":d,s=i.size,c=void 0===s?"md":s,b=i.orientation,m=void 0===b?"horizontal":b,v=t(a),g=v[0],p=v[1],f=null!=n?n:g;return u(o.Provider,{value:{activeTab:f,setActiveTab:function(i){void 0===n&&p(i),null==z||z(i)},variant:l,size:c,orientation:m},children:e})},List:function(r){var a=r.children,t=r.className,n=i(r,["children","className"]),z=l(),o=z.variant,c=z.size,b=z.orientation;return u("div",e({className:d(s({variant:o,size:c,orientation:b}),t),role:"tablist"},n,{children:a}))},Trigger:function(a){var t=a.value,n=a.icon,z=a.iconPosition,o=void 0===z?"left":z,s=a.badge,v=a.badgeVariant,g=void 0===v?"default":v,p=a.loading,f=void 0!==p&&p,h=a.children,x=a.className,y=a.disabled,w=i(a,["value","icon","iconPosition","badge","badgeVariant","loading","children","className","disabled"]),N=l(),T=N.activeTab,V=N.setActiveTab,j=N.variant,P=N.size,k=T===t,C=function(){return f?u("div",{className:"zui:animate-spin zui:w-4 zui:h-4 zui:border-2 zui:border-current zui:border-t-transparent zui:rounded-full"}):n?u(n,{className:d("sm"===P?"zui:w-3 zui:h-3":"md"===P?"zui:w-4 zui:h-4":"lg"===P?"zui:w-5 zui:h-5":"zui:w-6 zui:h-6")}):null},A=d(c({variant:j,size:P}),k&&b({variant:j}),x);return r("button",e({className:A,"data-state":k?"active":"inactive",disabled:y||f,onClick:function(){y||f||V(t)},role:"tab","aria-selected":k},w,{children:["left"===o&&C(),u("span",{className:f?"zui:opacity-70":"",children:h}),"right"===o&&C(),void 0!==s?u(m,{variant:g,size:"xl"===P?"lg":"lg"===P?"md":"sm",children:s}):null]}))},Content:function(r){var a=r.value,t=r.children,n=r.forceMount,z=void 0!==n&&n,o=r.className,s=i(r,["value","children","forceMount","className"]),c=l().activeTab===a;return c||z?u("div",e({className:d("zui:mt-4 zui:focus:outline-none",!c&&"zui:hidden",o),role:"tabpanel",hidden:!c},s,{children:t})):null}};export{v as Tab,v as default};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("../../chunks/tslib.es6-a3dc1f53.js"),e=require("react/jsx-runtime"),u=require("react"),r=require("../../chunks/index-9d477012.js"),a=require("../../chunks/index-4d90f67d.js"),t=u.createContext(void 0),n=function(){var i=u.useContext(t);if(!i)throw new Error("Tab components must be used within TabProvider");return i},z=r.cva("zui:flex zui:gap-1",{variants:{variant:{default:"zui:bg-gray-100 zui:p-1 zui:rounded-sm",pills:"zui:gap-2",outline:"zui:border zui:border-gray-200 zui:rounded-sm zui:p-1",underline:"zui:border-b zui:border-gray-200",ghost:"",bordered:"zui:border zui:border-gray-200 zui:rounded-sm"},orientation:{horizontal:"zui:flex-row",vertical:"zui:flex-col zui:w-fit"},size:{sm:"zui:text-sm",md:"zui:text-base",lg:"zui:text-lg",xl:"zui:text-xl"}},defaultVariants:{variant:"default",orientation:"horizontal",size:"md"}}),d=r.cva("zui:inline-flex zui:items-center zui:justify-center zui:gap-2 zui:font-medium zui:transition-all zui:duration-200 zui:cursor-pointer zui:select-none zui:whitespace-nowrap disabled:zui:cursor-not-allowed disabled:zui:opacity-50",{variants:{variant:{default:"zui:rounded-md zui:px-3 zui:py-1.5 hover:zui:bg-gray-200/70",pills:"zui:rounded-full zui:px-4 zui:py-2 zui:bg-gray-100 hover:zui:bg-gray-200",outline:"zui:rounded-md zui:px-3 zui:py-1.5 zui:border zui:border-transparent hover:zui:border-gray-300",underline:"zui:px-3 zui:py-2 zui:border-b-2 zui:border-transparent hover:zui:border-gray-300",ghost:"zui:rounded-md zui:px-3 zui:py-1.5 hover:zui:bg-gray-100",bordered:"zui:px-3 zui:py-1.5 zui:border-r zui:border-gray-200 last:zui:border-r-0 hover:zui:bg-gray-50"},size:{sm:"zui:text-sm zui:px-2 zui:py-1",md:"zui:text-sm zui:px-3 zui:py-1.5",lg:"zui:text-base zui:px-4 zui:py-2",xl:"zui:text-lg zui:px-6 zui:py-3"}},defaultVariants:{variant:"default",size:"md"}}),s=r.cva("",{variants:{variant:{default:"zui:bg-white zui:rounded-sm zui:text-gray-900 zui:shadow-sm",pills:"zui:bg-blue-500 zui:rounded-full zui:text-white",outline:"zui:border-blue-500 zui:rounded-sm zui:bg-blue-50",underline:"zui:border-blue-500 zui:text-blue-600",ghost:"zui:bg-gray-100 zui:text-gray-900 zui:rounded-sm",bordered:"zui:bg-blue-50 zui:text-blue-600 zui:rounded-sm"}},defaultVariants:{variant:"default"}}),o=function(i){var u=i.children,a=i.variant,t=void 0===a?"default":a,n=i.size,z=void 0===n?"sm":n,d=r.cva("zui:inline-flex zui:items-center zui:justify-center zui:rounded-full zui:font-medium",{variants:{variant:{default:"zui:bg-gray-100 zui:text-gray-800",secondary:"zui:bg-blue-100 zui:text-blue-800",success:"zui:bg-green-100 zui:text-green-800",warning:"zui:bg-yellow-100 zui:text-yellow-800",error:"zui:bg-red-100 zui:text-red-800"},size:{sm:"zui:px-1.5 zui:py-0.5 zui:text-xs zui:min-w-[1.25rem] zui:h-5",md:"zui:px-2 zui:py-1 zui:text-sm zui:min-w-[1.5rem] zui:h-6",lg:"zui:px-2.5 zui:py-1.5 zui:text-sm zui:min-w-[2rem] zui:h-8"}},defaultVariants:{variant:"default",size:"sm"}});return e.jsx("span",{className:d({variant:t,size:z}),children:u})},l={Provider:function(i){var r=i.children,a=i.defaultValue,n=void 0===a?"":a,z=i.value,d=i.onValueChange,s=i.variant,o=void 0===s?"default":s,l=i.size,c=void 0===l?"md":l,b=i.orientation,v=void 0===b?"horizontal":b,g=u.useState(n),m=g[0],x=g[1],p=null!=z?z:m;return e.jsx(t.Provider,{value:{activeTab:p,setActiveTab:function(i){void 0===z&&x(i),null==d||d(i)},variant:o,size:c,orientation:v},children:r})},List:function(u){var r=u.children,t=u.className,d=i.__rest(u,["children","className"]),s=n(),o=s.variant,l=s.size,c=s.orientation;return e.jsx("div",i.__assign({className:a.cn(z({variant:o,size:l,orientation:c}),t),role:"tablist"},d,{children:r}))},Trigger:function(u){var r=u.value,t=u.icon,z=u.iconPosition,l=void 0===z?"left":z,c=u.badge,b=u.badgeVariant,v=void 0===b?"default":b,g=u.loading,m=void 0!==g&&g,x=u.children,p=u.className,h=u.disabled,f=i.__rest(u,["value","icon","iconPosition","badge","badgeVariant","loading","children","className","disabled"]),y=n(),w=y.activeTab,j=y.setActiveTab,_=y.variant,N=y.size,T=w===r,V=function(){return m?e.jsx("div",{className:"zui:animate-spin zui:w-4 zui:h-4 zui:border-2 zui:border-current zui:border-t-transparent zui:rounded-full"}):t?e.jsx(t,{className:a.cn("sm"===N?"zui:w-3 zui:h-3":"md"===N?"zui:w-4 zui:h-4":"lg"===N?"zui:w-5 zui:h-5":"zui:w-6 zui:h-6")}):null},P=a.cn(d({variant:_,size:N}),T&&s({variant:_}),p);return e.jsxs("button",i.__assign({className:P,"data-state":T?"active":"inactive",disabled:h||m,onClick:function(){h||m||j(r)},role:"tab","aria-selected":T},f,{children:["left"===l&&V(),e.jsx("span",{className:m?"zui:opacity-70":"",children:x}),"right"===l&&V(),void 0!==c?e.jsx(o,{variant:v,size:"xl"===N?"lg":"lg"===N?"md":"sm",children:c}):null]}))},Content:function(u){var r=u.value,t=u.children,z=u.forceMount,d=void 0!==z&&z,s=u.className,o=i.__rest(u,["value","children","forceMount","className"]),l=n().activeTab===r;return l||d?e.jsx("div",i.__assign({className:a.cn("zui:mt-4 zui:focus:outline-none",!l&&"zui:hidden",s),role:"tabpanel",hidden:!l},o,{children:t})):null}};exports.Tab=l,exports.default=l;
@@ -1,80 +0,0 @@
1
- import React__default from 'react';
2
-
3
- interface Column {
4
- id: string;
5
- header: string;
6
- accessor: string;
7
- width?: number;
8
- minWidth?: number;
9
- maxWidth?: number;
10
- sticky?: 'left' | 'right';
11
- sortable?: boolean;
12
- filterable?: boolean;
13
- hidden?: boolean;
14
- align?: 'left' | 'center' | 'right';
15
- render?: (value: any, row: any, index: number) => React__default.ReactNode;
16
- }
17
- interface TableData {
18
- id: string;
19
- [key: string]: any;
20
- _expanded?: boolean;
21
- _selected?: boolean;
22
- _children?: TableData[];
23
- }
24
- interface StickyConfig {
25
- left?: string[];
26
- right?: string[];
27
- }
28
- interface BulkAction {
29
- label: string;
30
- icon?: React__default.ReactNode;
31
- onClick: (selectedIds: string[]) => void;
32
- variant?: 'primary' | 'secondary' | 'danger';
33
- disabled?: boolean;
34
- }
35
- interface TableProps {
36
- columns: Column[];
37
- data: TableData[];
38
- loading?: boolean;
39
- pagination?: {
40
- page: number;
41
- pageSize: number;
42
- total: number;
43
- onPageChange: (page: number) => void;
44
- onPageSizeChange: (size: number) => void;
45
- };
46
- selection?: {
47
- enabled: boolean;
48
- selectedRows: string[];
49
- onSelectionChange: (selectedIds: string[]) => void;
50
- };
51
- sorting?: {
52
- sortBy: string;
53
- sortOrder: 'asc' | 'desc';
54
- onSortChange: (sortBy: string, order: 'asc' | 'desc') => void;
55
- };
56
- filtering?: {
57
- filters: Record<string, any>;
58
- onFilterChange: (filters: Record<string, any>) => void;
59
- };
60
- expansion?: {
61
- expandedRows: string[];
62
- onExpansionChange: (expandedIds: string[]) => void;
63
- renderExpandedRow: (row: TableData) => React__default.ReactNode;
64
- };
65
- virtualization?: {
66
- enabled: boolean;
67
- rowHeight?: number;
68
- overscan?: number;
69
- };
70
- onRowClick?: (row: TableData) => void;
71
- className?: string;
72
- stickyColumns?: StickyConfig;
73
- bulkActions?: BulkAction[];
74
- isRowSelectable?: (row: TableData) => boolean;
75
- variant?: 'standard' | 'compact' | 'striped';
76
- }
77
- declare const Table: React__default.FC<TableProps>;
78
-
79
- export { Table, Table as default };
80
- export type { TableProps };
@@ -1 +0,0 @@
1
- import{a as i,b as e}from"../../chunks/tslib.es6-4974c96c.esm.js";import{jsx as n,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as u,useRef as o,useMemo as l,useEffect as a,useCallback as c}from"react";import{A as s,F as d}from"../../chunks/react-virtualized-auto-sizer.esm-9ede76fe.esm.js";import{Checkbox as z}from"../Checkbox/index.esm.js";import{i as h,C as f,a as m,j as g,A as y,k as x,l as p,c as b}from"../../chunks/lucide-1d5a9cda.esm.js";import"../../chunks/extends-bb693bd1.esm.js";import"../../chunks/assertThisInitialized-03efc53b.esm.js";import"../../chunks/index-6d90ff6c.esm.js";var v=150,w=function(e){var t,r=e.column,u=e.width,o=e.sticky,l=e.stickyPosition,a=o?((t={position:"sticky"})[o]="".concat(l||0,"px"),t.zIndex=25,t.backgroundColor="white",t):{},c="center"===r.align?"zui:justify-center":"right"===r.align?"zui:justify-end":"zui:justify-start";return n("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(c),style:i({width:"".concat(u,"px"),minWidth:"".concat(u,"px"),maxWidth:"".concat(u,"px")},a),children:n("div",{className:"zui:h-4 zui:bg-gray-200 zui:rounded zui:animate-pulse zui:w-3/4"})})},k=function(i){var e=i.leftStickyColumns,r=i.rightStickyColumns,u=i.regularColumns,o=i.selection,l=i.calculateStickyPosition,a=i.rowIndex;return t("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)&&n("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:n("div",{className:"zui:w-4 zui:h-4 zui:bg-gray-200 zui:rounded zui:animate-pulse"})}),e.map(function(i,t){return n(w,{column:i,width:i.width||v,sticky:"left",stickyPosition:l(e,t,"left")},"left-".concat(i.id,"-").concat(a))}),u.map(function(i,e){return n(w,{column:i,width:i.width||v},"regular-".concat(i.id,"-").concat(a))}),r.map(function(i,e){return n(w,{column:i,width:i.width||v,sticky:"right",stickyPosition:l(r,e,"right")},"right-".concat(i.id,"-").concat(a))})]})},C=function(i){var e=i.columns,t=i.leftStickyColumns,r=i.rightStickyColumns,u=i.regularColumns,o=i.selection,l=i.calculateStickyPosition,a=i.totalWidth;return n("div",{style:{minWidth:"".concat(a,"px")},children:Array.from({length:10},function(i,a){return n(k,{columns:e,leftStickyColumns:t,rightStickyColumns:r,regularColumns:u,selection:o,calculateStickyPosition:l,rowIndex:a},"skeleton-row-".concat(a))})})},N=function(y){var x,p,b=y.columns,w=y.data,k=y.loading,N=void 0!==k&&k,P=y.stickyColumns,R=y.pagination,M=y.selection,E=y.sorting,I=y.filtering,L=y.expansion,W=y.virtualization,O=void 0===W?{enabled:!1}:W,A=y.onRowClick;y.bulkActions;var B=y.isRowSelectable,T=y.className,_=void 0===T?"":T;y.variant;var H=u(b),F=H[0],q=H[1],D=u(""),G=D[0];D[1];var J=u(!1),K=J[0];J[1];var Q=o(null),U=o(null),V=o(null),X=l(function(){return F.map(function(e){var n,t,r=e.sticky;return(null===(n=null==P?void 0:P.left)||void 0===n?void 0:n.includes(e.id))?r="left":(null===(t=null==P?void 0:P.right)||void 0===t?void 0:t.includes(e.id))&&(r="right"),i(i({},e),{sticky:r})})},[F,P]),Y=l(function(){return X.filter(function(i){return!i.hidden})},[X]),Z=null!==(x=null==P?void 0:P.left)&&void 0!==x?x:[],$=null!==(p=null==P?void 0:P.right)&&void 0!==p?p:[],ii=Y.filter(function(i){return Z.includes(i.id)}),ei=Y.filter(function(i){return $.includes(i.id)}),ni=Y.filter(function(i){return!Z.includes(i.id)&&!$.includes(i.id)}),ti=l(function(){return ni.reduce(function(i,e){return i+(e.width||v)},0)},[ni]),ri=l(function(){var i=0;return(null==M?void 0:M.enabled)&&(i+=48),Y.forEach(function(e){i+=e.width||v}),Math.max(i,800)},[Y,M]),ui=l(function(){var i=e([],w,!0);return G&&(i=i.filter(function(i){return Object.values(i).some(function(i){return String(i).toLowerCase().includes(G.toLowerCase())})})),(null==I?void 0:I.filters)&&Object.entries(I.filters).forEach(function(e){var n=e[0],t=e[1];t&&(i=i.filter(function(i){return String(i[n]).toLowerCase().includes(String(t).toLowerCase())}))}),(null==E?void 0:E.sortBy)&&i.sort(function(i,e){var n=i[E.sortBy],t=e[E.sortBy];return n<t?"asc"===E.sortOrder?-1:1:n>t?"asc"===E.sortOrder?1:-1:0}),i},[w,G,null==I?void 0:I.filters,E]);a(function(){var i=U.current,e=V.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 oi=c(function(){if((null==M?void 0:M.enabled)&&ui){var i=ui.filter(function(i){return!B||B(i)}).map(function(i){return i.id});if(i.every(function(i){return M.selectedRows.includes(i)}))M.onSelectionChange(M.selectedRows.filter(function(e){return!i.includes(e)}));else{var n=Array.from(new Set(e(e([],M.selectedRows.filter(function(e){return!i.includes(e)}),!0),i,!0)));M.onSelectionChange(n)}}},[ui,M,B]),li=c(function(i){if(null==M?void 0:M.enabled){var n=M.selectedRows;n.includes(i)?M.onSelectionChange(n.filter(function(e){return e!==i})):M.onSelectionChange(e(e([],n,!0),[i],!1))}},[M]),ai=c(function(i){if(L){var n=L.expandedRows;n.includes(i)?L.onExpansionChange(n.filter(function(e){return e!==i})):L.onExpansionChange(e(e([],n,!0),[i],!1))}},[L]),ci=c(function(e){q(function(n){return n.map(function(n){return n.id===e?i(i({},n),{hidden:!n.hidden}):n})})},[]),si=c(function(i,e,t){var r=e[i.accessor];return i.render?i.render(r,e,t):n("span",{className:"zui:truncate",children:String(r||"")})},[]),di=c(function(i,e,n){var t=0;return"left"===n?((null==M?void 0:M.enabled)&&(t+=48),i.slice(0,e).forEach(function(i){t+=i.width||v})):i.slice(e+1).forEach(function(i){t+=i.width||v}),t},[M]);return t("div",{className:"zui:w-full zui:h-full zui:bg-white zui:flex zui:flex-col ".concat(_),children:[K&&!N&&t("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:[n("h3",{className:"zui:text-sm zui:font-medium zui:text-gray-900 zui:mb-3",children:"Show/Hide Columns"}),b.map(function(i){return t("label",{className:"zui:flex zui:items-center zui:space-x-2 zui:mb-2",children:[n("input",{type:"checkbox",checked:!i.hidden,onChange:function(){return ci(i.id)},className:"zui:rounded zui:border-gray-300"}),n("span",{className:"zui:text-sm zui:text-gray-700",children:i.header})]},i.id)})]}),t("div",{ref:Q,className:"zui:relative zui:flex-1 zui:min-h-0 zui:overflow-hidden",children:[t("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==M?void 0:M.enabled)&&n("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:n(z,{checked:!N&&ui.length>0&&ui.every(function(i){return M.selectedRows.includes(i.id)}),onChange:oi,disabled:N,className:"zui:rounded zui:border-gray-300 zui:w-4 zui:h-4 zui:disabled:opacity-50"})}),ii.map(function(i,e){return n(S,{column:i,width:i.width||v,sticky:"left",stickyPosition:di(ii,e,"left"),sorting:E,loading:N},i.id)}),n("div",{ref:U,className:"zui:flex-1 zui:overflow-x-auto zui:scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:n("div",{className:"zui:flex",style:{minWidth:"".concat(ti,"px")},children:ni.map(function(i){return n(S,{column:i,width:i.width||v,sorting:E,loading:N},i.id)})})}),ei.map(function(i,e){return n(S,{column:i,width:i.width||v,sticky:"right",stickyPosition:di(ei,e,"right"),sorting:E,loading:N},i.id)})]}),n("div",{ref:V,className:"zui:flex-1 zui:overflow-auto zui:h-[calc(100%_-_2.75rem)]",style:{minHeight:"200px"},children:(null==O?void 0:O.enabled)?n(s,{children:function(i){var e=i.height,t=i.width;return n(d,{height:e,width:t,itemCount:ui.length,itemSize:O.rowHeight||60,overscanCount:O.overscan||5,children:function(i){var e=i.index,t=i.style;return n("div",{style:t,children:n(j,{row:ui[e],rowIndex:e,columns:Y,leftStickyColumns:ii,rightStickyColumns:ei,regularColumns:ni,selection:M,expansion:L,onRowClick:A,onRowSelection:li,onRowExpansion:ai,renderCell:si,calculateStickyPosition:di,isRowSelectable:B})},ui[e].id)}})}}):N?n(C,{columns:Y,leftStickyColumns:ii,rightStickyColumns:ei,regularColumns:ni,selection:M,calculateStickyPosition:di,totalWidth:ri}):0===ui.length?t("div",{className:"zui:flex zui:flex-col zui:items-center zui:justify-center zui:py-12",children:[n("div",{className:"zui:text-gray-400 zui:text-lg zui:mb-2",children:"No data found"}),n("div",{className:"zui:text-gray-500 zui:text-sm",children:"Try adjusting your search or filters"})]}):n("div",{style:{minWidth:"".concat(ri,"px")},children:ui.map(function(i,e){return n(j,{row:i,rowIndex:e,columns:Y,leftStickyColumns:ii,rightStickyColumns:ei,regularColumns:ni,selection:M,expansion:L,onRowClick:A,onRowSelection:li,onRowExpansion:ai,renderCell:si,calculateStickyPosition:di,isRowSelectable:B},i.id)})})})]}),R&&t("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:[N?"Loading...":function(){Math.max(1,Math.ceil(R.total/R.pageSize));var i=Math.min((R.page-1)*R.pageSize+1,Math.max(0,R.total)),e=Math.min(R.page*R.pageSize,R.total);return"Showing ".concat(0===R.total?0:i,"-").concat(e," of ").concat(R.total," entries")}(),n("div",{className:"zui:flex zui:items-center zui:space-x-2",children:N?n(r,{children:Array.from({length:4},function(i,e){return n("div",{className:"zui:w-8 zui:h-8 zui:bg-gray-200 zui:rounded zui:animate-pulse"},e)})}):t(r,{children:[t("div",{className:"zui:flex zui:items-center zui:space-x-1 zui:ml-2",children:[n("span",{className:"zui:text-sm zui:text-gray-700",children:"Per page:"}),n("select",{value:R.pageSize,onChange:function(i){var e=Number(i.target.value);R.onPageSizeChange(e),R.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 n("option",{value:i,children:i},i)})})]}),n("button",{onClick:function(){return R.onPageChange(1)},disabled:1===R.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:n(h,{size:18})}),n("button",{onClick:function(){return R.onPageChange(Math.max(1,R.page-1))},disabled:1===R.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:n(f,{size:18})}),n("button",{onClick:function(){return R.onPageChange(Math.min(Math.max(1,Math.ceil(R.total/R.pageSize)),R.page+1))},disabled:R.page>=Math.max(1,Math.ceil(R.total/R.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:n(m,{size:18})}),n("button",{onClick:function(){return R.onPageChange(Math.max(1,Math.ceil(R.total/R.pageSize)))},disabled:R.page>=Math.max(1,Math.ceil(R.total/R.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:n(g,{size:18})})]})})]})]})},S=function(e){var r,u=e.column,o=e.width,l=e.sticky,a=e.stickyPosition,c=e.sorting,s=e.loading,d=void 0!==s&&s,z=l?((r={position:"sticky"})[l]="".concat(a||0,"px"),r.zIndex=45,r.backgroundColor="#f9fafb",r):{},h="center"===u.align?"zui:justify-center":"right"===u.align?"zui:justify-end":"zui:justify-start";return n("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({width:"".concat(o,"px"),minWidth:"".concat(o,"px"),maxWidth:"".concat(o,"px")},z),children:t("div",{className:"zui:flex zui:items-center zui:space-x-1 zui:flex-1 zui:min-w-0",children:[n("span",{className:"zui:truncate zui:flex-1",children:u.header}),u.sortable&&n("button",{onClick:function(){if(u.sortable&&c&&!d){var i="asc";c.sortBy===u.id&&(i="asc"===c.sortOrder?"desc":"asc"),c.onSortChange(u.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==c?void 0:c.sortBy)!==u.id?n(p,{className:"zui:w-4 zui:h-4 zui:text-gray-400"}):"asc"===c.sortOrder?n(y,{className:"zui:w-4 zui:h-4 zui:text-blue-600"}):n(x,{className:"zui:w-4 zui:h-4 zui:text-blue-600"})})]})})},j=function(i){var e=i.row,u=i.rowIndex,o=i.leftStickyColumns,l=i.rightStickyColumns,a=i.regularColumns,s=i.selection,d=i.expansion,h=i.onRowClick,f=i.onRowSelection,g=i.onRowExpansion,y=i.renderCell,x=i.calculateStickyPosition,p=i.isRowSelectable,w=(null==s?void 0:s.selectedRows.includes(e.id))||!1,k=(null==d?void 0:d.expandedRows.includes(e.id))||!1,C=e._children&&e._children.length>0,N=c(function(){f(e.id)},[e.id,f]),S=c(function(){g(e.id)},[e.id,g]),j=c(function(i,e,r){var u=i.render?i.render(e[i.accessor],e,r):n("span",{className:"zui:truncate",children:String(e[i.accessor]||"")});return t("div",{className:"zui:flex zui:items-center zui:w-full",children:[d&&n("div",{className:"zui:flex-shrink-0 zui:mr-2",children:C?n("button",{onClick:function(i){i.stopPropagation(),S()},className:"zui:p-1 zui:hover:bg-gray-200 zui:rounded zui:transition-colors",children:n(k?b:m,{className:"zui:w-4 zui:h-4"})}):n("div",{className:"zui:w-6 zui:h-6"})}),n("div",{className:"zui:flex-1 zui:min-w-0",children:u})]})},[d,C,k,S]);return t(r,{children:[t("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(w?"zui:bg-blue-50":"zui:bg-white"),onClick:function(){return null==h?void 0:h(e)},children:[(null==s?void 0:s.enabled)&&(!p||p(e)?n("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:n(z,{checked:w,onChange:function(i){i.stopPropagation(),N()},className:"zui:rounded zui:border-gray-300 zui:w-4 zui:h-4"})}):n("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"})),o.map(function(i,t){return n(P,{column:i,row:e,rowIndex:u,width:i.width||v,sticky:"left",stickyPosition:x(o,t,"left"),renderCell:0===t?j:y},i.id)}),a.map(function(i,t){return n(P,{column:i,row:e,rowIndex:u,width:i.width||v,renderCell:0===o.length&&0===t?j:y},i.id)}),l.map(function(i,t){return n(P,{column:i,row:e,rowIndex:u,width:i.width||v,sticky:"right",stickyPosition:x(l,t,"right"),renderCell:y},i.id)})]}),k&&(null==d?void 0:d.renderExpandedRow)&&n("div",{className:"zui:border-b zui:border-gray-200 zui:bg-gray-50",children:d.renderExpandedRow(e)})]})},P=function(e){var t,r=e.column,u=e.row,o=e.rowIndex,l=e.width,a=e.sticky,c=e.stickyPosition,s=e.renderCell,d=a?((t={position:"sticky"})[a]="".concat(c||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 n("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({width:"".concat(l,"px"),minWidth:"".concat(l,"px"),maxWidth:"".concat(l,"px")},d),children:n("div",{className:"zui:w-full zui:min-w-0",children:s(r,u,o)})})};export{N as Table,N as default};
@@ -1 +0,0 @@
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;
@@ -1,40 +0,0 @@
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 };
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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;
@@ -1,26 +0,0 @@
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 };
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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;
@@ -1,30 +0,0 @@
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 };
@@ -1 +0,0 @@
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};
@@ -1 +0,0 @@
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))};
@@ -1,25 +0,0 @@
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 };