@ekanos/harness 0.26.0 → 0.28.0

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 (159) hide show
  1. package/README.md +6 -4
  2. package/dist/api-types.d.ts +4 -0
  3. package/dist/internal/components/approvals-tray.d.ts +44 -6
  4. package/dist/internal/components/approvals-tray.js +252 -30
  5. package/dist/internal/components/connect-controls.js +4 -2
  6. package/dist/internal/components/connect-dialog.d.ts +8 -1
  7. package/dist/internal/components/connect-dialog.js +23 -10
  8. package/dist/internal/components/connect-panel.d.ts +3 -2
  9. package/dist/internal/components/connect-panel.js +680 -340
  10. package/dist/internal/components/connect-steps.d.ts +72 -0
  11. package/dist/internal/components/connect-steps.js +341 -0
  12. package/dist/internal/components/console-not-found.d.ts +14 -0
  13. package/dist/internal/components/console-not-found.js +57 -0
  14. package/dist/internal/components/dashboard-grid.d.ts +10 -5
  15. package/dist/internal/components/dashboard-grid.js +8 -9
  16. package/dist/internal/components/dev-toolbar.d.ts +27 -5
  17. package/dist/internal/components/dev-toolbar.js +214 -176
  18. package/dist/internal/components/ekanos-logo.d.ts +18 -0
  19. package/dist/internal/components/ekanos-logo.js +74 -0
  20. package/dist/internal/components/events-panel.d.ts +13 -4
  21. package/dist/internal/components/events-panel.js +478 -81
  22. package/dist/internal/components/harness-widget-provider.d.ts +6 -8
  23. package/dist/internal/components/harness-widget-provider.js +5 -19
  24. package/dist/internal/components/health-panel.d.ts +8 -1
  25. package/dist/internal/components/health-panel.js +328 -31
  26. package/dist/internal/components/integration-badge.js +4 -2
  27. package/dist/internal/components/integration-tab-skeletons.d.ts +8 -0
  28. package/dist/internal/components/integration-tab-skeletons.js +76 -0
  29. package/dist/internal/components/not-found-state.d.ts +39 -0
  30. package/dist/internal/components/not-found-state.js +127 -0
  31. package/dist/internal/components/operation-runner-panel.d.ts +1 -1
  32. package/dist/internal/components/operation-runner-panel.js +624 -189
  33. package/dist/internal/components/operation-scope.d.ts +13 -0
  34. package/dist/internal/components/operation-scope.js +79 -0
  35. package/dist/internal/components/page-skeletons.d.ts +11 -0
  36. package/dist/internal/components/page-skeletons.js +61 -0
  37. package/dist/internal/components/provenance-banner.d.ts +13 -4
  38. package/dist/internal/components/provenance-banner.js +35 -10
  39. package/dist/internal/components/run-log-copy.d.ts +17 -0
  40. package/dist/internal/components/run-log-copy.js +67 -0
  41. package/dist/internal/components/run-log-detail.d.ts +22 -0
  42. package/dist/internal/components/run-log-detail.js +295 -0
  43. package/dist/internal/components/run-log-empty.d.ts +13 -0
  44. package/dist/internal/components/run-log-empty.js +46 -0
  45. package/dist/internal/components/run-log.d.ts +23 -3
  46. package/dist/internal/components/run-log.js +384 -130
  47. package/dist/internal/components/runtime-strip.d.ts +5 -1
  48. package/dist/internal/components/runtime-strip.js +115 -10
  49. package/dist/internal/components/schema-form.d.ts +2 -1
  50. package/dist/internal/components/schema-form.js +212 -79
  51. package/dist/internal/components/scrollable-nav.js +14 -2
  52. package/dist/internal/components/segmented-control.d.ts +19 -0
  53. package/dist/internal/components/segmented-control.js +46 -0
  54. package/dist/internal/components/shell-header.d.ts +25 -0
  55. package/dist/internal/components/shell-header.js +126 -0
  56. package/dist/internal/components/surface-nav.d.ts +12 -3
  57. package/dist/internal/components/surface-nav.js +72 -83
  58. package/dist/internal/components/widget-surface.d.ts +5 -1
  59. package/dist/internal/components/widget-surface.js +86 -14
  60. package/dist/internal/components/workflow-runner.d.ts +23 -10
  61. package/dist/internal/components/workflow-runner.js +451 -69
  62. package/dist/internal/lib/connect-model.d.ts +134 -0
  63. package/dist/internal/lib/connect-model.js +282 -0
  64. package/dist/internal/lib/connection-facts.js +2 -1
  65. package/dist/internal/lib/console-client.js +5 -2
  66. package/dist/internal/lib/console-hooks.d.ts +4 -1
  67. package/dist/internal/lib/console-hooks.js +3 -2
  68. package/dist/internal/lib/console-types.d.ts +6 -0
  69. package/dist/internal/lib/docs-links.d.ts +28 -0
  70. package/dist/internal/lib/docs-links.js +57 -1
  71. package/dist/internal/lib/event-delivery.d.ts +33 -0
  72. package/dist/internal/lib/event-delivery.js +66 -0
  73. package/dist/internal/lib/experience-runtime.d.ts +2 -1
  74. package/dist/internal/lib/experience-runtime.js +5 -3
  75. package/dist/internal/lib/font-files/OFL-BricolageGrotesque.txt +93 -0
  76. package/dist/internal/lib/font-files/OFL-Figtree.txt +93 -0
  77. package/dist/internal/lib/font-files/bricolage-grotesque-latin-variable.woff2 +0 -0
  78. package/dist/internal/lib/font-files/figtree-latin-variable.woff2 +0 -0
  79. package/dist/internal/lib/fonts.js +13 -12
  80. package/dist/internal/lib/health-model.d.ts +58 -0
  81. package/dist/internal/lib/health-model.js +140 -0
  82. package/dist/internal/lib/integration-console-href.d.ts +15 -0
  83. package/dist/internal/lib/integration-console-href.js +16 -0
  84. package/dist/internal/lib/oauth-setup-guide.d.ts +28 -0
  85. package/dist/internal/lib/oauth-setup-guide.js +35 -1
  86. package/dist/internal/lib/operation-catalog.d.ts +70 -0
  87. package/dist/internal/lib/operation-catalog.js +261 -0
  88. package/dist/internal/lib/overview-model.d.ts +34 -0
  89. package/dist/internal/lib/overview-model.js +91 -0
  90. package/dist/internal/lib/registry-entry.d.ts +8 -0
  91. package/dist/internal/lib/registry-entry.js +11 -0
  92. package/dist/internal/lib/repo-name.d.ts +9 -0
  93. package/dist/internal/lib/repo-name.js +21 -0
  94. package/dist/internal/lib/run-log-view.d.ts +66 -1
  95. package/dist/internal/lib/run-log-view.js +183 -4
  96. package/dist/internal/lib/runner-view.d.ts +15 -0
  97. package/dist/internal/lib/runner-view.js +18 -0
  98. package/dist/internal/lib/schema-form-model.d.ts +17 -0
  99. package/dist/internal/lib/schema-form-model.js +50 -0
  100. package/dist/internal/lib/setup-checklist.d.ts +34 -0
  101. package/dist/internal/lib/setup-checklist.js +79 -0
  102. package/dist/internal/lib/toolbar-context.d.ts +0 -1
  103. package/dist/internal/lib/toolbar-context.js +0 -2
  104. package/dist/internal/lib/toolbar-visibility.d.ts +9 -2
  105. package/dist/internal/lib/toolbar-visibility.js +5 -0
  106. package/dist/internal/lib/use-operation-effects.d.ts +7 -0
  107. package/dist/internal/lib/use-operation-effects.js +28 -0
  108. package/dist/internal/lib/use-run-log-query.d.ts +9 -0
  109. package/dist/internal/lib/use-run-log-query.js +35 -0
  110. package/dist/internal/lib/widget-grid-gaps.d.ts +18 -0
  111. package/dist/internal/lib/widget-grid-gaps.js +41 -0
  112. package/dist/internal/lib/workflow-summary.d.ts +54 -0
  113. package/dist/internal/lib/workflow-summary.js +147 -0
  114. package/dist/internal/routes/console-home-page.js +2 -1
  115. package/dist/internal/routes/experience-connect-page.js +51 -22
  116. package/dist/internal/routes/experience-layout-page.js +75 -26
  117. package/dist/internal/routes/experience-page-host.js +63 -5
  118. package/dist/internal/routes/experience-review-queue-page.d.ts +4 -1
  119. package/dist/internal/routes/experience-review-queue-page.js +108 -12
  120. package/dist/internal/routes/experience-runs-page.js +57 -4
  121. package/dist/internal/routes/experience-summary-page.d.ts +19 -0
  122. package/dist/internal/routes/experience-summary-page.js +219 -62
  123. package/dist/internal/routes/experience-widget-page.js +58 -7
  124. package/dist/internal/routes/experience-widgets-page.d.ts +2 -3
  125. package/dist/internal/routes/experience-widgets-page.js +29 -4
  126. package/dist/internal/routes/experience-workflow-page.js +81 -9
  127. package/dist/internal/routes/experience-workflows-page.js +85 -21
  128. package/dist/internal/routes/integration-layout.js +28 -3
  129. package/dist/internal/routes/integrations-connect-page.js +16 -6
  130. package/dist/internal/routes/integrations-events-page.js +22 -1
  131. package/dist/internal/routes/integrations-health-page.js +16 -1
  132. package/dist/internal/routes/integrations-layout.js +28 -4
  133. package/dist/internal/routes/integrations-list-page.d.ts +0 -1
  134. package/dist/internal/routes/integrations-list-page.js +11 -9
  135. package/dist/internal/routes/integrations-operation-page.js +53 -17
  136. package/dist/internal/routes/integrations-operations-page.js +539 -49
  137. package/dist/internal/routes/integrations-overview-page.js +332 -69
  138. package/dist/internal/routes/integrations-runs-page.js +53 -3
  139. package/dist/internal/routes/integrations-scope.d.ts +15 -2
  140. package/dist/internal/routes/integrations-scope.js +66 -18
  141. package/dist/internal/routes/preview-index-page.js +2 -2
  142. package/dist/internal/routes/repo-home-page.d.ts +2 -2
  143. package/dist/internal/routes/repo-home-page.js +428 -236
  144. package/dist/internal/routes/repo-layout.d.ts +12 -0
  145. package/dist/internal/routes/repo-layout.js +50 -38
  146. package/dist/internal/routes/repo-package-layouts.js +22 -8
  147. package/dist/internal/routes/single-widget-page.d.ts +1 -1
  148. package/dist/internal/routes/single-widget-page.js +28 -5
  149. package/dist/internal/routes/tile-page.d.ts +1 -1
  150. package/dist/internal/routes/tile-page.js +1 -2
  151. package/dist/internal/routes/widgets-page.d.ts +1 -1
  152. package/dist/internal/routes/widgets-page.js +5 -3
  153. package/dist/internal/server/ekanos-api-router.js +20 -5
  154. package/dist/internal/server/repo-api-router.js +20 -7
  155. package/dist/registry.d.ts +4 -5
  156. package/dist/registry.js +0 -1
  157. package/dist/routes.d.ts +5 -0
  158. package/dist/routes.js +2 -0
  159. package/package.json +8 -8
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useState } from "react";
3
+ import { useId, useState } from "react";
4
4
  import { usePathname } from "next/navigation";
