@partrunner-ai/ui 2.4.4 → 2.5.1

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.cjs CHANGED
@@ -4171,26 +4171,44 @@ var TableRow = react.forwardRef(function TableRow2({
4171
4171
  }
4172
4172
  );
4173
4173
  });
4174
- var TableHead = react.forwardRef(function TableHead2({ className, scope = "col", ...props }, ref) {
4174
+ var CELL_ALIGN = {
4175
+ start: "pr-table__cell--start",
4176
+ left: "pr-table__cell--start",
4177
+ center: "pr-table__cell--center",
4178
+ end: "pr-table__cell--end",
4179
+ right: "pr-table__cell--end"
4180
+ };
4181
+ function alignClass({ align, numeric }) {
4182
+ if (numeric) return CELL_ALIGN.end;
4183
+ if (align === void 0 || align === "justify" || align === "char") return null;
4184
+ return CELL_ALIGN[align];
4185
+ }
4186
+ function nativeAlign({ align, numeric }) {
4187
+ if (numeric) return void 0;
4188
+ return align === "justify" || align === "char" ? align : void 0;
4189
+ }
4190
+ var TableHead = react.forwardRef(function TableHead2({ className, scope = "col", align, numeric, ...props }, ref) {
4175
4191
  return /* @__PURE__ */ jsxRuntime.jsx(
4176
4192
  "th",
4177
4193
  {
4178
4194
  ...props,
4179
4195
  ref,
4180
4196
  scope,
4197
+ align: nativeAlign({ align, numeric }),
4181
4198
  "data-slot": "table-head",
4182
- className: classes("pr-table__th", className)
4199
+ className: classes("pr-table__th", alignClass({ align, numeric }), className)
4183
4200
  }
4184
4201
  );
4185
4202
  });
4186
- var TableCell = react.forwardRef(function TableCell2({ className, ...props }, ref) {
4203
+ var TableCell = react.forwardRef(function TableCell2({ className, align, numeric, ...props }, ref) {
4187
4204
  return /* @__PURE__ */ jsxRuntime.jsx(
4188
4205
  "td",
4189
4206
  {
4190
4207
  ...props,
4191
4208
  ref,
4209
+ align: nativeAlign({ align, numeric }),
4192
4210
  "data-slot": "table-cell",
4193
- className: classes("pr-table__td", className)
4211
+ className: classes("pr-table__td", alignClass({ align, numeric }), className)
4194
4212
  }
4195
4213
  );
4196
4214
  });
@@ -4270,7 +4288,7 @@ function DataTable({
4270
4288
  scope: "col",
4271
4289
  className: [
4272
4290
  "pr-table__th",
4273
- ALIGN[col.align ?? "start"],
4291
+ ALIGN[col.numeric ? "end" : col.align ?? "start"],
4274
4292
  col.hideOnMobile ? "pr-table__cell--desktop" : null,
4275
4293
  col.headerClassName
4276
4294
  ].filter(Boolean).join(" "),
@@ -4306,7 +4324,7 @@ function DataTable({
4306
4324
  {
4307
4325
  className: [
4308
4326
  "pr-table__td",
4309
- ALIGN[col.align ?? "start"],
4327
+ ALIGN[col.numeric ? "end" : col.align ?? "start"],
4310
4328
  col.hideOnMobile ? "pr-table__cell--desktop" : null,
4311
4329
  col.className
4312
4330
  ].filter(Boolean).join(" "),
@@ -7260,6 +7278,341 @@ async function prepareCommentFile(file) {
7260
7278
  height: canvas.height
7261
7279
  };
7262
7280
  }
7281
+ var TONE_ICON = {
7282
+ neutral: lucideReact.Info,
7283
+ info: lucideReact.Info,
7284
+ success: lucideReact.CheckCircle2,
7285
+ warning: lucideReact.AlertTriangle,
7286
+ danger: lucideReact.XCircle
7287
+ };
7288
+ var Notice = react.forwardRef(function Notice2({
7289
+ tone = "info",
7290
+ title,
7291
+ children,
7292
+ icon,
7293
+ actions,
7294
+ onDismiss,
7295
+ dismissLabel = "Cerrar aviso",
7296
+ size = "md",
7297
+ role,
7298
+ className,
7299
+ ...rest
7300
+ }, ref) {
7301
+ const ToneIcon = TONE_ICON[tone];
7302
+ const iconNode = icon === false ? null : icon ?? /* @__PURE__ */ jsxRuntime.jsx(ToneIcon, { size: size === "sm" ? 16 : 18, "aria-hidden": true });
7303
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7304
+ "div",
7305
+ {
7306
+ ref,
7307
+ ...rest,
7308
+ role: role ?? (tone === "danger" ? "alert" : "status"),
7309
+ "data-slot": "notice",
7310
+ className: ["pr-notice", `pr-notice--${tone}`, `pr-notice--${size}`, className].filter(Boolean).join(" "),
7311
+ children: [
7312
+ iconNode != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-notice__icon", children: iconNode }) : null,
7313
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pr-notice__body", children: [
7314
+ title != null && title !== false ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "pr-notice__title", children: title }) : null,
7315
+ children != null && children !== false ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pr-notice__text", children }) : null
7316
+ ] }),
7317
+ actions != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pr-notice__actions", children: actions }) : null,
7318
+ onDismiss ? /* @__PURE__ */ jsxRuntime.jsx(
7319
+ IconButton,
7320
+ {
7321
+ className: "pr-notice__dismiss",
7322
+ label: dismissLabel,
7323
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 16, "aria-hidden": true }),
7324
+ variant: "ghost",
7325
+ size: "sm",
7326
+ compact: true,
7327
+ onClick: onDismiss
7328
+ }
7329
+ ) : null
7330
+ ]
7331
+ }
7332
+ );
7333
+ });
7334
+ var DetailList = react.forwardRef(function DetailList2({ columns = 2, layout = "stacked", density = "comfortable", className, ...rest }, ref) {
7335
+ return /* @__PURE__ */ jsxRuntime.jsx(
7336
+ "dl",
7337
+ {
7338
+ ref,
7339
+ ...rest,
7340
+ "data-slot": "detail-list",
7341
+ className: [
7342
+ "pr-detail-list",
7343
+ `pr-detail-list--${layout}`,
7344
+ `pr-detail-list--cols-${columns}`,
7345
+ density === "compact" ? "pr-detail-list--compact" : null,
7346
+ className
7347
+ ].filter(Boolean).join(" ")
7348
+ }
7349
+ );
7350
+ });
7351
+ var DetailItem = react.forwardRef(function DetailItem2({ label, children, span = 1, numeric = false, emptyText = "\u2014", className, ...rest }, ref) {
7352
+ const empty = children == null || children === "" || children === false;
7353
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7354
+ "div",
7355
+ {
7356
+ ref,
7357
+ ...rest,
7358
+ "data-slot": "detail-item",
7359
+ className: [
7360
+ "pr-detail-item",
7361
+ span !== 1 ? `pr-detail-item--span-${span}` : null,
7362
+ numeric ? "pr-detail-item--numeric" : null,
7363
+ className
7364
+ ].filter(Boolean).join(" "),
7365
+ children: [
7366
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "pr-detail-item__label", children: label }),
7367
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: ["pr-detail-item__value", empty ? "pr-detail-item__value--empty" : null].filter(Boolean).join(" "), children: empty ? emptyText : children })
7368
+ ]
7369
+ }
7370
+ );
7371
+ });
7372
+ var ItemList = react.forwardRef(function ItemList2({ density = "comfortable", divided = true, className, ...rest }, ref) {
7373
+ return /* @__PURE__ */ jsxRuntime.jsx(
7374
+ "ul",
7375
+ {
7376
+ ref,
7377
+ ...rest,
7378
+ "data-slot": "item-list",
7379
+ className: [
7380
+ "pr-item-list",
7381
+ density === "compact" ? "pr-item-list--compact" : null,
7382
+ divided ? "pr-item-list--divided" : null,
7383
+ className
7384
+ ].filter(Boolean).join(" ")
7385
+ }
7386
+ );
7387
+ });
7388
+ var DefaultLink2 = ({ href, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("a", { href, ...props, children });
7389
+ var ItemRow = react.forwardRef(function ItemRow2({
7390
+ title,
7391
+ description,
7392
+ descriptionLines = 1,
7393
+ meta,
7394
+ leading,
7395
+ trailing,
7396
+ tone,
7397
+ footer,
7398
+ selected = false,
7399
+ unread = false,
7400
+ unreadLabel = "No le\xEDdo",
7401
+ disabled = false,
7402
+ href,
7403
+ onClick,
7404
+ LinkComponent = DefaultLink2,
7405
+ className,
7406
+ ...rest
7407
+ }, ref) {
7408
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7409
+ leading != null ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pr-item-row__leading", "data-slot": "item-row-leading", children: [
7410
+ leading,
7411
+ unread ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-item-row__dot pr-item-row__dot--overlay", "data-slot": "item-row-dot", "aria-hidden": true }) : null
7412
+ ] }) : null,
7413
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pr-item-row__body", children: [
7414
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pr-item-row__top", children: [
7415
+ unread && leading == null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-item-row__dot", "data-slot": "item-row-dot", "aria-hidden": true }) : null,
7416
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pr-item-row__title", "data-slot": "item-row-title", children: [
7417
+ unread ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pr-visually-hidden", children: [
7418
+ unreadLabel,
7419
+ ", "
7420
+ ] }) : null,
7421
+ title
7422
+ ] }),
7423
+ meta != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-item-row__meta", "data-slot": "item-row-meta", children: meta }) : null
7424
+ ] }),
7425
+ description != null ? /* @__PURE__ */ jsxRuntime.jsx(
7426
+ "span",
7427
+ {
7428
+ "data-slot": "item-row-description",
7429
+ className: [
7430
+ "pr-item-row__description",
7431
+ descriptionLines === 2 ? "pr-item-row__description--2" : null
7432
+ ].filter(Boolean).join(" "),
7433
+ children: description
7434
+ }
7435
+ ) : null,
7436
+ footer != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-item-row__footer", "data-slot": "item-row-footer", children: footer }) : null
7437
+ ] }),
7438
+ trailing != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-item-row__trailing", "data-slot": "item-row-trailing", children: trailing }) : null
7439
+ ] });
7440
+ const mainClass = "pr-item-row__main";
7441
+ const current = selected ? "true" : void 0;
7442
+ let control;
7443
+ if (href != null && !disabled) {
7444
+ control = /* @__PURE__ */ jsxRuntime.jsx(
7445
+ LinkComponent,
7446
+ {
7447
+ href,
7448
+ className: mainClass,
7449
+ "aria-current": current,
7450
+ "data-slot": "item-row-main",
7451
+ ...onClick ? { onClick } : {},
7452
+ children: content
7453
+ }
7454
+ );
7455
+ } else if (href != null) {
7456
+ control = /* @__PURE__ */ jsxRuntime.jsx("a", { className: mainClass, "aria-disabled": "true", "aria-current": current, "data-slot": "item-row-main", children: content });
7457
+ } else {
7458
+ control = /* @__PURE__ */ jsxRuntime.jsx(
7459
+ "button",
7460
+ {
7461
+ type: "button",
7462
+ className: mainClass,
7463
+ "aria-current": current,
7464
+ disabled,
7465
+ onClick,
7466
+ "data-slot": "item-row-main",
7467
+ children: content
7468
+ }
7469
+ );
7470
+ }
7471
+ return /* @__PURE__ */ jsxRuntime.jsx(
7472
+ "li",
7473
+ {
7474
+ ref,
7475
+ ...rest,
7476
+ "data-slot": "item-row",
7477
+ "data-selected": selected ? "" : void 0,
7478
+ "data-tone": tone,
7479
+ "data-unread": unread ? "" : void 0,
7480
+ "data-disabled": disabled ? "" : void 0,
7481
+ className: ["pr-item-row", className].filter(Boolean).join(" "),
7482
+ children: control
7483
+ }
7484
+ );
7485
+ });
7486
+ var SplitView = react.forwardRef(function SplitView2({
7487
+ list,
7488
+ listHeader,
7489
+ detail,
7490
+ listWidth = "md",
7491
+ detailOpen = false,
7492
+ onBack,
7493
+ backLabel = "Volver a la lista",
7494
+ listLabel = "Lista",
7495
+ detailLabel = "Detalle",
7496
+ height = "fill",
7497
+ className,
7498
+ ...rest
7499
+ }, ref) {
7500
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7501
+ "div",
7502
+ {
7503
+ ref,
7504
+ ...rest,
7505
+ "data-slot": "split-view",
7506
+ "data-detail-open": detailOpen ? "" : void 0,
7507
+ className: [
7508
+ "pr-split-view",
7509
+ `pr-split-view--list-${listWidth}`,
7510
+ `pr-split-view--${height}`,
7511
+ className
7512
+ ].filter(Boolean).join(" "),
7513
+ children: [
7514
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { "aria-label": listLabel, className: "pr-split-view__list", children: [
7515
+ listHeader != null ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pr-split-view__list-header", children: listHeader }) : null,
7516
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pr-split-view__list-scroll", children: list })
7517
+ ] }),
7518
+ /* @__PURE__ */ jsxRuntime.jsxs("section", { "aria-label": detailLabel, className: "pr-split-view__detail", children: [
7519
+ onBack ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pr-split-view__back", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", icon: lucideReact.ChevronLeft, onClick: onBack, children: backLabel }) }) : null,
7520
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pr-split-view__detail-scroll", children: detail })
7521
+ ] })
7522
+ ]
7523
+ }
7524
+ );
7525
+ });
7526
+ var Stack = react.forwardRef(function Stack2({
7527
+ direction = "column",
7528
+ gap = "lg",
7529
+ align,
7530
+ justify,
7531
+ wrap = false,
7532
+ asChild = false,
7533
+ className,
7534
+ ...rest
7535
+ }, ref) {
7536
+ const classes2 = [
7537
+ "pr-stack",
7538
+ direction === "row" ? "pr-stack--row" : null,
7539
+ `pr-stack--gap-${gap}`,
7540
+ align ? `pr-stack--align-${align}` : null,
7541
+ justify ? `pr-stack--justify-${justify}` : null,
7542
+ wrap ? "pr-stack--wrap" : null,
7543
+ className
7544
+ ].filter(Boolean).join(" ");
7545
+ const Comp = asChild ? Slot : "div";
7546
+ return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ref, "data-slot": "stack", className: classes2, ...rest });
7547
+ });
7548
+ var Disclosure = react.forwardRef(function Disclosure2({
7549
+ title,
7550
+ description,
7551
+ trailing,
7552
+ defaultOpen = false,
7553
+ open: openProp,
7554
+ onOpenChange,
7555
+ variant = "plain",
7556
+ headingLevel = 3,
7557
+ className,
7558
+ children,
7559
+ ...rest
7560
+ }, ref) {
7561
+ const [innerOpen, setInnerOpen] = react.useState(defaultOpen);
7562
+ const controlled = openProp !== void 0;
7563
+ const open = controlled ? openProp : innerOpen;
7564
+ const baseId = react.useId();
7565
+ const buttonId = `${baseId}-trigger`;
7566
+ const panelId = `${baseId}-panel`;
7567
+ const Heading = `h${headingLevel}`;
7568
+ function toggle() {
7569
+ const next = !open;
7570
+ if (!controlled) setInnerOpen(next);
7571
+ onOpenChange?.(next);
7572
+ }
7573
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7574
+ "div",
7575
+ {
7576
+ ref,
7577
+ ...rest,
7578
+ "data-slot": "disclosure",
7579
+ "data-state": open ? "open" : "closed",
7580
+ className: ["pr-disclosure", `pr-disclosure--${variant}`, className].filter(Boolean).join(" "),
7581
+ children: [
7582
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { className: "pr-disclosure__heading", children: /* @__PURE__ */ jsxRuntime.jsxs(
7583
+ "button",
7584
+ {
7585
+ type: "button",
7586
+ id: buttonId,
7587
+ className: "pr-disclosure__trigger",
7588
+ "aria-expanded": open,
7589
+ "aria-controls": panelId,
7590
+ onClick: toggle,
7591
+ children: [
7592
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 18, "aria-hidden": true, className: "pr-disclosure__chevron" }),
7593
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pr-disclosure__text", children: [
7594
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-disclosure__title", children: title }),
7595
+ description != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-disclosure__description", children: description }) : null
7596
+ ] }),
7597
+ trailing != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pr-disclosure__trailing", children: trailing }) : null
7598
+ ]
7599
+ }
7600
+ ) }),
7601
+ /* @__PURE__ */ jsxRuntime.jsx(
7602
+ "div",
7603
+ {
7604
+ id: panelId,
7605
+ role: "region",
7606
+ "aria-labelledby": buttonId,
7607
+ hidden: !open,
7608
+ className: "pr-disclosure__panel",
7609
+ children
7610
+ }
7611
+ )
7612
+ ]
7613
+ }
7614
+ );
7615
+ });
7263
7616
 
