@surfaces-ui/components 0.6.0 → 0.8.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 (79) hide show
  1. package/NOTICE +50 -0
  2. package/dist/appComponents.d.ts +9 -0
  3. package/dist/appComponents.js +105 -1
  4. package/dist/appComponents.js.map +1 -1
  5. package/dist/brand/MovingMark.d.ts +15 -0
  6. package/dist/brand/MovingMark.js +52 -0
  7. package/dist/brand/MovingMark.js.map +1 -0
  8. package/dist/brand/SurfacesMark.d.ts +9 -0
  9. package/dist/brand/SurfacesMark.js +12 -0
  10. package/dist/brand/SurfacesMark.js.map +1 -0
  11. package/dist/brand/index.d.ts +3 -0
  12. package/dist/brand/index.js +3 -0
  13. package/dist/brand/index.js.map +1 -0
  14. package/dist/brand/markMotion.d.ts +29 -0
  15. package/dist/brand/markMotion.js +89 -0
  16. package/dist/brand/markMotion.js.map +1 -0
  17. package/dist/chart/Chart.d.ts +8 -4
  18. package/dist/chart/Chart.js +19 -8
  19. package/dist/chart/Chart.js.map +1 -1
  20. package/dist/chart/advice.d.ts +4 -2
  21. package/dist/chart/advice.js +14 -1
  22. package/dist/chart/advice.js.map +1 -1
  23. package/dist/chart/option.d.ts +17 -2
  24. package/dist/chart/option.js +146 -3
  25. package/dist/chart/option.js.map +1 -1
  26. package/dist/controls/ConfirmDialog.d.ts +17 -2
  27. package/dist/controls/ConfirmDialog.js +37 -11
  28. package/dist/controls/ConfirmDialog.js.map +1 -1
  29. package/dist/controls/ItemControls.d.ts +6 -2
  30. package/dist/controls/ItemControls.js +8 -3
  31. package/dist/controls/ItemControls.js.map +1 -1
  32. package/dist/controls/OutlineIcon.d.ts +9 -0
  33. package/dist/controls/OutlineIcon.js +12 -0
  34. package/dist/controls/OutlineIcon.js.map +1 -0
  35. package/dist/data/DataSourceProvider.d.ts +2 -0
  36. package/dist/data/DataSourceProvider.js +5 -0
  37. package/dist/data/DataSourceProvider.js.map +1 -1
  38. package/dist/feedback/ErrorPage.d.ts +27 -0
  39. package/dist/feedback/ErrorPage.js +12 -0
  40. package/dist/feedback/ErrorPage.js.map +1 -0
  41. package/dist/index.d.ts +6 -0
  42. package/dist/index.js +6 -0
  43. package/dist/index.js.map +1 -1
  44. package/dist/loading/ChartArt.d.ts +8 -0
  45. package/dist/loading/ChartArt.js +29 -0
  46. package/dist/loading/ChartArt.js.map +1 -0
  47. package/dist/loading/DraftCard.d.ts +10 -0
  48. package/dist/loading/DraftCard.js +38 -0
  49. package/dist/loading/DraftCard.js.map +1 -0
  50. package/dist/loading/Loading.d.ts +49 -0
  51. package/dist/loading/Loading.js +38 -0
  52. package/dist/loading/Loading.js.map +1 -0
  53. package/dist/locale/locale.d.ts +42 -0
  54. package/dist/locale/locale.js +43 -0
  55. package/dist/locale/locale.js.map +1 -1
  56. package/dist/record/RecordForm.d.ts +85 -0
  57. package/dist/record/RecordForm.js +221 -0
  58. package/dist/record/RecordForm.js.map +1 -0
  59. package/dist/record/record.d.ts +82 -0
  60. package/dist/record/record.js +125 -0
  61. package/dist/record/record.js.map +1 -0
  62. package/dist/result/QueryResult.js +2 -1
  63. package/dist/result/QueryResult.js.map +1 -1
  64. package/dist/review/ActionReceipt.d.ts +2 -1
  65. package/dist/review/ActionReceipt.js +1 -0
  66. package/dist/review/ActionReceipt.js.map +1 -1
  67. package/dist/schema/SchemaExplorer.d.ts +4 -0
  68. package/dist/schema/SchemaExplorer.js +46 -28
  69. package/dist/schema/SchemaExplorer.js.map +1 -1
  70. package/dist/site/Site.d.ts +9 -4
  71. package/dist/site/Site.js +14 -8
  72. package/dist/site/Site.js.map +1 -1
  73. package/dist/styles.css +1097 -100
  74. package/dist/styles.layer.css +1097 -100
  75. package/dist/text/Markdown.js +21 -8
  76. package/dist/text/Markdown.js.map +1 -1
  77. package/dist/workspace/icons.js +2 -1
  78. package/dist/workspace/icons.js.map +1 -1
  79. package/package.json +12 -7
@@ -9,6 +9,11 @@ export function DataSourceProvider({ dataSource, children }) {
9
9
  useProvided("dataSource", dataSource);
10
10
  return _jsx(DataSourceContext.Provider, { value: dataSource, children: children });
11
11
  }
12
+ /** The DataSource from the nearest provider or the prop, or nothing: for a component that can do without one (a form for a new record reads nothing). */
13
+ export function useOptionalDataSource(override) {
14
+ const fromContext = useContext(DataSourceContext);
15
+ return useTraced("DataSource", override ?? fromContext, DATA_SOURCE_TRACE);
16
+ }
12
17
  /** The DataSource from the nearest provider, or the one passed as a prop. */
