@lunora/studio 0.0.0 → 1.0.0-alpha.2

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 (81) hide show
  1. package/LICENSE.md +105 -0
  2. package/README.md +123 -9
  3. package/__assets__/package-og.svg +14 -0
  4. package/dist/index.d.ts +1402 -0
  5. package/dist/index.js +41 -0
  6. package/dist/mount.d.ts +21 -0
  7. package/dist/mount.js +26 -0
  8. package/dist/packem_shared/ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js +45 -0
  9. package/dist/packem_shared/ApiDocsPanel-DpRjJhG5.js +842 -0
  10. package/dist/packem_shared/ApiReferencePanel-DMIUp-kK.js +229 -0
  11. package/dist/packem_shared/ApiTab-DURGU15e.js +251 -0
  12. package/dist/packem_shared/AuditPanel-BC59Nhst.js +212 -0
  13. package/dist/packem_shared/CommandPalette-Dx_CoB9i.js +373 -0
  14. package/dist/packem_shared/ConfirmButton-WQVUoGFb.js +59 -0
  15. package/dist/packem_shared/ConnectionBadge-Bxagrip8.js +111 -0
  16. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +50 -0
  17. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +89 -0
  18. package/dist/packem_shared/DataBrowser-Coz6jJE6.js +4542 -0
  19. package/dist/packem_shared/DataFilters-FNquMaiu.js +249 -0
  20. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +66 -0
  21. package/dist/packem_shared/ExportImportPanel-WO34fJxy.js +193 -0
  22. package/dist/packem_shared/FileBrowser-Zcr-Qgxo.js +2932 -0
  23. package/dist/packem_shared/FunctionRunner-j0Rd5m9t.js +343 -0
  24. package/dist/packem_shared/FunctionStatsPanel-DboBl-XL.js +432 -0
  25. package/dist/packem_shared/GlobalDataBrowser-9MhPEfgN.js +318 -0
  26. package/dist/packem_shared/HealthPanel-DOIgbUtx.js +640 -0
  27. package/dist/packem_shared/HomePanel-bdOCNA-p.js +1273 -0
  28. package/dist/packem_shared/InsightsPanel-DaZPnSgt.js +423 -0
  29. package/dist/packem_shared/LogsPanel-CWdqAGpQ.js +839 -0
  30. package/dist/packem_shared/MailPanel-D_EGtDnS.js +447 -0
  31. package/dist/packem_shared/MetricsPanel-E4Gv6wTO.js +1625 -0
  32. package/dist/packem_shared/MigrationsPanel-DQdPY9io.js +246 -0
  33. package/dist/packem_shared/OpenRpcReferencePanel-j2p3HB0s.js +191 -0
  34. package/dist/packem_shared/PitrPanel-BbBkQR6t.js +252 -0
  35. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +3 -0
  36. package/dist/packem_shared/ScheduledJobs-Ok1CYYwI.js +159 -0
  37. package/dist/packem_shared/SchemaViewer-D8XGnp-X.js +2512 -0
  38. package/dist/packem_shared/SecurityAdvisorPanel-Cdm2IxLW.js +79 -0
  39. package/dist/packem_shared/SettingsPanel-D3WF2mBU.js +176 -0
  40. package/dist/packem_shared/ShardInput-DNCsT1KW.js +107 -0
  41. package/dist/packem_shared/SqlEditorPanel-BuQ7f2Hs.js +13 -0
  42. package/dist/packem_shared/Studio-D36od9Oz.js +33 -0
  43. package/dist/packem_shared/StudioApp-dvywkJ8I.js +383 -0
  44. package/dist/packem_shared/StudioI18nProvider-Dcajsznk.js +48 -0
  45. package/dist/packem_shared/TableEditor-DIVDk3vT.js +371 -0
  46. package/dist/packem_shared/advisor-view-DBlzJi6C.js +159 -0
  47. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +108 -0
  48. package/dist/packem_shared/app.d-CCmwDEVs.d.ts +300 -0
  49. package/dist/packem_shared/badge-B2PKA1-5.js +49 -0
  50. package/dist/packem_shared/bar-chart-CzJAgqkp.js +3245 -0
  51. package/dist/packem_shared/button-BhsN2uZH.js +49 -0
  52. package/dist/packem_shared/card-DURq3ElK.js +175 -0
  53. package/dist/packem_shared/cf-links-BZfRdxSE.js +8 -0
  54. package/dist/packem_shared/checkbox-UNkzAxl-.js +63 -0
  55. package/dist/packem_shared/createStudioI18n-CgvlmDkN.js +27 -0
  56. package/dist/packem_shared/data-grid-CCh2Couo.js +183 -0
  57. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +280 -0
  58. package/dist/packem_shared/empty-state-DY_oe0k6.js +98 -0
  59. package/dist/packem_shared/grid-features-DTjG6Sex.js +840 -0
  60. package/dist/packem_shared/input-XH4r1Pt1.js +53 -0
  61. package/dist/packem_shared/internal-BBZYexre.js +68 -0
  62. package/dist/packem_shared/label-D8ykjn5J.js +46 -0
  63. package/dist/packem_shared/live-status-bPff1O7Y.js +44 -0
  64. package/dist/packem_shared/reference-view-BCKIoai7.js +2180 -0
  65. package/dist/packem_shared/shard-history-DyebH1R5.js +38 -0
  66. package/dist/packem_shared/sparkline-10dG-_f0.js +93 -0
  67. package/dist/packem_shared/sql-editor-panel-CW2y2x9h.js +2562 -0
  68. package/dist/packem_shared/storage-tier-CL98eOvn.js +85 -0
  69. package/dist/packem_shared/studio-BDVd7rIV.js +10303 -0
  70. package/dist/packem_shared/table-_RzNvy3R.js +246 -0
  71. package/dist/packem_shared/table-list-sidebar-aZHLq70w.js +832 -0
  72. package/dist/packem_shared/textarea-D3gaCU_-.js +46 -0
  73. package/dist/packem_shared/use-live-admin-D1h1Fzsd.js +73 -0
  74. package/dist/packem_shared/use-live-shard-seed-B74RYcOy.js +76 -0
  75. package/dist/packem_shared/useDebounced-Dxncpg6z.js +32 -0
  76. package/dist/packem_shared/utils-B05Dmz_H.js +8 -0
  77. package/dist/packem_shared/virtual-rect-CVMUskSm.js +10 -0
  78. package/dist/standalone/studio.js +356 -0
  79. package/dist/styles.css +2 -0
  80. package/package.json +77 -17
  81. package/src/theme.css +59 -0