7264
7617
  exports.AlertDialogAction = AlertDialogAction;
7265
7618
  exports.AlertDialogCancel = AlertDialogCancel;
@@ -7290,6 +7643,8 @@ exports.CopyField = CopyField;
7290
7643
  exports.DataTable = DataTable;
7291
7644
  exports.DatePicker = DatePicker;
7292
7645
  exports.DateRangeFilter = DateRangeFilter;
7646
+ exports.DetailItem = DetailItem;
7647
+ exports.DetailList = DetailList;
7293
7648
  exports.Dialog = Dialog;
7294
7649
  exports.DialogClose = DialogClose;
7295
7650
  exports.DialogContent = DialogContent;
@@ -7300,6 +7655,7 @@ exports.DialogLayer = DialogLayer;
7300
7655
  exports.DialogRoot = DialogRoot;
7301
7656
  exports.DialogTitle = DialogTitle;
7302
7657
  exports.DialogTrigger = DialogTrigger;
7658
+ exports.Disclosure = Disclosure;
7303
7659
  exports.DropdownMenu = DropdownMenu;
7304
7660
  exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
7305
7661
  exports.DropdownMenuContent = DropdownMenuContent;
@@ -7319,9 +7675,12 @@ exports.FormField = FormField;
7319
7675
  exports.IconButton = IconButton;
7320
7676
  exports.IconTile = IconTile;
7321
7677
  exports.Input = Input;
7678
+ exports.ItemList = ItemList;
7679
+ exports.ItemRow = ItemRow;
7322
7680
  exports.Label = Label;
7323
7681
  exports.MultiSelect = MultiSelect;
7324
7682
  exports.NavigationTabs = NavigationTabs;
7683
+ exports.Notice = Notice;
7325
7684
  exports.OtpInput = OtpInput;
7326
7685
  exports.Page = Page;
7327
7686
  exports.PageHeader = PageHeader;
@@ -7363,6 +7722,8 @@ exports.SheetTrigger = SheetTrigger;
7363
7722
  exports.Skeleton = Skeleton;
7364
7723
  exports.Slot = Slot;
7365
7724
  exports.Spinner = Spinner;
7725
+ exports.SplitView = SplitView;
7726
+ exports.Stack = Stack;
7366
7727
  exports.StatTile = StatTile;
7367
7728
  exports.StatTileGrid = StatTileGrid;
7368
7729
  exports.StatusDot = StatusDot;