13
18
  export function useDataSource(override) {
14
19
  const fromContext = useContext(DataSourceContext);
@@ -1 +1 @@
1
- {"version":3,"file":"DataSourceProvider.js","sourceRoot":"","sources":["../../src/data/DataSourceProvider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAkB,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElE,MAAM,iBAAiB,GAAG,aAAa,CAAyB,SAAS,CAAC,CAAC;AAQ3E,qEAAqE;AACrE,MAAM,UAAU,kBAAkB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAA2B;IAClF,0GAA0G;IAC1G,WAAW,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACtC,OAAO,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,YAAG,QAAQ,GAA8B,CAAC;AAChG,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAAC,QAAqB;IACjD,MAAM,WAAW,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAClD,sGAAsG;IACtG,MAAM,UAAU,GAAG,SAAS,CAAC,YAAY,EAAE,QAAQ,IAAI,WAAW,EAAE,iBAAiB,CAAC,CAAC;IACvF,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;IAClH,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { DataSource } from \"@surfaces-ui/data\";\nimport { DATA_SOURCE_TRACE } from \"@surfaces-ui/trace\";\nimport { useProvided, useTraced } from \"@surfaces-ui/trace/react\";\nimport { type ReactNode, createContext, useContext } from \"react\";\n\nconst DataSourceContext = createContext<DataSource | undefined>(undefined);\n\nexport interface DataSourceProviderProps {\n /** Any implementation: a Connect client, `memoryDataSource`, or your own. */\n dataSource: DataSource;\n children: ReactNode;\n}\n\n/** Makes a DataSource available to every data component below it. */\nexport function DataSourceProvider({ dataSource, children }: DataSourceProviderProps) {\n // With a recorder above (dev tools), it is told which backend the page uses. Nothing happens without one.\n useProvided(\"dataSource\", dataSource);\n return <DataSourceContext.Provider value={dataSource}>{children}</DataSourceContext.Provider>;\n}\n\n/** The DataSource from the nearest provider, or the one passed as a prop. */\nexport function useDataSource(override?: DataSource): DataSource {\n const fromContext = useContext(DataSourceContext);\n // Traced, as a child of the component asking, when a recorder is above; the backend itself otherwise.\n const dataSource = useTraced(\"DataSource\", override ?? fromContext, DATA_SOURCE_TRACE);\n if (!dataSource) throw new Error(\"No DataSource: wrap the component in <DataSourceProvider> or pass dataSource.\");\n return dataSource;\n}\n"]}
1
+ {"version":3,"file":"DataSourceProvider.js","sourceRoot":"","sources":["../../src/data/DataSourceProvider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAkB,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElE,MAAM,iBAAiB,GAAG,aAAa,CAAyB,SAAS,CAAC,CAAC;AAQ3E,qEAAqE;AACrE,MAAM,UAAU,kBAAkB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAA2B;IAClF,0GAA0G;IAC1G,WAAW,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACtC,OAAO,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,YAAG,QAAQ,GAA8B,CAAC;AAChG,CAAC;AAED,yJAAyJ;AACzJ,MAAM,UAAU,qBAAqB,CAAC,QAAqB;IACzD,MAAM,WAAW,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAClD,OAAO,SAAS,CAAC,YAAY,EAAE,QAAQ,IAAI,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAC7E,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAAC,QAAqB;IACjD,MAAM,WAAW,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAClD,sGAAsG;IACtG,MAAM,UAAU,GAAG,SAAS,CAAC,YAAY,EAAE,QAAQ,IAAI,WAAW,EAAE,iBAAiB,CAAC,CAAC;IACvF,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;IAClH,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { DataSource } from \"@surfaces-ui/data\";\nimport { DATA_SOURCE_TRACE } from \"@surfaces-ui/trace\";\nimport { useProvided, useTraced } from \"@surfaces-ui/trace/react\";\nimport { type ReactNode, createContext, useContext } from \"react\";\n\nconst DataSourceContext = createContext<DataSource | undefined>(undefined);\n\nexport interface DataSourceProviderProps {\n /** Any implementation: a Connect client, `memoryDataSource`, or your own. */\n dataSource: DataSource;\n children: ReactNode;\n}\n\n/** Makes a DataSource available to every data component below it. */\nexport function DataSourceProvider({ dataSource, children }: DataSourceProviderProps) {\n // With a recorder above (dev tools), it is told which backend the page uses. Nothing happens without one.\n useProvided(\"dataSource\", dataSource);\n return <DataSourceContext.Provider value={dataSource}>{children}</DataSourceContext.Provider>;\n}\n\n/** The DataSource from the nearest provider or the prop, or nothing: for a component that can do without one (a form for a new record reads nothing). */\nexport function useOptionalDataSource(override?: DataSource): DataSource | undefined {\n const fromContext = useContext(DataSourceContext);\n return useTraced(\"DataSource\", override ?? fromContext, DATA_SOURCE_TRACE);\n}\n\n/** The DataSource from the nearest provider, or the one passed as a prop. */\nexport function useDataSource(override?: DataSource): DataSource {\n const fromContext = useContext(DataSourceContext);\n // Traced, as a child of the component asking, when a recorder is above; the backend itself otherwise.\n const dataSource = useTraced(\"DataSource\", override ?? fromContext, DATA_SOURCE_TRACE);\n if (!dataSource) throw new Error(\"No DataSource: wrap the component in <DataSourceProvider> or pass dataSource.\");\n return dataSource;\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from "react";
2
+ export interface ErrorPageProps {
3
+ /** What happened, short: "We can't find this report". */
4
+ title: string;
5
+ /** Why, as far as it may be said, and what can be done. Never an engine's or a server's own text. */
6
+ message: string;
7
+ /** A short code above the title, such as "404". */
8
+ code?: string;
9
+ /** The ways on, the one to take first. */
10
+ actions?: {
11
+ id: string;
12
+ label: string;
13
+ }[];
14
+ onAction?(id: string): void;
15
+ /** A picture above the words: the host's own mark or drawing. Decoration, hidden from assistive technology. */
16
+ picture?: ReactNode;
17
+ /** The title's heading level. Default 1. */
18
+ level?: 1 | 2 | 3;
19
+ className?: string;
20
+ }
21
+ /**
22
+ * What is shown in place of a page that could not be: not found, no longer shared, the server not answering, a failure
23
+ * to draw. It says what happened and the way on. The words are an alert, so they are read out when it appears. It is
24
+ * not a landmark: put it in the page's `main`. For "not found", say the same whether or not the thing exists for
25
+ * someone else, so the page does not tell.
26
+ */
27
+ export declare function ErrorPage({ title, message, code, actions, onAction, picture, level, className }: ErrorPageProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * What is shown in place of a page that could not be: not found, no longer shared, the server not answering, a failure
4
+ * to draw. It says what happened and the way on. The words are an alert, so they are read out when it appears. It is
5
+ * not a landmark: put it in the page's `main`. For "not found", say the same whether or not the thing exists for
6
+ * someone else, so the page does not tell.
7
+ */
8
+ export function ErrorPage({ title, message, code, actions = [], onAction, picture, level = 1, className }) {
9
+ const Title = `h${level}`;
10
+ return (_jsxs("div", { className: ["sf-error-page", className].filter(Boolean).join(" "), children: [picture && (_jsx("span", { className: "sf-error-page-picture", "aria-hidden": "true", children: picture })), _jsxs("div", { role: "alert", className: "sf-error-page-words", children: [code && _jsx("p", { className: "sf-error-page-code", children: code }), _jsx(Title, { children: title }), _jsx("p", { children: message })] }), actions.length > 0 && (_jsx("div", { className: "sf-error-page-actions", children: actions.map((action, i) => (_jsx("button", { type: "button", className: "sf-button", "data-variant": i === 0 ? "primary" : undefined, onClick: () => onAction?.(action.id), children: action.label }, action.id))) }))] }));
11
+ }
12
+ //# sourceMappingURL=ErrorPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorPage.js","sourceRoot":"","sources":["../../src/feedback/ErrorPage.tsx"],"names":[],"mappings":";AAmBA;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,EAAkB;IACvH,MAAM,KAAK,GAAG,IAAI,KAAK,EAAwB,CAAC;IAChD,OAAO,CACL,eAAK,SAAS,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aACnE,OAAO,IAAI,CACV,eAAM,SAAS,EAAC,uBAAuB,iBAAa,MAAM,YACvD,OAAO,GACH,CACR,EACD,eAAK,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,qBAAqB,aAC9C,IAAI,IAAI,YAAG,SAAS,EAAC,oBAAoB,YAAE,IAAI,GAAK,EACrD,KAAC,KAAK,cAAE,KAAK,GAAS,EACtB,sBAAI,OAAO,GAAK,IACZ,EACL,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CACrB,cAAK,SAAS,EAAC,uBAAuB,YACnC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAC1B,iBAAwB,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,WAAW,kBAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,YAC5I,MAAM,CAAC,KAAK,IADF,MAAM,CAAC,EAAE,CAEb,CACV,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\n\nexport interface ErrorPageProps {\n /** What happened, short: \"We can't find this report\". */\n title: string;\n /** Why, as far as it may be said, and what can be done. Never an engine's or a server's own text. */\n message: string;\n /** A short code above the title, such as \"404\". */\n code?: string;\n /** The ways on, the one to take first. */\n actions?: { id: string; label: string }[];\n onAction?(id: string): void;\n /** A picture above the words: the host's own mark or drawing. Decoration, hidden from assistive technology. */\n picture?: ReactNode;\n /** The title's heading level. Default 1. */\n level?: 1 | 2 | 3;\n className?: string;\n}\n\n/**\n * What is shown in place of a page that could not be: not found, no longer shared, the server not answering, a failure\n * to draw. It says what happened and the way on. The words are an alert, so they are read out when it appears. It is\n * not a landmark: put it in the page's `main`. For \"not found\", say the same whether or not the thing exists for\n * someone else, so the page does not tell.\n */\nexport function ErrorPage({ title, message, code, actions = [], onAction, picture, level = 1, className }: ErrorPageProps) {\n const Title = `h${level}` as \"h1\" | \"h2\" | \"h3\";\n return (\n <div className={[\"sf-error-page\", className].filter(Boolean).join(\" \")}>\n {picture && (\n <span className=\"sf-error-page-picture\" aria-hidden=\"true\">\n {picture}\n </span>\n )}\n <div role=\"alert\" className=\"sf-error-page-words\">\n {code && <p className=\"sf-error-page-code\">{code}</p>}\n <Title>{title}</Title>\n <p>{message}</p>\n </div>\n {actions.length > 0 && (\n <div className=\"sf-error-page-actions\">\n {actions.map((action, i) => (\n <button key={action.id} type=\"button\" className=\"sf-button\" data-variant={i === 0 ? \"primary\" : undefined} onClick={() => onAction?.(action.id)}>\n {action.label}\n </button>\n ))}\n </div>\n )}\n </div>\n );\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -51,6 +51,8 @@ export * from "./menu/ContextMenu.js";
51
51
  export * from "./schema/ObjectInfo.js";
52
52
  export { type FilterOp, type FilterSpec, type SortSpec, FILTER_OPS, chosenValues, filterWords, filtersExcept, filtersFromSpec, filtersToSpec, joinRelative, parseFilterSpecs, parseSortSpecs, sinceLabel, sinceStart, sortsFromSpec, sortsToSpec, selectValues, splitRelative, toggleValueFilter, valueFilter } from "@surfaces-ui/data";
53
53
  export * from "./form/Form.js";
54
+ export * from "./record/RecordForm.js";
55
+ export * from "./record/record.js";
54
56
  export * from "./workspace/layout.js";
55
57
  export * from "./workspace/icons.js";
56
58
  export * from "./workspace/Workspace.js";
@@ -77,6 +79,10 @@ export * from "./controls/ResizeHandle.js";
77
79
  export * from "./controls/SegmentedControl.js";
78
80
  export * from "./controls/ConfirmDialog.js";
79
81
  export * from "./controls/StatusBadge.js";
82
+ export { LOADER_CHARTS, type LoaderChart } from "./loading/ChartArt.js";
83
+ export * from "./loading/DraftCard.js";
84
+ export * from "./loading/Loading.js";
85
+ export * from "./feedback/ErrorPage.js";
80
86
  export * from "./controls/Combobox.js";
81
87
  export * from "./controls/Popover.js";
82
88
  export * from "./table/DataTable.js";
package/dist/index.js CHANGED
@@ -52,6 +52,8 @@ export * from "./schema/ObjectInfo.js";
52
52
  // The plain filter form lives in @surfaces-ui/data, below every package that uses it.
53
53
  export { FILTER_OPS, chosenValues, filterWords, filtersExcept, filtersFromSpec, filtersToSpec, joinRelative, parseFilterSpecs, parseSortSpecs, sinceLabel, sinceStart, sortsFromSpec, sortsToSpec, selectValues, splitRelative, toggleValueFilter, valueFilter } from "@surfaces-ui/data";
54
54
  export * from "./form/Form.js";
55
+ export * from "./record/RecordForm.js";
56
+ export * from "./record/record.js";
55
57
  export * from "./workspace/layout.js";
56
58
  export * from "./workspace/icons.js";
57
59
  export * from "./workspace/Workspace.js";
@@ -78,6 +80,10 @@ export * from "./controls/ResizeHandle.js";
78
80
  export * from "./controls/SegmentedControl.js";
79
81
  export * from "./controls/ConfirmDialog.js";
80
82
  export * from "./controls/StatusBadge.js";
83
+ export { LOADER_CHARTS } from "./loading/ChartArt.js";
84
+ export * from "./loading/DraftCard.js";
85
+ export * from "./loading/Loading.js";
86
+ export * from "./feedback/ErrorPage.js";
81
87
  export * from "./controls/Combobox.js";
82
88
  export * from "./controls/Popover.js";
83
89
  export * from "./table/DataTable.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBA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AC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./locale/locale.js\";\nexport * from \"./locale/SurfacesText.js\";\nexport * from \"./theme/ThemeProvider.js\";\nexport * from \"./theme/ThemePicker.js\";\nexport * from \"./data/DataSourceProvider.js\";\nexport * from \"./data/format.js\";\nexport * from \"./data/useRowWindow.js\";\nexport * from \"./data/messages.js\";\nexport * from \"./data/DataNotes.js\";\nexport * from \"./grid/DataGrid.js\";\nexport * from \"./chart/Chart.js\";\nexport * from \"./chart/option.js\";\nexport * from \"./editor/SqlEditor.js\";\nexport * from \"./schema/SchemaExplorer.js\";\nexport * from \"./schema/ObjectBrowser.js\";\nexport * from \"./filter/FilterBar.js\";\nexport * from \"./pivot/PivotTable.js\";\nexport * from \"./result/QueryResult.js\";\nexport * from \"./discovery/shared.js\";\nexport * from \"./discovery/DataSearch.js\";\nexport * from \"./discovery/ObjectDetail.js\";\nexport * from \"./discovery/ContextBuilder.js\";\nexport * from \"./discovery/RelationshipGraph.js\";\nexport * from \"./graph/NodeGraph.js\";\nexport * from \"./graph/model.js\";\nexport * from \"./discovery/AskData.js\";\nexport * from \"./model/ModelDiagram.js\";\nexport * from \"./text/Markdown.js\";\nexport * from \"./text/Image.js\";\nexport * from \"./source/SourceList.js\";\nexport * from \"./source/ConnectionBuilder.js\";\nexport * from \"./metric/Metric.js\";\nexport * from \"./rows/RowList.js\";\nexport * from \"./pipeline/Pipeline.js\";\nexport * from \"./panzoom/usePanZoom.js\";\nexport * from \"./data/export.js\";\nexport * from \"./plan/QueryPlan.js\";\nexport * from \"./pipeline/PipelineView.js\";\nexport * from \"./pipeline/DatasetReview.js\";\nexport * from \"./pipeline/IngestWizard.js\";\nexport * from \"./chart/advice.js\";\nexport * from \"./chart/Sparkline.js\";\nexport * from \"./chart/BulletGraph.js\";\nexport * from \"./metric/useMeasure.js\";\nexport * from \"./review/PlanReview.js\";\nexport * from \"./review/PiiReview.js\";\nexport * from \"./review/pii.js\";\nexport * from \"./review/StepFlow.js\";\nexport * from \"./review/ActionReceipt.js\";\nexport * from \"./menu/ContextMenu.js\";\nexport * from \"./schema/ObjectInfo.js\";\n// The plain filter form lives in @surfaces-ui/data, below every package that uses it.\nexport { type FilterOp, type FilterSpec, type SortSpec, FILTER_OPS, chosenValues, filterWords, filtersExcept, filtersFromSpec, filtersToSpec, joinRelative, parseFilterSpecs, parseSortSpecs, sinceLabel, sinceStart, sortsFromSpec, sortsToSpec, selectValues, splitRelative, toggleValueFilter, valueFilter } from \"@surfaces-ui/data\";\nexport * from \"./form/Form.js\";\nexport * from \"./workspace/layout.js\";\nexport * from \"./workspace/icons.js\";\nexport * from \"./workspace/Workspace.js\";\nexport * from \"./workspace/SideNav.js\";\nexport * from \"./workspace/NavBar.js\";\nexport * from \"./site/Site.js\";\nexport * from \"./schema/refs.js\";\nexport * from \"./files/files.js\";\nexport * from \"./files/FileBrowser.js\";\nexport * from \"./filter/QueryFilters.js\";\nexport * from \"./explore/model.js\";\nexport * from \"./explore/Explorer.js\";\nexport * from \"./explore/report.js\";\nexport * from \"./explore/ReportBuilder.js\";\nexport * from \"./explore/semantic.js\";\nexport * from \"./explore/SemanticsProvider.js\";\nexport * from \"./explore/SemanticModelEditor.js\";\nexport * from \"./explore/SemanticRows.js\";\nexport * from \"./explore/ModelLineage.js\";\nexport * from \"./explore/semantic-proposal.js\";\nexport * from \"./controls/ItemControls.js\";\nexport * from \"./controls/context.js\";\nexport * from \"./controls/ResizeHandle.js\";\nexport * from \"./controls/SegmentedControl.js\";\nexport * from \"./controls/ConfirmDialog.js\";\nexport * from \"./controls/StatusBadge.js\";\nexport * from \"./controls/Combobox.js\";\nexport * from \"./controls/Popover.js\";\nexport * from \"./table/DataTable.js\";\nexport * from \"./table/SelectionBar.js\";\nexport * from \"./table/Pagination.js\";\nexport * from \"./controls/resize.js\";\nexport * from \"./appComponents.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,c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AA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAoB,MAAM,uBAAuB,CAAC;AACxE,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./locale/locale.js\";\nexport * from \"./locale/SurfacesText.js\";\nexport * from \"./theme/ThemeProvider.js\";\nexport * from \"./theme/ThemePicker.js\";\nexport * from \"./data/DataSourceProvider.js\";\nexport * from \"./data/format.js\";\nexport * from \"./data/useRowWindow.js\";\nexport * from \"./data/messages.js\";\nexport * from \"./data/DataNotes.js\";\nexport * from \"./grid/DataGrid.js\";\nexport * from \"./chart/Chart.js\";\nexport * from \"./chart/option.js\";\nexport * from \"./editor/SqlEditor.js\";\nexport * from \"./schema/SchemaExplorer.js\";\nexport * from \"./schema/ObjectBrowser.js\";\nexport * from \"./filter/FilterBar.js\";\nexport * from \"./pivot/PivotTable.js\";\nexport * from \"./result/QueryResult.js\";\nexport * from \"./discovery/shared.js\";\nexport * from \"./discovery/DataSearch.js\";\nexport * from \"./discovery/ObjectDetail.js\";\nexport * from \"./discovery/ContextBuilder.js\";\nexport * from \"./discovery/RelationshipGraph.js\";\nexport * from \"./graph/NodeGraph.js\";\nexport * from \"./graph/model.js\";\nexport * from \"./discovery/AskData.js\";\nexport * from \"./model/ModelDiagram.js\";\nexport * from \"./text/Markdown.js\";\nexport * from \"./text/Image.js\";\nexport * from \"./source/SourceList.js\";\nexport * from \"./source/ConnectionBuilder.js\";\nexport * from \"./metric/Metric.js\";\nexport * from \"./rows/RowList.js\";\nexport * from \"./pipeline/Pipeline.js\";\nexport * from \"./panzoom/usePanZoom.js\";\nexport * from \"./data/export.js\";\nexport * from \"./plan/QueryPlan.js\";\nexport * from \"./pipeline/PipelineView.js\";\nexport * from \"./pipeline/DatasetReview.js\";\nexport * from \"./pipeline/IngestWizard.js\";\nexport * from \"./chart/advice.js\";\nexport * from \"./chart/Sparkline.js\";\nexport * from \"./chart/BulletGraph.js\";\nexport * from \"./metric/useMeasure.js\";\nexport * from \"./review/PlanReview.js\";\nexport * from \"./review/PiiReview.js\";\nexport * from \"./review/pii.js\";\nexport * from \"./review/StepFlow.js\";\nexport * from \"./review/ActionReceipt.js\";\nexport * from \"./menu/ContextMenu.js\";\nexport * from \"./schema/ObjectInfo.js\";\n// The plain filter form lives in @surfaces-ui/data, below every package that uses it.\nexport { type FilterOp, type FilterSpec, type SortSpec, FILTER_OPS, chosenValues, filterWords, filtersExcept, filtersFromSpec, filtersToSpec, joinRelative, parseFilterSpecs, parseSortSpecs, sinceLabel, sinceStart, sortsFromSpec, sortsToSpec, selectValues, splitRelative, toggleValueFilter, valueFilter } from \"@surfaces-ui/data\";\nexport * from \"./form/Form.js\";\nexport * from \"./record/RecordForm.js\";\nexport * from \"./record/record.js\";\nexport * from \"./workspace/layout.js\";\nexport * from \"./workspace/icons.js\";\nexport * from \"./workspace/Workspace.js\";\nexport * from \"./workspace/SideNav.js\";\nexport * from \"./workspace/NavBar.js\";\nexport * from \"./site/Site.js\";\nexport * from \"./schema/refs.js\";\nexport * from \"./files/files.js\";\nexport * from \"./files/FileBrowser.js\";\nexport * from \"./filter/QueryFilters.js\";\nexport * from \"./explore/model.js\";\nexport * from \"./explore/Explorer.js\";\nexport * from \"./explore/report.js\";\nexport * from \"./explore/ReportBuilder.js\";\nexport * from \"./explore/semantic.js\";\nexport * from \"./explore/SemanticsProvider.js\";\nexport * from \"./explore/SemanticModelEditor.js\";\nexport * from \"./explore/SemanticRows.js\";\nexport * from \"./explore/ModelLineage.js\";\nexport * from \"./explore/semantic-proposal.js\";\nexport * from \"./controls/ItemControls.js\";\nexport * from \"./controls/context.js\";\nexport * from \"./controls/ResizeHandle.js\";\nexport * from \"./controls/SegmentedControl.js\";\nexport * from \"./controls/ConfirmDialog.js\";\nexport * from \"./controls/StatusBadge.js\";\nexport { LOADER_CHARTS, type LoaderChart } from \"./loading/ChartArt.js\";\nexport * from \"./loading/DraftCard.js\";\nexport * from \"./loading/Loading.js\";\nexport * from \"./feedback/ErrorPage.js\";\nexport * from \"./controls/Combobox.js\";\nexport * from \"./controls/Popover.js\";\nexport * from \"./table/DataTable.js\";\nexport * from \"./table/SelectionBar.js\";\nexport * from \"./table/Pagination.js\";\nexport * from \"./controls/resize.js\";\nexport * from \"./appComponents.js\";\n"]}
@@ -0,0 +1,8 @@
1
+ /** The charts drawn while something is waited for. */
2
+ export type LoaderChart = "stacked" | "combo" | "scatter" | "gantt" | "heatmap" | "sankey" | "funnel" | "table" | "bars" | "rows" | "line" | "area" | "histogram" | "pareto" | "confusion";
3
+ /** Every loader chart. */
4
+ export declare const LOADER_CHARTS: LoaderChart[];
5
+ /** One chart, drawing itself and then moving where motion is allowed (`.sf-chart-art` in styles.css). */
6
+ export declare function ChartArt({ kind }: {
7
+ kind: LoaderChart;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /** Each chart in a 64 by 40 box. `data-s` is which colour a mark takes, `data-i` its place in the order they appear. */
3
+ const ART = {
4
+ stacked: [[12, 9, 6], [16, 7, 10], [9, 12, 5], [18, 8, 9], [13, 11, 11]].map((bar, i) => (_jsx("g", { "data-i": i, "data-grow": "up", children: bar.map((h, s) => (_jsx("rect", { x: 4 + i * 12, y: 38 - bar.slice(0, s + 1).reduce((a, b) => a + b, 0), width: 8, height: h - 0.75, "data-s": s + 1 }, s))) }, i))),
5
+ combo: (_jsxs(_Fragment, { children: [[14, 20, 16, 25, 22].map((h, i) => (_jsx("rect", { x: 4 + i * 12, y: 38 - h, width: 8, height: h, rx: 1, "data-s": "1", "data-i": i, "data-grow": "up" }, i))), _jsx("polyline", { pathLength: 1, points: "8,20 20,13 32,17 44,6 56,9", "data-line": "2" })] })),
6
+ scatter: [[8, 32, 3], [17, 24, 2.5], [25, 29, 4], [32, 17, 3], [40, 21, 2.5], [47, 10, 4], [57, 7, 3]].map(([x, y, r], i) => _jsx("circle", { cx: x, cy: y, r: r, "data-s": (i % 2) + 1, "data-i": i, "data-grow": "dot" }, i)),
7
+ gantt: [[4, 20], [14, 24], [22, 14], [32, 22], [46, 14]].map(([x, w], i) => _jsx("rect", { x: x, y: 2 + i * 7.5, width: w, height: 5, rx: 2.5, "data-s": (i % 3) + 1, "data-i": i, "data-grow": "along" }, i)),
8
+ heatmap: [3, 5, 2, 8, 6, 4, 7, 9, 5, 3, 2, 6, 10, 7, 4, 5, 3, 8, 6, 2, 9, 4, 7, 5].map((v, n) => (_jsx("rect", { x: 3 + (n % 6) * 9.8, y: 2 + Math.floor(n / 6) * 9.4, width: 8.8, height: 8.4, rx: 1, fillOpacity: v / 10, "data-s": "1", "data-i": (n % 6) + Math.floor(n / 6), "data-grow": "dot", "data-cell": true }, n))),
9
+ sankey: (_jsxs(_Fragment, { children: [["M7 8C30 8 34 7 57 7", "M7 15C30 15 34 24 57 24", "M7 30C30 30 34 14 57 14", "M7 34C30 34 34 33 57 33"].map((d, i) => (_jsx("path", { d: d, pathLength: 1, "data-flow": i < 2 ? "1" : "2", "data-i": i }, d))), [[4, 4, 15, 1], [4, 26, 11, 2], [57, 3, 15, 3], [57, 20, 17, 3]].map(([x, y, h, s], i) => (_jsx("rect", { x: x, y: y, width: 3, height: h, rx: 1, "data-s": s }, i)))] })),
10
+ funnel: [58, 44, 30, 18].map((w, i) => _jsx("path", { d: `M${32 - w / 2} ${2 + i * 9.5}H${32 + w / 2}L${32 + w / 2 - 5} ${10 + i * 9.5}H${32 - w / 2 + 5}Z`, "data-s": "1", fillOpacity: 1 - i * 0.18, "data-i": i, "data-grow": "out" }, w)),
11
+ bars: [18, 30, 22, 36, 26].map((h, i) => _jsx("rect", { x: 4 + i * 12, y: 38 - h, width: 8, height: h, rx: 1, "data-s": "1", "data-i": i, "data-grow": "up" }, i)),
12
+ rows: [54, 43, 31, 20].map((w, i) => _jsx("rect", { x: 4, y: 3 + i * 9.5, width: w, height: 6, rx: 1, "data-s": "1", "data-i": i, "data-grow": "along" }, i)),
13
+ line: (_jsxs(_Fragment, { children: [_jsx("polyline", { pathLength: 1, points: "4,30 15,20 26,25 37,10 48,16 60,5", "data-line": "1" }), _jsx("polyline", { pathLength: 1, points: "4,35 15,31 26,33 37,24 48,27 60,19", "data-line": "2", "data-i": 2 })] })),
14
+ area: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M4 38V28L18 18L32 23L46 9L60 14V38Z", "data-s": "1", fillOpacity: 0.3, "data-i": 4, "data-grow": "rise" }), _jsx("polyline", { pathLength: 1, points: "4,28 18,18 32,23 46,9 60,14", "data-line": "1" })] })),
15
+ // Bars that touch, over a range: what tells a histogram from a bar chart.
16
+ histogram: [4, 9, 17, 28, 35, 30, 20, 11, 5].map((h, i) => _jsx("rect", { x: 4 + i * 6.2, y: 38 - h, width: 5.9, height: h, "data-s": "1", "data-i": i, "data-grow": "up" }, i)),
17
+ // The largest first, with the running total over them.
18
+ pareto: (_jsxs(_Fragment, { children: [[30, 20, 12, 8, 5].map((h, i) => (_jsx("rect", { x: 4 + i * 12, y: 38 - h, width: 8, height: h, rx: 1, "data-s": "1", "data-i": i, "data-grow": "up" }, i))), _jsx("polyline", { pathLength: 1, points: "8,23 20,13 32,8 44,5 56,3", "data-line": "2" })] })),
19
+ // What was predicted against what was so: strong along the diagonal.
20
+ confusion: [9, 2, 1, 2, 8, 2, 1, 3, 10].map((v, n) => (_jsx("rect", { x: 11 + (n % 3) * 14.4, y: 1 + Math.floor(n / 3) * 12.8, width: 13.4, height: 11.8, rx: 1, fillOpacity: v / 10, "data-s": n % 4 === 0 ? "1" : "2", "data-i": (n % 3) + Math.floor(n / 3), "data-grow": "dot", "data-cell": true }, n))),
21
+ table: (_jsxs(_Fragment, { children: [_jsx("rect", { x: 3, y: 2, width: 58, height: 6, rx: 1, "data-s": "1", "data-i": 0, "data-grow": "along" }), [0, 1, 2].map((r) => [[3, 20], [27, 12], [45, 16]].map(([x, w], c) => _jsx("rect", { x: x, y: 13 + r * 9, width: w - r * (c + 1), height: 3.5, rx: 1.75, "data-s": "0", "data-i": r + c + 1, "data-grow": "along" }, `${r}${c}`)))] })),
22
+ };
23
+ /** Every loader chart. */
24
+ export const LOADER_CHARTS = ["stacked", "scatter", "gantt", "line", "heatmap", "histogram", "funnel", "combo", "rows", "sankey", "area", "confusion", "bars", "table", "pareto"];
25
+ /** One chart, drawing itself and then moving where motion is allowed (`.sf-chart-art` in styles.css). */
26
+ export function ChartArt({ kind }) {
27
+ return (_jsx("svg", { className: "sf-chart-art", viewBox: "0 0 64 40", "data-chart": kind, children: ART[kind] }));
28
+ }
29
+ //# sourceMappingURL=ChartArt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartArt.js","sourceRoot":"","sources":["../../src/loading/ChartArt.tsx"],"names":[],"mappings":";AAKA,wHAAwH;AACxH,MAAM,GAAG,GAAmC;IAC1C,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CA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,EAAE,EAAE,EAAE,CAAC,YAAS,GAAG,YAAS,CAAC,eAAY,OAAO,GAAG,EACxF,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,eAAuB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAE,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,YAAS,GAAG,YAAS,CAAC,GAAG,CAAC,GAAG,CAAC,eAAY,OAAO,IAAhI,GAAG,CAAC,GAAG,CAAC,EAAE,CAAyH,CAAC,CAAC,IACtN,CACJ;CACF,CAAC;AAEF,0BAA0B;AAC1B,MAAM,CAAC,MAAM,aAAa,GAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAEjM,yGAAyG;AACzG,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAyB;IACtD,OAAO,CACL,cAAK,SAAS,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW,gBAAa,IAAI,YAC/D,GAAG,CAAC,IAAI,CAAC,GACN,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\n\n/** The charts drawn while something is waited for. */\nexport type LoaderChart = \"stacked\" | \"combo\" | \"scatter\" | \"gantt\" | \"heatmap\" | \"sankey\" | \"funnel\" | \"table\" | \"bars\" | \"rows\" | \"line\" | \"area\" | \"histogram\" | \"pareto\" | \"confusion\";\n\n/** Each chart in a 64 by 40 box. `data-s` is which colour a mark takes, `data-i` its place in the order they appear. */\nconst ART: Record<LoaderChart, ReactNode> = {\n stacked: [[12, 9, 6], [16, 7, 10], [9, 12, 5], [18, 8, 9], [13, 11, 11]].map((bar, i) => (\n <g key={i} data-i={i} data-grow=\"up\">\n {bar.map((h, s) => (\n <rect key={s} x={4 + i * 12} y={38 - bar.slice(0, s + 1).reduce((a, b) => a + b, 0)} width={8} height={h - 0.75} data-s={s + 1} />\n ))}\n </g>\n )),\n combo: (\n <>\n {[14, 20, 16, 25, 22].map((h, i) => (\n <rect key={i} x={4 + i * 12} y={38 - h} width={8} height={h} rx={1} data-s=\"1\" data-i={i} data-grow=\"up\" />\n ))}\n <polyline pathLength={1} points=\"8,20 20,13 32,17 44,6 56,9\" data-line=\"2\" />\n </>\n ),\n scatter: [[8, 32, 3], [17, 24, 2.5], [25, 29, 4], [32, 17, 3], [40, 21, 2.5], [47, 10, 4], [57, 7, 3]].map(([x, y, r], i) => <circle key={i} cx={x} cy={y} r={r} data-s={(i % 2) + 1} data-i={i} data-grow=\"dot\" />),\n gantt: [[4, 20], [14, 24], [22, 14], [32, 22], [46, 14]].map(([x, w], i) => <rect key={i} x={x} y={2 + i * 7.5} width={w} height={5} rx={2.5} data-s={(i % 3) + 1} data-i={i} data-grow=\"along\" />),\n heatmap: [3, 5, 2, 8, 6, 4, 7, 9, 5, 3, 2, 6, 10, 7, 4, 5, 3, 8, 6, 2, 9, 4, 7, 5].map((v, n) => (\n <rect key={n} x={3 + (n % 6) * 9.8} y={2 + Math.floor(n / 6) * 9.4} width={8.8} height={8.4} rx={1} fillOpacity={v / 10} data-s=\"1\" data-i={(n % 6) + Math.floor(n / 6)} data-grow=\"dot\" data-cell />\n )),\n sankey: (\n <>\n {[\"M7 8C30 8 34 7 57 7\", \"M7 15C30 15 34 24 57 24\", \"M7 30C30 30 34 14 57 14\", \"M7 34C30 34 34 33 57 33\"].map((d, i) => (\n <path key={d} d={d} pathLength={1} data-flow={i < 2 ? \"1\" : \"2\"} data-i={i} />\n ))}\n {[[4, 4, 15, 1], [4, 26, 11, 2], [57, 3, 15, 3], [57, 20, 17, 3]].map(([x, y, h, s], i) => (\n <rect key={i} x={x} y={y} width={3} height={h} rx={1} data-s={s} />\n ))}\n </>\n ),\n funnel: [58, 44, 30, 18].map((w, i) => <path key={w} d={`M${32 - w / 2} ${2 + i * 9.5}H${32 + w / 2}L${32 + w / 2 - 5} ${10 + i * 9.5}H${32 - w / 2 + 5}Z`} data-s=\"1\" fillOpacity={1 - i * 0.18} data-i={i} data-grow=\"out\" />),\n bars: [18, 30, 22, 36, 26].map((h, i) => <rect key={i} x={4 + i * 12} y={38 - h} width={8} height={h} rx={1} data-s=\"1\" data-i={i} data-grow=\"up\" />),\n rows: [54, 43, 31, 20].map((w, i) => <rect key={i} x={4} y={3 + i * 9.5} width={w} height={6} rx={1} data-s=\"1\" data-i={i} data-grow=\"along\" />),\n line: (\n <>\n <polyline pathLength={1} points=\"4,30 15,20 26,25 37,10 48,16 60,5\" data-line=\"1\" />\n <polyline pathLength={1} points=\"4,35 15,31 26,33 37,24 48,27 60,19\" data-line=\"2\" data-i={2} />\n </>\n ),\n area: (\n <>\n <path d=\"M4 38V28L18 18L32 23L46 9L60 14V38Z\" data-s=\"1\" fillOpacity={0.3} data-i={4} data-grow=\"rise\" />\n <polyline pathLength={1} points=\"4,28 18,18 32,23 46,9 60,14\" data-line=\"1\" />\n </>\n ),\n // Bars that touch, over a range: what tells a histogram from a bar chart.\n histogram: [4, 9, 17, 28, 35, 30, 20, 11, 5].map((h, i) => <rect key={i} x={4 + i * 6.2} y={38 - h} width={5.9} height={h} data-s=\"1\" data-i={i} data-grow=\"up\" />),\n // The largest first, with the running total over them.\n pareto: (\n <>\n {[30, 20, 12, 8, 5].map((h, i) => (\n <rect key={i} x={4 + i * 12} y={38 - h} width={8} height={h} rx={1} data-s=\"1\" data-i={i} data-grow=\"up\" />\n ))}\n <polyline pathLength={1} points=\"8,23 20,13 32,8 44,5 56,3\" data-line=\"2\" />\n </>\n ),\n // What was predicted against what was so: strong along the diagonal.\n confusion: [9, 2, 1, 2, 8, 2, 1, 3, 10].map((v, n) => (\n <rect key={n} x={11 + (n % 3) * 14.4} y={1 + Math.floor(n / 3) * 12.8} width={13.4} height={11.8} rx={1} fillOpacity={v / 10} data-s={n % 4 === 0 ? \"1\" : \"2\"} data-i={(n % 3) + Math.floor(n / 3)} data-grow=\"dot\" data-cell />\n )),\n table: (\n <>\n <rect x={3} y={2} width={58} height={6} rx={1} data-s=\"1\" data-i={0} data-grow=\"along\" />\n {[0, 1, 2].map((r) => [[3, 20], [27, 12], [45, 16]].map(([x, w], c) => <rect key={`${r}${c}`} x={x} y={13 + r * 9} width={w! - r * (c + 1)} height={3.5} rx={1.75} data-s=\"0\" data-i={r + c + 1} data-grow=\"along\" />))}\n </>\n ),\n};\n\n/** Every loader chart. */\nexport const LOADER_CHARTS: LoaderChart[] = [\"stacked\", \"scatter\", \"gantt\", \"line\", \"heatmap\", \"histogram\", \"funnel\", \"combo\", \"rows\", \"sankey\", \"area\", \"confusion\", \"bars\", \"table\", \"pareto\"];\n\n/** One chart, drawing itself and then moving where motion is allowed (`.sf-chart-art` in styles.css). */\nexport function ChartArt({ kind }: { kind: LoaderChart }) {\n return (\n <svg className=\"sf-chart-art\" viewBox=\"0 0 64 40\" data-chart={kind}>\n {ART[kind]}\n </svg>\n );\n}\n"]}
@@ -0,0 +1,10 @@
1
+ export interface DraftCardProps {
2
+ /** How many cards, 1 to 3: fanned out when there is more than one, for several drafts made at once. Default 1. */
3
+ cards?: number;
4
+ }
5
+ /**
6
+ * A page sketching itself on a card, part by part under a pen, then thrown aside for another layout: for while a page
7
+ * is made or opened. Decoration beside the words that say so (`Loading` puts them together), hidden from assistive
8
+ * technology. Where motion is reduced it is one finished sketch, standing still.
9
+ */
10
+ export declare function DraftCard({ cards }: DraftCardProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { ChartArt } from "./ChartArt.js";
4
+ const M = "metric";
5
+ const chart = (kind) => ({ chart: kind });
6
+ /** The layouts a card tries, one after another: rows of parts. A part that is rows itself is a column of its own. */
7
+ const LAYOUTS = [
8
+ [["title"], ["text"], [M, M, M], [chart("combo"), chart("scatter")]],
9
+ [["filters"], ["title"], [chart("gantt"), chart("heatmap")]],
10
+ [["title"], [chart("sankey"), [[M], [M]]], ["rows"]],
11
+ [["title"], ["text"], [chart("stacked"), chart("funnel"), chart("table")]],
12
+ [["filters"], ["title"], [chart("histogram"), chart("confusion")], [chart("pareto"), chart("area")]],
13
+ [["title"], [M, M, M], [chart("line"), chart("rows")]],
14
+ ];
15
+ const THIN = new Set(["title", "text", "filters"]);
16
+ function Rows({ rows, at = 0 }) {
17
+ return (_jsx("div", { className: "sf-draft-rows", children: rows.map((row, r) => (_jsx("div", { className: "sf-draft-row", "data-thin": THIN.has(row[0]) || undefined, children: row.map((part, c) => {
18
+ // Parts arrive in reading order: a row at a time, and along a row.
19
+ const order = at + r * 3 + c;
20
+ return Array.isArray(part) ? (_jsx(Rows, { rows: part, at: order }, c)) : (_jsx("div", { className: "sf-draft-part", "data-kind": typeof part === "string" ? part : "chart", style: { "--sf-draft-order": order }, children: typeof part === "object" && _jsx(ChartArt, { kind: part.chart }) }, c));
21
+ }) }, r))) }));
22
+ }
23
+ function Card({ first }) {
24
+ const [turn, setTurn] = useState(first);
25
+ return (_jsx("div", { className: "sf-draft-slot", children: _jsxs("div", { className: "sf-draft-card", "data-tone": (turn % 6) + 1,
26
+ // The card's own leaving brings the next one; a part's animation ending inside it does not.
27
+ onAnimationEnd: (e) => e.target === e.currentTarget && setTurn((n) => n + 1), children: [_jsx(Rows, { rows: LAYOUTS[turn % LAYOUTS.length] }), _jsx("span", { className: "sf-draft-pen" })] }, turn) }));
28
+ }
29
+ /**
30
+ * A page sketching itself on a card, part by part under a pen, then thrown aside for another layout: for while a page
31
+ * is made or opened. Decoration beside the words that say so (`Loading` puts them together), hidden from assistive
32
+ * technology. Where motion is reduced it is one finished sketch, standing still.
33
+ */
34
+ export function DraftCard({ cards = 1 }) {
35
+ const count = Math.max(1, Math.min(3, Math.round(cards) || 1));
36
+ return (_jsx("div", { className: "sf-draft", "data-fan": count > 1 || undefined, "aria-hidden": "true", children: Array.from({ length: count }, (_, i) => (_jsx(Card, { first: i }, i))) }));
37
+ }
38
+ //# sourceMappingURL=DraftCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DraftCard.js","sourceRoot":"","sources":["../../src/loading/DraftCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAsB,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAoB,MAAM,eAAe,CAAC;AAI3D,MAAM,CAAC,GAAS,QAAQ,CAAC;AACzB,MAAM,KAAK,GAAG,CAAC,IAAiB,EAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAE7D,qHAAqH;AACrH,MAAM,OAAO,GAAe;IAC1B,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAA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,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/D,OAAO,CACL,cAAK,SAAS,EAAC,UAAU,cAAW,KAAK,GAAG,CAAC,IAAI,SAAS,iBAAc,MAAM,YAC3E,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAEvC,KAAC,IAAI,IAAS,KAAK,EAAE,CAAC,IAAX,CAAC,CAAc,CAC3B,CAAC,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { type CSSProperties, useState } from \"react\";\nimport { ChartArt, type LoaderChart } from \"./ChartArt.js\";\n\ntype Part = \"title\" | \"text\" | \"filters\" | \"metric\" | \"rows\" | { chart: LoaderChart } | Part[][];\n\nconst M: Part = \"metric\";\nconst chart = (kind: LoaderChart): Part => ({ chart: kind });\n\n/** The layouts a card tries, one after another: rows of parts. A part that is rows itself is a column of its own. */\nconst LAYOUTS: Part[][][] = [\n [[\"title\"], [\"text\"], [M, M, M], [chart(\"combo\"), chart(\"scatter\")]],\n [[\"filters\"], [\"title\"], [chart(\"gantt\"), chart(\"heatmap\")]],\n [[\"title\"], [chart(\"sankey\"), [[M], [M]]], [\"rows\"]],\n [[\"title\"], [\"text\"], [chart(\"stacked\"), chart(\"funnel\"), chart(\"table\")]],\n [[\"filters\"], [\"title\"], [chart(\"histogram\"), chart(\"confusion\")], [chart(\"pareto\"), chart(\"area\")]],\n [[\"title\"], [M, M, M], [chart(\"line\"), chart(\"rows\")]],\n];\n\nconst THIN = new Set<Part>([\"title\", \"text\", \"filters\"]);\n\nfunction Rows({ rows, at = 0 }: { rows: Part[][]; at?: number }) {\n return (\n <div className=\"sf-draft-rows\">\n {rows.map((row, r) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a layout does not change.\n <div key={r} className=\"sf-draft-row\" data-thin={THIN.has(row[0]!) || undefined}>\n {row.map((part, c) => {\n // Parts arrive in reading order: a row at a time, and along a row.\n const order = at + r * 3 + c;\n return Array.isArray(part) ? (\n // biome-ignore lint/suspicious/noArrayIndexKey: a layout does not change.\n <Rows key={c} rows={part} at={order} />\n ) : (\n // biome-ignore lint/suspicious/noArrayIndexKey: a layout does not change.\n <div key={c} className=\"sf-draft-part\" data-kind={typeof part === \"string\" ? part : \"chart\"} style={{ \"--sf-draft-order\": order } as CSSProperties}>\n {typeof part === \"object\" && <ChartArt kind={part.chart} />}\n </div>\n );\n })}\n </div>\n ))}\n </div>\n );\n}\n\nfunction Card({ first }: { first: number }) {\n const [turn, setTurn] = useState(first);\n return (\n <div className=\"sf-draft-slot\">\n <div\n key={turn}\n className=\"sf-draft-card\"\n data-tone={(turn % 6) + 1}\n // The card's own leaving brings the next one; a part's animation ending inside it does not.\n onAnimationEnd={(e) => e.target === e.currentTarget && setTurn((n) => n + 1)}\n >\n <Rows rows={LAYOUTS[turn % LAYOUTS.length]!} />\n <span className=\"sf-draft-pen\" />\n </div>\n </div>\n );\n}\n\nexport interface DraftCardProps {\n /** How many cards, 1 to 3: fanned out when there is more than one, for several drafts made at once. Default 1. */\n cards?: number;\n}\n\n/**\n * A page sketching itself on a card, part by part under a pen, then thrown aside for another layout: for while a page\n * is made or opened. Decoration beside the words that say so (`Loading` puts them together), hidden from assistive\n * technology. Where motion is reduced it is one finished sketch, standing still.\n */\nexport function DraftCard({ cards = 1 }: DraftCardProps) {\n const count = Math.max(1, Math.min(3, Math.round(cards) || 1));\n return (\n <div className=\"sf-draft\" data-fan={count > 1 || undefined} aria-hidden=\"true\">\n {Array.from({ length: count }, (_, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: the cards keep their places.\n <Card key={i} first={i} />\n ))}\n </div>\n );\n}\n"]}
@@ -0,0 +1,49 @@
1
+ import { type ReactNode } from "react";
2
+ import { type LoaderChart } from "./ChartArt.js";
3
+ export interface ChartLoaderProps {
4
+ /** The chart to draw. Without it one is picked by `seed`, or by the loader's place in the page. */
5
+ chart?: LoaderChart;
6
+ /** Picks the chart: the same words always pick the same one, so a loader taken down and put back is not another. */
7
+ seed?: string;
8
+ /** Its width, in px or any CSS length. Default 2.5rem. */
9
+ size?: number | string;
10
+ }
11
+ /**
12
+ * A small chart that draws itself and keeps moving, the same one for as long as the wait lasts. Decoration beside the
13
+ * words that say what is waited for, so it is hidden from assistive technology. Where motion is reduced it stands still.
14
+ */
15
+ export declare function ChartLoader({ chart, seed, size }: ChartLoaderProps): import("react").JSX.Element;
16
+ export interface LoadingProps {
17
+ /** What is being waited for: "Opening the report…". */
18
+ label: string;
19
+ /** "inline" (the default): a small chart beside the words. "page": a card sketching itself above them, for a page or a canvas. */
20
+ size?: "inline" | "page";
21
+ /** "page": how many cards, 1 to 3, fanned out when there is more than one. Default 1. */
22
+ cards?: number;
23
+ /** "inline": the chart to draw. */
24
+ chart?: LoaderChart;
25
+ /** A picture of the host's own in place of the chart or the card, such as `MovingMark`. */
26
+ picture?: ReactNode;
27
+ className?: string;
28
+ }
29
+ /**
30
+ * What is being waited for, with something that moves while it is. It is a live region, so the words are read out; a
31
+ * wait too short to read (a fifth of a second) shows nothing. Put `aria-busy` on what is being loaded.
32
+ */
33
+ export declare function Loading({ label, size, cards, chart, picture, className }: LoadingProps): import("react").JSX.Element;
34
+ export interface WorkingLineProps {
35
+ /** What is being done now, in words: "Reading the orders table…". */
36
+ label: string;
37
+ /** When it began, as `Date.now()` has it: the time it has been is shown. Without it no time is. */
38
+ since?: number;
39
+ /** Picks the chart, so the same turn keeps the same one. */
40
+ seed?: string;
41
+ /** Reads a change of words out. Default true; false inside something that is itself read out, such as a chat's log. */
42
+ announce?: boolean;
43
+ className?: string;
44
+ }
45
+ /**
46
+ * What an agent or a long job is doing now, with a chart that keeps moving and how long it has been. Give it only what
47
+ * is known to be happening. The time is not read out, so a screen reader hears only what changes.
48
+ */
49
+ export declare function WorkingLine({ label, since, seed, announce, className }: WorkingLineProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useId, useState } from "react";
3
+ import { ChartArt, LOADER_CHARTS } from "./ChartArt.js";
4
+ import { DraftCard } from "./DraftCard.js";
5
+ const hash = (words) => [...words].reduce((h, ch) => (h * 31 + ch.charCodeAt(0)) >>> 0, 7);
6
+ /**
7
+ * A small chart that draws itself and keeps moving, the same one for as long as the wait lasts. Decoration beside the
8
+ * words that say what is waited for, so it is hidden from assistive technology. Where motion is reduced it stands still.
9
+ */
10
+ export function ChartLoader({ chart, seed, size }) {
11
+ const place = useId();
12
+ return (_jsx("span", { className: "sf-chart-loader", "aria-hidden": "true", style: size === undefined ? undefined : { inlineSize: size }, children: _jsx(ChartArt, { kind: chart ?? LOADER_CHARTS[hash(seed ?? place) % LOADER_CHARTS.length] }) }));
13
+ }
14
+ /**
15
+ * What is being waited for, with something that moves while it is. It is a live region, so the words are read out; a
16
+ * wait too short to read (a fifth of a second) shows nothing. Put `aria-busy` on what is being loaded.
17
+ */
18
+ export function Loading({ label, size = "inline", cards = 1, chart, picture, className }) {
19
+ return (_jsxs("div", { className: ["sf-loading", className].filter(Boolean).join(" "), "data-size": size, role: "status", children: [picture ? (_jsx("span", { className: "sf-loading-picture", "aria-hidden": "true", children: picture })) : size === "page" ? (_jsx(DraftCard, { cards: cards })) : (_jsx(ChartLoader, { chart: chart })), _jsx("span", { className: "sf-loading-label", children: label })] }));
20
+ }
21
+ const clock = (seconds) => `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
22
+ /**
23
+ * What an agent or a long job is doing now, with a chart that keeps moving and how long it has been. Give it only what
24
+ * is known to be happening. The time is not read out, so a screen reader hears only what changes.
25
+ */
26
+ export function WorkingLine({ label, since, seed, announce = true, className }) {
27
+ const [now, setNow] = useState();
28
+ useEffect(() => {
29
+ if (since === undefined)
30
+ return;
31
+ const tell = () => setNow(Date.now());
32
+ tell();
33
+ const timer = setInterval(tell, 1000);
34
+ return () => clearInterval(timer);
35
+ }, [since]);
36
+ return (_jsxs("div", { className: ["sf-working", className].filter(Boolean).join(" "), children: [_jsx(ChartLoader, { seed: seed }), _jsx("span", { className: "sf-working-label", role: announce ? "status" : undefined, children: label }), since !== undefined && now !== undefined && (_jsx("span", { className: "sf-working-time", "aria-hidden": "true", children: clock(Math.max(0, Math.floor((now - since) / 1000))) }))] }));
37
+ }
38
+ //# sourceMappingURL=Loading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loading.js","sourceRoot":"","sources":["../../src/loading/Loading.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAoB,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAW3C,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AAEnG;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAoB;IACjE,MAAM,KAAK,GAAG,KAAK,EAAE,CAAC;IACtB,OAAO,CACL,eAAM,SAAS,EAAC,iBAAiB,iBAAa,MAAM,EAAC,KAAK,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,YAC/G,KAAC,QAAQ,IAAC,IAAI,EAAE,KAAK,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,aAAa,CAAC,MAAM,CAAE,GAAI,GAClF,CACR,CAAC;AACJ,C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AC;QACtC,IAAI,EAAE,CAAC;QACP,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,OAAO,CACL,eAAK,SAAS,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aACjE,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,GAAI,EAC3B,eAAM,SAAS,EAAC,kBAAkB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,YACrE,KAAK,GACD,EACN,KAAK,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,IAAI,CAC3C,eAAM,SAAS,EAAC,iBAAiB,iBAAa,MAAM,YACjD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAChD,CACR,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { type ReactNode, useEffect, useId, useState } from \"react\";\nimport { ChartArt, LOADER_CHARTS, type LoaderChart } from \"./ChartArt.js\";\nimport { DraftCard } from \"./DraftCard.js\";\n\nexport interface ChartLoaderProps {\n /** The chart to draw. Without it one is picked by `seed`, or by the loader's place in the page. */\n chart?: LoaderChart;\n /** Picks the chart: the same words always pick the same one, so a loader taken down and put back is not another. */\n seed?: string;\n /** Its width, in px or any CSS length. Default 2.5rem. */\n size?: number | string;\n}\n\nconst hash = (words: string) => [...words].reduce((h, ch) => (h * 31 + ch.charCodeAt(0)) >>> 0, 7);\n\n/**\n * A small chart that draws itself and keeps moving, the same one for as long as the wait lasts. Decoration beside the\n * words that say what is waited for, so it is hidden from assistive technology. Where motion is reduced it stands still.\n */\nexport function ChartLoader({ chart, seed, size }: ChartLoaderProps) {\n const place = useId();\n return (\n <span className=\"sf-chart-loader\" aria-hidden=\"true\" style={size === undefined ? undefined : { inlineSize: size }}>\n <ChartArt kind={chart ?? LOADER_CHARTS[hash(seed ?? place) % LOADER_CHARTS.length]!} />\n </span>\n );\n}\n\nexport interface LoadingProps {\n /** What is being waited for: \"Opening the report…\". */\n label: string;\n /** \"inline\" (the default): a small chart beside the words. \"page\": a card sketching itself above them, for a page or a canvas. */\n size?: \"inline\" | \"page\";\n /** \"page\": how many cards, 1 to 3, fanned out when there is more than one. Default 1. */\n cards?: number;\n /** \"inline\": the chart to draw. */\n chart?: LoaderChart;\n /** A picture of the host's own in place of the chart or the card, such as `MovingMark`. */\n picture?: ReactNode;\n className?: string;\n}\n\n/**\n * What is being waited for, with something that moves while it is. It is a live region, so the words are read out; a\n * wait too short to read (a fifth of a second) shows nothing. Put `aria-busy` on what is being loaded.\n */\nexport function Loading({ label, size = \"inline\", cards = 1, chart, picture, className }: LoadingProps) {\n return (\n <div className={[\"sf-loading\", className].filter(Boolean).join(\" \")} data-size={size} role=\"status\">\n {picture ? (\n <span className=\"sf-loading-picture\" aria-hidden=\"true\">\n {picture}\n </span>\n ) : size === \"page\" ? (\n <DraftCard cards={cards} />\n ) : (\n <ChartLoader chart={chart} />\n )}\n <span className=\"sf-loading-label\">{label}</span>\n </div>\n );\n}\n\nexport interface WorkingLineProps {\n /** What is being done now, in words: \"Reading the orders table…\". */\n label: string;\n /** When it began, as `Date.now()` has it: the time it has been is shown. Without it no time is. */\n since?: number;\n /** Picks the chart, so the same turn keeps the same one. */\n seed?: string;\n /** Reads a change of words out. Default true; false inside something that is itself read out, such as a chat's log. */\n announce?: boolean;\n className?: string;\n}\n\nconst clock = (seconds: number) => `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, \"0\")}`;\n\n/**\n * What an agent or a long job is doing now, with a chart that keeps moving and how long it has been. Give it only what\n * is known to be happening. The time is not read out, so a screen reader hears only what changes.\n */\nexport function WorkingLine({ label, since, seed, announce = true, className }: WorkingLineProps) {\n const [now, setNow] = useState<number>();\n useEffect(() => {\n if (since === undefined) return;\n const tell = () => setNow(Date.now());\n tell();\n const timer = setInterval(tell, 1000);\n return () => clearInterval(timer);\n }, [since]);\n return (\n <div className={[\"sf-working\", className].filter(Boolean).join(\" \")}>\n <ChartLoader seed={seed} />\n <span className=\"sf-working-label\" role={announce ? \"status\" : undefined}>\n {label}\n </span>\n {since !== undefined && now !== undefined && (\n <span className=\"sf-working-time\" aria-hidden=\"true\">\n {clock(Math.max(0, Math.floor((now - since) / 1000)))}\n </span>\n )}\n </div>\n );\n}\n"]}
@@ -49,6 +49,7 @@ export declare const defaultLabels: {
49
49
  readonly "grid.copiedRow": "the row";
50
50
  readonly "grid.copiedColumnName": "the column name";
51
51
  readonly "grid.copiedSql": "the SQL";
52
+ readonly "code.copyFailed": "Could not copy: the browser did not allow it. The code is selected, so you can copy it yourself.";
52
53
  readonly "grid.copyFailed": "Could not copy: the browser refused access to the clipboard.";
53
54
  readonly "grid.movedLeft": "Moved {name} left.";
54
55
  readonly "grid.movedRight": "Moved {name} right.";
@@ -235,6 +236,7 @@ export declare const defaultLabels: {
235
236
  readonly "plan.reject": "Reject";
236
237
  readonly "receipt.done": "Done";
237
238
  readonly "receipt.partial": "Partly done";
239
+ readonly "receipt.none": "Nothing changed";
238
240
  readonly "receipt.failed": "Failed";
239
241
  readonly "receipt.ran": "Ran";
240
242
  readonly "receipt.by": "by {who}";
@@ -269,6 +271,46 @@ export declare const defaultLabels: {
269
271
  readonly "pages.next": "Next";
270
272
  readonly "confirm.confirm": "Confirm";
271
273
  readonly "confirm.cancel": "Cancel";
274
+ readonly "confirm.typeWord": "Type “{word}” to go ahead";
275
+ readonly "confirm.reason": "Reason (optional)";
276
+ readonly "confirm.reasonRequired": "Reason (required)";
277
+ readonly "confirm.needWord": "Type “{word}” in the box first. Nothing has run.";
278
+ readonly "confirm.needReason": "Give a reason first. Nothing has run.";
279
+ readonly "run.working": "Working…";
280
+ readonly "run.you": "You";
281
+ readonly "run.reread": "Read it again";
282
+ readonly "run.continue": "Continue";
283
+ readonly "run.leftAlone": "Left alone";
284
+ readonly "run.andMore": "and {count} more";
285
+ readonly "run.changed": "Changed";
286
+ readonly "run.highRisk": "High risk";
287
+ readonly "run.irreversible": "Cannot be undone";
288
+ readonly "run.rows": "Rows it applies to";
289
+ readonly "run.operation": "Operation";
290
+ readonly "run.expires": "Ask again after {time}";
291
+ readonly "record.save": "Save";
292
+ readonly "record.saving": "Saving…";
293
+ readonly "record.saved": "Saved.";
294
+ readonly "record.edit": "Edit";
295
+ readonly "record.cancel": "Cancel";
296
+ readonly "record.unchanged": "Nothing has changed, so nothing was saved.";
297
+ readonly "record.notSaved": "Not saved: {count} fields need attention.";
298
+ readonly "record.notSavedOne": "Not saved: one field needs attention.";
299
+ readonly "record.problems": "There are {count} problems";
300
+ readonly "record.problemsOne": "There is a problem";
301
+ readonly "record.reading": "Reading the record…";
302
+ readonly "record.notFound": "This {label} was not found. It may have been removed.";
303
+ readonly "record.many": "More than one record has this key, so none is shown.";
304
+ readonly "record.unread": "The record could not be read.";
305
+ readonly "record.noOperation": "This form cannot be shown: the operation that saves it is not one this backend has.";
306
+ readonly "record.back": "Go back";
307
+ readonly "record.savedValue": "Saved now: {value}.";
308
+ readonly "record.leaveTitle": "Leave without saving?";
309
+ readonly "record.leaveBody": "Your changes to {what} have not been saved. If you leave, they are lost.";
310
+ readonly "record.leave": "Leave";
311
+ readonly "record.stay": "Stay";
312
+ readonly "record.yes": "Yes";
313
+ readonly "record.no": "No";
272
314
  readonly "combobox.loading": "Looking…";
273
315
  readonly "combobox.none": "Nothing matches.";
274
316
  readonly "combobox.count": "{count} suggestions";
@@ -75,6 +75,7 @@ export const defaultLabels = {
75
75
  "grid.copiedRow": "the row",
76
76
  "grid.copiedColumnName": "the column name",
77
77
  "grid.copiedSql": "the SQL",
78
+ "code.copyFailed": "Could not copy: the browser did not allow it. The code is selected, so you can copy it yourself.",
78
79
  "grid.copyFailed": "Could not copy: the browser refused access to the clipboard.",
79
80
  "grid.movedLeft": "Moved {name} left.",
80
81
  "grid.movedRight": "Moved {name} right.",
@@ -271,6 +272,7 @@ export const defaultLabels = {
271
272
  // ActionReceipt
272
273
  "receipt.done": "Done",
273
274
  "receipt.partial": "Partly done",
275
+ "receipt.none": "Nothing changed",
274
276
  "receipt.failed": "Failed",
275
277
  "receipt.ran": "Ran",
276
278
  "receipt.by": "by {who}",
@@ -309,6 +311,47 @@ export const defaultLabels = {
309
311
  // ConfirmDialog
310
312
  "confirm.confirm": "Confirm",
311
313
  "confirm.cancel": "Cancel",
314
+ "confirm.typeWord": "Type “{word}” to go ahead",
315
+ "confirm.reason": "Reason (optional)",
316
+ "confirm.reasonRequired": "Reason (required)",
317
+ "confirm.needWord": "Type “{word}” in the box first. Nothing has run.",
318
+ "confirm.needReason": "Give a reason first. Nothing has run.",
319
+ "run.working": "Working…",
320
+ "run.you": "You",
321
+ "run.reread": "Read it again",
322
+ "run.continue": "Continue",
323
+ "run.leftAlone": "Left alone",
324
+ "run.andMore": "and {count} more",
325
+ "run.changed": "Changed",
326
+ "run.highRisk": "High risk",
327
+ "run.irreversible": "Cannot be undone",
328
+ "run.rows": "Rows it applies to",
329
+ "run.operation": "Operation",
330
+ "run.expires": "Ask again after {time}",
331
+ // RecordForm
332
+ "record.save": "Save",
333
+ "record.saving": "Saving…",
334
+ "record.saved": "Saved.",
335
+ "record.edit": "Edit",
336
+ "record.cancel": "Cancel",
337
+ "record.unchanged": "Nothing has changed, so nothing was saved.",
338
+ "record.notSaved": "Not saved: {count} fields need attention.",
339
+ "record.notSavedOne": "Not saved: one field needs attention.",
340
+ "record.problems": "There are {count} problems",
341
+ "record.problemsOne": "There is a problem",
342
+ "record.reading": "Reading the record…",
343
+ "record.notFound": "This {label} was not found. It may have been removed.",
344
+ "record.many": "More than one record has this key, so none is shown.",
345
+ "record.unread": "The record could not be read.",
346
+ "record.noOperation": "This form cannot be shown: the operation that saves it is not one this backend has.",
347
+ "record.back": "Go back",
348
+ "record.savedValue": "Saved now: {value}.",
349
+ "record.leaveTitle": "Leave without saving?",
350
+ "record.leaveBody": "Your changes to {what} have not been saved. If you leave, they are lost.",
351
+ "record.leave": "Leave",
352
+ "record.stay": "Stay",
353
+ "record.yes": "Yes",
354
+ "record.no": "No",
312
355
  // Combobox
313
356
  "combobox.loading": "Looking…",
314
357
  "combobox.none": "Nothing matches.",