@krak-stack/registry 0.11.6 → 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 (123) hide show
  1. package/CHANGELOG.md +80 -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/classes.d.ts +1 -0
  18. package/dist/components/audit-log-table/html.d.ts +158 -0
  19. package/dist/components/audit-log-table/html.js +3294 -0
  20. package/dist/components/audit-log-table/index.d.ts +37 -0
  21. package/dist/components/audit-log-table/react.d.ts +3 -51
  22. package/dist/components/audit-log-table/react.js +130 -89
  23. package/dist/components/audit-log-table/schema.d.ts +122 -0
  24. package/dist/components/danger-confirmation/html.d.ts +2 -2
  25. package/dist/components/danger-confirmation/index.d.ts +2 -2
  26. package/dist/components/data-table/classes.d.ts +3 -0
  27. package/dist/components/data-table/html.d.ts +70 -12
  28. package/dist/components/data-table/html.js +56 -19
  29. package/dist/components/data-table/index.d.ts +51 -1
  30. package/dist/components/data-table/react.d.ts +1 -0
  31. package/dist/components/data-table/react.js +46 -16
  32. package/dist/components/data-table/schema.d.ts +93 -3
  33. package/dist/components/docs/html.js +22 -4
  34. package/dist/components/docs/react.js +33 -2
  35. package/dist/components/editable-text/html.d.ts +2 -2
  36. package/dist/components/editable-text/index.d.ts +4 -4
  37. package/dist/components/effect-form/react.js +343 -138
  38. package/dist/components/email-editor/legacy-editor.html.d.ts +6 -6
  39. package/dist/components/file-input/classes.d.ts +1 -1
  40. package/dist/components/file-input/file-type.d.ts +1 -0
  41. package/dist/components/file-input/html.d.ts +8 -1
  42. package/dist/components/file-input/html.js +170 -12
  43. package/dist/components/file-input/index.d.ts +1 -0
  44. package/dist/components/file-input/react.d.ts +9 -1
  45. package/dist/components/file-input/react.js +277 -127
  46. package/dist/components/file-input/schema.d.ts +1 -0
  47. package/dist/components/form/react.js +343 -138
  48. package/dist/components/icon-input/html.js +19 -5
  49. package/dist/components/icon-input/react.js +70 -13
  50. package/dist/components/map-menu/html.d.ts +6 -0
  51. package/dist/components/map-menu/html.js +13 -8
  52. package/dist/components/map-menu/index.d.ts +5 -4
  53. package/dist/components/map-menu/react.d.ts +28 -17
  54. package/dist/components/map-menu/react.js +84 -178
  55. package/dist/components/map-menu/schema.d.ts +6 -0
  56. package/dist/components/map-menu/shared.d.ts +4 -0
  57. package/dist/components/permissions-input/classes.d.ts +8 -0
  58. package/dist/components/permissions-input/html.d.ts +41 -0
  59. package/dist/components/permissions-input/html.js +130 -0
  60. package/dist/components/permissions-input/index.d.ts +80 -0
  61. package/dist/components/permissions-input/react.d.ts +7 -0
  62. package/dist/components/permissions-input/react.js +201 -0
  63. package/dist/components/permissions-input/schema.d.ts +33 -0
  64. package/dist/components/phone-number-input/html.js +48 -14
  65. package/dist/components/phone-number-input/react.js +67 -10
  66. package/dist/components/search-menu/html.d.ts +2 -2
  67. package/dist/components/select-with-custom-input/html.d.ts +2 -2
  68. package/dist/components/sidebar-layout/html.d.ts +3 -2
  69. package/dist/components/sidebar-layout/html.js +20 -2
  70. package/dist/components/sidebar-layout/index.d.ts +1 -0
  71. package/dist/components/sidebar-layout/react.js +33 -2
  72. package/dist/components/switch/react.d.ts +14 -0
  73. package/dist/components/switch/react.js +55 -0
  74. package/dist/components/theme-switcher/html.d.ts +2 -2
  75. package/dist/components/time-input/html.d.ts +2 -2
  76. package/dist/components/timezone-input/html.js +48 -14
  77. package/dist/components/timezone-input/react.js +67 -10
  78. package/dist/components/tracking-notice/classes.d.ts +6 -0
  79. package/dist/components/tracking-notice/html.d.ts +85 -0
  80. package/dist/components/tracking-notice/html.js +354 -0
  81. package/dist/components/tracking-notice/index.d.ts +95 -0
  82. package/dist/components/tracking-notice/react.d.ts +5 -27
  83. package/dist/components/tracking-notice/react.js +189 -59
  84. package/dist/components/tracking-notice/schema.d.ts +45 -0
  85. package/dist/components/upload-attachment/classes.d.ts +3 -2
  86. package/dist/components/upload-attachment/html.d.ts +5 -5
  87. package/dist/components/upload-attachment/html.js +7 -5
  88. package/dist/components/upload-attachment/react.d.ts +3 -1
  89. package/dist/components/upload-attachment/react.js +25 -17
  90. package/dist/components/virtualized-combobox/classes.d.ts +12 -0
  91. package/dist/components/virtualized-combobox/html.d.ts +42 -0
  92. package/dist/components/virtualized-combobox/html.js +48 -14
  93. package/dist/components/virtualized-combobox/index.d.ts +55 -4
  94. package/dist/components/virtualized-combobox/react.d.ts +6 -2
  95. package/dist/components/virtualized-combobox/react.js +67 -10
  96. package/dist/components/virtualized-combobox/schema.d.ts +60 -4
  97. package/dist/components/webhook-delivery-table/html.js +56 -19
  98. package/dist/components/webhook-delivery-table/react.js +46 -16
  99. package/dist/lib/access/index.d.ts +61 -0
  100. package/dist/lib/access/index.js +92 -0
  101. package/dist/lib/access/table/classes.d.ts +13 -0
  102. package/dist/lib/access/table/html.d.ts +39 -0
  103. package/dist/lib/access/table/html.js +157 -0
  104. package/dist/lib/access/table/index.d.ts +32 -0
  105. package/dist/lib/access/table/react.d.ts +3 -0
  106. package/dist/lib/access/table/react.js +195 -0
  107. package/dist/lib/access/table/schema.d.ts +43 -0
  108. package/dist/lib/docs.integrations.server.js +23 -1
  109. package/dist/lib/docs.js +33 -2
  110. package/dist/lib/docs.server.js +29 -2
  111. package/dist/lib/documentation-toolkit.js +23 -1
  112. package/dist/lib/effect-ui-adapter/use-model.d.ts +1 -1
  113. package/dist/lib/effect-ui-adapter/use-model.js +19 -11
  114. package/dist/lib/lucide-effect.d.ts +19 -19
  115. package/dist/lib/lucide-effect.js +38 -38
  116. package/dist/services/assets/library.d.ts +221 -0
  117. package/dist/services/assets/schema.d.ts +3 -0
  118. package/dist/services/assets/url.d.ts +12 -0
  119. package/dist/services/assets/use-library.d.ts +20 -0
  120. package/dist/services/events/browser.js +39 -26
  121. package/dist/services/events/index.js +23 -19
  122. package/dist/services/opentelemetry/web-vitals.js +27 -23
  123. package/package.json +21 -1
