@krak-stack/registry 0.11.7 → 0.11.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +39 -0
  3. package/dist/components/app-switcher/html.d.ts +2 -2
  4. package/dist/components/asset-input/html.d.ts +70 -0
  5. package/dist/components/asset-input/html.js +1549 -0
  6. package/dist/components/asset-input/index.d.ts +280 -0
  7. package/dist/components/asset-input/react.d.ts +32 -0
  8. package/dist/components/asset-input/react.js +2269 -0
  9. package/dist/components/asset-input/schema.d.ts +93 -0
  10. package/dist/components/asset-input/upload.d.ts +15 -0
  11. package/dist/components/asset-table/html.d.ts +110 -0
  12. package/dist/components/asset-table/html.js +4934 -0
  13. package/dist/components/asset-table/index.d.ts +225 -0
  14. package/dist/components/asset-table/react.d.ts +21 -0
  15. package/dist/components/asset-table/react.js +8241 -0
  16. package/dist/components/asset-table/schema.d.ts +73 -0
  17. package/dist/components/audit-log-table/html.js +47 -13
  18. package/dist/components/audit-log-table/react.js +36 -12
  19. package/dist/components/copy-button/html.d.ts +2 -2
  20. package/dist/components/danger-confirmation/html.d.ts +2 -2
  21. package/dist/components/data-table/classes.d.ts +2 -0
  22. package/dist/components/data-table/html.d.ts +58 -0
  23. package/dist/components/data-table/html.js +47 -13
  24. package/dist/components/data-table/index.d.ts +51 -1
  25. package/dist/components/data-table/react.d.ts +1 -0
  26. package/dist/components/data-table/react.js +36 -12
  27. package/dist/components/data-table/schema.d.ts +93 -3
  28. package/dist/components/date-input/html.d.ts +2 -2
  29. package/dist/components/docs/html.js +22 -4
  30. package/dist/components/docs/react.js +33 -2
  31. package/dist/components/editable-text/html.d.ts +2 -2
  32. package/dist/components/editing-locale-switcher/html.d.ts +2 -2
  33. package/dist/components/effect-form/react.js +343 -138
  34. package/dist/components/file-input/classes.d.ts +1 -1
  35. package/dist/components/file-input/file-type.d.ts +1 -0
  36. package/dist/components/file-input/html.d.ts +8 -1
  37. package/dist/components/file-input/html.js +170 -12
  38. package/dist/components/file-input/index.d.ts +1 -0
  39. package/dist/components/file-input/react.d.ts +9 -1
  40. package/dist/components/file-input/react.js +277 -127
  41. package/dist/components/file-input/schema.d.ts +1 -0
  42. package/dist/components/form/react.d.ts +5 -5
  43. package/dist/components/form/react.js +343 -138
  44. package/dist/components/icon-input/html.js +19 -5
  45. package/dist/components/icon-input/react.js +70 -13
  46. package/dist/components/locale-switcher/html.d.ts +2 -2
  47. package/dist/components/map-menu/html.d.ts +10 -4
  48. package/dist/components/map-menu/html.js +13 -8
  49. package/dist/components/map-menu/index.d.ts +5 -4
  50. package/dist/components/map-menu/react.d.ts +28 -17
  51. package/dist/components/map-menu/react.js +84 -178
  52. package/dist/components/map-menu/schema.d.ts +6 -0
  53. package/dist/components/map-menu/shared.d.ts +4 -0
  54. package/dist/components/permissions-input/classes.d.ts +8 -0
  55. package/dist/components/permissions-input/html.d.ts +41 -0
  56. package/dist/components/permissions-input/html.js +130 -0
  57. package/dist/components/permissions-input/index.d.ts +80 -0
  58. package/dist/components/permissions-input/react.d.ts +7 -0
  59. package/dist/components/permissions-input/react.js +201 -0
  60. package/dist/components/permissions-input/schema.d.ts +33 -0
  61. package/dist/components/phone-number-input/html.js +48 -14
  62. package/dist/components/phone-number-input/react.js +67 -10
  63. package/dist/components/presence-transition/index.d.ts +2 -2
  64. package/dist/components/search-menu/html.d.ts +2 -2
  65. package/dist/components/sidebar-layout/html.d.ts +3 -2
  66. package/dist/components/sidebar-layout/html.js +20 -2
  67. package/dist/components/sidebar-layout/index.d.ts +1 -0
  68. package/dist/components/sidebar-layout/react.js +33 -2
  69. package/dist/components/time-input/html.d.ts +2 -2
  70. package/dist/components/timezone-input/html.js +48 -14
  71. package/dist/components/timezone-input/react.js +67 -10
  72. package/dist/components/tracking-notice/html.d.ts +4 -4
  73. package/dist/components/tracking-notice/index.d.ts +2 -2
  74. package/dist/components/upload-attachment/classes.d.ts +3 -2
  75. package/dist/components/upload-attachment/html.d.ts +1 -1
  76. package/dist/components/upload-attachment/html.js +7 -5
  77. package/dist/components/upload-attachment/react.d.ts +3 -1
  78. package/dist/components/upload-attachment/react.js +25 -17
  79. package/dist/components/virtualized-combobox/classes.d.ts +12 -0
  80. package/dist/components/virtualized-combobox/html.d.ts +45 -3
  81. package/dist/components/virtualized-combobox/html.js +48 -14
  82. package/dist/components/virtualized-combobox/index.d.ts +55 -4
  83. package/dist/components/virtualized-combobox/react.d.ts +6 -2
  84. package/dist/components/virtualized-combobox/react.js +67 -10
  85. package/dist/components/virtualized-combobox/schema.d.ts +60 -4
  86. package/dist/components/webhook-delivery-table/html.js +47 -13
  87. package/dist/components/webhook-delivery-table/react.js +36 -12
  88. package/dist/lib/access/index.d.ts +61 -0
  89. package/dist/lib/access/index.js +92 -0
  90. package/dist/lib/access/table/classes.d.ts +13 -0
  91. package/dist/lib/access/table/html.d.ts +39 -0
  92. package/dist/lib/access/table/html.js +157 -0
  93. package/dist/lib/access/table/index.d.ts +32 -0
  94. package/dist/lib/access/table/react.d.ts +3 -0
  95. package/dist/lib/access/table/react.js +195 -0
  96. package/dist/lib/access/table/schema.d.ts +43 -0
  97. package/dist/lib/docs.integrations.server.js +23 -1
  98. package/dist/lib/docs.js +33 -2
  99. package/dist/lib/docs.server.js +29 -2
  100. package/dist/lib/documentation-toolkit.js +23 -1
  101. package/dist/lib/effect-ui-adapter/use-model.d.ts +1 -1
  102. package/dist/lib/effect-ui-adapter/use-model.js +19 -11
  103. package/dist/lib/lucide-effect.d.ts +19 -19
  104. package/dist/lib/lucide-effect.js +38 -38
  105. package/dist/services/assets/library.d.ts +221 -0
  106. package/dist/services/assets/schema.d.ts +3 -0
  107. package/dist/services/assets/url.d.ts +12 -0
  108. package/dist/services/assets/use-library.d.ts +20 -0
  109. package/package.json +13 -1