5
5
  import { Button } from "@ekanos/ui/button";
6
+ import { Card } from "@ekanos/ui/card";
6
7
  import { Icon } from "@ekanos/ui/icon";
7
- import { Label } from "@ekanos/ui/label";
8
8
  import {
9
9
  Select,
10
10
  SelectContent,
@@ -13,8 +13,8 @@ import {
13
13
  SelectValue
14
14
  } from "@ekanos/ui/select";
15
15
  import { Switch } from "@ekanos/ui/switch";
16
+ import { Tooltip, TooltipContent, TooltipTrigger } from "@ekanos/ui/tooltip";
16
17
  import { cn } from "@ekanos/ui/utils";
17
- import { useTheme } from "next-themes";
18
18
  import {
19
19
  DATA_MODES,
20
20
  FIXTURE_VARIANTS,
@@ -24,25 +24,55 @@ import {
24
24
  supportsLiveMode
25
25
  } from "../../registry.js";
26
26
  import { setChromeSlot } from "../lib/chrome-slot.js";
27
- import { HARNESS_DOCS_URL } from "../lib/docs-links.js";
28
- import { getThemeToggleAccessibleLabel } from "../lib/theme-toggle.js";
29
27
  import {
30
28
  RENDER_STATES,
31
29
  VIEWPORTS,
32
30
  useRepoMode,
33
31
  useToolbar
34
32
  } from "../lib/toolbar-context.js";
35
- import { toolbarControlsFor } from "../lib/toolbar-visibility.js";
33
+ import {
34
+ rendersInlineControls,
35
+ toolbarControlsFor
36
+ } from "../lib/toolbar-visibility.js";
36
37
  import { useHarnessRegistry } from "../registry-context.js";
37
- import { DocsLink } from "./docs-link.js";
38
38
  import { FOCUS_RING } from "./scrollable-nav.js";
39
+ import { SegmentedControl } from "./segmented-control.js";
40
+ const CONTROL_HELP = {
41
+ renderState: "The state the dashboard hands every widget: active is normal; loading and error show those states; inactive is a widget not switched on for the account; disabled is one switched off or unhealthy. Check each draws something sensible.",
42
+ data: "Fixtures answer from recorded data. Live API calls the real service with your local credentials, for integrations that declare a live block.",
43
+ variant: "Which recorded fixtures answer the widgets: default data, empty (no rows) or error (every read fails).",
44
+ viewport: "Narrows the preview to a phone, tablet or desktop width. Widgets lay out by their container width, so this is the width they respond to.",
45
+ unhealthy: "Simulates the integration's health check failing after it once succeeded. The dashboard then shows an active widget as disabled, as production does."
46
+ };
47
+ function HelpTip({ label, help }) {
48
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
49
+ /* @__PURE__ */ jsx(
50
+ TooltipTrigger,
51
+ {
52
+ className: cn(
53
+ "text-muted-foreground hover:text-foreground inline-flex size-5 items-center justify-center rounded-full",
54
+ FOCUS_RING
55
+ ),
56
+ "aria-label": `What ${label} does`,
57
+ "data-test": "toolbar-help",
58
+ children: /* @__PURE__ */ jsx(Icon, { name: "info", className: "h-3.5 w-3.5" })
59
+ }
60
+ ),
61
+ /* @__PURE__ */ jsx(TooltipContent, { className: "max-w-xs", children: help })
62
+ ] });
63
+ }
39
64
  function Field({
40
65
  label,
66
+ help,
41
67
  children
42
68
  }) {
43
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
44
- /* @__PURE__ */ jsx(Label, { className: "text-muted-foreground text-xs", children: label }),
45
- children
69
+ const id = useId();
70
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
71
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5", children: [
72
+ /* @__PURE__ */ jsx("span", { id, className: "text-muted-foreground text-xs font-medium", children: label }),
73
+ /* @__PURE__ */ jsx(HelpTip, { label, help })
74
+ ] }),
75
+ children(id)
46
76
  ] });
