@mastra/playground-ui 53.0.0-alpha.11 → 53.0.0-alpha.13

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 (69) hide show
  1. package/dist/{command-DWFd0d4c.js → command-Be-KrIAX.js} +2 -2
  2. package/dist/{command-DWFd0d4c.js.map → command-Be-KrIAX.js.map} +1 -1
  3. package/dist/{command-CUev1UxH.cjs → command-DsTBCmQq.cjs} +2 -2
  4. package/dist/{command-CUev1UxH.cjs.map → command-DsTBCmQq.cjs.map} +1 -1
  5. package/dist/components/Command.cjs.js +1 -1
  6. package/dist/components/Command.es.js +1 -1
  7. package/dist/components/CommandPalette.cjs.js +1 -1
  8. package/dist/components/CommandPalette.es.js +1 -1
  9. package/dist/components/DataCodeSection.cjs.js +1 -1
  10. package/dist/components/DataCodeSection.es.js +1 -1
  11. package/dist/components/DataPanel.cjs.js +1 -1
  12. package/dist/components/DataPanel.es.js +1 -1
  13. package/dist/components/Dialog.cjs.js +181 -2
  14. package/dist/components/Dialog.cjs.js.map +1 -1
  15. package/dist/components/Dialog.es.js +183 -1
  16. package/dist/components/Dialog.es.js.map +1 -1
  17. package/dist/components/IntegrationDialog.cjs.js +105 -0
  18. package/dist/components/IntegrationDialog.cjs.js.map +1 -0
  19. package/dist/components/IntegrationDialog.d.ts +2 -0
  20. package/dist/components/IntegrationDialog.es.js +101 -0
  21. package/dist/components/IntegrationDialog.es.js.map +1 -0
  22. package/dist/{data-code-section-D5I0m1cS.cjs → data-code-section-B_lg_J_0.cjs} +2 -2
  23. package/dist/{data-code-section-D5I0m1cS.cjs.map → data-code-section-B_lg_J_0.cjs.map} +1 -1
  24. package/dist/{data-code-section-d3NffL3V.js → data-code-section-Cm_W_XhO.js} +2 -2
  25. package/dist/{data-code-section-d3NffL3V.js.map → data-code-section-Cm_W_XhO.js.map} +1 -1
  26. package/dist/{data-panel-Bo2HCylZ.cjs → data-panel-Cv9j_IGQ.cjs} +2 -2
  27. package/dist/{data-panel-Bo2HCylZ.cjs.map → data-panel-Cv9j_IGQ.cjs.map} +1 -1
  28. package/dist/{data-panel-T3vp7wTD.js → data-panel-DXxeSnL1.js} +2 -2
  29. package/dist/{data-panel-T3vp7wTD.js.map → data-panel-DXxeSnL1.js.map} +1 -1
  30. package/dist/dialog-CZMPDVUj.js +259 -0
  31. package/dist/dialog-CZMPDVUj.js.map +1 -0
  32. package/dist/dialog-D-7Hkb3j.cjs +293 -0
  33. package/dist/dialog-D-7Hkb3j.cjs.map +1 -0
  34. package/dist/domains/traces/components/span-data-panel-view.cjs.js +1 -1
  35. package/dist/domains/traces/components/span-data-panel-view.es.js +1 -1
  36. package/dist/domains/traces/components/trace-columns-menu.cjs.js +1 -1
  37. package/dist/domains/traces/components/trace-columns-menu.es.js +1 -1
  38. package/dist/domains/traces/components/trace-data-panel-view.cjs.js +1 -1
  39. package/dist/domains/traces/components/trace-data-panel-view.es.js +1 -1
  40. package/dist/domains/traces/hooks/use-branch.cjs.js +2 -6
  41. package/dist/domains/traces/hooks/use-branch.cjs.js.map +1 -1
  42. package/dist/domains/traces/hooks/use-branch.es.js +2 -6
  43. package/dist/domains/traces/hooks/use-branch.es.js.map +1 -1
  44. package/dist/domains/traces/hooks/use-download-trace-json.cjs.js +4 -1
  45. package/dist/domains/traces/hooks/use-download-trace-json.cjs.js.map +1 -1
  46. package/dist/domains/traces/hooks/use-download-trace-json.es.js +4 -1
  47. package/dist/domains/traces/hooks/use-download-trace-json.es.js.map +1 -1
  48. package/dist/domains/traces/hooks/use-trace-spans.cjs.js +10 -7
  49. package/dist/domains/traces/hooks/use-trace-spans.cjs.js.map +1 -1
  50. package/dist/domains/traces/hooks/use-trace-spans.es.js +10 -7
  51. package/dist/domains/traces/hooks/use-trace-spans.es.js.map +1 -1
  52. package/dist/ee/signals/settings/signal-definition-form-dialog.cjs.js +1 -1
  53. package/dist/ee/signals/settings/signal-definition-form-dialog.es.js +1 -1
  54. package/dist/src/domains/traces/hooks/use-trace-spans.d.ts +3 -1
  55. package/dist/src/ds/components/Dialog/dialog-action.d.ts +9 -0
  56. package/dist/src/ds/components/Dialog/dialog-context.d.ts +16 -0
  57. package/dist/src/ds/components/Dialog/dialog-new-variant.stories.d.ts +64 -0
  58. package/dist/src/ds/components/Dialog/dialog.d.ts +15 -6
  59. package/dist/src/ds/components/Dialog/index.d.ts +2 -0
  60. package/dist/src/ds/components/IntegrationDialog/__fixtures__/integrations-catalog.d.ts +2 -0
  61. package/dist/src/ds/components/IntegrationDialog/index.d.ts +2 -0
  62. package/dist/src/ds/components/IntegrationDialog/integration-dialog.d.ts +28 -0
  63. package/dist/src/ds/components/IntegrationDialog/integration-dialog.stories.d.ts +24 -0
  64. package/dist/style.css +78 -0
  65. package/package.json +7 -7
  66. package/dist/dialog-CESxLg8S.js +0 -76
  67. package/dist/dialog-CESxLg8S.js.map +0 -1
  68. package/dist/dialog-K0q0KOOW.cjs +0 -107
  69. package/dist/dialog-K0q0KOOW.cjs.map +0 -1
@@ -7,7 +7,7 @@ const lucideReact = require('lucide-react');
7
7
  const React = require('react');
8
8
  const domains_traces_traceListColumns = require('../trace-list-columns.cjs.js');
9
9
  const Button = require('../../../Button-D10WB4vc.cjs');
10
- const dialog = require('../../../dialog-K0q0KOOW.cjs');
10
+ const dialog = require('../../../dialog-D-7Hkb3j.cjs');
11
11
  const dropdownMenu = require('../../../dropdown-menu-qsDhHNES.cjs');
12
12
  const input = require('../../../input-DBrWBeUp.cjs');
13
13
  const label = require('../../../label-B9ERiuZb.cjs');
@@ -3,7 +3,7 @@ import { Columns3Icon, PlusIcon } from 'lucide-react';
3
3
  import { useState } from 'react';
4
4
  import { TRACE_USAGE_COLUMNS } from '../trace-list-columns.es.js';
5
5
  import { B as Button } from '../../../Button-BsfLQEC6.js';
6
- import { D as Dialog, c as DialogContent, f as DialogHeader, i as DialogTitle, d as DialogDescription, a as DialogBody, e as DialogFooter } from '../../../dialog-CESxLg8S.js';
6
+ import { D as Dialog, a as DialogContent, b as DialogHeader, c as DialogTitle, d as DialogDescription, e as DialogBody, f as DialogFooter } from '../../../dialog-CZMPDVUj.js';
7
7
  import { D as DropdownMenu } from '../../../dropdown-menu-BYTyEuSa.js';
8
8
  import { I as Input } from '../../../input-DNjusDwY.js';
9
9
  import { L as Label } from '../../../label-Um4lWyRe.js';
