@surfaces-ui/components 0.0.0-stage → 0.3.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 (270) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +4 -0
  3. package/README.md +51 -2
  4. package/dist/appComponents.d.ts +86 -0
  5. package/dist/appComponents.js +555 -0
  6. package/dist/appComponents.js.map +1 -0
  7. package/dist/chart/BulletGraph.d.ts +44 -0
  8. package/dist/chart/BulletGraph.js +41 -0
  9. package/dist/chart/BulletGraph.js.map +1 -0
  10. package/dist/chart/Chart.d.ts +178 -0
  11. package/dist/chart/Chart.js +285 -0
  12. package/dist/chart/Chart.js.map +1 -0
  13. package/dist/chart/Sparkline.d.ts +35 -0
  14. package/dist/chart/Sparkline.js +38 -0
  15. package/dist/chart/Sparkline.js.map +1 -0
  16. package/dist/chart/advice.d.ts +32 -0
  17. package/dist/chart/advice.js +48 -0
  18. package/dist/chart/advice.js.map +1 -0
  19. package/dist/chart/option.d.ts +90 -0
  20. package/dist/chart/option.js +252 -0
  21. package/dist/chart/option.js.map +1 -0
  22. package/dist/chart/wheel.d.ts +12 -0
  23. package/dist/chart/wheel.js +21 -0
  24. package/dist/chart/wheel.js.map +1 -0
  25. package/dist/controls/Combobox.d.ts +39 -0
  26. package/dist/controls/Combobox.js +75 -0
  27. package/dist/controls/Combobox.js.map +1 -0
  28. package/dist/controls/ConfirmDialog.d.ts +35 -0
  29. package/dist/controls/ConfirmDialog.js +84 -0
  30. package/dist/controls/ConfirmDialog.js.map +1 -0
  31. package/dist/controls/ItemControls.d.ts +115 -0
  32. package/dist/controls/ItemControls.js +109 -0
  33. package/dist/controls/ItemControls.js.map +1 -0
  34. package/dist/controls/Popover.d.ts +31 -0
  35. package/dist/controls/Popover.js +114 -0
  36. package/dist/controls/Popover.js.map +1 -0
  37. package/dist/controls/ResizeHandle.d.ts +48 -0
  38. package/dist/controls/ResizeHandle.js +91 -0
  39. package/dist/controls/ResizeHandle.js.map +1 -0
  40. package/dist/controls/SegmentedControl.d.ts +27 -0
  41. package/dist/controls/SegmentedControl.js +17 -0
  42. package/dist/controls/SegmentedControl.js.map +1 -0
  43. package/dist/controls/StatusBadge.d.ts +17 -0
  44. package/dist/controls/StatusBadge.js +10 -0
  45. package/dist/controls/StatusBadge.js.map +1 -0
  46. package/dist/controls/context.d.ts +17 -0
  47. package/dist/controls/context.js +2 -0
  48. package/dist/controls/context.js.map +1 -0
  49. package/dist/controls/placement.d.ts +43 -0
  50. package/dist/controls/placement.js +19 -0
  51. package/dist/controls/placement.js.map +1 -0
  52. package/dist/controls/resize.d.ts +23 -0
  53. package/dist/controls/resize.js +49 -0
  54. package/dist/controls/resize.js.map +1 -0
  55. package/dist/data/DataNotes.d.ts +13 -0
  56. package/dist/data/DataNotes.js +18 -0
  57. package/dist/data/DataNotes.js.map +1 -0
  58. package/dist/data/DataSourceProvider.d.ts +11 -0
  59. package/dist/data/DataSourceProvider.js +21 -0
  60. package/dist/data/DataSourceProvider.js.map +1 -0
  61. package/dist/data/export.d.ts +33 -0
  62. package/dist/data/export.js +77 -0
  63. package/dist/data/export.js.map +1 -0
  64. package/dist/data/format.d.ts +44 -0
  65. package/dist/data/format.js +127 -0
  66. package/dist/data/format.js.map +1 -0
  67. package/dist/data/messages.d.ts +13 -0
  68. package/dist/data/messages.js +2 -0
  69. package/dist/data/messages.js.map +1 -0
  70. package/dist/data/useRowWindow.d.ts +70 -0
  71. package/dist/data/useRowWindow.js +175 -0
  72. package/dist/data/useRowWindow.js.map +1 -0
  73. package/dist/discovery/AskData.d.ts +22 -0
  74. package/dist/discovery/AskData.js +49 -0
  75. package/dist/discovery/AskData.js.map +1 -0
  76. package/dist/discovery/ContextBuilder.d.ts +49 -0
  77. package/dist/discovery/ContextBuilder.js +167 -0
  78. package/dist/discovery/ContextBuilder.js.map +1 -0
  79. package/dist/discovery/DataSearch.d.ts +27 -0
  80. package/dist/discovery/DataSearch.js +73 -0
  81. package/dist/discovery/DataSearch.js.map +1 -0
  82. package/dist/discovery/ObjectDetail.d.ts +38 -0
  83. package/dist/discovery/ObjectDetail.js +129 -0
  84. package/dist/discovery/ObjectDetail.js.map +1 -0
  85. package/dist/discovery/RelationshipGraph.d.ts +19 -0
  86. package/dist/discovery/RelationshipGraph.js +64 -0
  87. package/dist/discovery/RelationshipGraph.js.map +1 -0
  88. package/dist/discovery/shared.d.ts +38 -0
  89. package/dist/discovery/shared.js +64 -0
  90. package/dist/discovery/shared.js.map +1 -0
  91. package/dist/editor/SqlEditor.d.ts +41 -0
  92. package/dist/editor/SqlEditor.js +181 -0
  93. package/dist/editor/SqlEditor.js.map +1 -0
  94. package/dist/explore/Explorer.d.ts +110 -0
  95. package/dist/explore/Explorer.js +471 -0
  96. package/dist/explore/Explorer.js.map +1 -0
  97. package/dist/explore/ModelLineage.d.ts +22 -0
  98. package/dist/explore/ModelLineage.js +70 -0
  99. package/dist/explore/ModelLineage.js.map +1 -0
  100. package/dist/explore/ReportBuilder.d.ts +39 -0
  101. package/dist/explore/ReportBuilder.js +98 -0
  102. package/dist/explore/ReportBuilder.js.map +1 -0
  103. package/dist/explore/SemanticModelEditor.d.ts +60 -0
  104. package/dist/explore/SemanticModelEditor.js +220 -0
  105. package/dist/explore/SemanticModelEditor.js.map +1 -0
  106. package/dist/explore/SemanticRows.d.ts +42 -0
  107. package/dist/explore/SemanticRows.js +121 -0
  108. package/dist/explore/SemanticRows.js.map +1 -0
  109. package/dist/explore/SemanticsProvider.d.ts +31 -0
  110. package/dist/explore/SemanticsProvider.js +72 -0
  111. package/dist/explore/SemanticsProvider.js.map +1 -0
  112. package/dist/explore/model.d.ts +151 -0
  113. package/dist/explore/model.js +344 -0
  114. package/dist/explore/model.js.map +1 -0
  115. package/dist/explore/report.d.ts +60 -0
  116. package/dist/explore/report.js +92 -0
  117. package/dist/explore/report.js.map +1 -0
  118. package/dist/explore/semantic-proposal.d.ts +44 -0
  119. package/dist/explore/semantic-proposal.js +67 -0
  120. package/dist/explore/semantic-proposal.js.map +1 -0
  121. package/dist/explore/semantic.d.ts +44 -0
  122. package/dist/explore/semantic.js +154 -0
  123. package/dist/explore/semantic.js.map +1 -0
  124. package/dist/files/FileBrowser.d.ts +42 -0
  125. package/dist/files/FileBrowser.js +314 -0
  126. package/dist/files/FileBrowser.js.map +1 -0
  127. package/dist/files/files.d.ts +65 -0
  128. package/dist/files/files.js +165 -0
  129. package/dist/files/files.js.map +1 -0
  130. package/dist/filter/FilterBar.d.ts +49 -0
  131. package/dist/filter/FilterBar.js +153 -0
  132. package/dist/filter/FilterBar.js.map +1 -0
  133. package/dist/filter/QueryFilters.d.ts +25 -0
  134. package/dist/filter/QueryFilters.js +58 -0
  135. package/dist/filter/QueryFilters.js.map +1 -0
  136. package/dist/form/Form.d.ts +76 -0
  137. package/dist/form/Form.js +131 -0
  138. package/dist/form/Form.js.map +1 -0
  139. package/dist/graph/NodeGraph.d.ts +30 -0
  140. package/dist/graph/NodeGraph.js +89 -0
  141. package/dist/graph/NodeGraph.js.map +1 -0
  142. package/dist/graph/model.d.ts +68 -0
  143. package/dist/graph/model.js +122 -0
  144. package/dist/graph/model.js.map +1 -0
  145. package/dist/grid/DataGrid.d.ts +98 -0
  146. package/dist/grid/DataGrid.js +400 -0
  147. package/dist/grid/DataGrid.js.map +1 -0
  148. package/dist/index.d.ts +85 -0
  149. package/dist/index.js +87 -0
  150. package/dist/index.js.map +1 -0
  151. package/dist/locale/SurfacesText.d.ts +17 -0
  152. package/dist/locale/SurfacesText.js +17 -0
  153. package/dist/locale/SurfacesText.js.map +1 -0
  154. package/dist/locale/locale.d.ts +305 -0
  155. package/dist/locale/locale.js +359 -0
  156. package/dist/locale/locale.js.map +1 -0
  157. package/dist/menu/ContextMenu.d.ts +31 -0
  158. package/dist/menu/ContextMenu.js +95 -0
  159. package/dist/menu/ContextMenu.js.map +1 -0
  160. package/dist/metric/Metric.d.ts +33 -0
  161. package/dist/metric/Metric.js +64 -0
  162. package/dist/metric/Metric.js.map +1 -0
  163. package/dist/metric/useMeasure.d.ts +25 -0
  164. package/dist/metric/useMeasure.js +44 -0
  165. package/dist/metric/useMeasure.js.map +1 -0
  166. package/dist/model/ModelDiagram.d.ts +142 -0
  167. package/dist/model/ModelDiagram.js +700 -0
  168. package/dist/model/ModelDiagram.js.map +1 -0
  169. package/dist/panzoom/usePanZoom.d.ts +117 -0
  170. package/dist/panzoom/usePanZoom.js +313 -0
  171. package/dist/panzoom/usePanZoom.js.map +1 -0
  172. package/dist/pipeline/DatasetReview.d.ts +48 -0
  173. package/dist/pipeline/DatasetReview.js +157 -0
  174. package/dist/pipeline/DatasetReview.js.map +1 -0
  175. package/dist/pipeline/IngestWizard.d.ts +51 -0
  176. package/dist/pipeline/IngestWizard.js +79 -0
  177. package/dist/pipeline/IngestWizard.js.map +1 -0
  178. package/dist/pipeline/Pipeline.d.ts +171 -0
  179. package/dist/pipeline/Pipeline.js +203 -0
  180. package/dist/pipeline/Pipeline.js.map +1 -0
  181. package/dist/pipeline/PipelineView.d.ts +63 -0
  182. package/dist/pipeline/PipelineView.js +239 -0
  183. package/dist/pipeline/PipelineView.js.map +1 -0
  184. package/dist/pivot/PivotTable.d.ts +94 -0
  185. package/dist/pivot/PivotTable.js +176 -0
  186. package/dist/pivot/PivotTable.js.map +1 -0
  187. package/dist/plan/QueryPlan.d.ts +29 -0
  188. package/dist/plan/QueryPlan.js +79 -0
  189. package/dist/plan/QueryPlan.js.map +1 -0
  190. package/dist/result/QueryResult.d.ts +51 -0
  191. package/dist/result/QueryResult.js +256 -0
  192. package/dist/result/QueryResult.js.map +1 -0
  193. package/dist/review/ActionReceipt.d.ts +52 -0
  194. package/dist/review/ActionReceipt.js +32 -0
  195. package/dist/review/ActionReceipt.js.map +1 -0
  196. package/dist/review/PiiReview.d.ts +37 -0
  197. package/dist/review/PiiReview.js +29 -0
  198. package/dist/review/PiiReview.js.map +1 -0
  199. package/dist/review/PlanReview.d.ts +42 -0
  200. package/dist/review/PlanReview.js +37 -0
  201. package/dist/review/PlanReview.js.map +1 -0
  202. package/dist/review/StepFlow.d.ts +25 -0
  203. package/dist/review/StepFlow.js +21 -0
  204. package/dist/review/StepFlow.js.map +1 -0
  205. package/dist/review/pii.d.ts +21 -0
  206. package/dist/review/pii.js +67 -0
  207. package/dist/review/pii.js.map +1 -0
  208. package/dist/rows/RowList.d.ts +41 -0
  209. package/dist/rows/RowList.js +72 -0
  210. package/dist/rows/RowList.js.map +1 -0
  211. package/dist/schema/ObjectBrowser.d.ts +78 -0
  212. package/dist/schema/ObjectBrowser.js +467 -0
  213. package/dist/schema/ObjectBrowser.js.map +1 -0
  214. package/dist/schema/ObjectInfo.d.ts +25 -0
  215. package/dist/schema/ObjectInfo.js +69 -0
  216. package/dist/schema/ObjectInfo.js.map +1 -0
  217. package/dist/schema/SchemaExplorer.d.ts +32 -0
  218. package/dist/schema/SchemaExplorer.js +175 -0
  219. package/dist/schema/SchemaExplorer.js.map +1 -0
  220. package/dist/schema/refs.d.ts +32 -0
  221. package/dist/schema/refs.js +65 -0
  222. package/dist/schema/refs.js.map +1 -0
  223. package/dist/site/Site.d.ts +191 -0
  224. package/dist/site/Site.js +138 -0
  225. package/dist/site/Site.js.map +1 -0
  226. package/dist/source/ConnectionBuilder.d.ts +54 -0
  227. package/dist/source/ConnectionBuilder.js +115 -0
  228. package/dist/source/ConnectionBuilder.js.map +1 -0
  229. package/dist/source/SourceList.d.ts +17 -0
  230. package/dist/source/SourceList.js +71 -0
  231. package/dist/source/SourceList.js.map +1 -0
  232. package/dist/styles.css +9930 -0
  233. package/dist/styles.layer.css +9934 -0
  234. package/dist/table/DataTable.d.ts +72 -0
  235. package/dist/table/DataTable.js +68 -0
  236. package/dist/table/DataTable.js.map +1 -0
  237. package/dist/table/Pagination.d.ts +20 -0
  238. package/dist/table/Pagination.js +16 -0
  239. package/dist/table/Pagination.js.map +1 -0
  240. package/dist/table/SelectionBar.d.ts +43 -0
  241. package/dist/table/SelectionBar.js +18 -0
  242. package/dist/table/SelectionBar.js.map +1 -0
  243. package/dist/text/Markdown.d.ts +71 -0
  244. package/dist/text/Markdown.js +187 -0
  245. package/dist/text/Markdown.js.map +1 -0
  246. package/dist/text/highlight.d.ts +23 -0
  247. package/dist/text/highlight.js +196 -0
  248. package/dist/text/highlight.js.map +1 -0
  249. package/dist/theme/ThemePicker.d.ts +16 -0
  250. package/dist/theme/ThemePicker.js +50 -0
  251. package/dist/theme/ThemePicker.js.map +1 -0
  252. package/dist/theme/ThemeProvider.d.ts +52 -0
  253. package/dist/theme/ThemeProvider.js +111 -0
  254. package/dist/theme/ThemeProvider.js.map +1 -0
  255. package/dist/workspace/NavBar.d.ts +23 -0
  256. package/dist/workspace/NavBar.js +171 -0
  257. package/dist/workspace/NavBar.js.map +1 -0
  258. package/dist/workspace/SideNav.d.ts +61 -0
  259. package/dist/workspace/SideNav.js +149 -0
  260. package/dist/workspace/SideNav.js.map +1 -0
  261. package/dist/workspace/Workspace.d.ts +53 -0
  262. package/dist/workspace/Workspace.js +243 -0
  263. package/dist/workspace/Workspace.js.map +1 -0
  264. package/dist/workspace/icons.d.ts +34 -0
  265. package/dist/workspace/icons.js +37 -0
  266. package/dist/workspace/icons.js.map +1 -0
  267. package/dist/workspace/layout.d.ts +74 -0
  268. package/dist/workspace/layout.js +276 -0
  269. package/dist/workspace/layout.js.map +1 -0
  270. package/package.json +85 -3