47
77
  }
48
78
  const DATA_MODE_LABELS = {
@@ -51,198 +81,206 @@ const DATA_MODE_LABELS = {
51
81
  };
52
82
  function useCurrentIntegration() {
53
83
  const integrations = useHarnessRegistry();
54
- const pathname = usePathname();
55
- const slug = pathname.split("/").filter(Boolean)[0] ?? null;
84
+ const pathname = usePathname() ?? "";
85
+ const segments = pathname.split("/").filter(Boolean);
86
+ const slug = segments[0] === "integrations" ? segments[1] : segments[0] ?? null;
56
87
  return slug ? findIntegration(integrations, slug) : null;
57
88
  }
58
- function DevToolbar() {
89
+ function PreviewControls({
90
+ controls = { widget: true, data: true },
91
+ inline = false
92
+ }) {
59
93
  const { state, setState, reset } = useToolbar();
60
94
  const repo = useRepoMode();
61
- const { resolvedTheme, setTheme } = useTheme();
62
95
  const integration = useCurrentIntegration();
63
96
  const liveAvailable = supportsLiveMode(integration);
64
97
  const effectiveMode = resolveEffectiveDataMode(integration, state.dataMode);
65
98
  const live = liveAvailable && effectiveMode === "live";
66
- const pathname = usePathname();
67
- const controls = toolbarControlsFor(pathname);
68
- const hasControls = controls.widget || controls.data;
69
99
  const [open, setOpen] = useState(false);
70
- return /* @__PURE__ */ jsxs(
71
- "div",
72
- {
73
- className: "bg-card z-40 border-b md:sticky md:top-0",
74
- "data-test": "sticky-chrome",
75
- children: [
76
- /* @__PURE__ */ jsx("div", { ref: setChromeSlot, "data-test": "chrome-slot" }),
77
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-end gap-3 px-4 py-3 sm:px-6 md:gap-5", children: [
78
- hasControls ? /* @__PURE__ */ jsx(
79
- Button,
100
+ const panelId = useId();
101
+ const bar = /* @__PURE__ */ jsxs(Fragment, { children: [
102
+ /* @__PURE__ */ jsxs(
103
+ Button,
104
+ {
105
+ type: "button",
106
+ size: "sm",
107
+ variant: "outline",
108
+ className: "md:hidden",
109
+ "aria-expanded": open,
110
+ "aria-controls": panelId,
111
+ onClick: () => setOpen((value) => !value),
112
+ "data-test": "toolbar-controls-toggle",
113
+ children: [
114
+ /* @__PURE__ */ jsx(Icon, { name: "sliders-horizontal", className: "h-4 w-4" }),
115
+ open ? "Hide controls" : "Preview controls"
116
+ ]
117
+ }
118
+ ),
119
+ /* @__PURE__ */ jsxs(
120
+ "div",
121
+ {
122
+ id: panelId,
123
+ className: cn(
124
+ "order-last w-full flex-wrap items-center gap-x-4 gap-y-3 md:order-none md:flex md:w-auto md:flex-1",
125
+ open ? "flex" : "hidden"
126
+ ),
127
+ "data-test": "toolbar-controls",
128
+ children: [
129
+ controls.widget ? /* @__PURE__ */ jsx(Field, { label: "Render state", help: CONTROL_HELP.renderState, children: (labelId) => /* @__PURE__ */ jsxs(
130
+ Select,
80
131
  {
81
- type: "button",
82
- size: "sm",
83
- variant: "outline",
84
- className: "md:hidden",
85
- "aria-expanded": open,
86
- "aria-controls": "toolbar-controls",
87
- onClick: () => setOpen((value) => !value),
88
- "data-test": "toolbar-controls-toggle",
89
- children: open ? "Hide controls" : "Preview controls"
90
- }
91
- ) : null,
92
- hasControls ? /* @__PURE__ */ jsxs(
93
- "div",
94
- {
95
- id: "toolbar-controls",
96
- className: cn(
97
- "order-last w-full flex-wrap items-end gap-5 md:order-none md:flex md:w-auto",
98
- open ? "flex" : "hidden"
99
- ),
100
- "data-test": "toolbar-controls",
132
+ value: state.renderState,
133
+ onValueChange: (value) => setState({
134
+ renderState: value
135
+ }),
101
136
  children: [
102
- controls.widget ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Field, { label: "Render state", children: /* @__PURE__ */ jsxs(
103
- Select,
137
+ /* @__PURE__ */ jsx(
138
+ SelectTrigger,
104
139
  {
105
- value: state.renderState,
106
- onValueChange: (value) => setState({
107
- renderState: value
108
- }),
109
- children: [
110
- /* @__PURE__ */ jsx(
111
- SelectTrigger,
112
- {
113
- className: "w-36",
114
- "data-test": "toolbar-render-state",
115
- children: /* @__PURE__ */ jsx(SelectValue, {})
116
- }
117
- ),
118
- /* @__PURE__ */ jsx(SelectContent, { children: RENDER_STATES.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: value }, value)) })
119
- ]
140
+ size: "sm",
141
+ className: "w-24",
142
+ "aria-labelledby": labelId,
143
+ "data-test": "toolbar-render-state",
144
+ children: /* @__PURE__ */ jsx(SelectValue, {})
120
145
  }
121
- ) }) }) : null,
122
- controls.data ? /* @__PURE__ */ jsx(Fragment, { children: repo ? null : /* @__PURE__ */ jsx(Field, { label: "Data", children: /* @__PURE__ */ jsxs(
123
- Select,
146
+ ),
147
+ /* @__PURE__ */ jsx(SelectContent, { children: RENDER_STATES.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: value }, value)) })
148
+ ]
149
+ }
150
+ ) }) : null,
151
+ controls.data && !repo && integration ? /* @__PURE__ */ jsx(Field, { label: "Data", help: CONTROL_HELP.data, children: (labelId) => /* @__PURE__ */ jsxs(
152
+ Select,
153
+ {
154
+ value: effectiveMode,
155
+ onValueChange: (value) => setState({ dataMode: value }),
156
+ disabled: !liveAvailable,
157
+ children: [
158
+ /* @__PURE__ */ jsx(
159
+ SelectTrigger,
124
160
  {
125
- value: effectiveMode,
126
- onValueChange: (value) => setState({ dataMode: value }),
127
- disabled: !liveAvailable,
128
- children: [
129
- /* @__PURE__ */ jsx(
130
- SelectTrigger,
131
- {
132
- className: "w-32",
133
- "data-test": "toolbar-data-mode",
134
- children: /* @__PURE__ */ jsx(SelectValue, {})
135
- }
136
- ),
137
- /* @__PURE__ */ jsx(SelectContent, { children: DATA_MODES.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: DATA_MODE_LABELS[value] }, value)) })
138
- ]
161
+ size: "sm",
162
+ className: "w-24",
163
+ "aria-labelledby": labelId,
164
+ "data-test": "toolbar-data-mode",
165
+ children: /* @__PURE__ */ jsx(SelectValue, {})
139
166
  }
140
- ) }) }) : null,
141
- controls.widget ? /* @__PURE__ */ jsxs(Fragment, { children: [
142
- /* @__PURE__ */ jsx(Field, { label: "Fixture scenario", children: /* @__PURE__ */ jsxs(
143
- Select,
144
- {
145
- value: state.variant,
146
- onValueChange: (value) => setState({ variant: value }),
147
- disabled: live,
148
- children: [
149
- /* @__PURE__ */ jsx(SelectTrigger, { className: "w-32", "data-test": "toolbar-variant", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
150
- /* @__PURE__ */ jsx(SelectContent, { children: FIXTURE_VARIANTS.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: value }, value)) })
151
- ]
152
- }
153
- ) }),
154
- /* @__PURE__ */ jsx(Field, { label: "Viewport", children: /* @__PURE__ */ jsx("div", { className: "flex gap-1", children: Object.keys(VIEWPORTS).map((key) => /* @__PURE__ */ jsx(
155
- Button,
156
- {
157
- size: "sm",
158
- variant: state.viewport === key ? "default" : "outline",
159
- onClick: () => setState({ viewport: key }),
160
- children: VIEWPORTS[key].label
161
- },
162
- key
163
- )) }) }),
164
- /* @__PURE__ */ jsx(Field, { label: "Collapsed", children: /* @__PURE__ */ jsx(
165
- Switch,
166
- {
167
- checked: state.collapsed,
168
- onCheckedChange: (checked) => setState({ collapsed: checked }),
169
- "aria-label": "Toggle collapsed"
170
- }
171
- ) }),
172
- /* @__PURE__ */ jsx(Field, { label: "Unhealthy", children: /* @__PURE__ */ jsx(
173
- Switch,
174
- {
175
- checked: state.unhealthy,
176
- onCheckedChange: (checked) => setState({ unhealthy: checked }),
177
- "aria-label": "Simulate unhealthy integration"
178
- }
179
- ) })
180
- ] }) : null
167
+ ),
168
+ /* @__PURE__ */ jsx(SelectContent, { children: DATA_MODES.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: DATA_MODE_LABELS[value] }, value)) })
181
169
  ]
182
170
  }
