@pos-360/horizon 0.30.1 → 0.31.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.
- package/dist/{chunk-EZDGMHS7.mjs → chunk-2GMOVXHC.mjs} +98 -56
- package/dist/chunk-2GMOVXHC.mjs.map +1 -0
- package/dist/{chunk-RA7KTV62.mjs → chunk-3CXBEGTO.mjs} +909 -519
- package/dist/chunk-3CXBEGTO.mjs.map +1 -0
- package/dist/{chunk-23BJPJOK.js → chunk-D2BLWOWK.js} +98 -55
- package/dist/chunk-D2BLWOWK.js.map +1 -0
- package/dist/{chunk-H7KYKSHC.js → chunk-HKUYZ5K6.js} +1024 -633
- package/dist/chunk-HKUYZ5K6.js.map +1 -0
- package/dist/{chunk-6LDS7PWF.js → chunk-KKAQLA3Z.js} +83 -126
- package/dist/chunk-KKAQLA3Z.js.map +1 -0
- package/dist/{chunk-PQN73YBV.mjs → chunk-MOQF2VCC.mjs} +4 -46
- package/dist/chunk-MOQF2VCC.mjs.map +1 -0
- package/dist/enhanced.js +35 -35
- package/dist/enhanced.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +160 -156
- package/dist/index.mjs +3 -3
- package/dist/primitives.d.mts +38 -3
- package/dist/primitives.d.ts +38 -3
- package/dist/primitives.js +124 -120
- package/dist/primitives.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-23BJPJOK.js.map +0 -1
- package/dist/chunk-6LDS7PWF.js.map +0 -1
- package/dist/chunk-EZDGMHS7.mjs.map +0 -1
- package/dist/chunk-H7KYKSHC.js.map +0 -1
- package/dist/chunk-PQN73YBV.mjs.map +0 -1
- package/dist/chunk-RA7KTV62.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkD2BLWOWK_js = require('./chunk-D2BLWOWK.js');
|
|
4
|
+
var React11 = require('react');
|
|
5
5
|
var reactSlot = require('@radix-ui/react-slot');
|
|
6
6
|
var classVarianceAuthority = require('class-variance-authority');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -36,7 +36,7 @@ function _interopNamespace(e) {
|
|
|
36
36
|
return Object.freeze(n);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var React11__namespace = /*#__PURE__*/_interopNamespace(React11);
|
|
40
40
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
41
41
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
42
42
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
@@ -72,7 +72,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
|
-
var Button =
|
|
75
|
+
var Button = React11__namespace.forwardRef(
|
|
76
76
|
({
|
|
77
77
|
className,
|
|
78
78
|
variant,
|
|
@@ -88,7 +88,7 @@ var Button = React10__namespace.forwardRef(
|
|
|
88
88
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
89
89
|
Comp,
|
|
90
90
|
{
|
|
91
|
-
className:
|
|
91
|
+
className: chunkD2BLWOWK_js.cn(buttonVariants({ variant, size, className })),
|
|
92
92
|
ref,
|
|
93
93
|
...props,
|
|
94
94
|
children
|
|
@@ -99,7 +99,7 @@ var Button = React10__namespace.forwardRef(
|
|
|
99
99
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
100
100
|
Comp,
|
|
101
101
|
{
|
|
102
|
-
className:
|
|
102
|
+
className: chunkD2BLWOWK_js.cn(buttonVariants({ variant, size, className })),
|
|
103
103
|
ref,
|
|
104
104
|
...props,
|
|
105
105
|
children: [
|
|
@@ -112,11 +112,11 @@ var Button = React10__namespace.forwardRef(
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
Button.displayName = "Button";
|
|
115
|
-
var Card =
|
|
115
|
+
var Card = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
116
|
"div",
|
|
117
117
|
{
|
|
118
118
|
ref,
|
|
119
|
-
className:
|
|
119
|
+
className: chunkD2BLWOWK_js.cn(
|
|
120
120
|
"rounded-hz-lg border border-gray-200 bg-white text-gray-900 shadow dark:border-neutral-700 dark:bg-neutral-800 dark:text-gray-100",
|
|
121
121
|
className
|
|
122
122
|
),
|
|
@@ -124,56 +124,56 @@ var Card = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
124
124
|
}
|
|
125
125
|
));
|
|
126
126
|
Card.displayName = "Card";
|
|
127
|
-
var CardHeader =
|
|
127
|
+
var CardHeader = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
128
128
|
"div",
|
|
129
129
|
{
|
|
130
130
|
ref,
|
|
131
|
-
className:
|
|
131
|
+
className: chunkD2BLWOWK_js.cn("flex flex-col space-y-1.5 p-4", className),
|
|
132
132
|
...props
|
|
133
133
|
}
|
|
134
134
|
));
|
|
135
135
|
CardHeader.displayName = "CardHeader";
|
|
136
|
-
var CardTitle =
|
|
136
|
+
var CardTitle = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
137
137
|
"div",
|
|
138
138
|
{
|
|
139
139
|
ref,
|
|
140
|
-
className:
|
|
140
|
+
className: chunkD2BLWOWK_js.cn("font-semibold leading-none tracking-tight", className),
|
|
141
141
|
...props
|
|
142
142
|
}
|
|
143
143
|
));
|
|
144
144
|
CardTitle.displayName = "CardTitle";
|
|
145
|
-
var CardDescription =
|
|
145
|
+
var CardDescription = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
146
146
|
"div",
|
|
147
147
|
{
|
|
148
148
|
ref,
|
|
149
|
-
className:
|
|
149
|
+
className: chunkD2BLWOWK_js.cn("text-sm text-gray-500 dark:text-gray-400", className),
|
|
150
150
|
...props
|
|
151
151
|
}
|
|
152
152
|
));
|
|
153
153
|
CardDescription.displayName = "CardDescription";
|
|
154
|
-
var CardContent =
|
|
154
|
+
var CardContent = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
155
155
|
"div",
|
|
156
156
|
{
|
|
157
157
|
ref,
|
|
158
|
-
className:
|
|
158
|
+
className: chunkD2BLWOWK_js.cn("p-4 pt-0", className),
|
|
159
159
|
...props
|
|
160
160
|
}
|
|
161
161
|
));
|
|
162
162
|
CardContent.displayName = "CardContent";
|
|
163
|
-
var CardFooter =
|
|
163
|
+
var CardFooter = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
164
164
|
"div",
|
|
165
165
|
{
|
|
166
166
|
ref,
|
|
167
|
-
className:
|
|
167
|
+
className: chunkD2BLWOWK_js.cn("flex items-center p-4 pt-0", className),
|
|
168
168
|
...props
|
|
169
169
|
}
|
|
170
170
|
));
|
|
171
171
|
CardFooter.displayName = "CardFooter";
|
|
172
|
-
var Checkbox =
|
|
172
|
+
var Checkbox = React11__namespace.forwardRef(({ className, indicatorIcon, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
173
173
|
CheckboxPrimitive__namespace.Root,
|
|
174
174
|
{
|
|
175
175
|
ref,
|
|
176
|
-
className:
|
|
176
|
+
className: chunkD2BLWOWK_js.cn(
|
|
177
177
|
"peer h-4 w-4 shrink-0 rounded-hz-sm border border-gray-300 bg-transparent shadow focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-600 data-[state=checked]:text-white dark:border-neutral-600 dark:data-[state=checked]:bg-blue-600",
|
|
178
178
|
className
|
|
179
179
|
),
|
|
@@ -181,7 +181,7 @@ var Checkbox = React10__namespace.forwardRef(({ className, indicatorIcon, ...pro
|
|
|
181
181
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
182
182
|
CheckboxPrimitive__namespace.Indicator,
|
|
183
183
|
{
|
|
184
|
-
className:
|
|
184
|
+
className: chunkD2BLWOWK_js.cn("flex items-center justify-center text-current"),
|
|
185
185
|
children: indicatorIcon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-3.5 w-3.5", strokeWidth: 3 })
|
|
186
186
|
}
|
|
187
187
|
)
|
|
@@ -192,11 +192,11 @@ var Dialog = DialogPrimitive__namespace.Root;
|
|
|
192
192
|
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
193
193
|
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
194
194
|
var DialogClose = DialogPrimitive__namespace.Close;
|
|
195
|
-
var DialogOverlay =
|
|
195
|
+
var DialogOverlay = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
196
196
|
DialogPrimitive__namespace.Overlay,
|
|
197
197
|
{
|
|
198
198
|
ref,
|
|
199
|
-
className:
|
|
199
|
+
className: chunkD2BLWOWK_js.cn(
|
|
200
200
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
201
201
|
className
|
|
202
202
|
),
|
|
@@ -204,13 +204,13 @@ var DialogOverlay = React10__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
204
204
|
}
|
|
205
205
|
));
|
|
206
206
|
DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
|
|
207
|
-
var DialogContent =
|
|
207
|
+
var DialogContent = React11__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
208
208
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
209
209
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
210
210
|
DialogPrimitive__namespace.Content,
|
|
211
211
|
{
|
|
212
212
|
ref,
|
|
213
|
-
className:
|
|
213
|
+
className: chunkD2BLWOWK_js.cn(
|
|
214
214
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-hz-normal data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-hz-lg dark:border-neutral-700 dark:bg-neutral-800",
|
|
215
215
|
className
|
|
216
216
|
),
|
|
@@ -232,7 +232,7 @@ var DialogHeader = ({
|
|
|
232
232
|
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
233
233
|
"div",
|
|
234
234
|
{
|
|
235
|
-
className:
|
|
235
|
+
className: chunkD2BLWOWK_js.cn(
|
|
236
236
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
237
237
|
className
|
|
238
238
|
),
|
|
@@ -246,7 +246,7 @@ var DialogFooter = ({
|
|
|
246
246
|
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
247
247
|
"div",
|
|
248
248
|
{
|
|
249
|
-
className:
|
|
249
|
+
className: chunkD2BLWOWK_js.cn(
|
|
250
250
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
251
251
|
className
|
|
252
252
|
),
|
|
@@ -254,11 +254,11 @@ var DialogFooter = ({
|
|
|
254
254
|
}
|
|
255
255
|
);
|
|
256
256
|
DialogFooter.displayName = "DialogFooter";
|
|
257
|
-
var DialogTitle =
|
|
257
|
+
var DialogTitle = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
258
258
|
DialogPrimitive__namespace.Title,
|
|
259
259
|
{
|
|
260
260
|
ref,
|
|
261
|
-
className:
|
|
261
|
+
className: chunkD2BLWOWK_js.cn(
|
|
262
262
|
"text-lg font-semibold leading-none tracking-tight text-gray-900 dark:text-gray-100",
|
|
263
263
|
className
|
|
264
264
|
),
|
|
@@ -266,11 +266,11 @@ var DialogTitle = React10__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
266
266
|
}
|
|
267
267
|
));
|
|
268
268
|
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
269
|
-
var DialogDescription =
|
|
269
|
+
var DialogDescription = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
270
270
|
DialogPrimitive__namespace.Description,
|
|
271
271
|
{
|
|
272
272
|
ref,
|
|
273
|
-
className:
|
|
273
|
+
className: chunkD2BLWOWK_js.cn("text-sm text-gray-500 dark:text-gray-400", className),
|
|
274
274
|
...props
|
|
275
275
|
}
|
|
276
276
|
));
|
|
@@ -281,11 +281,11 @@ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
|
281
281
|
var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
282
282
|
var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
283
283
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
284
|
-
var DropdownMenuSubTrigger =
|
|
284
|
+
var DropdownMenuSubTrigger = React11__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
285
285
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
286
286
|
{
|
|
287
287
|
ref,
|
|
288
|
-
className:
|
|
288
|
+
className: chunkD2BLWOWK_js.cn(
|
|
289
289
|
"flex cursor-default select-none items-center gap-2 rounded-hz-sm px-2 py-1.5 text-sm outline-none focus:bg-gray-100 data-[state=open]:bg-gray-100 dark:focus:bg-gray-700 dark:data-[state=open]:bg-gray-700 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
290
290
|
inset && "pl-8",
|
|
291
291
|
className
|
|
@@ -298,11 +298,11 @@ var DropdownMenuSubTrigger = React10__namespace.forwardRef(({ className, inset,
|
|
|
298
298
|
}
|
|
299
299
|
));
|
|
300
300
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
|
|
301
|
-
var DropdownMenuSubContent =
|
|
301
|
+
var DropdownMenuSubContent = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
302
302
|
DropdownMenuPrimitive__namespace.SubContent,
|
|
303
303
|
{
|
|
304
304
|
ref,
|
|
305
|
-
className:
|
|
305
|
+
className: chunkD2BLWOWK_js.cn(
|
|
306
306
|
"z-50 min-w-[8rem] overflow-hidden rounded-hz-md border border-gray-200 bg-white p-1 text-gray-900 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin] dark:border-neutral-700 dark:bg-neutral-800 dark:text-gray-100",
|
|
307
307
|
className
|
|
308
308
|
),
|
|
@@ -310,12 +310,12 @@ var DropdownMenuSubContent = React10__namespace.forwardRef(({ className, ...prop
|
|
|
310
310
|
}
|
|
311
311
|
));
|
|
312
312
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
|
|
313
|
-
var DropdownMenuContent =
|
|
313
|
+
var DropdownMenuContent = React11__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
314
314
|
DropdownMenuPrimitive__namespace.Content,
|
|
315
315
|
{
|
|
316
316
|
ref,
|
|
317
317
|
sideOffset,
|
|
318
|
-
className:
|
|
318
|
+
className: chunkD2BLWOWK_js.cn(
|
|
319
319
|
"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-hz-md border border-gray-200 bg-white p-1 text-gray-900 shadow-md dark:border-neutral-700 dark:bg-neutral-800 dark:text-gray-100",
|
|
320
320
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
321
321
|
className
|
|
@@ -324,11 +324,11 @@ var DropdownMenuContent = React10__namespace.forwardRef(({ className, sideOffset
|
|
|
324
324
|
}
|
|
325
325
|
) }));
|
|
326
326
|
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
327
|
-
var DropdownMenuItem =
|
|
327
|
+
var DropdownMenuItem = React11__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
328
328
|
DropdownMenuPrimitive__namespace.Item,
|
|
329
329
|
{
|
|
330
330
|
ref,
|
|
331
|
-
className:
|
|
331
|
+
className: chunkD2BLWOWK_js.cn(
|
|
332
332
|
"relative flex cursor-default select-none items-center gap-2 rounded-hz-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-700 dark:focus:text-gray-100 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
333
333
|
inset && "pl-8",
|
|
334
334
|
className
|
|
@@ -337,11 +337,11 @@ var DropdownMenuItem = React10__namespace.forwardRef(({ className, inset, ...pro
|
|
|
337
337
|
}
|
|
338
338
|
));
|
|
339
339
|
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
340
|
-
var DropdownMenuCheckboxItem =
|
|
340
|
+
var DropdownMenuCheckboxItem = React11__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
341
341
|
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
342
342
|
{
|
|
343
343
|
ref,
|
|
344
|
-
className:
|
|
344
|
+
className: chunkD2BLWOWK_js.cn(
|
|
345
345
|
"relative flex cursor-default select-none items-center rounded-hz-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-700 dark:focus:text-gray-100",
|
|
346
346
|
className
|
|
347
347
|
),
|
|
@@ -354,11 +354,11 @@ var DropdownMenuCheckboxItem = React10__namespace.forwardRef(({ className, child
|
|
|
354
354
|
}
|
|
355
355
|
));
|
|
356
356
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
357
|
-
var DropdownMenuRadioItem =
|
|
357
|
+
var DropdownMenuRadioItem = React11__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
358
358
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
359
359
|
{
|
|
360
360
|
ref,
|
|
361
|
-
className:
|
|
361
|
+
className: chunkD2BLWOWK_js.cn(
|
|
362
362
|
"relative flex cursor-default select-none items-center rounded-hz-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-gray-700 dark:focus:text-gray-100",
|
|
363
363
|
className
|
|
364
364
|
),
|
|
@@ -370,11 +370,11 @@ var DropdownMenuRadioItem = React10__namespace.forwardRef(({ className, children
|
|
|
370
370
|
}
|
|
371
371
|
));
|
|
372
372
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
|
|
373
|
-
var DropdownMenuLabel =
|
|
373
|
+
var DropdownMenuLabel = React11__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
374
374
|
DropdownMenuPrimitive__namespace.Label,
|
|
375
375
|
{
|
|
376
376
|
ref,
|
|
377
|
-
className:
|
|
377
|
+
className: chunkD2BLWOWK_js.cn(
|
|
378
378
|
"px-2 py-1.5 text-sm font-semibold",
|
|
379
379
|
inset && "pl-8",
|
|
380
380
|
className
|
|
@@ -383,11 +383,11 @@ var DropdownMenuLabel = React10__namespace.forwardRef(({ className, inset, ...pr
|
|
|
383
383
|
}
|
|
384
384
|
));
|
|
385
385
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
386
|
-
var DropdownMenuSeparator =
|
|
386
|
+
var DropdownMenuSeparator = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
387
387
|
DropdownMenuPrimitive__namespace.Separator,
|
|
388
388
|
{
|
|
389
389
|
ref,
|
|
390
|
-
className:
|
|
390
|
+
className: chunkD2BLWOWK_js.cn("-mx-1 my-1 h-px bg-gray-100 dark:bg-neutral-700", className),
|
|
391
391
|
...props
|
|
392
392
|
}
|
|
393
393
|
));
|
|
@@ -399,25 +399,25 @@ var DropdownMenuShortcut = ({
|
|
|
399
399
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
400
400
|
"span",
|
|
401
401
|
{
|
|
402
|
-
className:
|
|
402
|
+
className: chunkD2BLWOWK_js.cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
403
403
|
...props
|
|
404
404
|
}
|
|
405
405
|
);
|
|
406
406
|
};
|
|
407
407
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
408
|
-
var FormContext =
|
|
408
|
+
var FormContext = React11__namespace.createContext(null);
|
|
409
409
|
function useFormContext() {
|
|
410
|
-
const context =
|
|
410
|
+
const context = React11__namespace.useContext(FormContext);
|
|
411
411
|
if (!context) {
|
|
412
412
|
throw new Error("useFormContext must be used within a Form component");
|
|
413
413
|
}
|
|
414
414
|
return context;
|
|
415
415
|
}
|
|
416
|
-
var FormFieldContext =
|
|
416
|
+
var FormFieldContext = React11__namespace.createContext(
|
|
417
417
|
null
|
|
418
418
|
);
|
|
419
419
|
function useFormFieldContext() {
|
|
420
|
-
const context =
|
|
420
|
+
const context = React11__namespace.useContext(FormFieldContext);
|
|
421
421
|
if (!context) {
|
|
422
422
|
throw new Error(
|
|
423
423
|
"useFormFieldContext must be used within a FormField component"
|
|
@@ -425,24 +425,24 @@ function useFormFieldContext() {
|
|
|
425
425
|
}
|
|
426
426
|
return context;
|
|
427
427
|
}
|
|
428
|
-
var Form =
|
|
428
|
+
var Form = React11__namespace.forwardRef(
|
|
429
429
|
({ className, children, onFormSubmit, ...props }, ref) => {
|
|
430
|
-
const [errors, setErrors] =
|
|
431
|
-
const [isSubmitting, setIsSubmitting] =
|
|
432
|
-
const setError =
|
|
430
|
+
const [errors, setErrors] = React11__namespace.useState({});
|
|
431
|
+
const [isSubmitting, setIsSubmitting] = React11__namespace.useState(false);
|
|
432
|
+
const setError = React11__namespace.useCallback(
|
|
433
433
|
(name, message) => {
|
|
434
434
|
setErrors((prev) => ({ ...prev, [name]: message }));
|
|
435
435
|
},
|
|
436
436
|
[]
|
|
437
437
|
);
|
|
438
|
-
const clearError =
|
|
438
|
+
const clearError = React11__namespace.useCallback((name) => {
|
|
439
439
|
setErrors((prev) => {
|
|
440
440
|
const next = { ...prev };
|
|
441
441
|
delete next[name];
|
|
442
442
|
return next;
|
|
443
443
|
});
|
|
444
444
|
}, []);
|
|
445
|
-
const clearAllErrors =
|
|
445
|
+
const clearAllErrors = React11__namespace.useCallback(() => {
|
|
446
446
|
setErrors({});
|
|
447
447
|
}, []);
|
|
448
448
|
const isValid = Object.keys(errors).length === 0;
|
|
@@ -461,7 +461,7 @@ var Form = React10__namespace.forwardRef(
|
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
};
|
|
464
|
-
const contextValue =
|
|
464
|
+
const contextValue = React11__namespace.useMemo(
|
|
465
465
|
() => ({
|
|
466
466
|
errors,
|
|
467
467
|
setError,
|
|
@@ -476,7 +476,7 @@ var Form = React10__namespace.forwardRef(
|
|
|
476
476
|
"form",
|
|
477
477
|
{
|
|
478
478
|
ref,
|
|
479
|
-
className:
|
|
479
|
+
className: chunkD2BLWOWK_js.cn("space-y-6", className),
|
|
480
480
|
onSubmit: handleSubmit,
|
|
481
481
|
...props,
|
|
482
482
|
children
|
|
@@ -485,36 +485,36 @@ var Form = React10__namespace.forwardRef(
|
|
|
485
485
|
}
|
|
486
486
|
);
|
|
487
487
|
Form.displayName = "Form";
|
|
488
|
-
var FormField =
|
|
488
|
+
var FormField = React11__namespace.forwardRef(
|
|
489
489
|
({ className, name, children, ...props }, ref) => {
|
|
490
490
|
const { errors } = useFormContext();
|
|
491
|
-
const id =
|
|
491
|
+
const id = React11__namespace.useId();
|
|
492
492
|
const error = errors[name];
|
|
493
|
-
const contextValue =
|
|
493
|
+
const contextValue = React11__namespace.useMemo(
|
|
494
494
|
() => ({ name, error, id }),
|
|
495
495
|
[name, error, id]
|
|
496
496
|
);
|
|
497
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className:
|
|
497
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: chunkD2BLWOWK_js.cn("space-y-2", className), ...props, children }) });
|
|
498
498
|
}
|
|
499
499
|
);
|
|
500
500
|
FormField.displayName = "FormField";
|
|
501
|
-
var FormLabel =
|
|
501
|
+
var FormLabel = React11__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
502
502
|
const { id, error } = useFormFieldContext();
|
|
503
503
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
504
|
-
|
|
504
|
+
chunkD2BLWOWK_js.Label,
|
|
505
505
|
{
|
|
506
506
|
ref,
|
|
507
507
|
htmlFor: id,
|
|
508
|
-
className:
|
|
508
|
+
className: chunkD2BLWOWK_js.cn(error && "text-rose-500 dark:text-rose-400", className),
|
|
509
509
|
...props
|
|
510
510
|
}
|
|
511
511
|
);
|
|
512
512
|
});
|
|
513
513
|
FormLabel.displayName = "FormLabel";
|
|
514
|
-
var FormControl =
|
|
514
|
+
var FormControl = React11__namespace.forwardRef(
|
|
515
515
|
({ children, ...props }, ref) => {
|
|
516
516
|
const { id, error, name } = useFormFieldContext();
|
|
517
|
-
const child =
|
|
517
|
+
const child = React11__namespace.cloneElement(children, {
|
|
518
518
|
id,
|
|
519
519
|
name,
|
|
520
520
|
"aria-invalid": !!error,
|
|
@@ -525,13 +525,13 @@ var FormControl = React10__namespace.forwardRef(
|
|
|
525
525
|
}
|
|
526
526
|
);
|
|
527
527
|
FormControl.displayName = "FormControl";
|
|
528
|
-
var FormDescription =
|
|
528
|
+
var FormDescription = React11__namespace.forwardRef(
|
|
529
529
|
({ className, ...props }, ref) => {
|
|
530
530
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
531
531
|
"span",
|
|
532
532
|
{
|
|
533
533
|
ref,
|
|
534
|
-
className:
|
|
534
|
+
className: chunkD2BLWOWK_js.cn(
|
|
535
535
|
"block text-sm text-neutral-500 dark:text-neutral-400",
|
|
536
536
|
className
|
|
537
537
|
),
|
|
@@ -541,9 +541,9 @@ var FormDescription = React10__namespace.forwardRef(
|
|
|
541
541
|
}
|
|
542
542
|
);
|
|
543
543
|
FormDescription.displayName = "FormDescription";
|
|
544
|
-
var FormMessage =
|
|
544
|
+
var FormMessage = React11__namespace.forwardRef(
|
|
545
545
|
({ className, children, error: errorProp, ...props }, ref) => {
|
|
546
|
-
const fieldContext =
|
|
546
|
+
const fieldContext = React11__namespace.useContext(FormFieldContext);
|
|
547
547
|
const error = errorProp ?? fieldContext?.error;
|
|
548
548
|
const id = fieldContext?.id;
|
|
549
549
|
if (!error && !children) {
|
|
@@ -554,7 +554,7 @@ var FormMessage = React10__namespace.forwardRef(
|
|
|
554
554
|
{
|
|
555
555
|
ref,
|
|
556
556
|
id: id ? `${id}-error` : void 0,
|
|
557
|
-
className:
|
|
557
|
+
className: chunkD2BLWOWK_js.cn(
|
|
558
558
|
"text-sm font-medium",
|
|
559
559
|
error ? "text-rose-500 dark:text-rose-400" : "text-neutral-600 dark:text-neutral-400",
|
|
560
560
|
className
|
|
@@ -567,14 +567,14 @@ var FormMessage = React10__namespace.forwardRef(
|
|
|
567
567
|
}
|
|
568
568
|
);
|
|
569
569
|
FormMessage.displayName = "FormMessage";
|
|
570
|
-
var PopoverContext =
|
|
570
|
+
var PopoverContext = React11__namespace.createContext({ open: false });
|
|
571
571
|
var Popover = ({
|
|
572
572
|
children,
|
|
573
573
|
open: controlledOpen,
|
|
574
574
|
onOpenChange,
|
|
575
575
|
...props
|
|
576
576
|
}) => {
|
|
577
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
577
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React11__namespace.useState(false);
|
|
578
578
|
const isControlled = controlledOpen !== void 0;
|
|
579
579
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
580
580
|
const handleOpenChange = (newOpen) => {
|
|
@@ -595,8 +595,8 @@ var Popover = ({
|
|
|
595
595
|
};
|
|
596
596
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
597
597
|
var PopoverAnchor = PopoverPrimitive__namespace.Anchor;
|
|
598
|
-
var PopoverContent =
|
|
599
|
-
const { open } =
|
|
598
|
+
var PopoverContent = React11__namespace.forwardRef(({ className, align = "center", sideOffset = 4, children, ...props }, ref) => {
|
|
599
|
+
const { open } = React11__namespace.useContext(PopoverContext);
|
|
600
600
|
const {
|
|
601
601
|
onOpenAutoFocus,
|
|
602
602
|
onCloseAutoFocus,
|
|
@@ -645,7 +645,7 @@ var PopoverContent = React10__namespace.forwardRef(({ className, align = "center
|
|
|
645
645
|
damping: 25,
|
|
646
646
|
mass: 0.8
|
|
647
647
|
},
|
|
648
|
-
className:
|
|
648
|
+
className: chunkD2BLWOWK_js.cn(
|
|
649
649
|
"z-50 w-72 rounded-md border border-white/20 bg-white/80 backdrop-blur-xl p-4 text-gray-900 shadow-lg outline-none dark:border-neutral-700/50 dark:bg-neutral-900/80 dark:text-neutral-100 origin-[--radix-popover-content-transform-origin]",
|
|
650
650
|
className
|
|
651
651
|
),
|
|
@@ -656,15 +656,15 @@ var PopoverContent = React10__namespace.forwardRef(({ className, align = "center
|
|
|
656
656
|
) }) });
|
|
657
657
|
});
|
|
658
658
|
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
659
|
-
var SelectContext =
|
|
660
|
-
var SelectSearchContext =
|
|
659
|
+
var SelectContext = React11__namespace.createContext({ open: false });
|
|
660
|
+
var SelectSearchContext = React11__namespace.createContext("");
|
|
661
661
|
var Select = ({
|
|
662
662
|
children,
|
|
663
663
|
open: controlledOpen,
|
|
664
664
|
onOpenChange,
|
|
665
665
|
...props
|
|
666
666
|
}) => {
|
|
667
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
667
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React11__namespace.useState(false);
|
|
668
668
|
const isControlled = controlledOpen !== void 0;
|
|
669
669
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
670
670
|
const handleOpenChange = (newOpen) => {
|
|
@@ -684,13 +684,13 @@ var Select = ({
|
|
|
684
684
|
) });
|
|
685
685
|
};
|
|
686
686
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
687
|
-
var SelectValue =
|
|
687
|
+
var SelectValue = React11__namespace.forwardRef(({ children, placeholder, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Value, { ref, placeholder, ...props, children }));
|
|
688
688
|
SelectValue.displayName = SelectPrimitive__namespace.Value.displayName;
|
|
689
|
-
var SelectTrigger =
|
|
689
|
+
var SelectTrigger = React11__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
690
690
|
SelectPrimitive__namespace.Trigger,
|
|
691
691
|
{
|
|
692
692
|
ref,
|
|
693
|
-
className:
|
|
693
|
+
className: chunkD2BLWOWK_js.cn(
|
|
694
694
|
"flex h-[52px] w-full items-center justify-between rounded-hz-md border border-gray-300 bg-white px-4 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-600 dark:bg-neutral-800 dark:text-gray-100 dark:placeholder:text-gray-500 [&>span]:line-clamp-1",
|
|
695
695
|
className
|
|
696
696
|
),
|
|
@@ -702,11 +702,11 @@ var SelectTrigger = React10__namespace.forwardRef(({ className, children, ...pro
|
|
|
702
702
|
}
|
|
703
703
|
));
|
|
704
704
|
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
705
|
-
var SelectScrollUpButton =
|
|
705
|
+
var SelectScrollUpButton = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
706
706
|
SelectPrimitive__namespace.ScrollUpButton,
|
|
707
707
|
{
|
|
708
708
|
ref,
|
|
709
|
-
className:
|
|
709
|
+
className: chunkD2BLWOWK_js.cn(
|
|
710
710
|
"flex cursor-default items-center justify-center py-1",
|
|
711
711
|
className
|
|
712
712
|
),
|
|
@@ -715,11 +715,11 @@ var SelectScrollUpButton = React10__namespace.forwardRef(({ className, ...props
|
|
|
715
715
|
}
|
|
716
716
|
));
|
|
717
717
|
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
718
|
-
var SelectScrollDownButton =
|
|
718
|
+
var SelectScrollDownButton = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
719
719
|
SelectPrimitive__namespace.ScrollDownButton,
|
|
720
720
|
{
|
|
721
721
|
ref,
|
|
722
|
-
className:
|
|
722
|
+
className: chunkD2BLWOWK_js.cn(
|
|
723
723
|
"flex cursor-default items-center justify-center py-1",
|
|
724
724
|
className
|
|
725
725
|
),
|
|
@@ -728,11 +728,11 @@ var SelectScrollDownButton = React10__namespace.forwardRef(({ className, ...prop
|
|
|
728
728
|
}
|
|
729
729
|
));
|
|
730
730
|
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
731
|
-
var SelectContent =
|
|
732
|
-
const { open } =
|
|
733
|
-
const [search, setSearch] =
|
|
734
|
-
const searchInputRef =
|
|
735
|
-
|
|
731
|
+
var SelectContent = React11__namespace.forwardRef(({ className, children, position = "popper", searchable = false, searchPlaceholder = "Search...", ...props }, ref) => {
|
|
732
|
+
const { open } = React11__namespace.useContext(SelectContext);
|
|
733
|
+
const [search, setSearch] = React11__namespace.useState("");
|
|
734
|
+
const searchInputRef = React11__namespace.useRef(null);
|
|
735
|
+
React11__namespace.useEffect(() => {
|
|
736
736
|
if (open && searchable) {
|
|
737
737
|
const frame = requestAnimationFrame(() => {
|
|
738
738
|
searchInputRef.current?.focus();
|
|
@@ -758,7 +758,7 @@ var SelectContent = React10__namespace.forwardRef(({ className, children, positi
|
|
|
758
758
|
} = props;
|
|
759
759
|
const ForceMountPortal = SelectPrimitive__namespace.Portal;
|
|
760
760
|
const ForceMountContent = SelectPrimitive__namespace.Content;
|
|
761
|
-
const AnimatedContent =
|
|
761
|
+
const AnimatedContent = React11__namespace.useMemo(() => React11__namespace.forwardRef(({ forceMount: _, ...props2 }, ref2) => /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.div, { ref: ref2, ...props2 })), []);
|
|
762
762
|
return /* @__PURE__ */ jsxRuntime.jsx(ForceMountPortal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
763
763
|
ForceMountContent,
|
|
764
764
|
{
|
|
@@ -790,7 +790,7 @@ var SelectContent = React10__namespace.forwardRef(({ className, children, positi
|
|
|
790
790
|
damping: 25,
|
|
791
791
|
mass: 0.8
|
|
792
792
|
},
|
|
793
|
-
className:
|
|
793
|
+
className: chunkD2BLWOWK_js.cn(
|
|
794
794
|
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-hz-lg border border-white/20 bg-white/80 backdrop-blur-xl text-gray-900 shadow-lg dark:border-neutral-700/50 dark:bg-neutral-900/80 dark:text-gray-100 origin-[--radix-select-content-transform-origin]",
|
|
795
795
|
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
796
796
|
className
|
|
@@ -815,7 +815,7 @@ var SelectContent = React10__namespace.forwardRef(({ className, children, positi
|
|
|
815
815
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
816
816
|
SelectPrimitive__namespace.Viewport,
|
|
817
817
|
{
|
|
818
|
-
className:
|
|
818
|
+
className: chunkD2BLWOWK_js.cn(
|
|
819
819
|
"p-1",
|
|
820
820
|
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
821
821
|
),
|
|
@@ -831,17 +831,17 @@ var SelectContent = React10__namespace.forwardRef(({ className, children, positi
|
|
|
831
831
|
) });
|
|
832
832
|
});
|
|
833
833
|
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
834
|
-
var SelectLabel =
|
|
834
|
+
var SelectLabel = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
835
835
|
SelectPrimitive__namespace.Label,
|
|
836
836
|
{
|
|
837
837
|
ref,
|
|
838
|
-
className:
|
|
838
|
+
className: chunkD2BLWOWK_js.cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
839
839
|
...props
|
|
840
840
|
}
|
|
841
841
|
));
|
|
842
842
|
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
843
|
-
var SelectItem =
|
|
844
|
-
const search =
|
|
843
|
+
var SelectItem = React11__namespace.forwardRef(({ className, children, textValue, ...props }, ref) => {
|
|
844
|
+
const search = React11__namespace.useContext(SelectSearchContext);
|
|
845
845
|
const itemText = textValue ?? (typeof children === "string" ? children : "");
|
|
846
846
|
if (search && itemText && !itemText.toLowerCase().includes(search.toLowerCase())) {
|
|
847
847
|
return null;
|
|
@@ -851,7 +851,7 @@ var SelectItem = React10__namespace.forwardRef(({ className, children, textValue
|
|
|
851
851
|
{
|
|
852
852
|
ref,
|
|
853
853
|
textValue,
|
|
854
|
-
className:
|
|
854
|
+
className: chunkD2BLWOWK_js.cn(
|
|
855
855
|
"relative flex w-full cursor-default select-none items-center rounded-hz-md py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-black/5 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-white/10 dark:focus:text-gray-100 transition-colors",
|
|
856
856
|
className
|
|
857
857
|
),
|
|
@@ -864,15 +864,316 @@ var SelectItem = React10__namespace.forwardRef(({ className, children, textValue
|
|
|
864
864
|
);
|
|
865
865
|
});
|
|
866
866
|
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
867
|
-
var SelectSeparator =
|
|
867
|
+
var SelectSeparator = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
868
868
|
SelectPrimitive__namespace.Separator,
|
|
869
869
|
{
|
|
870
870
|
ref,
|
|
871
|
-
className:
|
|
871
|
+
className: chunkD2BLWOWK_js.cn("-mx-1 my-1 h-px bg-gray-200/50 dark:bg-neutral-700/50", className),
|
|
872
872
|
...props
|
|
873
873
|
}
|
|
874
874
|
));
|
|
875
875
|
SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
|
|
876
|
+
var SelectBar = React11__namespace.forwardRef(({
|
|
877
|
+
options,
|
|
878
|
+
value,
|
|
879
|
+
onChange,
|
|
880
|
+
multiple = false,
|
|
881
|
+
multiValue,
|
|
882
|
+
onMultiChange,
|
|
883
|
+
manualApply = false,
|
|
884
|
+
searchable = false,
|
|
885
|
+
searchPlaceholder = "Search...",
|
|
886
|
+
placeholder = "Select\u2026",
|
|
887
|
+
label,
|
|
888
|
+
disabled = false,
|
|
889
|
+
className,
|
|
890
|
+
maxVisibleChips = 2
|
|
891
|
+
}, ref) => {
|
|
892
|
+
const [open, setOpen] = React11__namespace.useState(false);
|
|
893
|
+
const [search, setSearch] = React11__namespace.useState("");
|
|
894
|
+
const searchRef = React11__namespace.useRef(null);
|
|
895
|
+
const [internalValue, setInternalValue] = React11__namespace.useState(
|
|
896
|
+
void 0
|
|
897
|
+
);
|
|
898
|
+
const [internalMultiValue, setInternalMultiValue] = React11__namespace.useState(
|
|
899
|
+
[]
|
|
900
|
+
);
|
|
901
|
+
const [draftValue, setDraftValue] = React11__namespace.useState(
|
|
902
|
+
void 0
|
|
903
|
+
);
|
|
904
|
+
const [draftMultiValue, setDraftMultiValue] = React11__namespace.useState([]);
|
|
905
|
+
const committedSingle = value !== void 0 ? value : internalValue;
|
|
906
|
+
const committedMulti = multiValue !== void 0 ? multiValue : internalMultiValue;
|
|
907
|
+
const activeSingle = manualApply ? draftValue : committedSingle;
|
|
908
|
+
const activeMulti = manualApply ? draftMultiValue : committedMulti;
|
|
909
|
+
const commitSingle = React11__namespace.useCallback(
|
|
910
|
+
(v) => {
|
|
911
|
+
if (value === void 0) setInternalValue(v);
|
|
912
|
+
onChange?.(v);
|
|
913
|
+
},
|
|
914
|
+
[value, onChange]
|
|
915
|
+
);
|
|
916
|
+
const commitMulti = React11__namespace.useCallback(
|
|
917
|
+
(v) => {
|
|
918
|
+
if (multiValue === void 0) setInternalMultiValue(v);
|
|
919
|
+
onMultiChange?.(v);
|
|
920
|
+
},
|
|
921
|
+
[multiValue, onMultiChange]
|
|
922
|
+
);
|
|
923
|
+
const handleOpenChange = (newOpen) => {
|
|
924
|
+
if (newOpen) {
|
|
925
|
+
setDraftValue(committedSingle);
|
|
926
|
+
setDraftMultiValue(committedMulti);
|
|
927
|
+
setSearch("");
|
|
928
|
+
if (searchable) {
|
|
929
|
+
requestAnimationFrame(() => searchRef.current?.focus());
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
setOpen(newOpen);
|
|
933
|
+
};
|
|
934
|
+
const filtered = React11__namespace.useMemo(
|
|
935
|
+
() => search ? options.filter(
|
|
936
|
+
(o) => o.label.toLowerCase().includes(search.toLowerCase())
|
|
937
|
+
) : options,
|
|
938
|
+
[options, search]
|
|
939
|
+
);
|
|
940
|
+
const handleSingleSelect = (optionValue) => {
|
|
941
|
+
if (manualApply) {
|
|
942
|
+
setDraftValue(optionValue);
|
|
943
|
+
} else {
|
|
944
|
+
commitSingle(optionValue);
|
|
945
|
+
setOpen(false);
|
|
946
|
+
}
|
|
947
|
+
};
|
|
948
|
+
const handleMultiToggle = (optionValue) => {
|
|
949
|
+
const current = manualApply ? draftMultiValue : committedMulti;
|
|
950
|
+
const next = current.includes(optionValue) ? current.filter((v) => v !== optionValue) : [...current, optionValue];
|
|
951
|
+
if (manualApply) {
|
|
952
|
+
setDraftMultiValue(next);
|
|
953
|
+
} else {
|
|
954
|
+
commitMulti(next);
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
const handleApply = () => {
|
|
958
|
+
if (multiple) {
|
|
959
|
+
commitMulti(draftMultiValue);
|
|
960
|
+
} else {
|
|
961
|
+
commitSingle(draftValue);
|
|
962
|
+
}
|
|
963
|
+
setOpen(false);
|
|
964
|
+
};
|
|
965
|
+
const handleClear = () => {
|
|
966
|
+
if (manualApply) {
|
|
967
|
+
if (multiple) {
|
|
968
|
+
setDraftMultiValue([]);
|
|
969
|
+
} else {
|
|
970
|
+
setDraftValue(void 0);
|
|
971
|
+
}
|
|
972
|
+
} else {
|
|
973
|
+
if (multiple) {
|
|
974
|
+
commitMulti([]);
|
|
975
|
+
} else {
|
|
976
|
+
commitSingle(void 0);
|
|
977
|
+
}
|
|
978
|
+
setOpen(false);
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
const handleChipRemove = (e, chipValue) => {
|
|
982
|
+
e.stopPropagation();
|
|
983
|
+
const next = committedMulti.filter((v) => v !== chipValue);
|
|
984
|
+
commitMulti(next);
|
|
985
|
+
};
|
|
986
|
+
const canApply = (() => {
|
|
987
|
+
if (!manualApply) return false;
|
|
988
|
+
if (multiple) {
|
|
989
|
+
const a = [...draftMultiValue].sort();
|
|
990
|
+
const b = [...committedMulti].sort();
|
|
991
|
+
return JSON.stringify(a) !== JSON.stringify(b);
|
|
992
|
+
}
|
|
993
|
+
return draftValue !== committedSingle;
|
|
994
|
+
})();
|
|
995
|
+
const canClear = (() => {
|
|
996
|
+
if (manualApply) {
|
|
997
|
+
return multiple ? draftMultiValue.length > 0 : draftValue !== void 0;
|
|
998
|
+
}
|
|
999
|
+
return multiple ? committedMulti.length > 0 : committedSingle !== void 0;
|
|
1000
|
+
})();
|
|
1001
|
+
const labelFor = (v) => options.find((o) => o.value === v)?.label ?? v;
|
|
1002
|
+
const renderTriggerContent = () => {
|
|
1003
|
+
if (multiple) {
|
|
1004
|
+
if (committedMulti.length === 0) {
|
|
1005
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400 dark:text-gray-500 truncate", children: placeholder });
|
|
1006
|
+
}
|
|
1007
|
+
const visible = committedMulti.slice(0, maxVisibleChips);
|
|
1008
|
+
const overflow = committedMulti.length - maxVisibleChips;
|
|
1009
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1 min-w-0 flex-wrap", children: [
|
|
1010
|
+
visible.map((v) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1011
|
+
"span",
|
|
1012
|
+
{
|
|
1013
|
+
className: "inline-flex items-center gap-1 bg-blue-50 text-blue-700 border border-blue-200 dark:bg-blue-950/50 dark:text-blue-400 dark:border-blue-800/50 rounded-md px-2 py-0.5 text-xs font-medium max-w-[120px]",
|
|
1014
|
+
children: [
|
|
1015
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: labelFor(v) }),
|
|
1016
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1017
|
+
"button",
|
|
1018
|
+
{
|
|
1019
|
+
type: "button",
|
|
1020
|
+
className: "shrink-0 hover:text-blue-900 dark:hover:text-blue-200",
|
|
1021
|
+
onClick: (e) => handleChipRemove(e, v),
|
|
1022
|
+
"aria-label": `Remove ${labelFor(v)}`,
|
|
1023
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3" })
|
|
1024
|
+
}
|
|
1025
|
+
)
|
|
1026
|
+
]
|
|
1027
|
+
},
|
|
1028
|
+
v
|
|
1029
|
+
)),
|
|
1030
|
+
overflow > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center bg-blue-50 text-blue-700 border border-blue-200 dark:bg-blue-950/50 dark:text-blue-400 dark:border-blue-800/50 rounded-md px-2 py-0.5 text-xs font-medium", children: [
|
|
1031
|
+
"+",
|
|
1032
|
+
overflow,
|
|
1033
|
+
" more"
|
|
1034
|
+
] })
|
|
1035
|
+
] });
|
|
1036
|
+
}
|
|
1037
|
+
if (committedSingle !== void 0) {
|
|
1038
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-gray-900 dark:text-gray-100", children: labelFor(committedSingle) });
|
|
1039
|
+
}
|
|
1040
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400 dark:text-gray-500 truncate", children: placeholder });
|
|
1041
|
+
};
|
|
1042
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkD2BLWOWK_js.cn("space-y-1.5", className), children: [
|
|
1043
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(chunkD2BLWOWK_js.Label, { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: label }),
|
|
1044
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
1045
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1046
|
+
"button",
|
|
1047
|
+
{
|
|
1048
|
+
ref,
|
|
1049
|
+
type: "button",
|
|
1050
|
+
disabled,
|
|
1051
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1052
|
+
"flex h-[42px] min-h-[42px] w-full items-center justify-between gap-2 rounded-hz-md border border-gray-300 bg-white px-3 text-sm shadow-sm transition-colors",
|
|
1053
|
+
"hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
1054
|
+
"dark:border-neutral-600 dark:bg-neutral-800 dark:hover:bg-neutral-700",
|
|
1055
|
+
"disabled:pointer-events-none disabled:opacity-50"
|
|
1056
|
+
),
|
|
1057
|
+
children: [
|
|
1058
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 min-w-0 flex items-center", children: renderTriggerContent() }),
|
|
1059
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
1060
|
+
]
|
|
1061
|
+
}
|
|
1062
|
+
) }),
|
|
1063
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1064
|
+
PopoverContent,
|
|
1065
|
+
{
|
|
1066
|
+
align: "start",
|
|
1067
|
+
className: "w-[var(--radix-popover-trigger-width)] min-w-[200px] p-0 overflow-hidden",
|
|
1068
|
+
children: [
|
|
1069
|
+
searchable && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center border-b border-neutral-200/50 dark:border-neutral-700/50", children: [
|
|
1070
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-6 w-6 shrink-0 opacity-50 pl-2" }),
|
|
1071
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1072
|
+
"input",
|
|
1073
|
+
{
|
|
1074
|
+
ref: searchRef,
|
|
1075
|
+
value: search,
|
|
1076
|
+
onChange: (e) => setSearch(e.target.value),
|
|
1077
|
+
placeholder: searchPlaceholder,
|
|
1078
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
1079
|
+
className: "flex h-10 w-full py-2 bg-transparent text-sm placeholder:text-neutral-400 dark:placeholder:text-neutral-500 px-2 focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-none"
|
|
1080
|
+
}
|
|
1081
|
+
)
|
|
1082
|
+
] }),
|
|
1083
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-1 max-h-[240px] overflow-y-auto", children: filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 py-4 text-center text-sm text-gray-400 dark:text-gray-500", children: "No results found." }) : filtered.map((option) => {
|
|
1084
|
+
if (multiple) {
|
|
1085
|
+
const checked = activeMulti.includes(option.value);
|
|
1086
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1087
|
+
"button",
|
|
1088
|
+
{
|
|
1089
|
+
type: "button",
|
|
1090
|
+
disabled: option.disabled,
|
|
1091
|
+
onClick: () => handleMultiToggle(option.value),
|
|
1092
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1093
|
+
"relative flex w-full cursor-default select-none items-center gap-2 rounded-hz-md py-1.5 px-2 text-sm outline-none transition-colors",
|
|
1094
|
+
"hover:bg-black/5 dark:hover:bg-white/10",
|
|
1095
|
+
option.disabled && "pointer-events-none opacity-50"
|
|
1096
|
+
),
|
|
1097
|
+
children: [
|
|
1098
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1099
|
+
CheckboxPrimitive__namespace.Root,
|
|
1100
|
+
{
|
|
1101
|
+
checked,
|
|
1102
|
+
tabIndex: -1,
|
|
1103
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1104
|
+
"peer h-4 w-4 shrink-0 rounded-hz-sm border border-gray-300 bg-transparent shadow focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-600 data-[state=checked]:text-white dark:border-neutral-600 dark:data-[state=checked]:bg-blue-600"
|
|
1105
|
+
),
|
|
1106
|
+
style: { pointerEvents: "none" },
|
|
1107
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxPrimitive__namespace.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1108
|
+
lucideReact.Check,
|
|
1109
|
+
{
|
|
1110
|
+
className: "h-3.5 w-3.5",
|
|
1111
|
+
strokeWidth: 3
|
|
1112
|
+
}
|
|
1113
|
+
) })
|
|
1114
|
+
}
|
|
1115
|
+
),
|
|
1116
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: option.label })
|
|
1117
|
+
]
|
|
1118
|
+
},
|
|
1119
|
+
option.value
|
|
1120
|
+
);
|
|
1121
|
+
}
|
|
1122
|
+
const selected = activeSingle === option.value;
|
|
1123
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1124
|
+
"button",
|
|
1125
|
+
{
|
|
1126
|
+
type: "button",
|
|
1127
|
+
disabled: option.disabled,
|
|
1128
|
+
onClick: () => handleSingleSelect(option.value),
|
|
1129
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1130
|
+
"relative flex w-full cursor-default select-none items-center rounded-hz-md py-1.5 pl-2 pr-8 text-sm outline-none transition-colors",
|
|
1131
|
+
"hover:bg-black/5 dark:hover:bg-white/10",
|
|
1132
|
+
option.disabled && "pointer-events-none opacity-50"
|
|
1133
|
+
),
|
|
1134
|
+
children: [
|
|
1135
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: option.label }),
|
|
1136
|
+
selected && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) })
|
|
1137
|
+
]
|
|
1138
|
+
},
|
|
1139
|
+
option.value
|
|
1140
|
+
);
|
|
1141
|
+
}) }),
|
|
1142
|
+
manualApply && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-2 px-2 py-3 border-t border-gray-100 dark:border-neutral-700", children: [
|
|
1143
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1144
|
+
"button",
|
|
1145
|
+
{
|
|
1146
|
+
type: "button",
|
|
1147
|
+
onClick: handleClear,
|
|
1148
|
+
disabled: !canClear,
|
|
1149
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1150
|
+
"px-3 py-1.5 rounded-md text-sm transition-colors",
|
|
1151
|
+
canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
|
|
1152
|
+
),
|
|
1153
|
+
children: "Clear"
|
|
1154
|
+
}
|
|
1155
|
+
),
|
|
1156
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1157
|
+
"button",
|
|
1158
|
+
{
|
|
1159
|
+
type: "button",
|
|
1160
|
+
onClick: handleApply,
|
|
1161
|
+
disabled: !canApply,
|
|
1162
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1163
|
+
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors",
|
|
1164
|
+
canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
|
|
1165
|
+
),
|
|
1166
|
+
children: "Apply"
|
|
1167
|
+
}
|
|
1168
|
+
)
|
|
1169
|
+
] })
|
|
1170
|
+
]
|
|
1171
|
+
}
|
|
1172
|
+
)
|
|
1173
|
+
] })
|
|
1174
|
+
] });
|
|
1175
|
+
});
|
|
1176
|
+
SelectBar.displayName = "SelectBar";
|
|
876
1177
|
var separatorVariants = classVarianceAuthority.cva("shrink-0 bg-gray-200 dark:bg-neutral-700", {
|
|
877
1178
|
variants: {
|
|
878
1179
|
orientation: {
|
|
@@ -895,7 +1196,7 @@ function Separator3({
|
|
|
895
1196
|
{
|
|
896
1197
|
role: decorative ? "none" : "separator",
|
|
897
1198
|
"aria-orientation": decorative ? void 0 : orientation ?? void 0,
|
|
898
|
-
className:
|
|
1199
|
+
className: chunkD2BLWOWK_js.cn(separatorVariants({ orientation }), className),
|
|
899
1200
|
...props
|
|
900
1201
|
}
|
|
901
1202
|
);
|
|
@@ -904,7 +1205,7 @@ function Skeleton({ className }) {
|
|
|
904
1205
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
905
1206
|
"div",
|
|
906
1207
|
{
|
|
907
|
-
className:
|
|
1208
|
+
className: chunkD2BLWOWK_js.cn(
|
|
908
1209
|
"animate-pulse rounded-hz-md bg-neutral-200 dark:bg-neutral-800",
|
|
909
1210
|
className
|
|
910
1211
|
)
|
|
@@ -912,28 +1213,28 @@ function Skeleton({ className }) {
|
|
|
912
1213
|
);
|
|
913
1214
|
}
|
|
914
1215
|
function SkeletonText({ className }) {
|
|
915
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className:
|
|
1216
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: chunkD2BLWOWK_js.cn("h-4", className) });
|
|
916
1217
|
}
|
|
917
1218
|
function SkeletonTitle({ className }) {
|
|
918
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className:
|
|
1219
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: chunkD2BLWOWK_js.cn("h-6 w-48", className) });
|
|
919
1220
|
}
|
|
920
1221
|
function SkeletonSubtitle({ className }) {
|
|
921
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className:
|
|
1222
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: chunkD2BLWOWK_js.cn("h-3 w-64", className) });
|
|
922
1223
|
}
|
|
923
1224
|
function SkeletonAvatar({ className }) {
|
|
924
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className:
|
|
1225
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: chunkD2BLWOWK_js.cn("w-10 h-10 rounded", className) });
|
|
925
1226
|
}
|
|
926
1227
|
function SkeletonBadge({ className }) {
|
|
927
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className:
|
|
1228
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: chunkD2BLWOWK_js.cn("h-6 w-24", className) });
|
|
928
1229
|
}
|
|
929
1230
|
function SkeletonIcon({ className }) {
|
|
930
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className:
|
|
1231
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: chunkD2BLWOWK_js.cn("w-6 h-6 rounded", className) });
|
|
931
1232
|
}
|
|
932
1233
|
function SkeletonButton({ className }) {
|
|
933
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className:
|
|
1234
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: chunkD2BLWOWK_js.cn("h-10 w-24 rounded-hz-md", className) });
|
|
934
1235
|
}
|
|
935
1236
|
function SkeletonInput({ className }) {
|
|
936
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className:
|
|
1237
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: chunkD2BLWOWK_js.cn("h-10 w-full rounded-hz-md", className) });
|
|
937
1238
|
}
|
|
938
1239
|
function SkeletonTableRow({
|
|
939
1240
|
columns = 4,
|
|
@@ -951,7 +1252,7 @@ function SkeletonCard({ className }) {
|
|
|
951
1252
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
952
1253
|
"div",
|
|
953
1254
|
{
|
|
954
|
-
className:
|
|
1255
|
+
className: chunkD2BLWOWK_js.cn(
|
|
955
1256
|
"rounded-hz-lg border bg-card p-6 space-y-4",
|
|
956
1257
|
className
|
|
957
1258
|
),
|
|
@@ -1025,7 +1326,7 @@ function SegmentedControl({
|
|
|
1025
1326
|
{
|
|
1026
1327
|
...props,
|
|
1027
1328
|
...value !== void 0 ? { value, onValueChange: onChange } : {},
|
|
1028
|
-
className:
|
|
1329
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1029
1330
|
segmentedControlVariants({ size }),
|
|
1030
1331
|
containerRadiusClass[radius],
|
|
1031
1332
|
className
|
|
@@ -1035,7 +1336,7 @@ function SegmentedControl({
|
|
|
1035
1336
|
{
|
|
1036
1337
|
value: option.value,
|
|
1037
1338
|
disabled: option.disabled,
|
|
1038
|
-
className:
|
|
1339
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1039
1340
|
segmentedControlItemVariants({ size }),
|
|
1040
1341
|
itemRadiusClass[radius],
|
|
1041
1342
|
"border border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",
|
|
@@ -1053,8 +1354,8 @@ function SegmentedControl({
|
|
|
1053
1354
|
);
|
|
1054
1355
|
}
|
|
1055
1356
|
function BulkEditPopover({ column, onApply }) {
|
|
1056
|
-
const [value, setValue] =
|
|
1057
|
-
const [open, setOpen] =
|
|
1357
|
+
const [value, setValue] = React11__namespace.useState("");
|
|
1358
|
+
const [open, setOpen] = React11__namespace.useState(false);
|
|
1058
1359
|
const { bulkEdit } = column;
|
|
1059
1360
|
if (!bulkEdit) return null;
|
|
1060
1361
|
const isValid = bulkEdit.kind === "input" ? !!value.trim() : !!value;
|
|
@@ -1072,7 +1373,7 @@ function BulkEditPopover({ column, onApply }) {
|
|
|
1072
1373
|
}
|
|
1073
1374
|
if (!next) setValue("");
|
|
1074
1375
|
};
|
|
1075
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1376
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkD2BLWOWK_js.Tooltip, { content: `Apply to all ${headingLabel}`, side: "top", disabled: open, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
1076
1377
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1077
1378
|
"button",
|
|
1078
1379
|
{
|
|
@@ -1083,7 +1384,7 @@ function BulkEditPopover({ column, onApply }) {
|
|
|
1083
1384
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PenLine, { className: "h-3.5 w-3.5" })
|
|
1084
1385
|
}
|
|
1085
1386
|
) }),
|
|
1086
|
-
/* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { align: "start", className:
|
|
1387
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { align: "start", className: chunkD2BLWOWK_js.cn("p-3 space-y-3", bulkEdit.kind === "segmented-control" ? "w-auto" : "w-64"), children: [
|
|
1087
1388
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide", children: [
|
|
1088
1389
|
"Apply to all \u2014 ",
|
|
1089
1390
|
headingLabel
|
|
@@ -1104,7 +1405,7 @@ function BulkEditPopover({ column, onApply }) {
|
|
|
1104
1405
|
}
|
|
1105
1406
|
},
|
|
1106
1407
|
autoFocus: true,
|
|
1107
|
-
className:
|
|
1408
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1108
1409
|
"w-full rounded-hz-md border border-gray-300 bg-white py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-500/50 dark:border-neutral-600 dark:bg-neutral-800 dark:text-gray-100 dark:placeholder:text-gray-500",
|
|
1109
1410
|
bulkEdit.leadingDecorator ? "pl-7 pr-3" : "px-3"
|
|
1110
1411
|
)
|
|
@@ -1128,12 +1429,12 @@ function BulkEditPopover({ column, onApply }) {
|
|
|
1128
1429
|
] })
|
|
1129
1430
|
] }) }) });
|
|
1130
1431
|
}
|
|
1131
|
-
var TableContext =
|
|
1432
|
+
var TableContext = React11__namespace.createContext(null);
|
|
1132
1433
|
var useTableContext = () => {
|
|
1133
|
-
const context =
|
|
1434
|
+
const context = React11__namespace.useContext(TableContext);
|
|
1134
1435
|
return context;
|
|
1135
1436
|
};
|
|
1136
|
-
var TableInner =
|
|
1437
|
+
var TableInner = React11__namespace.forwardRef(
|
|
1137
1438
|
({
|
|
1138
1439
|
className,
|
|
1139
1440
|
selectionMode = "multiple",
|
|
@@ -1159,23 +1460,23 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1159
1460
|
}, ref) => {
|
|
1160
1461
|
const effectiveActionColumns = actionColumns ?? [];
|
|
1161
1462
|
const effectiveSelectable = effectiveActionColumns.includes("checkbox");
|
|
1162
|
-
const [internalSelectedRows, setInternalSelectedRows] =
|
|
1163
|
-
const [registeredRowIds, setRegisteredRowIds] =
|
|
1164
|
-
const wrapperRef =
|
|
1463
|
+
const [internalSelectedRows, setInternalSelectedRows] = React11__namespace.useState(/* @__PURE__ */ new Set());
|
|
1464
|
+
const [registeredRowIds, setRegisteredRowIds] = React11__namespace.useState(/* @__PURE__ */ new Set());
|
|
1465
|
+
const wrapperRef = React11__namespace.useRef(null);
|
|
1165
1466
|
const isControlled = controlledSelectedRows !== void 0;
|
|
1166
1467
|
const selectedRowsSet = isControlled ? new Set(controlledSelectedRows) : internalSelectedRows;
|
|
1167
|
-
const defaultGetRowId =
|
|
1468
|
+
const defaultGetRowId = React11__namespace.useCallback((row) => {
|
|
1168
1469
|
if (typeof row === "string") return row;
|
|
1169
1470
|
if (typeof row === "object" && row?.id) return String(row.id);
|
|
1170
1471
|
return String(row);
|
|
1171
1472
|
}, []);
|
|
1172
1473
|
const finalGetRowId = getRowId || defaultGetRowId;
|
|
1173
|
-
const allRowIds =
|
|
1474
|
+
const allRowIds = React11__namespace.useMemo(() => {
|
|
1174
1475
|
if (rows) return new Set(rows.map(finalGetRowId));
|
|
1175
1476
|
if (data) return new Set(data.map(finalGetRowId));
|
|
1176
1477
|
return registeredRowIds;
|
|
1177
1478
|
}, [rows, data, finalGetRowId, registeredRowIds]);
|
|
1178
|
-
const registerRowId =
|
|
1479
|
+
const registerRowId = React11__namespace.useCallback((rowId) => {
|
|
1179
1480
|
if (rowId) {
|
|
1180
1481
|
setRegisteredRowIds((prev) => {
|
|
1181
1482
|
if (prev.has(rowId)) return prev;
|
|
@@ -1183,7 +1484,7 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1183
1484
|
});
|
|
1184
1485
|
}
|
|
1185
1486
|
}, []);
|
|
1186
|
-
const unregisterRowId =
|
|
1487
|
+
const unregisterRowId = React11__namespace.useCallback((rowId) => {
|
|
1187
1488
|
if (rowId) {
|
|
1188
1489
|
setRegisteredRowIds((prev) => {
|
|
1189
1490
|
if (!prev.has(rowId)) return prev;
|
|
@@ -1193,7 +1494,7 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1193
1494
|
});
|
|
1194
1495
|
}
|
|
1195
1496
|
}, []);
|
|
1196
|
-
const toggleRow =
|
|
1497
|
+
const toggleRow = React11__namespace.useCallback(
|
|
1197
1498
|
(rowId) => {
|
|
1198
1499
|
if (!effectiveSelectable) return;
|
|
1199
1500
|
const next = new Set(selectedRowsSet);
|
|
@@ -1218,7 +1519,7 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1218
1519
|
},
|
|
1219
1520
|
[effectiveSelectable, selectionMode, selectedRowsSet, isControlled, onSelectionChange]
|
|
1220
1521
|
);
|
|
1221
|
-
const selectAll =
|
|
1522
|
+
const selectAll = React11__namespace.useCallback(() => {
|
|
1222
1523
|
if (!effectiveSelectable || selectionMode !== "multiple" || allRowIds.size === 0) return;
|
|
1223
1524
|
const next = new Set(allRowIds);
|
|
1224
1525
|
if (isControlled) {
|
|
@@ -1228,7 +1529,7 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1228
1529
|
onSelectionChange?.(Array.from(next));
|
|
1229
1530
|
}
|
|
1230
1531
|
}, [effectiveSelectable, selectionMode, allRowIds, isControlled, onSelectionChange]);
|
|
1231
|
-
const deselectAll =
|
|
1532
|
+
const deselectAll = React11__namespace.useCallback(() => {
|
|
1232
1533
|
if (!effectiveSelectable) return;
|
|
1233
1534
|
const next = /* @__PURE__ */ new Set();
|
|
1234
1535
|
if (isControlled) {
|
|
@@ -1238,19 +1539,19 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1238
1539
|
onSelectionChange?.(Array.from(next));
|
|
1239
1540
|
}
|
|
1240
1541
|
}, [effectiveSelectable, isControlled, onSelectionChange]);
|
|
1241
|
-
const isRowSelected =
|
|
1542
|
+
const isRowSelected = React11__namespace.useCallback(
|
|
1242
1543
|
(rowId) => selectedRowsSet.has(rowId),
|
|
1243
1544
|
[selectedRowsSet]
|
|
1244
1545
|
);
|
|
1245
|
-
const isAllSelected =
|
|
1546
|
+
const isAllSelected = React11__namespace.useMemo(() => {
|
|
1246
1547
|
if (!effectiveSelectable || allRowIds.size === 0) return false;
|
|
1247
1548
|
return allRowIds.size > 0 && Array.from(allRowIds).every((id) => selectedRowsSet.has(id));
|
|
1248
1549
|
}, [effectiveSelectable, allRowIds, selectedRowsSet]);
|
|
1249
|
-
const isSomeSelected =
|
|
1550
|
+
const isSomeSelected = React11__namespace.useMemo(() => {
|
|
1250
1551
|
if (!effectiveSelectable) return false;
|
|
1251
1552
|
return selectedRowsSet.size > 0 && !isAllSelected;
|
|
1252
1553
|
}, [effectiveSelectable, selectedRowsSet.size, isAllSelected]);
|
|
1253
|
-
const contextValue =
|
|
1554
|
+
const contextValue = React11__namespace.useMemo(() => ({
|
|
1254
1555
|
selectable: effectiveSelectable,
|
|
1255
1556
|
selectionMode,
|
|
1256
1557
|
selectedRows: selectedRowsSet,
|
|
@@ -1279,7 +1580,7 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1279
1580
|
unregisterRowId,
|
|
1280
1581
|
stickyYHeader
|
|
1281
1582
|
]);
|
|
1282
|
-
|
|
1583
|
+
React11__namespace.useEffect(() => {
|
|
1283
1584
|
const wrapper = wrapperRef.current;
|
|
1284
1585
|
if (!wrapper || highlightMode === "none") return;
|
|
1285
1586
|
let prevCell = null;
|
|
@@ -1335,12 +1636,12 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1335
1636
|
"div",
|
|
1336
1637
|
{
|
|
1337
1638
|
ref: wrapperRef,
|
|
1338
|
-
className:
|
|
1639
|
+
className: chunkD2BLWOWK_js.cn("relative w-full overflow-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-neutral-600 scrollbar-track-transparent", rounded && "rounded-lg", containerClassName),
|
|
1339
1640
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1340
1641
|
"table",
|
|
1341
1642
|
{
|
|
1342
1643
|
ref,
|
|
1343
|
-
className:
|
|
1644
|
+
className: chunkD2BLWOWK_js.cn("w-full caption-bottom text-sm", className),
|
|
1344
1645
|
...props,
|
|
1345
1646
|
children: columns && data ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: (() => {
|
|
1346
1647
|
const filteredCols = columns.filter(
|
|
@@ -1393,7 +1694,7 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1393
1694
|
...col.stickyXHeader ? { left: stickyOffsets[col.key] } : {},
|
|
1394
1695
|
...col.stickyXHeader && stickyYHeader ? { boxShadow: xyShadow } : col.stickyXHeader ? { boxShadow: xShadow } : stickyYHeader ? { boxShadow: yShadow } : {}
|
|
1395
1696
|
},
|
|
1396
|
-
className:
|
|
1697
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1397
1698
|
"h-12 px-4 text-left align-middle font-medium text-gray-500 dark:text-gray-400",
|
|
1398
1699
|
stickyYHeader && "sticky top-0 z-20 bg-gray-50 dark:bg-neutral-800",
|
|
1399
1700
|
col.stickyXHeader && "sticky z-20 bg-gray-50 dark:bg-neutral-800",
|
|
@@ -1420,7 +1721,7 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1420
1721
|
"tr",
|
|
1421
1722
|
{
|
|
1422
1723
|
"data-state": isSelected ? "selected" : void 0,
|
|
1423
|
-
className:
|
|
1724
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1424
1725
|
"border-b border-gray-200 transition-colors dark:border-neutral-700",
|
|
1425
1726
|
isSelected ? "bg-blue-50 dark:bg-blue-900/20" : (highlightMode === "row" || highlightMode === "cross") && "hover:bg-gray-50 dark:hover:bg-neutral-800/50",
|
|
1426
1727
|
onRowClick && "cursor-pointer"
|
|
@@ -1442,9 +1743,9 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1442
1743
|
}
|
|
1443
1744
|
contextValue.toggleRow(rowId);
|
|
1444
1745
|
} : col.key === "__delete__" ? (e) => e.stopPropagation() : void 0,
|
|
1445
|
-
className:
|
|
1746
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1446
1747
|
"p-4 align-middle",
|
|
1447
|
-
col.stickyXHeader &&
|
|
1748
|
+
col.stickyXHeader && chunkD2BLWOWK_js.cn("sticky z-20", isSelected ? "bg-blue-50 dark:bg-[#242a3a]" : "bg-gray-50 dark:bg-neutral-800"),
|
|
1448
1749
|
showDividers && "border-r border-gray-200 dark:border-neutral-700",
|
|
1449
1750
|
typeof col.cellClassName === "function" ? col.cellClassName(row) : col.cellClassName
|
|
1450
1751
|
),
|
|
@@ -1466,29 +1767,29 @@ var TableInner = React10__namespace.forwardRef(
|
|
|
1466
1767
|
);
|
|
1467
1768
|
TableInner.displayName = "Table";
|
|
1468
1769
|
var Table = TableInner;
|
|
1469
|
-
var TableHeader =
|
|
1770
|
+
var TableHeader = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1470
1771
|
"thead",
|
|
1471
1772
|
{
|
|
1472
1773
|
ref,
|
|
1473
|
-
className:
|
|
1774
|
+
className: chunkD2BLWOWK_js.cn("[&_tr]:border-b [&_tr]:border-gray-200 dark:[&_tr]:border-gray-700", className),
|
|
1474
1775
|
...props
|
|
1475
1776
|
}
|
|
1476
1777
|
));
|
|
1477
1778
|
TableHeader.displayName = "TableHeader";
|
|
1478
|
-
var TableBody =
|
|
1779
|
+
var TableBody = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1479
1780
|
"tbody",
|
|
1480
1781
|
{
|
|
1481
1782
|
ref,
|
|
1482
|
-
className:
|
|
1783
|
+
className: chunkD2BLWOWK_js.cn("[&_tr:last-child]:border-0", className),
|
|
1483
1784
|
...props
|
|
1484
1785
|
}
|
|
1485
1786
|
));
|
|
1486
1787
|
TableBody.displayName = "TableBody";
|
|
1487
|
-
var TableFooter =
|
|
1788
|
+
var TableFooter = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1488
1789
|
"tfoot",
|
|
1489
1790
|
{
|
|
1490
1791
|
ref,
|
|
1491
|
-
className:
|
|
1792
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1492
1793
|
"border-t border-gray-200 bg-gray-50 font-medium dark:border-neutral-700 dark:bg-neutral-800/50 [&>tr]:last:border-b-0",
|
|
1493
1794
|
className
|
|
1494
1795
|
),
|
|
@@ -1496,19 +1797,19 @@ var TableFooter = React10__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
1496
1797
|
}
|
|
1497
1798
|
));
|
|
1498
1799
|
TableFooter.displayName = "TableFooter";
|
|
1499
|
-
var TableRow =
|
|
1800
|
+
var TableRow = React11__namespace.forwardRef(
|
|
1500
1801
|
({ className, rowId, rowData, onClick, ...props }, ref) => {
|
|
1501
1802
|
const context = useTableContext();
|
|
1502
1803
|
const getRowId = context?.getRowId;
|
|
1503
1804
|
const selectable = context?.selectable;
|
|
1504
1805
|
const registerRowId = context?.registerRowId;
|
|
1505
1806
|
const unregisterRowId = context?.unregisterRowId;
|
|
1506
|
-
const finalRowId =
|
|
1807
|
+
const finalRowId = React11__namespace.useMemo(() => {
|
|
1507
1808
|
if (rowId) return rowId;
|
|
1508
1809
|
if (rowData && getRowId) return getRowId(rowData);
|
|
1509
1810
|
return props.id || void 0;
|
|
1510
1811
|
}, [rowId, rowData, getRowId, props.id]);
|
|
1511
|
-
|
|
1812
|
+
React11__namespace.useEffect(() => {
|
|
1512
1813
|
if (finalRowId && selectable) {
|
|
1513
1814
|
registerRowId?.(finalRowId);
|
|
1514
1815
|
return () => {
|
|
@@ -1517,7 +1818,7 @@ var TableRow = React10__namespace.forwardRef(
|
|
|
1517
1818
|
}
|
|
1518
1819
|
}, [finalRowId, selectable, registerRowId, unregisterRowId]);
|
|
1519
1820
|
const isSelected = finalRowId ? context?.isRowSelected(finalRowId) : false;
|
|
1520
|
-
const handleClick =
|
|
1821
|
+
const handleClick = React11__namespace.useCallback(
|
|
1521
1822
|
(e) => {
|
|
1522
1823
|
onClick?.(e);
|
|
1523
1824
|
},
|
|
@@ -1529,7 +1830,7 @@ var TableRow = React10__namespace.forwardRef(
|
|
|
1529
1830
|
ref,
|
|
1530
1831
|
"data-state": isSelected ? "selected" : void 0,
|
|
1531
1832
|
"data-row-id": finalRowId,
|
|
1532
|
-
className:
|
|
1833
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1533
1834
|
"border-b border-gray-200 transition-colors hover:bg-gray-50 data-[state=selected]:bg-blue-50 dark:border-neutral-700 dark:hover:bg-neutral-800/50 dark:data-[state=selected]:bg-blue-900/20",
|
|
1534
1835
|
className
|
|
1535
1836
|
),
|
|
@@ -1540,7 +1841,7 @@ var TableRow = React10__namespace.forwardRef(
|
|
|
1540
1841
|
}
|
|
1541
1842
|
);
|
|
1542
1843
|
TableRow.displayName = "TableRow";
|
|
1543
|
-
var TableHead =
|
|
1844
|
+
var TableHead = React11__namespace.forwardRef(({ className, style, ...props }, ref) => {
|
|
1544
1845
|
const context = useTableContext();
|
|
1545
1846
|
const isDark = typeof document !== "undefined" && document.documentElement.classList.contains("dark");
|
|
1546
1847
|
const yShadow = `inset 0 -1px 0 0 ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)"}`;
|
|
@@ -1549,7 +1850,7 @@ var TableHead = React10__namespace.forwardRef(({ className, style, ...props }, r
|
|
|
1549
1850
|
{
|
|
1550
1851
|
ref,
|
|
1551
1852
|
style: context?.stickyHeader ? { boxShadow: yShadow, ...style } : style,
|
|
1552
|
-
className:
|
|
1853
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1553
1854
|
"h-12 px-4 text-left align-middle font-medium text-gray-500 dark:text-gray-400 [&:has([role=checkbox])]:pr-0",
|
|
1554
1855
|
context?.stickyHeader && "sticky top-0 z-20 bg-gray-50 dark:bg-neutral-800",
|
|
1555
1856
|
className
|
|
@@ -1559,12 +1860,12 @@ var TableHead = React10__namespace.forwardRef(({ className, style, ...props }, r
|
|
|
1559
1860
|
);
|
|
1560
1861
|
});
|
|
1561
1862
|
TableHead.displayName = "TableHead";
|
|
1562
|
-
var TableCell =
|
|
1863
|
+
var TableCell = React11__namespace.forwardRef(
|
|
1563
1864
|
({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1564
1865
|
"td",
|
|
1565
1866
|
{
|
|
1566
1867
|
ref,
|
|
1567
|
-
className:
|
|
1868
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1568
1869
|
"align-middle [&:has([role=checkbox])]:pr-0",
|
|
1569
1870
|
variant === "embed" ? "p-1.5" : "p-4",
|
|
1570
1871
|
className
|
|
@@ -1574,16 +1875,16 @@ var TableCell = React10__namespace.forwardRef(
|
|
|
1574
1875
|
)
|
|
1575
1876
|
);
|
|
1576
1877
|
TableCell.displayName = "TableCell";
|
|
1577
|
-
var TableCaption =
|
|
1878
|
+
var TableCaption = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1578
1879
|
"caption",
|
|
1579
1880
|
{
|
|
1580
1881
|
ref,
|
|
1581
|
-
className:
|
|
1882
|
+
className: chunkD2BLWOWK_js.cn("mt-4 text-sm text-gray-500 dark:text-gray-400", className),
|
|
1582
1883
|
...props
|
|
1583
1884
|
}
|
|
1584
1885
|
));
|
|
1585
1886
|
TableCaption.displayName = "TableCaption";
|
|
1586
|
-
var TableSelectAll =
|
|
1887
|
+
var TableSelectAll = React11__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
1587
1888
|
const context = useTableContext();
|
|
1588
1889
|
if (!context?.selectable || context.selectionMode !== "multiple") {
|
|
1589
1890
|
return null;
|
|
@@ -1607,13 +1908,13 @@ var TableSelectAll = React10__namespace.forwardRef(({ className, ...props }, ref
|
|
|
1607
1908
|
) });
|
|
1608
1909
|
});
|
|
1609
1910
|
TableSelectAll.displayName = "TableSelectAll";
|
|
1610
|
-
var TableRowCheckbox =
|
|
1911
|
+
var TableRowCheckbox = React11__namespace.forwardRef(({ rowId, rowData, className, ...props }, ref) => {
|
|
1611
1912
|
const context = useTableContext();
|
|
1612
1913
|
const getRowId = context?.getRowId;
|
|
1613
1914
|
if (!context?.selectable) {
|
|
1614
1915
|
return null;
|
|
1615
1916
|
}
|
|
1616
|
-
const finalRowId =
|
|
1917
|
+
const finalRowId = React11__namespace.useMemo(() => {
|
|
1617
1918
|
if (rowId) return rowId;
|
|
1618
1919
|
if (rowData && getRowId) return getRowId(rowData);
|
|
1619
1920
|
return void 0;
|
|
@@ -1651,7 +1952,7 @@ function getDefaultColumns(columns, isMobile) {
|
|
|
1651
1952
|
}
|
|
1652
1953
|
function useColumnVisibility(columns, options = {}) {
|
|
1653
1954
|
const { storageKey } = options;
|
|
1654
|
-
const [visibleColumns, setVisibleColumnsState] =
|
|
1955
|
+
const [visibleColumns, setVisibleColumnsState] = React11.useState(() => {
|
|
1655
1956
|
if (storageKey && typeof window !== "undefined") {
|
|
1656
1957
|
try {
|
|
1657
1958
|
const saved = localStorage.getItem(storageKey);
|
|
@@ -1665,7 +1966,7 @@ function useColumnVisibility(columns, options = {}) {
|
|
|
1665
1966
|
}
|
|
1666
1967
|
return getDefaultColumns(columns, false);
|
|
1667
1968
|
});
|
|
1668
|
-
|
|
1969
|
+
React11.useEffect(() => {
|
|
1669
1970
|
if (storageKey) {
|
|
1670
1971
|
try {
|
|
1671
1972
|
const saved = localStorage.getItem(storageKey);
|
|
@@ -1678,7 +1979,7 @@ function useColumnVisibility(columns, options = {}) {
|
|
|
1678
1979
|
setVisibleColumnsState(getDefaultColumns(columns, true));
|
|
1679
1980
|
}
|
|
1680
1981
|
}, []);
|
|
1681
|
-
const setVisibleColumns =
|
|
1982
|
+
const setVisibleColumns = React11.useCallback((cols) => {
|
|
1682
1983
|
const stickyKeys = columns.filter((c) => c.stickyXHeader).map((c) => c.key);
|
|
1683
1984
|
const merged = Array.from(/* @__PURE__ */ new Set([...stickyKeys, ...cols]));
|
|
1684
1985
|
setVisibleColumnsState(merged);
|
|
@@ -1698,7 +1999,7 @@ function ColumnSelection({
|
|
|
1698
1999
|
triggerLabel = "Manage Columns",
|
|
1699
2000
|
trigger
|
|
1700
2001
|
}) {
|
|
1701
|
-
const handleToggle =
|
|
2002
|
+
const handleToggle = React11__namespace.useCallback((key, checked) => {
|
|
1702
2003
|
if (checked) {
|
|
1703
2004
|
if (!visibleColumns.includes(key)) {
|
|
1704
2005
|
onVisibleColumnsChange([...visibleColumns, key]);
|
|
@@ -1720,7 +2021,7 @@ function ColumnSelection({
|
|
|
1720
2021
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1721
2022
|
"label",
|
|
1722
2023
|
{
|
|
1723
|
-
className:
|
|
2024
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1724
2025
|
"flex items-center gap-2.5 rounded-hz-md px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-neutral-800",
|
|
1725
2026
|
isSticky && "opacity-50 cursor-not-allowed"
|
|
1726
2027
|
),
|
|
@@ -1745,33 +2046,33 @@ function ColumnSelection({
|
|
|
1745
2046
|
] })
|
|
1746
2047
|
] });
|
|
1747
2048
|
}
|
|
1748
|
-
var TabsContext =
|
|
2049
|
+
var TabsContext = React11__namespace.createContext(null);
|
|
1749
2050
|
var useTabsContext = () => {
|
|
1750
|
-
const context =
|
|
2051
|
+
const context = React11__namespace.useContext(TabsContext);
|
|
1751
2052
|
if (!context) {
|
|
1752
2053
|
throw new Error("Tabs components must be used within a Tabs provider");
|
|
1753
2054
|
}
|
|
1754
2055
|
return context;
|
|
1755
2056
|
};
|
|
1756
|
-
var TabsListContext =
|
|
1757
|
-
var useTabsListContext = () =>
|
|
1758
|
-
var Tabs =
|
|
1759
|
-
const [activeTab, setActiveTabState] =
|
|
1760
|
-
const tabRefs =
|
|
1761
|
-
const listRef =
|
|
1762
|
-
const setActiveTab =
|
|
2057
|
+
var TabsListContext = React11__namespace.createContext({ variant: "pill" });
|
|
2058
|
+
var useTabsListContext = () => React11__namespace.useContext(TabsListContext);
|
|
2059
|
+
var Tabs = React11__namespace.forwardRef(({ defaultValue, value, onValueChange, children, ...props }, ref) => {
|
|
2060
|
+
const [activeTab, setActiveTabState] = React11__namespace.useState(value ?? defaultValue);
|
|
2061
|
+
const tabRefs = React11__namespace.useRef(/* @__PURE__ */ new Map()).current;
|
|
2062
|
+
const listRef = React11__namespace.useRef(null);
|
|
2063
|
+
const setActiveTab = React11__namespace.useCallback(
|
|
1763
2064
|
(newValue) => {
|
|
1764
2065
|
setActiveTabState(newValue);
|
|
1765
2066
|
onValueChange?.(newValue);
|
|
1766
2067
|
},
|
|
1767
2068
|
[onValueChange]
|
|
1768
2069
|
);
|
|
1769
|
-
|
|
2070
|
+
React11__namespace.useEffect(() => {
|
|
1770
2071
|
if (value !== void 0) {
|
|
1771
2072
|
setActiveTabState(value);
|
|
1772
2073
|
}
|
|
1773
2074
|
}, [value]);
|
|
1774
|
-
const registerTab =
|
|
2075
|
+
const registerTab = React11__namespace.useCallback(
|
|
1775
2076
|
(tabValue, element) => {
|
|
1776
2077
|
tabRefs.set(tabValue, element);
|
|
1777
2078
|
},
|
|
@@ -1796,10 +2097,10 @@ var Tabs = React10__namespace.forwardRef(({ defaultValue, value, onValueChange,
|
|
|
1796
2097
|
);
|
|
1797
2098
|
});
|
|
1798
2099
|
Tabs.displayName = "Tabs";
|
|
1799
|
-
var TabsList =
|
|
2100
|
+
var TabsList = React11__namespace.forwardRef(({ className, children, variant = "pill", ...props }, ref) => {
|
|
1800
2101
|
const { activeTab, tabRefs, listRef } = useTabsContext();
|
|
1801
|
-
const [indicatorStyle, setIndicatorStyle] =
|
|
1802
|
-
|
|
2102
|
+
const [indicatorStyle, setIndicatorStyle] = React11__namespace.useState(null);
|
|
2103
|
+
React11__namespace.useEffect(() => {
|
|
1803
2104
|
if (variant !== "pill") return;
|
|
1804
2105
|
const updateIndicator = () => {
|
|
1805
2106
|
if (!activeTab || !listRef.current) return;
|
|
@@ -1824,7 +2125,7 @@ var TabsList = React10__namespace.forwardRef(({ className, children, variant = "
|
|
|
1824
2125
|
else if (ref) ref.current = node;
|
|
1825
2126
|
listRef.current = node;
|
|
1826
2127
|
},
|
|
1827
|
-
className:
|
|
2128
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1828
2129
|
variant === "pill" ? "relative inline-flex h-10 items-center justify-center rounded-hz-lg p-1 bg-gray-100 text-gray-500 dark:bg-neutral-700 dark:text-gray-400" : "flex gap-4 border-b border-gray-200 dark:border-neutral-800",
|
|
1829
2130
|
className
|
|
1830
2131
|
),
|
|
@@ -1852,11 +2153,11 @@ var TabsList = React10__namespace.forwardRef(({ className, children, variant = "
|
|
|
1852
2153
|
) });
|
|
1853
2154
|
});
|
|
1854
2155
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
1855
|
-
var TabsTrigger =
|
|
2156
|
+
var TabsTrigger = React11__namespace.forwardRef(({ className, value, icon, children, ...props }, ref) => {
|
|
1856
2157
|
const { registerTab, activeTab } = useTabsContext();
|
|
1857
2158
|
const { variant } = useTabsListContext();
|
|
1858
|
-
const triggerRef =
|
|
1859
|
-
|
|
2159
|
+
const triggerRef = React11__namespace.useRef(null);
|
|
2160
|
+
React11__namespace.useEffect(() => {
|
|
1860
2161
|
registerTab(value, triggerRef.current);
|
|
1861
2162
|
return () => registerTab(value, null);
|
|
1862
2163
|
}, [value, registerTab]);
|
|
@@ -1870,12 +2171,12 @@ var TabsTrigger = React10__namespace.forwardRef(({ className, value, icon, child
|
|
|
1870
2171
|
else if (ref) ref.current = node;
|
|
1871
2172
|
},
|
|
1872
2173
|
value,
|
|
1873
|
-
className:
|
|
2174
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1874
2175
|
"inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
1875
|
-
variant === "pill" ?
|
|
2176
|
+
variant === "pill" ? chunkD2BLWOWK_js.cn(
|
|
1876
2177
|
"relative z-10 justify-center rounded-hz-md px-3 py-1.5 transition-colors",
|
|
1877
2178
|
isActive ? "text-gray-900 dark:text-gray-100" : "text-gray-500 dark:text-gray-400"
|
|
1878
|
-
) :
|
|
2179
|
+
) : chunkD2BLWOWK_js.cn(
|
|
1879
2180
|
"pb-3 border-b-2 transition-colors",
|
|
1880
2181
|
isActive ? "border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400" : "border-transparent text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-600"
|
|
1881
2182
|
),
|
|
@@ -1890,11 +2191,11 @@ var TabsTrigger = React10__namespace.forwardRef(({ className, value, icon, child
|
|
|
1890
2191
|
);
|
|
1891
2192
|
});
|
|
1892
2193
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
1893
|
-
var TabsContent =
|
|
2194
|
+
var TabsContent = React11__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1894
2195
|
TabsPrimitive__namespace.Content,
|
|
1895
2196
|
{
|
|
1896
2197
|
ref,
|
|
1897
|
-
className:
|
|
2198
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1898
2199
|
"mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
1899
2200
|
className
|
|
1900
2201
|
),
|
|
@@ -1902,12 +2203,12 @@ var TabsContent = React10__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
1902
2203
|
}
|
|
1903
2204
|
));
|
|
1904
2205
|
TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
|
|
1905
|
-
var Textarea =
|
|
2206
|
+
var Textarea = React11__namespace.forwardRef(
|
|
1906
2207
|
({ className, ...props }, ref) => {
|
|
1907
2208
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1908
2209
|
"textarea",
|
|
1909
2210
|
{
|
|
1910
|
-
className:
|
|
2211
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1911
2212
|
"flex min-h-[80px] w-full rounded-hz-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-600 dark:bg-neutral-800 dark:text-gray-100 dark:placeholder:text-gray-500",
|
|
1912
2213
|
className
|
|
1913
2214
|
),
|
|
@@ -1986,7 +2287,7 @@ function Toggle({
|
|
|
1986
2287
|
...props,
|
|
1987
2288
|
type: "multiple",
|
|
1988
2289
|
...value !== void 0 ? { value, onValueChange: onChange } : {},
|
|
1989
|
-
className:
|
|
2290
|
+
className: chunkD2BLWOWK_js.cn(
|
|
1990
2291
|
toggleGroupVariants({ size }),
|
|
1991
2292
|
containerRadiusClass2[radius],
|
|
1992
2293
|
className
|
|
@@ -1999,7 +2300,7 @@ function Toggle({
|
|
|
1999
2300
|
value: option.value,
|
|
2000
2301
|
disabled: option.disabled,
|
|
2001
2302
|
"aria-label": iconOnly ? option.ariaLabel ?? option.value : void 0,
|
|
2002
|
-
className:
|
|
2303
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2003
2304
|
toggleItemVariants({ size, iconOnly }),
|
|
2004
2305
|
itemRadiusClass2[radius],
|
|
2005
2306
|
"border border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",
|
|
@@ -2059,8 +2360,8 @@ var switchLabelVariants = classVarianceAuthority.cva("select-none", {
|
|
|
2059
2360
|
size: "default"
|
|
2060
2361
|
}
|
|
2061
2362
|
});
|
|
2062
|
-
var Switch =
|
|
2063
|
-
const generatedId =
|
|
2363
|
+
var Switch = React11__namespace.forwardRef(({ className, size, label, labelPosition = "right", ...props }, ref) => {
|
|
2364
|
+
const generatedId = React11__namespace.useId();
|
|
2064
2365
|
const switchId = props.id ?? generatedId;
|
|
2065
2366
|
const switchEl = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2066
2367
|
SwitchPrimitive__namespace.Root,
|
|
@@ -2068,7 +2369,7 @@ var Switch = React10__namespace.forwardRef(({ className, size, label, labelPosit
|
|
|
2068
2369
|
...props,
|
|
2069
2370
|
id: switchId,
|
|
2070
2371
|
ref,
|
|
2071
|
-
className:
|
|
2372
|
+
className: chunkD2BLWOWK_js.cn(switchTrackVariants({ size }), className),
|
|
2072
2373
|
children: /* @__PURE__ */ jsxRuntime.jsx(SwitchPrimitive__namespace.Thumb, { className: switchThumbVariants({ size }) })
|
|
2073
2374
|
}
|
|
2074
2375
|
);
|
|
@@ -2076,7 +2377,7 @@ var Switch = React10__namespace.forwardRef(({ className, size, label, labelPosit
|
|
|
2076
2377
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2077
2378
|
"div",
|
|
2078
2379
|
{
|
|
2079
|
-
className:
|
|
2380
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2080
2381
|
"inline-flex items-center gap-2",
|
|
2081
2382
|
props.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2082
2383
|
),
|
|
@@ -2085,7 +2386,7 @@ var Switch = React10__namespace.forwardRef(({ className, size, label, labelPosit
|
|
|
2085
2386
|
"label",
|
|
2086
2387
|
{
|
|
2087
2388
|
htmlFor: switchId,
|
|
2088
|
-
className:
|
|
2389
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2089
2390
|
switchLabelVariants({ size }),
|
|
2090
2391
|
props.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2091
2392
|
),
|
|
@@ -2097,7 +2398,7 @@ var Switch = React10__namespace.forwardRef(({ className, size, label, labelPosit
|
|
|
2097
2398
|
"label",
|
|
2098
2399
|
{
|
|
2099
2400
|
htmlFor: switchId,
|
|
2100
|
-
className:
|
|
2401
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2101
2402
|
switchLabelVariants({ size }),
|
|
2102
2403
|
props.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2103
2404
|
),
|
|
@@ -2138,39 +2439,59 @@ function TimeInput({
|
|
|
2138
2439
|
max,
|
|
2139
2440
|
onChange,
|
|
2140
2441
|
onComplete,
|
|
2442
|
+
onDirty,
|
|
2141
2443
|
inputRef,
|
|
2142
2444
|
disabled = false,
|
|
2143
2445
|
"aria-label": ariaLabel
|
|
2144
2446
|
}) {
|
|
2145
|
-
const [editValue, setEditValue] =
|
|
2146
|
-
const internalRef =
|
|
2147
|
-
const committedRef =
|
|
2148
|
-
const
|
|
2149
|
-
const
|
|
2150
|
-
|
|
2151
|
-
if (raw === "") {
|
|
2152
|
-
setEditValue(raw);
|
|
2153
|
-
return;
|
|
2154
|
-
}
|
|
2155
|
-
if (raw.length === 1) {
|
|
2156
|
-
setEditValue(raw);
|
|
2157
|
-
return;
|
|
2158
|
-
}
|
|
2447
|
+
const [editValue, setEditValue] = React11__namespace.useState(null);
|
|
2448
|
+
const internalRef = React11__namespace.useRef(null);
|
|
2449
|
+
const committedRef = React11__namespace.useRef(false);
|
|
2450
|
+
const pendingDigitRef = React11__namespace.useRef(null);
|
|
2451
|
+
const setRefs = React11__namespace.useCallback(chunkD2BLWOWK_js.mergeRefs(internalRef, inputRef), [inputRef]);
|
|
2452
|
+
const commitTwoDigits = (raw) => {
|
|
2159
2453
|
const parsed = parseInt(raw, 10);
|
|
2160
2454
|
const clamped = clamp(parsed, min2, max);
|
|
2455
|
+
pendingDigitRef.current = null;
|
|
2161
2456
|
committedRef.current = true;
|
|
2162
2457
|
onChange(clamped);
|
|
2163
2458
|
setEditValue(null);
|
|
2164
2459
|
onComplete?.();
|
|
2165
2460
|
};
|
|
2461
|
+
const handleChange = (e) => {
|
|
2462
|
+
const allDigits = e.target.value.replace(/\D/g, "");
|
|
2463
|
+
if (allDigits === "") {
|
|
2464
|
+
setEditValue("");
|
|
2465
|
+
pendingDigitRef.current = null;
|
|
2466
|
+
return;
|
|
2467
|
+
}
|
|
2468
|
+
if (pendingDigitRef.current !== null) {
|
|
2469
|
+
if (allDigits.length > 2) {
|
|
2470
|
+
commitTwoDigits(pendingDigitRef.current + allDigits[allDigits.length - 1]);
|
|
2471
|
+
return;
|
|
2472
|
+
}
|
|
2473
|
+
pendingDigitRef.current = null;
|
|
2474
|
+
setEditValue("");
|
|
2475
|
+
return;
|
|
2476
|
+
}
|
|
2477
|
+
if (allDigits.length === 1) {
|
|
2478
|
+
pendingDigitRef.current = allDigits;
|
|
2479
|
+
setEditValue("0" + allDigits);
|
|
2480
|
+
onDirty?.();
|
|
2481
|
+
return;
|
|
2482
|
+
}
|
|
2483
|
+
commitTwoDigits(allDigits.slice(0, 2));
|
|
2484
|
+
};
|
|
2166
2485
|
const commit = () => {
|
|
2167
2486
|
if (committedRef.current) {
|
|
2168
2487
|
committedRef.current = false;
|
|
2488
|
+
pendingDigitRef.current = null;
|
|
2169
2489
|
setEditValue(null);
|
|
2170
2490
|
return;
|
|
2171
2491
|
}
|
|
2172
2492
|
if (editValue === null) return;
|
|
2173
2493
|
if (editValue === "") {
|
|
2494
|
+
pendingDigitRef.current = null;
|
|
2174
2495
|
setEditValue(null);
|
|
2175
2496
|
return;
|
|
2176
2497
|
}
|
|
@@ -2178,6 +2499,7 @@ function TimeInput({
|
|
|
2178
2499
|
if (!isNaN(parsed)) {
|
|
2179
2500
|
onChange(clamp(parsed, min2, max));
|
|
2180
2501
|
}
|
|
2502
|
+
pendingDigitRef.current = null;
|
|
2181
2503
|
setEditValue(null);
|
|
2182
2504
|
};
|
|
2183
2505
|
const handleKeyDown = (e) => {
|
|
@@ -2185,16 +2507,19 @@ function TimeInput({
|
|
|
2185
2507
|
commit();
|
|
2186
2508
|
internalRef.current?.blur();
|
|
2187
2509
|
} else if (e.key === "Escape") {
|
|
2510
|
+
pendingDigitRef.current = null;
|
|
2188
2511
|
setEditValue(null);
|
|
2189
2512
|
internalRef.current?.blur();
|
|
2190
2513
|
} else if (e.key === "ArrowUp") {
|
|
2191
2514
|
e.preventDefault();
|
|
2515
|
+
pendingDigitRef.current = null;
|
|
2192
2516
|
const curr = value ?? min2;
|
|
2193
2517
|
const next = curr >= max ? min2 : curr + 1;
|
|
2194
2518
|
onChange(next);
|
|
2195
2519
|
setEditValue(pad(next));
|
|
2196
2520
|
} else if (e.key === "ArrowDown") {
|
|
2197
2521
|
e.preventDefault();
|
|
2522
|
+
pendingDigitRef.current = null;
|
|
2198
2523
|
const curr = value ?? max;
|
|
2199
2524
|
const next = curr <= min2 ? max : curr - 1;
|
|
2200
2525
|
onChange(next);
|
|
@@ -2212,12 +2537,13 @@ function TimeInput({
|
|
|
2212
2537
|
value: editValue ?? (value === null ? "--" : pad(value)),
|
|
2213
2538
|
onChange: handleChange,
|
|
2214
2539
|
onFocus: (e) => {
|
|
2540
|
+
pendingDigitRef.current = null;
|
|
2215
2541
|
setEditValue("");
|
|
2216
2542
|
requestAnimationFrame(() => e.target.select());
|
|
2217
2543
|
},
|
|
2218
2544
|
onBlur: () => commit(),
|
|
2219
2545
|
onKeyDown: handleKeyDown,
|
|
2220
|
-
className:
|
|
2546
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2221
2547
|
"w-9 h-8 rounded-md border text-center text-sm tabular-nums font-medium outline-none transition-colors",
|
|
2222
2548
|
"bg-white border-gray-200 text-gray-600",
|
|
2223
2549
|
"focus:border-blue-500 focus:ring-1 focus:ring-blue-500/30 focus:text-gray-700",
|
|
@@ -2232,7 +2558,7 @@ function PeriodToggle({ value, onChange, disabled = false }) {
|
|
|
2232
2558
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2233
2559
|
"div",
|
|
2234
2560
|
{
|
|
2235
|
-
className:
|
|
2561
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2236
2562
|
"inline-flex rounded-md border overflow-hidden",
|
|
2237
2563
|
disabled && "opacity-40 cursor-not-allowed",
|
|
2238
2564
|
"border-gray-200 dark:border-neutral-600"
|
|
@@ -2243,7 +2569,7 @@ function PeriodToggle({ value, onChange, disabled = false }) {
|
|
|
2243
2569
|
type: "button",
|
|
2244
2570
|
disabled,
|
|
2245
2571
|
onClick: () => onChange(p),
|
|
2246
|
-
className:
|
|
2572
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2247
2573
|
"px-2 h-8 text-xs font-semibold tracking-wide transition-colors",
|
|
2248
2574
|
"disabled:pointer-events-none",
|
|
2249
2575
|
value === p ? "!bg-blue-600 !text-white dark:!bg-blue-500" : "bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-600 dark:bg-neutral-800 dark:text-gray-400 dark:hover:bg-neutral-700"
|
|
@@ -2262,11 +2588,12 @@ function TimeField({
|
|
|
2262
2588
|
hourRef,
|
|
2263
2589
|
minuteRef,
|
|
2264
2590
|
onMinuteComplete,
|
|
2591
|
+
onDirty,
|
|
2265
2592
|
disabled = false
|
|
2266
2593
|
}) {
|
|
2267
2594
|
const { hour12, period } = to12Hour(value.hour);
|
|
2268
|
-
const minuteInputRef =
|
|
2269
|
-
const mergedMinuteRef =
|
|
2595
|
+
const minuteInputRef = React11__namespace.useRef(null);
|
|
2596
|
+
const mergedMinuteRef = React11__namespace.useCallback(chunkD2BLWOWK_js.mergeRefs(minuteInputRef, minuteRef), [minuteRef]);
|
|
2270
2597
|
const handleHourChange = (newHour12) => {
|
|
2271
2598
|
onChange({ ...value, hour: to24Hour(newHour12, period) });
|
|
2272
2599
|
};
|
|
@@ -2284,7 +2611,7 @@ function TimeField({
|
|
|
2284
2611
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2285
2612
|
"span",
|
|
2286
2613
|
{
|
|
2287
|
-
className:
|
|
2614
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2288
2615
|
"text-xs font-semibold uppercase tracking-wider",
|
|
2289
2616
|
disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
|
|
2290
2617
|
),
|
|
@@ -2300,6 +2627,7 @@ function TimeField({
|
|
|
2300
2627
|
max: 12,
|
|
2301
2628
|
onChange: handleHourChange,
|
|
2302
2629
|
onComplete: focusMinute,
|
|
2630
|
+
onDirty,
|
|
2303
2631
|
inputRef: hourRef,
|
|
2304
2632
|
disabled,
|
|
2305
2633
|
"aria-label": `${label} hour`
|
|
@@ -2308,7 +2636,7 @@ function TimeField({
|
|
|
2308
2636
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2309
2637
|
"span",
|
|
2310
2638
|
{
|
|
2311
|
-
className:
|
|
2639
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2312
2640
|
"text-sm font-bold select-none",
|
|
2313
2641
|
disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
|
|
2314
2642
|
),
|
|
@@ -2323,6 +2651,7 @@ function TimeField({
|
|
|
2323
2651
|
max: 59,
|
|
2324
2652
|
onChange: handleMinuteChange,
|
|
2325
2653
|
onComplete: onMinuteComplete,
|
|
2654
|
+
onDirty,
|
|
2326
2655
|
inputRef: mergedMinuteRef,
|
|
2327
2656
|
disabled,
|
|
2328
2657
|
"aria-label": `${label} minute`
|
|
@@ -2339,11 +2668,14 @@ function TimeField({
|
|
|
2339
2668
|
] })
|
|
2340
2669
|
] });
|
|
2341
2670
|
}
|
|
2342
|
-
function
|
|
2343
|
-
const toHourRef = React10__namespace.useRef(null);
|
|
2671
|
+
function useTimeFieldState(value) {
|
|
2344
2672
|
const fromSet = isTimeSet(value.from);
|
|
2345
2673
|
const toSet = isTimeSet(value.to);
|
|
2346
2674
|
const bothSet = fromSet && toSet;
|
|
2675
|
+
const orphanMinutes = value.from.hour === null && value.from.minute !== null || value.to.hour === null && value.to.minute !== null;
|
|
2676
|
+
const fromPartial = !fromSet && (value.from.hour !== null || value.from.minute !== null);
|
|
2677
|
+
const toPartial = !toSet && (value.to.hour !== null || value.to.minute !== null);
|
|
2678
|
+
const oneSideMissing = fromSet && !toSet && !toPartial || toSet && !fromSet && !fromPartial;
|
|
2347
2679
|
const fromMinutes = (value.from.hour ?? 0) * 60 + (value.from.minute ?? 0);
|
|
2348
2680
|
const toMinutes = (value.to.hour ?? 0) * 60 + (value.to.minute ?? 0);
|
|
2349
2681
|
const bothEqual = fromMinutes === toMinutes;
|
|
@@ -2353,140 +2685,142 @@ function TimePickerColumn({ value, onChange, disabled = false }) {
|
|
|
2353
2685
|
const durationRemaining = durationMinutes % 60;
|
|
2354
2686
|
const showDuration = bothSet && !bothEqual;
|
|
2355
2687
|
const durationLabel = durationRemaining > 0 ? `${durationHours}h ${durationRemaining}m window${isOvernight ? " (overnight)" : ""}` : `${durationHours}h window${isOvernight ? " (overnight)" : ""}`;
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2688
|
+
const incompleteHint = orphanMinutes ? "Please set hours for the time to take effect" : fromPartial || toPartial ? "Please complete both hour and minute fields" : oneSideMissing ? `Please set the ${fromSet ? "to" : "from"} time` : null;
|
|
2689
|
+
return { showDuration, durationLabel, isOvernight, incompleteHint };
|
|
2690
|
+
}
|
|
2691
|
+
function TimePickerColumn({ value, onChange, disabled = false, onRemove, showRemove = false, onDirty }) {
|
|
2692
|
+
const toHourRef = React11__namespace.useRef(null);
|
|
2693
|
+
const { showDuration, durationLabel, isOvernight, incompleteHint } = useTimeFieldState(value);
|
|
2694
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col px-2 pt-2 pb-2 gap-1", children: [
|
|
2695
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2696
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2697
|
+
lucideReact.Clock,
|
|
2698
|
+
{
|
|
2699
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2700
|
+
"w-4 h-4 shrink-0",
|
|
2701
|
+
disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
|
|
2702
|
+
)
|
|
2703
|
+
}
|
|
2362
2704
|
),
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
"w-4 h-4 shrink-0",
|
|
2370
|
-
disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
|
|
2371
|
-
)
|
|
2372
|
-
}
|
|
2373
|
-
),
|
|
2374
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2375
|
-
"span",
|
|
2376
|
-
{
|
|
2377
|
-
className: chunk23BJPJOK_js.cn(
|
|
2378
|
-
"text-xs font-semibold uppercase tracking-wider",
|
|
2379
|
-
disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
|
|
2380
|
-
),
|
|
2381
|
-
children: "Time"
|
|
2382
|
-
}
|
|
2383
|
-
),
|
|
2384
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[9px] font-medium text-gray-400 dark:text-gray-600 tracking-wide", children: "(Optional)" })
|
|
2385
|
-
] }),
|
|
2386
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pl-6", children: [
|
|
2387
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2388
|
-
TimeField,
|
|
2389
|
-
{
|
|
2390
|
-
label: "From",
|
|
2391
|
-
value: value.from,
|
|
2392
|
-
onChange: (from) => onChange({ ...value, from }),
|
|
2393
|
-
onMinuteComplete: () => toHourRef.current?.focus(),
|
|
2394
|
-
disabled
|
|
2395
|
-
}
|
|
2396
|
-
),
|
|
2397
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2398
|
-
TimeField,
|
|
2399
|
-
{
|
|
2400
|
-
label: "To",
|
|
2401
|
-
value: value.to,
|
|
2402
|
-
onChange: (to) => onChange({ ...value, to }),
|
|
2403
|
-
hourRef: toHourRef,
|
|
2404
|
-
disabled
|
|
2405
|
-
}
|
|
2705
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2706
|
+
"span",
|
|
2707
|
+
{
|
|
2708
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2709
|
+
"text-xs font-semibold uppercase tracking-wider",
|
|
2710
|
+
disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
|
|
2406
2711
|
),
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2712
|
+
children: "Time"
|
|
2713
|
+
}
|
|
2714
|
+
),
|
|
2715
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[9px] font-medium text-gray-400 dark:text-gray-600 tracking-wide", children: "(Optional)" }),
|
|
2716
|
+
showRemove && onRemove && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2717
|
+
chunkD2BLWOWK_js.TextButton,
|
|
2718
|
+
{
|
|
2719
|
+
variant: "danger",
|
|
2720
|
+
onClick: onRemove,
|
|
2721
|
+
size: "sm",
|
|
2722
|
+
className: "!text-[0.625rem]",
|
|
2723
|
+
children: "Remove"
|
|
2724
|
+
}
|
|
2725
|
+
) })
|
|
2726
|
+
] }),
|
|
2727
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pl-6", children: [
|
|
2728
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2729
|
+
TimeField,
|
|
2730
|
+
{
|
|
2731
|
+
label: "From",
|
|
2732
|
+
value: value.from,
|
|
2733
|
+
onChange: (from) => onChange({ ...value, from }),
|
|
2734
|
+
onMinuteComplete: () => toHourRef.current?.focus(),
|
|
2735
|
+
onDirty,
|
|
2736
|
+
disabled
|
|
2737
|
+
}
|
|
2738
|
+
),
|
|
2739
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2740
|
+
TimeField,
|
|
2741
|
+
{
|
|
2742
|
+
label: "To",
|
|
2743
|
+
value: value.to,
|
|
2744
|
+
onChange: (to) => onChange({ ...value, to }),
|
|
2745
|
+
hourRef: toHourRef,
|
|
2746
|
+
onDirty,
|
|
2747
|
+
disabled
|
|
2748
|
+
}
|
|
2749
|
+
),
|
|
2750
|
+
showDuration && /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkD2BLWOWK_js.cn(
|
|
2751
|
+
"text-[10px] font-medium",
|
|
2752
|
+
isOvernight ? "text-amber-500 dark:text-amber-400" : "text-gray-400 dark:text-gray-500"
|
|
2753
|
+
), children: durationLabel }),
|
|
2754
|
+
incompleteHint && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-amber-500 dark:text-amber-400", children: incompleteHint })
|
|
2755
|
+
] })
|
|
2756
|
+
] });
|
|
2415
2757
|
}
|
|
2416
|
-
function TimePickerRow({ value, onChange, disabled = false }) {
|
|
2417
|
-
const toHourRef =
|
|
2418
|
-
const
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
const durationLabel = durationRemaining > 0 ? `${durationHours}h ${durationRemaining}m window${isOvernight ? " (overnight)" : ""}` : `${durationHours}h window${isOvernight ? " (overnight)" : ""}`;
|
|
2430
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2431
|
-
"div",
|
|
2432
|
-
{
|
|
2433
|
-
className: chunk23BJPJOK_js.cn(
|
|
2434
|
-
"flex flex-col px-4 pt-2 pb-3 gap-1",
|
|
2435
|
-
"border-t border-gray-100 dark:border-neutral-700"
|
|
2758
|
+
function TimePickerRow({ value, onChange, disabled = false, onRemove, showRemove = false, onDirty }) {
|
|
2759
|
+
const toHourRef = React11__namespace.useRef(null);
|
|
2760
|
+
const { showDuration, durationLabel, isOvernight, incompleteHint } = useTimeFieldState(value);
|
|
2761
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col px-4 pt-2 pb-3 gap-1", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
2762
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
|
|
2763
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2764
|
+
lucideReact.Clock,
|
|
2765
|
+
{
|
|
2766
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2767
|
+
"w-4 h-4 shrink-0",
|
|
2768
|
+
disabled ? "text-gray-300 dark:text-gray-600" : "text-gray-400 dark:text-gray-500"
|
|
2769
|
+
)
|
|
2770
|
+
}
|
|
2436
2771
|
),
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
}
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
onMinuteComplete: () => toHourRef.current?.focus(),
|
|
2459
|
-
disabled
|
|
2460
|
-
}
|
|
2461
|
-
),
|
|
2462
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2463
|
-
"div",
|
|
2464
|
-
{
|
|
2465
|
-
className: chunk23BJPJOK_js.cn(
|
|
2466
|
-
"w-4 h-px",
|
|
2467
|
-
disabled ? "bg-gray-200 dark:bg-neutral-700" : "bg-gray-300 dark:bg-neutral-600"
|
|
2468
|
-
)
|
|
2469
|
-
}
|
|
2470
|
-
),
|
|
2471
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2472
|
-
TimeField,
|
|
2473
|
-
{
|
|
2474
|
-
label: "To",
|
|
2475
|
-
value: value.to,
|
|
2476
|
-
onChange: (to) => onChange({ ...value, to }),
|
|
2477
|
-
hourRef: toHourRef,
|
|
2478
|
-
disabled
|
|
2479
|
-
}
|
|
2772
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[9px] font-medium text-gray-300 dark:text-gray-600 tracking-wide", children: "OPT" })
|
|
2773
|
+
] }),
|
|
2774
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 flex-1", children: [
|
|
2775
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2776
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2777
|
+
TimeField,
|
|
2778
|
+
{
|
|
2779
|
+
label: "From",
|
|
2780
|
+
value: value.from,
|
|
2781
|
+
onChange: (from) => onChange({ ...value, from }),
|
|
2782
|
+
onMinuteComplete: () => toHourRef.current?.focus(),
|
|
2783
|
+
onDirty,
|
|
2784
|
+
disabled
|
|
2785
|
+
}
|
|
2786
|
+
),
|
|
2787
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2788
|
+
"div",
|
|
2789
|
+
{
|
|
2790
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2791
|
+
"w-4 h-px",
|
|
2792
|
+
disabled ? "bg-gray-200 dark:bg-neutral-700" : "bg-gray-300 dark:bg-neutral-600"
|
|
2480
2793
|
)
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2794
|
+
}
|
|
2795
|
+
),
|
|
2796
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2797
|
+
TimeField,
|
|
2798
|
+
{
|
|
2799
|
+
label: "To",
|
|
2800
|
+
value: value.to,
|
|
2801
|
+
onChange: (to) => onChange({ ...value, to }),
|
|
2802
|
+
hourRef: toHourRef,
|
|
2803
|
+
onDirty,
|
|
2804
|
+
disabled
|
|
2805
|
+
}
|
|
2806
|
+
),
|
|
2807
|
+
showRemove && onRemove && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2808
|
+
Button,
|
|
2809
|
+
{
|
|
2810
|
+
variant: "outline",
|
|
2811
|
+
onClick: onRemove,
|
|
2812
|
+
className: "text-[0.625rem] border border-red-100 dark:border-red-700 rounded-md px-2 py-1 h-8 text-red-500 hover:text-red-600 dark:text-red-400 dark:hover:text-red-300 transition-colors",
|
|
2813
|
+
children: "Remove"
|
|
2814
|
+
}
|
|
2815
|
+
)
|
|
2816
|
+
] }),
|
|
2817
|
+
showDuration && /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkD2BLWOWK_js.cn(
|
|
2818
|
+
"text-[10px] font-medium pl-0.5",
|
|
2819
|
+
isOvernight ? "text-amber-500 dark:text-amber-400" : "text-gray-400 dark:text-gray-500"
|
|
2820
|
+
), children: durationLabel }),
|
|
2821
|
+
incompleteHint && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium pl-0.5 text-amber-500 dark:text-amber-400", children: incompleteHint })
|
|
2822
|
+
] })
|
|
2823
|
+
] }) });
|
|
2490
2824
|
}
|
|
2491
2825
|
var WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
2492
2826
|
function getCalendarDays(month) {
|
|
@@ -2534,7 +2868,7 @@ function CalendarMonth({
|
|
|
2534
2868
|
"button",
|
|
2535
2869
|
{
|
|
2536
2870
|
onClick: onPrevMonth,
|
|
2537
|
-
className:
|
|
2871
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2538
2872
|
"p-1 rounded-md transition-colors",
|
|
2539
2873
|
showPrevNav ? "hover:bg-gray-100 dark:hover:bg-neutral-700 text-gray-500 dark:text-gray-400" : "invisible pointer-events-none"
|
|
2540
2874
|
),
|
|
@@ -2546,7 +2880,7 @@ function CalendarMonth({
|
|
|
2546
2880
|
"button",
|
|
2547
2881
|
{
|
|
2548
2882
|
onClick: onNextMonth,
|
|
2549
|
-
className:
|
|
2883
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2550
2884
|
"p-1 rounded-md transition-colors",
|
|
2551
2885
|
showNextNav ? "hover:bg-gray-100 dark:hover:bg-neutral-700 text-gray-500 dark:text-gray-400" : "invisible pointer-events-none"
|
|
2552
2886
|
),
|
|
@@ -2581,7 +2915,7 @@ function CalendarMonth({
|
|
|
2581
2915
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2582
2916
|
"div",
|
|
2583
2917
|
{
|
|
2584
|
-
className:
|
|
2918
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2585
2919
|
"h-9 flex items-center justify-center",
|
|
2586
2920
|
(inRange || rangeStart || rangeEnd) && "bg-blue-50 dark:bg-blue-950/40",
|
|
2587
2921
|
rangeStart && !rangeEnd && "rounded-l-full",
|
|
@@ -2595,7 +2929,7 @@ function CalendarMonth({
|
|
|
2595
2929
|
onMouseEnter: () => !disabled && onDayHover(day),
|
|
2596
2930
|
tabIndex: disabled ? -1 : 0,
|
|
2597
2931
|
disabled,
|
|
2598
|
-
className:
|
|
2932
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2599
2933
|
"w-8 h-8 rounded-full text-sm flex items-center justify-center transition-colors",
|
|
2600
2934
|
isFuture && "text-gray-300 dark:text-gray-600 pointer-events-none cursor-not-allowed",
|
|
2601
2935
|
!disabled && !rangeStart && !rangeEnd && "text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-neutral-700",
|
|
@@ -2614,6 +2948,167 @@ function CalendarMonth({
|
|
|
2614
2948
|
)
|
|
2615
2949
|
] });
|
|
2616
2950
|
}
|
|
2951
|
+
function useDateRangePicker({
|
|
2952
|
+
value,
|
|
2953
|
+
onChange,
|
|
2954
|
+
showTimePicker = false,
|
|
2955
|
+
timeValue,
|
|
2956
|
+
onTimeChange
|
|
2957
|
+
}) {
|
|
2958
|
+
const [open, setOpen] = React11__namespace.useState(false);
|
|
2959
|
+
const [internalRange, setInternalRange] = React11__namespace.useState({
|
|
2960
|
+
from: void 0,
|
|
2961
|
+
to: void 0
|
|
2962
|
+
});
|
|
2963
|
+
const [draft, setDraft] = React11__namespace.useState({
|
|
2964
|
+
from: void 0,
|
|
2965
|
+
to: void 0
|
|
2966
|
+
});
|
|
2967
|
+
const [hoverDate, setHoverDate] = React11__namespace.useState();
|
|
2968
|
+
const [viewMonth, setViewMonth] = React11__namespace.useState(
|
|
2969
|
+
() => dateFns.startOfMonth(value?.from ?? /* @__PURE__ */ new Date())
|
|
2970
|
+
);
|
|
2971
|
+
const [activePreset, setActivePreset] = React11__namespace.useState();
|
|
2972
|
+
const [committedInternalTime, setCommittedInternalTime] = React11__namespace.useState(DEFAULT_TIME_RANGE);
|
|
2973
|
+
const [draftTime, setDraftTime] = React11__namespace.useState(DEFAULT_TIME_RANGE);
|
|
2974
|
+
const [timeExpanded, setTimeExpanded] = React11__namespace.useState(false);
|
|
2975
|
+
const [timeDirty, setTimeDirty] = React11__namespace.useState(false);
|
|
2976
|
+
const committedRange = value ?? internalRange;
|
|
2977
|
+
const committedTime = timeValue ?? committedInternalTime;
|
|
2978
|
+
const timeVisible = !!(draft.from && draft.to);
|
|
2979
|
+
const hasAnyTimeInput = timeDirty || draftTime.from.hour !== null || draftTime.from.minute !== null || draftTime.to.hour !== null || draftTime.to.minute !== null;
|
|
2980
|
+
const isTimeComplete2 = draftTime.from.hour !== null && draftTime.from.minute !== null && draftTime.to.hour !== null && draftTime.to.minute !== null;
|
|
2981
|
+
const hasPartialTime = showTimePicker && timeExpanded && !isTimeComplete2;
|
|
2982
|
+
const canClear = !!(draft.from || committedRange.from);
|
|
2983
|
+
const canApply = !(draft.from && !draft.to) && !!(draft.from || committedRange.from) && !hasPartialTime;
|
|
2984
|
+
const resetTime = React11__namespace.useCallback(() => {
|
|
2985
|
+
setDraftTime(DEFAULT_TIME_RANGE);
|
|
2986
|
+
setTimeExpanded(false);
|
|
2987
|
+
setTimeDirty(false);
|
|
2988
|
+
}, []);
|
|
2989
|
+
const handleTimeChange = React11__namespace.useCallback((newTime) => {
|
|
2990
|
+
setDraftTime(newTime);
|
|
2991
|
+
}, []);
|
|
2992
|
+
const handleOpenChange = React11__namespace.useCallback(
|
|
2993
|
+
(newOpen) => {
|
|
2994
|
+
if (newOpen) {
|
|
2995
|
+
setDraft(committedRange);
|
|
2996
|
+
if (committedRange.from)
|
|
2997
|
+
setViewMonth(dateFns.startOfMonth(committedRange.from));
|
|
2998
|
+
setDraftTime(committedTime);
|
|
2999
|
+
const hasExistingTime = committedTime.from.hour !== null || committedTime.from.minute !== null || committedTime.to.hour !== null || committedTime.to.minute !== null;
|
|
3000
|
+
setTimeExpanded(hasExistingTime);
|
|
3001
|
+
setTimeDirty(false);
|
|
3002
|
+
}
|
|
3003
|
+
setOpen(newOpen);
|
|
3004
|
+
},
|
|
3005
|
+
[committedRange, committedTime]
|
|
3006
|
+
);
|
|
3007
|
+
const handleDayClick = React11__namespace.useCallback(
|
|
3008
|
+
(date) => {
|
|
3009
|
+
const { from, to } = draft;
|
|
3010
|
+
if (!from || from && to) {
|
|
3011
|
+
setDraft({ from: date, to: void 0 });
|
|
3012
|
+
setActivePreset(void 0);
|
|
3013
|
+
if (showTimePicker && timeExpanded) {
|
|
3014
|
+
resetTime();
|
|
3015
|
+
}
|
|
3016
|
+
return;
|
|
3017
|
+
}
|
|
3018
|
+
const [start, end] = dateFns.isBefore(from, date) ? [from, date] : [date, from];
|
|
3019
|
+
setDraft({ from: start, to: end });
|
|
3020
|
+
setHoverDate(void 0);
|
|
3021
|
+
},
|
|
3022
|
+
[draft, showTimePicker, timeExpanded, resetTime]
|
|
3023
|
+
);
|
|
3024
|
+
const handlePreset = React11__namespace.useCallback(
|
|
3025
|
+
(preset) => {
|
|
3026
|
+
const newRange = preset.getRange();
|
|
3027
|
+
setDraft(newRange);
|
|
3028
|
+
setActivePreset(preset.label);
|
|
3029
|
+
if (newRange.from) setViewMonth(dateFns.startOfMonth(newRange.from));
|
|
3030
|
+
if (showTimePicker) resetTime();
|
|
3031
|
+
},
|
|
3032
|
+
[showTimePicker, resetTime]
|
|
3033
|
+
);
|
|
3034
|
+
const handleApply = React11__namespace.useCallback(() => {
|
|
3035
|
+
if (draft.from && !draft.to) return;
|
|
3036
|
+
const newRange = draft.from && draft.to ? draft : void 0;
|
|
3037
|
+
const rangeChanged = newRange?.from?.getTime() !== committedRange.from?.getTime() || newRange?.to?.getTime() !== committedRange.to?.getTime();
|
|
3038
|
+
const timeChanged = draftTime.from.hour !== committedTime.from.hour || draftTime.from.minute !== committedTime.from.minute || draftTime.to.hour !== committedTime.to.hour || draftTime.to.minute !== committedTime.to.minute;
|
|
3039
|
+
if (rangeChanged) {
|
|
3040
|
+
if (onChange) onChange(newRange);
|
|
3041
|
+
else setInternalRange(newRange ?? { from: void 0, to: void 0 });
|
|
3042
|
+
}
|
|
3043
|
+
if (timeChanged) {
|
|
3044
|
+
if (onTimeChange) onTimeChange(draftTime);
|
|
3045
|
+
else setCommittedInternalTime(draftTime);
|
|
3046
|
+
}
|
|
3047
|
+
setOpen(false);
|
|
3048
|
+
}, [draft, onChange, committedRange, draftTime, committedTime, onTimeChange]);
|
|
3049
|
+
const handleClear = React11__namespace.useCallback(() => {
|
|
3050
|
+
setDraft({ from: void 0, to: void 0 });
|
|
3051
|
+
setActivePreset(void 0);
|
|
3052
|
+
if (showTimePicker) resetTime();
|
|
3053
|
+
}, [showTimePicker, resetTime]);
|
|
3054
|
+
const expandTime = React11__namespace.useCallback(() => {
|
|
3055
|
+
setTimeExpanded(true);
|
|
3056
|
+
}, []);
|
|
3057
|
+
const markTimeDirty = React11__namespace.useCallback(() => {
|
|
3058
|
+
setTimeDirty(true);
|
|
3059
|
+
}, []);
|
|
3060
|
+
return {
|
|
3061
|
+
open,
|
|
3062
|
+
draft,
|
|
3063
|
+
hoverDate,
|
|
3064
|
+
viewMonth,
|
|
3065
|
+
activePreset,
|
|
3066
|
+
committedRange,
|
|
3067
|
+
committedTime,
|
|
3068
|
+
draftTime,
|
|
3069
|
+
timeExpanded,
|
|
3070
|
+
timeVisible,
|
|
3071
|
+
hasAnyTimeInput,
|
|
3072
|
+
canClear,
|
|
3073
|
+
canApply,
|
|
3074
|
+
showTimePicker,
|
|
3075
|
+
setHoverDate,
|
|
3076
|
+
setViewMonth,
|
|
3077
|
+
handleTimeChange,
|
|
3078
|
+
handleOpenChange,
|
|
3079
|
+
handleDayClick,
|
|
3080
|
+
handlePreset,
|
|
3081
|
+
handleApply,
|
|
3082
|
+
handleClear,
|
|
3083
|
+
resetTime,
|
|
3084
|
+
expandTime,
|
|
3085
|
+
markTimeDirty
|
|
3086
|
+
};
|
|
3087
|
+
}
|
|
3088
|
+
function formatTime(hour, minute) {
|
|
3089
|
+
const period = hour >= 12 ? "PM" : "AM";
|
|
3090
|
+
const h = hour % 12 || 12;
|
|
3091
|
+
const m = minute.toString().padStart(2, "0");
|
|
3092
|
+
return `${h}:${m} ${period}`;
|
|
3093
|
+
}
|
|
3094
|
+
function isTimeComplete(time) {
|
|
3095
|
+
return time.from.hour !== null && time.from.minute !== null && time.to.hour !== null && time.to.minute !== null;
|
|
3096
|
+
}
|
|
3097
|
+
function formatDateRange(range, placeholder, time) {
|
|
3098
|
+
if (!range?.from) return placeholder;
|
|
3099
|
+
const hasTime = time && isTimeComplete(time);
|
|
3100
|
+
if (!range.to || dateFns.isSameDay(range.from, range.to)) {
|
|
3101
|
+
const dateStr = dateFns.format(range.from, "MMM d, yyyy");
|
|
3102
|
+
return hasTime ? `${dateStr} ${formatTime(time.from.hour, time.from.minute)} \u2013 ${formatTime(time.to.hour, time.to.minute)}` : dateStr;
|
|
3103
|
+
}
|
|
3104
|
+
const sameYear = range.from.getFullYear() === range.to.getFullYear();
|
|
3105
|
+
const fromDate = dateFns.format(range.from, sameYear ? "MMM d" : "MMM d, yyyy");
|
|
3106
|
+
const toDate = dateFns.format(range.to, "MMM d, yyyy");
|
|
3107
|
+
if (hasTime) {
|
|
3108
|
+
return `${fromDate} ${formatTime(time.from.hour, time.from.minute)} \u2013 ${toDate} ${formatTime(time.to.hour, time.to.minute)}`;
|
|
3109
|
+
}
|
|
3110
|
+
return `${fromDate} \u2013 ${toDate}`;
|
|
3111
|
+
}
|
|
2617
3112
|
var DEFAULT_PRESETS = [
|
|
2618
3113
|
{
|
|
2619
3114
|
label: "Today",
|
|
@@ -2661,26 +3156,6 @@ var DEFAULT_PRESETS = [
|
|
|
2661
3156
|
}
|
|
2662
3157
|
}
|
|
2663
3158
|
];
|
|
2664
|
-
function formatTime(tv) {
|
|
2665
|
-
if (tv.hour === null || tv.minute === null) return "--:--";
|
|
2666
|
-
const period = tv.hour >= 12 ? "PM" : "AM";
|
|
2667
|
-
const h = tv.hour % 12 || 12;
|
|
2668
|
-
const m = tv.minute.toString().padStart(2, "0");
|
|
2669
|
-
return `${h}:${m} ${period}`;
|
|
2670
|
-
}
|
|
2671
|
-
function formatDateRange(range, placeholder, time) {
|
|
2672
|
-
if (!range?.from) return placeholder;
|
|
2673
|
-
const timeActive = time && time.from.hour !== null && time.to.hour !== null;
|
|
2674
|
-
const timeSuffix = timeActive ? ` ${formatTime(time.from)} \u2013 ${formatTime(time.to)}` : "";
|
|
2675
|
-
if (!range.to || dateFns.isSameDay(range.from, range.to)) {
|
|
2676
|
-
return dateFns.format(range.from, "MMM d, yyyy") + timeSuffix;
|
|
2677
|
-
}
|
|
2678
|
-
const sameYear = range.from.getFullYear() === range.to.getFullYear();
|
|
2679
|
-
if (sameYear) {
|
|
2680
|
-
return `${dateFns.format(range.from, "MMM d")} \u2013 ${dateFns.format(range.to, "MMM d, yyyy")}${timeSuffix}`;
|
|
2681
|
-
}
|
|
2682
|
-
return `${dateFns.format(range.from, "MMM d, yyyy")} \u2013 ${dateFns.format(range.to, "MMM d, yyyy")}${timeSuffix}`;
|
|
2683
|
-
}
|
|
2684
3159
|
function DateRangePicker({
|
|
2685
3160
|
value,
|
|
2686
3161
|
onChange,
|
|
@@ -2694,102 +3169,48 @@ function DateRangePicker({
|
|
|
2694
3169
|
timeValue,
|
|
2695
3170
|
onTimeChange
|
|
2696
3171
|
}) {
|
|
2697
|
-
const
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
from: void 0,
|
|
2704
|
-
to: void 0
|
|
3172
|
+
const picker = useDateRangePicker({
|
|
3173
|
+
value,
|
|
3174
|
+
onChange,
|
|
3175
|
+
showTimePicker,
|
|
3176
|
+
timeValue,
|
|
3177
|
+
onTimeChange
|
|
2705
3178
|
});
|
|
2706
|
-
const
|
|
2707
|
-
|
|
2708
|
-
() => dateFns.startOfMonth(value?.from ?? /* @__PURE__ */ new Date())
|
|
2709
|
-
);
|
|
2710
|
-
const [activePreset, setActivePreset] = React10__namespace.useState();
|
|
2711
|
-
const [internalTime, setInternalTime] = React10__namespace.useState(DEFAULT_TIME_RANGE);
|
|
2712
|
-
const committedRange = value ?? internalRange;
|
|
2713
|
-
const currentTime = timeValue ?? internalTime;
|
|
2714
|
-
const handleTimeChange = (newTime) => {
|
|
2715
|
-
if (onTimeChange) onTimeChange(newTime);
|
|
2716
|
-
else setInternalTime(newTime);
|
|
2717
|
-
};
|
|
2718
|
-
const timeVisible = !!(draft.from && draft.to);
|
|
2719
|
-
const handleOpenChange = (newOpen) => {
|
|
2720
|
-
if (newOpen) {
|
|
2721
|
-
setDraft(committedRange);
|
|
2722
|
-
if (committedRange.from) setLeftMonth(dateFns.startOfMonth(committedRange.from));
|
|
2723
|
-
if (!onTimeChange) setInternalTime(currentTime);
|
|
2724
|
-
}
|
|
2725
|
-
setOpen(newOpen);
|
|
2726
|
-
};
|
|
2727
|
-
const handleDayClick = (date) => {
|
|
2728
|
-
const { from, to } = draft;
|
|
2729
|
-
if (!from || from && to) {
|
|
2730
|
-
setDraft({ from: date, to: void 0 });
|
|
2731
|
-
setActivePreset(void 0);
|
|
2732
|
-
return;
|
|
2733
|
-
}
|
|
2734
|
-
const [start, end] = dateFns.isBefore(from, date) ? [from, date] : [date, from];
|
|
2735
|
-
setDraft({ from: start, to: end });
|
|
2736
|
-
setHoverDate(void 0);
|
|
2737
|
-
};
|
|
2738
|
-
const handlePreset = (preset) => {
|
|
2739
|
-
const newRange = preset.getRange();
|
|
2740
|
-
setDraft(newRange);
|
|
2741
|
-
setActivePreset(preset.label);
|
|
2742
|
-
if (newRange.from) setLeftMonth(dateFns.startOfMonth(newRange.from));
|
|
2743
|
-
};
|
|
2744
|
-
const handleApply = () => {
|
|
2745
|
-
if (draft.from && !draft.to) return;
|
|
2746
|
-
const newRange = draft.from && draft.to ? draft : void 0;
|
|
2747
|
-
if (onChange) onChange(newRange);
|
|
2748
|
-
else setInternalRange(newRange ?? { from: void 0, to: void 0 });
|
|
2749
|
-
setOpen(false);
|
|
2750
|
-
};
|
|
2751
|
-
const handleClear = () => {
|
|
2752
|
-
setDraft({ from: void 0, to: void 0 });
|
|
2753
|
-
setActivePreset(void 0);
|
|
2754
|
-
if (showTimePicker) handleTimeChange(DEFAULT_TIME_RANGE);
|
|
2755
|
-
};
|
|
2756
|
-
const canClear = !!(draft.from || committedRange.from);
|
|
2757
|
-
const canApply = !(draft.from && !draft.to) && !!(draft.from || committedRange.from);
|
|
2758
|
-
const rightMonth = dateFns.addMonths(leftMonth, 1);
|
|
2759
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
3179
|
+
const rightMonth = dateFns.addMonths(picker.viewMonth, 1);
|
|
3180
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: picker.open, onOpenChange: picker.handleOpenChange, children: [
|
|
2760
3181
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2761
3182
|
"button",
|
|
2762
3183
|
{
|
|
2763
3184
|
disabled,
|
|
2764
|
-
className:
|
|
3185
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2765
3186
|
"inline-flex items-center gap-2 rounded-md border border-gray-300 bg-white px-3 py-2 text-sm shadow-sm transition-colors",
|
|
2766
3187
|
"hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
2767
3188
|
"dark:border-neutral-600 dark:bg-neutral-800 dark:hover:bg-neutral-700",
|
|
2768
3189
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
2769
|
-
committedRange.from ? "text-gray-900 dark:text-gray-100" : "text-gray-400 dark:text-gray-500",
|
|
3190
|
+
picker.committedRange.from ? "text-gray-900 dark:text-gray-100" : "text-gray-400 dark:text-gray-500",
|
|
2770
3191
|
className
|
|
2771
3192
|
),
|
|
2772
3193
|
children: [
|
|
2773
3194
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "w-4 h-4 shrink-0 text-gray-400 dark:text-gray-500" }),
|
|
2774
3195
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: formatDateRange(
|
|
2775
|
-
committedRange,
|
|
3196
|
+
picker.committedRange,
|
|
2776
3197
|
placeholder,
|
|
2777
|
-
showTimePicker ?
|
|
3198
|
+
showTimePicker ? picker.committedTime : void 0
|
|
2778
3199
|
) })
|
|
2779
3200
|
]
|
|
2780
3201
|
}
|
|
2781
3202
|
) }),
|
|
2782
3203
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { align, className: "w-auto p-0 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex divide-x divide-gray-100 dark:divide-neutral-700", children: [
|
|
2783
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col p-3 gap-0.5 min-w-[130px]", children: (presetSections ?? [{ title: "Presets", options: presets }]).map((section, si) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3204
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col p-3 gap-0.5 min-w-[130px]", children: (presetSections ?? [{ title: "Presets", options: presets }]).map((section, si) => /* @__PURE__ */ jsxRuntime.jsxs(React11__namespace.Fragment, { children: [
|
|
2784
3205
|
si > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-2 border-t border-gray-100 dark:border-neutral-700" }),
|
|
2785
3206
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1 px-2", children: section.title }),
|
|
2786
3207
|
section.options.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2787
3208
|
"button",
|
|
2788
3209
|
{
|
|
2789
|
-
onClick: () => handlePreset(preset),
|
|
2790
|
-
className:
|
|
3210
|
+
onClick: () => picker.handlePreset(preset),
|
|
3211
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2791
3212
|
"w-full text-left px-2 py-1.5 rounded-md text-sm transition-colors",
|
|
2792
|
-
activePreset === preset.label ? "bg-blue-50 text-blue-600 font-medium dark:bg-blue-950/50 dark:text-blue-400" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700"
|
|
3213
|
+
picker.activePreset === preset.label ? "bg-blue-50 text-blue-600 font-medium dark:bg-blue-950/50 dark:text-blue-400" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700"
|
|
2793
3214
|
),
|
|
2794
3215
|
children: preset.label
|
|
2795
3216
|
},
|
|
@@ -2801,12 +3222,12 @@ function DateRangePicker({
|
|
|
2801
3222
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2802
3223
|
CalendarMonth,
|
|
2803
3224
|
{
|
|
2804
|
-
month:
|
|
2805
|
-
range: draft,
|
|
2806
|
-
hoverDate,
|
|
2807
|
-
onDayClick: handleDayClick,
|
|
2808
|
-
onDayHover: setHoverDate,
|
|
2809
|
-
onPrevMonth: () =>
|
|
3225
|
+
month: picker.viewMonth,
|
|
3226
|
+
range: picker.draft,
|
|
3227
|
+
hoverDate: picker.hoverDate,
|
|
3228
|
+
onDayClick: picker.handleDayClick,
|
|
3229
|
+
onDayHover: picker.setHoverDate,
|
|
3230
|
+
onPrevMonth: () => picker.setViewMonth(dateFns.subMonths(picker.viewMonth, 1)),
|
|
2810
3231
|
showPrevNav: true,
|
|
2811
3232
|
showNextNav: false
|
|
2812
3233
|
}
|
|
@@ -2816,46 +3237,72 @@ function DateRangePicker({
|
|
|
2816
3237
|
CalendarMonth,
|
|
2817
3238
|
{
|
|
2818
3239
|
month: rightMonth,
|
|
2819
|
-
range: draft,
|
|
2820
|
-
hoverDate,
|
|
2821
|
-
onDayClick: handleDayClick,
|
|
2822
|
-
onDayHover: setHoverDate,
|
|
2823
|
-
onNextMonth: () =>
|
|
3240
|
+
range: picker.draft,
|
|
3241
|
+
hoverDate: picker.hoverDate,
|
|
3242
|
+
onDayClick: picker.handleDayClick,
|
|
3243
|
+
onDayHover: picker.setHoverDate,
|
|
3244
|
+
onNextMonth: () => picker.setViewMonth(dateFns.addMonths(picker.viewMonth, 1)),
|
|
2824
3245
|
showPrevNav: false,
|
|
2825
3246
|
showNextNav: true
|
|
2826
3247
|
}
|
|
2827
3248
|
)
|
|
2828
3249
|
] }),
|
|
2829
|
-
showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3250
|
+
showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2830
3251
|
framerMotion.motion.div,
|
|
2831
3252
|
{
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
opacity: { duration: 0.2 }
|
|
2838
|
-
},
|
|
2839
|
-
className: "overflow-hidden",
|
|
2840
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2841
|
-
TimePickerRow,
|
|
3253
|
+
layout: true,
|
|
3254
|
+
transition: { layout: { duration: 0.2, ease: "easeInOut" } },
|
|
3255
|
+
className: "border-t border-gray-100 dark:border-neutral-700",
|
|
3256
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", initial: false, children: picker.timeVisible && !picker.timeExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3257
|
+
framerMotion.motion.div,
|
|
2842
3258
|
{
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
3259
|
+
initial: { opacity: 0 },
|
|
3260
|
+
animate: { opacity: 1 },
|
|
3261
|
+
exit: { opacity: 0 },
|
|
3262
|
+
transition: { duration: 0.12 },
|
|
3263
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-2 ", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3264
|
+
Button,
|
|
3265
|
+
{
|
|
3266
|
+
variant: "outline",
|
|
3267
|
+
onClick: picker.expandTime,
|
|
3268
|
+
leadingDecorator: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-3.5 h-3.5" }),
|
|
3269
|
+
className: "w-full rounded-md h-9",
|
|
3270
|
+
children: "Add time range"
|
|
3271
|
+
}
|
|
3272
|
+
) })
|
|
3273
|
+
},
|
|
3274
|
+
"add-time-btn"
|
|
3275
|
+
) : picker.timeVisible && picker.timeExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3276
|
+
framerMotion.motion.div,
|
|
3277
|
+
{
|
|
3278
|
+
initial: { opacity: 0 },
|
|
3279
|
+
animate: { opacity: 1 },
|
|
3280
|
+
exit: { opacity: 0 },
|
|
3281
|
+
transition: { duration: 0.12 },
|
|
3282
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3283
|
+
TimePickerRow,
|
|
3284
|
+
{
|
|
3285
|
+
value: picker.draftTime,
|
|
3286
|
+
onChange: picker.handleTimeChange,
|
|
3287
|
+
onRemove: picker.resetTime,
|
|
3288
|
+
showRemove: picker.timeExpanded,
|
|
3289
|
+
onDirty: picker.markTimeDirty
|
|
3290
|
+
}
|
|
3291
|
+
)
|
|
3292
|
+
},
|
|
3293
|
+
"time-picker"
|
|
3294
|
+
) : null })
|
|
3295
|
+
}
|
|
3296
|
+
),
|
|
2850
3297
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-2 px-4 py-3 border-t border-gray-100 dark:border-neutral-700", children: [
|
|
2851
3298
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2852
3299
|
"button",
|
|
2853
3300
|
{
|
|
2854
|
-
onClick: handleClear,
|
|
2855
|
-
disabled: !canClear,
|
|
2856
|
-
className:
|
|
3301
|
+
onClick: picker.handleClear,
|
|
3302
|
+
disabled: !picker.canClear,
|
|
3303
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2857
3304
|
"px-3 py-1.5 rounded-md text-sm transition-colors",
|
|
2858
|
-
canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
|
|
3305
|
+
picker.canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
|
|
2859
3306
|
),
|
|
2860
3307
|
children: "Clear"
|
|
2861
3308
|
}
|
|
@@ -2863,11 +3310,11 @@ function DateRangePicker({
|
|
|
2863
3310
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2864
3311
|
"button",
|
|
2865
3312
|
{
|
|
2866
|
-
onClick: handleApply,
|
|
2867
|
-
disabled: !canApply,
|
|
2868
|
-
className:
|
|
3313
|
+
onClick: picker.handleApply,
|
|
3314
|
+
disabled: !picker.canApply,
|
|
3315
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2869
3316
|
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors",
|
|
2870
|
-
canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
|
|
3317
|
+
picker.canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
|
|
2871
3318
|
),
|
|
2872
3319
|
children: "Apply"
|
|
2873
3320
|
}
|
|
@@ -2877,30 +3324,6 @@ function DateRangePicker({
|
|
|
2877
3324
|
] }) })
|
|
2878
3325
|
] });
|
|
2879
3326
|
}
|
|
2880
|
-
function formatTime2(tv) {
|
|
2881
|
-
if (tv.hour === null || tv.minute === null) return "";
|
|
2882
|
-
const period = tv.hour >= 12 ? "PM" : "AM";
|
|
2883
|
-
const h = tv.hour % 12 || 12;
|
|
2884
|
-
const m = tv.minute.toString().padStart(2, "0");
|
|
2885
|
-
return `${h}:${m} ${period}`;
|
|
2886
|
-
}
|
|
2887
|
-
function formatDateWithTime(date, dateFmt, time) {
|
|
2888
|
-
const dateStr = dateFns.format(date, dateFmt);
|
|
2889
|
-
const timeStr = time ? formatTime2(time) : "";
|
|
2890
|
-
return timeStr ? `${dateStr}, ${timeStr}` : dateStr;
|
|
2891
|
-
}
|
|
2892
|
-
function formatDateRange2(range, placeholder, time) {
|
|
2893
|
-
if (!range?.from) return placeholder;
|
|
2894
|
-
const hasTime = time && time.from.hour !== null && time.to.hour !== null;
|
|
2895
|
-
if (!range.to || dateFns.isSameDay(range.from, range.to)) {
|
|
2896
|
-
return formatDateWithTime(range.from, "MMMM d, yyyy", hasTime ? time.from : void 0);
|
|
2897
|
-
}
|
|
2898
|
-
const sameYear = range.from.getFullYear() === range.to.getFullYear();
|
|
2899
|
-
const fromFmt = sameYear ? "MMMM d" : "MMMM d, yyyy";
|
|
2900
|
-
const fromStr = formatDateWithTime(range.from, fromFmt, hasTime ? time.from : void 0);
|
|
2901
|
-
const toStr = formatDateWithTime(range.to, "MMMM d, yyyy", hasTime ? time.to : void 0);
|
|
2902
|
-
return `${fromStr} \u2013 ${toStr}`;
|
|
2903
|
-
}
|
|
2904
3327
|
function DateRangePickerMobile({
|
|
2905
3328
|
label,
|
|
2906
3329
|
value,
|
|
@@ -2914,103 +3337,49 @@ function DateRangePickerMobile({
|
|
|
2914
3337
|
timeValue,
|
|
2915
3338
|
onTimeChange
|
|
2916
3339
|
}) {
|
|
2917
|
-
const
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
3340
|
+
const picker = useDateRangePicker({
|
|
3341
|
+
value,
|
|
3342
|
+
onChange,
|
|
3343
|
+
showTimePicker,
|
|
3344
|
+
timeValue,
|
|
3345
|
+
onTimeChange
|
|
2921
3346
|
});
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
});
|
|
2926
|
-
const [hoverDate, setHoverDate] = React10__namespace.useState();
|
|
2927
|
-
const [viewMonth, setViewMonth] = React10__namespace.useState(
|
|
2928
|
-
() => dateFns.startOfMonth(value?.from ?? /* @__PURE__ */ new Date())
|
|
2929
|
-
);
|
|
2930
|
-
const [activePreset, setActivePreset] = React10__namespace.useState();
|
|
2931
|
-
const [internalTime, setInternalTime] = React10__namespace.useState(DEFAULT_TIME_RANGE);
|
|
2932
|
-
const committedRange = value ?? internalRange;
|
|
2933
|
-
const currentTime = timeValue ?? internalTime;
|
|
2934
|
-
const handleTimeChange = (newTime) => {
|
|
2935
|
-
if (onTimeChange) onTimeChange(newTime);
|
|
2936
|
-
else setInternalTime(newTime);
|
|
2937
|
-
};
|
|
2938
|
-
const timeVisible = !!(draft.from && draft.to);
|
|
2939
|
-
const handleOpenChange = (newOpen) => {
|
|
2940
|
-
if (newOpen) {
|
|
2941
|
-
setDraft(committedRange);
|
|
2942
|
-
if (committedRange.from) setViewMonth(dateFns.startOfMonth(committedRange.from));
|
|
2943
|
-
if (!onTimeChange) setInternalTime(currentTime);
|
|
2944
|
-
}
|
|
2945
|
-
setOpen(newOpen);
|
|
2946
|
-
};
|
|
2947
|
-
const handleDayClick = (date) => {
|
|
2948
|
-
const { from, to } = draft;
|
|
2949
|
-
if (!from || from && to) {
|
|
2950
|
-
setDraft({ from: date, to: void 0 });
|
|
2951
|
-
setActivePreset(void 0);
|
|
2952
|
-
return;
|
|
2953
|
-
}
|
|
2954
|
-
const [start, end] = dateFns.isBefore(from, date) ? [from, date] : [date, from];
|
|
2955
|
-
setDraft({ from: start, to: end });
|
|
2956
|
-
setHoverDate(void 0);
|
|
2957
|
-
};
|
|
2958
|
-
const handlePreset = (preset) => {
|
|
2959
|
-
const newRange = preset.getRange();
|
|
2960
|
-
setDraft(newRange);
|
|
2961
|
-
setActivePreset(preset.label);
|
|
2962
|
-
if (newRange.from) setViewMonth(dateFns.startOfMonth(newRange.from));
|
|
2963
|
-
};
|
|
2964
|
-
const handleApply = () => {
|
|
2965
|
-
if (draft.from && !draft.to) return;
|
|
2966
|
-
const newRange = draft.from && draft.to ? draft : void 0;
|
|
2967
|
-
if (onChange) onChange(newRange);
|
|
2968
|
-
else setInternalRange(newRange ?? { from: void 0, to: void 0 });
|
|
2969
|
-
setOpen(false);
|
|
2970
|
-
};
|
|
2971
|
-
const handleClear = () => {
|
|
2972
|
-
setDraft({ from: void 0, to: void 0 });
|
|
2973
|
-
setActivePreset(void 0);
|
|
2974
|
-
if (showTimePicker) handleTimeChange(DEFAULT_TIME_RANGE);
|
|
2975
|
-
};
|
|
2976
|
-
const canClear = !!(draft.from || committedRange.from);
|
|
2977
|
-
const canApply = !(draft.from && !draft.to) && !!(draft.from || committedRange.from);
|
|
2978
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunk23BJPJOK_js.cn("space-y-1.5", className), children: [
|
|
2979
|
-
label && /* @__PURE__ */ jsxRuntime.jsx(chunk23BJPJOK_js.Label, { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: label }),
|
|
2980
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
3347
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkD2BLWOWK_js.cn("space-y-1.5", className), children: [
|
|
3348
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(chunkD2BLWOWK_js.Label, { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: label }),
|
|
3349
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: picker.open, onOpenChange: picker.handleOpenChange, children: [
|
|
2981
3350
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2982
3351
|
"button",
|
|
2983
3352
|
{
|
|
2984
3353
|
disabled,
|
|
2985
|
-
className:
|
|
3354
|
+
className: chunkD2BLWOWK_js.cn(
|
|
2986
3355
|
"inline-flex w-full items-center gap-2 rounded-md border border-gray-300 bg-white px-3 py-2 text-sm shadow-sm transition-colors",
|
|
2987
3356
|
"hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
2988
3357
|
"dark:border-neutral-600 dark:bg-neutral-800 dark:hover:bg-neutral-700",
|
|
2989
3358
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
2990
|
-
committedRange.from ? "text-gray-900 dark:text-gray-100" : "text-gray-400 dark:text-gray-500"
|
|
3359
|
+
picker.committedRange.from ? "text-gray-900 dark:text-gray-100" : "text-gray-400 dark:text-gray-500"
|
|
2991
3360
|
),
|
|
2992
3361
|
children: [
|
|
2993
3362
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { className: "w-4 h-4 shrink-0 text-gray-400 dark:text-gray-500" }),
|
|
2994
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children:
|
|
2995
|
-
committedRange,
|
|
3363
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: formatDateRange(
|
|
3364
|
+
picker.committedRange,
|
|
2996
3365
|
placeholder,
|
|
2997
|
-
showTimePicker ?
|
|
3366
|
+
showTimePicker ? picker.committedTime : void 0
|
|
2998
3367
|
) })
|
|
2999
3368
|
]
|
|
3000
3369
|
}
|
|
3001
3370
|
) }),
|
|
3002
3371
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { align: "center", className: "w-auto p-0 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex divide-x divide-gray-100 dark:divide-neutral-700", children: [
|
|
3003
3372
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col p-2 gap-0.5 min-w-[110px] max-h-[360px] overflow-y-auto", children: (presetSections ?? [{ title: "Presets", options: presets }]).map(
|
|
3004
|
-
(section, si) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3373
|
+
(section, si) => /* @__PURE__ */ jsxRuntime.jsxs(React11__namespace.Fragment, { children: [
|
|
3005
3374
|
si > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-2 border-t border-gray-100 dark:border-neutral-700" }),
|
|
3006
3375
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1 px-2", children: section.title }),
|
|
3007
3376
|
section.options.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3008
3377
|
"button",
|
|
3009
3378
|
{
|
|
3010
|
-
onClick: () => handlePreset(preset),
|
|
3011
|
-
className:
|
|
3379
|
+
onClick: () => picker.handlePreset(preset),
|
|
3380
|
+
className: chunkD2BLWOWK_js.cn(
|
|
3012
3381
|
"w-full text-left px-2 py-1.5 rounded-md text-sm transition-colors",
|
|
3013
|
-
activePreset === preset.label ? "bg-blue-50 text-blue-600 font-medium dark:bg-blue-950/50 dark:text-blue-400" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700"
|
|
3382
|
+
picker.activePreset === preset.label ? "bg-blue-50 text-blue-600 font-medium dark:bg-blue-950/50 dark:text-blue-400" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700"
|
|
3014
3383
|
),
|
|
3015
3384
|
children: preset.label
|
|
3016
3385
|
},
|
|
@@ -3022,52 +3391,73 @@ function DateRangePickerMobile({
|
|
|
3022
3391
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3023
3392
|
CalendarMonth,
|
|
3024
3393
|
{
|
|
3025
|
-
month: viewMonth,
|
|
3026
|
-
range: draft,
|
|
3027
|
-
hoverDate,
|
|
3028
|
-
onDayClick: handleDayClick,
|
|
3029
|
-
onDayHover: setHoverDate,
|
|
3030
|
-
onPrevMonth: () => setViewMonth(dateFns.subMonths(viewMonth, 1)),
|
|
3031
|
-
onNextMonth: () => setViewMonth(dateFns.addMonths(viewMonth, 1)),
|
|
3394
|
+
month: picker.viewMonth,
|
|
3395
|
+
range: picker.draft,
|
|
3396
|
+
hoverDate: picker.hoverDate,
|
|
3397
|
+
onDayClick: picker.handleDayClick,
|
|
3398
|
+
onDayHover: picker.setHoverDate,
|
|
3399
|
+
onPrevMonth: () => picker.setViewMonth(dateFns.subMonths(picker.viewMonth, 1)),
|
|
3400
|
+
onNextMonth: () => picker.setViewMonth(dateFns.addMonths(picker.viewMonth, 1)),
|
|
3032
3401
|
showPrevNav: true,
|
|
3033
3402
|
showNextNav: true
|
|
3034
3403
|
}
|
|
3035
3404
|
) }),
|
|
3036
|
-
showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3405
|
+
showTimePicker && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3037
3406
|
framerMotion.motion.div,
|
|
3038
3407
|
{
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3408
|
+
layout: true,
|
|
3409
|
+
transition: { layout: { duration: 0.2, ease: "easeInOut" } },
|
|
3410
|
+
className: "border-t border-gray-100 dark:border-neutral-700",
|
|
3411
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", initial: false, children: picker.timeVisible && !picker.timeExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3412
|
+
framerMotion.motion.div,
|
|
3413
|
+
{
|
|
3414
|
+
initial: { opacity: 0 },
|
|
3415
|
+
animate: { opacity: 1 },
|
|
3416
|
+
exit: { opacity: 0 },
|
|
3417
|
+
transition: { duration: 0.12 },
|
|
3418
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3419
|
+
Button,
|
|
3420
|
+
{
|
|
3421
|
+
variant: "outline",
|
|
3422
|
+
onClick: picker.expandTime,
|
|
3423
|
+
leadingDecorator: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-3.5 h-3.5" }),
|
|
3424
|
+
className: "w-full rounded-md h-9",
|
|
3425
|
+
children: "Add time range"
|
|
3426
|
+
}
|
|
3427
|
+
) })
|
|
3048
3428
|
},
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3053
|
-
TimePickerColumn,
|
|
3429
|
+
"add-time-btn"
|
|
3430
|
+
) : picker.timeVisible && picker.timeExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3431
|
+
framerMotion.motion.div,
|
|
3054
3432
|
{
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3433
|
+
initial: { opacity: 0 },
|
|
3434
|
+
animate: { opacity: 1 },
|
|
3435
|
+
exit: { opacity: 0 },
|
|
3436
|
+
transition: { duration: 0.12 },
|
|
3437
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3438
|
+
TimePickerColumn,
|
|
3439
|
+
{
|
|
3440
|
+
value: picker.draftTime,
|
|
3441
|
+
onChange: picker.handleTimeChange,
|
|
3442
|
+
onRemove: picker.resetTime,
|
|
3443
|
+
showRemove: picker.timeExpanded,
|
|
3444
|
+
onDirty: picker.markTimeDirty
|
|
3445
|
+
}
|
|
3446
|
+
)
|
|
3447
|
+
},
|
|
3448
|
+
"time-picker"
|
|
3449
|
+
) : null })
|
|
3450
|
+
}
|
|
3451
|
+
),
|
|
3062
3452
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-2 px-2 py-3 border-t border-gray-100 dark:border-neutral-700", children: [
|
|
3063
3453
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3064
3454
|
"button",
|
|
3065
3455
|
{
|
|
3066
|
-
onClick: handleClear,
|
|
3067
|
-
disabled: !canClear,
|
|
3068
|
-
className:
|
|
3456
|
+
onClick: picker.handleClear,
|
|
3457
|
+
disabled: !picker.canClear,
|
|
3458
|
+
className: chunkD2BLWOWK_js.cn(
|
|
3069
3459
|
"px-3 py-1.5 rounded-md text-sm transition-colors",
|
|
3070
|
-
canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
|
|
3460
|
+
picker.canClear ? "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-neutral-700" : "text-gray-300 dark:text-gray-600 cursor-not-allowed"
|
|
3071
3461
|
),
|
|
3072
3462
|
children: "Clear"
|
|
3073
3463
|
}
|
|
@@ -3075,11 +3465,11 @@ function DateRangePickerMobile({
|
|
|
3075
3465
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3076
3466
|
"button",
|
|
3077
3467
|
{
|
|
3078
|
-
onClick: handleApply,
|
|
3079
|
-
disabled: !canApply,
|
|
3080
|
-
className:
|
|
3468
|
+
onClick: picker.handleApply,
|
|
3469
|
+
disabled: !picker.canApply,
|
|
3470
|
+
className: chunkD2BLWOWK_js.cn(
|
|
3081
3471
|
"px-3 py-1.5 rounded-md text-sm font-medium transition-colors",
|
|
3082
|
-
canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
|
|
3472
|
+
picker.canApply ? "bg-blue-600 text-white hover:bg-blue-700 dark:hover:bg-blue-500" : "bg-blue-100 text-blue-300 cursor-not-allowed dark:bg-blue-950/30 dark:text-blue-800"
|
|
3083
3473
|
),
|
|
3084
3474
|
children: "Apply"
|
|
3085
3475
|
}
|
|
@@ -3117,7 +3507,7 @@ function MobileDataCard({
|
|
|
3117
3507
|
image && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: image }),
|
|
3118
3508
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 space-y-2", children: [
|
|
3119
3509
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3120
|
-
|
|
3510
|
+
chunkD2BLWOWK_js.Text,
|
|
3121
3511
|
{
|
|
3122
3512
|
size: "sm",
|
|
3123
3513
|
weight: "semibold",
|
|
@@ -3125,7 +3515,7 @@ function MobileDataCard({
|
|
|
3125
3515
|
children: title
|
|
3126
3516
|
}
|
|
3127
3517
|
),
|
|
3128
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3518
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(chunkD2BLWOWK_js.Text, { size: "xs", className: "text-neutral-400 dark:text-neutral-500", children: subtitle }),
|
|
3129
3519
|
contentRows && contentRows.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-x-4 gap-y-1 text-xs", children: contentRows.map((row) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "truncate", children: [
|
|
3130
3520
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-neutral-400 dark:text-neutral-500", children: [
|
|
3131
3521
|
row.label,
|
|
@@ -3142,7 +3532,7 @@ function MobileDataCard({
|
|
|
3142
3532
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3143
3533
|
"div",
|
|
3144
3534
|
{
|
|
3145
|
-
className:
|
|
3535
|
+
className: chunkD2BLWOWK_js.cn(
|
|
3146
3536
|
"overflow-hidden rounded-lg border transition-colors",
|
|
3147
3537
|
isSelected ? "border-blue-500 bg-blue-50/50 dark:border-blue-400 dark:bg-blue-900/10" : "border-neutral-200 bg-white dark:border-neutral-700 dark:bg-neutral-800/30",
|
|
3148
3538
|
className
|
|
@@ -3172,11 +3562,11 @@ function MobileDataCard({
|
|
|
3172
3562
|
}
|
|
3173
3563
|
),
|
|
3174
3564
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3175
|
-
|
|
3565
|
+
chunkD2BLWOWK_js.Text,
|
|
3176
3566
|
{
|
|
3177
3567
|
size: "xs",
|
|
3178
3568
|
as: "span",
|
|
3179
|
-
className:
|
|
3569
|
+
className: chunkD2BLWOWK_js.cn(
|
|
3180
3570
|
isSelected ? "font-medium text-blue-600 dark:text-blue-400" : "text-neutral-400 dark:text-neutral-500"
|
|
3181
3571
|
),
|
|
3182
3572
|
children: isSelected ? "Selected" : "Select"
|
|
@@ -3195,13 +3585,13 @@ function MobileDataCard({
|
|
|
3195
3585
|
children: contentBody
|
|
3196
3586
|
}
|
|
3197
3587
|
) : contentBody,
|
|
3198
|
-
statsRenderer ?? (stats && stats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
3588
|
+
statsRenderer ?? (stats && stats.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkD2BLWOWK_js.cn("grid gap-1.5 px-3 pb-3", colsClass[cols]), children: stats.map((stat) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3199
3589
|
"div",
|
|
3200
3590
|
{
|
|
3201
3591
|
className: "flex flex-col items-center rounded-md bg-neutral-100 py-1.5 dark:bg-neutral-800",
|
|
3202
3592
|
children: [
|
|
3203
3593
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3204
|
-
|
|
3594
|
+
chunkD2BLWOWK_js.Text,
|
|
3205
3595
|
{
|
|
3206
3596
|
size: "xs",
|
|
3207
3597
|
as: "span",
|
|
@@ -3210,12 +3600,12 @@ function MobileDataCard({
|
|
|
3210
3600
|
}
|
|
3211
3601
|
),
|
|
3212
3602
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3213
|
-
|
|
3603
|
+
chunkD2BLWOWK_js.Text,
|
|
3214
3604
|
{
|
|
3215
3605
|
size: "sm",
|
|
3216
3606
|
weight: "semibold",
|
|
3217
3607
|
as: "span",
|
|
3218
|
-
className:
|
|
3608
|
+
className: chunkD2BLWOWK_js.cn(
|
|
3219
3609
|
"mt-0.5 tabular-nums",
|
|
3220
3610
|
stat.className ?? "text-neutral-800 dark:text-neutral-200"
|
|
3221
3611
|
),
|
|
@@ -3234,7 +3624,7 @@ function MobileDataCard({
|
|
|
3234
3624
|
className: "flex items-center justify-between",
|
|
3235
3625
|
children: [
|
|
3236
3626
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3237
|
-
|
|
3627
|
+
chunkD2BLWOWK_js.Text,
|
|
3238
3628
|
{
|
|
3239
3629
|
size: "xs",
|
|
3240
3630
|
as: "span",
|
|
@@ -3243,7 +3633,7 @@ function MobileDataCard({
|
|
|
3243
3633
|
}
|
|
3244
3634
|
),
|
|
3245
3635
|
detail.pill ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center rounded-full bg-blue-50 px-2 py-0.5 dark:bg-blue-900/30", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3246
|
-
|
|
3636
|
+
chunkD2BLWOWK_js.Text,
|
|
3247
3637
|
{
|
|
3248
3638
|
size: "xs",
|
|
3249
3639
|
weight: "medium",
|
|
@@ -3391,6 +3781,7 @@ exports.PopoverContent = PopoverContent;
|
|
|
3391
3781
|
exports.PopoverTrigger = PopoverTrigger;
|
|
3392
3782
|
exports.SegmentedControl = SegmentedControl;
|
|
3393
3783
|
exports.Select = Select;
|
|
3784
|
+
exports.SelectBar = SelectBar;
|
|
3394
3785
|
exports.SelectContent = SelectContent;
|
|
3395
3786
|
exports.SelectGroup = SelectGroup;
|
|
3396
3787
|
exports.SelectItem = SelectItem;
|
|
@@ -3443,5 +3834,5 @@ exports.useColumnVisibility = useColumnVisibility;
|
|
|
3443
3834
|
exports.useFormContext = useFormContext;
|
|
3444
3835
|
exports.useFormFieldContext = useFormFieldContext;
|
|
3445
3836
|
exports.useTableSelection = useTableSelection;
|
|
3446
|
-
//# sourceMappingURL=chunk-
|
|
3447
|
-
//# sourceMappingURL=chunk-
|
|
3837
|
+
//# sourceMappingURL=chunk-HKUYZ5K6.js.map
|
|
3838
|
+
//# sourceMappingURL=chunk-HKUYZ5K6.js.map
|