@petrarca/sonnet-ui 0.4.2 → 0.6.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/index.d.ts +244 -2
- package/dist/index.js +1513 -634
- package/dist/index.js.map +1 -1
- package/dist/json-editor/index.d.ts +9 -1
- package/dist/json-editor/index.js +24 -17
- package/dist/json-editor/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -147,10 +147,10 @@ var buttonVariants = cva3(
|
|
|
147
147
|
link: "text-primary underline-offset-4 hover:underline"
|
|
148
148
|
},
|
|
149
149
|
size: {
|
|
150
|
-
default: "h-
|
|
151
|
-
sm: "h-
|
|
152
|
-
lg: "h-
|
|
153
|
-
icon: "h-
|
|
150
|
+
default: "h-9 px-4 py-2",
|
|
151
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
152
|
+
lg: "h-10 rounded-md px-8",
|
|
153
|
+
icon: "h-9 w-9",
|
|
154
154
|
compact: "h-7 w-7 p-0"
|
|
155
155
|
}
|
|
156
156
|
},
|
|
@@ -175,15 +175,96 @@ var Button = React3.forwardRef(
|
|
|
175
175
|
);
|
|
176
176
|
Button.displayName = "Button";
|
|
177
177
|
|
|
178
|
-
// src/
|
|
178
|
+
// src/icon-button.tsx
|
|
179
|
+
import * as React5 from "react";
|
|
180
|
+
import { cn as cn6 } from "@petrarca/sonnet-core";
|
|
181
|
+
|
|
182
|
+
// src/tooltip.tsx
|
|
179
183
|
import * as React4 from "react";
|
|
184
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
180
185
|
import { cn as cn5 } from "@petrarca/sonnet-core";
|
|
181
186
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
182
|
-
var
|
|
183
|
-
|
|
187
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
188
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
189
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
190
|
+
var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
191
|
+
TooltipPrimitive.Content,
|
|
184
192
|
{
|
|
185
193
|
ref,
|
|
194
|
+
sideOffset,
|
|
186
195
|
className: cn5(
|
|
196
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-tooltip-content-transform-origin]",
|
|
197
|
+
className
|
|
198
|
+
),
|
|
199
|
+
...props
|
|
200
|
+
}
|
|
201
|
+
));
|
|
202
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
203
|
+
|
|
204
|
+
// src/simple-tooltip.tsx
|
|
205
|
+
import { jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
206
|
+
function SimpleTooltip({
|
|
207
|
+
label,
|
|
208
|
+
children,
|
|
209
|
+
side,
|
|
210
|
+
align,
|
|
211
|
+
delayDuration = 700,
|
|
212
|
+
sideOffset
|
|
213
|
+
}) {
|
|
214
|
+
return /* @__PURE__ */ jsx6(TooltipProvider, { delayDuration, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
215
|
+
/* @__PURE__ */ jsx6(TooltipTrigger, { asChild: true, children }),
|
|
216
|
+
/* @__PURE__ */ jsx6(TooltipContent, { side, align, sideOffset, children: label })
|
|
217
|
+
] }) });
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// src/icon-button.tsx
|
|
221
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
222
|
+
function revealClass(disabled) {
|
|
223
|
+
return disabled ? "disabled:opacity-30 group-hover/row:disabled:opacity-30" : "opacity-0 group-hover/row:opacity-100 focus:opacity-100";
|
|
224
|
+
}
|
|
225
|
+
var IconButton = React5.forwardRef(
|
|
226
|
+
function IconButton2({
|
|
227
|
+
label,
|
|
228
|
+
children,
|
|
229
|
+
tone = "default",
|
|
230
|
+
variant = "ghost",
|
|
231
|
+
tooltipSide,
|
|
232
|
+
revealOnHover = false,
|
|
233
|
+
className,
|
|
234
|
+
disabled,
|
|
235
|
+
...props
|
|
236
|
+
}, ref) {
|
|
237
|
+
const toneClass = variant === "ghost" ? tone === "destructive" ? "text-muted-foreground hover:text-destructive" : "text-muted-foreground hover:text-foreground" : tone === "destructive" ? "hover:text-destructive" : void 0;
|
|
238
|
+
return /* @__PURE__ */ jsx7(SimpleTooltip, { label, side: tooltipSide, children: /* @__PURE__ */ jsx7(
|
|
239
|
+
Button,
|
|
240
|
+
{
|
|
241
|
+
ref,
|
|
242
|
+
type: "button",
|
|
243
|
+
size: "compact",
|
|
244
|
+
variant,
|
|
245
|
+
"aria-label": label,
|
|
246
|
+
disabled,
|
|
247
|
+
className: cn6(
|
|
248
|
+
toneClass,
|
|
249
|
+
revealOnHover && revealClass(disabled),
|
|
250
|
+
className
|
|
251
|
+
),
|
|
252
|
+
...props,
|
|
253
|
+
children
|
|
254
|
+
}
|
|
255
|
+
) });
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
// src/card.tsx
|
|
260
|
+
import * as React6 from "react";
|
|
261
|
+
import { cn as cn7 } from "@petrarca/sonnet-core";
|
|
262
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
263
|
+
var Card = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
264
|
+
"div",
|
|
265
|
+
{
|
|
266
|
+
ref,
|
|
267
|
+
className: cn7(
|
|
187
268
|
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
188
269
|
className
|
|
189
270
|
),
|
|
@@ -191,20 +272,20 @@ var Card = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
191
272
|
}
|
|
192
273
|
));
|
|
193
274
|
Card.displayName = "Card";
|
|
194
|
-
var CardHeader =
|
|
275
|
+
var CardHeader = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
195
276
|
"div",
|
|
196
277
|
{
|
|
197
278
|
ref,
|
|
198
|
-
className:
|
|
279
|
+
className: cn7("flex flex-col space-y-1.5 p-6", className),
|
|
199
280
|
...props
|
|
200
281
|
}
|
|
201
282
|
));
|
|
202
283
|
CardHeader.displayName = "CardHeader";
|
|
203
|
-
var CardTitle =
|
|
284
|
+
var CardTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
204
285
|
"div",
|
|
205
286
|
{
|
|
206
287
|
ref,
|
|
207
|
-
className:
|
|
288
|
+
className: cn7(
|
|
208
289
|
"text-2xl font-semibold leading-none tracking-tight",
|
|
209
290
|
className
|
|
210
291
|
),
|
|
@@ -212,47 +293,47 @@ var CardTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
212
293
|
}
|
|
213
294
|
));
|
|
214
295
|
CardTitle.displayName = "CardTitle";
|
|
215
|
-
var CardDescription =
|
|
296
|
+
var CardDescription = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
216
297
|
"div",
|
|
217
298
|
{
|
|
218
299
|
ref,
|
|
219
|
-
className:
|
|
300
|
+
className: cn7("text-sm text-muted-foreground", className),
|
|
220
301
|
...props
|
|
221
302
|
}
|
|
222
303
|
));
|
|
223
304
|
CardDescription.displayName = "CardDescription";
|
|
224
|
-
var CardContent =
|
|
305
|
+
var CardContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8("div", { ref, className: cn7("p-6 pt-0", className), ...props }));
|
|
225
306
|
CardContent.displayName = "CardContent";
|
|
226
|
-
var CardFooter =
|
|
307
|
+
var CardFooter = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
227
308
|
"div",
|
|
228
309
|
{
|
|
229
310
|
ref,
|
|
230
|
-
className:
|
|
311
|
+
className: cn7("flex items-center p-6 pt-0", className),
|
|
231
312
|
...props
|
|
232
313
|
}
|
|
233
314
|
));
|
|
234
315
|
CardFooter.displayName = "CardFooter";
|
|
235
316
|
|
|
236
317
|
// src/checkbox.tsx
|
|
237
|
-
import * as
|
|
318
|
+
import * as React7 from "react";
|
|
238
319
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
239
320
|
import { Check } from "lucide-react";
|
|
240
|
-
import { cn as
|
|
241
|
-
import { jsx as
|
|
242
|
-
var Checkbox =
|
|
321
|
+
import { cn as cn8 } from "@petrarca/sonnet-core";
|
|
322
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
323
|
+
var Checkbox = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
243
324
|
CheckboxPrimitive.Root,
|
|
244
325
|
{
|
|
245
326
|
ref,
|
|
246
|
-
className:
|
|
327
|
+
className: cn8(
|
|
247
328
|
"grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
248
329
|
className
|
|
249
330
|
),
|
|
250
331
|
...props,
|
|
251
|
-
children: /* @__PURE__ */
|
|
332
|
+
children: /* @__PURE__ */ jsx9(
|
|
252
333
|
CheckboxPrimitive.Indicator,
|
|
253
334
|
{
|
|
254
|
-
className:
|
|
255
|
-
children: /* @__PURE__ */
|
|
335
|
+
className: cn8("grid place-content-center text-current"),
|
|
336
|
+
children: /* @__PURE__ */ jsx9(Check, { className: "h-4 w-4" })
|
|
256
337
|
}
|
|
257
338
|
)
|
|
258
339
|
}
|
|
@@ -266,26 +347,26 @@ var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
|
266
347
|
var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
267
348
|
|
|
268
349
|
// src/command.tsx
|
|
269
|
-
import * as
|
|
350
|
+
import * as React9 from "react";
|
|
270
351
|
import { Command as CommandPrimitive } from "cmdk";
|
|
271
352
|
import { Search } from "lucide-react";
|
|
272
|
-
import { cn as
|
|
353
|
+
import { cn as cn10 } from "@petrarca/sonnet-core";
|
|
273
354
|
|
|
274
355
|
// src/dialog.tsx
|
|
275
|
-
import * as
|
|
356
|
+
import * as React8 from "react";
|
|
276
357
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
277
358
|
import { X } from "lucide-react";
|
|
278
|
-
import { cn as
|
|
279
|
-
import { jsx as
|
|
359
|
+
import { cn as cn9 } from "@petrarca/sonnet-core";
|
|
360
|
+
import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
280
361
|
var Dialog = DialogPrimitive.Root;
|
|
281
362
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
282
363
|
var DialogPortal = DialogPrimitive.Portal;
|
|
283
364
|
var DialogClose = DialogPrimitive.Close;
|
|
284
|
-
var DialogOverlay =
|
|
365
|
+
var DialogOverlay = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
285
366
|
DialogPrimitive.Overlay,
|
|
286
367
|
{
|
|
287
368
|
ref,
|
|
288
|
-
className:
|
|
369
|
+
className: cn9(
|
|
289
370
|
"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",
|
|
290
371
|
className
|
|
291
372
|
),
|
|
@@ -293,22 +374,22 @@ var DialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
293
374
|
}
|
|
294
375
|
));
|
|
295
376
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
296
|
-
var DialogContent =
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
/* @__PURE__ */
|
|
377
|
+
var DialogContent = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs2(DialogPortal, { children: [
|
|
378
|
+
/* @__PURE__ */ jsx10(DialogOverlay, {}),
|
|
379
|
+
/* @__PURE__ */ jsxs2(
|
|
299
380
|
DialogPrimitive.Content,
|
|
300
381
|
{
|
|
301
382
|
ref,
|
|
302
|
-
className:
|
|
383
|
+
className: cn9(
|
|
303
384
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-lg",
|
|
304
385
|
className
|
|
305
386
|
),
|
|
306
387
|
...props,
|
|
307
388
|
children: [
|
|
308
389
|
children,
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ jsxs2(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
391
|
+
/* @__PURE__ */ jsx10(X, { className: "h-4 w-4" }),
|
|
392
|
+
/* @__PURE__ */ jsx10("span", { className: "sr-only", children: "Close" })
|
|
312
393
|
] })
|
|
313
394
|
]
|
|
314
395
|
}
|
|
@@ -318,10 +399,10 @@ DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
|
318
399
|
var DialogHeader = ({
|
|
319
400
|
className,
|
|
320
401
|
...props
|
|
321
|
-
}) => /* @__PURE__ */
|
|
402
|
+
}) => /* @__PURE__ */ jsx10(
|
|
322
403
|
"div",
|
|
323
404
|
{
|
|
324
|
-
className:
|
|
405
|
+
className: cn9(
|
|
325
406
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
326
407
|
className
|
|
327
408
|
),
|
|
@@ -332,10 +413,10 @@ DialogHeader.displayName = "DialogHeader";
|
|
|
332
413
|
var DialogFooter = ({
|
|
333
414
|
className,
|
|
334
415
|
...props
|
|
335
|
-
}) => /* @__PURE__ */
|
|
416
|
+
}) => /* @__PURE__ */ jsx10(
|
|
336
417
|
"div",
|
|
337
418
|
{
|
|
338
|
-
className:
|
|
419
|
+
className: cn9(
|
|
339
420
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
340
421
|
className
|
|
341
422
|
),
|
|
@@ -343,11 +424,11 @@ var DialogFooter = ({
|
|
|
343
424
|
}
|
|
344
425
|
);
|
|
345
426
|
DialogFooter.displayName = "DialogFooter";
|
|
346
|
-
var DialogTitle =
|
|
427
|
+
var DialogTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
347
428
|
DialogPrimitive.Title,
|
|
348
429
|
{
|
|
349
430
|
ref,
|
|
350
|
-
className:
|
|
431
|
+
className: cn9(
|
|
351
432
|
"text-lg font-semibold leading-none tracking-tight",
|
|
352
433
|
className
|
|
353
434
|
),
|
|
@@ -355,23 +436,23 @@ var DialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
355
436
|
}
|
|
356
437
|
));
|
|
357
438
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
358
|
-
var DialogDescription =
|
|
439
|
+
var DialogDescription = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
359
440
|
DialogPrimitive.Description,
|
|
360
441
|
{
|
|
361
442
|
ref,
|
|
362
|
-
className:
|
|
443
|
+
className: cn9("text-sm text-muted-foreground", className),
|
|
363
444
|
...props
|
|
364
445
|
}
|
|
365
446
|
));
|
|
366
447
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
367
448
|
|
|
368
449
|
// src/command.tsx
|
|
369
|
-
import { jsx as
|
|
370
|
-
var Command =
|
|
450
|
+
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
451
|
+
var Command = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
371
452
|
CommandPrimitive,
|
|
372
453
|
{
|
|
373
454
|
ref,
|
|
374
|
-
className:
|
|
455
|
+
className: cn10(
|
|
375
456
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
376
457
|
className
|
|
377
458
|
),
|
|
@@ -380,15 +461,15 @@ var Command = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
380
461
|
));
|
|
381
462
|
Command.displayName = CommandPrimitive.displayName;
|
|
382
463
|
var CommandDialog = ({ children, ...props }) => {
|
|
383
|
-
return /* @__PURE__ */
|
|
464
|
+
return /* @__PURE__ */ jsx11(Dialog, { ...props, children: /* @__PURE__ */ jsx11(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: /* @__PURE__ */ jsx11(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) });
|
|
384
465
|
};
|
|
385
|
-
var CommandInput =
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
466
|
+
var CommandInput = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs3("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
467
|
+
/* @__PURE__ */ jsx11(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
468
|
+
/* @__PURE__ */ jsx11(
|
|
388
469
|
CommandPrimitive.Input,
|
|
389
470
|
{
|
|
390
471
|
ref,
|
|
391
|
-
className:
|
|
472
|
+
className: cn10(
|
|
392
473
|
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
393
474
|
className
|
|
394
475
|
),
|
|
@@ -397,16 +478,16 @@ var CommandInput = React7.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
397
478
|
)
|
|
398
479
|
] }));
|
|
399
480
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
400
|
-
var CommandList =
|
|
481
|
+
var CommandList = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
401
482
|
CommandPrimitive.List,
|
|
402
483
|
{
|
|
403
484
|
ref,
|
|
404
|
-
className:
|
|
485
|
+
className: cn10("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
405
486
|
...props
|
|
406
487
|
}
|
|
407
488
|
));
|
|
408
489
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
409
|
-
var CommandEmpty =
|
|
490
|
+
var CommandEmpty = React9.forwardRef((props, ref) => /* @__PURE__ */ jsx11(
|
|
410
491
|
CommandPrimitive.Empty,
|
|
411
492
|
{
|
|
412
493
|
ref,
|
|
@@ -415,11 +496,11 @@ var CommandEmpty = React7.forwardRef((props, ref) => /* @__PURE__ */ jsx8(
|
|
|
415
496
|
}
|
|
416
497
|
));
|
|
417
498
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
418
|
-
var CommandGroup =
|
|
499
|
+
var CommandGroup = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
419
500
|
CommandPrimitive.Group,
|
|
420
501
|
{
|
|
421
502
|
ref,
|
|
422
|
-
className:
|
|
503
|
+
className: cn10(
|
|
423
504
|
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
424
505
|
className
|
|
425
506
|
),
|
|
@@ -427,20 +508,20 @@ var CommandGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
427
508
|
}
|
|
428
509
|
));
|
|
429
510
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
430
|
-
var CommandSeparator =
|
|
511
|
+
var CommandSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
431
512
|
CommandPrimitive.Separator,
|
|
432
513
|
{
|
|
433
514
|
ref,
|
|
434
|
-
className:
|
|
515
|
+
className: cn10("-mx-1 h-px bg-border", className),
|
|
435
516
|
...props
|
|
436
517
|
}
|
|
437
518
|
));
|
|
438
519
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
439
|
-
var CommandItem =
|
|
520
|
+
var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
440
521
|
CommandPrimitive.Item,
|
|
441
522
|
{
|
|
442
523
|
ref,
|
|
443
|
-
className:
|
|
524
|
+
className: cn10(
|
|
444
525
|
"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
445
526
|
className
|
|
446
527
|
),
|
|
@@ -452,10 +533,10 @@ var CommandShortcut = ({
|
|
|
452
533
|
className,
|
|
453
534
|
...props
|
|
454
535
|
}) => {
|
|
455
|
-
return /* @__PURE__ */
|
|
536
|
+
return /* @__PURE__ */ jsx11(
|
|
456
537
|
"span",
|
|
457
538
|
{
|
|
458
|
-
className:
|
|
539
|
+
className: cn10(
|
|
459
540
|
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
460
541
|
className
|
|
461
542
|
),
|
|
@@ -466,22 +547,22 @@ var CommandShortcut = ({
|
|
|
466
547
|
CommandShortcut.displayName = "CommandShortcut";
|
|
467
548
|
|
|
468
549
|
// src/dropdown-menu.tsx
|
|
469
|
-
import * as
|
|
550
|
+
import * as React10 from "react";
|
|
470
551
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
471
552
|
import { Check as Check2, ChevronRight, Circle } from "lucide-react";
|
|
472
|
-
import { cn as
|
|
473
|
-
import { jsx as
|
|
553
|
+
import { cn as cn11 } from "@petrarca/sonnet-core";
|
|
554
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
474
555
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
475
556
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
476
557
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
477
558
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
478
559
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
479
560
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
480
|
-
var DropdownMenuSubTrigger =
|
|
561
|
+
var DropdownMenuSubTrigger = React10.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs4(
|
|
481
562
|
DropdownMenuPrimitive.SubTrigger,
|
|
482
563
|
{
|
|
483
564
|
ref,
|
|
484
|
-
className:
|
|
565
|
+
className: cn11(
|
|
485
566
|
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
486
567
|
inset && "pl-8",
|
|
487
568
|
className
|
|
@@ -489,16 +570,16 @@ var DropdownMenuSubTrigger = React8.forwardRef(({ className, inset, children, ..
|
|
|
489
570
|
...props,
|
|
490
571
|
children: [
|
|
491
572
|
children,
|
|
492
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ jsx12(ChevronRight, { className: "ml-auto" })
|
|
493
574
|
]
|
|
494
575
|
}
|
|
495
576
|
));
|
|
496
577
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
497
|
-
var DropdownMenuSubContent =
|
|
578
|
+
var DropdownMenuSubContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
498
579
|
DropdownMenuPrimitive.SubContent,
|
|
499
580
|
{
|
|
500
581
|
ref,
|
|
501
|
-
className:
|
|
582
|
+
className: cn11(
|
|
502
583
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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]",
|
|
503
584
|
className
|
|
504
585
|
),
|
|
@@ -506,12 +587,12 @@ var DropdownMenuSubContent = React8.forwardRef(({ className, ...props }, ref) =>
|
|
|
506
587
|
}
|
|
507
588
|
));
|
|
508
589
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
509
|
-
var DropdownMenuContent =
|
|
590
|
+
var DropdownMenuContent = React10.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx12(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx12(
|
|
510
591
|
DropdownMenuPrimitive.Content,
|
|
511
592
|
{
|
|
512
593
|
ref,
|
|
513
594
|
sideOffset,
|
|
514
|
-
className:
|
|
595
|
+
className: cn11(
|
|
515
596
|
"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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]",
|
|
516
597
|
className
|
|
517
598
|
),
|
|
@@ -519,11 +600,11 @@ var DropdownMenuContent = React8.forwardRef(({ className, sideOffset = 4, ...pro
|
|
|
519
600
|
}
|
|
520
601
|
) }));
|
|
521
602
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
522
|
-
var DropdownMenuItem =
|
|
603
|
+
var DropdownMenuItem = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
523
604
|
DropdownMenuPrimitive.Item,
|
|
524
605
|
{
|
|
525
606
|
ref,
|
|
526
|
-
className:
|
|
607
|
+
className: cn11(
|
|
527
608
|
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
528
609
|
inset && "pl-8",
|
|
529
610
|
className
|
|
@@ -532,44 +613,44 @@ var DropdownMenuItem = React8.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
532
613
|
}
|
|
533
614
|
));
|
|
534
615
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
535
|
-
var DropdownMenuCheckboxItem =
|
|
616
|
+
var DropdownMenuCheckboxItem = React10.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs4(
|
|
536
617
|
DropdownMenuPrimitive.CheckboxItem,
|
|
537
618
|
{
|
|
538
619
|
ref,
|
|
539
|
-
className:
|
|
620
|
+
className: cn11(
|
|
540
621
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
541
622
|
className
|
|
542
623
|
),
|
|
543
624
|
checked,
|
|
544
625
|
...props,
|
|
545
626
|
children: [
|
|
546
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ jsx12("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx12(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx12(Check2, { className: "h-4 w-4" }) }) }),
|
|
547
628
|
children
|
|
548
629
|
]
|
|
549
630
|
}
|
|
550
631
|
));
|
|
551
632
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
552
|
-
var DropdownMenuRadioItem =
|
|
633
|
+
var DropdownMenuRadioItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs4(
|
|
553
634
|
DropdownMenuPrimitive.RadioItem,
|
|
554
635
|
{
|
|
555
636
|
ref,
|
|
556
|
-
className:
|
|
637
|
+
className: cn11(
|
|
557
638
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
558
639
|
className
|
|
559
640
|
),
|
|
560
641
|
...props,
|
|
561
642
|
children: [
|
|
562
|
-
/* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ jsx12("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx12(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx12(Circle, { className: "h-2 w-2 fill-current" }) }) }),
|
|
563
644
|
children
|
|
564
645
|
]
|
|
565
646
|
}
|
|
566
647
|
));
|
|
567
648
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
568
|
-
var DropdownMenuLabel =
|
|
649
|
+
var DropdownMenuLabel = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
569
650
|
DropdownMenuPrimitive.Label,
|
|
570
651
|
{
|
|
571
652
|
ref,
|
|
572
|
-
className:
|
|
653
|
+
className: cn11(
|
|
573
654
|
"px-2 py-1.5 text-sm font-semibold",
|
|
574
655
|
inset && "pl-8",
|
|
575
656
|
className
|
|
@@ -578,11 +659,11 @@ var DropdownMenuLabel = React8.forwardRef(({ className, inset, ...props }, ref)
|
|
|
578
659
|
}
|
|
579
660
|
));
|
|
580
661
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
581
|
-
var DropdownMenuSeparator =
|
|
662
|
+
var DropdownMenuSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
582
663
|
DropdownMenuPrimitive.Separator,
|
|
583
664
|
{
|
|
584
665
|
ref,
|
|
585
|
-
className:
|
|
666
|
+
className: cn11("-mx-1 my-1 h-px bg-muted", className),
|
|
586
667
|
...props
|
|
587
668
|
}
|
|
588
669
|
));
|
|
@@ -591,10 +672,10 @@ var DropdownMenuShortcut = ({
|
|
|
591
672
|
className,
|
|
592
673
|
...props
|
|
593
674
|
}) => {
|
|
594
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ jsx12(
|
|
595
676
|
"span",
|
|
596
677
|
{
|
|
597
|
-
className:
|
|
678
|
+
className: cn11("ml-auto text-xs tracking-widest opacity-60", className),
|
|
598
679
|
...props
|
|
599
680
|
}
|
|
600
681
|
);
|
|
@@ -602,16 +683,16 @@ var DropdownMenuShortcut = ({
|
|
|
602
683
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
603
684
|
|
|
604
685
|
// src/input.tsx
|
|
605
|
-
import * as
|
|
606
|
-
import { cn as
|
|
607
|
-
import { jsx as
|
|
608
|
-
var Input =
|
|
686
|
+
import * as React11 from "react";
|
|
687
|
+
import { cn as cn12 } from "@petrarca/sonnet-core";
|
|
688
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
689
|
+
var Input = React11.forwardRef(
|
|
609
690
|
({ className, type, ...props }, ref) => {
|
|
610
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ jsx13(
|
|
611
692
|
"input",
|
|
612
693
|
{
|
|
613
694
|
type,
|
|
614
|
-
className:
|
|
695
|
+
className: cn12(
|
|
615
696
|
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
616
697
|
className
|
|
617
698
|
),
|
|
@@ -620,22 +701,681 @@ var Input = React9.forwardRef(
|
|
|
620
701
|
}
|
|
621
702
|
);
|
|
622
703
|
}
|
|
623
|
-
);
|
|
624
|
-
Input.displayName = "Input";
|
|
704
|
+
);
|
|
705
|
+
Input.displayName = "Input";
|
|
706
|
+
function InputError({
|
|
707
|
+
error
|
|
708
|
+
}) {
|
|
709
|
+
if (!error) return null;
|
|
710
|
+
return /* @__PURE__ */ jsx13("p", { className: "mt-1 text-sm text-destructive", children: error });
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// src/DateInput/DateInput.tsx
|
|
714
|
+
import * as React14 from "react";
|
|
715
|
+
import { Calendar as CalendarIcon } from "lucide-react";
|
|
716
|
+
import {
|
|
717
|
+
cn as cn15,
|
|
718
|
+
compileDateFormat,
|
|
719
|
+
parseDate,
|
|
720
|
+
formatDateInput,
|
|
721
|
+
formatIsoDate,
|
|
722
|
+
parseIsoDate,
|
|
723
|
+
getLocaleDateFormat
|
|
724
|
+
} from "@petrarca/sonnet-core";
|
|
725
|
+
import { useLocale as useLocale2 } from "@petrarca/sonnet-core/config";
|
|
726
|
+
|
|
727
|
+
// src/popover.tsx
|
|
728
|
+
import * as React12 from "react";
|
|
729
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
730
|
+
import { cn as cn13 } from "@petrarca/sonnet-core";
|
|
731
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
732
|
+
var Popover = PopoverPrimitive.Root;
|
|
733
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
734
|
+
var PopoverContent = React12.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx14(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx14(
|
|
735
|
+
PopoverPrimitive.Content,
|
|
736
|
+
{
|
|
737
|
+
ref,
|
|
738
|
+
align,
|
|
739
|
+
sideOffset,
|
|
740
|
+
className: cn13(
|
|
741
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-popover-content-transform-origin]",
|
|
742
|
+
className
|
|
743
|
+
),
|
|
744
|
+
...props
|
|
745
|
+
}
|
|
746
|
+
) }));
|
|
747
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
748
|
+
|
|
749
|
+
// src/DateInput/Calendar.tsx
|
|
750
|
+
import * as React13 from "react";
|
|
751
|
+
import { ChevronLeft, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
752
|
+
import {
|
|
753
|
+
cn as cn14,
|
|
754
|
+
getWeekdayLabels,
|
|
755
|
+
getFirstDayOfWeek
|
|
756
|
+
} from "@petrarca/sonnet-core";
|
|
757
|
+
import { useLocale } from "@petrarca/sonnet-core/config";
|
|
758
|
+
import { Fragment, jsx as jsx15, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
759
|
+
var TERMINAL_VIEW = {
|
|
760
|
+
year: "years",
|
|
761
|
+
month: "months",
|
|
762
|
+
day: "days"
|
|
763
|
+
};
|
|
764
|
+
function sameDay(a, b) {
|
|
765
|
+
return a.getDate() === b.getDate() && a.getMonth() === b.getMonth() && a.getFullYear() === b.getFullYear();
|
|
766
|
+
}
|
|
767
|
+
function monthName(month, locale) {
|
|
768
|
+
return new Date(2e3, month, 1).toLocaleDateString(locale, { month: "long" });
|
|
769
|
+
}
|
|
770
|
+
function decadeStart(year) {
|
|
771
|
+
return Math.floor(year / 10) * 10;
|
|
772
|
+
}
|
|
773
|
+
function buildDayCells(viewDate, firstDay) {
|
|
774
|
+
const year = viewDate.getFullYear();
|
|
775
|
+
const month = viewDate.getMonth();
|
|
776
|
+
const weekday = new Date(year, month, 1).getDay();
|
|
777
|
+
const leadingBlanks = (weekday - firstDay + 7) % 7;
|
|
778
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
779
|
+
const cells = [];
|
|
780
|
+
for (let i = 0; i < leadingBlanks; i++) cells.push(null);
|
|
781
|
+
for (let day = 1; day <= daysInMonth; day++)
|
|
782
|
+
cells.push(new Date(year, month, day));
|
|
783
|
+
return cells;
|
|
784
|
+
}
|
|
785
|
+
function DaysView({
|
|
786
|
+
viewDate,
|
|
787
|
+
value,
|
|
788
|
+
onSelect,
|
|
789
|
+
locale
|
|
790
|
+
}) {
|
|
791
|
+
const firstDay = getFirstDayOfWeek(locale);
|
|
792
|
+
const cells = buildDayCells(viewDate, firstDay);
|
|
793
|
+
const weekdayLabels = getWeekdayLabels(locale);
|
|
794
|
+
const today = /* @__PURE__ */ new Date();
|
|
795
|
+
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
796
|
+
/* @__PURE__ */ jsx15("div", { className: "mb-1 grid grid-cols-7 gap-1", children: weekdayLabels.map((label) => /* @__PURE__ */ jsx15(
|
|
797
|
+
"div",
|
|
798
|
+
{
|
|
799
|
+
className: "text-center text-xs font-medium text-muted-foreground",
|
|
800
|
+
children: label
|
|
801
|
+
},
|
|
802
|
+
label
|
|
803
|
+
)) }),
|
|
804
|
+
/* @__PURE__ */ jsx15("div", { className: "grid grid-cols-7 gap-1", children: cells.map((date, index) => {
|
|
805
|
+
if (!date) return /* @__PURE__ */ jsx15("div", { className: "h-8 w-8" }, `blank-${index}`);
|
|
806
|
+
const isSelected = value ? sameDay(date, value) : false;
|
|
807
|
+
const isToday = sameDay(date, today);
|
|
808
|
+
return /* @__PURE__ */ jsx15(
|
|
809
|
+
"button",
|
|
810
|
+
{
|
|
811
|
+
type: "button",
|
|
812
|
+
onClick: () => onSelect(date),
|
|
813
|
+
className: cn14(
|
|
814
|
+
"h-8 w-8 rounded-full text-center text-sm",
|
|
815
|
+
isToday && !isSelected && "border border-primary",
|
|
816
|
+
isSelected ? "bg-primary text-primary-foreground" : "hover:bg-state-hover"
|
|
817
|
+
),
|
|
818
|
+
children: date.getDate()
|
|
819
|
+
},
|
|
820
|
+
date.toISOString()
|
|
821
|
+
);
|
|
822
|
+
}) })
|
|
823
|
+
] });
|
|
824
|
+
}
|
|
825
|
+
function MonthsView({
|
|
826
|
+
viewDate,
|
|
827
|
+
value,
|
|
828
|
+
onPick,
|
|
829
|
+
locale
|
|
830
|
+
}) {
|
|
831
|
+
const now = /* @__PURE__ */ new Date();
|
|
832
|
+
return /* @__PURE__ */ jsx15("div", { className: "grid grid-cols-3 gap-2", children: Array.from({ length: 12 }, (_, month) => {
|
|
833
|
+
const isCurrent = month === now.getMonth() && viewDate.getFullYear() === now.getFullYear();
|
|
834
|
+
const isSelected = !!value && month === value.getMonth() && viewDate.getFullYear() === value.getFullYear();
|
|
835
|
+
return /* @__PURE__ */ jsx15(
|
|
836
|
+
"button",
|
|
837
|
+
{
|
|
838
|
+
type: "button",
|
|
839
|
+
onClick: () => onPick(month),
|
|
840
|
+
className: cn14(
|
|
841
|
+
"rounded py-2 text-center text-sm",
|
|
842
|
+
isCurrent && !isSelected && "border border-primary",
|
|
843
|
+
isSelected ? "bg-primary text-primary-foreground" : "hover:bg-state-hover"
|
|
844
|
+
),
|
|
845
|
+
children: monthName(month, locale)
|
|
846
|
+
},
|
|
847
|
+
month
|
|
848
|
+
);
|
|
849
|
+
}) });
|
|
850
|
+
}
|
|
851
|
+
function YearsView({
|
|
852
|
+
viewDate,
|
|
853
|
+
value,
|
|
854
|
+
onPick
|
|
855
|
+
}) {
|
|
856
|
+
const now = (/* @__PURE__ */ new Date()).getFullYear();
|
|
857
|
+
const start = decadeStart(viewDate.getFullYear());
|
|
858
|
+
return /* @__PURE__ */ jsx15("div", { className: "grid grid-cols-3 gap-2", children: Array.from({ length: 10 }, (_, i) => {
|
|
859
|
+
const year = start + i;
|
|
860
|
+
const isSelected = !!value && year === value.getFullYear();
|
|
861
|
+
return /* @__PURE__ */ jsx15(
|
|
862
|
+
"button",
|
|
863
|
+
{
|
|
864
|
+
type: "button",
|
|
865
|
+
onClick: () => onPick(year),
|
|
866
|
+
className: cn14(
|
|
867
|
+
"rounded py-2 text-center text-sm",
|
|
868
|
+
year === now && !isSelected && "border border-primary",
|
|
869
|
+
isSelected ? "bg-primary text-primary-foreground" : "hover:bg-state-hover"
|
|
870
|
+
),
|
|
871
|
+
children: year
|
|
872
|
+
},
|
|
873
|
+
year
|
|
874
|
+
);
|
|
875
|
+
}) });
|
|
876
|
+
}
|
|
877
|
+
function headerText(view, viewDate, locale) {
|
|
878
|
+
if (view === "months") return viewDate.getFullYear().toString();
|
|
879
|
+
if (view === "years") {
|
|
880
|
+
const start = decadeStart(viewDate.getFullYear());
|
|
881
|
+
return `${start} - ${start + 9}`;
|
|
882
|
+
}
|
|
883
|
+
return `${monthName(viewDate.getMonth(), locale)} ${viewDate.getFullYear()}`;
|
|
884
|
+
}
|
|
885
|
+
function shiftViewDate(view, viewDate, direction) {
|
|
886
|
+
if (view === "months") {
|
|
887
|
+
return new Date(viewDate.getFullYear() + direction, viewDate.getMonth(), 1);
|
|
888
|
+
}
|
|
889
|
+
if (view === "years") {
|
|
890
|
+
return new Date(decadeStart(viewDate.getFullYear()) + direction * 10, 0, 1);
|
|
891
|
+
}
|
|
892
|
+
return new Date(viewDate.getFullYear(), viewDate.getMonth() + direction, 1);
|
|
893
|
+
}
|
|
894
|
+
function Calendar({
|
|
895
|
+
value,
|
|
896
|
+
onSelect,
|
|
897
|
+
defaultViewDate,
|
|
898
|
+
precision = "day",
|
|
899
|
+
locale
|
|
900
|
+
}) {
|
|
901
|
+
const resolvedLocale = useLocale(locale);
|
|
902
|
+
const terminalView = TERMINAL_VIEW[precision];
|
|
903
|
+
const [view, setView] = React13.useState(terminalView);
|
|
904
|
+
const [viewDate, setViewDate] = React13.useState(
|
|
905
|
+
value ?? defaultViewDate ?? /* @__PURE__ */ new Date()
|
|
906
|
+
);
|
|
907
|
+
React13.useEffect(() => {
|
|
908
|
+
if (value) setViewDate(value);
|
|
909
|
+
}, [value]);
|
|
910
|
+
const handleMonthPick = (month) => {
|
|
911
|
+
const next = new Date(viewDate.getFullYear(), month, 1);
|
|
912
|
+
if (precision === "month") {
|
|
913
|
+
onSelect(next);
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
setViewDate(next);
|
|
917
|
+
setView("days");
|
|
918
|
+
};
|
|
919
|
+
const handleYearPick = (year) => {
|
|
920
|
+
const next = new Date(year, viewDate.getMonth(), 1);
|
|
921
|
+
if (precision === "year") {
|
|
922
|
+
onSelect(next);
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
setViewDate(next);
|
|
926
|
+
setView("months");
|
|
927
|
+
};
|
|
928
|
+
const canDrillUp = view !== "years";
|
|
929
|
+
const drillUp = () => setView(view === "days" ? "months" : "years");
|
|
930
|
+
return /* @__PURE__ */ jsxs5("div", { className: "w-64", children: [
|
|
931
|
+
/* @__PURE__ */ jsxs5("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
932
|
+
/* @__PURE__ */ jsx15(
|
|
933
|
+
"button",
|
|
934
|
+
{
|
|
935
|
+
type: "button",
|
|
936
|
+
onClick: () => setViewDate(shiftViewDate(view, viewDate, -1)),
|
|
937
|
+
className: "rounded-full p-1 hover:bg-state-hover",
|
|
938
|
+
"aria-label": "Previous",
|
|
939
|
+
children: /* @__PURE__ */ jsx15(ChevronLeft, { size: 16 })
|
|
940
|
+
}
|
|
941
|
+
),
|
|
942
|
+
/* @__PURE__ */ jsx15(
|
|
943
|
+
"button",
|
|
944
|
+
{
|
|
945
|
+
type: "button",
|
|
946
|
+
onClick: canDrillUp ? drillUp : void 0,
|
|
947
|
+
disabled: !canDrillUp,
|
|
948
|
+
className: cn14(
|
|
949
|
+
"rounded px-2 py-1 font-medium",
|
|
950
|
+
canDrillUp && "hover:bg-state-hover"
|
|
951
|
+
),
|
|
952
|
+
children: headerText(view, viewDate, resolvedLocale)
|
|
953
|
+
}
|
|
954
|
+
),
|
|
955
|
+
/* @__PURE__ */ jsx15(
|
|
956
|
+
"button",
|
|
957
|
+
{
|
|
958
|
+
type: "button",
|
|
959
|
+
onClick: () => setViewDate(shiftViewDate(view, viewDate, 1)),
|
|
960
|
+
className: "rounded-full p-1 hover:bg-state-hover",
|
|
961
|
+
"aria-label": "Next",
|
|
962
|
+
children: /* @__PURE__ */ jsx15(ChevronRight2, { size: 16 })
|
|
963
|
+
}
|
|
964
|
+
)
|
|
965
|
+
] }),
|
|
966
|
+
view === "days" && /* @__PURE__ */ jsx15(
|
|
967
|
+
DaysView,
|
|
968
|
+
{
|
|
969
|
+
viewDate,
|
|
970
|
+
value,
|
|
971
|
+
onSelect,
|
|
972
|
+
locale: resolvedLocale
|
|
973
|
+
}
|
|
974
|
+
),
|
|
975
|
+
view === "months" && /* @__PURE__ */ jsx15(
|
|
976
|
+
MonthsView,
|
|
977
|
+
{
|
|
978
|
+
viewDate,
|
|
979
|
+
value,
|
|
980
|
+
onPick: handleMonthPick,
|
|
981
|
+
locale: resolvedLocale
|
|
982
|
+
}
|
|
983
|
+
),
|
|
984
|
+
view === "years" && /* @__PURE__ */ jsx15(YearsView, { viewDate, value, onPick: handleYearPick })
|
|
985
|
+
] });
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
// src/DateInput/DateInput.tsx
|
|
989
|
+
import { jsx as jsx16, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
990
|
+
function DateInput({
|
|
991
|
+
value,
|
|
992
|
+
onChange,
|
|
993
|
+
precision = "day",
|
|
994
|
+
locale,
|
|
995
|
+
id,
|
|
996
|
+
name,
|
|
997
|
+
placeholder,
|
|
998
|
+
required,
|
|
999
|
+
disabled,
|
|
1000
|
+
error,
|
|
1001
|
+
className,
|
|
1002
|
+
onBlur
|
|
1003
|
+
}) {
|
|
1004
|
+
const resolvedLocale = useLocale2(locale);
|
|
1005
|
+
const [open, setOpen] = React14.useState(false);
|
|
1006
|
+
const [inputValue, setInputValue] = React14.useState("");
|
|
1007
|
+
const [parseError, setParseError] = React14.useState("");
|
|
1008
|
+
const fmt = React14.useMemo(
|
|
1009
|
+
() => compileDateFormat({
|
|
1010
|
+
format: getLocaleDateFormat(resolvedLocale, precision)
|
|
1011
|
+
}),
|
|
1012
|
+
[resolvedLocale, precision]
|
|
1013
|
+
);
|
|
1014
|
+
const selectedDate = React14.useMemo(() => parseIsoDate(value), [value]);
|
|
1015
|
+
React14.useEffect(() => {
|
|
1016
|
+
setInputValue(selectedDate ? formatDateInput(selectedDate, fmt) : "");
|
|
1017
|
+
setParseError("");
|
|
1018
|
+
}, [selectedDate, fmt]);
|
|
1019
|
+
const commit = (date) => {
|
|
1020
|
+
onChange(date ? formatIsoDate(date, precision) : "");
|
|
1021
|
+
};
|
|
1022
|
+
const handleBlur = () => {
|
|
1023
|
+
if (!inputValue.trim()) {
|
|
1024
|
+
setParseError("");
|
|
1025
|
+
commit(null);
|
|
1026
|
+
onBlur?.();
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
const result = parseDate(inputValue, fmt);
|
|
1030
|
+
if (result.date) {
|
|
1031
|
+
setInputValue(result.value);
|
|
1032
|
+
setParseError("");
|
|
1033
|
+
commit(result.date);
|
|
1034
|
+
} else {
|
|
1035
|
+
setParseError(result.error || "Invalid date");
|
|
1036
|
+
}
|
|
1037
|
+
onBlur?.();
|
|
1038
|
+
};
|
|
1039
|
+
const handleCalendarSelect = (date) => {
|
|
1040
|
+
setInputValue(formatDateInput(date, fmt));
|
|
1041
|
+
setParseError("");
|
|
1042
|
+
commit(date);
|
|
1043
|
+
setOpen(false);
|
|
1044
|
+
};
|
|
1045
|
+
const shownError = error || parseError;
|
|
1046
|
+
return /* @__PURE__ */ jsxs6("div", { className: cn15("relative", className), children: [
|
|
1047
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
1048
|
+
/* @__PURE__ */ jsx16(
|
|
1049
|
+
Input,
|
|
1050
|
+
{
|
|
1051
|
+
id,
|
|
1052
|
+
name,
|
|
1053
|
+
type: "text",
|
|
1054
|
+
value: inputValue,
|
|
1055
|
+
onChange: (event) => {
|
|
1056
|
+
setInputValue(event.currentTarget.value);
|
|
1057
|
+
setParseError("");
|
|
1058
|
+
},
|
|
1059
|
+
onBlur: handleBlur,
|
|
1060
|
+
onKeyDown: (event) => {
|
|
1061
|
+
if (event.key === "Enter") {
|
|
1062
|
+
handleBlur();
|
|
1063
|
+
setOpen(false);
|
|
1064
|
+
} else if (event.key === "Escape") {
|
|
1065
|
+
setOpen(false);
|
|
1066
|
+
}
|
|
1067
|
+
},
|
|
1068
|
+
placeholder: placeholder ?? fmt.format,
|
|
1069
|
+
required,
|
|
1070
|
+
disabled,
|
|
1071
|
+
autoComplete: "off",
|
|
1072
|
+
"aria-invalid": shownError ? true : void 0,
|
|
1073
|
+
className: cn15("pr-10", shownError && "border-destructive")
|
|
1074
|
+
}
|
|
1075
|
+
),
|
|
1076
|
+
/* @__PURE__ */ jsxs6(Popover, { open, onOpenChange: setOpen, children: [
|
|
1077
|
+
/* @__PURE__ */ jsx16(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
1078
|
+
"button",
|
|
1079
|
+
{
|
|
1080
|
+
type: "button",
|
|
1081
|
+
disabled,
|
|
1082
|
+
"aria-label": "Open calendar",
|
|
1083
|
+
className: "absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
1084
|
+
children: /* @__PURE__ */ jsx16(CalendarIcon, { size: 16 })
|
|
1085
|
+
}
|
|
1086
|
+
) }),
|
|
1087
|
+
/* @__PURE__ */ jsx16(PopoverContent, { align: "end", className: "w-auto p-2", children: /* @__PURE__ */ jsx16(
|
|
1088
|
+
Calendar,
|
|
1089
|
+
{
|
|
1090
|
+
value: selectedDate,
|
|
1091
|
+
onSelect: handleCalendarSelect,
|
|
1092
|
+
precision,
|
|
1093
|
+
locale: resolvedLocale
|
|
1094
|
+
}
|
|
1095
|
+
) })
|
|
1096
|
+
] })
|
|
1097
|
+
] }),
|
|
1098
|
+
/* @__PURE__ */ jsx16(InputError, { error: shownError })
|
|
1099
|
+
] });
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
// src/TimeInput/TimeInput.tsx
|
|
1103
|
+
import * as React15 from "react";
|
|
1104
|
+
import { Clock } from "lucide-react";
|
|
1105
|
+
import {
|
|
1106
|
+
cn as cn16,
|
|
1107
|
+
parseTime,
|
|
1108
|
+
normalizeTime
|
|
1109
|
+
} from "@petrarca/sonnet-core";
|
|
1110
|
+
import { jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1111
|
+
function TimeInput({
|
|
1112
|
+
value,
|
|
1113
|
+
onChange,
|
|
1114
|
+
granularity = "minute",
|
|
1115
|
+
id,
|
|
1116
|
+
name,
|
|
1117
|
+
placeholder,
|
|
1118
|
+
required,
|
|
1119
|
+
disabled,
|
|
1120
|
+
error,
|
|
1121
|
+
className,
|
|
1122
|
+
onBlur
|
|
1123
|
+
}) {
|
|
1124
|
+
const [inputValue, setInputValue] = React15.useState("");
|
|
1125
|
+
const [parseError, setParseError] = React15.useState("");
|
|
1126
|
+
const normalized = React15.useMemo(
|
|
1127
|
+
() => normalizeTime(value, granularity),
|
|
1128
|
+
[value, granularity]
|
|
1129
|
+
);
|
|
1130
|
+
React15.useEffect(() => {
|
|
1131
|
+
setInputValue(normalized);
|
|
1132
|
+
setParseError("");
|
|
1133
|
+
}, [normalized]);
|
|
1134
|
+
const handleBlur = () => {
|
|
1135
|
+
if (!inputValue.trim()) {
|
|
1136
|
+
setParseError("");
|
|
1137
|
+
onChange("");
|
|
1138
|
+
onBlur?.();
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
const result = parseTime(inputValue, granularity);
|
|
1142
|
+
if (result.value) {
|
|
1143
|
+
setInputValue(result.value);
|
|
1144
|
+
setParseError("");
|
|
1145
|
+
onChange(result.value);
|
|
1146
|
+
} else {
|
|
1147
|
+
setParseError(result.error || "Invalid time");
|
|
1148
|
+
}
|
|
1149
|
+
onBlur?.();
|
|
1150
|
+
};
|
|
1151
|
+
const shownError = error || parseError;
|
|
1152
|
+
const placeholderText = placeholder ?? (granularity === "second" ? "HH:MM:SS" : "HH:MM");
|
|
1153
|
+
return /* @__PURE__ */ jsxs7("div", { className: cn16("relative", className), children: [
|
|
1154
|
+
/* @__PURE__ */ jsxs7("div", { className: "relative", children: [
|
|
1155
|
+
/* @__PURE__ */ jsx17(
|
|
1156
|
+
Input,
|
|
1157
|
+
{
|
|
1158
|
+
id,
|
|
1159
|
+
name,
|
|
1160
|
+
type: "text",
|
|
1161
|
+
inputMode: "numeric",
|
|
1162
|
+
value: inputValue,
|
|
1163
|
+
onChange: (event) => {
|
|
1164
|
+
setInputValue(event.currentTarget.value);
|
|
1165
|
+
setParseError("");
|
|
1166
|
+
},
|
|
1167
|
+
onBlur: handleBlur,
|
|
1168
|
+
onKeyDown: (event) => {
|
|
1169
|
+
if (event.key === "Enter") handleBlur();
|
|
1170
|
+
},
|
|
1171
|
+
placeholder: placeholderText,
|
|
1172
|
+
required,
|
|
1173
|
+
disabled,
|
|
1174
|
+
autoComplete: "off",
|
|
1175
|
+
"aria-invalid": shownError ? true : void 0,
|
|
1176
|
+
className: cn16("pr-10", shownError && "border-destructive")
|
|
1177
|
+
}
|
|
1178
|
+
),
|
|
1179
|
+
/* @__PURE__ */ jsx17("span", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground", children: /* @__PURE__ */ jsx17(Clock, { size: 16 }) })
|
|
1180
|
+
] }),
|
|
1181
|
+
/* @__PURE__ */ jsx17(InputError, { error: shownError })
|
|
1182
|
+
] });
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
// src/DateTimeInput/DateTimeInput.tsx
|
|
1186
|
+
import * as React16 from "react";
|
|
1187
|
+
import {
|
|
1188
|
+
cn as cn17,
|
|
1189
|
+
splitDateTime,
|
|
1190
|
+
joinDateTime,
|
|
1191
|
+
formatIsoDate as formatIsoDate2
|
|
1192
|
+
} from "@petrarca/sonnet-core";
|
|
1193
|
+
import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1194
|
+
function DateTimeInput({
|
|
1195
|
+
value,
|
|
1196
|
+
onChange,
|
|
1197
|
+
granularity = "minute",
|
|
1198
|
+
timeZone,
|
|
1199
|
+
locale,
|
|
1200
|
+
idPrefix,
|
|
1201
|
+
required,
|
|
1202
|
+
disabled,
|
|
1203
|
+
error,
|
|
1204
|
+
className,
|
|
1205
|
+
onBlur
|
|
1206
|
+
}) {
|
|
1207
|
+
const { date, time } = React16.useMemo(() => splitDateTime(value), [value]);
|
|
1208
|
+
const handleDateChange = (nextDate) => {
|
|
1209
|
+
onChange(joinDateTime(nextDate, time));
|
|
1210
|
+
};
|
|
1211
|
+
const handleTimeChange = (nextTime) => {
|
|
1212
|
+
if (!nextTime) {
|
|
1213
|
+
onChange(date ? joinDateTime(date, "") : "");
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1216
|
+
onChange(joinDateTime(date || formatIsoDate2(/* @__PURE__ */ new Date()), nextTime));
|
|
1217
|
+
};
|
|
1218
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn17("space-y-1", className), children: [
|
|
1219
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex gap-2", children: [
|
|
1220
|
+
/* @__PURE__ */ jsx18("div", { className: "flex-1", children: /* @__PURE__ */ jsx18(
|
|
1221
|
+
DateInput,
|
|
1222
|
+
{
|
|
1223
|
+
id: idPrefix ? `${idPrefix}-date` : void 0,
|
|
1224
|
+
value: date,
|
|
1225
|
+
onChange: handleDateChange,
|
|
1226
|
+
locale,
|
|
1227
|
+
error,
|
|
1228
|
+
required,
|
|
1229
|
+
disabled,
|
|
1230
|
+
onBlur
|
|
1231
|
+
}
|
|
1232
|
+
) }),
|
|
1233
|
+
/* @__PURE__ */ jsx18("div", { className: "w-32", children: /* @__PURE__ */ jsx18(
|
|
1234
|
+
TimeInput,
|
|
1235
|
+
{
|
|
1236
|
+
id: idPrefix ? `${idPrefix}-time` : void 0,
|
|
1237
|
+
value: time,
|
|
1238
|
+
onChange: handleTimeChange,
|
|
1239
|
+
granularity,
|
|
1240
|
+
disabled,
|
|
1241
|
+
onBlur
|
|
1242
|
+
}
|
|
1243
|
+
) })
|
|
1244
|
+
] }),
|
|
1245
|
+
timeZone && /* @__PURE__ */ jsxs8("p", { className: "text-xs text-tertiary-foreground", children: [
|
|
1246
|
+
"Times in ",
|
|
1247
|
+
timeZone
|
|
1248
|
+
] })
|
|
1249
|
+
] });
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
// src/select.tsx
|
|
1253
|
+
import * as React17 from "react";
|
|
1254
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1255
|
+
import { Check as Check3, ChevronDown, ChevronUp } from "lucide-react";
|
|
1256
|
+
import { cn as cn18 } from "@petrarca/sonnet-core";
|
|
1257
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1258
|
+
var Select = SelectPrimitive.Root;
|
|
1259
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
1260
|
+
var SelectValue = SelectPrimitive.Value;
|
|
1261
|
+
var SelectTrigger = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs9(
|
|
1262
|
+
SelectPrimitive.Trigger,
|
|
1263
|
+
{
|
|
1264
|
+
ref,
|
|
1265
|
+
className: cn18(
|
|
1266
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1",
|
|
1267
|
+
className
|
|
1268
|
+
),
|
|
1269
|
+
...props,
|
|
1270
|
+
children: [
|
|
1271
|
+
children,
|
|
1272
|
+
/* @__PURE__ */ jsx19(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx19(ChevronDown, { className: "h-4 w-4 opacity-60" }) })
|
|
1273
|
+
]
|
|
1274
|
+
}
|
|
1275
|
+
));
|
|
1276
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1277
|
+
var SelectScrollUpButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1278
|
+
SelectPrimitive.ScrollUpButton,
|
|
1279
|
+
{
|
|
1280
|
+
ref,
|
|
1281
|
+
className: cn18(
|
|
1282
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1283
|
+
className
|
|
1284
|
+
),
|
|
1285
|
+
...props,
|
|
1286
|
+
children: /* @__PURE__ */ jsx19(ChevronUp, { className: "h-4 w-4" })
|
|
1287
|
+
}
|
|
1288
|
+
));
|
|
1289
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1290
|
+
var SelectScrollDownButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1291
|
+
SelectPrimitive.ScrollDownButton,
|
|
1292
|
+
{
|
|
1293
|
+
ref,
|
|
1294
|
+
className: cn18(
|
|
1295
|
+
"flex cursor-default items-center justify-center py-1",
|
|
1296
|
+
className
|
|
1297
|
+
),
|
|
1298
|
+
...props,
|
|
1299
|
+
children: /* @__PURE__ */ jsx19(ChevronDown, { className: "h-4 w-4" })
|
|
1300
|
+
}
|
|
1301
|
+
));
|
|
1302
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1303
|
+
var SelectContent = React17.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx19(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs9(
|
|
1304
|
+
SelectPrimitive.Content,
|
|
1305
|
+
{
|
|
1306
|
+
ref,
|
|
1307
|
+
className: cn18(
|
|
1308
|
+
"relative z-50 max-h-[var(--radix-select-content-available-height)] min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-select-content-transform-origin]",
|
|
1309
|
+
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",
|
|
1310
|
+
className
|
|
1311
|
+
),
|
|
1312
|
+
position,
|
|
1313
|
+
...props,
|
|
1314
|
+
children: [
|
|
1315
|
+
/* @__PURE__ */ jsx19(SelectScrollUpButton, {}),
|
|
1316
|
+
/* @__PURE__ */ jsx19(
|
|
1317
|
+
SelectPrimitive.Viewport,
|
|
1318
|
+
{
|
|
1319
|
+
className: cn18(
|
|
1320
|
+
"p-1",
|
|
1321
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
1322
|
+
),
|
|
1323
|
+
children
|
|
1324
|
+
}
|
|
1325
|
+
),
|
|
1326
|
+
/* @__PURE__ */ jsx19(SelectScrollDownButton, {})
|
|
1327
|
+
]
|
|
1328
|
+
}
|
|
1329
|
+
) }));
|
|
1330
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1331
|
+
var SelectLabel = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1332
|
+
SelectPrimitive.Label,
|
|
1333
|
+
{
|
|
1334
|
+
ref,
|
|
1335
|
+
className: cn18("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
1336
|
+
...props
|
|
1337
|
+
}
|
|
1338
|
+
));
|
|
1339
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1340
|
+
var SelectItem = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs9(
|
|
1341
|
+
SelectPrimitive.Item,
|
|
1342
|
+
{
|
|
1343
|
+
ref,
|
|
1344
|
+
className: cn18(
|
|
1345
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1346
|
+
className
|
|
1347
|
+
),
|
|
1348
|
+
...props,
|
|
1349
|
+
children: [
|
|
1350
|
+
/* @__PURE__ */ jsx19("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx19(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx19(Check3, { className: "h-4 w-4" }) }) }),
|
|
1351
|
+
/* @__PURE__ */ jsx19(SelectPrimitive.ItemText, { children })
|
|
1352
|
+
]
|
|
1353
|
+
}
|
|
1354
|
+
));
|
|
1355
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1356
|
+
var SelectSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1357
|
+
SelectPrimitive.Separator,
|
|
1358
|
+
{
|
|
1359
|
+
ref,
|
|
1360
|
+
className: cn18("-mx-1 my-1 h-px bg-muted", className),
|
|
1361
|
+
...props
|
|
1362
|
+
}
|
|
1363
|
+
));
|
|
1364
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
625
1365
|
|
|
626
1366
|
// src/input-group.tsx
|
|
627
1367
|
import { cva as cva4 } from "class-variance-authority";
|
|
628
|
-
import { cn as
|
|
1368
|
+
import { cn as cn20 } from "@petrarca/sonnet-core";
|
|
629
1369
|
|
|
630
1370
|
// src/textarea.tsx
|
|
631
|
-
import * as
|
|
632
|
-
import { cn as
|
|
633
|
-
import { jsx as
|
|
634
|
-
var Textarea =
|
|
635
|
-
return /* @__PURE__ */
|
|
1371
|
+
import * as React18 from "react";
|
|
1372
|
+
import { cn as cn19 } from "@petrarca/sonnet-core";
|
|
1373
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1374
|
+
var Textarea = React18.forwardRef(({ className, ...props }, ref) => {
|
|
1375
|
+
return /* @__PURE__ */ jsx20(
|
|
636
1376
|
"textarea",
|
|
637
1377
|
{
|
|
638
|
-
className:
|
|
1378
|
+
className: cn19(
|
|
639
1379
|
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
640
1380
|
className
|
|
641
1381
|
),
|
|
@@ -647,14 +1387,14 @@ var Textarea = React10.forwardRef(({ className, ...props }, ref) => {
|
|
|
647
1387
|
Textarea.displayName = "Textarea";
|
|
648
1388
|
|
|
649
1389
|
// src/input-group.tsx
|
|
650
|
-
import { jsx as
|
|
1390
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
651
1391
|
function InputGroup({ className, ...props }) {
|
|
652
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ jsx21(
|
|
653
1393
|
"div",
|
|
654
1394
|
{
|
|
655
1395
|
"data-slot": "input-group",
|
|
656
1396
|
role: "group",
|
|
657
|
-
className:
|
|
1397
|
+
className: cn20(
|
|
658
1398
|
"group/input-group border-input dark:bg-input/30 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow]",
|
|
659
1399
|
"h-9 has-[>textarea]:h-auto",
|
|
660
1400
|
// Variants based on alignment.
|
|
@@ -693,13 +1433,13 @@ function InputGroupAddon({
|
|
|
693
1433
|
align = "inline-start",
|
|
694
1434
|
...props
|
|
695
1435
|
}) {
|
|
696
|
-
return /* @__PURE__ */
|
|
1436
|
+
return /* @__PURE__ */ jsx21(
|
|
697
1437
|
"div",
|
|
698
1438
|
{
|
|
699
1439
|
role: "group",
|
|
700
1440
|
"data-slot": "input-group-addon",
|
|
701
1441
|
"data-align": align,
|
|
702
|
-
className:
|
|
1442
|
+
className: cn20(inputGroupAddonVariants({ align }), className),
|
|
703
1443
|
onClick: (e) => {
|
|
704
1444
|
if (e.target.closest("button")) {
|
|
705
1445
|
return;
|
|
@@ -733,22 +1473,22 @@ function InputGroupButton({
|
|
|
733
1473
|
size = "xs",
|
|
734
1474
|
...props
|
|
735
1475
|
}) {
|
|
736
|
-
return /* @__PURE__ */
|
|
1476
|
+
return /* @__PURE__ */ jsx21(
|
|
737
1477
|
Button,
|
|
738
1478
|
{
|
|
739
1479
|
type,
|
|
740
1480
|
"data-size": size,
|
|
741
1481
|
variant,
|
|
742
|
-
className:
|
|
1482
|
+
className: cn20(inputGroupButtonVariants({ size }), className),
|
|
743
1483
|
...props
|
|
744
1484
|
}
|
|
745
1485
|
);
|
|
746
1486
|
}
|
|
747
1487
|
function InputGroupText({ className, ...props }) {
|
|
748
|
-
return /* @__PURE__ */
|
|
1488
|
+
return /* @__PURE__ */ jsx21(
|
|
749
1489
|
"span",
|
|
750
1490
|
{
|
|
751
|
-
className:
|
|
1491
|
+
className: cn20(
|
|
752
1492
|
"text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
753
1493
|
className
|
|
754
1494
|
),
|
|
@@ -760,11 +1500,11 @@ function InputGroupInput({
|
|
|
760
1500
|
className,
|
|
761
1501
|
...props
|
|
762
1502
|
}) {
|
|
763
|
-
return /* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ jsx21(
|
|
764
1504
|
Input,
|
|
765
1505
|
{
|
|
766
1506
|
"data-slot": "input-group-control",
|
|
767
|
-
className:
|
|
1507
|
+
className: cn20(
|
|
768
1508
|
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
769
1509
|
className
|
|
770
1510
|
),
|
|
@@ -776,11 +1516,11 @@ function InputGroupTextarea({
|
|
|
776
1516
|
className,
|
|
777
1517
|
...props
|
|
778
1518
|
}) {
|
|
779
|
-
return /* @__PURE__ */
|
|
1519
|
+
return /* @__PURE__ */ jsx21(
|
|
780
1520
|
Textarea,
|
|
781
1521
|
{
|
|
782
1522
|
"data-slot": "input-group-control",
|
|
783
|
-
className:
|
|
1523
|
+
className: cn20(
|
|
784
1524
|
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
785
1525
|
className
|
|
786
1526
|
),
|
|
@@ -790,95 +1530,73 @@ function InputGroupTextarea({
|
|
|
790
1530
|
}
|
|
791
1531
|
|
|
792
1532
|
// src/label.tsx
|
|
793
|
-
import * as
|
|
1533
|
+
import * as React19 from "react";
|
|
794
1534
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
795
1535
|
import { cva as cva5 } from "class-variance-authority";
|
|
796
|
-
import { cn as
|
|
797
|
-
import { jsx as
|
|
1536
|
+
import { cn as cn21 } from "@petrarca/sonnet-core";
|
|
1537
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
798
1538
|
var labelVariants = cva5(
|
|
799
1539
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
800
1540
|
);
|
|
801
|
-
var
|
|
1541
|
+
var Label3 = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
802
1542
|
LabelPrimitive.Root,
|
|
803
1543
|
{
|
|
804
1544
|
ref,
|
|
805
|
-
className:
|
|
1545
|
+
className: cn21(labelVariants(), className),
|
|
806
1546
|
...props
|
|
807
1547
|
}
|
|
808
1548
|
));
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
// src/popover.tsx
|
|
812
|
-
import * as React12 from "react";
|
|
813
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
814
|
-
import { cn as cn14 } from "@petrarca/sonnet-core";
|
|
815
|
-
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
816
|
-
var Popover = PopoverPrimitive.Root;
|
|
817
|
-
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
818
|
-
var PopoverContent = React12.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx14(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx14(
|
|
819
|
-
PopoverPrimitive.Content,
|
|
820
|
-
{
|
|
821
|
-
ref,
|
|
822
|
-
align,
|
|
823
|
-
sideOffset,
|
|
824
|
-
className: cn14(
|
|
825
|
-
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-popover-content-transform-origin]",
|
|
826
|
-
className
|
|
827
|
-
),
|
|
828
|
-
...props
|
|
829
|
-
}
|
|
830
|
-
) }));
|
|
831
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
1549
|
+
Label3.displayName = LabelPrimitive.Root.displayName;
|
|
832
1550
|
|
|
833
1551
|
// src/scroll-area.tsx
|
|
834
|
-
import * as
|
|
1552
|
+
import * as React20 from "react";
|
|
835
1553
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
836
|
-
import { cn as
|
|
837
|
-
import { jsx as
|
|
838
|
-
var ScrollArea =
|
|
1554
|
+
import { cn as cn22 } from "@petrarca/sonnet-core";
|
|
1555
|
+
import { jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1556
|
+
var ScrollArea = React20.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
839
1557
|
ScrollAreaPrimitive.Root,
|
|
840
1558
|
{
|
|
841
1559
|
ref,
|
|
842
|
-
className:
|
|
1560
|
+
className: cn22("relative overflow-hidden", className),
|
|
843
1561
|
...props,
|
|
844
1562
|
children: [
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ jsx23(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
|
|
1564
|
+
/* @__PURE__ */ jsx23(ScrollBar, {}),
|
|
1565
|
+
/* @__PURE__ */ jsx23(ScrollAreaPrimitive.Corner, {})
|
|
848
1566
|
]
|
|
849
1567
|
}
|
|
850
1568
|
));
|
|
851
1569
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
852
|
-
var ScrollBar =
|
|
1570
|
+
var ScrollBar = React20.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
853
1571
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
854
1572
|
{
|
|
855
1573
|
ref,
|
|
856
1574
|
orientation,
|
|
857
|
-
className:
|
|
1575
|
+
className: cn22(
|
|
858
1576
|
"flex touch-none select-none transition-colors",
|
|
859
1577
|
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
860
1578
|
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
861
1579
|
className
|
|
862
1580
|
),
|
|
863
1581
|
...props,
|
|
864
|
-
children: /* @__PURE__ */
|
|
1582
|
+
children: /* @__PURE__ */ jsx23(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
865
1583
|
}
|
|
866
1584
|
));
|
|
867
1585
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
868
1586
|
|
|
869
1587
|
// src/separator.tsx
|
|
870
|
-
import * as
|
|
1588
|
+
import * as React21 from "react";
|
|
871
1589
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
872
|
-
import { cn as
|
|
873
|
-
import { jsx as
|
|
874
|
-
var
|
|
875
|
-
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */
|
|
1590
|
+
import { cn as cn23 } from "@petrarca/sonnet-core";
|
|
1591
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1592
|
+
var Separator3 = React21.forwardRef(
|
|
1593
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
876
1594
|
SeparatorPrimitive.Root,
|
|
877
1595
|
{
|
|
878
1596
|
ref,
|
|
879
1597
|
decorative,
|
|
880
1598
|
orientation,
|
|
881
|
-
className:
|
|
1599
|
+
className: cn23(
|
|
882
1600
|
"shrink-0 bg-border",
|
|
883
1601
|
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
884
1602
|
className
|
|
@@ -887,22 +1605,22 @@ var Separator2 = React14.forwardRef(
|
|
|
887
1605
|
}
|
|
888
1606
|
)
|
|
889
1607
|
);
|
|
890
|
-
|
|
1608
|
+
Separator3.displayName = SeparatorPrimitive.Root.displayName;
|
|
891
1609
|
|
|
892
1610
|
// src/resize-handle.tsx
|
|
893
|
-
import * as
|
|
894
|
-
import { cn as
|
|
895
|
-
import { jsx as
|
|
896
|
-
var ResizeHandle =
|
|
1611
|
+
import * as React22 from "react";
|
|
1612
|
+
import { cn as cn24 } from "@petrarca/sonnet-core";
|
|
1613
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1614
|
+
var ResizeHandle = React22.forwardRef(
|
|
897
1615
|
({ orientation = "vertical", gripLength = 48, className, style, ...props }, ref) => {
|
|
898
1616
|
const isVertical = orientation === "vertical";
|
|
899
|
-
return /* @__PURE__ */
|
|
1617
|
+
return /* @__PURE__ */ jsx25(
|
|
900
1618
|
"div",
|
|
901
1619
|
{
|
|
902
1620
|
ref,
|
|
903
1621
|
role: "separator",
|
|
904
1622
|
"aria-orientation": orientation,
|
|
905
|
-
className:
|
|
1623
|
+
className: cn24(
|
|
906
1624
|
"group relative flex shrink-0 select-none touch-none items-center justify-center rounded-sm",
|
|
907
1625
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
908
1626
|
isVertical ? "mx-1 w-2 cursor-col-resize" : "my-1 h-2 cursor-row-resize",
|
|
@@ -910,7 +1628,7 @@ var ResizeHandle = React15.forwardRef(
|
|
|
910
1628
|
),
|
|
911
1629
|
style,
|
|
912
1630
|
...props,
|
|
913
|
-
children: /* @__PURE__ */
|
|
1631
|
+
children: /* @__PURE__ */ jsx25(
|
|
914
1632
|
"div",
|
|
915
1633
|
{
|
|
916
1634
|
className: "pointer-events-none absolute rounded-full bg-border transition-colors group-hover:bg-border-strong",
|
|
@@ -924,20 +1642,20 @@ var ResizeHandle = React15.forwardRef(
|
|
|
924
1642
|
ResizeHandle.displayName = "ResizeHandle";
|
|
925
1643
|
|
|
926
1644
|
// src/sheet.tsx
|
|
927
|
-
import * as
|
|
1645
|
+
import * as React23 from "react";
|
|
928
1646
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
929
1647
|
import { X as X2 } from "lucide-react";
|
|
930
|
-
import { cn as
|
|
931
|
-
import { jsx as
|
|
1648
|
+
import { cn as cn25 } from "@petrarca/sonnet-core";
|
|
1649
|
+
import { jsx as jsx26, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
932
1650
|
var Sheet = DialogPrimitive2.Root;
|
|
933
1651
|
var SheetTrigger = DialogPrimitive2.Trigger;
|
|
934
1652
|
var SheetClose = DialogPrimitive2.Close;
|
|
935
1653
|
var SheetPortal = DialogPrimitive2.Portal;
|
|
936
|
-
var SheetOverlay =
|
|
1654
|
+
var SheetOverlay = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
937
1655
|
DialogPrimitive2.Overlay,
|
|
938
1656
|
{
|
|
939
1657
|
ref,
|
|
940
|
-
className:
|
|
1658
|
+
className: cn25(
|
|
941
1659
|
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
942
1660
|
className
|
|
943
1661
|
),
|
|
@@ -945,14 +1663,14 @@ var SheetOverlay = React16.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
945
1663
|
}
|
|
946
1664
|
));
|
|
947
1665
|
SheetOverlay.displayName = "SheetOverlay";
|
|
948
|
-
var SheetContent =
|
|
949
|
-
({ className, children, side = "right", offsetTop = "0px", style, ...props }, ref) => /* @__PURE__ */
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
1666
|
+
var SheetContent = React23.forwardRef(
|
|
1667
|
+
({ className, children, side = "right", offsetTop = "0px", style, ...props }, ref) => /* @__PURE__ */ jsxs11(SheetPortal, { children: [
|
|
1668
|
+
/* @__PURE__ */ jsx26(SheetOverlay, {}),
|
|
1669
|
+
/* @__PURE__ */ jsxs11(
|
|
952
1670
|
DialogPrimitive2.Content,
|
|
953
1671
|
{
|
|
954
1672
|
ref,
|
|
955
|
-
className:
|
|
1673
|
+
className: cn25(
|
|
956
1674
|
"fixed z-50 flex flex-col bg-background shadow-xl transition-transform duration-300 ease-in-out",
|
|
957
1675
|
"bottom-0 w-[480px] max-w-[90vw] border-l",
|
|
958
1676
|
side === "right" && "right-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
|
|
@@ -963,9 +1681,9 @@ var SheetContent = React16.forwardRef(
|
|
|
963
1681
|
...props,
|
|
964
1682
|
children: [
|
|
965
1683
|
children,
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ jsxs11(DialogPrimitive2.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", children: [
|
|
1685
|
+
/* @__PURE__ */ jsx26(X2, { className: "h-4 w-4" }),
|
|
1686
|
+
/* @__PURE__ */ jsx26("span", { className: "sr-only", children: "Close" })
|
|
969
1687
|
] })
|
|
970
1688
|
]
|
|
971
1689
|
}
|
|
@@ -976,21 +1694,21 @@ SheetContent.displayName = "SheetContent";
|
|
|
976
1694
|
var SheetHeader = ({
|
|
977
1695
|
className,
|
|
978
1696
|
...props
|
|
979
|
-
}) => /* @__PURE__ */
|
|
980
|
-
var SheetTitle =
|
|
1697
|
+
}) => /* @__PURE__ */ jsx26("div", { className: cn25("shrink-0 border-b px-6 py-4", className), ...props });
|
|
1698
|
+
var SheetTitle = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
981
1699
|
DialogPrimitive2.Title,
|
|
982
1700
|
{
|
|
983
1701
|
ref,
|
|
984
|
-
className:
|
|
1702
|
+
className: cn25("text-lg font-semibold", className),
|
|
985
1703
|
...props
|
|
986
1704
|
}
|
|
987
1705
|
));
|
|
988
1706
|
SheetTitle.displayName = "SheetTitle";
|
|
989
|
-
var SheetDescription =
|
|
1707
|
+
var SheetDescription = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
990
1708
|
DialogPrimitive2.Description,
|
|
991
1709
|
{
|
|
992
1710
|
ref,
|
|
993
|
-
className:
|
|
1711
|
+
className: cn25("text-sm text-muted-foreground mt-1", className),
|
|
994
1712
|
...props
|
|
995
1713
|
}
|
|
996
1714
|
));
|
|
@@ -998,20 +1716,20 @@ SheetDescription.displayName = "SheetDescription";
|
|
|
998
1716
|
var SheetBody = ({
|
|
999
1717
|
className,
|
|
1000
1718
|
...props
|
|
1001
|
-
}) => /* @__PURE__ */
|
|
1719
|
+
}) => /* @__PURE__ */ jsx26(
|
|
1002
1720
|
"div",
|
|
1003
1721
|
{
|
|
1004
|
-
className:
|
|
1722
|
+
className: cn25("flex-1 overflow-y-auto px-6 py-4", className),
|
|
1005
1723
|
...props
|
|
1006
1724
|
}
|
|
1007
1725
|
);
|
|
1008
1726
|
var SheetFooter = ({
|
|
1009
1727
|
className,
|
|
1010
1728
|
...props
|
|
1011
|
-
}) => /* @__PURE__ */
|
|
1729
|
+
}) => /* @__PURE__ */ jsx26(
|
|
1012
1730
|
"div",
|
|
1013
1731
|
{
|
|
1014
|
-
className:
|
|
1732
|
+
className: cn25(
|
|
1015
1733
|
"shrink-0 border-t px-6 py-4 flex justify-end gap-2",
|
|
1016
1734
|
className
|
|
1017
1735
|
),
|
|
@@ -1020,8 +1738,8 @@ var SheetFooter = ({
|
|
|
1020
1738
|
);
|
|
1021
1739
|
|
|
1022
1740
|
// src/simple-group.tsx
|
|
1023
|
-
import { cn as
|
|
1024
|
-
import { jsx as
|
|
1741
|
+
import { cn as cn26 } from "@petrarca/sonnet-core";
|
|
1742
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1025
1743
|
var gapMap = {
|
|
1026
1744
|
0: "gap-0",
|
|
1027
1745
|
xs: "gap-1",
|
|
@@ -1083,10 +1801,10 @@ function SimpleGroup({
|
|
|
1083
1801
|
const wrapClass = wrap ? wrapMap[wrap] : void 0;
|
|
1084
1802
|
const growClass = grow ? "[&>*]:flex-1" : void 0;
|
|
1085
1803
|
const mtClass = mt ? mtMap[mt] : void 0;
|
|
1086
|
-
return /* @__PURE__ */
|
|
1804
|
+
return /* @__PURE__ */ jsx27(
|
|
1087
1805
|
"div",
|
|
1088
1806
|
{
|
|
1089
|
-
className:
|
|
1807
|
+
className: cn26(
|
|
1090
1808
|
"flex flex-row",
|
|
1091
1809
|
gapClass,
|
|
1092
1810
|
alignClass,
|
|
@@ -1104,8 +1822,8 @@ function SimpleGroup({
|
|
|
1104
1822
|
}
|
|
1105
1823
|
|
|
1106
1824
|
// src/simple-stack.tsx
|
|
1107
|
-
import { cn as
|
|
1108
|
-
import { jsx as
|
|
1825
|
+
import { cn as cn27 } from "@petrarca/sonnet-core";
|
|
1826
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1109
1827
|
var gapMap2 = {
|
|
1110
1828
|
0: "gap-0",
|
|
1111
1829
|
xs: "gap-1",
|
|
@@ -1145,10 +1863,10 @@ function SimpleStack({
|
|
|
1145
1863
|
const alignClass = align ? alignMap2[align] : void 0;
|
|
1146
1864
|
const justifyClass = justify ? justifyMap2[justify] : void 0;
|
|
1147
1865
|
const heightStyle = h !== void 0 ? { height: typeof h === "number" ? `${h}px` : h } : void 0;
|
|
1148
|
-
return /* @__PURE__ */
|
|
1866
|
+
return /* @__PURE__ */ jsx28(
|
|
1149
1867
|
"div",
|
|
1150
1868
|
{
|
|
1151
|
-
className:
|
|
1869
|
+
className: cn27(
|
|
1152
1870
|
"flex flex-col",
|
|
1153
1871
|
gapClass,
|
|
1154
1872
|
alignClass,
|
|
@@ -1161,96 +1879,58 @@ function SimpleStack({
|
|
|
1161
1879
|
);
|
|
1162
1880
|
}
|
|
1163
1881
|
|
|
1164
|
-
// src/tooltip.tsx
|
|
1165
|
-
import * as React17 from "react";
|
|
1166
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
1167
|
-
import { cn as cn21 } from "@petrarca/sonnet-core";
|
|
1168
|
-
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1169
|
-
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1170
|
-
var Tooltip = TooltipPrimitive.Root;
|
|
1171
|
-
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
1172
|
-
var TooltipContent = React17.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1173
|
-
TooltipPrimitive.Content,
|
|
1174
|
-
{
|
|
1175
|
-
ref,
|
|
1176
|
-
sideOffset,
|
|
1177
|
-
className: cn21(
|
|
1178
|
-
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-tooltip-content-transform-origin]",
|
|
1179
|
-
className
|
|
1180
|
-
),
|
|
1181
|
-
...props
|
|
1182
|
-
}
|
|
1183
|
-
));
|
|
1184
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
1185
|
-
|
|
1186
|
-
// src/simple-tooltip.tsx
|
|
1187
|
-
import { jsx as jsx22, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1188
|
-
function SimpleTooltip({
|
|
1189
|
-
label,
|
|
1190
|
-
children,
|
|
1191
|
-
side,
|
|
1192
|
-
align,
|
|
1193
|
-
delayDuration = 700,
|
|
1194
|
-
sideOffset
|
|
1195
|
-
}) {
|
|
1196
|
-
return /* @__PURE__ */ jsx22(TooltipProvider, { delayDuration, children: /* @__PURE__ */ jsxs6(Tooltip, { children: [
|
|
1197
|
-
/* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children }),
|
|
1198
|
-
/* @__PURE__ */ jsx22(TooltipContent, { side, align, sideOffset, children: label })
|
|
1199
|
-
] }) });
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
1882
|
// src/skeleton.tsx
|
|
1203
|
-
import { cn as
|
|
1204
|
-
import { jsx as
|
|
1883
|
+
import { cn as cn28 } from "@petrarca/sonnet-core";
|
|
1884
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1205
1885
|
function Skeleton({
|
|
1206
1886
|
className,
|
|
1207
1887
|
...props
|
|
1208
1888
|
}) {
|
|
1209
|
-
return /* @__PURE__ */
|
|
1889
|
+
return /* @__PURE__ */ jsx29(
|
|
1210
1890
|
"div",
|
|
1211
1891
|
{
|
|
1212
|
-
className:
|
|
1892
|
+
className: cn28("animate-pulse rounded-md bg-muted", className),
|
|
1213
1893
|
...props
|
|
1214
1894
|
}
|
|
1215
1895
|
);
|
|
1216
1896
|
}
|
|
1217
1897
|
|
|
1218
1898
|
// src/spinner.tsx
|
|
1219
|
-
import { cn as
|
|
1220
|
-
import { jsx as
|
|
1899
|
+
import { cn as cn29 } from "@petrarca/sonnet-core";
|
|
1900
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1221
1901
|
var sizeClasses = {
|
|
1222
1902
|
sm: "h-4 w-4 border-2",
|
|
1223
1903
|
md: "h-8 w-8 border-2",
|
|
1224
1904
|
lg: "h-12 w-12 border-3"
|
|
1225
1905
|
};
|
|
1226
1906
|
function Spinner({ className, size = "md" }) {
|
|
1227
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ jsx30(
|
|
1228
1908
|
"div",
|
|
1229
1909
|
{
|
|
1230
|
-
className:
|
|
1910
|
+
className: cn29(
|
|
1231
1911
|
"inline-block animate-spin rounded-full border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
|
|
1232
1912
|
sizeClasses[size],
|
|
1233
1913
|
className
|
|
1234
1914
|
),
|
|
1235
1915
|
role: "status",
|
|
1236
|
-
children: /* @__PURE__ */
|
|
1916
|
+
children: /* @__PURE__ */ jsx30("span", { className: "!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]", children: "Loading..." })
|
|
1237
1917
|
}
|
|
1238
1918
|
);
|
|
1239
1919
|
}
|
|
1240
1920
|
|
|
1241
1921
|
// src/tabs.tsx
|
|
1242
|
-
import * as
|
|
1922
|
+
import * as React24 from "react";
|
|
1243
1923
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
1244
|
-
import { cn as
|
|
1245
|
-
import { jsx as
|
|
1924
|
+
import { cn as cn30 } from "@petrarca/sonnet-core";
|
|
1925
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1246
1926
|
var Tabs = TabsPrimitive.Root;
|
|
1247
|
-
var TabsList =
|
|
1927
|
+
var TabsList = React24.forwardRef(({ className, align = "start", ...props }, ref) => {
|
|
1248
1928
|
const alignClass = align === "center" ? "justify-center" : align === "end" ? "justify-end" : "justify-start";
|
|
1249
|
-
return /* @__PURE__ */
|
|
1929
|
+
return /* @__PURE__ */ jsx31(
|
|
1250
1930
|
TabsPrimitive.List,
|
|
1251
1931
|
{
|
|
1252
1932
|
ref,
|
|
1253
|
-
className:
|
|
1933
|
+
className: cn30(
|
|
1254
1934
|
"inline-flex h-10 items-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
1255
1935
|
alignClass,
|
|
1256
1936
|
className
|
|
@@ -1260,11 +1940,11 @@ var TabsList = React18.forwardRef(({ className, align = "start", ...props }, ref
|
|
|
1260
1940
|
);
|
|
1261
1941
|
});
|
|
1262
1942
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
1263
|
-
var TabsTrigger =
|
|
1943
|
+
var TabsTrigger = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
1264
1944
|
TabsPrimitive.Trigger,
|
|
1265
1945
|
{
|
|
1266
1946
|
ref,
|
|
1267
|
-
className:
|
|
1947
|
+
className: cn30(
|
|
1268
1948
|
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
1269
1949
|
className
|
|
1270
1950
|
),
|
|
@@ -1272,11 +1952,11 @@ var TabsTrigger = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1272
1952
|
}
|
|
1273
1953
|
));
|
|
1274
1954
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
1275
|
-
var TabsContent =
|
|
1955
|
+
var TabsContent = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
1276
1956
|
TabsPrimitive.Content,
|
|
1277
1957
|
{
|
|
1278
1958
|
ref,
|
|
1279
|
-
className:
|
|
1959
|
+
className: cn30(
|
|
1280
1960
|
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1281
1961
|
"data-[state=inactive]:hidden",
|
|
1282
1962
|
className
|
|
@@ -1285,27 +1965,41 @@ var TabsContent = React18.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1285
1965
|
}
|
|
1286
1966
|
));
|
|
1287
1967
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
1968
|
+
var TabsSeparator = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx31(
|
|
1969
|
+
"div",
|
|
1970
|
+
{
|
|
1971
|
+
ref,
|
|
1972
|
+
role: "separator",
|
|
1973
|
+
"aria-orientation": "vertical",
|
|
1974
|
+
className: cn30(
|
|
1975
|
+
"mx-2 h-6 w-0.5 shrink-0 rounded-full bg-muted-foreground/40",
|
|
1976
|
+
className
|
|
1977
|
+
),
|
|
1978
|
+
...props
|
|
1979
|
+
}
|
|
1980
|
+
));
|
|
1981
|
+
TabsSeparator.displayName = "TabsSeparator";
|
|
1288
1982
|
|
|
1289
1983
|
// src/stepper.tsx
|
|
1290
|
-
import { Check as
|
|
1984
|
+
import { Check as Check4 } from "lucide-react";
|
|
1291
1985
|
import {
|
|
1292
1986
|
Direction as DirectionPrimitive,
|
|
1293
1987
|
Slot as SlotPrimitive
|
|
1294
1988
|
} from "radix-ui";
|
|
1295
|
-
import * as
|
|
1989
|
+
import * as React28 from "react";
|
|
1296
1990
|
import { useComposedRefs } from "@petrarca/sonnet-core";
|
|
1297
|
-
import { cn as
|
|
1991
|
+
import { cn as cn31 } from "@petrarca/sonnet-core";
|
|
1298
1992
|
|
|
1299
1993
|
// src/radix/hooks/use-as-ref.ts
|
|
1300
|
-
import * as
|
|
1994
|
+
import * as React26 from "react";
|
|
1301
1995
|
|
|
1302
1996
|
// src/radix/hooks/use-isomorphic-layout-effect.ts
|
|
1303
|
-
import * as
|
|
1304
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
1997
|
+
import * as React25 from "react";
|
|
1998
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React25.useLayoutEffect : React25.useEffect;
|
|
1305
1999
|
|
|
1306
2000
|
// src/radix/hooks/use-as-ref.ts
|
|
1307
2001
|
function useAsRef(props) {
|
|
1308
|
-
const ref =
|
|
2002
|
+
const ref = React26.useRef(props);
|
|
1309
2003
|
useIsomorphicLayoutEffect(() => {
|
|
1310
2004
|
ref.current = props;
|
|
1311
2005
|
});
|
|
@@ -1313,9 +2007,9 @@ function useAsRef(props) {
|
|
|
1313
2007
|
}
|
|
1314
2008
|
|
|
1315
2009
|
// src/radix/hooks/use-lazy-ref.ts
|
|
1316
|
-
import * as
|
|
2010
|
+
import * as React27 from "react";
|
|
1317
2011
|
function useLazyRef(fn) {
|
|
1318
|
-
const ref =
|
|
2012
|
+
const ref = React27.useRef(null);
|
|
1319
2013
|
if (ref.current === null) {
|
|
1320
2014
|
ref.current = fn();
|
|
1321
2015
|
}
|
|
@@ -1323,7 +2017,7 @@ function useLazyRef(fn) {
|
|
|
1323
2017
|
}
|
|
1324
2018
|
|
|
1325
2019
|
// src/stepper.tsx
|
|
1326
|
-
import { jsx as
|
|
2020
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1327
2021
|
var ROOT_NAME = "Stepper";
|
|
1328
2022
|
var LIST_NAME = "StepperList";
|
|
1329
2023
|
var ITEM_NAME = "StepperItem";
|
|
@@ -1442,9 +2136,9 @@ function getDataState(value, itemValue, stepState, steps, variant = "item") {
|
|
|
1442
2136
|
}
|
|
1443
2137
|
return "inactive";
|
|
1444
2138
|
}
|
|
1445
|
-
var StoreContext =
|
|
2139
|
+
var StoreContext = React28.createContext(null);
|
|
1446
2140
|
function useStoreContext(consumerName) {
|
|
1447
|
-
const context =
|
|
2141
|
+
const context = React28.useContext(StoreContext);
|
|
1448
2142
|
if (!context) {
|
|
1449
2143
|
throw new Error(`\`${consumerName}\` must be used within \`${ROOT_NAME}\``);
|
|
1450
2144
|
}
|
|
@@ -1452,15 +2146,15 @@ function useStoreContext(consumerName) {
|
|
|
1452
2146
|
}
|
|
1453
2147
|
function useStore(selector) {
|
|
1454
2148
|
const store = useStoreContext("useStore");
|
|
1455
|
-
const getSnapshot =
|
|
2149
|
+
const getSnapshot = React28.useCallback(
|
|
1456
2150
|
() => selector(store.getState()),
|
|
1457
2151
|
[store, selector]
|
|
1458
2152
|
);
|
|
1459
|
-
return
|
|
2153
|
+
return React28.useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
|
|
1460
2154
|
}
|
|
1461
|
-
var StepperContext =
|
|
2155
|
+
var StepperContext = React28.createContext(null);
|
|
1462
2156
|
function useStepperContext(consumerName) {
|
|
1463
|
-
const context =
|
|
2157
|
+
const context = React28.useContext(StepperContext);
|
|
1464
2158
|
if (!context) {
|
|
1465
2159
|
throw new Error(`\`${consumerName}\` must be used within \`${ROOT_NAME}\``);
|
|
1466
2160
|
}
|
|
@@ -1498,7 +2192,7 @@ function Stepper(props) {
|
|
|
1498
2192
|
onValueRemove,
|
|
1499
2193
|
onValidate
|
|
1500
2194
|
});
|
|
1501
|
-
const store =
|
|
2195
|
+
const store = React28.useMemo(() => {
|
|
1502
2196
|
return {
|
|
1503
2197
|
subscribe: (cb) => {
|
|
1504
2198
|
listenersRef.current.add(cb);
|
|
@@ -1572,9 +2266,9 @@ function Stepper(props) {
|
|
|
1572
2266
|
}
|
|
1573
2267
|
}, [value]);
|
|
1574
2268
|
const dir = DirectionPrimitive.useDirection(dirProp);
|
|
1575
|
-
const instanceId =
|
|
2269
|
+
const instanceId = React28.useId();
|
|
1576
2270
|
const rootId = id ?? instanceId;
|
|
1577
|
-
const contextValue =
|
|
2271
|
+
const contextValue = React28.useMemo(
|
|
1578
2272
|
() => ({
|
|
1579
2273
|
rootId,
|
|
1580
2274
|
dir,
|
|
@@ -1587,7 +2281,7 @@ function Stepper(props) {
|
|
|
1587
2281
|
[rootId, dir, orientation, activationMode, disabled, nonInteractive, loop]
|
|
1588
2282
|
);
|
|
1589
2283
|
const RootPrimitive = asChild ? SlotPrimitive.Slot : "div";
|
|
1590
|
-
return /* @__PURE__ */
|
|
2284
|
+
return /* @__PURE__ */ jsx32(StoreContext.Provider, { value: store, children: /* @__PURE__ */ jsx32(StepperContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx32(
|
|
1591
2285
|
RootPrimitive,
|
|
1592
2286
|
{
|
|
1593
2287
|
id: rootId,
|
|
@@ -1596,7 +2290,7 @@ function Stepper(props) {
|
|
|
1596
2290
|
"data-slot": "stepper",
|
|
1597
2291
|
dir,
|
|
1598
2292
|
...rootProps,
|
|
1599
|
-
className:
|
|
2293
|
+
className: cn31(
|
|
1600
2294
|
"flex gap-3",
|
|
1601
2295
|
orientation === "horizontal" ? "w-full flex-col" : "flex-row",
|
|
1602
2296
|
className
|
|
@@ -1604,9 +2298,9 @@ function Stepper(props) {
|
|
|
1604
2298
|
}
|
|
1605
2299
|
) }) });
|
|
1606
2300
|
}
|
|
1607
|
-
var FocusContext =
|
|
2301
|
+
var FocusContext = React28.createContext(null);
|
|
1608
2302
|
function useFocusContext(consumerName) {
|
|
1609
|
-
const context =
|
|
2303
|
+
const context = React28.useContext(FocusContext);
|
|
1610
2304
|
if (!context) {
|
|
1611
2305
|
throw new Error(
|
|
1612
2306
|
`\`${consumerName}\` must be used within \`FocusProvider\``
|
|
@@ -1633,32 +2327,32 @@ function StepperList(props) {
|
|
|
1633
2327
|
onFocus: onFocusProp,
|
|
1634
2328
|
onMouseDown: onMouseDownProp
|
|
1635
2329
|
});
|
|
1636
|
-
const [tabStopId, setTabStopId] =
|
|
1637
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
1638
|
-
const [focusableItemCount, setFocusableItemCount] =
|
|
1639
|
-
const isClickFocusRef =
|
|
1640
|
-
const itemsRef =
|
|
1641
|
-
const listRef =
|
|
2330
|
+
const [tabStopId, setTabStopId] = React28.useState(null);
|
|
2331
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React28.useState(false);
|
|
2332
|
+
const [focusableItemCount, setFocusableItemCount] = React28.useState(0);
|
|
2333
|
+
const isClickFocusRef = React28.useRef(false);
|
|
2334
|
+
const itemsRef = React28.useRef(/* @__PURE__ */ new Map());
|
|
2335
|
+
const listRef = React28.useRef(null);
|
|
1642
2336
|
const composedRef = useComposedRefs(ref, listRef);
|
|
1643
|
-
const onItemFocus =
|
|
2337
|
+
const onItemFocus = React28.useCallback((tabStopId2) => {
|
|
1644
2338
|
setTabStopId(tabStopId2);
|
|
1645
2339
|
}, []);
|
|
1646
|
-
const onItemShiftTab =
|
|
2340
|
+
const onItemShiftTab = React28.useCallback(() => {
|
|
1647
2341
|
setIsTabbingBackOut(true);
|
|
1648
2342
|
}, []);
|
|
1649
|
-
const onFocusableItemAdd =
|
|
2343
|
+
const onFocusableItemAdd = React28.useCallback(() => {
|
|
1650
2344
|
setFocusableItemCount((prevCount) => prevCount + 1);
|
|
1651
2345
|
}, []);
|
|
1652
|
-
const onFocusableItemRemove =
|
|
2346
|
+
const onFocusableItemRemove = React28.useCallback(() => {
|
|
1653
2347
|
setFocusableItemCount((prevCount) => prevCount - 1);
|
|
1654
2348
|
}, []);
|
|
1655
|
-
const onItemRegister =
|
|
2349
|
+
const onItemRegister = React28.useCallback((item) => {
|
|
1656
2350
|
itemsRef.current.set(item.id, item);
|
|
1657
2351
|
}, []);
|
|
1658
|
-
const onItemUnregister =
|
|
2352
|
+
const onItemUnregister = React28.useCallback((id) => {
|
|
1659
2353
|
itemsRef.current.delete(id);
|
|
1660
2354
|
}, []);
|
|
1661
|
-
const getItems =
|
|
2355
|
+
const getItems = React28.useCallback(() => {
|
|
1662
2356
|
return Array.from(itemsRef.current.values()).filter((item) => item.ref.current).sort((a, b) => {
|
|
1663
2357
|
const elementA = a.ref.current;
|
|
1664
2358
|
const elementB = b.ref.current;
|
|
@@ -1673,7 +2367,7 @@ function StepperList(props) {
|
|
|
1673
2367
|
return 0;
|
|
1674
2368
|
});
|
|
1675
2369
|
}, []);
|
|
1676
|
-
const onBlur =
|
|
2370
|
+
const onBlur = React28.useCallback(
|
|
1677
2371
|
(event) => {
|
|
1678
2372
|
propsRef.current.onBlur?.(event);
|
|
1679
2373
|
if (event.defaultPrevented) return;
|
|
@@ -1681,7 +2375,7 @@ function StepperList(props) {
|
|
|
1681
2375
|
},
|
|
1682
2376
|
[propsRef]
|
|
1683
2377
|
);
|
|
1684
|
-
const onFocus =
|
|
2378
|
+
const onFocus = React28.useCallback(
|
|
1685
2379
|
(event) => {
|
|
1686
2380
|
propsRef.current.onFocus?.(event);
|
|
1687
2381
|
if (event.defaultPrevented) return;
|
|
@@ -1710,7 +2404,7 @@ function StepperList(props) {
|
|
|
1710
2404
|
},
|
|
1711
2405
|
[propsRef, isTabbingBackOut, currentValue, tabStopId]
|
|
1712
2406
|
);
|
|
1713
|
-
const onMouseDown =
|
|
2407
|
+
const onMouseDown = React28.useCallback(
|
|
1714
2408
|
(event) => {
|
|
1715
2409
|
propsRef.current.onMouseDown?.(event);
|
|
1716
2410
|
if (event.defaultPrevented) return;
|
|
@@ -1718,7 +2412,7 @@ function StepperList(props) {
|
|
|
1718
2412
|
},
|
|
1719
2413
|
[propsRef]
|
|
1720
2414
|
);
|
|
1721
|
-
const focusContextValue =
|
|
2415
|
+
const focusContextValue = React28.useMemo(
|
|
1722
2416
|
() => ({
|
|
1723
2417
|
tabStopId,
|
|
1724
2418
|
onItemFocus,
|
|
@@ -1741,7 +2435,7 @@ function StepperList(props) {
|
|
|
1741
2435
|
]
|
|
1742
2436
|
);
|
|
1743
2437
|
const ListPrimitive = asChild ? SlotPrimitive.Slot : "div";
|
|
1744
|
-
return /* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ jsx32(FocusContext.Provider, { value: focusContextValue, children: /* @__PURE__ */ jsx32(
|
|
1745
2439
|
ListPrimitive,
|
|
1746
2440
|
{
|
|
1747
2441
|
role: "tablist",
|
|
@@ -1752,7 +2446,7 @@ function StepperList(props) {
|
|
|
1752
2446
|
tabIndex: isTabbingBackOut || focusableItemCount === 0 ? -1 : 0,
|
|
1753
2447
|
...listProps,
|
|
1754
2448
|
ref: composedRef,
|
|
1755
|
-
className:
|
|
2449
|
+
className: cn31(
|
|
1756
2450
|
"flex outline-none",
|
|
1757
2451
|
orientation === "horizontal" ? "flex-row items-center" : "flex-col items-start",
|
|
1758
2452
|
className
|
|
@@ -1764,11 +2458,11 @@ function StepperList(props) {
|
|
|
1764
2458
|
}
|
|
1765
2459
|
) });
|
|
1766
2460
|
}
|
|
1767
|
-
var StepperItemContext =
|
|
2461
|
+
var StepperItemContext = React28.createContext(
|
|
1768
2462
|
null
|
|
1769
2463
|
);
|
|
1770
2464
|
function useStepperItemContext(consumerName) {
|
|
1771
|
-
const context =
|
|
2465
|
+
const context = React28.useContext(StepperItemContext);
|
|
1772
2466
|
if (!context) {
|
|
1773
2467
|
throw new Error(`\`${consumerName}\` must be used within \`${ITEM_NAME}\``);
|
|
1774
2468
|
}
|
|
@@ -1801,7 +2495,7 @@ function StepperItem(props) {
|
|
|
1801
2495
|
const stepState = useStore((state) => state.steps.get(itemValue));
|
|
1802
2496
|
const steps = useStore((state) => state.steps);
|
|
1803
2497
|
const dataState = getDataState(value, itemValue, stepState, steps);
|
|
1804
|
-
const itemContextValue =
|
|
2498
|
+
const itemContextValue = React28.useMemo(
|
|
1805
2499
|
() => ({
|
|
1806
2500
|
value: itemValue,
|
|
1807
2501
|
stepState
|
|
@@ -1809,7 +2503,7 @@ function StepperItem(props) {
|
|
|
1809
2503
|
[itemValue, stepState]
|
|
1810
2504
|
);
|
|
1811
2505
|
const ItemPrimitive = asChild ? SlotPrimitive.Slot : "div";
|
|
1812
|
-
return /* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ jsx32(StepperItemContext.Provider, { value: itemContextValue, children: /* @__PURE__ */ jsx32(
|
|
1813
2507
|
ItemPrimitive,
|
|
1814
2508
|
{
|
|
1815
2509
|
"data-disabled": stepState?.disabled ? "" : void 0,
|
|
@@ -1819,7 +2513,7 @@ function StepperItem(props) {
|
|
|
1819
2513
|
dir: context.dir,
|
|
1820
2514
|
...itemProps,
|
|
1821
2515
|
ref,
|
|
1822
|
-
className:
|
|
2516
|
+
className: cn31(
|
|
1823
2517
|
"relative flex not-last:flex-1 items-center",
|
|
1824
2518
|
orientation === "horizontal" ? "flex-row" : "flex-col",
|
|
1825
2519
|
className
|
|
@@ -1868,11 +2562,11 @@ function StepperTrigger(props) {
|
|
|
1868
2562
|
const isActive = value === itemValue;
|
|
1869
2563
|
const isTabStop = focusContext.tabStopId === triggerId;
|
|
1870
2564
|
const dataState = getDataState(value, itemValue, stepState, steps);
|
|
1871
|
-
const triggerRef =
|
|
2565
|
+
const triggerRef = React28.useRef(null);
|
|
1872
2566
|
const composedRef = useComposedRefs(ref, triggerRef);
|
|
1873
|
-
const isArrowKeyPressedRef =
|
|
1874
|
-
const isMouseClickRef =
|
|
1875
|
-
|
|
2567
|
+
const isArrowKeyPressedRef = React28.useRef(false);
|
|
2568
|
+
const isMouseClickRef = React28.useRef(false);
|
|
2569
|
+
React28.useEffect(() => {
|
|
1876
2570
|
function onKeyDown2(event) {
|
|
1877
2571
|
if (ARROW_KEYS.includes(event.key)) {
|
|
1878
2572
|
isArrowKeyPressedRef.current = true;
|
|
@@ -1906,7 +2600,7 @@ function StepperTrigger(props) {
|
|
|
1906
2600
|
}
|
|
1907
2601
|
};
|
|
1908
2602
|
}, [focusContext, triggerId, itemValue, isTabStop, isDisabled]);
|
|
1909
|
-
const onClick =
|
|
2603
|
+
const onClick = React28.useCallback(
|
|
1910
2604
|
async (event) => {
|
|
1911
2605
|
propsRef.current.onClick?.(event);
|
|
1912
2606
|
if (event.defaultPrevented) return;
|
|
@@ -1927,7 +2621,7 @@ function StepperTrigger(props) {
|
|
|
1927
2621
|
propsRef
|
|
1928
2622
|
]
|
|
1929
2623
|
);
|
|
1930
|
-
const onFocus =
|
|
2624
|
+
const onFocus = React28.useCallback(
|
|
1931
2625
|
async (event) => {
|
|
1932
2626
|
propsRef.current.onFocus?.(event);
|
|
1933
2627
|
if (event.defaultPrevented) return;
|
|
@@ -1955,7 +2649,7 @@ function StepperTrigger(props) {
|
|
|
1955
2649
|
propsRef
|
|
1956
2650
|
]
|
|
1957
2651
|
);
|
|
1958
|
-
const onKeyDown =
|
|
2652
|
+
const onKeyDown = React28.useCallback(
|
|
1959
2653
|
async (event) => {
|
|
1960
2654
|
propsRef.current.onKeyDown?.(event);
|
|
1961
2655
|
if (event.defaultPrevented) return;
|
|
@@ -2010,7 +2704,7 @@ function StepperTrigger(props) {
|
|
|
2010
2704
|
steps
|
|
2011
2705
|
]
|
|
2012
2706
|
);
|
|
2013
|
-
const onMouseDown =
|
|
2707
|
+
const onMouseDown = React28.useCallback(
|
|
2014
2708
|
(event) => {
|
|
2015
2709
|
propsRef.current.onMouseDown?.(event);
|
|
2016
2710
|
if (event.defaultPrevented) return;
|
|
@@ -2024,7 +2718,7 @@ function StepperTrigger(props) {
|
|
|
2024
2718
|
[focusContext, triggerId, isDisabled, propsRef]
|
|
2025
2719
|
);
|
|
2026
2720
|
const TriggerPrimitive = asChild ? SlotPrimitive.Slot : "button";
|
|
2027
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ jsx32(
|
|
2028
2722
|
TriggerPrimitive,
|
|
2029
2723
|
{
|
|
2030
2724
|
id: triggerId,
|
|
@@ -2043,7 +2737,7 @@ function StepperTrigger(props) {
|
|
|
2043
2737
|
tabIndex: isTabStop ? 0 : -1,
|
|
2044
2738
|
...triggerProps,
|
|
2045
2739
|
ref: composedRef,
|
|
2046
|
-
className:
|
|
2740
|
+
className: cn31(
|
|
2047
2741
|
"inline-flex items-center justify-center gap-3 rounded-md text-left outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2048
2742
|
"not-has-data-[slot=description]:rounded-full not-has-data-[slot=title]:rounded-full",
|
|
2049
2743
|
className
|
|
@@ -2066,7 +2760,7 @@ function StepperIndicator(props) {
|
|
|
2066
2760
|
const stepPosition = Array.from(steps.keys()).indexOf(itemValue) + 1;
|
|
2067
2761
|
const dataState = getDataState(value, itemValue, stepState, steps);
|
|
2068
2762
|
const IndicatorPrimitive = asChild ? SlotPrimitive.Slot : "div";
|
|
2069
|
-
return /* @__PURE__ */
|
|
2763
|
+
return /* @__PURE__ */ jsx32(
|
|
2070
2764
|
IndicatorPrimitive,
|
|
2071
2765
|
{
|
|
2072
2766
|
"data-state": dataState,
|
|
@@ -2074,11 +2768,11 @@ function StepperIndicator(props) {
|
|
|
2074
2768
|
dir: context.dir,
|
|
2075
2769
|
...indicatorProps,
|
|
2076
2770
|
ref,
|
|
2077
|
-
className:
|
|
2771
|
+
className: cn31(
|
|
2078
2772
|
"flex size-7 shrink-0 items-center justify-center rounded-full border-2 border-muted bg-background font-medium text-muted-foreground text-sm transition-colors data-[state=active]:border-primary data-[state=completed]:border-primary data-[state=active]:bg-primary data-[state=completed]:bg-primary data-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground",
|
|
2079
2773
|
className
|
|
2080
2774
|
),
|
|
2081
|
-
children: typeof children === "function" ? children(dataState) : children ? children : dataState === "completed" ? /* @__PURE__ */
|
|
2775
|
+
children: typeof children === "function" ? children(dataState) : children ? children : dataState === "completed" ? /* @__PURE__ */ jsx32(Check4, { className: "size-4" }) : stepPosition
|
|
2082
2776
|
}
|
|
2083
2777
|
);
|
|
2084
2778
|
}
|
|
@@ -2106,7 +2800,7 @@ function StepperSeparator(props) {
|
|
|
2106
2800
|
"separator"
|
|
2107
2801
|
);
|
|
2108
2802
|
const SeparatorPrimitive2 = asChild ? SlotPrimitive.Slot : "div";
|
|
2109
|
-
return /* @__PURE__ */
|
|
2803
|
+
return /* @__PURE__ */ jsx32(
|
|
2110
2804
|
SeparatorPrimitive2,
|
|
2111
2805
|
{
|
|
2112
2806
|
role: "separator",
|
|
@@ -2118,7 +2812,7 @@ function StepperSeparator(props) {
|
|
|
2118
2812
|
dir: context.dir,
|
|
2119
2813
|
...separatorProps,
|
|
2120
2814
|
ref,
|
|
2121
|
-
className:
|
|
2815
|
+
className: cn31(
|
|
2122
2816
|
"bg-border transition-colors data-[state=active]:bg-primary data-[state=completed]:bg-primary",
|
|
2123
2817
|
orientation === "horizontal" ? "h-px flex-1" : "h-10 w-px",
|
|
2124
2818
|
className
|
|
@@ -2132,7 +2826,7 @@ function StepperTitle(props) {
|
|
|
2132
2826
|
const itemContext = useStepperItemContext(TITLE_NAME);
|
|
2133
2827
|
const titleId = getId(context.rootId, "title", itemContext.value);
|
|
2134
2828
|
const TitlePrimitive = asChild ? SlotPrimitive.Slot : "span";
|
|
2135
|
-
return /* @__PURE__ */
|
|
2829
|
+
return /* @__PURE__ */ jsx32(
|
|
2136
2830
|
TitlePrimitive,
|
|
2137
2831
|
{
|
|
2138
2832
|
id: titleId,
|
|
@@ -2140,7 +2834,7 @@ function StepperTitle(props) {
|
|
|
2140
2834
|
dir: context.dir,
|
|
2141
2835
|
...titleProps,
|
|
2142
2836
|
ref,
|
|
2143
|
-
className:
|
|
2837
|
+
className: cn31("font-medium text-sm", className)
|
|
2144
2838
|
}
|
|
2145
2839
|
);
|
|
2146
2840
|
}
|
|
@@ -2150,7 +2844,7 @@ function StepperDescription(props) {
|
|
|
2150
2844
|
const itemContext = useStepperItemContext(DESCRIPTION_NAME);
|
|
2151
2845
|
const descriptionId = getId(context.rootId, "description", itemContext.value);
|
|
2152
2846
|
const DescriptionPrimitive = asChild ? SlotPrimitive.Slot : "span";
|
|
2153
|
-
return /* @__PURE__ */
|
|
2847
|
+
return /* @__PURE__ */ jsx32(
|
|
2154
2848
|
DescriptionPrimitive,
|
|
2155
2849
|
{
|
|
2156
2850
|
id: descriptionId,
|
|
@@ -2158,7 +2852,7 @@ function StepperDescription(props) {
|
|
|
2158
2852
|
dir: context.dir,
|
|
2159
2853
|
...descriptionProps,
|
|
2160
2854
|
ref,
|
|
2161
|
-
className:
|
|
2855
|
+
className: cn31("text-muted-foreground text-xs", className)
|
|
2162
2856
|
}
|
|
2163
2857
|
);
|
|
2164
2858
|
}
|
|
@@ -2177,7 +2871,7 @@ function StepperContent(props) {
|
|
|
2177
2871
|
const triggerId = getId(context.rootId, "trigger", valueProp);
|
|
2178
2872
|
if (valueProp !== value && !forceMount) return null;
|
|
2179
2873
|
const ContentPrimitive = asChild ? SlotPrimitive.Slot : "div";
|
|
2180
|
-
return /* @__PURE__ */
|
|
2874
|
+
return /* @__PURE__ */ jsx32(
|
|
2181
2875
|
ContentPrimitive,
|
|
2182
2876
|
{
|
|
2183
2877
|
id: contentId,
|
|
@@ -2187,7 +2881,7 @@ function StepperContent(props) {
|
|
|
2187
2881
|
dir: context.dir,
|
|
2188
2882
|
...contentProps,
|
|
2189
2883
|
ref,
|
|
2190
|
-
className:
|
|
2884
|
+
className: cn31("flex-1 outline-none", className)
|
|
2191
2885
|
}
|
|
2192
2886
|
);
|
|
2193
2887
|
}
|
|
@@ -2202,7 +2896,7 @@ function StepperPrev(props) {
|
|
|
2202
2896
|
const stepKeys = Array.from(steps.keys());
|
|
2203
2897
|
const currentIndex = stepKeys.length > 0 ? stepKeys.indexOf(value ?? "") : -1;
|
|
2204
2898
|
const isDisabled = disabled || currentIndex <= 0;
|
|
2205
|
-
const onClick =
|
|
2899
|
+
const onClick = React28.useCallback(
|
|
2206
2900
|
async (event) => {
|
|
2207
2901
|
propsRef.current.onClick?.(event);
|
|
2208
2902
|
if (event.defaultPrevented || isDisabled) return;
|
|
@@ -2215,7 +2909,7 @@ function StepperPrev(props) {
|
|
|
2215
2909
|
[propsRef, isDisabled, currentIndex, stepKeys, store]
|
|
2216
2910
|
);
|
|
2217
2911
|
const PrevPrimitive = asChild ? SlotPrimitive.Slot : "button";
|
|
2218
|
-
return /* @__PURE__ */
|
|
2912
|
+
return /* @__PURE__ */ jsx32(
|
|
2219
2913
|
PrevPrimitive,
|
|
2220
2914
|
{
|
|
2221
2915
|
type: "button",
|
|
@@ -2237,7 +2931,7 @@ function StepperNext(props) {
|
|
|
2237
2931
|
const stepKeys = Array.from(steps.keys());
|
|
2238
2932
|
const currentIndex = stepKeys.length > 0 ? stepKeys.indexOf(value ?? "") : -1;
|
|
2239
2933
|
const isDisabled = disabled || stepKeys.length === 0 || currentIndex >= stepKeys.length - 1;
|
|
2240
|
-
const onClick =
|
|
2934
|
+
const onClick = React28.useCallback(
|
|
2241
2935
|
async (event) => {
|
|
2242
2936
|
propsRef.current.onClick?.(event);
|
|
2243
2937
|
if (event.defaultPrevented || isDisabled) return;
|
|
@@ -2250,7 +2944,7 @@ function StepperNext(props) {
|
|
|
2250
2944
|
[propsRef, isDisabled, currentIndex, stepKeys, store]
|
|
2251
2945
|
);
|
|
2252
2946
|
const NextPrimitive = asChild ? SlotPrimitive.Slot : "button";
|
|
2253
|
-
return /* @__PURE__ */
|
|
2947
|
+
return /* @__PURE__ */ jsx32(
|
|
2254
2948
|
NextPrimitive,
|
|
2255
2949
|
{
|
|
2256
2950
|
type: "button",
|
|
@@ -2265,18 +2959,19 @@ function StepperNext(props) {
|
|
|
2265
2959
|
// src/EntityTable/EntityTable.tsx
|
|
2266
2960
|
import {
|
|
2267
2961
|
useCallback as useCallback2,
|
|
2268
|
-
useEffect as
|
|
2269
|
-
useMemo as
|
|
2962
|
+
useEffect as useEffect6,
|
|
2963
|
+
useMemo as useMemo5,
|
|
2270
2964
|
useRef as useRef4,
|
|
2271
|
-
useState as
|
|
2965
|
+
useState as useState5
|
|
2272
2966
|
} from "react";
|
|
2273
2967
|
import {
|
|
2274
2968
|
flexRender,
|
|
2275
2969
|
getCoreRowModel,
|
|
2276
2970
|
useReactTable
|
|
2277
2971
|
} from "@tanstack/react-table";
|
|
2278
|
-
import { ChevronRight as
|
|
2279
|
-
import { cn as
|
|
2972
|
+
import { ChevronRight as ChevronRight3 } from "lucide-react";
|
|
2973
|
+
import { cn as cn32 } from "@petrarca/sonnet-core";
|
|
2974
|
+
import { useComponentDefaults } from "@petrarca/sonnet-core/config";
|
|
2280
2975
|
|
|
2281
2976
|
// src/EntityTable/tableSchema/mergeUiSchema.ts
|
|
2282
2977
|
function resolveCellRenderer(property, uiEntry) {
|
|
@@ -2306,12 +3001,12 @@ function mergeColumnConfig(key, property, uiSchema) {
|
|
|
2306
3001
|
}
|
|
2307
3002
|
|
|
2308
3003
|
// src/EntityTable/tableSchema/cellRegistry.ts
|
|
2309
|
-
import
|
|
3004
|
+
import React29 from "react";
|
|
2310
3005
|
import { warnLog } from "@petrarca/sonnet-core";
|
|
2311
3006
|
|
|
2312
3007
|
// src/EntityTable/tableSchema/cellRenderers.tsx
|
|
2313
3008
|
import { formatDate, formatDateTime } from "@petrarca/sonnet-core";
|
|
2314
|
-
import { Fragment, jsx as
|
|
3009
|
+
import { Fragment as Fragment2, jsx as jsx33, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2315
3010
|
function resolveValue(value, options) {
|
|
2316
3011
|
const key = options.valueKey;
|
|
2317
3012
|
if (key && value != null && typeof value === "object") {
|
|
@@ -2327,60 +3022,95 @@ function TextCell({
|
|
|
2327
3022
|
options
|
|
2328
3023
|
}) {
|
|
2329
3024
|
const text = resolveValue(value, options);
|
|
2330
|
-
return /* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ jsx33("span", { className: cx("", options), children: text == null ? "\u2014" : String(text) });
|
|
2331
3026
|
}
|
|
2332
3027
|
function MutedCell({
|
|
2333
3028
|
value,
|
|
2334
3029
|
options
|
|
2335
3030
|
}) {
|
|
2336
3031
|
const text = resolveValue(value, options);
|
|
2337
|
-
return /* @__PURE__ */
|
|
3032
|
+
return /* @__PURE__ */ jsx33("span", { className: cx("text-muted-foreground", options), children: text == null ? "\u2014" : String(text) });
|
|
2338
3033
|
}
|
|
2339
3034
|
function BoldCell({
|
|
2340
3035
|
value,
|
|
2341
3036
|
options
|
|
2342
3037
|
}) {
|
|
2343
3038
|
const text = resolveValue(value, options);
|
|
2344
|
-
return /* @__PURE__ */
|
|
3039
|
+
return /* @__PURE__ */ jsx33("span", { className: cx("font-medium", options), children: text == null ? "\u2014" : String(text) });
|
|
2345
3040
|
}
|
|
2346
3041
|
function CodeCell({
|
|
2347
3042
|
value,
|
|
2348
3043
|
options
|
|
2349
3044
|
}) {
|
|
2350
3045
|
const text = resolveValue(value, options);
|
|
2351
|
-
return /* @__PURE__ */
|
|
3046
|
+
return /* @__PURE__ */ jsx33("span", { className: cx("font-mono text-xs", options), children: text == null ? "\u2014" : String(text) });
|
|
2352
3047
|
}
|
|
2353
3048
|
function BadgeCell({
|
|
2354
3049
|
value,
|
|
2355
3050
|
options
|
|
2356
3051
|
}) {
|
|
2357
3052
|
if (value == null)
|
|
2358
|
-
return /* @__PURE__ */
|
|
3053
|
+
return /* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
2359
3054
|
const key = String(value);
|
|
2360
3055
|
const colors = options.colors;
|
|
2361
3056
|
const labels = options.labels;
|
|
2362
3057
|
const color = colors?.[key];
|
|
2363
3058
|
const label = labels?.[key] ?? key;
|
|
2364
|
-
return /* @__PURE__ */
|
|
3059
|
+
return /* @__PURE__ */ jsx33(Badge, { badgeColor: color, children: label });
|
|
3060
|
+
}
|
|
3061
|
+
function conditionHolds(value, when) {
|
|
3062
|
+
const isEmpty = value == null || value === "";
|
|
3063
|
+
switch (when) {
|
|
3064
|
+
case "empty":
|
|
3065
|
+
return isEmpty;
|
|
3066
|
+
case "present":
|
|
3067
|
+
return !isEmpty;
|
|
3068
|
+
case "truthy":
|
|
3069
|
+
return Boolean(value);
|
|
3070
|
+
case "falsy":
|
|
3071
|
+
return !value;
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
function renderConditionalFallback(value, fallback) {
|
|
3075
|
+
if (fallback === "dash" || value == null || value === "") {
|
|
3076
|
+
return /* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
3077
|
+
}
|
|
3078
|
+
if (fallback === "muted-value") {
|
|
3079
|
+
return /* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: String(value) });
|
|
3080
|
+
}
|
|
3081
|
+
return /* @__PURE__ */ jsx33("span", { children: String(value) });
|
|
3082
|
+
}
|
|
3083
|
+
function ConditionalBadgeCell({
|
|
3084
|
+
value,
|
|
3085
|
+
options
|
|
3086
|
+
}) {
|
|
3087
|
+
const when = options.when ?? "truthy";
|
|
3088
|
+
const variant = options.variant ?? "secondary";
|
|
3089
|
+
const fallback = options.fallback ?? "dash";
|
|
3090
|
+
if (conditionHolds(value, when)) {
|
|
3091
|
+
const label = options.label != null ? String(options.label) : String(value ?? "");
|
|
3092
|
+
return /* @__PURE__ */ jsx33(Badge, { variant, children: label });
|
|
3093
|
+
}
|
|
3094
|
+
return renderConditionalFallback(value, fallback);
|
|
2365
3095
|
}
|
|
2366
3096
|
function DateCell({
|
|
2367
3097
|
value,
|
|
2368
3098
|
options
|
|
2369
3099
|
}) {
|
|
2370
|
-
return /* @__PURE__ */
|
|
3100
|
+
return /* @__PURE__ */ jsx33("span", { className: cx("text-muted-foreground", options), children: formatDate(value) });
|
|
2371
3101
|
}
|
|
2372
3102
|
function DateTimeCell({
|
|
2373
3103
|
value,
|
|
2374
3104
|
options
|
|
2375
3105
|
}) {
|
|
2376
|
-
return /* @__PURE__ */
|
|
3106
|
+
return /* @__PURE__ */ jsx33("span", { className: cx("text-muted-foreground", options), children: formatDateTime(value) });
|
|
2377
3107
|
}
|
|
2378
3108
|
function BooleanCell({ value }) {
|
|
2379
|
-
return /* @__PURE__ */
|
|
3109
|
+
return /* @__PURE__ */ jsx33("span", { className: value ? "text-green-600" : "text-muted-foreground", children: value ? "Yes" : "No" });
|
|
2380
3110
|
}
|
|
2381
3111
|
function NumberCell({ value }) {
|
|
2382
3112
|
const text = value == null ? "\u2014" : String(value);
|
|
2383
|
-
return /* @__PURE__ */
|
|
3113
|
+
return /* @__PURE__ */ jsx33("span", { className: "tabular-nums", children: text });
|
|
2384
3114
|
}
|
|
2385
3115
|
function TruncateCell({
|
|
2386
3116
|
value,
|
|
@@ -2388,7 +3118,7 @@ function TruncateCell({
|
|
|
2388
3118
|
}) {
|
|
2389
3119
|
const resolved = resolveValue(value, options);
|
|
2390
3120
|
const text = resolved == null ? "\u2014" : String(resolved);
|
|
2391
|
-
return /* @__PURE__ */
|
|
3121
|
+
return /* @__PURE__ */ jsx33("span", { className: "block truncate max-w-xs", title: text, children: text });
|
|
2392
3122
|
}
|
|
2393
3123
|
function OverflowListCell({
|
|
2394
3124
|
value,
|
|
@@ -2396,20 +3126,20 @@ function OverflowListCell({
|
|
|
2396
3126
|
}) {
|
|
2397
3127
|
const items = Array.isArray(value) ? value : [];
|
|
2398
3128
|
if (items.length === 0)
|
|
2399
|
-
return /* @__PURE__ */
|
|
3129
|
+
return /* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
2400
3130
|
const displayKey = options.displayKey;
|
|
2401
3131
|
const fallbackKey = options.fallbackKey;
|
|
2402
3132
|
const prefixKey = options.prefixKey;
|
|
2403
3133
|
const first = items[0];
|
|
2404
3134
|
const label = displayKey && first[displayKey] || fallbackKey && first[fallbackKey] || "";
|
|
2405
|
-
return /* @__PURE__ */
|
|
2406
|
-
prefixKey && /* @__PURE__ */
|
|
3135
|
+
return /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
3136
|
+
prefixKey && /* @__PURE__ */ jsxs12("span", { className: "text-muted-foreground", children: [
|
|
2407
3137
|
String(first[prefixKey]),
|
|
2408
3138
|
":",
|
|
2409
3139
|
" "
|
|
2410
3140
|
] }),
|
|
2411
3141
|
label,
|
|
2412
|
-
items.length > 1 && /* @__PURE__ */
|
|
3142
|
+
items.length > 1 && /* @__PURE__ */ jsxs12("span", { className: "text-muted-foreground ml-1", children: [
|
|
2413
3143
|
"+",
|
|
2414
3144
|
items.length - 1
|
|
2415
3145
|
] })
|
|
@@ -2421,8 +3151,8 @@ function JoinCell({
|
|
|
2421
3151
|
}) {
|
|
2422
3152
|
const sep = options.separator ?? ", ";
|
|
2423
3153
|
if (!Array.isArray(value) || value.length === 0)
|
|
2424
|
-
return /* @__PURE__ */
|
|
2425
|
-
return /* @__PURE__ */
|
|
3154
|
+
return /* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
3155
|
+
return /* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: value.join(sep) });
|
|
2426
3156
|
}
|
|
2427
3157
|
|
|
2428
3158
|
// src/EntityTable/tableSchema/cellRegistry.ts
|
|
@@ -2432,6 +3162,7 @@ var CELL_RENDERERS = {
|
|
|
2432
3162
|
bold: BoldCell,
|
|
2433
3163
|
code: CodeCell,
|
|
2434
3164
|
badge: BadgeCell,
|
|
3165
|
+
"badge-when": ConditionalBadgeCell,
|
|
2435
3166
|
date: DateCell,
|
|
2436
3167
|
datetime: DateTimeCell,
|
|
2437
3168
|
boolean: BooleanCell,
|
|
@@ -2453,7 +3184,7 @@ function resolveCellRenderer2(name, localRenderers) {
|
|
|
2453
3184
|
return localRenderers?.[name] ?? CELL_RENDERERS[name] ?? TextCell;
|
|
2454
3185
|
}
|
|
2455
3186
|
function createRenderer(render) {
|
|
2456
|
-
return ({ row, options }) =>
|
|
3187
|
+
return ({ row, options }) => React29.createElement(React29.Fragment, null, render(row, options));
|
|
2457
3188
|
}
|
|
2458
3189
|
function validateRendererNames(renderers) {
|
|
2459
3190
|
for (const name of Object.keys(renderers)) {
|
|
@@ -2468,12 +3199,12 @@ function validateRendererNames(renderers) {
|
|
|
2468
3199
|
// src/EntityTable/tableSchema/columnResolver.ts
|
|
2469
3200
|
function resolveColumns(schema, uiSchema) {
|
|
2470
3201
|
const properties = schema.properties ?? {};
|
|
2471
|
-
const entries = Object.entries(properties).map(([key, property]) => {
|
|
3202
|
+
const entries = Object.entries(properties).map(([key, property], index) => {
|
|
2472
3203
|
const config = mergeColumnConfig(key, property, uiSchema);
|
|
2473
|
-
return { key, property, config };
|
|
3204
|
+
return { key, property, config, index };
|
|
2474
3205
|
}).filter(({ config }) => !config.hidden);
|
|
2475
3206
|
const ordered = entries.filter(({ config }) => config.order !== void 0).sort((a, b) => a.config.order - b.config.order);
|
|
2476
|
-
const unordered = entries.filter(({ config }) => config.order === void 0).sort((a, b) => a.
|
|
3207
|
+
const unordered = entries.filter(({ config }) => config.order === void 0).sort((a, b) => a.index - b.index);
|
|
2477
3208
|
const sorted = [...ordered, ...unordered];
|
|
2478
3209
|
return sorted.map(({ key, property, config }) => {
|
|
2479
3210
|
const cellRenderer = config.cellRenderer ?? inferCellRenderer(property.type, property.format);
|
|
@@ -2494,7 +3225,7 @@ function keyToLabel(key) {
|
|
|
2494
3225
|
}
|
|
2495
3226
|
|
|
2496
3227
|
// src/EntityTable/EntityTable.tsx
|
|
2497
|
-
import { jsx as
|
|
3228
|
+
import { jsx as jsx34, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2498
3229
|
var coreRowModel = getCoreRowModel();
|
|
2499
3230
|
function resolveTableDefaults(props) {
|
|
2500
3231
|
return {
|
|
@@ -2502,6 +3233,24 @@ function resolveTableDefaults(props) {
|
|
|
2502
3233
|
selectionMode: props.selectionMode ?? false
|
|
2503
3234
|
};
|
|
2504
3235
|
}
|
|
3236
|
+
var ENTITY_TABLE_BUILTIN = {
|
|
3237
|
+
rowActivation: "click",
|
|
3238
|
+
showChevron: true
|
|
3239
|
+
};
|
|
3240
|
+
function useResolvedActivation(props) {
|
|
3241
|
+
const resolved = useComponentDefaults(
|
|
3242
|
+
"EntityTable",
|
|
3243
|
+
ENTITY_TABLE_BUILTIN,
|
|
3244
|
+
{
|
|
3245
|
+
rowActivation: props.rowActivation,
|
|
3246
|
+
showChevron: props.showChevron
|
|
3247
|
+
}
|
|
3248
|
+
);
|
|
3249
|
+
return {
|
|
3250
|
+
rowActivation: resolved.rowActivation,
|
|
3251
|
+
showChevron: resolved.showChevron
|
|
3252
|
+
};
|
|
3253
|
+
}
|
|
2505
3254
|
function buildColumnDefs(resolved, localRenderers) {
|
|
2506
3255
|
return resolved.map((col) => {
|
|
2507
3256
|
const Renderer = resolveCellRenderer2(col.cellRenderer, localRenderers);
|
|
@@ -2513,7 +3262,7 @@ function buildColumnDefs(resolved, localRenderers) {
|
|
|
2513
3262
|
cell: ({
|
|
2514
3263
|
getValue,
|
|
2515
3264
|
row
|
|
2516
|
-
}) => /* @__PURE__ */
|
|
3265
|
+
}) => /* @__PURE__ */ jsx34(
|
|
2517
3266
|
Renderer,
|
|
2518
3267
|
{
|
|
2519
3268
|
value: getValue(),
|
|
@@ -2531,7 +3280,7 @@ function buildSelectColumn() {
|
|
|
2531
3280
|
return {
|
|
2532
3281
|
id: "_select",
|
|
2533
3282
|
size: 40,
|
|
2534
|
-
header: ({ table: t }) => /* @__PURE__ */
|
|
3283
|
+
header: ({ table: t }) => /* @__PURE__ */ jsx34(
|
|
2535
3284
|
Checkbox,
|
|
2536
3285
|
{
|
|
2537
3286
|
checked: t.getIsAllPageRowsSelected() || (t.getIsSomePageRowsSelected() ? "indeterminate" : false),
|
|
@@ -2539,7 +3288,7 @@ function buildSelectColumn() {
|
|
|
2539
3288
|
"aria-label": "Select all"
|
|
2540
3289
|
}
|
|
2541
3290
|
),
|
|
2542
|
-
cell: ({ row }) => /* @__PURE__ */
|
|
3291
|
+
cell: ({ row }) => /* @__PURE__ */ jsx34(
|
|
2543
3292
|
Checkbox,
|
|
2544
3293
|
{
|
|
2545
3294
|
checked: row.getIsSelected(),
|
|
@@ -2576,43 +3325,43 @@ function useEntityTableState(props, selectionMode) {
|
|
|
2576
3325
|
onSelectionChange
|
|
2577
3326
|
} = props;
|
|
2578
3327
|
const isPaginated = !!(pagination && onPaginationChange);
|
|
2579
|
-
const dataRows =
|
|
3328
|
+
const dataRows = useMemo5(() => data?.data ?? [], [data]);
|
|
2580
3329
|
const total = data?.meta.total;
|
|
2581
3330
|
const pageIndex = pagination?.pageIndex ?? 0;
|
|
2582
3331
|
const pageSize = pagination?.pageSize ?? 1;
|
|
2583
|
-
|
|
3332
|
+
useEffect6(() => {
|
|
2584
3333
|
if (!isPaginated || total == null || !onPaginationChange) return;
|
|
2585
3334
|
const maxPage = Math.max(0, Math.ceil(total / pageSize) - 1);
|
|
2586
3335
|
if (pageIndex > maxPage) {
|
|
2587
3336
|
onPaginationChange((prev) => ({ ...prev, pageIndex: maxPage }));
|
|
2588
3337
|
}
|
|
2589
3338
|
}, [total, isPaginated, pageIndex, pageSize, onPaginationChange]);
|
|
2590
|
-
const [rowSelection, setRowSelection] =
|
|
2591
|
-
|
|
3339
|
+
const [rowSelection, setRowSelection] = useState5({});
|
|
3340
|
+
useEffect6(() => {
|
|
2592
3341
|
setRowSelection({});
|
|
2593
3342
|
}, [data]);
|
|
2594
|
-
const [activeRowIndex, setActiveRowIndex] =
|
|
3343
|
+
const [activeRowIndex, setActiveRowIndex] = useState5(-1);
|
|
2595
3344
|
const containerRef = useRef4(null);
|
|
2596
|
-
const dataColumns =
|
|
3345
|
+
const dataColumns = useMemo5(() => {
|
|
2597
3346
|
if (renderers) validateRendererNames(renderers);
|
|
2598
3347
|
return buildColumnDefs(resolveColumns(schema, uiSchema), renderers);
|
|
2599
3348
|
}, [schema, uiSchema, renderers]);
|
|
2600
|
-
const selectColumn =
|
|
3349
|
+
const selectColumn = useMemo5(
|
|
2601
3350
|
() => selectionMode ? buildSelectColumn() : null,
|
|
2602
3351
|
[selectionMode]
|
|
2603
3352
|
);
|
|
2604
|
-
const columns =
|
|
3353
|
+
const columns = useMemo5(
|
|
2605
3354
|
() => selectColumn ? [selectColumn, ...dataColumns] : dataColumns,
|
|
2606
3355
|
[selectColumn, dataColumns]
|
|
2607
3356
|
);
|
|
2608
3357
|
const onSelectionChangeRef = useRef4(onSelectionChange);
|
|
2609
3358
|
onSelectionChangeRef.current = onSelectionChange;
|
|
2610
|
-
|
|
3359
|
+
useEffect6(() => {
|
|
2611
3360
|
if (!selectionMode || !onSelectionChangeRef.current) return;
|
|
2612
3361
|
const selected = Object.keys(rowSelection).filter((k) => rowSelection[k]).map(Number).map((i) => dataRows[i]).filter((r) => r !== void 0);
|
|
2613
3362
|
onSelectionChangeRef.current(selected);
|
|
2614
3363
|
}, [rowSelection, selectionMode, dataRows]);
|
|
2615
|
-
const tableState =
|
|
3364
|
+
const tableState = useMemo5(
|
|
2616
3365
|
() => ({
|
|
2617
3366
|
...isPaginated ? { pagination } : {},
|
|
2618
3367
|
...selectionMode ? { rowSelection } : {}
|
|
@@ -2630,7 +3379,7 @@ function useEntityTableState(props, selectionMode) {
|
|
|
2630
3379
|
onPaginationChange
|
|
2631
3380
|
});
|
|
2632
3381
|
const table = useReactTable(tableOptions);
|
|
2633
|
-
|
|
3382
|
+
useEffect6(() => {
|
|
2634
3383
|
if (activeRowIndex < 0 || !containerRef.current) return;
|
|
2635
3384
|
const rows = containerRef.current.querySelectorAll("tbody tr");
|
|
2636
3385
|
rows[activeRowIndex]?.scrollIntoView({ block: "nearest" });
|
|
@@ -2647,6 +3396,29 @@ function useEntityTableState(props, selectionMode) {
|
|
|
2647
3396
|
columns
|
|
2648
3397
|
};
|
|
2649
3398
|
}
|
|
3399
|
+
function useActiveRowEvent(args) {
|
|
3400
|
+
const {
|
|
3401
|
+
selectionMode,
|
|
3402
|
+
rowActivation,
|
|
3403
|
+
onRowClick,
|
|
3404
|
+
onActiveRowChange,
|
|
3405
|
+
activeRowIndex,
|
|
3406
|
+
dataRows,
|
|
3407
|
+
setActiveRowIndex
|
|
3408
|
+
} = args;
|
|
3409
|
+
const singleActiveMode = !selectionMode && rowActivation === "double-click" && !!onRowClick;
|
|
3410
|
+
const onChangeRef = useRef4(onActiveRowChange);
|
|
3411
|
+
onChangeRef.current = onActiveRowChange;
|
|
3412
|
+
useEffect6(() => {
|
|
3413
|
+
if (!singleActiveMode) return;
|
|
3414
|
+
const row = activeRowIndex >= 0 ? dataRows[activeRowIndex] ?? null : null;
|
|
3415
|
+
onChangeRef.current?.(row);
|
|
3416
|
+
}, [singleActiveMode, activeRowIndex, dataRows]);
|
|
3417
|
+
return useCallback2(
|
|
3418
|
+
(index) => setActiveRowIndex(index),
|
|
3419
|
+
[setActiveRowIndex]
|
|
3420
|
+
);
|
|
3421
|
+
}
|
|
2650
3422
|
function useTableKeyboard(table, activeRowIndex, setActiveRowIndex, selectionMode, onRowClick) {
|
|
2651
3423
|
return useCallback2(
|
|
2652
3424
|
(e) => {
|
|
@@ -2693,9 +3465,9 @@ function handleSpaceKey(e, tableRows, selectionMode, activeRowIndex) {
|
|
|
2693
3465
|
e.preventDefault();
|
|
2694
3466
|
tableRows[activeRowIndex]?.toggleSelected();
|
|
2695
3467
|
}
|
|
2696
|
-
function resolveTrailingCols(rowActions, onRowClick, selectionMode) {
|
|
3468
|
+
function resolveTrailingCols(rowActions, onRowClick, selectionMode, showChevron) {
|
|
2697
3469
|
const hasRowActions = !!(rowActions && rowActions.length > 0);
|
|
2698
|
-
const hasChevron = !!(onRowClick && !selectionMode && !hasRowActions);
|
|
3470
|
+
const hasChevron = !!(onRowClick && showChevron && !selectionMode && !hasRowActions);
|
|
2699
3471
|
return {
|
|
2700
3472
|
hasRowActions,
|
|
2701
3473
|
hasChevron,
|
|
@@ -2713,7 +3485,7 @@ function StatusRows({
|
|
|
2713
3485
|
colCount
|
|
2714
3486
|
}) {
|
|
2715
3487
|
if (isLoading) {
|
|
2716
|
-
return /* @__PURE__ */
|
|
3488
|
+
return /* @__PURE__ */ jsx34("tr", { children: /* @__PURE__ */ jsx34(
|
|
2717
3489
|
"td",
|
|
2718
3490
|
{
|
|
2719
3491
|
colSpan: colCount,
|
|
@@ -2723,7 +3495,7 @@ function StatusRows({
|
|
|
2723
3495
|
) });
|
|
2724
3496
|
}
|
|
2725
3497
|
if (isError) {
|
|
2726
|
-
return /* @__PURE__ */
|
|
3498
|
+
return /* @__PURE__ */ jsx34("tr", { children: /* @__PURE__ */ jsx34(
|
|
2727
3499
|
"td",
|
|
2728
3500
|
{
|
|
2729
3501
|
colSpan: colCount,
|
|
@@ -2733,7 +3505,7 @@ function StatusRows({
|
|
|
2733
3505
|
) });
|
|
2734
3506
|
}
|
|
2735
3507
|
if (isEmpty) {
|
|
2736
|
-
return /* @__PURE__ */
|
|
3508
|
+
return /* @__PURE__ */ jsx34("tr", { children: /* @__PURE__ */ jsx34(
|
|
2737
3509
|
"td",
|
|
2738
3510
|
{
|
|
2739
3511
|
colSpan: colCount,
|
|
@@ -2753,7 +3525,7 @@ function RowActionCell({
|
|
|
2753
3525
|
actions,
|
|
2754
3526
|
rowOriginal
|
|
2755
3527
|
}) {
|
|
2756
|
-
return /* @__PURE__ */
|
|
3528
|
+
return /* @__PURE__ */ jsx34("td", { className: "px-4 py-3 w-24 text-right", children: /* @__PURE__ */ jsx34("div", { className: "flex items-center justify-end gap-1", children: actions.map((action) => /* @__PURE__ */ jsx34(
|
|
2757
3529
|
ActionButton,
|
|
2758
3530
|
{
|
|
2759
3531
|
action,
|
|
@@ -2769,8 +3541,8 @@ function ActionButton({
|
|
|
2769
3541
|
const isHidden = action.hidden?.(rowOriginal);
|
|
2770
3542
|
if (isHidden) return null;
|
|
2771
3543
|
const isDisabled = action.disabled?.(rowOriginal);
|
|
2772
|
-
const
|
|
2773
|
-
return /* @__PURE__ */
|
|
3544
|
+
const Icon2 = action.icon;
|
|
3545
|
+
return /* @__PURE__ */ jsx34(
|
|
2774
3546
|
"button",
|
|
2775
3547
|
{
|
|
2776
3548
|
title: action.label,
|
|
@@ -2779,29 +3551,63 @@ function ActionButton({
|
|
|
2779
3551
|
e.stopPropagation();
|
|
2780
3552
|
action.onClick(rowOriginal);
|
|
2781
3553
|
},
|
|
2782
|
-
className:
|
|
3554
|
+
className: cn32(
|
|
2783
3555
|
"inline-flex items-center justify-center h-7 w-7 rounded-md transition-colors",
|
|
2784
3556
|
action.variant === "destructive" ? "text-destructive hover:bg-destructive/10" : "text-muted-foreground hover:bg-accent",
|
|
2785
3557
|
isDisabled ? "opacity-30 cursor-not-allowed group-hover/row:opacity-30" : "opacity-0 group-hover/row:opacity-100 focus:opacity-100"
|
|
2786
3558
|
),
|
|
2787
|
-
children:
|
|
3559
|
+
children: Icon2 ? /* @__PURE__ */ jsx34(Icon2, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx34("span", { className: "text-xs", children: action.label })
|
|
2788
3560
|
},
|
|
2789
3561
|
action.label
|
|
2790
3562
|
);
|
|
2791
3563
|
}
|
|
3564
|
+
function ChevronCell({
|
|
3565
|
+
rowOriginal,
|
|
3566
|
+
rowActivation,
|
|
3567
|
+
onRowClick
|
|
3568
|
+
}) {
|
|
3569
|
+
const asButton = rowActivation === "double-click" && !!onRowClick;
|
|
3570
|
+
return /* @__PURE__ */ jsx34("td", { className: "px-4 py-3 w-10", children: asButton ? /* @__PURE__ */ jsx34(
|
|
3571
|
+
"button",
|
|
3572
|
+
{
|
|
3573
|
+
type: "button",
|
|
3574
|
+
title: "Open",
|
|
3575
|
+
onClick: (e) => {
|
|
3576
|
+
e.stopPropagation();
|
|
3577
|
+
onRowClick(rowOriginal);
|
|
3578
|
+
},
|
|
3579
|
+
className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
3580
|
+
children: /* @__PURE__ */ jsx34(ChevronRight3, { className: "h-4 w-4" })
|
|
3581
|
+
}
|
|
3582
|
+
) : /* @__PURE__ */ jsx34(ChevronRight3, { className: "h-4 w-4 text-muted-foreground" }) });
|
|
3583
|
+
}
|
|
3584
|
+
function rowClassName(row, isActive, selectionMode, singleClickSelects, onRowClick) {
|
|
3585
|
+
return cn32(
|
|
3586
|
+
"border-b last:border-b-0 transition-colors group/row",
|
|
3587
|
+
onRowClick && !selectionMode && "hover:bg-accent/50 cursor-pointer",
|
|
3588
|
+
selectionMode && "cursor-default",
|
|
3589
|
+
row.getIsSelected() && "bg-primary/10",
|
|
3590
|
+
isActive && selectionMode && "bg-accent",
|
|
3591
|
+
isActive && singleClickSelects && "bg-primary/10"
|
|
3592
|
+
);
|
|
3593
|
+
}
|
|
2792
3594
|
function DataRow({
|
|
2793
3595
|
row,
|
|
2794
3596
|
index,
|
|
2795
3597
|
selectionMode,
|
|
3598
|
+
rowActivation,
|
|
2796
3599
|
activeRowIndex,
|
|
2797
3600
|
onRowClick,
|
|
3601
|
+
onActivateRow,
|
|
2798
3602
|
setActiveRowIndex,
|
|
2799
3603
|
containerRef,
|
|
2800
3604
|
hasRowActions,
|
|
2801
3605
|
hasChevron,
|
|
2802
3606
|
rowActions
|
|
2803
3607
|
}) {
|
|
2804
|
-
|
|
3608
|
+
const singleClickSelects = !selectionMode && rowActivation === "double-click" && !!onRowClick;
|
|
3609
|
+
const isActive = index === activeRowIndex;
|
|
3610
|
+
return /* @__PURE__ */ jsxs13(
|
|
2805
3611
|
"tr",
|
|
2806
3612
|
{
|
|
2807
3613
|
onClick: () => {
|
|
@@ -2809,35 +3615,51 @@ function DataRow({
|
|
|
2809
3615
|
row,
|
|
2810
3616
|
index,
|
|
2811
3617
|
selectionMode,
|
|
3618
|
+
rowActivation,
|
|
2812
3619
|
onRowClick,
|
|
3620
|
+
onActivateRow,
|
|
2813
3621
|
setActiveRowIndex,
|
|
2814
3622
|
containerRef
|
|
2815
3623
|
);
|
|
2816
3624
|
},
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
row
|
|
2822
|
-
|
|
3625
|
+
onDoubleClick: () => {
|
|
3626
|
+
if (singleClickSelects && onRowClick) onRowClick(row.original);
|
|
3627
|
+
},
|
|
3628
|
+
className: rowClassName(
|
|
3629
|
+
row,
|
|
3630
|
+
isActive,
|
|
3631
|
+
selectionMode,
|
|
3632
|
+
singleClickSelects,
|
|
3633
|
+
onRowClick
|
|
2823
3634
|
),
|
|
2824
3635
|
children: [
|
|
2825
|
-
row.getVisibleCells().map((cell) => /* @__PURE__ */
|
|
2826
|
-
hasRowActions && /* @__PURE__ */
|
|
2827
|
-
hasChevron && /* @__PURE__ */
|
|
3636
|
+
row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx34("td", { className: "px-4 py-3", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)),
|
|
3637
|
+
hasRowActions && /* @__PURE__ */ jsx34(RowActionCell, { actions: rowActions, rowOriginal: row.original }),
|
|
3638
|
+
hasChevron && /* @__PURE__ */ jsx34(
|
|
3639
|
+
ChevronCell,
|
|
3640
|
+
{
|
|
3641
|
+
rowOriginal: row.original,
|
|
3642
|
+
rowActivation,
|
|
3643
|
+
onRowClick
|
|
3644
|
+
}
|
|
3645
|
+
)
|
|
2828
3646
|
]
|
|
2829
3647
|
},
|
|
2830
3648
|
row.id
|
|
2831
3649
|
);
|
|
2832
3650
|
}
|
|
2833
|
-
function handleRowClick(row, index, selectionMode, onRowClick, setActiveRowIndex, containerRef) {
|
|
3651
|
+
function handleRowClick(row, index, selectionMode, rowActivation, onRowClick, onActivateRow, setActiveRowIndex, containerRef) {
|
|
2834
3652
|
if (selectionMode) {
|
|
2835
3653
|
row.toggleSelected();
|
|
2836
3654
|
setActiveRowIndex(index);
|
|
2837
3655
|
containerRef.current?.focus();
|
|
2838
|
-
|
|
2839
|
-
|
|
3656
|
+
return;
|
|
3657
|
+
}
|
|
3658
|
+
if (rowActivation === "double-click" && onRowClick) {
|
|
3659
|
+
onActivateRow(index);
|
|
3660
|
+
return;
|
|
2840
3661
|
}
|
|
3662
|
+
if (onRowClick) onRowClick(row.original);
|
|
2841
3663
|
}
|
|
2842
3664
|
function TableFooter({
|
|
2843
3665
|
isPaginated,
|
|
@@ -2848,9 +3670,9 @@ function TableFooter({
|
|
|
2848
3670
|
}) {
|
|
2849
3671
|
if (!data?.meta) return null;
|
|
2850
3672
|
if (isPaginated) {
|
|
2851
|
-
return /* @__PURE__ */
|
|
3673
|
+
return /* @__PURE__ */ jsx34(PaginationFooter, { table, entityLabel });
|
|
2852
3674
|
}
|
|
2853
|
-
return /* @__PURE__ */
|
|
3675
|
+
return /* @__PURE__ */ jsxs13("p", { className: "text-xs text-muted-foreground mt-3", children: [
|
|
2854
3676
|
"Showing ",
|
|
2855
3677
|
dataRows.length,
|
|
2856
3678
|
" of ",
|
|
@@ -2867,9 +3689,11 @@ function EntityTable(props) {
|
|
|
2867
3689
|
errorMessage,
|
|
2868
3690
|
entityLabel,
|
|
2869
3691
|
onRowClick,
|
|
3692
|
+
onActiveRowChange,
|
|
2870
3693
|
rowActions
|
|
2871
3694
|
} = props;
|
|
2872
3695
|
const { isFiltered, selectionMode } = resolveTableDefaults(props);
|
|
3696
|
+
const { rowActivation, showChevron } = useResolvedActivation(props);
|
|
2873
3697
|
const {
|
|
2874
3698
|
table,
|
|
2875
3699
|
dataRows,
|
|
@@ -2886,23 +3710,33 @@ function EntityTable(props) {
|
|
|
2886
3710
|
selectionMode,
|
|
2887
3711
|
onRowClick
|
|
2888
3712
|
);
|
|
3713
|
+
const handleActivateRow = useActiveRowEvent({
|
|
3714
|
+
selectionMode,
|
|
3715
|
+
rowActivation,
|
|
3716
|
+
onRowClick,
|
|
3717
|
+
onActiveRowChange,
|
|
3718
|
+
activeRowIndex,
|
|
3719
|
+
dataRows,
|
|
3720
|
+
setActiveRowIndex
|
|
3721
|
+
});
|
|
2889
3722
|
const { hasRowActions, hasChevron, hasTrailingCol } = resolveTrailingCols(
|
|
2890
3723
|
rowActions,
|
|
2891
3724
|
onRowClick,
|
|
2892
|
-
selectionMode
|
|
3725
|
+
selectionMode,
|
|
3726
|
+
showChevron
|
|
2893
3727
|
);
|
|
2894
3728
|
const colCount = columns.length + (hasTrailingCol ? 1 : 0);
|
|
2895
|
-
return /* @__PURE__ */
|
|
2896
|
-
/* @__PURE__ */
|
|
3729
|
+
return /* @__PURE__ */ jsxs13("div", { children: [
|
|
3730
|
+
/* @__PURE__ */ jsx34(
|
|
2897
3731
|
"div",
|
|
2898
3732
|
{
|
|
2899
3733
|
ref: selectionMode ? containerRef : void 0,
|
|
2900
3734
|
tabIndex: selectionMode ? 0 : void 0,
|
|
2901
3735
|
onKeyDown: selectionMode ? handleKeyDown : void 0,
|
|
2902
|
-
className:
|
|
2903
|
-
children: /* @__PURE__ */
|
|
2904
|
-
/* @__PURE__ */
|
|
2905
|
-
table.getFlatHeaders().map((header) => /* @__PURE__ */
|
|
3736
|
+
className: cn32("rounded-lg border", selectionMode && "outline-none"),
|
|
3737
|
+
children: /* @__PURE__ */ jsxs13("table", { className: "w-full text-sm", children: [
|
|
3738
|
+
/* @__PURE__ */ jsx34("thead", { children: /* @__PURE__ */ jsxs13("tr", { className: "border-b bg-muted/40", children: [
|
|
3739
|
+
table.getFlatHeaders().map((header) => /* @__PURE__ */ jsx34(
|
|
2906
3740
|
"th",
|
|
2907
3741
|
{
|
|
2908
3742
|
className: "text-left text-xs font-medium text-muted-foreground px-4 py-2.5",
|
|
@@ -2914,7 +3748,7 @@ function EntityTable(props) {
|
|
|
2914
3748
|
},
|
|
2915
3749
|
header.id
|
|
2916
3750
|
)),
|
|
2917
|
-
hasRowActions && /* @__PURE__ */
|
|
3751
|
+
hasRowActions && /* @__PURE__ */ jsx34(
|
|
2918
3752
|
"th",
|
|
2919
3753
|
{
|
|
2920
3754
|
"aria-label": "Actions",
|
|
@@ -2922,10 +3756,10 @@ function EntityTable(props) {
|
|
|
2922
3756
|
className: "w-24 text-right text-xs font-medium text-muted-foreground px-4 py-2.5"
|
|
2923
3757
|
}
|
|
2924
3758
|
),
|
|
2925
|
-
hasChevron && /* @__PURE__ */
|
|
3759
|
+
hasChevron && /* @__PURE__ */ jsx34("th", { "aria-label": "Open", scope: "col", className: "w-10" })
|
|
2926
3760
|
] }) }),
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
3761
|
+
/* @__PURE__ */ jsxs13("tbody", { children: [
|
|
3762
|
+
/* @__PURE__ */ jsx34(
|
|
2929
3763
|
StatusRows,
|
|
2930
3764
|
{
|
|
2931
3765
|
isLoading,
|
|
@@ -2938,14 +3772,16 @@ function EntityTable(props) {
|
|
|
2938
3772
|
colCount
|
|
2939
3773
|
}
|
|
2940
3774
|
),
|
|
2941
|
-
table.getRowModel().rows.map((row, index) => /* @__PURE__ */
|
|
3775
|
+
table.getRowModel().rows.map((row, index) => /* @__PURE__ */ jsx34(
|
|
2942
3776
|
DataRow,
|
|
2943
3777
|
{
|
|
2944
3778
|
row,
|
|
2945
3779
|
index,
|
|
2946
3780
|
selectionMode,
|
|
3781
|
+
rowActivation,
|
|
2947
3782
|
activeRowIndex,
|
|
2948
3783
|
onRowClick,
|
|
3784
|
+
onActivateRow: handleActivateRow,
|
|
2949
3785
|
setActiveRowIndex,
|
|
2950
3786
|
containerRef,
|
|
2951
3787
|
hasRowActions,
|
|
@@ -2958,7 +3794,7 @@ function EntityTable(props) {
|
|
|
2958
3794
|
] })
|
|
2959
3795
|
}
|
|
2960
3796
|
),
|
|
2961
|
-
/* @__PURE__ */
|
|
3797
|
+
/* @__PURE__ */ jsx34(
|
|
2962
3798
|
TableFooter,
|
|
2963
3799
|
{
|
|
2964
3800
|
isPaginated,
|
|
@@ -2979,10 +3815,10 @@ function PaginationFooter({
|
|
|
2979
3815
|
const pageCount = table.getPageCount();
|
|
2980
3816
|
const from = rowCount === 0 ? 0 : pageIndex * pageSize + 1;
|
|
2981
3817
|
const to = Math.min((pageIndex + 1) * pageSize, rowCount);
|
|
2982
|
-
return /* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
2984
|
-
/* @__PURE__ */
|
|
2985
|
-
/* @__PURE__ */
|
|
3818
|
+
return /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3819
|
+
/* @__PURE__ */ jsx34("p", { className: "text-xs text-muted-foreground", children: rowCount === 0 ? `No ${entityLabel}` : `Showing ${from}\u2013${to} of ${rowCount} ${entityLabel}` }),
|
|
3820
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1", children: [
|
|
3821
|
+
/* @__PURE__ */ jsx34(
|
|
2986
3822
|
"button",
|
|
2987
3823
|
{
|
|
2988
3824
|
type: "button",
|
|
@@ -2992,8 +3828,8 @@ function PaginationFooter({
|
|
|
2992
3828
|
children: "Previous"
|
|
2993
3829
|
}
|
|
2994
3830
|
),
|
|
2995
|
-
/* @__PURE__ */
|
|
2996
|
-
/* @__PURE__ */
|
|
3831
|
+
/* @__PURE__ */ jsx34("span", { className: "text-xs text-muted-foreground px-2", children: pageCount > 0 ? `${pageIndex + 1} / ${pageCount}` : "--" }),
|
|
3832
|
+
/* @__PURE__ */ jsx34(
|
|
2997
3833
|
"button",
|
|
2998
3834
|
{
|
|
2999
3835
|
type: "button",
|
|
@@ -3008,13 +3844,13 @@ function PaginationFooter({
|
|
|
3008
3844
|
}
|
|
3009
3845
|
|
|
3010
3846
|
// src/PropertyList/PropertyList.tsx
|
|
3011
|
-
import
|
|
3847
|
+
import React32 from "react";
|
|
3012
3848
|
import { copyTextToClipboard } from "@petrarca/sonnet-core";
|
|
3013
3849
|
|
|
3014
3850
|
// src/PropertyList/PropertyValue.tsx
|
|
3015
|
-
import { useState as
|
|
3851
|
+
import { useState as useState6 } from "react";
|
|
3016
3852
|
import { JSONTree } from "react-json-tree";
|
|
3017
|
-
import { jsx as
|
|
3853
|
+
import { jsx as jsx35, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3018
3854
|
var DEFAULT_CLAMP_CHARS = 180;
|
|
3019
3855
|
var tokenTheme = {
|
|
3020
3856
|
scheme: "sonnet",
|
|
@@ -3039,10 +3875,10 @@ function isObjectLike(v) {
|
|
|
3039
3875
|
return typeof v === "object" && v !== null;
|
|
3040
3876
|
}
|
|
3041
3877
|
function JsonValue({ value }) {
|
|
3042
|
-
const [open, setOpen] =
|
|
3878
|
+
const [open, setOpen] = useState6(false);
|
|
3043
3879
|
const summary = Array.isArray(value) ? `[${value.length} item${value.length === 1 ? "" : "s"}]` : `{${Object.keys(value).length} key${Object.keys(value).length === 1 ? "" : "s"}}`;
|
|
3044
3880
|
if (!open) {
|
|
3045
|
-
return /* @__PURE__ */
|
|
3881
|
+
return /* @__PURE__ */ jsxs14(
|
|
3046
3882
|
"button",
|
|
3047
3883
|
{
|
|
3048
3884
|
type: "button",
|
|
@@ -3054,13 +3890,13 @@ function JsonValue({ value }) {
|
|
|
3054
3890
|
children: [
|
|
3055
3891
|
summary,
|
|
3056
3892
|
" ",
|
|
3057
|
-
/* @__PURE__ */
|
|
3893
|
+
/* @__PURE__ */ jsx35("span", { className: "text-xs", children: "\u2014 show" })
|
|
3058
3894
|
]
|
|
3059
3895
|
}
|
|
3060
3896
|
);
|
|
3061
3897
|
}
|
|
3062
|
-
return /* @__PURE__ */
|
|
3063
|
-
/* @__PURE__ */
|
|
3898
|
+
return /* @__PURE__ */ jsxs14("div", { className: "text-xs font-mono", children: [
|
|
3899
|
+
/* @__PURE__ */ jsx35(
|
|
3064
3900
|
"button",
|
|
3065
3901
|
{
|
|
3066
3902
|
type: "button",
|
|
@@ -3072,7 +3908,7 @@ function JsonValue({ value }) {
|
|
|
3072
3908
|
children: "hide"
|
|
3073
3909
|
}
|
|
3074
3910
|
),
|
|
3075
|
-
/* @__PURE__ */
|
|
3911
|
+
/* @__PURE__ */ jsx35("div", { className: "max-h-64 overflow-auto rounded border border-border bg-muted/30 px-2 py-1", children: /* @__PURE__ */ jsx35(
|
|
3076
3912
|
JSONTree,
|
|
3077
3913
|
{
|
|
3078
3914
|
data: value,
|
|
@@ -3085,11 +3921,11 @@ function JsonValue({ value }) {
|
|
|
3085
3921
|
] });
|
|
3086
3922
|
}
|
|
3087
3923
|
function LongTextValue({ text }) {
|
|
3088
|
-
const [open, setOpen] =
|
|
3924
|
+
const [open, setOpen] = useState6(false);
|
|
3089
3925
|
if (!open) {
|
|
3090
|
-
return /* @__PURE__ */
|
|
3091
|
-
/* @__PURE__ */
|
|
3092
|
-
/* @__PURE__ */
|
|
3926
|
+
return /* @__PURE__ */ jsxs14("span", { className: "break-words", children: [
|
|
3927
|
+
/* @__PURE__ */ jsx35("span", { className: "line-clamp-3 align-bottom", children: text }),
|
|
3928
|
+
/* @__PURE__ */ jsx35(
|
|
3093
3929
|
"button",
|
|
3094
3930
|
{
|
|
3095
3931
|
type: "button",
|
|
@@ -3103,9 +3939,9 @@ function LongTextValue({ text }) {
|
|
|
3103
3939
|
)
|
|
3104
3940
|
] });
|
|
3105
3941
|
}
|
|
3106
|
-
return /* @__PURE__ */
|
|
3107
|
-
/* @__PURE__ */
|
|
3108
|
-
/* @__PURE__ */
|
|
3942
|
+
return /* @__PURE__ */ jsxs14("span", { className: "break-words", children: [
|
|
3943
|
+
/* @__PURE__ */ jsx35("span", { className: "block max-h-64 overflow-auto whitespace-pre-wrap rounded border border-border bg-muted/30 px-2 py-1", children: text }),
|
|
3944
|
+
/* @__PURE__ */ jsx35(
|
|
3109
3945
|
"button",
|
|
3110
3946
|
{
|
|
3111
3947
|
type: "button",
|
|
@@ -3123,12 +3959,12 @@ function renderFromSchema(value, schema, className) {
|
|
|
3123
3959
|
const cellName = schema["x-ui-cell"] ?? inferCellRenderer(schema.type, schema.format);
|
|
3124
3960
|
if (cellName === "json") {
|
|
3125
3961
|
const parsed = typeof value === "string" ? safeParse(value) : value;
|
|
3126
|
-
return isObjectLike(parsed) ? /* @__PURE__ */
|
|
3962
|
+
return isObjectLike(parsed) ? /* @__PURE__ */ jsx35(JsonValue, { value: parsed }) : null;
|
|
3127
3963
|
}
|
|
3128
3964
|
if (cellName && cellName !== "text") {
|
|
3129
3965
|
const Renderer = CELL_RENDERERS[cellName];
|
|
3130
3966
|
if (Renderer) {
|
|
3131
|
-
return /* @__PURE__ */
|
|
3967
|
+
return /* @__PURE__ */ jsx35("span", { className, children: /* @__PURE__ */ jsx35(
|
|
3132
3968
|
Renderer,
|
|
3133
3969
|
{
|
|
3134
3970
|
value,
|
|
@@ -3142,23 +3978,23 @@ function renderFromSchema(value, schema, className) {
|
|
|
3142
3978
|
}
|
|
3143
3979
|
function renderObjectLike(value, className) {
|
|
3144
3980
|
if (Array.isArray(value) && value.every((v) => !isObjectLike(v))) {
|
|
3145
|
-
return /* @__PURE__ */
|
|
3981
|
+
return /* @__PURE__ */ jsx35("span", { className: `break-words ${className ?? ""}`, children: value.map(String).join(", ") });
|
|
3146
3982
|
}
|
|
3147
|
-
return /* @__PURE__ */
|
|
3983
|
+
return /* @__PURE__ */ jsx35(JsonValue, { value });
|
|
3148
3984
|
}
|
|
3149
3985
|
function renderString(value, className, clampChars) {
|
|
3150
3986
|
if (typeof value === "boolean") {
|
|
3151
|
-
return /* @__PURE__ */
|
|
3987
|
+
return /* @__PURE__ */ jsx35("span", { className, children: value ? "true" : "false" });
|
|
3152
3988
|
}
|
|
3153
3989
|
const str = String(value);
|
|
3154
3990
|
if (str.length > clampChars || str.includes("\n")) {
|
|
3155
|
-
return /* @__PURE__ */
|
|
3991
|
+
return /* @__PURE__ */ jsx35("span", { className, children: /* @__PURE__ */ jsx35(LongTextValue, { text: str }) });
|
|
3156
3992
|
}
|
|
3157
|
-
return /* @__PURE__ */
|
|
3993
|
+
return /* @__PURE__ */ jsx35("span", { className: `break-words ${className ?? ""}`, children: str });
|
|
3158
3994
|
}
|
|
3159
3995
|
function renderFromValue(value, className, clampChars) {
|
|
3160
3996
|
if (value == null) {
|
|
3161
|
-
return /* @__PURE__ */
|
|
3997
|
+
return /* @__PURE__ */ jsx35("span", { className: `text-muted-foreground ${className ?? ""}`, children: "\u2014" });
|
|
3162
3998
|
}
|
|
3163
3999
|
if (isObjectLike(value)) return renderObjectLike(value, className);
|
|
3164
4000
|
return renderString(value, className, clampChars);
|
|
@@ -3181,7 +4017,7 @@ function safeParse(s) {
|
|
|
3181
4017
|
}
|
|
3182
4018
|
|
|
3183
4019
|
// src/PropertyList/PropertyList.tsx
|
|
3184
|
-
import { jsx as
|
|
4020
|
+
import { jsx as jsx36, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3185
4021
|
function PropertyList({
|
|
3186
4022
|
properties,
|
|
3187
4023
|
propertySchemas,
|
|
@@ -3193,28 +4029,28 @@ function PropertyList({
|
|
|
3193
4029
|
}) {
|
|
3194
4030
|
const entries = Object.entries(properties ?? {});
|
|
3195
4031
|
if (entries.length === 0) {
|
|
3196
|
-
return /* @__PURE__ */
|
|
4032
|
+
return /* @__PURE__ */ jsx36("p", { className: "text-sm text-muted-foreground italic", children: emptyLabel });
|
|
3197
4033
|
}
|
|
3198
|
-
const header = showHeader && /* @__PURE__ */
|
|
4034
|
+
const header = showHeader && /* @__PURE__ */ jsx36("p", { className: "text-[11px] text-muted-foreground mb-1.5", children: "Properties" });
|
|
3199
4035
|
const dtClass = `text-[11px] text-muted-foreground ${copyable ? "cursor-pointer hover:text-foreground" : ""}`;
|
|
3200
4036
|
const dtProps = (value) => copyable ? {
|
|
3201
4037
|
onClick: () => copyTextToClipboard(stringForCopy(value)),
|
|
3202
4038
|
title: "Click to copy value"
|
|
3203
4039
|
} : {};
|
|
3204
4040
|
if (layout === "stacked") {
|
|
3205
|
-
return /* @__PURE__ */
|
|
4041
|
+
return /* @__PURE__ */ jsxs15("div", { className, children: [
|
|
3206
4042
|
header,
|
|
3207
|
-
/* @__PURE__ */
|
|
3208
|
-
/* @__PURE__ */
|
|
3209
|
-
/* @__PURE__ */
|
|
4043
|
+
/* @__PURE__ */ jsx36("dl", { className: "space-y-1", children: entries.map(([key, value]) => /* @__PURE__ */ jsxs15("div", { children: [
|
|
4044
|
+
/* @__PURE__ */ jsx36("dt", { className: dtClass, ...dtProps(value), children: key }),
|
|
4045
|
+
/* @__PURE__ */ jsx36("dd", { className: "text-sm text-foreground font-medium break-words", children: /* @__PURE__ */ jsx36(PropertyValue, { value, schema: propertySchemas?.[key] }) })
|
|
3210
4046
|
] }, key)) })
|
|
3211
4047
|
] });
|
|
3212
4048
|
}
|
|
3213
|
-
return /* @__PURE__ */
|
|
4049
|
+
return /* @__PURE__ */ jsxs15("div", { className, children: [
|
|
3214
4050
|
header,
|
|
3215
|
-
/* @__PURE__ */
|
|
3216
|
-
/* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ jsx36("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 items-baseline", children: entries.map(([key, value]) => /* @__PURE__ */ jsxs15(React32.Fragment, { children: [
|
|
4052
|
+
/* @__PURE__ */ jsx36("dt", { className: `${dtClass} whitespace-nowrap`, ...dtProps(value), children: key }),
|
|
4053
|
+
/* @__PURE__ */ jsx36("dd", { className: "text-sm text-foreground min-w-0 break-words", children: /* @__PURE__ */ jsx36(PropertyValue, { value, schema: propertySchemas?.[key] }) })
|
|
3218
4054
|
] }, key)) })
|
|
3219
4055
|
] });
|
|
3220
4056
|
}
|
|
@@ -3225,13 +4061,13 @@ function stringForCopy(value) {
|
|
|
3225
4061
|
}
|
|
3226
4062
|
|
|
3227
4063
|
// src/EntitySelect/EntitySelect.tsx
|
|
3228
|
-
import * as
|
|
3229
|
-
import { Check as
|
|
3230
|
-
import { cn as
|
|
4064
|
+
import * as React33 from "react";
|
|
4065
|
+
import { Check as Check5, ChevronsUpDown, Loader2, X as X3 } from "lucide-react";
|
|
4066
|
+
import { cn as cn33 } from "@petrarca/sonnet-core";
|
|
3231
4067
|
import {
|
|
3232
4068
|
useEntityOptions
|
|
3233
4069
|
} from "@petrarca/sonnet-core/hooks";
|
|
3234
|
-
import { Fragment as
|
|
4070
|
+
import { Fragment as Fragment3, jsx as jsx37, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3235
4071
|
function emptyStateMessage({
|
|
3236
4072
|
mode,
|
|
3237
4073
|
search,
|
|
@@ -3249,8 +4085,8 @@ function emptyStateMessage({
|
|
|
3249
4085
|
return emptyMessage;
|
|
3250
4086
|
}
|
|
3251
4087
|
function useHasSearched(submit) {
|
|
3252
|
-
const [hasSearched, setHasSearched] =
|
|
3253
|
-
const wrappedSubmit =
|
|
4088
|
+
const [hasSearched, setHasSearched] = React33.useState(false);
|
|
4089
|
+
const wrappedSubmit = React33.useCallback(() => {
|
|
3254
4090
|
setHasSearched(true);
|
|
3255
4091
|
submit();
|
|
3256
4092
|
}, [submit]);
|
|
@@ -3273,19 +4109,19 @@ function EntitySelectLabel({
|
|
|
3273
4109
|
description
|
|
3274
4110
|
}) {
|
|
3275
4111
|
const hasLabel = label !== void 0 && label !== false;
|
|
3276
|
-
return /* @__PURE__ */
|
|
3277
|
-
hasLabel && /* @__PURE__ */
|
|
4112
|
+
return /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
4113
|
+
hasLabel && /* @__PURE__ */ jsxs16(
|
|
3278
4114
|
"label",
|
|
3279
4115
|
{
|
|
3280
4116
|
htmlFor: id,
|
|
3281
4117
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
3282
4118
|
children: [
|
|
3283
4119
|
label,
|
|
3284
|
-
required && /* @__PURE__ */
|
|
4120
|
+
required && /* @__PURE__ */ jsx37("span", { className: "ml-1 text-destructive", children: "*" })
|
|
3285
4121
|
]
|
|
3286
4122
|
}
|
|
3287
4123
|
),
|
|
3288
|
-
description && /* @__PURE__ */
|
|
4124
|
+
description && /* @__PURE__ */ jsx37("p", { className: "text-sm text-muted-foreground", children: description })
|
|
3289
4125
|
] });
|
|
3290
4126
|
}
|
|
3291
4127
|
function EntitySelectDropdown({
|
|
@@ -3302,8 +4138,8 @@ function EntitySelectDropdown({
|
|
|
3302
4138
|
value,
|
|
3303
4139
|
handleSelect
|
|
3304
4140
|
}) {
|
|
3305
|
-
return /* @__PURE__ */
|
|
3306
|
-
/* @__PURE__ */
|
|
4141
|
+
return /* @__PURE__ */ jsxs16(Command, { shouldFilter: false, children: [
|
|
4142
|
+
/* @__PURE__ */ jsx37(
|
|
3307
4143
|
CommandInput,
|
|
3308
4144
|
{
|
|
3309
4145
|
placeholder: searchPlaceholder,
|
|
@@ -3317,8 +4153,8 @@ function EntitySelectDropdown({
|
|
|
3317
4153
|
} : void 0
|
|
3318
4154
|
}
|
|
3319
4155
|
),
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
4156
|
+
/* @__PURE__ */ jsxs16(CommandList, { children: [
|
|
4157
|
+
/* @__PURE__ */ jsx37(CommandEmpty, { children: emptyStateMessage({
|
|
3322
4158
|
mode,
|
|
3323
4159
|
search,
|
|
3324
4160
|
minChars,
|
|
@@ -3326,16 +4162,16 @@ function EntitySelectDropdown({
|
|
|
3326
4162
|
hasSearched,
|
|
3327
4163
|
emptyMessage
|
|
3328
4164
|
}) }),
|
|
3329
|
-
/* @__PURE__ */
|
|
4165
|
+
/* @__PURE__ */ jsx37(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs16(
|
|
3330
4166
|
CommandItem,
|
|
3331
4167
|
{
|
|
3332
4168
|
value: option.value,
|
|
3333
4169
|
onSelect: handleSelect,
|
|
3334
4170
|
children: [
|
|
3335
|
-
/* @__PURE__ */
|
|
3336
|
-
|
|
4171
|
+
/* @__PURE__ */ jsx37(
|
|
4172
|
+
Check5,
|
|
3337
4173
|
{
|
|
3338
|
-
className:
|
|
4174
|
+
className: cn33(
|
|
3339
4175
|
"mr-2 h-4 w-4",
|
|
3340
4176
|
value === option.value ? "opacity-100" : "opacity-0"
|
|
3341
4177
|
)
|
|
@@ -3354,11 +4190,13 @@ function EntitySelect(props) {
|
|
|
3354
4190
|
fetcher,
|
|
3355
4191
|
queryKey,
|
|
3356
4192
|
value,
|
|
4193
|
+
selectedOption,
|
|
3357
4194
|
onChange,
|
|
3358
4195
|
onChangeOption,
|
|
3359
4196
|
onBlur,
|
|
3360
4197
|
label,
|
|
3361
4198
|
required,
|
|
4199
|
+
clearable,
|
|
3362
4200
|
description,
|
|
3363
4201
|
error,
|
|
3364
4202
|
className,
|
|
@@ -3372,8 +4210,8 @@ function EntitySelect(props) {
|
|
|
3372
4210
|
emptyMessage,
|
|
3373
4211
|
disabled
|
|
3374
4212
|
} = resolveEntitySelectDefaults(props);
|
|
3375
|
-
const [open, setOpen] =
|
|
3376
|
-
const [selectedLabel, setSelectedLabel] =
|
|
4213
|
+
const [open, setOpen] = React33.useState(false);
|
|
4214
|
+
const [selectedLabel, setSelectedLabel] = React33.useState(null);
|
|
3377
4215
|
const {
|
|
3378
4216
|
options,
|
|
3379
4217
|
isLoading,
|
|
@@ -3382,7 +4220,7 @@ function EntitySelect(props) {
|
|
|
3382
4220
|
submit: rawSubmit
|
|
3383
4221
|
} = useEntityOptions({ fetcher, queryKey, mode, minChars });
|
|
3384
4222
|
const [hasSearched, submit] = useHasSearched(rawSubmit);
|
|
3385
|
-
|
|
4223
|
+
React33.useEffect(() => {
|
|
3386
4224
|
if (!value) {
|
|
3387
4225
|
setSelectedLabel(null);
|
|
3388
4226
|
return;
|
|
@@ -3390,9 +4228,22 @@ function EntitySelect(props) {
|
|
|
3390
4228
|
const found = options.find((opt) => opt.value === value);
|
|
3391
4229
|
if (found) {
|
|
3392
4230
|
setSelectedLabel(found.label);
|
|
4231
|
+
} else if (selectedOption && selectedOption.value === value) {
|
|
4232
|
+
setSelectedLabel(selectedOption.label);
|
|
3393
4233
|
}
|
|
3394
|
-
}, [value, options]);
|
|
3395
|
-
const
|
|
4234
|
+
}, [value, options, selectedOption]);
|
|
4235
|
+
const handleClear = React33.useCallback(
|
|
4236
|
+
(e) => {
|
|
4237
|
+
e.preventDefault();
|
|
4238
|
+
e.stopPropagation();
|
|
4239
|
+
setSelectedLabel(null);
|
|
4240
|
+
onChange?.(null);
|
|
4241
|
+
onChangeOption?.(null);
|
|
4242
|
+
},
|
|
4243
|
+
[onChange, onChangeOption]
|
|
4244
|
+
);
|
|
4245
|
+
const showClear = Boolean(clearable && value && !required && !disabled);
|
|
4246
|
+
const handleSelect = React33.useCallback(
|
|
3396
4247
|
(selectedValue) => {
|
|
3397
4248
|
const opt = options.find((o) => o.value === selectedValue);
|
|
3398
4249
|
if (opt) setSelectedLabel(opt.label);
|
|
@@ -3405,7 +4256,7 @@ function EntitySelect(props) {
|
|
|
3405
4256
|
},
|
|
3406
4257
|
[options, value, onChange, onChangeOption, setSearch]
|
|
3407
4258
|
);
|
|
3408
|
-
const handleOpenChange =
|
|
4259
|
+
const handleOpenChange = React33.useCallback(
|
|
3409
4260
|
(newOpen) => {
|
|
3410
4261
|
setOpen(newOpen);
|
|
3411
4262
|
if (!newOpen) {
|
|
@@ -3415,8 +4266,8 @@ function EntitySelect(props) {
|
|
|
3415
4266
|
},
|
|
3416
4267
|
[onBlur, setSearch]
|
|
3417
4268
|
);
|
|
3418
|
-
return /* @__PURE__ */
|
|
3419
|
-
/* @__PURE__ */
|
|
4269
|
+
return /* @__PURE__ */ jsxs16("div", { className: cn33("space-y-2", className), children: [
|
|
4270
|
+
/* @__PURE__ */ jsx37(
|
|
3420
4271
|
EntitySelectLabel,
|
|
3421
4272
|
{
|
|
3422
4273
|
id,
|
|
@@ -3425,35 +4276,46 @@ function EntitySelect(props) {
|
|
|
3425
4276
|
description
|
|
3426
4277
|
}
|
|
3427
4278
|
),
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
4279
|
+
/* @__PURE__ */ jsxs16(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
4280
|
+
/* @__PURE__ */ jsx37(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs16(
|
|
3430
4281
|
Button,
|
|
3431
4282
|
{
|
|
3432
4283
|
id,
|
|
3433
4284
|
variant: "outline",
|
|
3434
4285
|
role: "combobox",
|
|
3435
4286
|
"aria-expanded": open,
|
|
3436
|
-
className:
|
|
4287
|
+
className: cn33(
|
|
3437
4288
|
"w-full justify-between",
|
|
3438
4289
|
!selectedLabel && "text-muted-foreground",
|
|
3439
4290
|
error && "border-destructive"
|
|
3440
4291
|
),
|
|
3441
4292
|
disabled,
|
|
3442
4293
|
children: [
|
|
3443
|
-
/* @__PURE__ */
|
|
3444
|
-
/* @__PURE__ */
|
|
3445
|
-
isLoading && /* @__PURE__ */
|
|
3446
|
-
/* @__PURE__ */
|
|
4294
|
+
/* @__PURE__ */ jsx37("span", { className: "truncate", children: selectedLabel ?? placeholder }),
|
|
4295
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1", children: [
|
|
4296
|
+
isLoading && /* @__PURE__ */ jsx37(Loader2, { className: "h-4 w-4 animate-spin opacity-50" }),
|
|
4297
|
+
showClear && /* @__PURE__ */ jsx37(
|
|
4298
|
+
"span",
|
|
4299
|
+
{
|
|
4300
|
+
role: "button",
|
|
4301
|
+
"aria-label": "Clear selection",
|
|
4302
|
+
tabIndex: -1,
|
|
4303
|
+
className: "rounded-sm opacity-50 hover:opacity-100",
|
|
4304
|
+
onPointerDown: handleClear,
|
|
4305
|
+
children: /* @__PURE__ */ jsx37(X3, { className: "h-4 w-4 shrink-0" })
|
|
4306
|
+
}
|
|
4307
|
+
),
|
|
4308
|
+
/* @__PURE__ */ jsx37(ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
3447
4309
|
] })
|
|
3448
4310
|
]
|
|
3449
4311
|
}
|
|
3450
4312
|
) }),
|
|
3451
|
-
/* @__PURE__ */
|
|
4313
|
+
/* @__PURE__ */ jsx37(
|
|
3452
4314
|
PopoverContent,
|
|
3453
4315
|
{
|
|
3454
4316
|
className: "w-[--radix-popover-trigger-width] p-0",
|
|
3455
4317
|
align: "start",
|
|
3456
|
-
children: /* @__PURE__ */
|
|
4318
|
+
children: /* @__PURE__ */ jsx37(
|
|
3457
4319
|
EntitySelectDropdown,
|
|
3458
4320
|
{
|
|
3459
4321
|
searchPlaceholder,
|
|
@@ -3473,34 +4335,34 @@ function EntitySelect(props) {
|
|
|
3473
4335
|
}
|
|
3474
4336
|
)
|
|
3475
4337
|
] }),
|
|
3476
|
-
error && /* @__PURE__ */
|
|
4338
|
+
error && /* @__PURE__ */ jsx37("p", { className: "text-sm font-medium text-destructive", children: error })
|
|
3477
4339
|
] });
|
|
3478
4340
|
}
|
|
3479
4341
|
|
|
3480
4342
|
// src/EntityTree/EntityTree.tsx
|
|
3481
4343
|
import {
|
|
3482
|
-
forwardRef as
|
|
4344
|
+
forwardRef as forwardRef22,
|
|
3483
4345
|
useImperativeHandle as useImperativeHandle2,
|
|
3484
|
-
useMemo as
|
|
4346
|
+
useMemo as useMemo7,
|
|
3485
4347
|
useRef as useRef6
|
|
3486
4348
|
} from "react";
|
|
3487
4349
|
import { Pencil } from "lucide-react";
|
|
3488
|
-
import { cn as
|
|
4350
|
+
import { cn as cn35 } from "@petrarca/sonnet-core";
|
|
3489
4351
|
|
|
3490
4352
|
// src/TreeView/TreeView.tsx
|
|
3491
4353
|
import {
|
|
3492
|
-
forwardRef as
|
|
4354
|
+
forwardRef as forwardRef21,
|
|
3493
4355
|
useCallback as useCallback4,
|
|
3494
|
-
useEffect as
|
|
4356
|
+
useEffect as useEffect8,
|
|
3495
4357
|
useId as useId2,
|
|
3496
4358
|
useImperativeHandle,
|
|
3497
|
-
useMemo as
|
|
4359
|
+
useMemo as useMemo6,
|
|
3498
4360
|
useRef as useRef5,
|
|
3499
|
-
useState as
|
|
4361
|
+
useState as useState8
|
|
3500
4362
|
} from "react";
|
|
3501
|
-
import { ChevronRight as
|
|
3502
|
-
import { cn as
|
|
3503
|
-
import { jsx as
|
|
4363
|
+
import { ChevronRight as ChevronRight4 } from "lucide-react";
|
|
4364
|
+
import { cn as cn34 } from "@petrarca/sonnet-core";
|
|
4365
|
+
import { jsx as jsx38, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3504
4366
|
function flatten(nodes, expandedIds, depth = 0, parentId = null, result = []) {
|
|
3505
4367
|
for (const node of nodes) {
|
|
3506
4368
|
result.push({ node, depth, parentId });
|
|
@@ -3517,15 +4379,15 @@ function ToggleIcon({
|
|
|
3517
4379
|
isExpanded
|
|
3518
4380
|
}) {
|
|
3519
4381
|
if (!hasChildren) {
|
|
3520
|
-
return /* @__PURE__ */
|
|
4382
|
+
return /* @__PURE__ */ jsx38("span", { className: "block w-1.5 h-1.5 rounded-full bg-border mx-auto" });
|
|
3521
4383
|
}
|
|
3522
4384
|
if (isLoading) {
|
|
3523
|
-
return /* @__PURE__ */
|
|
4385
|
+
return /* @__PURE__ */ jsx38("span", { className: "block w-3 h-3 rounded-full border-2 border-muted-foreground/40 border-t-foreground animate-spin" });
|
|
3524
4386
|
}
|
|
3525
|
-
return /* @__PURE__ */
|
|
3526
|
-
|
|
4387
|
+
return /* @__PURE__ */ jsx38(
|
|
4388
|
+
ChevronRight4,
|
|
3527
4389
|
{
|
|
3528
|
-
className:
|
|
4390
|
+
className: cn34(
|
|
3529
4391
|
"h-3.5 w-3.5 text-muted-foreground transition-transform",
|
|
3530
4392
|
isExpanded && "rotate-90"
|
|
3531
4393
|
)
|
|
@@ -3571,7 +4433,7 @@ function NodeRow({
|
|
|
3571
4433
|
},
|
|
3572
4434
|
[node.id, onSelectionChange]
|
|
3573
4435
|
);
|
|
3574
|
-
return /* @__PURE__ */
|
|
4436
|
+
return /* @__PURE__ */ jsxs17(
|
|
3575
4437
|
"li",
|
|
3576
4438
|
{
|
|
3577
4439
|
id: `${treeId}-node-${node.id}`,
|
|
@@ -3580,7 +4442,7 @@ function NodeRow({
|
|
|
3580
4442
|
"aria-selected": onSelectionChange ? isSelected : void 0,
|
|
3581
4443
|
"aria-busy": node.isLoading,
|
|
3582
4444
|
tabIndex: isFocused ? 0 : -1,
|
|
3583
|
-
className:
|
|
4445
|
+
className: cn34(
|
|
3584
4446
|
"flex items-center gap-1 px-2 py-1.5 rounded-sm text-sm select-none",
|
|
3585
4447
|
"cursor-pointer transition-colors",
|
|
3586
4448
|
"hover:bg-accent/60",
|
|
@@ -3590,13 +4452,13 @@ function NodeRow({
|
|
|
3590
4452
|
style: { paddingLeft: depth * indentPx + 8 },
|
|
3591
4453
|
onClick: handleClick,
|
|
3592
4454
|
children: [
|
|
3593
|
-
/* @__PURE__ */
|
|
4455
|
+
/* @__PURE__ */ jsx38(
|
|
3594
4456
|
"span",
|
|
3595
4457
|
{
|
|
3596
4458
|
className: "shrink-0 flex items-center justify-center w-4 h-4",
|
|
3597
4459
|
onClick: handleToggle,
|
|
3598
4460
|
"aria-hidden": true,
|
|
3599
|
-
children: /* @__PURE__ */
|
|
4461
|
+
children: /* @__PURE__ */ jsx38(
|
|
3600
4462
|
ToggleIcon,
|
|
3601
4463
|
{
|
|
3602
4464
|
hasChildren: node.hasChildren,
|
|
@@ -3606,7 +4468,7 @@ function NodeRow({
|
|
|
3606
4468
|
)
|
|
3607
4469
|
}
|
|
3608
4470
|
),
|
|
3609
|
-
onSelectionChange && isSelectable && /* @__PURE__ */
|
|
4471
|
+
onSelectionChange && isSelectable && /* @__PURE__ */ jsx38(
|
|
3610
4472
|
"input",
|
|
3611
4473
|
{
|
|
3612
4474
|
type: "checkbox",
|
|
@@ -3618,8 +4480,8 @@ function NodeRow({
|
|
|
3618
4480
|
tabIndex: -1
|
|
3619
4481
|
}
|
|
3620
4482
|
),
|
|
3621
|
-
/* @__PURE__ */
|
|
3622
|
-
node.isError && /* @__PURE__ */
|
|
4483
|
+
/* @__PURE__ */ jsx38("span", { className: "flex-1 min-w-0", children: renderNode(node, depth) }),
|
|
4484
|
+
node.isError && /* @__PURE__ */ jsx38("span", { className: "shrink-0 text-xs text-destructive", "aria-live": "polite", children: "Failed to load" })
|
|
3623
4485
|
]
|
|
3624
4486
|
}
|
|
3625
4487
|
);
|
|
@@ -3639,11 +4501,11 @@ function TreeViewInner({
|
|
|
3639
4501
|
className
|
|
3640
4502
|
}, ref) {
|
|
3641
4503
|
const treeId = useId2();
|
|
3642
|
-
const [focusedId, setFocusedId] =
|
|
4504
|
+
const [focusedId, setFocusedId] = useState8(null);
|
|
3643
4505
|
const listRef = useRef5(null);
|
|
3644
|
-
const [constrainedParent, setConstrainedParent] =
|
|
4506
|
+
const [constrainedParent, setConstrainedParent] = useState8(UNCONSTRAINED);
|
|
3645
4507
|
const selectionSize = selectedIds?.size ?? 0;
|
|
3646
|
-
|
|
4508
|
+
useEffect8(() => {
|
|
3647
4509
|
if (selectionSize === 0) setConstrainedParent(UNCONSTRAINED);
|
|
3648
4510
|
}, [selectionSize]);
|
|
3649
4511
|
useImperativeHandle(
|
|
@@ -3660,16 +4522,16 @@ function TreeViewInner({
|
|
|
3660
4522
|
}),
|
|
3661
4523
|
[focusedId]
|
|
3662
4524
|
);
|
|
3663
|
-
const flatNodes =
|
|
4525
|
+
const flatNodes = useMemo6(
|
|
3664
4526
|
() => flatten(nodes, expandedIds),
|
|
3665
4527
|
[nodes, expandedIds]
|
|
3666
4528
|
);
|
|
3667
|
-
const parentById =
|
|
4529
|
+
const parentById = useMemo6(() => {
|
|
3668
4530
|
const map = /* @__PURE__ */ new Map();
|
|
3669
4531
|
for (const f of flatNodes) map.set(f.node.id, f.parentId);
|
|
3670
4532
|
return map;
|
|
3671
4533
|
}, [flatNodes]);
|
|
3672
|
-
const selectableSet =
|
|
4534
|
+
const selectableSet = useMemo6(() => {
|
|
3673
4535
|
if (!constrainSelectionToSiblings || constrainedParent === UNCONSTRAINED) {
|
|
3674
4536
|
return void 0;
|
|
3675
4537
|
}
|
|
@@ -3795,10 +4657,10 @@ function TreeViewInner({
|
|
|
3795
4657
|
]
|
|
3796
4658
|
);
|
|
3797
4659
|
if (nodes.length === 0) {
|
|
3798
|
-
return /* @__PURE__ */
|
|
4660
|
+
return /* @__PURE__ */ jsx38(
|
|
3799
4661
|
"div",
|
|
3800
4662
|
{
|
|
3801
|
-
className:
|
|
4663
|
+
className: cn34(
|
|
3802
4664
|
"py-8 text-center text-sm text-muted-foreground",
|
|
3803
4665
|
className
|
|
3804
4666
|
),
|
|
@@ -3806,15 +4668,15 @@ function TreeViewInner({
|
|
|
3806
4668
|
}
|
|
3807
4669
|
);
|
|
3808
4670
|
}
|
|
3809
|
-
return /* @__PURE__ */
|
|
4671
|
+
return /* @__PURE__ */ jsx38(
|
|
3810
4672
|
"ul",
|
|
3811
4673
|
{
|
|
3812
4674
|
ref: listRef,
|
|
3813
4675
|
role: "tree",
|
|
3814
4676
|
"aria-label": "Tree",
|
|
3815
|
-
className:
|
|
4677
|
+
className: cn34("outline-none", className),
|
|
3816
4678
|
onKeyDown: handleKeyDown,
|
|
3817
|
-
children: flatNodes.map((flat) => /* @__PURE__ */
|
|
4679
|
+
children: flatNodes.map((flat) => /* @__PURE__ */ jsx38(
|
|
3818
4680
|
NodeRow,
|
|
3819
4681
|
{
|
|
3820
4682
|
flat,
|
|
@@ -3836,26 +4698,26 @@ function TreeViewInner({
|
|
|
3836
4698
|
}
|
|
3837
4699
|
);
|
|
3838
4700
|
}
|
|
3839
|
-
var TreeView =
|
|
4701
|
+
var TreeView = forwardRef21(TreeViewInner);
|
|
3840
4702
|
|
|
3841
4703
|
// src/EntityTree/EntityTree.tsx
|
|
3842
|
-
import { jsx as
|
|
4704
|
+
import { jsx as jsx39, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3843
4705
|
function buildCellRow(resolved, activeNodeIdRef, onNodeEdit, localRenderers) {
|
|
3844
4706
|
return function renderCells(node) {
|
|
3845
4707
|
const isActive = node.id === activeNodeIdRef.current;
|
|
3846
|
-
return /* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ jsxs18("span", { className: "flex items-center gap-4 min-w-0 w-full group/row", children: [
|
|
3847
4709
|
resolved.map((col) => {
|
|
3848
4710
|
const Renderer = resolveCellRenderer2(
|
|
3849
4711
|
col.cellRenderer,
|
|
3850
4712
|
localRenderers
|
|
3851
4713
|
);
|
|
3852
4714
|
const value = node.data[col.key];
|
|
3853
|
-
return /* @__PURE__ */
|
|
4715
|
+
return /* @__PURE__ */ jsx39(
|
|
3854
4716
|
"span",
|
|
3855
4717
|
{
|
|
3856
4718
|
className: "shrink-0",
|
|
3857
4719
|
style: col.width !== void 0 ? { width: col.width } : void 0,
|
|
3858
|
-
children: /* @__PURE__ */
|
|
4720
|
+
children: /* @__PURE__ */ jsx39(
|
|
3859
4721
|
Renderer,
|
|
3860
4722
|
{
|
|
3861
4723
|
value,
|
|
@@ -3867,7 +4729,7 @@ function buildCellRow(resolved, activeNodeIdRef, onNodeEdit, localRenderers) {
|
|
|
3867
4729
|
col.key
|
|
3868
4730
|
);
|
|
3869
4731
|
}),
|
|
3870
|
-
onNodeEdit && /* @__PURE__ */
|
|
4732
|
+
onNodeEdit && /* @__PURE__ */ jsx39("span", { className: "ml-auto shrink-0", children: /* @__PURE__ */ jsx39(
|
|
3871
4733
|
"button",
|
|
3872
4734
|
{
|
|
3873
4735
|
type: "button",
|
|
@@ -3876,11 +4738,11 @@ function buildCellRow(resolved, activeNodeIdRef, onNodeEdit, localRenderers) {
|
|
|
3876
4738
|
onNodeEdit(node);
|
|
3877
4739
|
},
|
|
3878
4740
|
"aria-label": "Edit",
|
|
3879
|
-
className:
|
|
4741
|
+
className: cn35(
|
|
3880
4742
|
"p-1 rounded hover:bg-background text-muted-foreground hover:text-foreground transition-colors",
|
|
3881
4743
|
isActive ? "opacity-100" : "opacity-0 group-hover/row:opacity-100"
|
|
3882
4744
|
),
|
|
3883
|
-
children: /* @__PURE__ */
|
|
4745
|
+
children: /* @__PURE__ */ jsx39(Pencil, { className: "h-3.5 w-3.5" })
|
|
3884
4746
|
}
|
|
3885
4747
|
) })
|
|
3886
4748
|
] });
|
|
@@ -3903,10 +4765,10 @@ function renderTreeStatus({
|
|
|
3903
4765
|
className
|
|
3904
4766
|
}) {
|
|
3905
4767
|
if (isLoading && nodes.length === 0) {
|
|
3906
|
-
return /* @__PURE__ */
|
|
4768
|
+
return /* @__PURE__ */ jsx39(
|
|
3907
4769
|
"div",
|
|
3908
4770
|
{
|
|
3909
|
-
className:
|
|
4771
|
+
className: cn35(
|
|
3910
4772
|
"py-8 text-center text-sm text-muted-foreground",
|
|
3911
4773
|
className
|
|
3912
4774
|
),
|
|
@@ -3915,19 +4777,19 @@ function renderTreeStatus({
|
|
|
3915
4777
|
);
|
|
3916
4778
|
}
|
|
3917
4779
|
if (isError) {
|
|
3918
|
-
return /* @__PURE__ */
|
|
4780
|
+
return /* @__PURE__ */ jsx39(
|
|
3919
4781
|
"div",
|
|
3920
4782
|
{
|
|
3921
|
-
className:
|
|
4783
|
+
className: cn35("py-8 text-center text-sm text-destructive", className),
|
|
3922
4784
|
children: errorMessage ?? `Failed to load ${entityLabel}.`
|
|
3923
4785
|
}
|
|
3924
4786
|
);
|
|
3925
4787
|
}
|
|
3926
4788
|
if (!isLoading && nodes.length === 0) {
|
|
3927
|
-
return /* @__PURE__ */
|
|
4789
|
+
return /* @__PURE__ */ jsxs18(
|
|
3928
4790
|
"div",
|
|
3929
4791
|
{
|
|
3930
|
-
className:
|
|
4792
|
+
className: cn35(
|
|
3931
4793
|
"py-8 text-center text-sm text-muted-foreground",
|
|
3932
4794
|
className
|
|
3933
4795
|
),
|
|
@@ -3985,7 +4847,7 @@ function EntityTreeInner(props, ref) {
|
|
|
3985
4847
|
treeRef.current?.focus();
|
|
3986
4848
|
}
|
|
3987
4849
|
}));
|
|
3988
|
-
const resolved =
|
|
4850
|
+
const resolved = useMemo7(() => {
|
|
3989
4851
|
if (renderers) validateRendererNames(renderers);
|
|
3990
4852
|
return resolveColumns(schema, uiSchema);
|
|
3991
4853
|
}, [schema, uiSchema, renderers]);
|
|
@@ -3997,7 +4859,7 @@ function EntityTreeInner(props, ref) {
|
|
|
3997
4859
|
onSelectionChange,
|
|
3998
4860
|
constrainSelectionToSiblings
|
|
3999
4861
|
});
|
|
4000
|
-
const defaultRenderNode =
|
|
4862
|
+
const defaultRenderNode = useMemo7(
|
|
4001
4863
|
() => buildCellRow(
|
|
4002
4864
|
resolved,
|
|
4003
4865
|
activeNodeIdRef,
|
|
@@ -4006,7 +4868,7 @@ function EntityTreeInner(props, ref) {
|
|
|
4006
4868
|
),
|
|
4007
4869
|
[resolved, selection.effectiveOnNodeEdit, renderers]
|
|
4008
4870
|
);
|
|
4009
|
-
const renderNode =
|
|
4871
|
+
const renderNode = useMemo7(
|
|
4010
4872
|
() => resolveRenderNode(renderNodeOverride, defaultRenderNode),
|
|
4011
4873
|
[renderNodeOverride, defaultRenderNode]
|
|
4012
4874
|
);
|
|
@@ -4019,7 +4881,7 @@ function EntityTreeInner(props, ref) {
|
|
|
4019
4881
|
className
|
|
4020
4882
|
});
|
|
4021
4883
|
if (statusView) return statusView;
|
|
4022
|
-
return /* @__PURE__ */
|
|
4884
|
+
return /* @__PURE__ */ jsx39("div", { className: cn35("rounded-lg border", className), children: /* @__PURE__ */ jsx39(
|
|
4023
4885
|
TreeView,
|
|
4024
4886
|
{
|
|
4025
4887
|
ref: treeRef,
|
|
@@ -4038,17 +4900,17 @@ function EntityTreeInner(props, ref) {
|
|
|
4038
4900
|
}
|
|
4039
4901
|
) });
|
|
4040
4902
|
}
|
|
4041
|
-
var EntityTree =
|
|
4903
|
+
var EntityTree = forwardRef22(EntityTreeInner);
|
|
4042
4904
|
|
|
4043
4905
|
// src/SearchInput/SearchInput.tsx
|
|
4044
|
-
import
|
|
4045
|
-
import { Search as Search2, X as
|
|
4046
|
-
import { cn as
|
|
4906
|
+
import React38, { useMemo as useMemo9, useRef as useRef9, useState as useState11, useEffect as useEffect12 } from "react";
|
|
4907
|
+
import { Search as Search2, X as X4, ChevronDown as ChevronDown2 } from "lucide-react";
|
|
4908
|
+
import { cn as cn37 } from "@petrarca/sonnet-core";
|
|
4047
4909
|
import { getFieldTitle as getFieldTitle2 } from "@petrarca/sonnet-core/schema";
|
|
4048
4910
|
import { isEmptyFilterExpr } from "@petrarca/sonnet-core/search";
|
|
4049
4911
|
|
|
4050
4912
|
// src/SearchInput/useSearchInput.ts
|
|
4051
|
-
import { useCallback as useCallback5, useEffect as
|
|
4913
|
+
import { useCallback as useCallback5, useEffect as useEffect9, useMemo as useMemo8, useRef as useRef7, useState as useState9 } from "react";
|
|
4052
4914
|
import { collectTerms } from "@petrarca/sonnet-core/search";
|
|
4053
4915
|
|
|
4054
4916
|
// src/SearchInput/schemaAdapter.ts
|
|
@@ -4123,7 +4985,7 @@ function useSearchInput({
|
|
|
4123
4985
|
minChars = 0,
|
|
4124
4986
|
searchFields
|
|
4125
4987
|
}) {
|
|
4126
|
-
const allFacets =
|
|
4988
|
+
const allFacets = useMemo8(
|
|
4127
4989
|
() => schema ? buildFacetDescriptors(schema) : [],
|
|
4128
4990
|
[schema]
|
|
4129
4991
|
);
|
|
@@ -4132,23 +4994,23 @@ function useSearchInput({
|
|
|
4132
4994
|
const terms = collectTerms(value);
|
|
4133
4995
|
return terms.length === 1 && terms[0].key === "search" ? terms[0].value : "";
|
|
4134
4996
|
})() : "";
|
|
4135
|
-
const [inputValue, setInputValue] =
|
|
4136
|
-
const [pendingFacet, setPendingFacet] =
|
|
4997
|
+
const [inputValue, setInputValue] = useState9(initialInput);
|
|
4998
|
+
const [pendingFacet, setPendingFacet] = useState9(
|
|
4137
4999
|
null
|
|
4138
5000
|
);
|
|
4139
|
-
const [draftTerms, setDraftTerms] =
|
|
5001
|
+
const [draftTerms, setDraftTerms] = useState9(
|
|
4140
5002
|
() => isFaceted ? collectTerms(value) : []
|
|
4141
5003
|
);
|
|
4142
|
-
const valueTerms =
|
|
5004
|
+
const valueTerms = useMemo8(
|
|
4143
5005
|
() => !isFaceted ? collectTerms(value) : [],
|
|
4144
5006
|
[value, isFaceted]
|
|
4145
5007
|
);
|
|
4146
5008
|
const activeTerms = isFaceted ? draftTerms : valueTerms;
|
|
4147
|
-
const activeFieldKeys =
|
|
5009
|
+
const activeFieldKeys = useMemo8(
|
|
4148
5010
|
() => new Set(activeTerms.map((t) => t.key)),
|
|
4149
5011
|
[activeTerms]
|
|
4150
5012
|
);
|
|
4151
|
-
const filteredFacets =
|
|
5013
|
+
const filteredFacets = useMemo8(() => {
|
|
4152
5014
|
if (!isFaceted || pendingFacet || inputValue.endsWith(" ")) return [];
|
|
4153
5015
|
const available = allFacets.filter((f) => !activeFieldKeys.has(f.key));
|
|
4154
5016
|
if (!inputValue.trim()) return available;
|
|
@@ -4171,7 +5033,7 @@ function useSearchInput({
|
|
|
4171
5033
|
filteredFacetsRef.current = filteredFacets;
|
|
4172
5034
|
const minCharsRef = useRef7(minChars);
|
|
4173
5035
|
minCharsRef.current = minChars;
|
|
4174
|
-
|
|
5036
|
+
useEffect9(() => {
|
|
4175
5037
|
if (!isFaceted) return;
|
|
4176
5038
|
const terms = collectTerms(value);
|
|
4177
5039
|
if (terms.length === 0) {
|
|
@@ -4183,7 +5045,7 @@ function useSearchInput({
|
|
|
4183
5045
|
const searchFieldsRef = useRef7(searchFields);
|
|
4184
5046
|
searchFieldsRef.current = searchFields;
|
|
4185
5047
|
const isMountedRef = useRef7(false);
|
|
4186
|
-
|
|
5048
|
+
useEffect9(() => {
|
|
4187
5049
|
if (!isMountedRef.current) {
|
|
4188
5050
|
isMountedRef.current = true;
|
|
4189
5051
|
return;
|
|
@@ -4350,8 +5212,8 @@ function useSearchInput({
|
|
|
4350
5212
|
}
|
|
4351
5213
|
|
|
4352
5214
|
// src/SearchInput/widgets/TextSearchWidget.tsx
|
|
4353
|
-
import { useRef as useRef8, useEffect as
|
|
4354
|
-
import { jsx as
|
|
5215
|
+
import { useRef as useRef8, useEffect as useEffect10 } from "react";
|
|
5216
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
4355
5217
|
function TextSearchWidget({
|
|
4356
5218
|
value,
|
|
4357
5219
|
onChange,
|
|
@@ -4361,10 +5223,10 @@ function TextSearchWidget({
|
|
|
4361
5223
|
autoFocus
|
|
4362
5224
|
}) {
|
|
4363
5225
|
const inputRef = useRef8(null);
|
|
4364
|
-
|
|
5226
|
+
useEffect10(() => {
|
|
4365
5227
|
if (autoFocus) inputRef.current?.focus();
|
|
4366
5228
|
}, [autoFocus]);
|
|
4367
|
-
return /* @__PURE__ */
|
|
5229
|
+
return /* @__PURE__ */ jsx40(
|
|
4368
5230
|
Input,
|
|
4369
5231
|
{
|
|
4370
5232
|
ref: inputRef,
|
|
@@ -4390,9 +5252,9 @@ function TextSearchWidget({
|
|
|
4390
5252
|
}
|
|
4391
5253
|
|
|
4392
5254
|
// src/SearchInput/widgets/EnumSearchWidget.tsx
|
|
4393
|
-
import { useEffect as
|
|
4394
|
-
import { cn as
|
|
4395
|
-
import { jsx as
|
|
5255
|
+
import { useEffect as useEffect11, useState as useState10 } from "react";
|
|
5256
|
+
import { cn as cn36 } from "@petrarca/sonnet-core";
|
|
5257
|
+
import { jsx as jsx41, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4396
5258
|
function EnumSearchWidget({
|
|
4397
5259
|
property,
|
|
4398
5260
|
options: widgetOptions,
|
|
@@ -4401,9 +5263,9 @@ function EnumSearchWidget({
|
|
|
4401
5263
|
placeholder,
|
|
4402
5264
|
autoFocus
|
|
4403
5265
|
}) {
|
|
4404
|
-
const [open, setOpen] =
|
|
4405
|
-
const [search, setSearch] =
|
|
4406
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
5266
|
+
const [open, setOpen] = useState10(false);
|
|
5267
|
+
const [search, setSearch] = useState10("");
|
|
5268
|
+
const [highlightedIndex, setHighlightedIndex] = useState10(0);
|
|
4407
5269
|
const enumValues = property.enum ?? [];
|
|
4408
5270
|
const enumNames = widgetOptions.enumNames ?? {};
|
|
4409
5271
|
const items = enumValues.map((val) => ({
|
|
@@ -4413,10 +5275,10 @@ function EnumSearchWidget({
|
|
|
4413
5275
|
const filtered = search ? items.filter(
|
|
4414
5276
|
(item) => item.label.toLowerCase().includes(search.toLowerCase())
|
|
4415
5277
|
) : items;
|
|
4416
|
-
|
|
5278
|
+
useEffect11(() => {
|
|
4417
5279
|
setHighlightedIndex(0);
|
|
4418
5280
|
}, [filtered.length, search]);
|
|
4419
|
-
|
|
5281
|
+
useEffect11(() => {
|
|
4420
5282
|
if (autoFocus) {
|
|
4421
5283
|
requestAnimationFrame(() => setOpen(true));
|
|
4422
5284
|
}
|
|
@@ -4456,8 +5318,8 @@ function EnumSearchWidget({
|
|
|
4456
5318
|
return;
|
|
4457
5319
|
}
|
|
4458
5320
|
}
|
|
4459
|
-
return /* @__PURE__ */
|
|
4460
|
-
/* @__PURE__ */
|
|
5321
|
+
return /* @__PURE__ */ jsxs19(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
5322
|
+
/* @__PURE__ */ jsx41(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
|
|
4461
5323
|
"button",
|
|
4462
5324
|
{
|
|
4463
5325
|
type: "button",
|
|
@@ -4466,14 +5328,14 @@ function EnumSearchWidget({
|
|
|
4466
5328
|
children: placeholder ?? "Select..."
|
|
4467
5329
|
}
|
|
4468
5330
|
) }),
|
|
4469
|
-
/* @__PURE__ */
|
|
5331
|
+
/* @__PURE__ */ jsxs19(
|
|
4470
5332
|
PopoverContent,
|
|
4471
5333
|
{
|
|
4472
5334
|
className: "w-48 p-1",
|
|
4473
5335
|
align: "start",
|
|
4474
5336
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
4475
5337
|
children: [
|
|
4476
|
-
/* @__PURE__ */
|
|
5338
|
+
/* @__PURE__ */ jsx41(
|
|
4477
5339
|
"input",
|
|
4478
5340
|
{
|
|
4479
5341
|
autoFocus: true,
|
|
@@ -4484,13 +5346,13 @@ function EnumSearchWidget({
|
|
|
4484
5346
|
className: "w-full px-2 py-1.5 text-sm bg-transparent outline-none border-b border-border mb-1 placeholder:text-muted-foreground"
|
|
4485
5347
|
}
|
|
4486
5348
|
),
|
|
4487
|
-
/* @__PURE__ */
|
|
4488
|
-
filtered.length === 0 && /* @__PURE__ */
|
|
4489
|
-
filtered.map((item, i) => /* @__PURE__ */
|
|
5349
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
5350
|
+
filtered.length === 0 && /* @__PURE__ */ jsx41("p", { className: "px-2 py-1.5 text-sm text-muted-foreground", children: "No matches" }),
|
|
5351
|
+
filtered.map((item, i) => /* @__PURE__ */ jsx41(
|
|
4490
5352
|
"button",
|
|
4491
5353
|
{
|
|
4492
5354
|
type: "button",
|
|
4493
|
-
className:
|
|
5355
|
+
className: cn36(
|
|
4494
5356
|
"w-full text-left px-2 py-1.5 text-sm rounded transition-colors",
|
|
4495
5357
|
i === highlightedIndex ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground"
|
|
4496
5358
|
),
|
|
@@ -4529,7 +5391,7 @@ var DEFAULT_SEARCH_WIDGETS = {
|
|
|
4529
5391
|
};
|
|
4530
5392
|
|
|
4531
5393
|
// src/SearchInput/SearchInput.tsx
|
|
4532
|
-
import { Fragment as
|
|
5394
|
+
import { Fragment as Fragment4, jsx as jsx42, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4533
5395
|
function resolveSearchDefaults(props) {
|
|
4534
5396
|
return {
|
|
4535
5397
|
mode: props.mode ?? "explicit",
|
|
@@ -4549,8 +5411,8 @@ function FacetPicker({
|
|
|
4549
5411
|
acceptFacet,
|
|
4550
5412
|
inputRef
|
|
4551
5413
|
}) {
|
|
4552
|
-
return /* @__PURE__ */
|
|
4553
|
-
/* @__PURE__ */
|
|
5414
|
+
return /* @__PURE__ */ jsxs20(Popover, { open: pickerVisible, onOpenChange: setPickerOpen, modal: false, children: [
|
|
5415
|
+
/* @__PURE__ */ jsx42(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx42(
|
|
4554
5416
|
"button",
|
|
4555
5417
|
{
|
|
4556
5418
|
type: "button",
|
|
@@ -4561,21 +5423,21 @@ function FacetPicker({
|
|
|
4561
5423
|
setPickerOpen((o) => !o);
|
|
4562
5424
|
inputRef.current?.focus();
|
|
4563
5425
|
},
|
|
4564
|
-
children: /* @__PURE__ */
|
|
5426
|
+
children: /* @__PURE__ */ jsx42(ChevronDown2, { className: "h-3 w-3" })
|
|
4565
5427
|
}
|
|
4566
5428
|
) }),
|
|
4567
|
-
/* @__PURE__ */
|
|
5429
|
+
/* @__PURE__ */ jsx42(
|
|
4568
5430
|
PopoverContent,
|
|
4569
5431
|
{
|
|
4570
|
-
className:
|
|
5432
|
+
className: cn37("w-44 p-1", !hasFacetsToShow && "hidden"),
|
|
4571
5433
|
align: "start",
|
|
4572
5434
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
4573
5435
|
onFocusOutside: (e) => e.preventDefault(),
|
|
4574
|
-
children: filteredFacets.map((facet, i) => /* @__PURE__ */
|
|
5436
|
+
children: filteredFacets.map((facet, i) => /* @__PURE__ */ jsx42(
|
|
4575
5437
|
"button",
|
|
4576
5438
|
{
|
|
4577
5439
|
type: "button",
|
|
4578
|
-
className:
|
|
5440
|
+
className: cn37(
|
|
4579
5441
|
"w-full text-left px-2 py-1.5 text-sm rounded transition-colors",
|
|
4580
5442
|
i === highlightedIndex ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground"
|
|
4581
5443
|
),
|
|
@@ -4609,7 +5471,7 @@ function ValueEntry({
|
|
|
4609
5471
|
onInputFocus
|
|
4610
5472
|
}) {
|
|
4611
5473
|
if (pendingFacet && PendingWidget) {
|
|
4612
|
-
return /* @__PURE__ */
|
|
5474
|
+
return /* @__PURE__ */ jsx42(
|
|
4613
5475
|
PendingWidget,
|
|
4614
5476
|
{
|
|
4615
5477
|
property: pendingFacet.property,
|
|
@@ -4631,7 +5493,7 @@ function ValueEntry({
|
|
|
4631
5493
|
}
|
|
4632
5494
|
);
|
|
4633
5495
|
}
|
|
4634
|
-
return /* @__PURE__ */
|
|
5496
|
+
return /* @__PURE__ */ jsx42(
|
|
4635
5497
|
Input,
|
|
4636
5498
|
{
|
|
4637
5499
|
ref: inputRef,
|
|
@@ -4700,10 +5562,10 @@ function ActiveChips({
|
|
|
4700
5562
|
schema,
|
|
4701
5563
|
onRemove
|
|
4702
5564
|
}) {
|
|
4703
|
-
return /* @__PURE__ */
|
|
5565
|
+
return /* @__PURE__ */ jsx42(Fragment4, { children: terms.map((term, i) => {
|
|
4704
5566
|
const property = schema?.properties?.[term.key];
|
|
4705
5567
|
const label = property ? getFieldTitle2(term.key, property) : term.key;
|
|
4706
|
-
return /* @__PURE__ */
|
|
5568
|
+
return /* @__PURE__ */ jsx42(
|
|
4707
5569
|
FilterChip,
|
|
4708
5570
|
{
|
|
4709
5571
|
label: `${label}: ${term.value}`,
|
|
@@ -4727,8 +5589,8 @@ function SearchActions({
|
|
|
4727
5589
|
onClear,
|
|
4728
5590
|
onCommit
|
|
4729
5591
|
}) {
|
|
4730
|
-
return /* @__PURE__ */
|
|
4731
|
-
!isEmpty && /* @__PURE__ */
|
|
5592
|
+
return /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
5593
|
+
!isEmpty && /* @__PURE__ */ jsx42(
|
|
4732
5594
|
"button",
|
|
4733
5595
|
{
|
|
4734
5596
|
type: "button",
|
|
@@ -4738,10 +5600,10 @@ function SearchActions({
|
|
|
4738
5600
|
},
|
|
4739
5601
|
className: "text-muted-foreground hover:text-foreground transition-colors shrink-0",
|
|
4740
5602
|
"aria-label": "Clear search",
|
|
4741
|
-
children: /* @__PURE__ */
|
|
5603
|
+
children: /* @__PURE__ */ jsx42(X4, { className: "h-4 w-4" })
|
|
4742
5604
|
}
|
|
4743
5605
|
),
|
|
4744
|
-
showSearchButton && mode === "explicit" && /* @__PURE__ */
|
|
5606
|
+
showSearchButton && mode === "explicit" && /* @__PURE__ */ jsx42(
|
|
4745
5607
|
Button,
|
|
4746
5608
|
{
|
|
4747
5609
|
type: "button",
|
|
@@ -4773,10 +5635,10 @@ function SearchInput(props) {
|
|
|
4773
5635
|
const { mode, debounceMs, minChars, showSearchButton, disabled } = resolveSearchDefaults(props);
|
|
4774
5636
|
const inputRef = useRef9(null);
|
|
4775
5637
|
const containerRef = useRef9(null);
|
|
4776
|
-
const [pickerOpen, setPickerOpen] =
|
|
4777
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
4778
|
-
const [pickerNavigated, setPickerNavigated] =
|
|
4779
|
-
|
|
5638
|
+
const [pickerOpen, setPickerOpen] = useState11(false);
|
|
5639
|
+
const [highlightedIndex, setHighlightedIndex] = useState11(-1);
|
|
5640
|
+
const [pickerNavigated, setPickerNavigated] = useState11(false);
|
|
5641
|
+
useEffect12(() => {
|
|
4780
5642
|
if (!pickerOpen) return;
|
|
4781
5643
|
function handleMouseDown(e) {
|
|
4782
5644
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -4786,7 +5648,7 @@ function SearchInput(props) {
|
|
|
4786
5648
|
document.addEventListener("mousedown", handleMouseDown);
|
|
4787
5649
|
return () => document.removeEventListener("mousedown", handleMouseDown);
|
|
4788
5650
|
}, [pickerOpen]);
|
|
4789
|
-
const widgetRegistry =
|
|
5651
|
+
const widgetRegistry = useMemo9(
|
|
4790
5652
|
() => mergeWidgetRegistry(customWidgets),
|
|
4791
5653
|
[customWidgets]
|
|
4792
5654
|
);
|
|
@@ -4814,7 +5676,7 @@ function SearchInput(props) {
|
|
|
4814
5676
|
searchFields
|
|
4815
5677
|
});
|
|
4816
5678
|
const isEmpty = isEmptyFilterExpr(value) && inputValue === "";
|
|
4817
|
-
|
|
5679
|
+
useEffect12(() => {
|
|
4818
5680
|
setHighlightedIndex(-1);
|
|
4819
5681
|
}, [filteredFacets, pickerOpen]);
|
|
4820
5682
|
const resolvedPlaceholder = resolvePlaceholder(
|
|
@@ -4826,7 +5688,7 @@ function SearchInput(props) {
|
|
|
4826
5688
|
const showFacetControls = isFaceted && !pendingFacet;
|
|
4827
5689
|
const pickerVisible = showFacetControls && pickerOpen;
|
|
4828
5690
|
const hasFacetsToShow = pickerVisible && filteredFacets.length > 0;
|
|
4829
|
-
const acceptFacet =
|
|
5691
|
+
const acceptFacet = React38.useCallback(
|
|
4830
5692
|
(facet) => {
|
|
4831
5693
|
selectFacet(facet);
|
|
4832
5694
|
setPickerOpen(false);
|
|
@@ -4850,11 +5712,11 @@ function SearchInput(props) {
|
|
|
4850
5712
|
acceptFacet,
|
|
4851
5713
|
handleKeyDown
|
|
4852
5714
|
};
|
|
4853
|
-
return /* @__PURE__ */
|
|
5715
|
+
return /* @__PURE__ */ jsxs20(
|
|
4854
5716
|
"div",
|
|
4855
5717
|
{
|
|
4856
5718
|
ref: containerRef,
|
|
4857
|
-
className:
|
|
5719
|
+
className: cn37(
|
|
4858
5720
|
"flex flex-wrap items-center gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 text-sm min-h-9",
|
|
4859
5721
|
disabled ? "opacity-50 cursor-not-allowed" : "cursor-text",
|
|
4860
5722
|
className
|
|
@@ -4867,8 +5729,8 @@ function SearchInput(props) {
|
|
|
4867
5729
|
}
|
|
4868
5730
|
},
|
|
4869
5731
|
children: [
|
|
4870
|
-
/* @__PURE__ */
|
|
4871
|
-
isFaceted && /* @__PURE__ */
|
|
5732
|
+
/* @__PURE__ */ jsx42(Search2, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
5733
|
+
isFaceted && /* @__PURE__ */ jsx42(
|
|
4872
5734
|
ActiveChips,
|
|
4873
5735
|
{
|
|
4874
5736
|
terms: activeTerms,
|
|
@@ -4876,12 +5738,12 @@ function SearchInput(props) {
|
|
|
4876
5738
|
onRemove: handleRemoveTerm
|
|
4877
5739
|
}
|
|
4878
5740
|
),
|
|
4879
|
-
pendingFacet && /* @__PURE__ */
|
|
5741
|
+
pendingFacet && /* @__PURE__ */ jsxs20("span", { className: "inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground", children: [
|
|
4880
5742
|
pendingFacet.label,
|
|
4881
5743
|
":"
|
|
4882
5744
|
] }),
|
|
4883
|
-
/* @__PURE__ */
|
|
4884
|
-
showFacetControls && /* @__PURE__ */
|
|
5745
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-1 flex-1 min-w-[120px]", children: [
|
|
5746
|
+
showFacetControls && /* @__PURE__ */ jsx42(
|
|
4885
5747
|
FacetPicker,
|
|
4886
5748
|
{
|
|
4887
5749
|
pickerVisible,
|
|
@@ -4894,7 +5756,7 @@ function SearchInput(props) {
|
|
|
4894
5756
|
inputRef
|
|
4895
5757
|
}
|
|
4896
5758
|
),
|
|
4897
|
-
/* @__PURE__ */
|
|
5759
|
+
/* @__PURE__ */ jsx42(
|
|
4898
5760
|
ValueEntry,
|
|
4899
5761
|
{
|
|
4900
5762
|
pendingFacet,
|
|
@@ -4918,7 +5780,7 @@ function SearchInput(props) {
|
|
|
4918
5780
|
}
|
|
4919
5781
|
)
|
|
4920
5782
|
] }),
|
|
4921
|
-
/* @__PURE__ */
|
|
5783
|
+
/* @__PURE__ */ jsx42(
|
|
4922
5784
|
SearchActions,
|
|
4923
5785
|
{
|
|
4924
5786
|
isEmpty,
|
|
@@ -4933,14 +5795,14 @@ function SearchInput(props) {
|
|
|
4933
5795
|
);
|
|
4934
5796
|
}
|
|
4935
5797
|
function FilterChip({ label, onRemove }) {
|
|
4936
|
-
return /* @__PURE__ */
|
|
5798
|
+
return /* @__PURE__ */ jsxs20(
|
|
4937
5799
|
Badge,
|
|
4938
5800
|
{
|
|
4939
5801
|
variant: "secondary",
|
|
4940
5802
|
className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded-full",
|
|
4941
5803
|
children: [
|
|
4942
5804
|
label,
|
|
4943
|
-
/* @__PURE__ */
|
|
5805
|
+
/* @__PURE__ */ jsx42(
|
|
4944
5806
|
"button",
|
|
4945
5807
|
{
|
|
4946
5808
|
type: "button",
|
|
@@ -4950,7 +5812,7 @@ function FilterChip({ label, onRemove }) {
|
|
|
4950
5812
|
},
|
|
4951
5813
|
className: "ml-0.5 hover:text-destructive transition-colors",
|
|
4952
5814
|
"aria-label": `Remove filter ${label}`,
|
|
4953
|
-
children: /* @__PURE__ */
|
|
5815
|
+
children: /* @__PURE__ */ jsx42(X4, { className: "h-3 w-3" })
|
|
4954
5816
|
}
|
|
4955
5817
|
)
|
|
4956
5818
|
]
|
|
@@ -4960,9 +5822,9 @@ function FilterChip({ label, onRemove }) {
|
|
|
4960
5822
|
|
|
4961
5823
|
// src/Clipboard/ClipboardButton.tsx
|
|
4962
5824
|
import { Copy } from "lucide-react";
|
|
4963
|
-
import { jsx as
|
|
5825
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
4964
5826
|
function ClipboardButton({ hasItems, onClick }) {
|
|
4965
|
-
return /* @__PURE__ */
|
|
5827
|
+
return /* @__PURE__ */ jsx43(
|
|
4966
5828
|
Button,
|
|
4967
5829
|
{
|
|
4968
5830
|
variant: "ghost",
|
|
@@ -4973,21 +5835,21 @@ function ClipboardButton({ hasItems, onClick }) {
|
|
|
4973
5835
|
opacity: hasItems ? 1 : 0.4,
|
|
4974
5836
|
cursor: hasItems ? "pointer" : "not-allowed"
|
|
4975
5837
|
},
|
|
4976
|
-
children: /* @__PURE__ */
|
|
5838
|
+
children: /* @__PURE__ */ jsx43(Copy, { size: 16 })
|
|
4977
5839
|
}
|
|
4978
5840
|
);
|
|
4979
5841
|
}
|
|
4980
5842
|
var ClipboardButton_default = ClipboardButton;
|
|
4981
5843
|
|
|
4982
5844
|
// src/Clipboard/ClipboardItem.tsx
|
|
4983
|
-
import { X as
|
|
4984
|
-
import { jsx as
|
|
5845
|
+
import { X as X5, Plus } from "lucide-react";
|
|
5846
|
+
import { jsx as jsx44, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4985
5847
|
function ClipboardItemComponent({ item, onAddItem, onRemove }) {
|
|
4986
5848
|
const handleAddClick = (e) => {
|
|
4987
5849
|
const keepInClipboard = e.shiftKey;
|
|
4988
5850
|
onAddItem(item, keepInClipboard);
|
|
4989
5851
|
};
|
|
4990
|
-
return /* @__PURE__ */
|
|
5852
|
+
return /* @__PURE__ */ jsx44(
|
|
4991
5853
|
"div",
|
|
4992
5854
|
{
|
|
4993
5855
|
className: "p-3 rounded mb-2",
|
|
@@ -4995,17 +5857,17 @@ function ClipboardItemComponent({ item, onAddItem, onRemove }) {
|
|
|
4995
5857
|
borderLeft: `4px solid ${item.color}`,
|
|
4996
5858
|
backgroundColor: "#f8f9fa"
|
|
4997
5859
|
},
|
|
4998
|
-
children: /* @__PURE__ */
|
|
4999
|
-
/* @__PURE__ */
|
|
5000
|
-
/* @__PURE__ */
|
|
5001
|
-
/* @__PURE__ */
|
|
5002
|
-
/* @__PURE__ */
|
|
5860
|
+
children: /* @__PURE__ */ jsxs21(SimpleGroup, { justify: "space-between", wrap: "nowrap", align: "flex-start", children: [
|
|
5861
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex-1 min-w-0 overflow-hidden", children: [
|
|
5862
|
+
/* @__PURE__ */ jsx44("p", { className: "text-sm font-semibold truncate", children: item.label }),
|
|
5863
|
+
/* @__PURE__ */ jsx44("p", { className: "text-xs text-muted-foreground truncate", children: item.displayName }),
|
|
5864
|
+
/* @__PURE__ */ jsxs21("p", { className: "text-xs text-muted-foreground font-mono", children: [
|
|
5003
5865
|
"#",
|
|
5004
5866
|
item.entityId
|
|
5005
5867
|
] })
|
|
5006
5868
|
] }),
|
|
5007
|
-
/* @__PURE__ */
|
|
5008
|
-
/* @__PURE__ */
|
|
5869
|
+
/* @__PURE__ */ jsxs21(SimpleGroup, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 }, children: [
|
|
5870
|
+
/* @__PURE__ */ jsxs21(
|
|
5009
5871
|
Button,
|
|
5010
5872
|
{
|
|
5011
5873
|
size: "sm",
|
|
@@ -5013,19 +5875,19 @@ function ClipboardItemComponent({ item, onAddItem, onRemove }) {
|
|
|
5013
5875
|
onClick: handleAddClick,
|
|
5014
5876
|
title: "Click to add and remove from clipboard, Shift+Click to keep in clipboard",
|
|
5015
5877
|
children: [
|
|
5016
|
-
/* @__PURE__ */
|
|
5878
|
+
/* @__PURE__ */ jsx44(Plus, { size: 16 }),
|
|
5017
5879
|
"Add"
|
|
5018
5880
|
]
|
|
5019
5881
|
}
|
|
5020
5882
|
),
|
|
5021
|
-
/* @__PURE__ */
|
|
5883
|
+
/* @__PURE__ */ jsx44(
|
|
5022
5884
|
Button,
|
|
5023
5885
|
{
|
|
5024
5886
|
size: "sm",
|
|
5025
5887
|
variant: "ghost",
|
|
5026
5888
|
onClick: () => onRemove(item.id),
|
|
5027
5889
|
title: "Remove from clipboard",
|
|
5028
|
-
children: /* @__PURE__ */
|
|
5890
|
+
children: /* @__PURE__ */ jsx44(X5, { size: 16 })
|
|
5029
5891
|
}
|
|
5030
5892
|
)
|
|
5031
5893
|
] })
|
|
@@ -5123,16 +5985,16 @@ var useClipboard = create()(
|
|
|
5123
5985
|
var clipboardStore_default = useClipboard;
|
|
5124
5986
|
|
|
5125
5987
|
// src/Clipboard/ClipboardMenu.tsx
|
|
5126
|
-
import { jsx as
|
|
5988
|
+
import { jsx as jsx45, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5127
5989
|
function ClipboardMenu({ onAddItem }) {
|
|
5128
5990
|
const { items, removeItem, clear } = clipboardStore_default();
|
|
5129
5991
|
if (items.length === 0) {
|
|
5130
|
-
return /* @__PURE__ */
|
|
5131
|
-
/* @__PURE__ */
|
|
5132
|
-
/* @__PURE__ */
|
|
5992
|
+
return /* @__PURE__ */ jsxs22("div", { style: { padding: "16px", textAlign: "center", width: "300px" }, children: [
|
|
5993
|
+
/* @__PURE__ */ jsx45("p", { className: "text-sm text-muted-foreground", children: "No items in clipboard" }),
|
|
5994
|
+
/* @__PURE__ */ jsx45("p", { className: "text-xs text-muted-foreground mt-1", children: 'Right-click a node and select "Copy"' })
|
|
5133
5995
|
] });
|
|
5134
5996
|
}
|
|
5135
|
-
return /* @__PURE__ */
|
|
5997
|
+
return /* @__PURE__ */ jsxs22(
|
|
5136
5998
|
"div",
|
|
5137
5999
|
{
|
|
5138
6000
|
style: {
|
|
@@ -5143,7 +6005,7 @@ function ClipboardMenu({ onAddItem }) {
|
|
|
5143
6005
|
maxHeight: "500px"
|
|
5144
6006
|
},
|
|
5145
6007
|
children: [
|
|
5146
|
-
/* @__PURE__ */
|
|
6008
|
+
/* @__PURE__ */ jsx45(ScrollArea, { className: "flex-1 p-3 min-h-0", children: /* @__PURE__ */ jsx45(SimpleStack, { gap: 0, children: items.map((item) => /* @__PURE__ */ jsx45(
|
|
5147
6009
|
ClipboardItem_default,
|
|
5148
6010
|
{
|
|
5149
6011
|
item,
|
|
@@ -5152,8 +6014,8 @@ function ClipboardMenu({ onAddItem }) {
|
|
|
5152
6014
|
},
|
|
5153
6015
|
item.id
|
|
5154
6016
|
)) }) }),
|
|
5155
|
-
/* @__PURE__ */
|
|
5156
|
-
/* @__PURE__ */
|
|
6017
|
+
/* @__PURE__ */ jsx45(Separator3, {}),
|
|
6018
|
+
/* @__PURE__ */ jsx45("div", { style: { padding: "8px 12px", flexShrink: 0 }, children: /* @__PURE__ */ jsxs22(
|
|
5157
6019
|
Button,
|
|
5158
6020
|
{
|
|
5159
6021
|
className: "w-full",
|
|
@@ -5161,7 +6023,7 @@ function ClipboardMenu({ onAddItem }) {
|
|
|
5161
6023
|
size: "sm",
|
|
5162
6024
|
onClick: clear,
|
|
5163
6025
|
children: [
|
|
5164
|
-
/* @__PURE__ */
|
|
6026
|
+
/* @__PURE__ */ jsx45(Trash2, { size: 16 }),
|
|
5165
6027
|
"Clear All (",
|
|
5166
6028
|
items.length,
|
|
5167
6029
|
")"
|
|
@@ -5183,6 +6045,7 @@ export {
|
|
|
5183
6045
|
Badge,
|
|
5184
6046
|
Button,
|
|
5185
6047
|
CELL_RENDERERS,
|
|
6048
|
+
Calendar,
|
|
5186
6049
|
Card,
|
|
5187
6050
|
CardContent,
|
|
5188
6051
|
CardDescription,
|
|
@@ -5205,6 +6068,8 @@ export {
|
|
|
5205
6068
|
CommandList,
|
|
5206
6069
|
CommandSeparator,
|
|
5207
6070
|
CommandShortcut,
|
|
6071
|
+
DateInput,
|
|
6072
|
+
DateTimeInput,
|
|
5208
6073
|
Dialog,
|
|
5209
6074
|
DialogClose,
|
|
5210
6075
|
DialogContent,
|
|
@@ -5233,14 +6098,16 @@ export {
|
|
|
5233
6098
|
EntitySelect,
|
|
5234
6099
|
EntityTable,
|
|
5235
6100
|
EntityTree,
|
|
6101
|
+
IconButton,
|
|
5236
6102
|
Input,
|
|
6103
|
+
InputError,
|
|
5237
6104
|
InputGroup,
|
|
5238
6105
|
InputGroupAddon,
|
|
5239
6106
|
InputGroupButton,
|
|
5240
6107
|
InputGroupInput,
|
|
5241
6108
|
InputGroupText,
|
|
5242
6109
|
InputGroupTextarea,
|
|
5243
|
-
|
|
6110
|
+
Label3 as Label,
|
|
5244
6111
|
Popover,
|
|
5245
6112
|
PopoverContent,
|
|
5246
6113
|
PopoverTrigger,
|
|
@@ -5250,7 +6117,17 @@ export {
|
|
|
5250
6117
|
ScrollArea,
|
|
5251
6118
|
ScrollBar,
|
|
5252
6119
|
SearchInput,
|
|
5253
|
-
|
|
6120
|
+
Select,
|
|
6121
|
+
SelectContent,
|
|
6122
|
+
SelectGroup,
|
|
6123
|
+
SelectItem,
|
|
6124
|
+
SelectLabel,
|
|
6125
|
+
SelectScrollDownButton,
|
|
6126
|
+
SelectScrollUpButton,
|
|
6127
|
+
SelectSeparator,
|
|
6128
|
+
SelectTrigger,
|
|
6129
|
+
SelectValue,
|
|
6130
|
+
Separator3 as Separator,
|
|
5254
6131
|
Sheet,
|
|
5255
6132
|
SheetBody,
|
|
5256
6133
|
SheetClose,
|
|
@@ -5280,8 +6157,10 @@ export {
|
|
|
5280
6157
|
Tabs,
|
|
5281
6158
|
TabsContent,
|
|
5282
6159
|
TabsList,
|
|
6160
|
+
TabsSeparator,
|
|
5283
6161
|
TabsTrigger,
|
|
5284
6162
|
Textarea,
|
|
6163
|
+
TimeInput,
|
|
5285
6164
|
Tooltip,
|
|
5286
6165
|
TooltipContent,
|
|
5287
6166
|
TooltipProvider,
|