@@ -0,0 +1,73 @@
1
+ import { Schema } from "effect";
2
+ export declare const AssetTableItemSchema: Schema.Struct<{
3
+ readonly id: Schema.NonEmptyString;
4
+ readonly name: Schema.String;
5
+ readonly mimeType: Schema.String;
6
+ readonly byteSize: Schema.Finite;
7
+ readonly createdAt: Schema.Date;
8
+ readonly updatedAt: Schema.Date;
9
+ /** Stable, authorized file URL. Do not pass an expiring signed URL. */
10
+ readonly url: Schema.optionalKey<Schema.String>;
11
+ }>;
12
+ export type AssetTableItem = typeof AssetTableItemSchema.Type;
13
+ export declare const AssetTableMessagesSchema: Schema.$Record<Schema.String, Schema.Struct<{
14
+ readonly id: Schema.optionalKey<Schema.String>;
15
+ readonly name: Schema.optionalKey<Schema.String>;
16
+ readonly type: Schema.optionalKey<Schema.String>;
17
+ readonly size: Schema.optionalKey<Schema.String>;
18
+ readonly created: Schema.optionalKey<Schema.String>;
19
+ readonly updated: Schema.optionalKey<Schema.String>;
20
+ readonly download: Schema.optionalKey<Schema.String>;
21
+ readonly replace: Schema.optionalKey<Schema.String>;
22
+ readonly delete: Schema.optionalKey<Schema.String>;
23
+ readonly deleteSelected: Schema.optionalKey<Schema.String>;
24
+ readonly empty: Schema.optionalKey<Schema.String>;
25
+ readonly loadFailed: Schema.optionalKey<Schema.String>;
26
+ readonly deleteFailed: Schema.optionalKey<Schema.String>;
27
+ readonly title: Schema.optionalKey<Schema.String>;
28
+ readonly copyLink: Schema.optionalKey<Schema.String>;
29
+ readonly linkCopied: Schema.optionalKey<Schema.String>;
30
+ readonly copyLinkUnavailable: Schema.optionalKey<Schema.String>;
31
+ readonly close: Schema.optionalKey<Schema.String>;
32
+ }>>;
33
+ export declare const AssetTablePropsSchema: Schema.Struct<{
34
+ readonly assets: Schema.optionalKey<Schema.$Array<Schema.Struct<{
35
+ readonly id: Schema.NonEmptyString;
36
+ readonly name: Schema.String;
37
+ readonly mimeType: Schema.String;
38
+ readonly byteSize: Schema.Finite;
39
+ readonly createdAt: Schema.Date;
40
+ readonly updatedAt: Schema.Date;
41
+ /** Stable, authorized file URL. Do not pass an expiring signed URL. */
42
+ readonly url: Schema.optionalKey<Schema.String>;
43
+ }>>>;
44
+ readonly access: Schema.optionalKey<Schema.Struct<{
45
+ readonly scopeKey: Schema.NonEmptyString;
46
+ readonly permissions: Schema.$Array<Schema.Literals<readonly ["list", "read", "create", "update", "delete"]>>;
47
+ }>>;
48
+ readonly locale: Schema.optionalKey<Schema.String>;
49
+ readonly timeZone: Schema.optionalKey<Schema.String>;
50
+ readonly messages: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
51
+ readonly id: Schema.optionalKey<Schema.String>;
52
+ readonly name: Schema.optionalKey<Schema.String>;
53
+ readonly type: Schema.optionalKey<Schema.String>;
54
+ readonly size: Schema.optionalKey<Schema.String>;
55
+ readonly created: Schema.optionalKey<Schema.String>;
56
+ readonly updated: Schema.optionalKey<Schema.String>;
57
+ readonly download: Schema.optionalKey<Schema.String>;
58
+ readonly replace: Schema.optionalKey<Schema.String>;
59
+ readonly delete: Schema.optionalKey<Schema.String>;
60
+ readonly deleteSelected: Schema.optionalKey<Schema.String>;
61
+ readonly empty: Schema.optionalKey<Schema.String>;
62
+ readonly loadFailed: Schema.optionalKey<Schema.String>;
63
+ readonly deleteFailed: Schema.optionalKey<Schema.String>;
64
+ readonly title: Schema.optionalKey<Schema.String>;
65
+ readonly copyLink: Schema.optionalKey<Schema.String>;
66
+ readonly linkCopied: Schema.optionalKey<Schema.String>;
67
+ readonly copyLinkUnavailable: Schema.optionalKey<Schema.String>;
68
+ readonly close: Schema.optionalKey<Schema.String>;
69
+ }>>>;
70
+ }>;
71
+ export type AssetTableSharedProps = typeof AssetTablePropsSchema.Type;
72
+ export declare const AssetActionSchema: Schema.Literals<readonly ["download", "copyLink", "replace", "delete"]>;
73
+ export type AssetAction = typeof AssetActionSchema.Type;
@@ -494,6 +494,7 @@ var tableClasses = {
494
494
  actionTrigger: `size-8 ${cellTriggerFocus}`,
495
495
  actionsCell: "sticky right-0 z-20 w-10 min-w-10 cursor-default bg-background p-0 transition-colors group-hover/row:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]",
496
496
  actionsAlign: "flex min-h-12 items-center justify-end pe-1",
497
+ row: "h-16 [&:where(:not(:last-child))>td]:border-b",
497
498
  header: "relative h-12 p-0",
498
499
  stickyHeader: "sticky top-0 z-30 bg-background",
499
500
  stickyHeaderRule: "after:border-border after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:border-b",
@@ -560,6 +561,7 @@ var DataTableItemSchema = Schema4.Struct({
560
561
  value: Schema4.NonEmptyString,
561
562
  label: Schema4.String
562
563
  }).annotate({ identifier: "DataTableItem" });
564
+ var TableIconSchema = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableIcon" });
563
565
  var DataTableReferenceSchema = Schema4.Struct({
564
566
  label: Schema4.String,
565
567
  description: Schema4.optionalKey(Schema4.String),
@@ -599,11 +601,15 @@ var DataTableActionSchema = Schema4.Struct({
599
601
  variant: Schema4.optionalKey(Schema4.Literals(["default", "destructive"])),
600
602
  disabled: Schema4.optionalKey(Schema4.Boolean)
601
603
  }).annotate({ identifier: "DataTableAction" });
604
+ var DataTableRowActionSchema = Schema4.Struct({
605
+ ...DataTableActionSchema.fields,
606
+ icon: Schema4.optionalKey(TableIconSchema)
607
+ }).annotate({ identifier: "DataTableRowAction" });
602
608
  var DataTableRowSchema = Schema4.Struct({
603
609
  id: Schema4.NonEmptyString,
604
610
  label: Schema4.String,
605
611
  cells: Schema4.Record(Schema4.String, DataTableCellValueSchema),
606
- actions: Schema4.optionalKey(Schema4.Array(DataTableActionSchema)),
612
+ actions: Schema4.optionalKey(Schema4.Array(DataTableRowActionSchema)),
607
613
  primaryActionId: Schema4.optionalKey(Schema4.String),
608
614
  groups: Schema4.optionalKey(Schema4.Record(Schema4.String, Schema4.Array(Schema4.String))),
609
615
  selectable: Schema4.optionalKey(Schema4.Boolean),
@@ -638,11 +644,10 @@ var DataTableBadgeOptionSchema = Schema4.Struct({
638
644
  "muted"
639
645
  ]))
640
646
  }).annotate({ identifier: "DataTableBadgeOption" });
641
- var BadgeIcon = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableBadgeIcon" });
642
647
  var DataTableBadgeOptionsSchema = Schema4.Struct({
643
648
  options: Schema4.optionalKey(Schema4.Array(DataTableBadgeOptionSchema.mapFields((fields) => ({
644
649
  ...fields,
645
- icon: Schema4.optionalKey(BadgeIcon)
650
+ icon: Schema4.optionalKey(TableIconSchema)
646
651
  }))))
647
652
  }).annotate({ identifier: "DataTableBadgeOptions" });
648
653
  var DataTableFieldSchema = Schema4.Union([
@@ -657,6 +662,7 @@ var DataTableFieldSchema = Schema4.Union([
657
662
  type: Schema4.Literal("number"),
658
663
  typeOptions: Schema4.optionalKey(Schema4.Struct({
659
664
  locale: Schema4.optionalKey(Schema4.String),
665
+ format: Schema4.optionalKey(Schema4.Literal("bytes")),
660
666
  style: Schema4.optionalKey(Schema4.Literals(["decimal", "percent", "currency", "unit"])),
661
667
  currency: Schema4.optionalKey(Schema4.String),
662
668
  unit: Schema4.optionalKey(Schema4.String),
@@ -666,7 +672,14 @@ var DataTableFieldSchema = Schema4.Union([
666
672
  exportFormat: Schema4.optionalKey(Schema4.Literals(["raw", "formatted"]))
667
673
  }).annotate({ identifier: "DataTableNumberFormat" }))
668
674
  }),
669
- Schema4.Struct({ ...column, type: Schema4.Literal("reference") }),
675
+ Schema4.Struct({
676
+ ...column,
677
+ type: Schema4.Literal("reference"),
678
+ typeOptions: Schema4.optionalKey(Schema4.Struct({
679
+ imageVariant: Schema4.optionalKey(Schema4.Literals(["circle", "square"])),
680
+ fallbackIcons: Schema4.optionalKey(Schema4.Record(Schema4.String, TableIconSchema))
681
+ }).annotate({ identifier: "DataTableReferenceOptions" }))
682
+ }),
670
683
  Schema4.Struct({
671
684
  ...column,
672
685
  type: Schema4.Literal("date"),
@@ -953,9 +966,17 @@ var isTableBoolean = Schema5.is(Schema5.Boolean);
953
966
  var isTableReference = Schema5.is(DataTableReferenceSchema);
954
967
  var isTableList = Schema5.is(Schema5.Array(DataTableItemSchema));
955
968
  var tableInitials = (label) => label.trim().split(/\s+/).slice(0, 2).map((word) => word.slice(0, 1)).join("").toLocaleUpperCase();
969
+ var formatBytes = (bytes, locale) => {
970
+ const [unit, scale] = bytes >= 1024 ** 2 ? ["megabyte", 1024 ** 2] : bytes >= 1024 ? ["kilobyte", 1024] : ["byte", 1];
971
+ return new Intl.NumberFormat(locale, {
972
+ style: "unit",
973
+ unit,
974
+ maximumFractionDigits: 1
975
+ }).format(bytes / scale);
976
+ };
956
977
  var formatNumberValue = (value, options, defaultLocale = "en") => {
957
- const { locale, ...format } = options ?? {};
958
- return new Intl.NumberFormat(locale ?? defaultLocale, format).format(value);
978
+ const { locale, format, ...intlOptions } = options ?? {};
979
+ return format === "bytes" ? formatBytes(value, locale ?? defaultLocale) : new Intl.NumberFormat(locale ?? defaultLocale, intlOptions).format(value);
959
980
  };
960
981
  var tableBooleanLabel = (value, options) => (value ? options?.trueLabel : options?.falseLabel) ?? String(value);
961
982
  var decodeDateInput = Schema5.decodeUnknownOption(DataTableDateInputSchema);
@@ -2094,6 +2115,7 @@ var DataTable = Html2.component({
2094
2115
  filterColumnId,
2095
2116
  childSearch,
2096
2117
  icon,
2118
+ rowIcon,
2097
2119
  separatorBefore
2098
2120
  }) => {
2099
2121
  if (children || filterEditor) {
@@ -2166,7 +2188,7 @@ var DataTable = Html2.component({
2166
2188
  value: id,
2167
2189
  closeOnClick: !searchLabel
2168
2190
  });
2169
- const content = part.children(checked !== undefined && h.span.attr("aria-hidden", "true").class("w-3").children(checked ? "✓" : ""), indicator(icon), name);
2191
+ const content = part.children(rowIcon?.(h, { size: 16, className: "shrink-0" }), checked !== undefined && h.span.attr("aria-hidden", "true").class("w-3").children(checked ? "✓" : ""), indicator(icon), name);
2170
2192
  return separatorBefore ? h.div.children(MenuSeparator(h, menu), content) : content;
2171
2193
  })))));
2172
2194
  }
@@ -2283,12 +2305,18 @@ var DataTable = Html2.component({
2283
2305
  }
2284
2306
  case "boolean":
2285
2307
  return isTableBoolean(value) ? h.label.attr("data-slot", "data-table-boolean-cell").class(cn(booleanCellControl, column.editable && !disabled && "hover:bg-muted/50 cursor-pointer")).children(check(keyOf("edit", row.id, column.id), `${column.headerName}: ${row.label}`, value, (value) => edit(DataTableEdit.SetBoolean({ value })), { readOnly: !column.editable || disabled }, true)) : empty;
2286
- case "reference":
2287
- return isTableReference(value) ? h.div.class(tableClasses.reference).children(h.span.class(cn(tableClasses.referenceAvatar, "rounded-full")).children(h.span.attr("aria-hidden", "true").children(tableInitials(value.label)), value.imageSrc && !model.failedImages.includes(value.imageSrc) && h.img.attrs({
2288
- src: value.imageSrc,
2308
+ case "reference": {
2309
+ if (!isTableReference(value))
2310
+ return empty;
2311
+ const image = value.imageSrc && !model.failedImages.includes(value.imageSrc) ? value.imageSrc : undefined;
2312
+ const fallbackIcons = column.typeOptions?.fallbackIcons;
2313
+ const fallbackIcon = fallbackIcons && Object.hasOwn(fallbackIcons, row.id) ? fallbackIcons[row.id] : undefined;
2314
+ return h.div.class(tableClasses.reference).children(h.span.class(cn(tableClasses.referenceAvatar, column.typeOptions?.imageVariant === "square" ? "rounded-md" : "rounded-full")).children((!image || !fallbackIcon) && h.span.attr("aria-hidden", "true").children(fallbackIcon?.(h, { size: 16 }) ?? tableInitials(value.label)), image && h.img.attrs({
2315
+ src: image,
2289
2316
  alt: "",
2290
2317
  loading: "lazy"
2291
- }).class("absolute inset-0 size-full object-cover").on("error", DataTableMessage.ReferenceImageFailed({ src: value.imageSrc }))), h.div.class(tableClasses.referenceText).children(h.span.class(tableClasses.referenceName).children(value.label), value.description && h.span.class(tableClasses.referenceDescription).children(value.description))) : empty;
2318
+ }).class("absolute inset-0 size-full object-cover").on("error", DataTableMessage.ReferenceImageFailed({ src: image }))), h.div.class(tableClasses.referenceText).children(h.span.class(tableClasses.referenceName).attr("title", value.label).children(value.label), value.description && h.span.class(tableClasses.referenceDescription).children(value.description)));
2319
+ }
2292
2320
  case "list": {
2293
2321
  const current = isTableList(value) ? value : [];
2294
2322
  const visible = current.slice(0, column.visibleCount ?? 3);
@@ -2375,13 +2403,19 @@ var DataTable = Html2.component({
2375
2403
  };
2376
2404
  const dragHandle = (row) => draggable && h.span.attr("aria-hidden", "true").class("inline-flex size-8 cursor-grab items-center justify-center text-muted-foreground").draggable({ [RowDrag]: row.id }, { effectAllowed: "move" }).on("dragstart", DataTableMessage.DragStarted({ rowId: row.id })).on("dragend", DataTableMessage.DragEnded()).children(GripVertical(h, { size: 16 }));
2377
2405
  const rowControls = (row, siblings, key) => {
2378
- const items = tableRowActions(row, siblings, reorder, copy);
2406
+ const items = tableRowActions(row, siblings, reorder, copy).map((item) => {
2407
+ if ("icon" in item) {
2408
+ const { icon, ...action } = item;
2409
+ return { ...action, rowIcon: icon };
2410
+ }
2411
+ return { ...item, icon: undefined };
2412
+ });
2379
2413
  return items.length > 0 && menu(keyOf("row", key, row.id), copy.actions, `${copy.actions}: ${row.label}`, items, false, undefined, false, "actions");
2380
2414
  };
2381
2415
  const renderRow = (row, siblings, key, group) => {
2382
2416
  const primary = row.actions?.find(({ id, disabled }) => id === row.primaryActionId && !disabled);
2383
2417
  const activate = props.rowActivation ? DataTableMessage.RowActivated({ rowId: row.id }) : primary && DataTableMessage.RowActionRequested({ rowId: row.id, actionId: primary.id });
2384
- const tr = h.tr.key(keyOf(key, row.id)).class(cn("group/row hover:bg-muted/50 data-[selected]:bg-muted/40 border-b last:border-0", props.rowActivation && "cursor-pointer")).attr("data-selected", selected.has(row.id) ? "" : undefined);
2418
+ const tr = h.tr.key(keyOf(key, row.id)).class(cn("group/row hover:bg-muted/50 data-[selected]:bg-muted/40", tableClasses.row, props.rowActivation && "cursor-pointer")).attr("data-selected", selected.has(row.id) ? "" : undefined);
2385
2419
  const rowElement = props.rowActivation && activate ? tr.attr("tabindex", "0").on("click", activate).on("keydown", (event) => !event.repeat && !event.composing && (event.key === "Enter" || event.key === " ") ? activate : undefined, { preventDefault: true }) : tr;
2386
2420
  const ignoreActivation = () => {
2387
2421
  return;
@@ -635,6 +635,7 @@ var tableClasses = {
635
635
  actionTrigger: `size-8 ${cellTriggerFocus}`,
636
636
  actionsCell: "sticky right-0 z-20 w-10 min-w-10 cursor-default bg-background p-0 transition-colors group-hover/row:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]",
637
637
  actionsAlign: "flex min-h-12 items-center justify-end pe-1",
638
+ row: "h-16 [&:where(:not(:last-child))>td]:border-b",
638
639
  header: "relative h-12 p-0",
639
640
  stickyHeader: "sticky top-0 z-30 bg-background",
640
641
  stickyHeaderRule: "after:border-border after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:border-b",
@@ -707,6 +708,7 @@ var DataTableItemSchema = Schema4.Struct({
707
708
  value: Schema4.NonEmptyString,
708
709
  label: Schema4.String
709
710
  }).annotate({ identifier: "DataTableItem" });
711
+ var TableIconSchema = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableIcon" });
710
712
  var DataTableReferenceSchema = Schema4.Struct({
711
713
  label: Schema4.String,
712
714
  description: Schema4.optionalKey(Schema4.String),
@@ -746,11 +748,15 @@ var DataTableActionSchema = Schema4.Struct({
746
748
  variant: Schema4.optionalKey(Schema4.Literals(["default", "destructive"])),
747
749
  disabled: Schema4.optionalKey(Schema4.Boolean)
748
750
  }).annotate({ identifier: "DataTableAction" });
751
+ var DataTableRowActionSchema = Schema4.Struct({
752
+ ...DataTableActionSchema.fields,
753
+ icon: Schema4.optionalKey(TableIconSchema)
754
+ }).annotate({ identifier: "DataTableRowAction" });
749
755
  var DataTableRowSchema = Schema4.Struct({
750
756
  id: Schema4.NonEmptyString,
751
757
  label: Schema4.String,
752
758
  cells: Schema4.Record(Schema4.String, DataTableCellValueSchema),
753
- actions: Schema4.optionalKey(Schema4.Array(DataTableActionSchema)),
759
+ actions: Schema4.optionalKey(Schema4.Array(DataTableRowActionSchema)),
754
760
  primaryActionId: Schema4.optionalKey(Schema4.String),
755
761
  groups: Schema4.optionalKey(Schema4.Record(Schema4.String, Schema4.Array(Schema4.String))),
756
762
  selectable: Schema4.optionalKey(Schema4.Boolean),
@@ -785,11 +791,10 @@ var DataTableBadgeOptionSchema = Schema4.Struct({
785
791
  "muted"
786
792
  ]))
787
793
  }).annotate({ identifier: "DataTableBadgeOption" });
788
- var BadgeIcon = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableBadgeIcon" });
789
794
  var DataTableBadgeOptionsSchema = Schema4.Struct({
790
795
  options: Schema4.optionalKey(Schema4.Array(DataTableBadgeOptionSchema.mapFields((fields) => ({
791
796
  ...fields,
792
- icon: Schema4.optionalKey(BadgeIcon)
797
+ icon: Schema4.optionalKey(TableIconSchema)
793
798
  }))))
794
799
  }).annotate({ identifier: "DataTableBadgeOptions" });
795
800
  var DataTableFieldSchema = Schema4.Union([
@@ -804,6 +809,7 @@ var DataTableFieldSchema = Schema4.Union([
804
809
  type: Schema4.Literal("number"),
805
810
  typeOptions: Schema4.optionalKey(Schema4.Struct({
806
811
  locale: Schema4.optionalKey(Schema4.String),
812
+ format: Schema4.optionalKey(Schema4.Literal("bytes")),
807
813
  style: Schema4.optionalKey(Schema4.Literals(["decimal", "percent", "currency", "unit"])),
808
814
  currency: Schema4.optionalKey(Schema4.String),
809
815
  unit: Schema4.optionalKey(Schema4.String),
@@ -813,7 +819,14 @@ var DataTableFieldSchema = Schema4.Union([
813
819
  exportFormat: Schema4.optionalKey(Schema4.Literals(["raw", "formatted"]))
814
820
  }).annotate({ identifier: "DataTableNumberFormat" }))
815
821
  }),
816
- Schema4.Struct({ ...column, type: Schema4.Literal("reference") }),
822
+ Schema4.Struct({
823
+ ...column,
824
+ type: Schema4.Literal("reference"),
825
+ typeOptions: Schema4.optionalKey(Schema4.Struct({
826
+ imageVariant: Schema4.optionalKey(Schema4.Literals(["circle", "square"])),
827
+ fallbackIcons: Schema4.optionalKey(Schema4.Record(Schema4.String, TableIconSchema))
828
+ }).annotate({ identifier: "DataTableReferenceOptions" }))
829
+ }),
817
830
  Schema4.Struct({
818
831
  ...column,
819
832
  type: Schema4.Literal("date"),
@@ -1092,9 +1105,17 @@ var isTableBoolean = Schema5.is(Schema5.Boolean);
1092
1105
  var isTableReference = Schema5.is(DataTableReferenceSchema);
1093
1106
  var isTableList = Schema5.is(Schema5.Array(DataTableItemSchema));
1094
1107
  var tableInitials = (label) => label.trim().split(/\s+/).slice(0, 2).map((word) => word.slice(0, 1)).join("").toLocaleUpperCase();
1108
+ var formatBytes = (bytes, locale) => {
1109
+ const [unit, scale] = bytes >= 1024 ** 2 ? ["megabyte", 1024 ** 2] : bytes >= 1024 ? ["kilobyte", 1024] : ["byte", 1];
1110
+ return new Intl.NumberFormat(locale, {
1111
+ style: "unit",
1112
+ unit,
1113
+ maximumFractionDigits: 1
1114
+ }).format(bytes / scale);
1115
+ };
1095
1116
  var formatNumberValue = (value, options, defaultLocale = "en") => {
1096
- const { locale, ...format } = options ?? {};
1097
- return new Intl.NumberFormat(locale ?? defaultLocale, format).format(value);
1117
+ const { locale, format, ...intlOptions } = options ?? {};
1118
+ return format === "bytes" ? formatBytes(value, locale ?? defaultLocale) : new Intl.NumberFormat(locale ?? defaultLocale, intlOptions).format(value);
1098
1119
  };
1099
1120
  var tableBooleanLabel = (value, options) => (value ? options?.trueLabel : options?.falseLabel) ?? String(value);
1100
1121
  var decodeDateInput = Schema5.decodeUnknownOption(DataTableDateInputSchema);
@@ -2027,6 +2048,7 @@ var DataTableReferenceCell = ({
2027
2048
  if (!item)
2028
2049
  return emptyLabel;
2029
2050
  const initials = tableInitials(item.label);
2051
+ const image = item.imageSrc && item.imageSrc !== failedImage ? item.imageSrc : undefined;
2030
2052
  return /* @__PURE__ */ jsxs3("div", {
2031
2053
  className: tableClasses.reference,
2032
2054
  children: [
@@ -2036,14 +2058,16 @@ var DataTableReferenceCell = ({
2036
2058
  "aria-hidden": "true",
2037
2059
  className: "[&_svg]:size-4",
2038
2060
  children: item.icon
2039
- }) : item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */ jsx3("img", {
2040
- src: item.imageSrc,
2041
- alt: item.label,
2061
+ }) : image ? /* @__PURE__ */ jsx3("img", {
2062
+ src: image,
2063
+ alt: item.fallbackIcon ? "" : item.label,
2064
+ loading: "lazy",
2042
2065
  className: "size-full object-cover",
2043
- onError: () => setFailedImage(item.imageSrc ?? undefined)
2066
+ onError: () => setFailedImage(image)
2044
2067
  }) : /* @__PURE__ */ jsx3("span", {
2045
2068
  "aria-hidden": "true",
2046
- children: initials
2069
+ className: "[&_svg]:size-4",
2070
+ children: item.fallbackIcon ?? initials
2047
2071
  })
2048
2072
  }),
2049
2073
  /* @__PURE__ */ jsxs3("div", {
@@ -3580,7 +3604,7 @@ var TableDataRow = ({
3580
3604
  ref: measureRef,
3581
3605
  "data-index": virtualIndex,
3582
3606
  "aria-rowindex": virtualIndex === undefined ? undefined : virtualIndex + 2,
3583
- className: cn("group/row data-[drop-position=before]:[&>td]:border-primary data-[drop-position=after]:[&>td]:border-primary h-16 data-[drag-source=true]:opacity-40 data-[drop-position=after]:[&>td]:border-b-2 data-[drop-position=before]:[&>td]:border-t-2", store.config.onRowClicked && "cursor-pointer"),
3607
+ className: cn("group/row data-[drop-position=before]:[&>td]:border-primary data-[drop-position=after]:[&>td]:border-primary data-[drag-source=true]:opacity-40 data-[drop-position=after]:[&>td]:border-b-2 data-[drop-position=before]:[&>td]:border-t-2", tableClasses.row, store.config.onRowClicked && "cursor-pointer"),
3584
3608
  "data-state": store.state.rowSelection[row.id] && "selected",
3585
3609
  "data-table-row": row.id,
3586
3610
  onClick: () => store.config.onRowClicked?.(row.data),
@@ -39,10 +39,10 @@ export declare const CopyButton: Component.Component<"CopyButton", {
39
39
  }, {
40
40
  readonly status: "copied" | "failed" | "idle";
41
41
  }, {
42
+ readonly _tag: "Reset";
43
+ } | {
42
44
  readonly _tag: "Finished";
43
45
  readonly success: boolean;
44
46
  } | {
45
47
  readonly _tag: "Pressed";
46
- } | {
47
- readonly _tag: "Reset";
48
48
  }, never, never, Html.Elements, {}, never>;
@@ -26,10 +26,10 @@ export declare const DangerConfirmation: import("effect/ui/Component").Component
26
26
  readonly status: "failed" | "idle" | "pending" | "succeeded";
27
27
  }, {
28
28
  readonly _tag: "Opened";
29
- } | {
30
- readonly _tag: "Confirmed";
31
29
  } | {
32
30
  readonly _tag: "Dismissed";
31
+ } | {
32
+ readonly _tag: "Confirmed";
33
33
  } | {
34
34
  readonly _tag: "Edited";
35
35
  readonly text: string;
@@ -19,6 +19,7 @@ export declare const tableClasses: {
19
19
  readonly actionTrigger: "size-8 focus-visible:ring-0 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring";
20
20
  readonly actionsCell: "sticky right-0 z-20 w-10 min-w-10 cursor-default bg-background p-0 transition-colors group-hover/row:bg-[color-mix(in_oklab,var(--muted)_50%,var(--background))]";
21
21
  readonly actionsAlign: "flex min-h-12 items-center justify-end pe-1";
22
+ readonly row: "h-16 [&:where(:not(:last-child))>td]:border-b";
22
23
  readonly header: "relative h-12 p-0";
23
24
  readonly stickyHeader: "sticky top-0 z-30 bg-background";
24
25
  readonly stickyHeaderRule: "after:border-border after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:border-b";
@@ -51,6 +52,7 @@ export declare const resolveTableClasses: (overrides?: TableClassesOverrides) =>
51
52
  actionTrigger: string;
52
53
  actionsCell: string;
53
54
  actionsAlign: string;
55
+ row: string;
54
56
  header: string;
55
57
  stickyHeader: string;
56
58
  stickyHeaderRule: string;
@@ -25,6 +25,7 @@ export declare const DataTable: Component.Component<"DataTable", {
25
25
  readonly relationshipCell?: string | undefined;
26
26
  readonly relationshipTrigger?: string | undefined;
27
27
  readonly resizeHandle?: string | undefined;
28
+ readonly row?: string | undefined;
28
29
  readonly selectedTrigger?: string | undefined;
29
30
  readonly selectionCell?: string | undefined;
30
31
  readonly selectionCenter?: string | undefined;
@@ -55,6 +56,7 @@ export declare const DataTable: Component.Component<"DataTable", {
55
56
  readonly name: string;
56
57
  readonly variant?: "default" | "destructive" | undefined;
57
58
  readonly disabled?: boolean | undefined;
59
+ readonly icon?: (<Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">) | undefined;
58
60
  }[] | undefined;
59
61
  readonly primaryActionId?: string | undefined;
60
62
  readonly groups?: {
@@ -132,6 +134,7 @@ export declare const DataTable: Component.Component<"DataTable", {
132
134
  readonly type: "number";
133
135
  readonly typeOptions?: {
134
136
  readonly locale?: string | undefined;
137
+ readonly format?: "bytes" | undefined;
135
138
  readonly style?: "currency" | "decimal" | "percent" | "unit" | undefined;
136
139
  readonly currency?: string | undefined;
137
140
  readonly unit?: string | undefined;
@@ -156,6 +159,12 @@ export declare const DataTable: Component.Component<"DataTable", {
156
159
  readonly emptyLabel?: string | undefined;
157
160
  readonly nulls?: "first" | "last" | undefined;
158
161
  readonly type: "reference";
162
+ readonly typeOptions?: {
163
+ readonly imageVariant?: "circle" | "square" | undefined;
164
+ readonly fallbackIcons?: {
165
+ readonly [x: string]: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
166
+ } | undefined;
167
+ } | undefined;
159
168
  } | {
160
169
  readonly id: string;
161
170
  readonly headerName: string;
@@ -278,6 +287,7 @@ export declare const DataTable: Component.Component<"DataTable", {
278
287
  readonly type: "number";
279
288
  readonly typeOptions?: {
280
289
  readonly locale?: string | undefined;
290
+ readonly format?: "bytes" | undefined;
281
291
  readonly style?: "currency" | "decimal" | "percent" | "unit" | undefined;
282
292
  readonly currency?: string | undefined;
283
293
  readonly unit?: string | undefined;
@@ -329,6 +339,7 @@ export declare const DataTable: Component.Component<"DataTable", {
329
339
  readonly type: "number";
330
340
  readonly typeOptions?: {
331
341
  readonly locale?: string | undefined;
342
+ readonly format?: "bytes" | undefined;
332
343
  readonly style?: "currency" | "decimal" | "percent" | "unit" | undefined;
333
344
  readonly currency?: string | undefined;
334
345
  readonly unit?: string | undefined;
@@ -353,6 +364,12 @@ export declare const DataTable: Component.Component<"DataTable", {
353
364
  readonly emptyLabel?: string | undefined;
354
365
  readonly nulls?: "first" | "last" | undefined;
355
366
  readonly type: "reference";
367
+ readonly typeOptions?: {
368
+ readonly imageVariant?: "circle" | "square" | undefined;
369
+ readonly fallbackIcons?: {
370
+ readonly [x: string]: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
371
+ } | undefined;
372
+ } | undefined;
356
373
  } | {
357
374
  readonly id: string;
358
375
  readonly headerName: string;
@@ -473,6 +490,12 @@ export declare const DataTable: Component.Component<"DataTable", {
473
490
  readonly emptyLabel?: string | undefined;
474
491
  readonly nulls?: "first" | "last" | undefined;
475
492
  readonly type: "reference";
493
+ readonly typeOptions?: {
494
+ readonly imageVariant?: "circle" | "square" | undefined;
495
+ readonly fallbackIcons?: {
496
+ readonly [x: string]: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
497
+ } | undefined;
498
+ } | undefined;
476
499
  readonly fields?: readonly ({
477
500
  readonly id: string;
478
501
  readonly headerName: string;
@@ -516,6 +539,7 @@ export declare const DataTable: Component.Component<"DataTable", {
516
539
  readonly type: "number";
517
540
  readonly typeOptions?: {
518
541
  readonly locale?: string | undefined;
542
+ readonly format?: "bytes" | undefined;
519
543
  readonly style?: "currency" | "decimal" | "percent" | "unit" | undefined;
520
544
  readonly currency?: string | undefined;
521
545
  readonly unit?: string | undefined;
@@ -540,6 +564,12 @@ export declare const DataTable: Component.Component<"DataTable", {
540
564
  readonly emptyLabel?: string | undefined;
541
565
  readonly nulls?: "first" | "last" | undefined;
542
566
  readonly type: "reference";
567
+ readonly typeOptions?: {
568
+ readonly imageVariant?: "circle" | "square" | undefined;
569
+ readonly fallbackIcons?: {
570
+ readonly [x: string]: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
571
+ } | undefined;
572
+ } | undefined;
543
573
  } | {
544
574
  readonly id: string;
545
575
  readonly headerName: string;
@@ -709,6 +739,7 @@ export declare const DataTable: Component.Component<"DataTable", {
709
739
  readonly type: "number";
710
740
  readonly typeOptions?: {
711
741
  readonly locale?: string | undefined;
742
+ readonly format?: "bytes" | undefined;
712
743
  readonly style?: "currency" | "decimal" | "percent" | "unit" | undefined;
713
744
  readonly currency?: string | undefined;
714
745
  readonly unit?: string | undefined;
@@ -733,6 +764,12 @@ export declare const DataTable: Component.Component<"DataTable", {
733
764
  readonly emptyLabel?: string | undefined;
734
765
  readonly nulls?: "first" | "last" | undefined;
735
766
  readonly type: "reference";
767
+ readonly typeOptions?: {
768
+ readonly imageVariant?: "circle" | "square" | undefined;
769
+ readonly fallbackIcons?: {
770
+ readonly [x: string]: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
771
+ } | undefined;
772
+ } | undefined;
736
773
  } | {
737
774
  readonly id: string;
738
775
  readonly headerName: string;
@@ -904,6 +941,7 @@ export declare const DataTable: Component.Component<"DataTable", {
904
941
  readonly type: "number";
905
942
  readonly typeOptions?: {
906
943
  readonly locale?: string | undefined;
944
+ readonly format?: "bytes" | undefined;
907
945
  readonly style?: "currency" | "decimal" | "percent" | "unit" | undefined;
908
946
  readonly currency?: string | undefined;
909
947
  readonly unit?: string | undefined;
@@ -928,6 +966,12 @@ export declare const DataTable: Component.Component<"DataTable", {
928
966
  readonly emptyLabel?: string | undefined;
929
967
  readonly nulls?: "first" | "last" | undefined;
930
968
  readonly type: "reference";
969
+ readonly typeOptions?: {
970
+ readonly imageVariant?: "circle" | "square" | undefined;
971
+ readonly fallbackIcons?: {
972
+ readonly [x: string]: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
973
+ } | undefined;
974
+ } | undefined;
931
975
  } | {
932
976
  readonly id: string;
933
977
  readonly headerName: string;
@@ -1097,6 +1141,7 @@ export declare const DataTable: Component.Component<"DataTable", {
1097
1141
  readonly type: "number";
1098
1142
  readonly typeOptions?: {
1099
1143
  readonly locale?: string | undefined;
1144
+ readonly format?: "bytes" | undefined;
1100
1145
  readonly style?: "currency" | "decimal" | "percent" | "unit" | undefined;
1101
1146
  readonly currency?: string | undefined;
1102
1147
  readonly unit?: string | undefined;
@@ -1121,6 +1166,12 @@ export declare const DataTable: Component.Component<"DataTable", {
1121
1166
  readonly emptyLabel?: string | undefined;
1122
1167
  readonly nulls?: "first" | "last" | undefined;
1123
1168
  readonly type: "reference";
1169
+ readonly typeOptions?: {
1170
+ readonly imageVariant?: "circle" | "square" | undefined;
1171
+ readonly fallbackIcons?: {
1172
+ readonly [x: string]: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
1173
+ } | undefined;
1174
+ } | undefined;
1124
1175
  } | {
1125
1176
  readonly id: string;
1126
1177
  readonly headerName: string;
@@ -1303,6 +1354,7 @@ export declare const DataTable: Component.Component<"DataTable", {
1303
1354
  readonly type: "number";
1304
1355
  readonly typeOptions?: {
1305
1356
  readonly locale?: string | undefined;
1357
+ readonly format?: "bytes" | undefined;
1306
1358
  readonly style?: "currency" | "decimal" | "percent" | "unit" | undefined;
1307
1359
  readonly currency?: string | undefined;
1308
1360
  readonly unit?: string | undefined;
@@ -1327,6 +1379,12 @@ export declare const DataTable: Component.Component<"DataTable", {
1327
1379
  readonly emptyLabel?: string | undefined;
1328
1380
  readonly nulls?: "first" | "last" | undefined;
1329
1381
  readonly type: "reference";
1382
+ readonly typeOptions?: {
1383
+ readonly imageVariant?: "circle" | "square" | undefined;
1384
+ readonly fallbackIcons?: {
1385
+ readonly [x: string]: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
1386
+ } | undefined;
1387
+ } | undefined;
1330
1388
  } | {
1331
1389
  readonly id: string;
1332
1390
  readonly headerName: string;