@@ -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";
@@ -36,6 +37,7 @@ export declare const tableClasses: {
36
37
  readonly referenceName: "truncate font-medium";
37
38
  readonly referenceDescription: "text-muted-foreground truncate text-xs";
38
39
  };
40
+ export declare const tableResultsFooterClass = "bg-background text-muted-foreground sticky bottom-0 z-30 shrink-0 border-t px-2 py-2 text-sm";
39
41
  export declare const resolveTableClasses: (overrides?: TableClassesOverrides) => {
40
42
  selectionCell: string;
41
43
  selectionCenter: string;
@@ -50,6 +52,7 @@ export declare const resolveTableClasses: (overrides?: TableClassesOverrides) =>
50
52
  actionTrigger: string;
51
53
  actionsCell: string;
52
54
  actionsAlign: string;
55
+ row: string;
53
56
  header: string;
54
57
  stickyHeader: string;
55
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;
@@ -1711,6 +1769,18 @@ export declare const DataTable: Component.Component<"DataTable", {
1711
1769
  } | null;
1712
1770
  readonly invalidFilter: boolean;
1713
1771
  }, {
1772
+ readonly _tag: "PreferencesLoaded";
1773
+ readonly preferences: {
1774
+ readonly columnVisibility: {
1775
+ readonly [x: string]: boolean;
1776
+ };
1777
+ readonly columnSizing: {
1778
+ readonly [x: string]: number;
1779
+ };
1780
+ readonly grouping?: readonly string[] | undefined;
1781
+ readonly view: "gallery" | "table";
1782
+ } | null;
1783
+ } | {
1714
1784
  readonly _tag: "BuiltInExportRequested";
1715
1785
  readonly format: "csv" | "json";
1716
1786
  readonly locale?: string | undefined;
@@ -1850,18 +1920,6 @@ export declare const DataTable: Component.Component<"DataTable", {
1850
1920
  } | {
1851
1921
  readonly _tag: "PageSizeRequested";
1852
1922
  readonly pageSize: number;
1853
- } | {
1854
- readonly _tag: "PreferencesLoaded";
1855
- readonly preferences: {
1856
- readonly columnVisibility: {
1857
- readonly [x: string]: boolean;
1858
- };
1859
- readonly columnSizing: {
1860
- readonly [x: string]: number;
1861
- };
1862
- readonly grouping?: readonly string[] | undefined;
1863
- readonly view: "gallery" | "table";
1864
- } | null;
1865
1923
  } | {
1866
1924
  readonly _tag: "ReferenceImageFailed";
1867
1925
  readonly src: string;
@@ -489,6 +489,7 @@ var tableClasses = {
489
489
  actionTrigger: `size-8 ${cellTriggerFocus}`,
490
490
  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))]",