183
- ) : null,
184
- /* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
185
- /* @__PURE__ */ jsx(
186
- DocsLink,
171
+ ) }) : null,
172
+ controls.widget ? /* @__PURE__ */ jsxs(Fragment, { children: [
173
+ /* @__PURE__ */ jsx(Field, { label: "Scenario", help: CONTROL_HELP.variant, children: (labelId) => /* @__PURE__ */ jsxs(
174
+ Select,
187
175
  {
188
- href: HARNESS_DOCS_URL,
189
- className: cn("rounded-md", FOCUS_RING),
190
- "data-test": "toolbar-docs-link",
191
- children: "Docs"
192
- }
193
- ),
194
- live && controls.data ? /* @__PURE__ */ jsxs(
195
- "span",
196
- {
197
- className: "text-primary flex items-center gap-2 text-sm font-medium",
198
- "data-test": "toolbar-live-badge",
199
- children: [
200
- /* @__PURE__ */ jsx(Icon, { name: "broadcast", className: "h-4 w-4" }),
201
- "Reaching ",
202
- resolveEgress(integration).join(", ")
203
- ]
204
- }
205
- ) : null,
206
- /* @__PURE__ */ jsxs(
207
- Button,
208
- {
209
- size: "sm",
210
- variant: "outline",
211
- onClick: () => setTheme(resolvedTheme === "dark" ? "light" : "dark"),
212
- "aria-label": getThemeToggleAccessibleLabel(resolvedTheme),
176
+ value: state.variant,
177
+ onValueChange: (value) => setState({ variant: value }),
178
+ disabled: live,
213
179
  children: [
214
- /* @__PURE__ */ jsxs(
215
- "span",
180
+ /* @__PURE__ */ jsx(
181
+ SelectTrigger,
216
182
  {
217
- "aria-hidden": "true",
218
- className: cn("flex items-center dark:hidden"),
219
- children: [
220
- /* @__PURE__ */ jsx(Icon, { name: "moon", className: "mr-2 h-4 w-4" }),
221
- "Dark"
222
- ]
183
+ size: "sm",
184
+ className: "w-24",
185
+ "aria-labelledby": labelId,
186
+ "data-test": "toolbar-variant",
187
+ children: /* @__PURE__ */ jsx(SelectValue, {})
223
188
  }
224
189
  ),
225
- /* @__PURE__ */ jsxs(
226
- "span",
227
- {
228
- "aria-hidden": "true",
229
- className: cn("hidden items-center dark:flex"),
230
- children: [
231
- /* @__PURE__ */ jsx(Icon, { name: "sun", className: "mr-2 h-4 w-4" }),
232
- "Light"
233
- ]
234
- }
235
- )
190
+ /* @__PURE__ */ jsx(SelectContent, { children: FIXTURE_VARIANTS.map((value) => /* @__PURE__ */ jsx(SelectItem, { value, children: value }, value)) })
236
191
  ]
237
192
  }
238
- ),
239
- hasControls ? /* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: reset, children: "Reset" }) : null
240
- ] })
241
- ] })
242
- ]
193
+ ) }),
194
+ /* @__PURE__ */ jsx(Field, { label: "Viewport", help: CONTROL_HELP.viewport, children: () => /* @__PURE__ */ jsx(
195
+ SegmentedControl,
196
+ {
197
+ label: "Viewport",
198
+ testPrefix: "toolbar-viewport",
199
+ value: state.viewport,
200
+ onChange: (viewport) => setState({ viewport }),
201
+ options: Object.keys(VIEWPORTS).map(
202
+ (key) => ({ value: key, label: VIEWPORTS[key].label })
203
+ )
204
+ }
205
+ ) }),
206
+ /* @__PURE__ */ jsx(Field, { label: "Unhealthy", help: CONTROL_HELP.unhealthy, children: (labelId) => /* @__PURE__ */ jsx(
207
+ Switch,
208
+ {
209
+ checked: state.unhealthy,
210
+ onCheckedChange: (checked) => setState({ unhealthy: checked }),
211
+ "aria-labelledby": labelId,
212
+ "data-test": "toolbar-unhealthy"
213
+ }
214
+ ) })
215
+ ] }) : null
216
+ ]
217
+ }
218
+ ),
219
+ /* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
220
+ live && controls.data ? /* @__PURE__ */ jsxs(
221
+ "span",
222
+ {
223
+ className: "text-primary flex items-center gap-2 text-sm font-medium",
224
+ "data-test": "toolbar-live-badge",
225
+ children: [
226
+ /* @__PURE__ */ jsx(Icon, { name: "broadcast", className: "h-4 w-4" }),
227
+ "Reaching ",
228
+ resolveEgress(integration).join(", ")
229
+ ]
230
+ }
231
+ ) : null,
232
+ /* @__PURE__ */ jsxs(
233
+ Button,
234
+ {
235
+ size: "sm",
236
+ variant: "ghost",
237
+ onClick: reset,
238
+ title: "Put every preview control back to its default",
239
+ "aria-label": "Reset preview controls",
240
+ "data-test": "toolbar-reset",
241
+ children: [
242
+ /* @__PURE__ */ jsx(Icon, { name: "arrow-counter-clockwise", className: "h-4 w-4" }),
243
+ inline ? null : "Reset"
244
+ ]
245
+ }
246
+ )
247
+ ] })
248
+ ] });
249
+ const shared = {
250
+ role: "toolbar",
251
+ "aria-label": "Preview controls",
252
+ className: "flex flex-wrap items-center gap-x-4 gap-y-3"
253
+ };
254
+ return inline ? /* @__PURE__ */ jsx(
255
+ Card,
256
+ {
257
+ layout: "bleed",
258
+ ...shared,
259
+ className: cn(shared.className, "sticky top-2 z-20 flex-row px-3 py-2"),
260
+ "data-test": "preview-controls",
261
+ children: bar
262
+ }
263
+ ) : /* @__PURE__ */ jsx(
264
+ "div",
265
+ {
266
+ ...shared,
267
+ className: cn(shared.className, "bg-card border-b px-4 py-3 sm:px-6"),
268
+ "data-test": "toolbar-band",
269
+ children: bar
243
270
  }
244
271
  );