@@ -0,0 +1,49 @@
1
+ import { Button as Button$1 } from '@base-ui/react/button';
2
+ import { cva } from 'class-variance-authority';
3
+ import { c as cn } from './utils-B05Dmz_H.js';
4
+ import { jsxDEV } from 'react/jsx-dev-runtime';
5
+
6
+ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
7
+ variants: {
8
+ variant: {
9
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
10
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
11
+ secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
12
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
13
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
14
+ link: "text-primary underline-offset-4 hover:underline"
15
+ },
16
+ size: {
17
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",
18
+ xs: "h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",
19
+ sm: "h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",
20
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",
21
+ icon: "size-8",
22
+ "icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
23
+ "icon-sm": "size-7 rounded-md",
24
+ "icon-lg": "size-9"
25
+ }
26
+ },
27
+ defaultVariants: {
28
+ variant: "default",
29
+ size: "default"
30
+ }
31
+ });
32
+ function Button({
33
+ className,
34
+ variant = "default",
35
+ size = "default",
36
+ ...props
37
+ }) {
38
+ return /* @__PURE__ */ jsxDEV(Button$1, {
39
+ "data-slot": "button",
40
+ className: cn(buttonVariants({
41
+ variant,
42
+ size,
43
+ className
44
+ })),
45
+ ...props
46
+ }, void 0, false);
47
+ }
48
+
49
+ export { Button as B };
@@ -0,0 +1,175 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import 'react';
3
+ import { c as cn } from './utils-B05Dmz_H.js';
4
+ import { jsxDEV } from 'react/jsx-dev-runtime';
5
+
6
+ function Card({
7
+ className,
8
+ size = "default",
9
+ ...props
10
+ }) {
11
+ return /* @__PURE__ */ jsxDEV("div", {
12
+ "data-slot": "card",
13
+ "data-size": size,
14
+ className: cn("group/card flex flex-col gap-4 overflow-hidden rounded-xl border border-border bg-card py-4 text-xs/relaxed text-card-foreground shadow-xs has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-2 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-md *:[img:last-child]:rounded-md", className),
15
+ ...props
16
+ }, void 0, false);
17
+ }
18
+ function CardHeader(t0) {
19
+ const $ = c(8);
20
+ let className;
21
+ let props;
22
+ if ($[0] !== t0) {
23
+ ({
24
+ className,
25
+ ...props
26
+ } = t0);
27
+ $[0] = t0;
28
+ $[1] = className;
29
+ $[2] = props;
30
+ } else {
31
+ className = $[1];
32
+ props = $[2];
33
+ }
34
+ let t1;
35
+ if ($[3] !== className) {
36
+ t1 = cn("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-md px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3", className);
37
+ $[3] = className;
38
+ $[4] = t1;
39
+ } else {
40
+ t1 = $[4];
41
+ }
42
+ let t2;
43
+ if ($[5] !== props || $[6] !== t1) {
44
+ t2 = /* @__PURE__ */ jsxDEV("div", {
45
+ "data-slot": "card-header",
46
+ className: t1,
47
+ ...props
48
+ }, void 0, false);
49
+ $[5] = props;
50
+ $[6] = t1;
51
+ $[7] = t2;
52
+ } else {
53
+ t2 = $[7];
54
+ }
55
+ return t2;
56
+ }
57
+ function CardTitle(t0) {
58
+ const $ = c(8);
59
+ let className;
60
+ let props;
61
+ if ($[0] !== t0) {
62
+ ({
63
+ className,
64
+ ...props
65
+ } = t0);
66
+ $[0] = t0;
67
+ $[1] = className;
68
+ $[2] = props;
69
+ } else {
70
+ className = $[1];
71
+ props = $[2];
72
+ }
73
+ let t1;
74
+ if ($[3] !== className) {
75
+ t1 = cn("font-heading text-sm font-medium group-data-[size=sm]/card:text-sm", className);
76
+ $[3] = className;
77
+ $[4] = t1;
78
+ } else {
79
+ t1 = $[4];
80
+ }
81
+ let t2;
82
+ if ($[5] !== props || $[6] !== t1) {
83
+ t2 = /* @__PURE__ */ jsxDEV("div", {
84
+ "data-slot": "card-title",
85
+ className: t1,
86
+ ...props
87
+ }, void 0, false);
88
+ $[5] = props;
89
+ $[6] = t1;
90
+ $[7] = t2;
91
+ } else {
92
+ t2 = $[7];
93
+ }
94
+ return t2;
95
+ }
96
+ function CardDescription(t0) {
97
+ const $ = c(8);
98
+ let className;
99
+ let props;
100
+ if ($[0] !== t0) {
101
+ ({
102
+ className,
103
+ ...props
104
+ } = t0);
105
+ $[0] = t0;
106
+ $[1] = className;
107
+ $[2] = props;
108
+ } else {
109
+ className = $[1];
110
+ props = $[2];
111
+ }
112
+ let t1;
113
+ if ($[3] !== className) {
114
+ t1 = cn("text-xs/relaxed text-muted-foreground", className);
115
+ $[3] = className;
116
+ $[4] = t1;
117
+ } else {
118
+ t1 = $[4];
119
+ }
120
+ let t2;
121
+ if ($[5] !== props || $[6] !== t1) {
122
+ t2 = /* @__PURE__ */ jsxDEV("div", {
123
+ "data-slot": "card-description",
124
+ className: t1,
125
+ ...props
126
+ }, void 0, false);
127
+ $[5] = props;
128
+ $[6] = t1;
129
+ $[7] = t2;
130
+ } else {
131
+ t2 = $[7];
132
+ }
133
+ return t2;
134
+ }
135
+ function CardContent(t0) {
136
+ const $ = c(8);
137
+ let className;
138
+ let props;
139
+ if ($[0] !== t0) {
140
+ ({
141
+ className,
142
+ ...props
143
+ } = t0);
144
+ $[0] = t0;
145
+ $[1] = className;
146
+ $[2] = props;
147
+ } else {
148
+ className = $[1];
149
+ props = $[2];
150
+ }
151
+ let t1;
152
+ if ($[3] !== className) {
153
+ t1 = cn("px-4 group-data-[size=sm]/card:px-3", className);
154
+ $[3] = className;
155
+ $[4] = t1;
156
+ } else {
157
+ t1 = $[4];
158
+ }
159
+ let t2;
160
+ if ($[5] !== props || $[6] !== t1) {
161
+ t2 = /* @__PURE__ */ jsxDEV("div", {
162
+ "data-slot": "card-content",
163
+ className: t1,
164
+ ...props
165
+ }, void 0, false);
166
+ $[5] = props;
167
+ $[6] = t1;
168
+ $[7] = t2;
169
+ } else {
170
+ t2 = $[7];
171
+ }
172
+ return t2;
173
+ }
174
+
175
+ export { Card as C, CardContent as a, CardHeader as b, CardTitle as c, CardDescription as d };
@@ -0,0 +1,8 @@
1
+ const CLOUDFLARE_DASH = "https://dash.cloudflare.com/?to=/:account";
2
+ const CLOUDFLARE_OBSERVABILITY_URL = `${CLOUDFLARE_DASH}/workers-and-pages/observability`;
3
+ const CLOUDFLARE_WORKERS_URL = `${CLOUDFLARE_DASH}/workers-and-pages`;
4
+ const CLOUDFLARE_R2_URL = `${CLOUDFLARE_DASH}/r2`;
5
+ const CLOUDFLARE_D1_URL = `${CLOUDFLARE_DASH}/workers/d1`;
6
+ const CLOUDFLARE_DURABLE_OBJECTS_URL = `${CLOUDFLARE_DASH}/workers/durable-objects`;
7
+
8
+ export { CLOUDFLARE_D1_URL as C, CLOUDFLARE_OBSERVABILITY_URL as a, CLOUDFLARE_WORKERS_URL as b, CLOUDFLARE_DURABLE_OBJECTS_URL as c, CLOUDFLARE_R2_URL as d };
@@ -0,0 +1,63 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
3
+ import { c as cn } from './utils-B05Dmz_H.js';
4
+ import { HugeiconsIcon } from '@hugeicons/react';
5
+ import { Tick02Icon } from '@hugeicons/core-free-icons';
6
+ import { jsxDEV } from 'react/jsx-dev-runtime';
7
+
8
+ function Checkbox(t0) {
9
+ const $ = c(9);
10
+ let className;
11
+ let props;
12
+ if ($[0] !== t0) {
13
+ ({
14
+ className,
15
+ ...props
16
+ } = t0);
17
+ $[0] = t0;
18
+ $[1] = className;
19
+ $[2] = props;
20
+ } else {
21
+ className = $[1];
22
+ props = $[2];
23
+ }
24
+ let t1;
25
+ if ($[3] !== className) {
26
+ t1 = cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className);
27
+ $[3] = className;
28
+ $[4] = t1;
29
+ } else {
30
+ t1 = $[4];
31
+ }
32
+ let t2;
33
+ if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
34
+ t2 = /* @__PURE__ */ jsxDEV(Checkbox$1.Indicator, {
35
+ "data-slot": "checkbox-indicator",
36
+ className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
37
+ children: /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
38
+ icon: Tick02Icon,
39
+ strokeWidth: 2
40
+ }, void 0, false)
41
+ }, void 0, false);
42
+ $[5] = t2;
43
+ } else {
44
+ t2 = $[5];
45
+ }
46
+ let t3;
47
+ if ($[6] !== props || $[7] !== t1) {
48
+ t3 = /* @__PURE__ */ jsxDEV(Checkbox$1.Root, {
49
+ "data-slot": "checkbox",
50
+ className: t1,
51
+ ...props,
52
+ children: t2
53
+ }, void 0, false);
54
+ $[6] = props;
55
+ $[7] = t1;
56
+ $[8] = t3;
57
+ } else {
58
+ t3 = $[8];
59
+ }
60
+ return t3;
61
+ }
62
+
63
+ export { Checkbox as C };
@@ -0,0 +1,27 @@
1
+ import { setupI18n } from '@lingui/core';
2
+ import { compileMessage } from '@lingui/message-utils/compileMessage';
3
+ import { use, createContext } from 'react';
4
+
5
+ const messages = {};
6
+
7
+ const DEFAULT_LOCALE = "en";
8
+ const BUILTIN_CATALOGS = {
9
+ en: messages
10
+ };
11
+ const createStudioI18n = (locale = DEFAULT_LOCALE, catalogs = BUILTIN_CATALOGS) => {
12
+ const instance = setupI18n();
13
+ instance.setMessagesCompiler(compileMessage);
14
+ for (const [code, catalog] of Object.entries(catalogs)) {
15
+ instance.load(code, catalog);
16
+ }
17
+ instance.activate(catalogs[locale] === void 0 ? DEFAULT_LOCALE : locale);
18
+ return instance;
19
+ };
20
+ const studioI18n = createStudioI18n();
21
+ const StudioI18nContext = /* @__PURE__ */ createContext(studioI18n);
22
+ const useT = () => {
23
+ const i18n = use(StudioI18nContext);
24
+ return (id, values) => i18n._(id, values);
25
+ };
26
+
27
+ export { DEFAULT_LOCALE, StudioI18nContext, createStudioI18n, studioI18n, useT };
@@ -0,0 +1,183 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useT } from './createStudioI18n-CgvlmDkN.js';
3
+ import { h as formatCell } from './internal-BBZYexre.js';
4
+ import { jsxDEV } from 'react/jsx-dev-runtime';
5
+
6
+ const CellValue = (t0) => {
7
+ const $ = c(8);
8
+ const {
9
+ value
10
+ } = t0;
11
+ if (value === null || value === void 0) {
12
+ let t12;
13
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
14
+ t12 = /* @__PURE__ */ jsxDEV("span", {
15
+ className: "text-muted-foreground/50 italic",
16
+ children: "NULL"
17
+ }, void 0, false);
18
+ $[0] = t12;
19
+ } else {
20
+ t12 = $[0];
21
+ }
22
+ return t12;
23
+ }
24
+ let t1;
25
+ if ($[1] !== value) {
26
+ t1 = formatCell(value);
27
+ $[1] = value;
28
+ $[2] = t1;
29
+ } else {
30
+ t1 = $[2];
31
+ }
32
+ let t2;
33
+ if ($[3] !== value) {
34
+ t2 = formatCell(value);
35
+ $[3] = value;
36
+ $[4] = t2;
37
+ } else {
38
+ t2 = $[4];
39
+ }
40
+ let t3;
41
+ if ($[5] !== t1 || $[6] !== t2) {
42
+ t3 = /* @__PURE__ */ jsxDEV("span", {
43
+ title: t1,
44
+ children: t2
45
+ }, void 0, false);
46
+ $[5] = t1;
47
+ $[6] = t2;
48
+ $[7] = t3;
49
+ } else {
50
+ t3 = $[7];
51
+ }
52
+ return t3;
53
+ };
54
+ const TransposedTable = (t0) => {
55
+ const $ = c(22);
56
+ const {
57
+ columns,
58
+ rows
59
+ } = t0;
60
+ const t = useT();
61
+ let t1;
62
+ if ($[0] !== t) {
63
+ t1 = t("Field");
64
+ $[0] = t;
65
+ $[1] = t1;
66
+ } else {
67
+ t1 = $[1];
68
+ }
69
+ let t2;
70
+ if ($[2] !== t1) {
71
+ t2 = /* @__PURE__ */ jsxDEV("th", {
72
+ className: "border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",
73
+ children: t1
74
+ }, void 0, false);
75
+ $[2] = t1;
76
+ $[3] = t2;
77
+ } else {
78
+ t2 = $[3];
79
+ }
80
+ let t3;
81
+ if ($[4] !== rows || $[5] !== t) {
82
+ let t42;
83
+ if ($[7] !== t) {
84
+ t42 = (_, index) => /* @__PURE__ */ jsxDEV("th", {
85
+ className: "border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",
86
+ children: t("Row {n}", {
87
+ n: index + 1
88
+ })
89
+ }, index, false);
90
+ $[7] = t;
91
+ $[8] = t42;
92
+ } else {
93
+ t42 = $[8];
94
+ }
95
+ t3 = rows.map(t42);
96
+ $[4] = rows;
97
+ $[5] = t;
98
+ $[6] = t3;
99
+ } else {
100
+ t3 = $[6];
101
+ }
102
+ let t4;
103
+ if ($[9] !== t2 || $[10] !== t3) {
104
+ t4 = /* @__PURE__ */ jsxDEV("thead", {
105
+ className: "sticky top-0 z-10 bg-muted",
106
+ children: /* @__PURE__ */ jsxDEV("tr", {
107
+ children: [t2, t3]
108
+ }, void 0, true)
109
+ }, void 0, false);
110
+ $[9] = t2;
111
+ $[10] = t3;
112
+ $[11] = t4;
113
+ } else {
114
+ t4 = $[11];
115
+ }
116
+ let t5;
117
+ if ($[12] !== columns || $[13] !== rows) {
118
+ let t62;
119
+ if ($[15] !== rows) {
120
+ t62 = (column) => /* @__PURE__ */ jsxDEV("tr", {
121
+ className: "hover:bg-muted/40",
122
+ children: [/* @__PURE__ */ jsxDEV("th", {
123
+ className: "border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",
124
+ scope: "row",
125
+ children: column
126
+ }, void 0, false), rows.map((row, index_0) => /* @__PURE__ */ jsxDEV("td", {
127
+ className: "max-w-md truncate border-b border-border px-3 py-1.5 font-mono",
128
+ children: /* @__PURE__ */ jsxDEV(CellValue, {
129
+ value: row[column]
130
+ }, void 0, false)
131
+ }, index_0, false))]
132
+ }, column, true);
133
+ $[15] = rows;
134
+ $[16] = t62;
135
+ } else {
136
+ t62 = $[16];
137
+ }
138
+ t5 = columns.map(t62);
139
+ $[12] = columns;
140
+ $[13] = rows;
141
+ $[14] = t5;
142
+ } else {
143
+ t5 = $[14];
144
+ }
145
+ let t6;
146
+ if ($[17] !== t5) {
147
+ t6 = /* @__PURE__ */ jsxDEV("tbody", {
148
+ children: t5
149
+ }, void 0, false);
150
+ $[17] = t5;
151
+ $[18] = t6;
152
+ } else {
153
+ t6 = $[18];
154
+ }
155
+ let t7;
156
+ if ($[19] !== t4 || $[20] !== t6) {
157
+ t7 = /* @__PURE__ */ jsxDEV("div", {
158
+ className: "min-h-0 flex-1 overflow-auto",
159
+ "data-testid": "db-transposed",
160
+ children: /* @__PURE__ */ jsxDEV("table", {
161
+ className: "border-collapse text-xs",
162
+ children: [t4, t6]
163
+ }, void 0, true)
164
+ }, void 0, false);
165
+ $[19] = t4;
166
+ $[20] = t6;
167
+ $[21] = t7;
168
+ } else {
169
+ t7 = $[21];
170
+ }
171
+ return t7;
172
+ };
173
+ const GridContainer = ({
174
+ children,
175
+ layout = "card",
176
+ testId
177
+ }) => /* @__PURE__ */ jsxDEV("div", {
178
+ className: layout === "fill" ? "flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border" : "overflow-x-auto border border-border bg-card",
179
+ "data-testid": testId,
180
+ children
181
+ }, void 0, false);
182
+
183
+ export { CellValue as C, GridContainer as G, TransposedTable as T };