491
491
  actionsAlign: "flex min-h-12 items-center justify-end pe-1",
492
+ row: "h-16 [&:where(:not(:last-child))>td]:border-b",
492
493
  header: "relative h-12 p-0",
493
494
  stickyHeader: "sticky top-0 z-30 bg-background",
494
495
  stickyHeaderRule: "after:border-border after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:border-b",
@@ -506,6 +507,7 @@ var tableClasses = {
506
507
  referenceName: "truncate font-medium",
507
508
  referenceDescription: "text-muted-foreground truncate text-xs"
508
509
  };
510
+ var tableResultsFooterClass = "bg-background text-muted-foreground sticky bottom-0 z-30 shrink-0 border-t px-2 py-2 text-sm";
509
511
  var resolveTableClasses = (overrides) => ({
510
512
  ...tableClasses,
511
513
  ...overrides
@@ -554,6 +556,7 @@ var DataTableItemSchema = Schema4.Struct({
554
556
  value: Schema4.NonEmptyString,
555
557
  label: Schema4.String
556
558
  }).annotate({ identifier: "DataTableItem" });
559
+ var TableIconSchema = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableIcon" });
557
560
  var DataTableReferenceSchema = Schema4.Struct({
558
561
  label: Schema4.String,
559
562
  description: Schema4.optionalKey(Schema4.String),
@@ -593,11 +596,15 @@ var DataTableActionSchema = Schema4.Struct({
593
596
  variant: Schema4.optionalKey(Schema4.Literals(["default", "destructive"])),
594
597
  disabled: Schema4.optionalKey(Schema4.Boolean)
595
598
  }).annotate({ identifier: "DataTableAction" });
599
+ var DataTableRowActionSchema = Schema4.Struct({
600
+ ...DataTableActionSchema.fields,
601
+ icon: Schema4.optionalKey(TableIconSchema)
602
+ }).annotate({ identifier: "DataTableRowAction" });
596
603
  var DataTableRowSchema = Schema4.Struct({
597
604
  id: Schema4.NonEmptyString,
598
605
  label: Schema4.String,
599
606
  cells: Schema4.Record(Schema4.String, DataTableCellValueSchema),
600
- actions: Schema4.optionalKey(Schema4.Array(DataTableActionSchema)),
607
+ actions: Schema4.optionalKey(Schema4.Array(DataTableRowActionSchema)),
601
608
  primaryActionId: Schema4.optionalKey(Schema4.String),
602
609
  groups: Schema4.optionalKey(Schema4.Record(Schema4.String, Schema4.Array(Schema4.String))),
603
610
  selectable: Schema4.optionalKey(Schema4.Boolean),
@@ -632,11 +639,10 @@ var DataTableBadgeOptionSchema = Schema4.Struct({
632
639
  "muted"
633
640
  ]))
634
641
  }).annotate({ identifier: "DataTableBadgeOption" });
635
- var BadgeIcon = Schema4.declare((value) => Predicate.isFunction(value)).annotate({ identifier: "DataTableBadgeIcon" });
636
642
  var DataTableBadgeOptionsSchema = Schema4.Struct({
637
643
  options: Schema4.optionalKey(Schema4.Array(DataTableBadgeOptionSchema.mapFields((fields) => ({
638
644
  ...fields,
639
- icon: Schema4.optionalKey(BadgeIcon)
645
+ icon: Schema4.optionalKey(TableIconSchema)
640
646
  }))))
641
647
  }).annotate({ identifier: "DataTableBadgeOptions" });
642
648
  var DataTableFieldSchema = Schema4.Union([
@@ -651,6 +657,7 @@ var DataTableFieldSchema = Schema4.Union([
651
657
  type: Schema4.Literal("number"),
652
658
  typeOptions: Schema4.optionalKey(Schema4.Struct({
653
659
  locale: Schema4.optionalKey(Schema4.String),
660
+ format: Schema4.optionalKey(Schema4.Literal("bytes")),
654
661
  style: Schema4.optionalKey(Schema4.Literals(["decimal", "percent", "currency", "unit"])),
655
662
  currency: Schema4.optionalKey(Schema4.String),
656
663
  unit: Schema4.optionalKey(Schema4.String),
@@ -660,7 +667,14 @@ var DataTableFieldSchema = Schema4.Union([
660
667
  exportFormat: Schema4.optionalKey(Schema4.Literals(["raw", "formatted"]))
661
668
  }).annotate({ identifier: "DataTableNumberFormat" }))
662
669
  }),
663
- Schema4.Struct({ ...column, type: Schema4.Literal("reference") }),
670
+ Schema4.Struct({
671
+ ...column,
672
+ type: Schema4.Literal("reference"),
673
+ typeOptions: Schema4.optionalKey(Schema4.Struct({
674
+ imageVariant: Schema4.optionalKey(Schema4.Literals(["circle", "square"])),
675
+ fallbackIcons: Schema4.optionalKey(Schema4.Record(Schema4.String, TableIconSchema))
676
+ }).annotate({ identifier: "DataTableReferenceOptions" }))
677
+ }),
664
678
  Schema4.Struct({
665
679
  ...column,
666
680
  type: Schema4.Literal("date"),
@@ -947,9 +961,17 @@ var isTableBoolean = Schema5.is(Schema5.Boolean);
947
961
  var isTableReference = Schema5.is(DataTableReferenceSchema);
948
962
  var isTableList = Schema5.is(Schema5.Array(DataTableItemSchema));
949
963
  var tableInitials = (label) => label.trim().split(/\s+/).slice(0, 2).map((word) => word.slice(0, 1)).join("").toLocaleUpperCase();
964
+ var formatBytes = (bytes, locale) => {
965
+ const [unit, scale] = bytes >= 1024 ** 2 ? ["megabyte", 1024 ** 2] : bytes >= 1024 ? ["kilobyte", 1024] : ["byte", 1];
966
+ return new Intl.NumberFormat(locale, {
967
+ style: "unit",
968
+ unit,
969
+ maximumFractionDigits: 1
970
+ }).format(bytes / scale);
971
+ };
950
972
  var formatNumberValue = (value, options, defaultLocale = "en") => {
951
- const { locale, ...format } = options ?? {};
952
- return new Intl.NumberFormat(locale ?? defaultLocale, format).format(value);
973
+ const { locale, format, ...intlOptions } = options ?? {};
974
+ return format === "bytes" ? formatBytes(value, locale ?? defaultLocale) : new Intl.NumberFormat(locale ?? defaultLocale, intlOptions).format(value);
953
975
  };
954
976
  var tableBooleanLabel = (value, options) => (value ? options?.trueLabel : options?.falseLabel) ?? String(value);
955
977
  var decodeDateInput = Schema5.decodeUnknownOption(DataTableDateInputSchema);
@@ -1997,7 +2019,9 @@ var DataTable = Html2.component({
1997
2019
  const dropOnRow = (rowId, group) => group ? DataTableMessage.GroupDropped(group) : reorder ? DataTableMessage.DragDropped({ targetId: rowId }) : undefined;
1998
2020
  const rowActions = reorder || props.rowData.some(({ actions }) => actions?.length);
1999
2021
  const span = Math.max(1, columns.length + Number(!!selection) + Number(rowActions) + Number(draggable));
2000
- const virtual = tableVirtualization(rows.length, features.virtualization, !grouping.length && !gallery && !features.reordering && props.status?.error === undefined && rows.length > 0);
2022
+ const virtualization = features.virtualization;
2023
+ const fillHeight = virtualization && virtualization !== true && virtualization.scroll === "internal";
2024
+ const virtual = tableVirtualization(rows.length, virtualization, !grouping.length && !gallery && !features.reordering && props.status?.error === undefined && rows.length > 0);
2001
2025
  const ids = rows.filter(({ selectable }) => selectable !== false).map(({ id }) => id);
2002
2026
  const selectedHere = ids.filter((id) => selected.has(id)).length;
2003
2027
  const status = props.status;
@@ -2086,6 +2110,7 @@ var DataTable = Html2.component({
2086
2110
  filterColumnId,
2087
2111
  childSearch,
2088
2112
  icon,
2113
+ rowIcon,
2089
2114
  separatorBefore
2090
2115
  }) => {
2091
2116
  if (children || filterEditor) {
@@ -2158,7 +2183,7 @@ var DataTable = Html2.component({
2158
2183
  value: id,
2159
2184
  closeOnClick: !searchLabel
2160
2185
  });
2161
- const content = part.children(checked !== undefined && h.span.attr("aria-hidden", "true").class("w-3").children(checked ? "✓" : ""), indicator(icon), name);
2186
+ 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);
2162
2187
  return separatorBefore ? h.div.children(MenuSeparator(h, menu), content) : content;
2163
2188
  })))));
2164
2189
  }
@@ -2275,12 +2300,18 @@ var DataTable = Html2.component({
2275
2300
  }
2276
2301
  case "boolean":
2277
2302
  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;
2278
- case "reference":
2279
- 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({
2280
- src: value.imageSrc,
2303
+ case "reference": {
2304
+ if (!isTableReference(value))
2305
+ return empty;
2306
+ const image = value.imageSrc && !model.failedImages.includes(value.imageSrc) ? value.imageSrc : undefined;
2307
+ const fallbackIcons = column.typeOptions?.fallbackIcons;
2308
+ const fallbackIcon = fallbackIcons && Object.hasOwn(fallbackIcons, row.id) ? fallbackIcons[row.id] : undefined;
2309
+ 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({
2310
+ src: image,
2281
2311
  alt: "",
2282
2312
  loading: "lazy"
2283
- }).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;
2313
+ }).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)));
2314
+ }
2284
2315
  case "list": {
2285
2316
  const current = isTableList(value) ? value : [];
2286
2317
  const visible = current.slice(0, column.visibleCount ?? 3);
@@ -2367,13 +2398,19 @@ var DataTable = Html2.component({
2367
2398
  };
2368
2399
  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 }));
2369
2400
  const rowControls = (row, siblings, key) => {
2370
- const items = tableRowActions(row, siblings, reorder, copy);
2401
+ const items = tableRowActions(row, siblings, reorder, copy).map((item) => {
2402
+ if ("icon" in item) {
2403
+ const { icon, ...action } = item;
2404
+ return { ...action, rowIcon: icon };
2405
+ }
2406
+ return { ...item, icon: undefined };
2407
+ });
2371
2408
  return items.length > 0 && menu(keyOf("row", key, row.id), copy.actions, `${copy.actions}: ${row.label}`, items, false, undefined, false, "actions");
2372
2409
  };
2373
2410
  const renderRow = (row, siblings, key, group) => {
2374
2411
  const primary = row.actions?.find(({ id, disabled }) => id === row.primaryActionId && !disabled);
2375
2412
  const activate = props.rowActivation ? DataTableMessage.RowActivated({ rowId: row.id }) : primary && DataTableMessage.RowActionRequested({ rowId: row.id, actionId: primary.id });
2376
- 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);
2413
+ 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);
2377
2414
  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;
2378
2415
  const ignoreActivation = () => {
2379
2416
  return;
@@ -2448,7 +2485,7 @@ var DataTable = Html2.component({
2448
2485
  ];
2449
2486
  });
2450
2487
  };