245
272
  }
273
+ function DevToolbar() {
274
+ const pathname = usePathname() ?? "/";
275
+ const controls = toolbarControlsFor(pathname);
276
+ const band = (controls.widget || controls.data) && !rendersInlineControls(pathname);
277
+ return /* @__PURE__ */ jsxs("div", { className: "bg-card z-40 md:sticky md:top-0", "data-test": "sticky-chrome", children: [
278
+ /* @__PURE__ */ jsx("div", { ref: setChromeSlot, "data-test": "chrome-slot" }),
279
+ band ? /* @__PURE__ */ jsx(PreviewControls, { controls }) : null
280
+ ] });
281
+ }
246
282
  export {
247
- DevToolbar
283
+ CONTROL_HELP,
284
+ DevToolbar,
285
+ PreviewControls
248
286
  };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The logo's lowercase e in white on a tile of its gradient. The e carries a
3
+ * stroke of its own fill so the hairline holds at small sizes.
4
+ */
5
+ export declare function EkanosMark({ className }: {
6
+ className?: string;
7
+ }): import("react").JSX.Element;
8
+ /**
9
+ * The wordmark in the current text colour. Its strokes are hairlines, so it
10
+ * takes a stroke of its own fill to stay legible at header size.
11
+ */
12
+ export declare function EkanosWordmark({ className }: {
13
+ className?: string;
14
+ }): import("react").JSX.Element;
15
+ /** The logo as the way home: the mark always, the wordmark beside it from `sm`. */
16
+ export declare function EkanosHomeLink({ className }: {
17
+ className?: string;
18
+ }): import("react").JSX.Element;
@@ -0,0 +1,74 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import Link from "next/link";
3
+ import { cn } from "@ekanos/ui/utils";
4
+ import { FOCUS_RING } from "./scrollable-nav.js";
5
+ const E_PATH = "M12.33,35.86c0-8.12,5.95-14.07,14.4-14.07s14.34,5.95,14.34,14.07v.11H13.79c.05,7.25,5.2,12.66,12.93,12.66,5.47,0,9.69-2.71,11.69-6.93h1.52c-2.06,4.98-6.93,8.23-13.21,8.23-8.44,0-14.4-5.95-14.4-14.07ZM39.6,34.67c-.54-6.71-5.57-11.58-12.88-11.58s-12.39,4.87-12.93,11.58h25.82Z";
6
+ const WORDMARK_REST = "M44.45,10.8h1.41v24.08l17.43-12.39h2.22l-18.02,12.88,18.62,13.86h-2.27l-17.97-13.37v13.37h-1.41V10.8ZM64.54,35.86c0-8.12,5.95-14.07,14.4-14.07s14.34,5.9,14.34,14.18v13.26h-1.35v-7.58c-2.22,5.3-6.98,8.28-13.04,8.28-8.39,0-14.34-5.95-14.34-14.07ZM91.88,35.86c0-7.31-5.2-12.77-12.94-12.77s-12.94,5.47-12.94,12.77,5.2,12.77,12.94,12.77,12.94-5.47,12.94-12.77ZM96.66,35.21c0-8.82,5.3-13.42,13.21-13.42s13.21,4.6,13.21,13.42v14.02h-1.41v-14.02c0-7.74-4.66-12.12-11.8-12.12s-11.8,4.38-11.8,12.12v14.02h-1.41v-14.02ZM126.34,35.86c0-8.12,5.95-14.07,14.4-14.07s14.4,5.95,14.4,14.07-5.95,14.07-14.4,14.07-14.4-5.95-14.4-14.07ZM153.67,35.86c0-7.31-5.2-12.77-12.94-12.77s-12.94,5.47-12.94,12.77,5.2,12.77,12.94,12.77,12.94-5.47,12.94-12.77ZM157.58,41.98h1.41c.16,3.9,3.73,6.71,9.31,6.71s9.15-2.92,9.15-6.87c0-4.44-4.38-4.87-9.04-5.41-4.93-.54-10.12-1.14-10.12-6.6,0-4.87,4.06-8.01,9.9-8.01s9.8,3.3,9.9,7.69h-1.41c-.11-3.84-3.3-6.39-8.5-6.39s-8.44,2.6-8.44,6.55c0,4.55,4.38,4.93,9.04,5.47,4.93.54,10.12,1.14,10.12,6.55,0,4.82-4.17,8.28-10.66,8.28s-10.5-3.41-10.66-7.96Z";
7
+ const LOGO_GRADIENT = "[background-image:linear-gradient(to_top_in_oklab,oklch(0.603_0.2347_26.99)_0%,oklch(0.5727_0.1707_21.07)_23%,oklch(0.6043_0.0435_4.7)_59%,oklch(0.6596_0.0336_211.63)_85%,oklch(0.687_0.0565_204.87)_100%)]";
8
+ function EkanosMark({ className }) {
9
+ return /* @__PURE__ */ jsx(
10
+ "svg",
11
+ {
12
+ viewBox: "0 0 24 24",
13
+ "aria-hidden": "true",
14
+ focusable: "false",
15
+ className: cn("size-7 shrink-0 rounded-md", LOGO_GRADIENT, className),
16
+ children: /* @__PURE__ */ jsx(
17
+ "path",
18
+ {
19
+ transform: "translate(-0.07 -4.21) scale(0.452)",
20
+ fill: "oklch(1 0 0)",
21
+ stroke: "oklch(1 0 0)",
22
+ strokeWidth: "1.6",
23
+ strokeLinejoin: "round",
24
+ d: E_PATH
25
+ }
26
+ )
27
+ }
28
+ );
29
+ }
30
+ function EkanosWordmark({ className }) {
31
+ return /* @__PURE__ */ jsx(
32
+ "svg",
33
+ {
34
+ viewBox: "12.3 10.8 166 39.2",
35
+ "aria-hidden": "true",
36
+ focusable: "false",
37
+ className: cn("h-5 w-auto shrink-0", className),
38
+ children: /* @__PURE__ */ jsx(
39
+ "path",
40
+ {
41
+ fill: "currentColor",
42
+ stroke: "currentColor",
43
+ strokeWidth: "0.9",
44
+ strokeLinejoin: "round",
45
+ d: `${E_PATH}${WORDMARK_REST}`
46
+ }
47
+ )
48
+ }
49
+ );
50
+ }
51
+ function EkanosHomeLink({ className }) {
52
+ return /* @__PURE__ */ jsxs(
53
+ Link,
54
+ {
55
+ href: "/",
56
+ "aria-label": "Ekanos harness home",
57
+ "data-test": "header-logo",
58
+ className: cn(
59
+ "text-foreground flex shrink-0 items-center gap-2 rounded-md",
60
+ FOCUS_RING,
61
+ className
62
+ ),
63
+ children: [
64
+ /* @__PURE__ */ jsx(EkanosMark, {}),
65
+ /* @__PURE__ */ jsx(EkanosWordmark, { className: "hidden sm:block" })
66
+ ]
67
+ }
68
+ );
69
+ }
70
+ export {
71
+ EkanosHomeLink,
72
+ EkanosMark,
73
+ EkanosWordmark
74
+ };
@@ -1,10 +1,19 @@
1
1
  import type { ConsoleEvent, ConsoleIntegration } from '../lib/console-types.js';
2
+ /** An integration with no events: say what an event is and where to go instead. */
3
+ export declare function NoEvents({ integration, operationsHref, }: {
4
+ integration: string;
5
+ operationsHref: string;
6
+ }): import("react").JSX.Element;
2
7
  /**
3
- * Simulated events: pick one of the contract's events, edit its payload, emit.
4
- * Fixtures mode validates the payload and lists the workflow triggers that
5
- * would match; live-local mode runs the integration's own handler.
8
+ * Send a test event: pick one of the contract's events, edit its payload,
9
+ * send it. Fixtures mode validates the payload and lists the workflows that
10
+ * start on it; live mode also runs the integration's own webhook handler.
6
11
  */
7
- export declare function EventsPanel({ integration, events, }: {
12
+ export declare function EventsPanel({ integration, events, base, initialEvent, }: {
8
13
  integration: ConsoleIntegration;
9
14
  events: ConsoleEvent[];
15
+ /** This integration's console, for links into its run log and operations. */
16
+ base: string;
17
+ /** Event name to open with (`?event=`). */
18
+ initialEvent?: string | null;
10
19
  }): import("react").JSX.Element | null;