@@ -13,7 +13,7 @@ const domains_traces_components_traceSummaryDescription = require('./trace-summa
13
13
  const domains_traces_components_traceTimeline = require('./trace-timeline.cjs.js');
14
14
  const Button = require('../../../Button-D10WB4vc.cjs');
15
15
  const buttonsGroup = require('../../../buttons-group-Cn36DWYX.cjs');
16
- const dataPanel = require('../../../data-panel-Bo2HCylZ.cjs');
16
+ const dataPanel = require('../../../data-panel-Cv9j_IGQ.cjs');
17
17
  const dropdownMenu = require('../../../dropdown-menu-qsDhHNES.cjs');
18
18
  const searchFieldBlock = require('../../../search-field-block-CiinIsub.cjs');
19
19
  const Notice = require('../../../Notice-D_ji361h.cjs');
@@ -9,7 +9,7 @@ import { TraceSummaryDescription } from './trace-summary-description.es.js';
9
9
  import { TraceTimeline } from './trace-timeline.es.js';
10
10
  import { B as Button } from '../../../Button-BsfLQEC6.js';
11
11
  import { B as ButtonsGroup } from '../../../buttons-group-BjM12HPx.js';
12
- import { D as DataPanel } from '../../../data-panel-T3vp7wTD.js';
12
+ import { D as DataPanel } from '../../../data-panel-DXxeSnL1.js';
13
13
  import { D as DropdownMenu } from '../../../dropdown-menu-BYTyEuSa.js';
14
14
  import { S as SearchFieldBlock } from '../../../search-field-block-D51aN1d9.js';
15
15
  import { N as Notice } from '../../../Notice-DSUAUUYU.js';
@@ -7,7 +7,6 @@ const reactQuery = require('@tanstack/react-query');
7
7
  const domains_traces_utils_toSearchableSpans = require('../utils/to-searchable-spans.cjs.js');
8
8
  require('date-fns');
9
9
 
10
- const IMMUTABLE_CACHE_TIME = 1e3 * 60 * 60 * 24 * 30;
11
10
  function useBranch({
12
11
  traceId,
13
12
  spanId,
@@ -25,11 +24,8 @@ function useBranch({
25
24
  // Builds each span's search haystack once per fetch, cached with the query.
26
25
  select: domains_traces_utils_toSearchableSpans.selectSearchableSpans,
27
26
  enabled: !!traceId && !!spanId,
28
- staleTime: (query) => {
29
- const data = query.state.data;
30
- const isFinished = data?.spans.every((s) => Boolean(s.endedAt));
31
- return isFinished ? IMMUTABLE_CACHE_TIME : 0;
32
- }
27
+ // A finished subtree can still gain spans from a resumed run or delayed export.
28
+ staleTime: 0
33
29
  });
34
30
  }
35
31
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-branch.cjs.js","sources":["../../../../src/domains/traces/hooks/use-branch.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport type { SearchableSpan } from '../types';\nimport { selectSearchableSpans } from '../utils';\n\nconst IMMUTABLE_CACHE_TIME = 1000 * 60 * 60 * 24 * 30; // 30 days, massive cache, span data is immutable\n\nexport interface UseBranchArgs {\n traceId: string | null | undefined;\n spanId: string | null | undefined;\n depth?: number;\n}\n\nexport function useBranch({\n traceId,\n spanId,\n depth,\n}: UseBranchArgs): UseQueryResult<{ traceId: string; spans: SearchableSpan[] } | null> {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['branch', traceId, spanId, depth],\n queryFn: async () => {\n if (!traceId || !spanId) {\n throw new Error('traceId and spanId are required');\n }\n return client.getBranch({ traceId, spanId, depth });\n },\n // Builds each span's search haystack once per fetch, cached with the query.\n select: selectSearchableSpans,\n enabled: !!traceId && !!spanId,\n staleTime: query => {\n const data = query.state.data;\n const isFinished = data?.spans.every(s => Boolean(s.endedAt));\n return isFinished ? IMMUTABLE_CACHE_TIME : 0;\n },\n });\n}\n"],"names":["useMastraClient","useQuery","selectSearchableSpans"],"mappings":";;;;;;;;;AAMA,MAAM,oBAAA,GAAuB,GAAA,GAAO,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK,EAAA;AAQ5C,SAAS,SAAA,CAAU;AAAA,EACxB,OAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAuF;AACrF,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,QAAA,EAAU,OAAA,EAAS,QAAQ,KAAK,CAAA;AAAA,IAC3C,SAAS,YAAY;AACnB,MAAA,IAAI,CAAC,OAAA,IAAW,CAAC,MAAA,EAAQ;AACvB,QAAA,MAAM,IAAI,MAAM,iCAAiC,CAAA;AAAA,MACnD;AACA,MAAA,OAAO,OAAO,SAAA,CAAU,EAAE,OAAA,EAAS,MAAA,EAAQ,OAAO,CAAA;AAAA,IACpD,CAAA;AAAA;AAAA,IAEA,MAAA,EAAQC,4DAAA;AAAA,IACR,OAAA,EAAS,CAAC,CAAC,OAAA,IAAW,CAAC,CAAC,MAAA;AAAA,IACxB,WAAW,CAAA,KAAA,KAAS;AAClB,MAAA,MAAM,IAAA,GAAO,MAAM,KAAA,CAAM,IAAA;AACzB,MAAA,MAAM,UAAA,GAAa,MAAM,KAAA,CAAM,KAAA,CAAM,OAAK,OAAA,CAAQ,CAAA,CAAE,OAAO,CAAC,CAAA;AAC5D,MAAA,OAAO,aAAa,oBAAA,GAAuB,CAAA;AAAA,IAC7C;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-branch.cjs.js","sources":["../../../../src/domains/traces/hooks/use-branch.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport type { SearchableSpan } from '../types';\nimport { selectSearchableSpans } from '../utils';\n\nexport interface UseBranchArgs {\n traceId: string | null | undefined;\n spanId: string | null | undefined;\n depth?: number;\n}\n\nexport function useBranch({\n traceId,\n spanId,\n depth,\n}: UseBranchArgs): UseQueryResult<{ traceId: string; spans: SearchableSpan[] } | null> {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['branch', traceId, spanId, depth],\n queryFn: async () => {\n if (!traceId || !spanId) {\n throw new Error('traceId and spanId are required');\n }\n return client.getBranch({ traceId, spanId, depth });\n },\n // Builds each span's search haystack once per fetch, cached with the query.\n select: selectSearchableSpans,\n enabled: !!traceId && !!spanId,\n // A finished subtree can still gain spans from a resumed run or delayed export.\n staleTime: 0,\n });\n}\n"],"names":["useMastraClient","useQuery","selectSearchableSpans"],"mappings":";;;;;;;;;AAYO,SAAS,SAAA,CAAU;AAAA,EACxB,OAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAuF;AACrF,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,QAAA,EAAU,OAAA,EAAS,QAAQ,KAAK,CAAA;AAAA,IAC3C,SAAS,YAAY;AACnB,MAAA,IAAI,CAAC,OAAA,IAAW,CAAC,MAAA,EAAQ;AACvB,QAAA,MAAM,IAAI,MAAM,iCAAiC,CAAA;AAAA,MACnD;AACA,MAAA,OAAO,OAAO,SAAA,CAAU,EAAE,OAAA,EAAS,MAAA,EAAQ,OAAO,CAAA;AAAA,IACpD,CAAA;AAAA;AAAA,IAEA,MAAA,EAAQC,4DAAA;AAAA,IACR,OAAA,EAAS,CAAC,CAAC,OAAA,IAAW,CAAC,CAAC,MAAA;AAAA;AAAA,IAExB,SAAA,EAAW;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -3,7 +3,6 @@ import { useQuery } from '@tanstack/react-query';
3
3
  import { selectSearchableSpans } from '../utils/to-searchable-spans.es.js';
4
4
  import 'date-fns';
5
5
 
6
- const IMMUTABLE_CACHE_TIME = 1e3 * 60 * 60 * 24 * 30;
7
6
  function useBranch({
8
7
  traceId,
9
8
  spanId,
@@ -21,11 +20,8 @@ function useBranch({
21
20
  // Builds each span's search haystack once per fetch, cached with the query.
22
21
  select: selectSearchableSpans,
23
22
  enabled: !!traceId && !!spanId,
24
- staleTime: (query) => {
25
- const data = query.state.data;
26
- const isFinished = data?.spans.every((s) => Boolean(s.endedAt));
27
- return isFinished ? IMMUTABLE_CACHE_TIME : 0;
28
- }
23
+ // A finished subtree can still gain spans from a resumed run or delayed export.
24
+ staleTime: 0
29
25
  });
30
26
  }
31
27
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-branch.es.js","sources":["../../../../src/domains/traces/hooks/use-branch.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport type { SearchableSpan } from '../types';\nimport { selectSearchableSpans } from '../utils';\n\nconst IMMUTABLE_CACHE_TIME = 1000 * 60 * 60 * 24 * 30; // 30 days, massive cache, span data is immutable\n\nexport interface UseBranchArgs {\n traceId: string | null | undefined;\n spanId: string | null | undefined;\n depth?: number;\n}\n\nexport function useBranch({\n traceId,\n spanId,\n depth,\n}: UseBranchArgs): UseQueryResult<{ traceId: string; spans: SearchableSpan[] } | null> {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['branch', traceId, spanId, depth],\n queryFn: async () => {\n if (!traceId || !spanId) {\n throw new Error('traceId and spanId are required');\n }\n return client.getBranch({ traceId, spanId, depth });\n },\n // Builds each span's search haystack once per fetch, cached with the query.\n select: selectSearchableSpans,\n enabled: !!traceId && !!spanId,\n staleTime: query => {\n const data = query.state.data;\n const isFinished = data?.spans.every(s => Boolean(s.endedAt));\n return isFinished ? IMMUTABLE_CACHE_TIME : 0;\n },\n });\n}\n"],"names":[],"mappings":";;;;;AAMA,MAAM,oBAAA,GAAuB,GAAA,GAAO,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK,EAAA;AAQ5C,SAAS,SAAA,CAAU;AAAA,EACxB,OAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAuF;AACrF,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,QAAA,EAAU,OAAA,EAAS,QAAQ,KAAK,CAAA;AAAA,IAC3C,SAAS,YAAY;AACnB,MAAA,IAAI,CAAC,OAAA,IAAW,CAAC,MAAA,EAAQ;AACvB,QAAA,MAAM,IAAI,MAAM,iCAAiC,CAAA;AAAA,MACnD;AACA,MAAA,OAAO,OAAO,SAAA,CAAU,EAAE,OAAA,EAAS,MAAA,EAAQ,OAAO,CAAA;AAAA,IACpD,CAAA;AAAA;AAAA,IAEA,MAAA,EAAQ,qBAAA;AAAA,IACR,OAAA,EAAS,CAAC,CAAC,OAAA,IAAW,CAAC,CAAC,MAAA;AAAA,IACxB,WAAW,CAAA,KAAA,KAAS;AAClB,MAAA,MAAM,IAAA,GAAO,MAAM,KAAA,CAAM,IAAA;AACzB,MAAA,MAAM,UAAA,GAAa,MAAM,KAAA,CAAM,KAAA,CAAM,OAAK,OAAA,CAAQ,CAAA,CAAE,OAAO,CAAC,CAAA;AAC5D,MAAA,OAAO,aAAa,oBAAA,GAAuB,CAAA;AAAA,IAC7C;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-branch.es.js","sources":["../../../../src/domains/traces/hooks/use-branch.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQuery } from '@tanstack/react-query';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport type { SearchableSpan } from '../types';\nimport { selectSearchableSpans } from '../utils';\n\nexport interface UseBranchArgs {\n traceId: string | null | undefined;\n spanId: string | null | undefined;\n depth?: number;\n}\n\nexport function useBranch({\n traceId,\n spanId,\n depth,\n}: UseBranchArgs): UseQueryResult<{ traceId: string; spans: SearchableSpan[] } | null> {\n const client = useMastraClient();\n\n return useQuery({\n queryKey: ['branch', traceId, spanId, depth],\n queryFn: async () => {\n if (!traceId || !spanId) {\n throw new Error('traceId and spanId are required');\n }\n return client.getBranch({ traceId, spanId, depth });\n },\n // Builds each span's search haystack once per fetch, cached with the query.\n select: selectSearchableSpans,\n enabled: !!traceId && !!spanId,\n // A finished subtree can still gain spans from a resumed run or delayed export.\n staleTime: 0,\n });\n}\n"],"names":[],"mappings":";;;;;AAYO,SAAS,SAAA,CAAU;AAAA,EACxB,OAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAuF;AACrF,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,QAAA,EAAU,OAAA,EAAS,QAAQ,KAAK,CAAA;AAAA,IAC3C,SAAS,YAAY;AACnB,MAAA,IAAI,CAAC,OAAA,IAAW,CAAC,MAAA,EAAQ;AACvB,QAAA,MAAM,IAAI,MAAM,iCAAiC,CAAA;AAAA,MACnD;AACA,MAAA,OAAO,OAAO,SAAA,CAAU,EAAE,OAAA,EAAS,MAAA,EAAQ,OAAO,CAAA;AAAA,IACpD,CAAA;AAAA;AAAA,IAEA,MAAA,EAAQ,qBAAA;AAAA,IACR,OAAA,EAAS,CAAC,CAAC,OAAA,IAAW,CAAC,CAAC,MAAA;AAAA;AAAA,IAExB,SAAA,EAAW;AAAA,GACZ,CAAA;AACH;;;;"}
@@ -3,17 +3,20 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const react = require('@mastra/react');
6
+ const reactQuery = require('@tanstack/react-query');
6
7
  const React = require('react');
8
+ const domains_traces_hooks_useTraceSpans = require('./use-trace-spans.cjs.js');
7
9
  const toast = require('../../../toast-EtbZnj9b.cjs');
8
10
  const downloadJson = require('../../../downloadJson-PWUDbzkB.cjs');
9
11
 
10
12
  function useDownloadTraceJson() {
11
13
  const client = react.useMastraClient();
14
+ const queryClient = reactQuery.useQueryClient();
12
15
  const [isPending, setIsPending] = React.useState(false);
13
16
  const download = (traceId) => {
14
17
  if (isPending) return;
15
18
  setIsPending(true);
16
- const task = client.getTrace(traceId).then((trace) => downloadJson.downloadJson(`trace-${traceId}.json`, trace)).finally(() => setIsPending(false));
19
+ const task = queryClient.fetchQuery(domains_traces_hooks_useTraceSpans.traceSpansQueryOptions(client, traceId)).then((trace) => downloadJson.downloadJson(`trace-${traceId}.json`, trace)).finally(() => setIsPending(false));
17
20
  toast.toast.promise({
18
21
  myPromise: task,
19
22
  loadingMessage: "Preparing trace download…",
@@ -1 +1 @@
1
- {"version":3,"file":"use-download-trace-json.cjs.js","sources":["../../../../src/domains/traces/hooks/use-download-trace-json.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useState } from 'react';\nimport { downloadJson } from '@/lib/file';\nimport { toast } from '@/lib/toast';\n\nexport function useDownloadTraceJson() {\n const client = useMastraClient();\n const [isPending, setIsPending] = useState(false);\n\n const download = (traceId: string) => {\n if (isPending) return;\n setIsPending(true);\n\n // getTrace returns the full payload (heavy input/output), unlike the light spans the panel renders.\n const task = client\n .getTrace(traceId)\n .then(trace => downloadJson(`trace-${traceId}.json`, trace))\n .finally(() => setIsPending(false));\n\n toast.promise({\n myPromise: task,\n loadingMessage: 'Preparing trace download…',\n successMessage: 'Trace downloaded',\n errorMessage: 'Failed to download trace',\n });\n };\n\n return { download, isPending };\n}\n"],"names":["useMastraClient","useState","downloadJson","toast"],"mappings":";;;;;;;;;AAKO,SAAS,oBAAA,GAAuB;AACrC,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAC/B,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAIC,eAAS,KAAK,CAAA;AAEhD,EAAA,MAAM,QAAA,GAAW,CAAC,OAAA,KAAoB;AACpC,IAAA,IAAI,SAAA,EAAW;AACf,IAAA,YAAA,CAAa,IAAI,CAAA;AAGjB,IAAA,MAAM,OAAO,MAAA,CACV,QAAA,CAAS,OAAO,CAAA,CAChB,IAAA,CAAK,WAASC,yBAAA,CAAa,CAAA,MAAA,EAAS,OAAO,CAAA,KAAA,CAAA,EAAS,KAAK,CAAC,CAAA,CAC1D,QAAQ,MAAM,YAAA,CAAa,KAAK,CAAC,CAAA;AAEpC,IAAAC,WAAA,CAAM,OAAA,CAAQ;AAAA,MACZ,SAAA,EAAW,IAAA;AAAA,MACX,cAAA,EAAgB,2BAAA;AAAA,MAChB,cAAA,EAAgB,kBAAA;AAAA,MAChB,YAAA,EAAc;AAAA,KACf,CAAA;AAAA,EACH,CAAA;AAEA,EAAA,OAAO,EAAE,UAAU,SAAA,EAAU;AAC/B;;;;"}
1
+ {"version":3,"file":"use-download-trace-json.cjs.js","sources":["../../../../src/domains/traces/hooks/use-download-trace-json.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { useState } from 'react';\nimport { traceSpansQueryOptions } from './use-trace-spans';\nimport { downloadJson } from '@/lib/file';\nimport { toast } from '@/lib/toast';\n\nexport function useDownloadTraceJson() {\n const client = useMastraClient();\n const queryClient = useQueryClient();\n const [isPending, setIsPending] = useState(false);\n\n const download = (traceId: string) => {\n if (isPending) return;\n setIsPending(true);\n\n // Fetch the full payload into the shared cache so the panel matches the downloaded trace.\n const task = queryClient\n .fetchQuery(traceSpansQueryOptions(client, traceId))\n .then(trace => downloadJson(`trace-${traceId}.json`, trace))\n .finally(() => setIsPending(false));\n\n toast.promise({\n myPromise: task,\n loadingMessage: 'Preparing trace download…',\n successMessage: 'Trace downloaded',\n errorMessage: 'Failed to download trace',\n });\n };\n\n return { download, isPending };\n}\n"],"names":["useMastraClient","useQueryClient","useState","traceSpansQueryOptions","downloadJson","toast"],"mappings":";;;;;;;;;;;AAOO,SAAS,oBAAA,GAAuB;AACrC,EAAA,MAAM,SAASA,qBAAA,EAAgB;AAC/B,EAAA,MAAM,cAAcC,yBAAA,EAAe;AACnC,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAIC,eAAS,KAAK,CAAA;AAEhD,EAAA,MAAM,QAAA,GAAW,CAAC,OAAA,KAAoB;AACpC,IAAA,IAAI,SAAA,EAAW;AACf,IAAA,YAAA,CAAa,IAAI,CAAA;AAGjB,IAAA,MAAM,IAAA,GAAO,YACV,UAAA,CAAWC,yDAAA,CAAuB,QAAQ,OAAO,CAAC,EAClD,IAAA,CAAK,CAAA,KAAA,KAASC,0BAAa,CAAA,MAAA,EAAS,OAAO,SAAS,KAAK,CAAC,EAC1D,OAAA,CAAQ,MAAM,YAAA,CAAa,KAAK,CAAC,CAAA;AAEpC,IAAAC,WAAA,CAAM,OAAA,CAAQ;AAAA,MACZ,SAAA,EAAW,IAAA;AAAA,MACX,cAAA,EAAgB,2BAAA;AAAA,MAChB,cAAA,EAAgB,kBAAA;AAAA,MAChB,YAAA,EAAc;AAAA,KACf,CAAA;AAAA,EACH,CAAA;AAEA,EAAA,OAAO,EAAE,UAAU,SAAA,EAAU;AAC/B;;;;"}
@@ -1,15 +1,18 @@
1
1
  import { useMastraClient } from '@mastra/react';
2
+ import { useQueryClient } from '@tanstack/react-query';
2
3
  import { useState } from 'react';
4
+ import { traceSpansQueryOptions } from './use-trace-spans.es.js';
3
5
  import { t as toast } from '../../../toast-czUGO0aH.js';
4
6
  import { d as downloadJson } from '../../../downloadJson-DuPoMa_6.js';
5
7
 
6
8
  function useDownloadTraceJson() {
7
9
  const client = useMastraClient();
10
+ const queryClient = useQueryClient();
8
11
  const [isPending, setIsPending] = useState(false);
9
12
  const download = (traceId) => {
10
13
  if (isPending) return;
11
14
  setIsPending(true);
12
- const task = client.getTrace(traceId).then((trace) => downloadJson(`trace-${traceId}.json`, trace)).finally(() => setIsPending(false));
15
+ const task = queryClient.fetchQuery(traceSpansQueryOptions(client, traceId)).then((trace) => downloadJson(`trace-${traceId}.json`, trace)).finally(() => setIsPending(false));
13
16
  toast.promise({
14
17
  myPromise: task,
15
18
  loadingMessage: "Preparing trace download…",
@@ -1 +1 @@
1
- {"version":3,"file":"use-download-trace-json.es.js","sources":["../../../../src/domains/traces/hooks/use-download-trace-json.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useState } from 'react';\nimport { downloadJson } from '@/lib/file';\nimport { toast } from '@/lib/toast';\n\nexport function useDownloadTraceJson() {\n const client = useMastraClient();\n const [isPending, setIsPending] = useState(false);\n\n const download = (traceId: string) => {\n if (isPending) return;\n setIsPending(true);\n\n // getTrace returns the full payload (heavy input/output), unlike the light spans the panel renders.\n const task = client\n .getTrace(traceId)\n .then(trace => downloadJson(`trace-${traceId}.json`, trace))\n .finally(() => setIsPending(false));\n\n toast.promise({\n myPromise: task,\n loadingMessage: 'Preparing trace download…',\n successMessage: 'Trace downloaded',\n errorMessage: 'Failed to download trace',\n });\n };\n\n return { download, isPending };\n}\n"],"names":[],"mappings":";;;;;AAKO,SAAS,oBAAA,GAAuB;AACrC,EAAA,MAAM,SAAS,eAAA,EAAgB;AAC/B,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAEhD,EAAA,MAAM,QAAA,GAAW,CAAC,OAAA,KAAoB;AACpC,IAAA,IAAI,SAAA,EAAW;AACf,IAAA,YAAA,CAAa,IAAI,CAAA;AAGjB,IAAA,MAAM,OAAO,MAAA,CACV,QAAA,CAAS,OAAO,CAAA,CAChB,IAAA,CAAK,WAAS,YAAA,CAAa,CAAA,MAAA,EAAS,OAAO,CAAA,KAAA,CAAA,EAAS,KAAK,CAAC,CAAA,CAC1D,QAAQ,MAAM,YAAA,CAAa,KAAK,CAAC,CAAA;AAEpC,IAAA,KAAA,CAAM,OAAA,CAAQ;AAAA,MACZ,SAAA,EAAW,IAAA;AAAA,MACX,cAAA,EAAgB,2BAAA;AAAA,MAChB,cAAA,EAAgB,kBAAA;AAAA,MAChB,YAAA,EAAc;AAAA,KACf,CAAA;AAAA,EACH,CAAA;AAEA,EAAA,OAAO,EAAE,UAAU,SAAA,EAAU;AAC/B;;;;"}
1
+ {"version":3,"file":"use-download-trace-json.es.js","sources":["../../../../src/domains/traces/hooks/use-download-trace-json.ts"],"sourcesContent":["import { useMastraClient } from '@mastra/react';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { useState } from 'react';\nimport { traceSpansQueryOptions } from './use-trace-spans';\nimport { downloadJson } from '@/lib/file';\nimport { toast } from '@/lib/toast';\n\nexport function useDownloadTraceJson() {\n const client = useMastraClient();\n const queryClient = useQueryClient();\n const [isPending, setIsPending] = useState(false);\n\n const download = (traceId: string) => {\n if (isPending) return;\n setIsPending(true);\n\n // Fetch the full payload into the shared cache so the panel matches the downloaded trace.\n const task = queryClient\n .fetchQuery(traceSpansQueryOptions(client, traceId))\n .then(trace => downloadJson(`trace-${traceId}.json`, trace))\n .finally(() => setIsPending(false));\n\n toast.promise({\n myPromise: task,\n loadingMessage: 'Preparing trace download…',\n successMessage: 'Trace downloaded',\n errorMessage: 'Failed to download trace',\n });\n };\n\n return { download, isPending };\n}\n"],"names":[],"mappings":";;;;;;;AAOO,SAAS,oBAAA,GAAuB;AACrC,EAAA,MAAM,SAAS,eAAA,EAAgB;AAC/B,EAAA,MAAM,cAAc,cAAA,EAAe;AACnC,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAEhD,EAAA,MAAM,QAAA,GAAW,CAAC,OAAA,KAAoB;AACpC,IAAA,IAAI,SAAA,EAAW;AACf,IAAA,YAAA,CAAa,IAAI,CAAA;AAGjB,IAAA,MAAM,IAAA,GAAO,YACV,UAAA,CAAW,sBAAA,CAAuB,QAAQ,OAAO,CAAC,EAClD,IAAA,CAAK,CAAA,KAAA,KAAS,aAAa,CAAA,MAAA,EAAS,OAAO,SAAS,KAAK,CAAC,EAC1D,OAAA,CAAQ,MAAM,YAAA,CAAa,KAAK,CAAC,CAAA;AAEpC,IAAA,KAAA,CAAM,OAAA,CAAQ;AAAA,MACZ,SAAA,EAAW,IAAA;AAAA,MACX,cAAA,EAAgB,2BAAA;AAAA,MAChB,cAAA,EAAgB,kBAAA;AAAA,MAChB,YAAA,EAAc;AAAA,KACf,CAAA;AAAA,EACH,CAAA;AAEA,EAAA,OAAO,EAAE,UAAU,SAAA,EAAU;AAC/B;;;;"}
@@ -7,7 +7,6 @@ const reactQuery = require('@tanstack/react-query');
7
7
  const domains_traces_utils_toSearchableSpans = require('../utils/to-searchable-spans.cjs.js');
8
8
  require('date-fns');
9
9
 
10
- const IMMUTABLE_CACHE_TIME = 1e3 * 60 * 60 * 24 * 30;
11
10
  const traceSpansQueryOptions = (client, traceId) => reactQuery.queryOptions({
12
11
  queryKey: ["trace-spans", traceId],
13
12
  queryFn: async () => {
@@ -18,16 +17,17 @@ const traceSpansQueryOptions = (client, traceId) => reactQuery.queryOptions({
18
17
  return res;
19
18
  },
20
19
  enabled: !!traceId,
21
- staleTime: (query) => {
22
- const data = query.state.data;
23
- const isFinished = data?.spans.every((span) => Boolean(span.endedAt));
24
- return isFinished ? IMMUTABLE_CACHE_TIME : 0;
25
- }
20
+ // Resumed runs and delayed exports can append spans even when every known span has ended.
21
+ staleTime: 0
26
22
  });
27
- function useTraceSpans(traceId) {
23
+ function useTraceSpans(traceId, { passive = false } = {}) {
28
24
  const client = react.useMastraClient();
29
25
  return reactQuery.useQuery({
30
26
  ...traceSpansQueryOptions(client, traceId),
27
+ // History rows share updates but leave automatic refreshes to the selected detail.
28
+ refetchOnMount: !passive,
29
+ refetchOnWindowFocus: !passive,
30
+ refetchOnReconnect: !passive,
31
31
  // Builds each span's search haystack once per fetch, cached with the query.
32
32
  select: domains_traces_utils_toSearchableSpans.selectSearchableSpans
33
33
  });
@@ -37,6 +37,9 @@ function useTraceSpansQueries(traceIds, select, fallback) {
37
37
  return reactQuery.useQueries({
38
38
  queries: traceIds.map((traceId) => ({
39
39
  ...traceSpansQueryOptions(client, traceId),
40
+ refetchOnMount: false,
41
+ refetchOnWindowFocus: false,
42
+ refetchOnReconnect: false,
40
43
  select: (data) => select(traceId, data)
41
44
  })),
42
45
  combine: (results) => results.map(
@@ -1 +1 @@
1
- {"version":3,"file":"use-trace-spans.cjs.js","sources":["../../../../src/domains/traces/hooks/use-trace-spans.ts"],"sourcesContent":["import type { MastraClient } from '@mastra/client-js';\nimport { useMastraClient } from '@mastra/react';\nimport { queryOptions, useQueries, useQuery } from '@tanstack/react-query';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport type { SearchableSpan } from '../types';\nimport { selectSearchableSpans } from '../utils';\n\nconst IMMUTABLE_CACHE_TIME = 1000 * 60 * 60 * 24 * 30; // 30 days, massive cache, span data is immutable\n\n/**\n * Key, fetcher and stale policy of the `trace-spans` query. Every observer of this key must\n * share these (rather than only the key) so one observer with a stricter `staleTime` does not\n * refetch data another one considers fresh.\n */\nexport const traceSpansQueryOptions = (client: MastraClient, traceId: string | null | undefined) =>\n queryOptions({\n queryKey: ['trace-spans', traceId],\n queryFn: async () => {\n if (!traceId) {\n throw new Error('Trace ID is required');\n }\n const res = await client.getTrace(traceId);\n return res;\n },\n enabled: !!traceId,\n staleTime: query => {\n const data = query.state.data;\n const isFinished = data?.spans.every(span => Boolean(span.endedAt));\n return isFinished ? IMMUTABLE_CACHE_TIME : 0;\n },\n });\n\n/**\n * Every span of a single trace, with its full payload.\n *\n * The lightweight projection exists to keep blob columns off the read path of a\n * *list*, where the cost is paid once per trace on screen. A trace that is open\n * has already narrowed that to one, and the panel both renders and searches\n * these spans -- `input`, `output` and `attributes` included -- so the\n * projection would only hide content the reader is looking at.\n */\nexport function useTraceSpans(\n traceId: string | null | undefined,\n): UseQueryResult<{ traceId: string; spans: SearchableSpan[] } | null> {\n const client = useMastraClient();\n\n return useQuery({\n ...traceSpansQueryOptions(client, traceId),\n // Builds each span's search haystack once per fetch, cached with the query.\n select: selectSearchableSpans,\n });\n}\n\nexport type TraceSpansData = Awaited<ReturnType<MastraClient['getTrace']>>;\n\n/**\n * Observes the `trace-spans` query of several traces at once and projects each one with `select`.\n * Traces still loading (or failed) yield `fallback(traceId)` so the result always lines up with `traceIds`.\n */\nexport function useTraceSpansQueries<T>(\n traceIds: string[],\n select: (traceId: string, data: TraceSpansData) => T,\n fallback: (traceId: string) => T,\n): T[] {\n const client = useMastraClient();\n\n return useQueries({\n queries: traceIds.map(traceId => ({\n ...traceSpansQueryOptions(client, traceId),\n select: (data: TraceSpansData) => select(traceId, data),\n })),\n combine: results =>\n results.map((result, index) =>\n result.data === undefined ? fallback(traceIds[index] ?? '') : (result.data as T),\n ),\n });\n}\n"],"names":["queryOptions","useMastraClient","useQuery","selectSearchableSpans","useQueries"],"mappings":";;;;;;;;;AAOA,MAAM,oBAAA,GAAuB,GAAA,GAAO,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK,EAAA;AAO5C,MAAM,sBAAA,GAAyB,CAAC,MAAA,EAAsB,OAAA,KAC3DA,uBAAA,CAAa;AAAA,EACX,QAAA,EAAU,CAAC,aAAA,EAAe,OAAO,CAAA;AAAA,EACjC,SAAS,YAAY;AACnB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,MAAM,IAAI,MAAM,sBAAsB,CAAA;AAAA,IACxC;AACA,IAAA,MAAM,GAAA,GAAM,MAAM,MAAA,CAAO,QAAA,CAAS,OAAO,CAAA;AACzC,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AAAA,EACA,OAAA,EAAS,CAAC,CAAC,OAAA;AAAA,EACX,WAAW,CAAA,KAAA,KAAS;AAClB,IAAA,MAAM,IAAA,GAAO,MAAM,KAAA,CAAM,IAAA;AACzB,IAAA,MAAM,UAAA,GAAa,MAAM,KAAA,CAAM,KAAA,CAAM,UAAQ,OAAA,CAAQ,IAAA,CAAK,OAAO,CAAC,CAAA;AAClE,IAAA,OAAO,aAAa,oBAAA,GAAuB,CAAA;AAAA,EAC7C;AACF,CAAC;AAWI,SAAS,cACd,OAAA,EACqE;AACrE,EAAA,MAAM,SAASC,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,GAAG,sBAAA,CAAuB,MAAA,EAAQ,OAAO,CAAA;AAAA;AAAA,IAEzC,MAAA,EAAQC;AAAA,GACT,CAAA;AACH;AAQO,SAAS,oBAAA,CACd,QAAA,EACA,MAAA,EACA,QAAA,EACK;AACL,EAAA,MAAM,SAASF,qBAAA,EAAgB;AAE/B,EAAA,OAAOG,qBAAA,CAAW;AAAA,IAChB,OAAA,EAAS,QAAA,CAAS,GAAA,CAAI,CAAA,OAAA,MAAY;AAAA,MAChC,GAAG,sBAAA,CAAuB,MAAA,EAAQ,OAAO,CAAA;AAAA,MACzC,MAAA,EAAQ,CAAC,IAAA,KAAyB,MAAA,CAAO,SAAS,IAAI;AAAA,KACxD,CAAE,CAAA;AAAA,IACF,OAAA,EAAS,aACP,OAAA,CAAQ,GAAA;AAAA,MAAI,CAAC,MAAA,EAAQ,KAAA,KACnB,MAAA,CAAO,IAAA,KAAS,MAAA,GAAY,QAAA,CAAS,QAAA,CAAS,KAAK,CAAA,IAAK,EAAE,CAAA,GAAK,MAAA,CAAO;AAAA;AACxE,GACH,CAAA;AACH;;;;;;"}
1
+ {"version":3,"file":"use-trace-spans.cjs.js","sources":["../../../../src/domains/traces/hooks/use-trace-spans.ts"],"sourcesContent":["import type { MastraClient } from '@mastra/client-js';\nimport { useMastraClient } from '@mastra/react';\nimport { queryOptions, useQueries, useQuery } from '@tanstack/react-query';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport type { SearchableSpan } from '../types';\nimport { selectSearchableSpans } from '../utils';\n\n/**\n * Key, fetcher and stale policy of the `trace-spans` query. Every observer of this key must\n * share these (rather than only the key) so one observer with a stricter `staleTime` does not\n * refetch data another one considers fresh.\n */\nexport const traceSpansQueryOptions = (client: MastraClient, traceId: string | null | undefined) =>\n queryOptions({\n queryKey: ['trace-spans', traceId],\n queryFn: async () => {\n if (!traceId) {\n throw new Error('Trace ID is required');\n }\n const res = await client.getTrace(traceId);\n return res;\n },\n enabled: !!traceId,\n // Resumed runs and delayed exports can append spans even when every known span has ended.\n staleTime: 0,\n });\n\n/**\n * Every span of a single trace, with its full payload.\n *\n * The lightweight projection exists to keep blob columns off the read path of a\n * *list*, where the cost is paid once per trace on screen. A trace that is open\n * has already narrowed that to one, and the panel both renders and searches\n * these spans -- `input`, `output` and `attributes` included -- so the\n * projection would only hide content the reader is looking at.\n */\nexport function useTraceSpans(\n traceId: string | null | undefined,\n { passive = false }: { passive?: boolean } = {},\n): UseQueryResult<{ traceId: string; spans: SearchableSpan[] } | null> {\n const client = useMastraClient();\n\n return useQuery({\n ...traceSpansQueryOptions(client, traceId),\n // History rows share updates but leave automatic refreshes to the selected detail.\n refetchOnMount: !passive,\n refetchOnWindowFocus: !passive,\n refetchOnReconnect: !passive,\n // Builds each span's search haystack once per fetch, cached with the query.\n select: selectSearchableSpans,\n });\n}\n\nexport type TraceSpansData = Awaited<ReturnType<MastraClient['getTrace']>>;\n\n/**\n * Observes the `trace-spans` query of several traces at once and projects each one with `select`.\n * Traces still loading (or failed) yield `fallback(traceId)` so the result always lines up with `traceIds`.\n */\nexport function useTraceSpansQueries<T>(\n traceIds: string[],\n select: (traceId: string, data: TraceSpansData) => T,\n fallback: (traceId: string) => T,\n): T[] {\n const client = useMastraClient();\n\n return useQueries({\n queries: traceIds.map(traceId => ({\n ...traceSpansQueryOptions(client, traceId),\n refetchOnMount: false,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n select: (data: TraceSpansData) => select(traceId, data),\n })),\n combine: results =>\n results.map((result, index) =>\n result.data === undefined ? fallback(traceIds[index] ?? '') : (result.data as T),\n ),\n });\n}\n"],"names":["queryOptions","useMastraClient","useQuery","selectSearchableSpans","useQueries"],"mappings":";;;;;;;;;AAYO,MAAM,sBAAA,GAAyB,CAAC,MAAA,EAAsB,OAAA,KAC3DA,uBAAA,CAAa;AAAA,EACX,QAAA,EAAU,CAAC,aAAA,EAAe,OAAO,CAAA;AAAA,EACjC,SAAS,YAAY;AACnB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,MAAM,IAAI,MAAM,sBAAsB,CAAA;AAAA,IACxC;AACA,IAAA,MAAM,GAAA,GAAM,MAAM,MAAA,CAAO,QAAA,CAAS,OAAO,CAAA;AACzC,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AAAA,EACA,OAAA,EAAS,CAAC,CAAC,OAAA;AAAA;AAAA,EAEX,SAAA,EAAW;AACb,CAAC;AAWI,SAAS,cACd,OAAA,EACA,EAAE,UAAU,KAAA,EAAM,GAA2B,EAAC,EACuB;AACrE,EAAA,MAAM,SAASC,qBAAA,EAAgB;AAE/B,EAAA,OAAOC,mBAAA,CAAS;AAAA,IACd,GAAG,sBAAA,CAAuB,MAAA,EAAQ,OAAO,CAAA;AAAA;AAAA,IAEzC,gBAAgB,CAAC,OAAA;AAAA,IACjB,sBAAsB,CAAC,OAAA;AAAA,IACvB,oBAAoB,CAAC,OAAA;AAAA;AAAA,IAErB,MAAA,EAAQC;AAAA,GACT,CAAA;AACH;AAQO,SAAS,oBAAA,CACd,QAAA,EACA,MAAA,EACA,QAAA,EACK;AACL,EAAA,MAAM,SAASF,qBAAA,EAAgB;AAE/B,EAAA,OAAOG,qBAAA,CAAW;AAAA,IAChB,OAAA,EAAS,QAAA,CAAS,GAAA,CAAI,CAAA,OAAA,MAAY;AAAA,MAChC,GAAG,sBAAA,CAAuB,MAAA,EAAQ,OAAO,CAAA;AAAA,MACzC,cAAA,EAAgB,KAAA;AAAA,MAChB,oBAAA,EAAsB,KAAA;AAAA,MACtB,kBAAA,EAAoB,KAAA;AAAA,MACpB,MAAA,EAAQ,CAAC,IAAA,KAAyB,MAAA,CAAO,SAAS,IAAI;AAAA,KACxD,CAAE,CAAA;AAAA,IACF,OAAA,EAAS,aACP,OAAA,CAAQ,GAAA;AAAA,MAAI,CAAC,MAAA,EAAQ,KAAA,KACnB,MAAA,CAAO,IAAA,KAAS,MAAA,GAAY,QAAA,CAAS,QAAA,CAAS,KAAK,CAAA,IAAK,EAAE,CAAA,GAAK,MAAA,CAAO;AAAA;AACxE,GACH,CAAA;AACH;;;;;;"}
@@ -3,7 +3,6 @@ import { useQuery, queryOptions, useQueries } from '@tanstack/react-query';
3
3
  import { selectSearchableSpans } from '../utils/to-searchable-spans.es.js';
4
4
  import 'date-fns';
5
5
 
6
- const IMMUTABLE_CACHE_TIME = 1e3 * 60 * 60 * 24 * 30;
7
6
  const traceSpansQueryOptions = (client, traceId) => queryOptions({
8
7
  queryKey: ["trace-spans", traceId],
9
8
  queryFn: async () => {
@@ -14,16 +13,17 @@ const traceSpansQueryOptions = (client, traceId) => queryOptions({
14
13
  return res;
15
14
  },
16
15
  enabled: !!traceId,
17
- staleTime: (query) => {
18
- const data = query.state.data;
19
- const isFinished = data?.spans.every((span) => Boolean(span.endedAt));
20
- return isFinished ? IMMUTABLE_CACHE_TIME : 0;
21
- }
16
+ // Resumed runs and delayed exports can append spans even when every known span has ended.
17
+ staleTime: 0
22
18
  });
23
- function useTraceSpans(traceId) {
19
+ function useTraceSpans(traceId, { passive = false } = {}) {
24
20
  const client = useMastraClient();
25
21
  return useQuery({
26
22
  ...traceSpansQueryOptions(client, traceId),
23
+ // History rows share updates but leave automatic refreshes to the selected detail.
24
+ refetchOnMount: !passive,
25
+ refetchOnWindowFocus: !passive,
26
+ refetchOnReconnect: !passive,
27
27
  // Builds each span's search haystack once per fetch, cached with the query.
28
28
  select: selectSearchableSpans
29
29
  });
@@ -33,6 +33,9 @@ function useTraceSpansQueries(traceIds, select, fallback) {
33
33
  return useQueries({
34
34
  queries: traceIds.map((traceId) => ({
35
35
  ...traceSpansQueryOptions(client, traceId),
36
+ refetchOnMount: false,
37
+ refetchOnWindowFocus: false,
38
+ refetchOnReconnect: false,
36
39
  select: (data) => select(traceId, data)
37
40
  })),
38
41
  combine: (results) => results.map(
@@ -1 +1 @@
1
- {"version":3,"file":"use-trace-spans.es.js","sources":["../../../../src/domains/traces/hooks/use-trace-spans.ts"],"sourcesContent":["import type { MastraClient } from '@mastra/client-js';\nimport { useMastraClient } from '@mastra/react';\nimport { queryOptions, useQueries, useQuery } from '@tanstack/react-query';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport type { SearchableSpan } from '../types';\nimport { selectSearchableSpans } from '../utils';\n\nconst IMMUTABLE_CACHE_TIME = 1000 * 60 * 60 * 24 * 30; // 30 days, massive cache, span data is immutable\n\n/**\n * Key, fetcher and stale policy of the `trace-spans` query. Every observer of this key must\n * share these (rather than only the key) so one observer with a stricter `staleTime` does not\n * refetch data another one considers fresh.\n */\nexport const traceSpansQueryOptions = (client: MastraClient, traceId: string | null | undefined) =>\n queryOptions({\n queryKey: ['trace-spans', traceId],\n queryFn: async () => {\n if (!traceId) {\n throw new Error('Trace ID is required');\n }\n const res = await client.getTrace(traceId);\n return res;\n },\n enabled: !!traceId,\n staleTime: query => {\n const data = query.state.data;\n const isFinished = data?.spans.every(span => Boolean(span.endedAt));\n return isFinished ? IMMUTABLE_CACHE_TIME : 0;\n },\n });\n\n/**\n * Every span of a single trace, with its full payload.\n *\n * The lightweight projection exists to keep blob columns off the read path of a\n * *list*, where the cost is paid once per trace on screen. A trace that is open\n * has already narrowed that to one, and the panel both renders and searches\n * these spans -- `input`, `output` and `attributes` included -- so the\n * projection would only hide content the reader is looking at.\n */\nexport function useTraceSpans(\n traceId: string | null | undefined,\n): UseQueryResult<{ traceId: string; spans: SearchableSpan[] } | null> {\n const client = useMastraClient();\n\n return useQuery({\n ...traceSpansQueryOptions(client, traceId),\n // Builds each span's search haystack once per fetch, cached with the query.\n select: selectSearchableSpans,\n });\n}\n\nexport type TraceSpansData = Awaited<ReturnType<MastraClient['getTrace']>>;\n\n/**\n * Observes the `trace-spans` query of several traces at once and projects each one with `select`.\n * Traces still loading (or failed) yield `fallback(traceId)` so the result always lines up with `traceIds`.\n */\nexport function useTraceSpansQueries<T>(\n traceIds: string[],\n select: (traceId: string, data: TraceSpansData) => T,\n fallback: (traceId: string) => T,\n): T[] {\n const client = useMastraClient();\n\n return useQueries({\n queries: traceIds.map(traceId => ({\n ...traceSpansQueryOptions(client, traceId),\n select: (data: TraceSpansData) => select(traceId, data),\n })),\n combine: results =>\n results.map((result, index) =>\n result.data === undefined ? fallback(traceIds[index] ?? '') : (result.data as T),\n ),\n });\n}\n"],"names":[],"mappings":";;;;;AAOA,MAAM,oBAAA,GAAuB,GAAA,GAAO,EAAA,GAAK,EAAA,GAAK,EAAA,GAAK,EAAA;AAO5C,MAAM,sBAAA,GAAyB,CAAC,MAAA,EAAsB,OAAA,KAC3D,YAAA,CAAa;AAAA,EACX,QAAA,EAAU,CAAC,aAAA,EAAe,OAAO,CAAA;AAAA,EACjC,SAAS,YAAY;AACnB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,MAAM,IAAI,MAAM,sBAAsB,CAAA;AAAA,IACxC;AACA,IAAA,MAAM,GAAA,GAAM,MAAM,MAAA,CAAO,QAAA,CAAS,OAAO,CAAA;AACzC,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AAAA,EACA,OAAA,EAAS,CAAC,CAAC,OAAA;AAAA,EACX,WAAW,CAAA,KAAA,KAAS;AAClB,IAAA,MAAM,IAAA,GAAO,MAAM,KAAA,CAAM,IAAA;AACzB,IAAA,MAAM,UAAA,GAAa,MAAM,KAAA,CAAM,KAAA,CAAM,UAAQ,OAAA,CAAQ,IAAA,CAAK,OAAO,CAAC,CAAA;AAClE,IAAA,OAAO,aAAa,oBAAA,GAAuB,CAAA;AAAA,EAC7C;AACF,CAAC;AAWI,SAAS,cACd,OAAA,EACqE;AACrE,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,GAAG,sBAAA,CAAuB,MAAA,EAAQ,OAAO,CAAA;AAAA;AAAA,IAEzC,MAAA,EAAQ;AAAA,GACT,CAAA;AACH;AAQO,SAAS,oBAAA,CACd,QAAA,EACA,MAAA,EACA,QAAA,EACK;AACL,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,UAAA,CAAW;AAAA,IAChB,OAAA,EAAS,QAAA,CAAS,GAAA,CAAI,CAAA,OAAA,MAAY;AAAA,MAChC,GAAG,sBAAA,CAAuB,MAAA,EAAQ,OAAO,CAAA;AAAA,MACzC,MAAA,EAAQ,CAAC,IAAA,KAAyB,MAAA,CAAO,SAAS,IAAI;AAAA,KACxD,CAAE,CAAA;AAAA,IACF,OAAA,EAAS,aACP,OAAA,CAAQ,GAAA;AAAA,MAAI,CAAC,MAAA,EAAQ,KAAA,KACnB,MAAA,CAAO,IAAA,KAAS,MAAA,GAAY,QAAA,CAAS,QAAA,CAAS,KAAK,CAAA,IAAK,EAAE,CAAA,GAAK,MAAA,CAAO;AAAA;AACxE,GACH,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"use-trace-spans.es.js","sources":["../../../../src/domains/traces/hooks/use-trace-spans.ts"],"sourcesContent":["import type { MastraClient } from '@mastra/client-js';\nimport { useMastraClient } from '@mastra/react';\nimport { queryOptions, useQueries, useQuery } from '@tanstack/react-query';\nimport type { UseQueryResult } from '@tanstack/react-query';\nimport type { SearchableSpan } from '../types';\nimport { selectSearchableSpans } from '../utils';\n\n/**\n * Key, fetcher and stale policy of the `trace-spans` query. Every observer of this key must\n * share these (rather than only the key) so one observer with a stricter `staleTime` does not\n * refetch data another one considers fresh.\n */\nexport const traceSpansQueryOptions = (client: MastraClient, traceId: string | null | undefined) =>\n queryOptions({\n queryKey: ['trace-spans', traceId],\n queryFn: async () => {\n if (!traceId) {\n throw new Error('Trace ID is required');\n }\n const res = await client.getTrace(traceId);\n return res;\n },\n enabled: !!traceId,\n // Resumed runs and delayed exports can append spans even when every known span has ended.\n staleTime: 0,\n });\n\n/**\n * Every span of a single trace, with its full payload.\n *\n * The lightweight projection exists to keep blob columns off the read path of a\n * *list*, where the cost is paid once per trace on screen. A trace that is open\n * has already narrowed that to one, and the panel both renders and searches\n * these spans -- `input`, `output` and `attributes` included -- so the\n * projection would only hide content the reader is looking at.\n */\nexport function useTraceSpans(\n traceId: string | null | undefined,\n { passive = false }: { passive?: boolean } = {},\n): UseQueryResult<{ traceId: string; spans: SearchableSpan[] } | null> {\n const client = useMastraClient();\n\n return useQuery({\n ...traceSpansQueryOptions(client, traceId),\n // History rows share updates but leave automatic refreshes to the selected detail.\n refetchOnMount: !passive,\n refetchOnWindowFocus: !passive,\n refetchOnReconnect: !passive,\n // Builds each span's search haystack once per fetch, cached with the query.\n select: selectSearchableSpans,\n });\n}\n\nexport type TraceSpansData = Awaited<ReturnType<MastraClient['getTrace']>>;\n\n/**\n * Observes the `trace-spans` query of several traces at once and projects each one with `select`.\n * Traces still loading (or failed) yield `fallback(traceId)` so the result always lines up with `traceIds`.\n */\nexport function useTraceSpansQueries<T>(\n traceIds: string[],\n select: (traceId: string, data: TraceSpansData) => T,\n fallback: (traceId: string) => T,\n): T[] {\n const client = useMastraClient();\n\n return useQueries({\n queries: traceIds.map(traceId => ({\n ...traceSpansQueryOptions(client, traceId),\n refetchOnMount: false,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n select: (data: TraceSpansData) => select(traceId, data),\n })),\n combine: results =>\n results.map((result, index) =>\n result.data === undefined ? fallback(traceIds[index] ?? '') : (result.data as T),\n ),\n });\n}\n"],"names":[],"mappings":";;;;;AAYO,MAAM,sBAAA,GAAyB,CAAC,MAAA,EAAsB,OAAA,KAC3D,YAAA,CAAa;AAAA,EACX,QAAA,EAAU,CAAC,aAAA,EAAe,OAAO,CAAA;AAAA,EACjC,SAAS,YAAY;AACnB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,MAAM,IAAI,MAAM,sBAAsB,CAAA;AAAA,IACxC;AACA,IAAA,MAAM,GAAA,GAAM,MAAM,MAAA,CAAO,QAAA,CAAS,OAAO,CAAA;AACzC,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AAAA,EACA,OAAA,EAAS,CAAC,CAAC,OAAA;AAAA;AAAA,EAEX,SAAA,EAAW;AACb,CAAC;AAWI,SAAS,cACd,OAAA,EACA,EAAE,UAAU,KAAA,EAAM,GAA2B,EAAC,EACuB;AACrE,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,QAAA,CAAS;AAAA,IACd,GAAG,sBAAA,CAAuB,MAAA,EAAQ,OAAO,CAAA;AAAA;AAAA,IAEzC,gBAAgB,CAAC,OAAA;AAAA,IACjB,sBAAsB,CAAC,OAAA;AAAA,IACvB,oBAAoB,CAAC,OAAA;AAAA;AAAA,IAErB,MAAA,EAAQ;AAAA,GACT,CAAA;AACH;AAQO,SAAS,oBAAA,CACd,QAAA,EACA,MAAA,EACA,QAAA,EACK;AACL,EAAA,MAAM,SAAS,eAAA,EAAgB;AAE/B,EAAA,OAAO,UAAA,CAAW;AAAA,IAChB,OAAA,EAAS,QAAA,CAAS,GAAA,CAAI,CAAA,OAAA,MAAY;AAAA,MAChC,GAAG,sBAAA,CAAuB,MAAA,EAAQ,OAAO,CAAA;AAAA,MACzC,cAAA,EAAgB,KAAA;AAAA,MAChB,oBAAA,EAAsB,KAAA;AAAA,MACtB,kBAAA,EAAoB,KAAA;AAAA,MACpB,MAAA,EAAQ,CAAC,IAAA,KAAyB,MAAA,CAAO,SAAS,IAAI;AAAA,KACxD,CAAE,CAAA;AAAA,IACF,OAAA,EAAS,aACP,OAAA,CAAQ,GAAA;AAAA,MAAI,CAAC,MAAA,EAAQ,KAAA,KACnB,MAAA,CAAO,IAAA,KAAS,MAAA,GAAY,QAAA,CAAS,QAAA,CAAS,KAAK,CAAA,IAAK,EAAE,CAAA,GAAK,MAAA,CAAO;AAAA;AACxE,GACH,CAAA;AACH;;;;"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const jsxRuntime = require('react/jsx-runtime');
6
6
  const React = require('react');
7
7
  const Button = require('../../../Button-D10WB4vc.cjs');
8
- const dialog = require('../../../dialog-K0q0KOOW.cjs');
8
+ const dialog = require('../../../dialog-D-7Hkb3j.cjs');
9
9
  const fieldBlock = require('../../../field-block-Dr9fbwQx.cjs');
10
10
  const textFieldBlock = require('../../../text-field-block-Dtup2Jqm.cjs');
11
11
  const spinner = require('../../../spinner-B_xKBDo_.cjs');
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { useId, useState } from 'react';
3
3
  import { B as Button } from '../../../Button-BsfLQEC6.js';
4
- import { D as Dialog, c as DialogContent, f as DialogHeader, i as DialogTitle, d as DialogDescription, a as DialogBody, e as DialogFooter } from '../../../dialog-CESxLg8S.js';
4
+ import { D as Dialog, a as DialogContent, b as DialogHeader, c as DialogTitle, d as DialogDescription, e as DialogBody, f as DialogFooter } from '../../../dialog-CZMPDVUj.js';
5
5
  import { F as FieldBlock } from '../../../field-block-DcGeY-_x.js';
6
6
  import { T as TextFieldBlock } from '../../../text-field-block-D7vJZCzd.js';
7
7
  import { S as Spinner } from '../../../spinner-BMRlaJFy.js';
@@ -207,7 +207,9 @@ export declare const traceSpansQueryOptions: (client: MastraClient, traceId: str
207
207
  * these spans -- `input`, `output` and `attributes` included -- so the
208
208
  * projection would only hide content the reader is looking at.
209
209
  */
210
- export declare function useTraceSpans(traceId: string | null | undefined): UseQueryResult<{
210
+ export declare function useTraceSpans(traceId: string | null | undefined, { passive }?: {
211
+ passive?: boolean;
212
+ }): UseQueryResult<{
211
213
  traceId: string;
212
214
  spans: SearchableSpan[];
213
215
  } | null>;
@@ -0,0 +1,9 @@
1
+ import { ComponentProps } from 'react';
2
+ import { Button, TextButtonSize } from '../Button';
3
+ export type DialogActionProps = Omit<ComponentProps<typeof Button>, 'onClick' | 'variant' | 'as' | 'type' | 'size'> & {
4
+ size?: TextButtonSize;
5
+ onConfirm: () => void;
6
+ confirmation?: 'click' | 'hold';
7
+ holdSeconds?: number;
8
+ };
9
+ export declare const DialogAction: import('react').ForwardRefExoticComponent<Omit<DialogActionProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,16 @@
1
+ export type DialogVariant = 'default' | 'new';
2
+ export type DialogIntent = 'default' | 'destructive';
3
+ export type DialogContextValue = {
4
+ variant: DialogVariant;
5
+ intent: DialogIntent;
6
+ pending: boolean;
7
+ };
8
+ export declare const DialogContext: import('react').Context<DialogContextValue>;
9
+ export declare function useDialogContext(): DialogContextValue;
10
+ export declare const dialogActionSizeClasses: {
11
+ readonly xs: "min-h-form-xs leading-ui-xs";
12
+ readonly sm: "min-h-form-sm leading-ui-sm";
13
+ readonly md: "min-h-form-md leading-ui-md";
14
+ readonly lg: "min-h-form-default leading-ui-md";
15
+ };
16
+ export declare const dialogActionLayoutClasses = "h-auto min-w-0 max-w-full whitespace-normal wrap-anywhere max-[22rem]:w-full";
@@ -0,0 +1,64 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { TextButtonSize } from '../Button';
3
+ declare function ConfirmationExample({ holdSeconds, buttonSize, intent, confirmation, title, description, actionLabel, cancelLabel, failFirst, longBody, }: {
4
+ holdSeconds?: number;
5
+ buttonSize?: TextButtonSize;
6
+ intent?: 'default' | 'destructive';
7
+ confirmation?: 'click' | 'hold';
8
+ title?: string;
9
+ description?: string;
10
+ actionLabel?: string;
11
+ cancelLabel?: string;
12
+ failFirst?: boolean;
13
+ longBody?: boolean;
14
+ }): import("react").JSX.Element;
15
+ declare const meta: {
16
+ title: string;
17
+ component: typeof ConfirmationExample;
18
+ parameters: {
19
+ layout: string;
20
+ docs: {
21
+ description: {
22
+ component: string;
23
+ };
24
+ };
25
+ };
26
+ argTypes: {
27
+ holdSeconds: {
28
+ control: {
29
+ type: "number";
30
+ min: number;
31
+ step: number;
32
+ };
33
+ };
34
+ buttonSize: {
35
+ control: "inline-radio";
36
+ options: string[];
37
+ };
38
+ intent: {
39
+ control: "inline-radio";
40
+ options: string[];
41
+ };
42
+ confirmation: {
43
+ control: "inline-radio";
44
+ options: string[];
45
+ };
46
+ };
47
+ args: {
48
+ holdSeconds: number;
49
+ buttonSize: "md";
50
+ intent: "default";
51
+ confirmation: "click";
52
+ failFirst: false;
53
+ longBody: false;
54
+ };
55
+ };
56
+ export default meta;
57
+ type Story = StoryObj<typeof meta>;
58
+ export declare const Default: Story;
59
+ export declare const Destructive: Story;
60
+ export declare const PressAndHold: Story;
61
+ export declare const LongTitleAndLabels: Story;
62
+ export declare const ScrollingBody: Story;
63
+ export declare const ErrorAndRetry: Story;
64
+ export declare const WithForm: Story;
@@ -1,6 +1,14 @@
1
1
  import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
2
+ import { DialogAction } from './dialog-action';
3
+ import { DialogIntent, DialogVariant } from './dialog-context';
4
+ import { TextButtonSize } from '../Button';
2
5
  import * as React from 'react';
3
- declare const Dialog: typeof DialogPrimitive.Root;
6
+ export type DialogProps = DialogPrimitive.Root.Props & {
7
+ variant?: DialogVariant;
8
+ intent?: DialogIntent;
9
+ pending?: boolean;
10
+ };
11
+ declare function Dialog({ variant, intent, pending, onOpenChange, ...props }: DialogProps): React.JSX.Element;
4
12
  type DialogTriggerProps = DialogPrimitive.Trigger.Props & {
5
13
  /** @deprecated Use Base UI's native `render` prop instead for stronger composition typing. */
6
14
  asChild?: boolean;
@@ -30,10 +38,7 @@ declare const DialogFooter: {
30
38
  ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
31
39
  displayName: string;
32
40
  };
33
- declare const DialogBody: {
34
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
35
- displayName: string;
36
- };
41
+ declare const DialogBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
37
42
  type DialogTitleProps = Omit<DialogPrimitive.Title.Props, 'className'> & {
38
43
  className?: string;
39
44
  };
@@ -42,4 +47,8 @@ type DialogDescriptionProps = Omit<DialogPrimitive.Description.Props, 'className
42
47
  className?: string;
43
48
  };
44
49
  declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
45
- export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogBody, DialogTitle, DialogDescription, };
50
+ type DialogCancelProps = DialogPrimitive.Close.Props & {
51
+ size?: TextButtonSize;
52
+ };
53
+ declare const DialogCancel: React.ForwardRefExoticComponent<Omit<DialogCancelProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
54
+ export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogBody, DialogTitle, DialogDescription, DialogCancel, DialogAction, };
@@ -1 +1,3 @@
1
1
  export * from './dialog';
2
+ export type { DialogActionProps } from './dialog-action';
3
+ export type { DialogIntent, DialogVariant } from './dialog-context';
@@ -0,0 +1,2 @@
1
+ import { IntegrationDialogItem } from '../integration-dialog';
2
+ export declare const integrationsCatalog: IntegrationDialogItem[];
@@ -0,0 +1,2 @@
1
+ export { IntegrationDialog } from './integration-dialog';
2
+ export type { IntegrationDialogItem, IntegrationDialogProps } from './integration-dialog';
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ import { DialogProps } from '../Dialog';
3
+ export type IntegrationDialogItem = {
4
+ id: string;
5
+ name: string;
6
+ logo?: ReactNode;
7
+ badge?: string;
8
+ meta?: string;
9
+ disabled?: boolean;
10
+ };
11
+ export type IntegrationDialogProps = Omit<DialogProps, 'variant' | 'intent' | 'children'> & {
12
+ title: ReactNode;
13
+ description?: ReactNode;
14
+ items: IntegrationDialogItem[];
15
+ onSelect: (item: IntegrationDialogItem) => void;
16
+ searchPlaceholder?: string;
17
+ searchLabel?: string;
18
+ emptyMessage?: ReactNode;
19
+ children?: ReactNode;
20
+ className?: string;
21
+ };
22
+ declare function IntegrationDialog({ title, description, items, onSelect, searchPlaceholder, searchLabel, emptyMessage, children, className, ...props }: IntegrationDialogProps): import("react").JSX.Element;
23
+ declare namespace IntegrationDialog {
24
+ var Trigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogTrigger.Props<unknown> & {
25
+ asChild?: boolean;
26
+ }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
27
+ }
28
+ export { IntegrationDialog };
@@ -0,0 +1,24 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { IntegrationDialogItem } from './integration-dialog';
3
+ declare function Example({ items }: {
4
+ items?: IntegrationDialogItem[];
5
+ }): import("react").JSX.Element;
6
+ declare const meta: {
7
+ title: string;
8
+ component: typeof Example;
9
+ parameters: {
10
+ layout: string;
11
+ docs: {
12
+ description: {
13
+ component: string;
14
+ };
15
+ };
16
+ };
17
+ };
18
+ export default meta;
19
+ type Story = StoryObj<typeof meta>;
20
+ export declare const Default: Story;
21
+ export declare const FewItems: Story;
22
+ export declare const NoLogos: Story;
23
+ export declare const DisabledItem: Story;
24
+ export declare const Empty: Story;