2451
- return h.section.class(cn("grid min-w-0 gap-2", props.className)).onMount(PersistPreferences({
2488
+ return h.section.class(cn("min-w-0 gap-2", fillHeight ? "flex min-h-0 flex-1 flex-col" : "grid", props.className)).onMount(PersistPreferences({
2452
2489
  columns: props.columnDefs.map(({ id }) => id),
2453
2490
  gallery: !!features.gallery,
2454
2491
  preferences: tablePreferences(model)
@@ -2682,7 +2719,7 @@ var DataTable = Html2.component({
2682
2719
  ] : [];
2683
2720
  }) : renderGroups(rows, 0, "")));
2684
2721
  };
2685
- const viewport = () => h.div.class("@container overflow-auto");
2722
+ const viewport = () => h.div.class(cn("@container overflow-auto", fillHeight && "min-h-0 flex-1"));
2686
2723
  if (!virtual)
2687
2724
  return viewport().children(renderTable());
2688
2725
  return VirtualList(h, {
@@ -2694,11 +2731,11 @@ var DataTable = Html2.component({
2694
2731
  overscan: virtual.overscan,
2695
2732
  initialCount: virtual.initialCount
2696
2733
  },
2697
- view: (list) => virtual.scroll === "page" ? h.div.children(renderTable(list)) : list.viewport(viewport().style({
2734
+ view: (list) => virtual.scroll === "page" ? h.div.children(renderTable(list)) : list.viewport(fillHeight ? viewport() : viewport().style({
2698
2735
  maxHeight: `${virtual.height}px`
2699
2736
  })).children(renderTable(list))
2700
2737
  });
2701
- })(), paginationVisible && Pagination(h, {
2738
+ })(), paginationVisible ? Pagination(h, {
2702
2739
  props: {
2703
2740
  locale,
2704
2741
  page,
@@ -2712,7 +2749,7 @@ var DataTable = Html2.component({
2712
2749
  PageChanged: ({ page }) => DataTableMessage.PageRequested({ page }),
2713
2750
  PageSizeChanged: ({ pageSize }) => DataTableMessage.PageSizeRequested({ pageSize })
2714
2751
  }
2715
- }));
2752
+ }) : h.div.attr("role", "status").class(tableResultsFooterClass).children(paginationMessages(locale).results(totalRows)));
2716
2753
  }
2717
2754
  });
2718
2755
  export {