@@ -0,0 +1,191 @@
1
+ import { type ReactNode } from "react";
2
+ /**
3
+ * Components for sites: a landing page, a docs page, a blog. Each is plain React, styled by `--sf-*` tokens only,
4
+ * and responds to its container. Links are taken as given: an app passes its own addresses, and the catalog's
5
+ * renderers check an agent's with `safeUrl` before they reach here.
6
+ */
7
+ type Heading = 1 | 2 | 3 | 4;
8
+ export interface HeroProps {
9
+ title: ReactNode;
10
+ /** One or two sentences under the title, at most 40rem wide. */
11
+ lead?: ReactNode;
12
+ /** A short line above the title. */
13
+ eyebrow?: ReactNode;
14
+ /** Buttons or links: the first is the primary action. */
15
+ actions?: ReactNode;
16
+ /** An image, a device frame or a live surface beneath the words. */
17
+ media?: ReactNode;
18
+ align?: "center" | "start";
19
+ /** The title's heading level. Defaults to 1. */
20
+ level?: Heading;
21
+ className?: string;
22
+ }
23
+ /** The opening of a page: a large title that scales with its container, a lead, actions and media. */
24
+ export declare function Hero({ title, lead, eyebrow, actions, media, align, level, className }: HeroProps): import("react").JSX.Element;
25
+ export interface SectionProps {
26
+ heading: ReactNode;
27
+ eyebrow?: ReactNode;
28
+ lead?: ReactNode;
29
+ children?: ReactNode;
30
+ /** The heading's level. Defaults to 2. */
31
+ level?: Heading;
32
+ className?: string;
33
+ }
34
+ /** A part of a page under its own heading, with room around it. Named by its heading for assistive technology. */
35
+ export declare function Section({ heading: title, eyebrow, lead, children, level, className }: SectionProps): import("react").JSX.Element;
36
+ export interface FeatureItem {
37
+ id: string;
38
+ title: string;
39
+ line?: string;
40
+ /** A link. Without one the item is a button that calls `onSelect`. */
41
+ href?: string;
42
+ }
43
+ export interface FeatureGridProps {
44
+ items: FeatureItem[];
45
+ /** What the list is, for assistive technology. */
46
+ label?: string;
47
+ onSelect?(id: string): void;
48
+ className?: string;
49
+ }
50
+ /** Cards of a title and a line each, as many to a row as the container fits. Each is a link or a button. */
51
+ export declare function FeatureGrid({ items, label, onSelect, className }: FeatureGridProps): import("react").JSX.Element;
52
+ export type Device = "desktop" | "phone";
53
+ export interface DeviceFrameProps {
54
+ /** Draws `children` in each, side by side. Defaults to a desktop and a phone. Under 40rem of room only the last stands. */
55
+ devices?: Device[];
56
+ /** The desktop window's title. */
57
+ title?: string;
58
+ /** What the screen shows, for assistive technology; each screen is named after its device and this. */
59
+ label?: string;
60
+ /** Draws the content for one device. Called once per device. */
61
+ children: ReactNode | ((device: Device) => ReactNode);
62
+ className?: string;
63
+ }
64
+ /**
65
+ * A desktop window and a phone around the same content, for showing a product. The screens scroll on their own and
66
+ * can be focused to scroll by keyboard. The frames are drawing only: they are hidden from assistive technology.
67
+ */
68
+ export declare function DeviceFrame({ devices, title, label, children, className }: DeviceFrameProps): import("react").JSX.Element;
69
+ /** How fast the prompt types, how long the answer holds before it starts again, in milliseconds. */
70
+ export declare const PROMPT_REVEAL_TIMING: {
71
+ readonly type: 28;
72
+ readonly start: 400;
73
+ readonly hold: 9000;
74
+ readonly restart: 600;
75
+ };
76
+ export interface PromptRevealProps {
77
+ /** What a person asks, typed out first. */
78
+ prompt: string;
79
+ /** The answer, shown once the prompt is typed. */
80
+ children: ReactNode;
81
+ /** Starts again after a pause. Defaults to true. */
82
+ loop?: boolean;
83
+ /** What is shown, for the status line. */
84
+ label?: string;
85
+ className?: string;
86
+ }
87
+ /**
88
+ * A prompt typed out and its answer shown, then again. Under reduced motion, once paused, or once a person reaches
89
+ * into the answer, it shows the finished answer and stands still. It has a Pause button, since it moves for longer
90
+ * than five seconds. Assistive technology reads the whole prompt at once, never letter by letter.
91
+ */
92
+ export declare function PromptReveal({ prompt, children, loop, label, className }: PromptRevealProps): import("react").JSX.Element;
93
+ export interface ShowcaseItem {
94
+ id: string;
95
+ name: string;
96
+ line?: string;
97
+ content: ReactNode;
98
+ }
99
+ export interface ShowcaseProps {
100
+ items: ShowcaseItem[];
101
+ /** What the picker chooses between, for assistive technology. */
102
+ label: string;
103
+ value?: string;
104
+ defaultValue?: string;
105
+ onChange?(id: string): void;
106
+ className?: string;
107
+ }
108
+ /** A picker of named examples above a stage that shows the chosen one. The picker wraps rather than run past the edge. */
109
+ export declare function Showcase({ items, label, value, defaultValue, onChange, className }: ShowcaseProps): import("react").JSX.Element;
110
+ export interface FooterLink {
111
+ id: string;
112
+ label: string;
113
+ href?: string;
114
+ }
115
+ export interface FooterProps {
116
+ groups: {
117
+ label?: string;
118
+ items: FooterLink[];
119
+ }[];
120
+ /** A line at the very end: a copyright, a licence. */
121
+ note?: ReactNode;
122
+ onSelect?(id: string): void;
123
+ label?: string;
124
+ className?: string;
125
+ }
126
+ /** The end of a site's page: columns of links that wrap to the container, and a note. */
127
+ export declare function Footer({ groups, note, onSelect, label, className }: FooterProps): import("react").JSX.Element;
128
+ export type MediaRatio = "16:9" | "4:3" | "3:2" | "1:1" | "21:9";
129
+ export interface MediaProps {
130
+ /** The address. Without one, the description stands in its place. */
131
+ src?: string;
132
+ /** What it shows, for anyone who cannot see it. An empty string marks it as decoration. */
133
+ alt: string;
134
+ kind?: "image" | "video";
135
+ ratio?: MediaRatio;
136
+ caption?: ReactNode;
137
+ className?: string;
138
+ }
139
+ /**
140
+ * An image or a video at a fixed ratio, so nothing moves as it loads, and loaded only near the screen. A video has
141
+ * controls and never plays on its own. With no address, its description is shown in the space it would take.
142
+ */
143
+ export declare function Media({ src, alt, kind, ratio, caption, className }: MediaProps): import("react").JSX.Element;
144
+ export interface QuoteProps {
145
+ children: ReactNode;
146
+ /** Who said it. */
147
+ cite?: ReactNode;
148
+ /** Where it was said. */
149
+ href?: string;
150
+ className?: string;
151
+ }
152
+ /** A pull quote, with who said it. */
153
+ export declare function Quote({ children, cite, href, className }: QuoteProps): import("react").JSX.Element;
154
+ export type CalloutTone = "note" | "tip" | "warning";
155
+ export interface CalloutProps {
156
+ tone?: CalloutTone;
157
+ /** Its heading. Without one, the tone's name ("Note") is the heading, so the kind is never told by colour alone. */
158
+ title?: ReactNode;
159
+ children: ReactNode;
160
+ className?: string;
161
+ }
162
+ /** A note set apart from the text around it: a note, a tip or a warning. */
163
+ export declare function Callout({ tone, title, children, className }: CalloutProps): import("react").JSX.Element;
164
+ export interface Post {
165
+ id: string;
166
+ title: string;
167
+ /** An ISO date, shown in the reader's own words for it. */
168
+ date?: string;
169
+ excerpt?: string;
170
+ tags?: string[];
171
+ href?: string;
172
+ }
173
+ export interface PostCardProps extends Post {
174
+ onOpen?(id: string): void;
175
+ /** The title's heading level. Defaults to 3. */
176
+ level?: Heading;
177
+ className?: string;
178
+ }
179
+ /** A UTC date read as words, or the text as given when it is not a date. */
180
+ export declare function postDate(date: string, locale?: string): string;
181
+ /** A post in a list: its title as a link or a button, the date, a line of it and its tags. */
182
+ export declare function PostCard({ id, title, date, excerpt, tags, href, onOpen, level, className }: PostCardProps): import("react").JSX.Element;
183
+ export interface PostListProps {
184
+ posts: Post[];
185
+ label?: string;
186
+ onOpen?(id: string): void;
187
+ className?: string;
188
+ }
189
+ /** Posts newest first as given, one card each. */
190
+ export declare function PostList({ posts, label, onOpen, className }: PostListProps): import("react").JSX.Element;
191
+ export {};
@@ -0,0 +1,138 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createElement, useEffect, useId, useState } from "react";
3
+ const heading = (level, props, children) => createElement(`h${level}`, props, children);
4
+ /** The opening of a page: a large title that scales with its container, a lead, actions and media. */
5
+ export function Hero({ title, lead, eyebrow, actions, media, align = "center", level = 1, className }) {
6
+ return (_jsxs("section", { className: ["sf-site-hero", className].filter(Boolean).join(" "), "data-align": align, children: [eyebrow != null && _jsx("p", { className: "sf-site-eyebrow", children: eyebrow }), heading(level, { className: "sf-site-hero-title" }, title), lead != null && _jsx("p", { className: "sf-site-lead", children: lead }), actions != null && _jsx("div", { className: "sf-site-actions", children: actions }), media != null && _jsx("div", { className: "sf-site-hero-media", children: media })] }));
7
+ }
8
+ /** A part of a page under its own heading, with room around it. Named by its heading for assistive technology. */
9
+ export function Section({ heading: title, eyebrow, lead, children, level = 2, className }) {
10
+ const id = useId();
11
+ return (_jsxs("section", { className: ["sf-site-section", className].filter(Boolean).join(" "), "aria-labelledby": id, children: [_jsxs("div", { className: "sf-site-section-head", children: [eyebrow != null && _jsx("p", { className: "sf-site-eyebrow", children: eyebrow }), heading(level, { id, className: "sf-site-section-title" }, title), lead != null && _jsx("p", { className: "sf-site-section-lead", children: lead })] }), children] }));
12
+ }
13
+ /** Cards of a title and a line each, as many to a row as the container fits. Each is a link or a button. */
14
+ export function FeatureGrid({ items, label, onSelect, className }) {
15
+ return (_jsx("ul", { className: ["sf-site-features", className].filter(Boolean).join(" "), "aria-label": label, children: items.map((item) => {
16
+ const body = (_jsxs(_Fragment, { children: [_jsx("span", { className: "sf-site-feature-title", children: item.title }), item.line && _jsx("span", { className: "sf-site-feature-line", children: item.line })] }));
17
+ return (_jsx("li", { children: item.href ? (_jsx("a", { className: "sf-site-feature", href: item.href, children: body })) : (_jsx("button", { type: "button", className: "sf-site-feature", onClick: () => onSelect?.(item.id), disabled: !onSelect, children: body })) }, item.id));
18
+ }) }));
19
+ }
20
+ const DEVICE_NAME = { desktop: "Desktop", phone: "Phone" };
21
+ /**
22
+ * A desktop window and a phone around the same content, for showing a product. The screens scroll on their own and
23
+ * can be focused to scroll by keyboard. The frames are drawing only: they are hidden from assistive technology.
24
+ */
25
+ export function DeviceFrame({ devices = ["desktop", "phone"], title, label, children, className }) {
26
+ const shown = devices.length ? [...new Set(devices)] : ["desktop", "phone"];
27
+ const content = (device) => (typeof children === "function" ? children(device) : children);
28
+ const screen = (device) => (_jsx("section", { className: "sf-site-screen sf-container", "aria-label": label ? `${DEVICE_NAME[device]}: ${label}` : DEVICE_NAME[device], tabIndex: 0, children: content(device) }));
29
+ return (_jsx("div", { className: ["sf-site-devices", className].filter(Boolean).join(" "), children: _jsx("div", { className: "sf-site-devices-row", "data-count": shown.length, children: shown.map((device) => device === "desktop" ? (_jsxs("figure", { className: "sf-site-desktop", children: [_jsxs("div", { className: "sf-site-desktop-bar", "aria-hidden": "true", children: [_jsx("span", {}), _jsx("span", {}), _jsx("span", {}), _jsx("p", { children: title ?? "" })] }), _jsx("div", { className: "sf-site-desktop-body", children: screen(device) }), _jsx("figcaption", { children: DEVICE_NAME.desktop })] }, device)) : (_jsxs("figure", { className: "sf-site-phone", children: [_jsxs("div", { className: "sf-site-phone-frame", children: [_jsx("div", { className: "sf-site-phone-island", "aria-hidden": "true" }), _jsx("div", { className: "sf-site-phone-body", children: screen(device) })] }), _jsx("figcaption", { children: DEVICE_NAME.phone })] }, device))) }) }));
30
+ }
31
+ function useReducedMotion() {
32
+ const query = "(prefers-reduced-motion: reduce)";
33
+ const [reduce, setReduce] = useState(() => (typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(query).matches : false));
34
+ useEffect(() => {
35
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function")
36
+ return;
37
+ const media = window.matchMedia(query);
38
+ const change = () => setReduce(media.matches);
39
+ media.addEventListener("change", change);
40
+ return () => media.removeEventListener("change", change);
41
+ }, []);
42
+ return reduce;
43
+ }
44
+ /** How fast the prompt types, how long the answer holds before it starts again, in milliseconds. */
45
+ export const PROMPT_REVEAL_TIMING = { type: 28, start: 400, hold: 9000, restart: 600 };
46
+ /**
47
+ * A prompt typed out and its answer shown, then again. Under reduced motion, once paused, or once a person reaches
48
+ * into the answer, it shows the finished answer and stands still. It has a Pause button, since it moves for longer
49
+ * than five seconds. Assistive technology reads the whole prompt at once, never letter by letter.
50
+ */
51
+ export function PromptReveal({ prompt, children, loop = true, label, className }) {
52
+ const reduce = useReducedMotion();
53
+ const [paused, setPaused] = useState(false);
54
+ const still = reduce || paused;
55
+ const [typed, setTyped] = useState(0);
56
+ const [round, setRound] = useState(0);
57
+ useEffect(() => {
58
+ if (still)
59
+ return;
60
+ let count = 0;
61
+ let timer;
62
+ const step = () => {
63
+ if (count < prompt.length) {
64
+ count += 1;
65
+ setTyped(count);
66
+ timer = setTimeout(step, PROMPT_REVEAL_TIMING.type);
67
+ }
68
+ else if (loop) {
69
+ timer = setTimeout(() => {
70
+ count = 0;
71
+ setTyped(0);
72
+ setRound((r) => r + 1);
73
+ timer = setTimeout(step, PROMPT_REVEAL_TIMING.restart);
74
+ }, PROMPT_REVEAL_TIMING.hold);
75
+ }
76
+ };
77
+ setTyped(0);
78
+ timer = setTimeout(step, PROMPT_REVEAL_TIMING.start);
79
+ return () => clearTimeout(timer);
80
+ }, [still, prompt, loop]);
81
+ const shown = still ? prompt.length : typed;
82
+ const done = shown >= prompt.length;
83
+ const status = reduce ? "Shown finished, since your system asks for less motion." : paused ? "Paused." : done ? "Answered." : "Typing.";
84
+ return (_jsxs("div", { className: ["sf-site-prompt-reveal", className].filter(Boolean).join(" "), children: [_jsx("p", { className: "sf-visually-hidden", children: prompt }), _jsxs("p", { className: "sf-site-prompt", "aria-hidden": "true", children: [_jsx("span", { children: prompt.slice(0, shown) || " " }), !done && _jsx("span", { className: "sf-site-caret" })] }), _jsx("div", { className: "sf-site-answer", "data-shown": done || undefined, ref: (element) => {
85
+ // Set here, not as a prop: React 18 does not know `inert`.
86
+ if (element)
87
+ element.inert = !done;
88
+ }, "aria-hidden": done ? undefined : true, onPointerDown: () => setPaused(true), onFocus: () => setPaused(true), children: children }, done ? `shown-${round}` : "waiting"), _jsxs("div", { className: "sf-site-reveal-foot", children: [_jsxs("p", { className: "sf-site-reveal-status", role: "status", children: [label ? `${label}. ` : "", status] }), !reduce && (_jsx("button", { type: "button", className: "sf-button", "aria-pressed": paused, onClick: () => setPaused((p) => !p), children: paused ? "Play" : "Pause" }))] })] }));
89
+ }
90
+ /** A picker of named examples above a stage that shows the chosen one. The picker wraps rather than run past the edge. */
91
+ export function Showcase({ items, label, value, defaultValue, onChange, className }) {
92
+ const name = useId();
93
+ const [own, setOwn] = useState(defaultValue ?? items[0]?.id);
94
+ const current = items.find((item) => item.id === (value ?? own)) ?? items[0];
95
+ const choose = (id) => {
96
+ setOwn(id);
97
+ onChange?.(id);
98
+ };
99
+ return (_jsxs("div", { className: ["sf-site-showcase", className].filter(Boolean).join(" "), children: [_jsx("div", { className: "sf-segmented sf-site-showcase-picker", role: "radiogroup", "aria-label": label, "data-thumb": "off", children: items.map((item) => (_jsxs("label", { className: "sf-segment", "data-checked": item.id === current?.id || undefined, children: [_jsx("input", { type: "radio", name: name, value: item.id, checked: item.id === current?.id, onChange: () => choose(item.id) }), item.name] }, item.id))) }), current && (_jsxs("div", { className: "sf-site-showcase-stage", children: [_jsx("p", { className: "sf-site-showcase-name", children: current.name }), current.line && _jsx("p", { className: "sf-site-showcase-line", children: current.line }), current.content] }, current.id))] }));
100
+ }
101
+ /** The end of a site's page: columns of links that wrap to the container, and a note. */
102
+ export function Footer({ groups, note, onSelect, label = "Site", className }) {
103
+ return (_jsxs("footer", { className: ["sf-site-footer", className].filter(Boolean).join(" "), children: [_jsx("nav", { className: "sf-site-footer-groups", "aria-label": label, children: groups.map((group, index) => (_jsxs("div", { className: "sf-site-footer-group", children: [group.label && _jsx("p", { className: "sf-site-footer-label", children: group.label }), _jsx("ul", { children: group.items.map((item) => (_jsx("li", { children: item.href ? (_jsx("a", { href: item.href, children: item.label })) : (_jsx("button", { type: "button", className: "sf-site-link", onClick: () => onSelect?.(item.id), disabled: !onSelect, children: item.label })) }, item.id))) })] }, group.label ?? index))) }), note != null && _jsx("p", { className: "sf-site-footer-note", children: note })] }));
104
+ }
105
+ /**
106
+ * An image or a video at a fixed ratio, so nothing moves as it loads, and loaded only near the screen. A video has
107
+ * controls and never plays on its own. With no address, its description is shown in the space it would take.
108
+ */
109
+ export function Media({ src, alt, kind = "image", ratio = "16:9", caption, className }) {
110
+ const style = { "--sf-site-ratio": ratio.replace(":", " / ") };
111
+ const body = !src ? (_jsx("div", { className: "sf-site-media-missing", role: alt ? "img" : undefined, "aria-label": alt || undefined, children: _jsx("span", { "aria-hidden": "true", children: alt || "Image" }) })) : kind === "video" ? (_jsx("video", { className: "sf-site-media-body", src: src, controls: true, preload: "none", "aria-label": alt || undefined })) : (_jsx("img", { className: "sf-site-media-body", src: src, alt: alt, loading: "lazy", decoding: "async" }));
112
+ return (_jsxs("figure", { className: ["sf-site-media", className].filter(Boolean).join(" "), style: style, children: [body, caption != null && _jsx("figcaption", { children: caption })] }));
113
+ }
114
+ /** A pull quote, with who said it. */
115
+ export function Quote({ children, cite, href, className }) {
116
+ return (_jsxs("figure", { className: ["sf-site-quote", className].filter(Boolean).join(" "), children: [_jsx("blockquote", { cite: href, children: children }), cite != null && _jsx("figcaption", { children: href ? _jsx("a", { href: href, children: cite }) : cite })] }));
117
+ }
118
+ const TONE_NAME = { note: "Note", tip: "Tip", warning: "Warning" };
119
+ /** A note set apart from the text around it: a note, a tip or a warning. */
120
+ export function Callout({ tone = "note", title, children, className }) {
121
+ return (_jsxs("aside", { className: ["sf-site-callout", className].filter(Boolean).join(" "), "data-tone": tone, "aria-label": typeof title === "string" ? title : TONE_NAME[tone], children: [_jsx("p", { className: "sf-site-callout-title", children: title ?? TONE_NAME[tone] }), _jsx("div", { className: "sf-site-callout-body", children: children })] }));
122
+ }
123
+ /** A UTC date read as words, or the text as given when it is not a date. */
124
+ export function postDate(date, locale) {
125
+ const time = Date.parse(date);
126
+ return Number.isNaN(time) ? date : new Intl.DateTimeFormat(locale, { dateStyle: "long", timeZone: "UTC" }).format(time);
127
+ }
128
+ /** A post in a list: its title as a link or a button, the date, a line of it and its tags. */
129
+ export function PostCard({ id, title, date, excerpt, tags, href, onOpen, level = 3, className }) {
130
+ return (_jsxs("article", { className: ["sf-site-post", className].filter(Boolean).join(" "), children: [heading(level, { className: "sf-site-post-title" }, href ? (_jsx("a", { href: href, children: title })) : onOpen ? (_jsx("button", { type: "button", className: "sf-site-link", onClick: () => onOpen(id), children: title })) : (title)), date && (_jsx("p", { className: "sf-site-post-date", children: _jsx("time", { dateTime: date, children: postDate(date) }) })), excerpt && _jsx("p", { className: "sf-site-post-excerpt", children: excerpt }), tags && tags.length > 0 && (_jsx("ul", { className: "sf-site-post-tags", "aria-label": "Tags", children: tags.map((tag) => (_jsx("li", { children: tag }, tag))) }))] }));
131
+ }
132
+ /** Posts newest first as given, one card each. */
133
+ export function PostList({ posts, label, onOpen, className }) {
134
+ if (posts.length === 0)
135
+ return _jsx("p", { className: "sf-site-empty", children: "Nothing here yet." });
136
+ return (_jsx("ul", { className: ["sf-site-posts", className].filter(Boolean).join(" "), "aria-label": label, children: posts.map((post) => (_jsx("li", { children: _jsx(PostCard, { ...post, onOpen: onOpen }) }, post.id))) }));
137
+ }
138
+ //# sourceMappingURL=Site.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Site.js","sourceRoot":"","sources":["../../src/site/Site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E,KAAK,EAAE,MAAM,EAAE,SAAS,EAAiB;IACzE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,YAAG,SAAS,EAAC,eAAe,kCAAsB,CAAC;IAClF,OAAO,CACL,aAAI,SAAS,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAc,KAAK,YACrF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,uBACE,KAAC,QAAQ,OAAK,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,IAD/B,IAAI,CAAC,EAAE,CAEX,CACN,CAAC,GACC,CACN,CAAC;AACJ,CAAC","sourcesContent":["import { type CSSProperties, type ReactNode, createElement, useEffect, useId, useState } from \"react\";\n\n/**\n * Components for sites: a landing page, a docs page, a blog. Each is plain React, styled by `--sf-*` tokens only,\n * and responds to its container. Links are taken as given: an app passes its own addresses, and the catalog's\n * renderers check an agent's with `safeUrl` before they reach here.\n */\n\ntype Heading = 1 | 2 | 3 | 4;\nconst heading = (level: Heading, props: Record<string, unknown>, children: ReactNode) => createElement(`h${level}`, props, children);\n\nexport interface HeroProps {\n title: ReactNode;\n /** One or two sentences under the title, at most 40rem wide. */\n lead?: ReactNode;\n /** A short line above the title. */\n eyebrow?: ReactNode;\n /** Buttons or links: the first is the primary action. */\n actions?: ReactNode;\n /** An image, a device frame or a live surface beneath the words. */\n media?: ReactNode;\n align?: \"center\" | \"start\";\n /** The title's heading level. Defaults to 1. */\n level?: Heading;\n className?: string;\n}\n\n/** The opening of a page: a large title that scales with its container, a lead, actions and media. */\nexport function Hero({ title, lead, eyebrow, actions, media, align = \"center\", level = 1, className }: HeroProps) {\n return (\n <section className={[\"sf-site-hero\", className].filter(Boolean).join(\" \")} data-align={align}>\n {eyebrow != null && <p className=\"sf-site-eyebrow\">{eyebrow}</p>}\n {heading(level, { className: \"sf-site-hero-title\" }, title)}\n {lead != null && <p className=\"sf-site-lead\">{lead}</p>}\n {actions != null && <div className=\"sf-site-actions\">{actions}</div>}\n {media != null && <div className=\"sf-site-hero-media\">{media}</div>}\n </section>\n );\n}\n\nexport interface SectionProps {\n heading: ReactNode;\n eyebrow?: ReactNode;\n lead?: ReactNode;\n children?: ReactNode;\n /** The heading's level. Defaults to 2. */\n level?: Heading;\n className?: string;\n}\n\n/** A part of a page under its own heading, with room around it. Named by its heading for assistive technology. */\nexport function Section({ heading: title, eyebrow, lead, children, level = 2, className }: SectionProps) {\n const id = useId();\n return (\n <section className={[\"sf-site-section\", className].filter(Boolean).join(\" \")} aria-labelledby={id}>\n <div className=\"sf-site-section-head\">\n {eyebrow != null && <p className=\"sf-site-eyebrow\">{eyebrow}</p>}\n {heading(level, { id, className: \"sf-site-section-title\" }, title)}\n {lead != null && <p className=\"sf-site-section-lead\">{lead}</p>}\n </div>\n {children}\n </section>\n );\n}\n\nexport interface FeatureItem {\n id: string;\n title: string;\n line?: string;\n /** A link. Without one the item is a button that calls `onSelect`. */\n href?: string;\n}\n\nexport interface FeatureGridProps {\n items: FeatureItem[];\n /** What the list is, for assistive technology. */\n label?: string;\n onSelect?(id: string): void;\n className?: string;\n}\n\n/** Cards of a title and a line each, as many to a row as the container fits. Each is a link or a button. */\nexport function FeatureGrid({ items, label, onSelect, className }: FeatureGridProps) {\n return (\n <ul className={[\"sf-site-features\", className].filter(Boolean).join(\" \")} aria-label={label}>\n {items.map((item) => {\n const body = (\n <>\n <span className=\"sf-site-feature-title\">{item.title}</span>\n {item.line && <span className=\"sf-site-feature-line\">{item.line}</span>}\n </>\n );\n return (\n <li key={item.id}>\n {item.href ? (\n <a className=\"sf-site-feature\" href={item.href}>\n {body}\n </a>\n ) : (\n <button type=\"button\" className=\"sf-site-feature\" onClick={() => onSelect?.(item.id)} disabled={!onSelect}>\n {body}\n </button>\n )}\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport type Device = \"desktop\" | \"phone\";\n\nexport interface DeviceFrameProps {\n /** Draws `children` in each, side by side. Defaults to a desktop and a phone. Under 40rem of room only the last stands. */\n devices?: Device[];\n /** The desktop window's title. */\n title?: string;\n /** What the screen shows, for assistive technology; each screen is named after its device and this. */\n label?: string;\n /** Draws the content for one device. Called once per device. */\n children: ReactNode | ((device: Device) => ReactNode);\n className?: string;\n}\n\nconst DEVICE_NAME: Record<Device, string> = { desktop: \"Desktop\", phone: \"Phone\" };\n\n/**\n * A desktop window and a phone around the same content, for showing a product. The screens scroll on their own and\n * can be focused to scroll by keyboard. The frames are drawing only: they are hidden from assistive technology.\n */\nexport function DeviceFrame({ devices = [\"desktop\", \"phone\"], title, label, children, className }: DeviceFrameProps) {\n const shown = devices.length ? [...new Set(devices)] : ([\"desktop\", \"phone\"] as Device[]);\n const content = (device: Device) => (typeof children === \"function\" ? children(device) : children);\n const screen = (device: Device) => (\n // biome-ignore lint/a11y/noNoninteractiveTabindex: a scrolling region is focused to scroll it by keyboard\n <section className=\"sf-site-screen sf-container\" aria-label={label ? `${DEVICE_NAME[device]}: ${label}` : DEVICE_NAME[device]} tabIndex={0}>\n {content(device)}\n </section>\n );\n return (\n <div className={[\"sf-site-devices\", className].filter(Boolean).join(\" \")}>\n <div className=\"sf-site-devices-row\" data-count={shown.length}>\n {shown.map((device) =>\n device === \"desktop\" ? (\n <figure key={device} className=\"sf-site-desktop\">\n <div className=\"sf-site-desktop-bar\" aria-hidden=\"true\">\n <span />\n <span />\n <span />\n <p>{title ?? \"\"}</p>\n </div>\n <div className=\"sf-site-desktop-body\">{screen(device)}</div>\n <figcaption>{DEVICE_NAME.desktop}</figcaption>\n </figure>\n ) : (\n <figure key={device} className=\"sf-site-phone\">\n <div className=\"sf-site-phone-frame\">\n <div className=\"sf-site-phone-island\" aria-hidden=\"true\" />\n <div className=\"sf-site-phone-body\">{screen(device)}</div>\n </div>\n <figcaption>{DEVICE_NAME.phone}</figcaption>\n </figure>\n ),\n )}\n </div>\n </div>\n );\n}\n\nfunction useReducedMotion(): boolean {\n const query = \"(prefers-reduced-motion: reduce)\";\n const [reduce, setReduce] = useState(() => (typeof window !== \"undefined\" && typeof window.matchMedia === \"function\" ? window.matchMedia(query).matches : false));\n useEffect(() => {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") return;\n const media = window.matchMedia(query);\n const change = () => setReduce(media.matches);\n media.addEventListener(\"change\", change);\n return () => media.removeEventListener(\"change\", change);\n }, []);\n return reduce;\n}\n\n/** How fast the prompt types, how long the answer holds before it starts again, in milliseconds. */\nexport const PROMPT_REVEAL_TIMING = { type: 28, start: 400, hold: 9000, restart: 600 } as const;\n\nexport interface PromptRevealProps {\n /** What a person asks, typed out first. */\n prompt: string;\n /** The answer, shown once the prompt is typed. */\n children: ReactNode;\n /** Starts again after a pause. Defaults to true. */\n loop?: boolean;\n /** What is shown, for the status line. */\n label?: string;\n className?: string;\n}\n\n/**\n * A prompt typed out and its answer shown, then again. Under reduced motion, once paused, or once a person reaches\n * into the answer, it shows the finished answer and stands still. It has a Pause button, since it moves for longer\n * than five seconds. Assistive technology reads the whole prompt at once, never letter by letter.\n */\nexport function PromptReveal({ prompt, children, loop = true, label, className }: PromptRevealProps) {\n const reduce = useReducedMotion();\n const [paused, setPaused] = useState(false);\n const still = reduce || paused;\n const [typed, setTyped] = useState(0);\n const [round, setRound] = useState(0);\n useEffect(() => {\n if (still) return;\n let count = 0;\n let timer: ReturnType<typeof setTimeout>;\n const step = () => {\n if (count < prompt.length) {\n count += 1;\n setTyped(count);\n timer = setTimeout(step, PROMPT_REVEAL_TIMING.type);\n } else if (loop) {\n timer = setTimeout(() => {\n count = 0;\n setTyped(0);\n setRound((r) => r + 1);\n timer = setTimeout(step, PROMPT_REVEAL_TIMING.restart);\n }, PROMPT_REVEAL_TIMING.hold);\n }\n };\n setTyped(0);\n timer = setTimeout(step, PROMPT_REVEAL_TIMING.start);\n return () => clearTimeout(timer);\n }, [still, prompt, loop]);\n const shown = still ? prompt.length : typed;\n const done = shown >= prompt.length;\n const status = reduce ? \"Shown finished, since your system asks for less motion.\" : paused ? \"Paused.\" : done ? \"Answered.\" : \"Typing.\";\n return (\n <div className={[\"sf-site-prompt-reveal\", className].filter(Boolean).join(\" \")}>\n <p className=\"sf-visually-hidden\">{prompt}</p>\n <p className=\"sf-site-prompt\" aria-hidden=\"true\">\n <span>{prompt.slice(0, shown) || \" \"}</span>\n {!done && <span className=\"sf-site-caret\" />}\n </p>\n {/* biome-ignore lint/a11y/noStaticElementInteractions: it only watches for a person reaching into the answer, to stop it moving */}\n {/* The answer keeps its place while the prompt types, hidden and out of reach, so the page does not jump; it is\n drawn afresh each time it is shown, so whatever rises in as it is drawn rises in again. */}\n <div\n key={done ? `shown-${round}` : \"waiting\"}\n className=\"sf-site-answer\"\n data-shown={done || undefined}\n ref={(element) => {\n // Set here, not as a prop: React 18 does not know `inert`.\n if (element) element.inert = !done;\n }}\n aria-hidden={done ? undefined : true}\n onPointerDown={() => setPaused(true)}\n onFocus={() => setPaused(true)}\n >\n {children}\n </div>\n <div className=\"sf-site-reveal-foot\">\n <p className=\"sf-site-reveal-status\" role=\"status\">\n {label ? `${label}. ` : \"\"}\n {status}\n </p>\n {!reduce && (\n <button type=\"button\" className=\"sf-button\" aria-pressed={paused} onClick={() => setPaused((p) => !p)}>\n {paused ? \"Play\" : \"Pause\"}\n </button>\n )}\n </div>\n </div>\n );\n}\n\nexport interface ShowcaseItem {\n id: string;\n name: string;\n line?: string;\n content: ReactNode;\n}\n\nexport interface ShowcaseProps {\n items: ShowcaseItem[];\n /** What the picker chooses between, for assistive technology. */\n label: string;\n value?: string;\n defaultValue?: string;\n onChange?(id: string): void;\n className?: string;\n}\n\n/** A picker of named examples above a stage that shows the chosen one. The picker wraps rather than run past the edge. */\nexport function Showcase({ items, label, value, defaultValue, onChange, className }: ShowcaseProps) {\n const name = useId();\n const [own, setOwn] = useState(defaultValue ?? items[0]?.id);\n const current = items.find((item) => item.id === (value ?? own)) ?? items[0];\n const choose = (id: string) => {\n setOwn(id);\n onChange?.(id);\n };\n return (\n <div className={[\"sf-site-showcase\", className].filter(Boolean).join(\" \")}>\n <div className=\"sf-segmented sf-site-showcase-picker\" role=\"radiogroup\" aria-label={label} data-thumb=\"off\">\n {items.map((item) => (\n <label key={item.id} className=\"sf-segment\" data-checked={item.id === current?.id || undefined}>\n <input type=\"radio\" name={name} value={item.id} checked={item.id === current?.id} onChange={() => choose(item.id)} />\n {item.name}\n </label>\n ))}\n </div>\n {current && (\n <div key={current.id} className=\"sf-site-showcase-stage\">\n <p className=\"sf-site-showcase-name\">{current.name}</p>\n {current.line && <p className=\"sf-site-showcase-line\">{current.line}</p>}\n {current.content}\n </div>\n )}\n </div>\n );\n}\n\nexport interface FooterLink {\n id: string;\n label: string;\n href?: string;\n}\n\nexport interface FooterProps {\n groups: { label?: string; items: FooterLink[] }[];\n /** A line at the very end: a copyright, a licence. */\n note?: ReactNode;\n onSelect?(id: string): void;\n label?: string;\n className?: string;\n}\n\n/** The end of a site's page: columns of links that wrap to the container, and a note. */\nexport function Footer({ groups, note, onSelect, label = \"Site\", className }: FooterProps) {\n return (\n <footer className={[\"sf-site-footer\", className].filter(Boolean).join(\" \")}>\n <nav className=\"sf-site-footer-groups\" aria-label={label}>\n {groups.map((group, index) => (\n <div key={group.label ?? index} className=\"sf-site-footer-group\">\n {group.label && <p className=\"sf-site-footer-label\">{group.label}</p>}\n <ul>\n {group.items.map((item) => (\n <li key={item.id}>\n {item.href ? (\n <a href={item.href}>{item.label}</a>\n ) : (\n <button type=\"button\" className=\"sf-site-link\" onClick={() => onSelect?.(item.id)} disabled={!onSelect}>\n {item.label}\n </button>\n )}\n </li>\n ))}\n </ul>\n </div>\n ))}\n </nav>\n {note != null && <p className=\"sf-site-footer-note\">{note}</p>}\n </footer>\n );\n}\n\nexport type MediaRatio = \"16:9\" | \"4:3\" | \"3:2\" | \"1:1\" | \"21:9\";\n\nexport interface MediaProps {\n /** The address. Without one, the description stands in its place. */\n src?: string;\n /** What it shows, for anyone who cannot see it. An empty string marks it as decoration. */\n alt: string;\n kind?: \"image\" | \"video\";\n ratio?: MediaRatio;\n caption?: ReactNode;\n className?: string;\n}\n\n/**\n * An image or a video at a fixed ratio, so nothing moves as it loads, and loaded only near the screen. A video has\n * controls and never plays on its own. With no address, its description is shown in the space it would take.\n */\nexport function Media({ src, alt, kind = \"image\", ratio = \"16:9\", caption, className }: MediaProps) {\n const style = { \"--sf-site-ratio\": ratio.replace(\":\", \" / \") } as CSSProperties;\n const body = !src ? (\n <div className=\"sf-site-media-missing\" role={alt ? \"img\" : undefined} aria-label={alt || undefined}>\n <span aria-hidden=\"true\">{alt || \"Image\"}</span>\n </div>\n ) : kind === \"video\" ? (\n // biome-ignore lint/a11y/useMediaCaption: captions are the host's to add to the file\n <video className=\"sf-site-media-body\" src={src} controls preload=\"none\" aria-label={alt || undefined} />\n ) : (\n <img className=\"sf-site-media-body\" src={src} alt={alt} loading=\"lazy\" decoding=\"async\" />\n );\n return (\n <figure className={[\"sf-site-media\", className].filter(Boolean).join(\" \")} style={style}>\n {body}\n {caption != null && <figcaption>{caption}</figcaption>}\n </figure>\n );\n}\n\nexport interface QuoteProps {\n children: ReactNode;\n /** Who said it. */\n cite?: ReactNode;\n /** Where it was said. */\n href?: string;\n className?: string;\n}\n\n/** A pull quote, with who said it. */\nexport function Quote({ children, cite, href, className }: QuoteProps) {\n return (\n <figure className={[\"sf-site-quote\", className].filter(Boolean).join(\" \")}>\n <blockquote cite={href}>{children}</blockquote>\n {cite != null && <figcaption>{href ? <a href={href}>{cite}</a> : cite}</figcaption>}\n </figure>\n );\n}\n\nexport type CalloutTone = \"note\" | \"tip\" | \"warning\";\nconst TONE_NAME: Record<CalloutTone, string> = { note: \"Note\", tip: \"Tip\", warning: \"Warning\" };\n\nexport interface CalloutProps {\n tone?: CalloutTone;\n /** Its heading. Without one, the tone's name (\"Note\") is the heading, so the kind is never told by colour alone. */\n title?: ReactNode;\n children: ReactNode;\n className?: string;\n}\n\n/** A note set apart from the text around it: a note, a tip or a warning. */\nexport function Callout({ tone = \"note\", title, children, className }: CalloutProps) {\n return (\n <aside className={[\"sf-site-callout\", className].filter(Boolean).join(\" \")} data-tone={tone} aria-label={typeof title === \"string\" ? title : TONE_NAME[tone]}>\n <p className=\"sf-site-callout-title\">{title ?? TONE_NAME[tone]}</p>\n <div className=\"sf-site-callout-body\">{children}</div>\n </aside>\n );\n}\n\nexport interface Post {\n id: string;\n title: string;\n /** An ISO date, shown in the reader's own words for it. */\n date?: string;\n excerpt?: string;\n tags?: string[];\n href?: string;\n}\n\nexport interface PostCardProps extends Post {\n onOpen?(id: string): void;\n /** The title's heading level. Defaults to 3. */\n level?: Heading;\n className?: string;\n}\n\n/** A UTC date read as words, or the text as given when it is not a date. */\nexport function postDate(date: string, locale?: string): string {\n const time = Date.parse(date);\n return Number.isNaN(time) ? date : new Intl.DateTimeFormat(locale, { dateStyle: \"long\", timeZone: \"UTC\" }).format(time);\n}\n\n/** A post in a list: its title as a link or a button, the date, a line of it and its tags. */\nexport function PostCard({ id, title, date, excerpt, tags, href, onOpen, level = 3, className }: PostCardProps) {\n return (\n <article className={[\"sf-site-post\", className].filter(Boolean).join(\" \")}>\n {heading(\n level,\n { className: \"sf-site-post-title\" },\n href ? (\n <a href={href}>{title}</a>\n ) : onOpen ? (\n <button type=\"button\" className=\"sf-site-link\" onClick={() => onOpen(id)}>\n {title}\n </button>\n ) : (\n title\n ),\n )}\n {date && (\n <p className=\"sf-site-post-date\">\n <time dateTime={date}>{postDate(date)}</time>\n </p>\n )}\n {excerpt && <p className=\"sf-site-post-excerpt\">{excerpt}</p>}\n {tags && tags.length > 0 && (\n <ul className=\"sf-site-post-tags\" aria-label=\"Tags\">\n {tags.map((tag) => (\n <li key={tag}>{tag}</li>\n ))}\n </ul>\n )}\n </article>\n );\n}\n\nexport interface PostListProps {\n posts: Post[];\n label?: string;\n onOpen?(id: string): void;\n className?: string;\n}\n\n/** Posts newest first as given, one card each. */\nexport function PostList({ posts, label, onOpen, className }: PostListProps) {\n if (posts.length === 0) return <p className=\"sf-site-empty\">Nothing here yet.</p>;\n return (\n <ul className={[\"sf-site-posts\", className].filter(Boolean).join(\" \")} aria-label={label}>\n {posts.map((post) => (\n <li key={post.id}>\n <PostCard {...post} onOpen={onOpen} />\n </li>\n ))}\n </ul>\n );\n}\n"]}
@@ -0,0 +1,54 @@
1
+ export type StorageKind = "local" | "s3" | "gcs" | "azure" | "http";
2
+ export type TableFormatName = "parquet" | "delta" | "iceberg" | "csv" | "json";
3
+ export type CredentialMode = "secret" | "ambient" | "public";
4
+ export interface ConnectionDraftTable {
5
+ name: string;
6
+ format: TableFormatName;
7
+ /** A file, glob or table root. For Iceberg, the table root or a metadata.json file. */
8
+ path: string;
9
+ }
10
+ /** A source being set up. It holds the name of a secret, never a credential. */
11
+ export interface ConnectionDraft {
12
+ sourceId: string;
13
+ storage: StorageKind;
14
+ /** Bucket or prefix the connection covers, e.g. s3://acme-lake/sales. Not used for local files. */
15
+ scope: string;
16
+ credentials: CredentialMode;
17
+ /** Name of the server-side secret, e.g. LAKE. */
18
+ secret: string;
19
+ region: string;
20
+ /** For S3-compatible stores such as MinIO. */
21
+ endpoint: string;
22
+ tables: ConnectionDraftTable[];
23
+ /** Optional Iceberg REST catalog to attach. */
24
+ catalogUri: string;
25
+ catalogWarehouse: string;
26
+ }
27
+ export declare const emptyConnectionDraft: ConnectionDraft;
28
+ export interface ConnectionPlan {
29
+ /** A `surfaces.config.ts` source entry. Contains secret names only. */
30
+ config: string;
31
+ /** Environment variables to set on the server before starting it. */
32
+ env: string[];
33
+ /** What must be fixed before the config will work. */
34
+ problems: string[];
35
+ }
36
+ /**
37
+ * Turns a draft into the config a server reads and the environment
38
+ * variables that carry its credentials. Pure, so it can be tested and reused
39
+ * by an agent or a command-line tool.
40
+ */
41
+ export declare function connectionPlan(draft: ConnectionDraft): ConnectionPlan;
42
+ export interface ConnectionBuilderProps {
43
+ value: ConnectionDraft;
44
+ onChange(draft: ConnectionDraft): void;
45
+ className?: string;
46
+ }
47
+ /**
48
+ * Sets up a connection to Parquet, Delta Lake or Iceberg data on an object
49
+ * store, a web server or the server's own disk, and optionally an Iceberg
50
+ * REST catalog. It writes the config for the server and lists the
51
+ * environment variables that hold the credentials. There is nowhere to type
52
+ * a credential: the browser only ever handles the secret's name.
53
+ */
54
+ export declare function ConnectionBuilder({ value, onChange, className }: ConnectionBuilderProps): import("react").JSX.Element;
@@ -0,0 +1,115 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useState } from "react";
3
+ import { CodeBlock } from "../text/Markdown.js";
4
+ export const emptyConnectionDraft = {
5
+ sourceId: "lake",
6
+ storage: "s3",
7
+ scope: "",
8
+ credentials: "secret",
9
+ secret: "LAKE",
10
+ region: "",
11
+ endpoint: "",
12
+ tables: [{ name: "", format: "parquet", path: "" }],
13
+ catalogUri: "",
14
+ catalogWarehouse: "",
15
+ };
16
+ const STORAGE = [
17
+ { id: "s3", label: "Amazon S3 or compatible", prefix: "s3://", example: "s3://acme-lake/sales" },
18
+ { id: "gcs", label: "Google Cloud Storage", prefix: "gs://", example: "gs://acme-lake/sales" },
19
+ { id: "azure", label: "Azure Storage", prefix: "az://", example: "az://lake/sales" },
20
+ { id: "http", label: "Web (https)", prefix: "https://", example: "https://data.example.com/lake" },
21
+ { id: "local", label: "Files on the server", prefix: "", example: "data/orders.parquet" },
22
+ ];
23
+ const FORMATS = [
24
+ { id: "parquet", label: "Parquet", hint: "A file or a glob such as orders/*.parquet" },
25
+ { id: "delta", label: "Delta Lake", hint: "The table's root folder (the one holding _delta_log)" },
26
+ { id: "iceberg", label: "Iceberg", hint: "The table's root folder, or its metadata.json file" },
27
+ { id: "csv", label: "CSV", hint: "A file or a glob" },
28
+ { id: "json", label: "JSON", hint: "A file or a glob" },
29
+ ];
30
+ const ENV_FIELDS = {
31
+ s3: ["KEY_ID", "SECRET"],
32
+ gcs: ["KEY_ID", "SECRET"],
33
+ azure: ["CONNECTION_STRING"],
34
+ http: ["TOKEN"],
35
+ };
36
+ const quote = (value) => JSON.stringify(value);
37
+ /**
38
+ * Turns a draft into the config a server reads and the environment
39
+ * variables that carry its credentials. Pure, so it can be tested and reused
40
+ * by an agent or a command-line tool.
41
+ */
42
+ export function connectionPlan(draft) {
43
+ const problems = [];
44
+ const remote = draft.storage !== "local";
45
+ const storage = STORAGE.find((s) => s.id === draft.storage);
46
+ const scope = draft.scope.trim().replace(/\/+$/, "");
47
+ const secret = draft.secret.trim();
48
+ if (!/^[A-Za-z_][\w-]*$/.test(draft.sourceId))
49
+ problems.push("Give the source a short name made of letters, digits, hyphens or underscores.");
50
+ if (remote && !scope.startsWith(storage.prefix))
51
+ problems.push(`The location should start with ${storage.prefix}`);
52
+ if (remote && draft.credentials === "secret" && !/^[A-Z][A-Z0-9_]*$/.test(secret))
53
+ problems.push("Name the secret in capitals, e.g. LAKE. Its values are set on the server, not here.");
54
+ const tables = draft.tables.filter((t) => t.name.trim() || t.path.trim());
55
+ if (tables.length === 0 && !draft.catalogUri.trim())
56
+ problems.push("Add at least one table or a catalog.");
57
+ for (const table of tables) {
58
+ if (!/^[A-Za-z_]\w*$/.test(table.name.trim()))
59
+ problems.push(`Table names use letters, digits and underscores: ${table.name || "(empty)"}`);
60
+ if (remote && scope && !table.path.trim().startsWith(scope))
61
+ problems.push(`${table.name || "A table"} is outside ${scope}, so the connection will not cover it.`);
62
+ if (!table.path.trim())
63
+ problems.push(`${table.name || "A table"} needs a location.`);
64
+ }
65
+ if (new Set(tables.map((t) => t.name.trim().toLowerCase())).size !== tables.length)
66
+ problems.push("Two tables have the same name.");
67
+ const lines = ["{", ` id: ${quote(draft.sourceId)},`, ` engine: "duckdb",`];
68
+ if (remote) {
69
+ const connection = [`name: ${quote(draft.sourceId.replace(/-/g, "_"))}`, `kind: ${quote(draft.storage)}`, `scope: ${quote(scope)}`];
70
+ if (draft.credentials === "secret")
71
+ connection.push(`secret: ${quote(secret)}`);
72
+ if (draft.credentials === "ambient")
73
+ connection.push("ambientCredentials: true");
74
+ if (draft.region.trim())
75
+ connection.push(`region: ${quote(draft.region.trim())}`);
76
+ if (draft.endpoint.trim())
77
+ connection.push(`endpoint: ${quote(draft.endpoint.trim())}`, `urlStyle: "path"`);
78
+ lines.push(` connections: [{ ${connection.join(", ")} }],`);
79
+ }
80
+ lines.push(" tables: [");
81
+ for (const table of tables)
82
+ lines.push(` { name: ${quote(table.name.trim())}, format: ${quote(table.format)}, path: ${quote(table.path.trim())} },`);
83
+ lines.push(" ],");
84
+ if (draft.catalogUri.trim()) {
85
+ const catalog = [`name: "catalog"`, `kind: "iceberg-rest"`, `uri: ${quote(draft.catalogUri.trim())}`];
86
+ if (draft.catalogWarehouse.trim())
87
+ catalog.push(`warehouse: ${quote(draft.catalogWarehouse.trim())}`);
88
+ if (draft.credentials === "secret")
89
+ catalog.push(`secret: ${quote(secret)}`);
90
+ lines.push(` catalogs: [{ ${catalog.join(", ")} }],`);
91
+ }
92
+ lines.push("}");
93
+ const env = remote && draft.credentials === "secret"
94
+ ? [...ENV_FIELDS[draft.storage], ...(draft.catalogUri.trim() ? ["TOKEN"] : [])].filter((f, i, all) => all.indexOf(f) === i).map((field) => `${secret}_${field}`)
95
+ : [];
96
+ return { config: lines.join("\n"), env, problems };
97
+ }
98
+ /**
99
+ * Sets up a connection to Parquet, Delta Lake or Iceberg data on an object
100
+ * store, a web server or the server's own disk, and optionally an Iceberg
101
+ * REST catalog. It writes the config for the server and lists the
102
+ * environment variables that hold the credentials. There is nowhere to type
103
+ * a credential: the browser only ever handles the secret's name.
104
+ */
105
+ export function ConnectionBuilder({ value, onChange, className }) {
106
+ const id = useId();
107
+ const plan = connectionPlan(value);
108
+ const storage = STORAGE.find((s) => s.id === value.storage);
109
+ const remote = value.storage !== "local";
110
+ const set = (change) => onChange({ ...value, ...change });
111
+ const setTable = (index, change) => set({ tables: value.tables.map((t, i) => (i === index ? { ...t, ...change } : t)) });
112
+ const field = (label, key, placeholder = "") => (_jsxs("label", { children: [_jsx("span", { children: label }), _jsx("input", { className: "sf-input", value: String(value[key]), placeholder: placeholder, onChange: (e) => set({ [key]: e.target.value }) })] }));
113
+ return (_jsxs("div", { className: ["sf-connect", className].filter(Boolean).join(" "), children: [_jsxs("fieldset", { className: "sf-connect-group", children: [_jsx("legend", { children: "Where the data is" }), field("Source name", "sourceId", "lake"), _jsxs("label", { children: [_jsx("span", { children: "Storage" }), _jsx("select", { className: "sf-input", value: value.storage, onChange: (e) => set({ storage: e.target.value, scope: "" }), children: STORAGE.map((s) => (_jsx("option", { value: s.id, children: s.label }, s.id))) })] }), remote && field("Bucket or folder it covers", "scope", storage.example), (value.storage === "s3" || value.storage === "gcs") && field("Region", "region", "us-east-1"), value.storage === "s3" && field("Endpoint (S3-compatible stores only)", "endpoint", "minio.internal:9000")] }), remote && (_jsxs("fieldset", { className: "sf-connect-group", children: [_jsx("legend", { children: "How the server signs in" }), _jsxs("label", { children: [_jsx("span", { children: "Credentials" }), _jsxs("select", { className: "sf-input", value: value.credentials, onChange: (e) => set({ credentials: e.target.value }), children: [_jsx("option", { value: "secret", children: "A named secret on the server" }), value.storage !== "http" && _jsx("option", { value: "ambient", children: "The server's own cloud role or profile" }), _jsx("option", { value: "public", children: "None, the data is public" })] })] }), value.credentials === "secret" && field("Secret name", "secret", "LAKE"), _jsx("p", { className: "sf-connect-note", children: "Credentials are never typed here. The server reads them from its environment by this name." })] })), _jsxs("fieldset", { className: "sf-connect-group sf-connect-tables", children: [_jsx("legend", { children: "Tables" }), value.tables.map((table, index) => (_jsxs("div", { className: "sf-connect-row", role: "group", "aria-label": `Table ${index + 1}`, children: [_jsxs("label", { children: [_jsx("span", { children: "Name" }), _jsx("input", { className: "sf-input", value: table.name, placeholder: "orders", onChange: (e) => setTable(index, { name: e.target.value }) })] }), _jsxs("label", { children: [_jsx("span", { children: "Format" }), _jsx("select", { className: "sf-input", value: table.format, onChange: (e) => setTable(index, { format: e.target.value }), children: FORMATS.map((f) => (_jsx("option", { value: f.id, children: f.label }, f.id))) })] }), _jsxs("div", { className: "sf-connect-path", children: [_jsxs("label", { children: [_jsx("span", { children: "Location" }), _jsx("input", { className: "sf-input", value: table.path, placeholder: remote ? `${value.scope || storage.example}/orders` : storage.example, "aria-describedby": `${id}-hint-${index}`, onChange: (e) => setTable(index, { path: e.target.value }) })] }), _jsx("span", { id: `${id}-hint-${index}`, className: "sf-connect-note", children: FORMATS.find((f) => f.id === table.format).hint })] }), value.tables.length > 1 && (_jsx("button", { type: "button", className: "sf-button", "aria-label": `Remove table ${index + 1}`, onClick: () => set({ tables: value.tables.filter((_, i) => i !== index) }), children: "Remove" }))] }, index))), _jsx("button", { type: "button", className: "sf-button", onClick: () => set({ tables: [...value.tables, { name: "", format: "parquet", path: "" }] }), children: "Add table" })] }), remote && (_jsxs("fieldset", { className: "sf-connect-group", children: [_jsx("legend", { children: "Iceberg catalog (optional)" }), field("REST catalog address", "catalogUri", "https://catalog.example.com/api/catalog"), field("Warehouse", "catalogWarehouse", "analytics"), _jsx("p", { className: "sf-connect-note", children: "Every table in the catalog is listed under its own schema, so they need not be added one by one." })] })), _jsx("section", { className: "sf-connect-plan", "aria-label": "What to do", "aria-live": "polite", children: plan.problems.length > 0 ? (_jsx("ul", { className: "sf-connect-problems", children: plan.problems.map((problem) => (_jsx("li", { children: problem }, problem))) })) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "sf-object-label", children: "1. Add this to sources in surfaces.config.ts" }), _jsx(CodeBlock, { code: plan.config, language: "ts" }), plan.env.length > 0 && (_jsxs(_Fragment, { children: [_jsx("p", { className: "sf-object-label", children: "2. Set these on the server, then restart it" }), _jsx(CodeBlock, { code: plan.env.map((name) => `export ${name}=…`).join("\n"), language: "sh" })] })), _jsx("p", { className: "sf-connect-note", children: "Then use \u201CTest connection\u201D on the source to see that each table can be reached." })] })) })] }));
114
+ }
115
+ //# sourceMappingURL=ConnectionBuilder.js.map