@surreal-ui/catalog 0.14.1 → 0.16.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.
@@ -270,6 +270,10 @@
270
270
 
271
271
 
272
272
 
273
+
274
+
275
+
276
+
273
277
  /* progress */
274
278
  .sui-progress {
275
279
  display: flex;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { UiAestheticProfile, UiComponentGroup, ComponentRuntime, UiComponentContract, ComponentSource } from '@pixerate/schemas/genui';
2
- export { ComponentRuntime, ComponentSource, UiAestheticProfile, UiComponentContract, UiComponentGroup } from '@pixerate/schemas/genui';
1
+ import { UiAestheticProfile, UiComponentGroup, ComponentRuntime, UiComponentContract, ComponentSource, UiEncoding } from '@pixerate/schemas/genui';
2
+ export { ComponentRuntime, ComponentSource, UiAestheticProfile, UiComponentContract, UiComponentGroup, UiEncoding } from '@pixerate/schemas/genui';
3
3
  export { D as DeprecatedSpec, T as ThemeMode, m as mapDeprecatedProps, r as resolveStructure } from './theme-V1Iz-HmC.js';
4
4
 
5
5
  /**
@@ -113,6 +113,11 @@ interface CatalogComponent {
113
113
  }>;
114
114
  /** Component type to use where this one can't run. */
115
115
  fallback?: string;
116
+ /**
117
+ * How to read it (a data visual or paradigm from a provider): what each visual channel shows,
118
+ * as a path into its props, and which parts are decoration that show no data.
119
+ */
120
+ encodings?: UiEncoding[];
116
121
  /** sha256 of the component's folder: changes whenever it does. */
117
122
  contentHash: string;
118
123
  /** The component type it implements, for an alternative or a provider item. */
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  getComponent,
17
17
  replacementFor,
18
18
  resolveRole
19
- } from "./chunk-K6AAK2NB.js";
19
+ } from "./chunk-VEFEZH7Q.js";
20
20
  import {
21
21
  mapDeprecatedProps,
22
22
  resolveStructure
package/dist/lazy.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  getAesthetic,
12
12
  getComponent,
13
13
  replacementFor
14
- } from "./chunk-K6AAK2NB.js";
14
+ } from "./chunk-VEFEZH7Q.js";
15
15
  import "./chunk-HMNTTISG.js";
16
16
 
17
17
  // src/lazy.generated.ts
package/dist/node.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { CatalogComponent } from './index.js';
2
2
  import { RegistryItem } from './registry.js';
3
3
  import { PlatformLanguage } from '@pixerate/schemas';
4
- import '@pixerate/schemas/genui';
4
+ import { UiFallback } from '@pixerate/schemas/genui';
5
+ export { UiFallback } from '@pixerate/schemas/genui';
5
6
  import './theme-V1Iz-HmC.js';
6
7
 
7
8
  /** The skills in the package, by folder name. */
@@ -65,4 +66,14 @@ declare function catalogFrameworks(component: CatalogComponent, dist?: string):
65
66
  */
66
67
  declare function catalogRegistryItem(component: CatalogComponent, framework: PlatformLanguage, aestheticId: string, dist?: string): RegistryItem | null;
67
68
 
68
- export { DEFAULT_SKILLS_DIR, type InstallSkillsOptions, type InstalledSkillFile, type InstalledSkills, SURREAL_SKILLS, type SurrealSkillName, catalogDistDir, catalogFrameworks, catalogRegistryItem, codeDependencies, installSkills, skillsSource };
69
+ /**
70
+ * What `component` shows instead for `data`, from its provider: `{ implements, props }`, where
71
+ * `implements` is a catalog type (usually `component.fallback`, though a provider may pick another
72
+ * baseline for the data, as Flair's loaders show a spinner while their value is unknown).
73
+ * Undefined when the type names no fallback or its provider has no runtime mapping. Throws when
74
+ * the data doesn't fit the type's contract. Needs the provider package installed (an optional
75
+ * peer of this one).
76
+ */
77
+ declare function engineFallback(component: Pick<CatalogComponent, 'fallback' | 'source'>, data: unknown): Promise<UiFallback | undefined>;
78
+
79
+ export { DEFAULT_SKILLS_DIR, type InstallSkillsOptions, type InstalledSkillFile, type InstalledSkills, SURREAL_SKILLS, type SurrealSkillName, catalogDistDir, catalogFrameworks, catalogRegistryItem, codeDependencies, engineFallback, installSkills, skillsSource };
package/dist/node.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AESTHETICS,
3
3
  getAesthetic
4
- } from "./chunk-K6AAK2NB.js";
4
+ } from "./chunk-VEFEZH7Q.js";
5
5
  import "./chunk-HMNTTISG.js";
6
6
 
7
7
  // src/skills.ts
@@ -153,6 +153,25 @@ function catalogRegistryItem(component, framework, aestheticId, dist = catalogDi
153
153
  }
154
154
  };
155
155
  }
156
+
157
+ // src/engine-fallback.ts
158
+ async function editorItem(itemId) {
159
+ const { uiComponents } = await import("@pixerate/editor/chart");
160
+ const chart = uiComponents().find((c) => c.id === itemId);
161
+ if (chart) return chart;
162
+ const { diagramUiComponents } = await import("@pixerate/editor/canvas");
163
+ return diagramUiComponents().find((c) => c.id === itemId);
164
+ }
165
+ async function engineFallback(component, data) {
166
+ const { provider, itemId } = component.source;
167
+ if (!component.fallback || !itemId) return void 0;
168
+ if (provider === "editor") return (await editorItem(itemId))?.fallback?.(data);
169
+ if (provider === "flair") {
170
+ const { loadEffect, uiFallback } = await import("@pixerate/flair/catalog/lazy");
171
+ return uiFallback(await loadEffect(itemId), data);
172
+ }
173
+ return void 0;
174
+ }
156
175
  export {
157
176
  DEFAULT_SKILLS_DIR,
158
177
  SURREAL_SKILLS,
@@ -160,6 +179,7 @@ export {
160
179
  catalogFrameworks,
161
180
  catalogRegistryItem,
162
181
  codeDependencies,
182
+ engineFallback,
163
183
  installSkills,
164
184
  skillsSource
165
185
  };
@@ -15,6 +15,50 @@ interface GaugeProps {
15
15
  /** A speedometer gauge: its coloured band draws on, the needle sweeps past the value and settles, and the reading counts up beneath. (Flair `gauge`, coloured by the aesthetic's roles.) */
16
16
  declare function Gauge({ value, max, unit, label, className, style }: GaugeProps): React.JSX.Element;
17
17
 
18
+ interface LoaderProps {
19
+ /** How far along the job is, 0–1; null (or left out) while it cannot tell, so the loader plays its own loop. */
20
+ value?: number | null;
21
+ /** Accessible name. */
22
+ label?: string;
23
+ className?: string;
24
+ style?: React.CSSProperties;
25
+ }
26
+ /** A glass circle filling with sloshing liquid, two waves rolling across its surface and bubbles rising, then draining to fill again. (Flair `liquid-loader`, coloured by the aesthetic's roles.) */
27
+ declare function Loader({ value, label, className, style }: LoaderProps): React.JSX.Element;
28
+
29
+ interface FlairFlameLoaderProps {
30
+ /** How far along the job is, 0–1; null (or left out) while it cannot tell, so the loader plays its own loop. */
31
+ value?: number | null;
32
+ /** Accessible name. */
33
+ label?: string;
34
+ className?: string;
35
+ style?: React.CSSProperties;
36
+ }
37
+ /** A progress bar that burns along its length: the filled part glows like embers under flames, tallest at the leading edge, sparks flying off it. (Flair `flame-loader`, coloured by the aesthetic's roles.) */
38
+ declare function FlairFlameLoader({ value, label, className, style }: FlairFlameLoaderProps): React.JSX.Element;
39
+
40
+ interface FlairGeneratingFieldProps {
41
+ /** How far along the job is, 0–1; null (or left out) while it cannot tell, so the loader plays its own loop. */
42
+ value?: number | null;
43
+ /** Accessible name. */
44
+ label?: string;
45
+ className?: string;
46
+ style?: React.CSSProperties;
47
+ }
48
+ /** A soft field brewing over a card while a job runs, its motion set by what is being made, with a glowing front that sweeps across as the job gets further along. (Flair `generating-field`, coloured by the aesthetic's roles.) */
49
+ declare function FlairGeneratingField({ value, label, className, style }: FlairGeneratingFieldProps): React.JSX.Element;
50
+
51
+ interface FlairSlopVatProps {
52
+ /** How far along the job is, 0–1; null (or left out) while it cannot tell, so the loader plays its own loop. */
53
+ value?: number | null;
54
+ /** Accessible name. */
55
+ label?: string;
56
+ className?: string;
57
+ style?: React.CSSProperties;
58
+ }
59
+ /** A stroked machine vat filling with bubbling slop to how far a job has got, gooey lobes bobbing on the surface and a nozzle dripping into a puddle below. (Flair `slop-vat`, coloured by the aesthetic's roles.) */
60
+ declare function FlairSlopVat({ value, label, className, style }: FlairSlopVatProps): React.JSX.Element;
61
+
18
62
  interface FlairProgressBarProps {
19
63
  /** Percent done. */
20
64
  value: number;
@@ -38,4 +82,4 @@ interface FlairToggleSwitchProps {
38
82
  /** A switch whose knob slides across, squashing a little mid-slide, as the track blends to its on colour; the next click slides it back. (Flair `toggle-switch`, coloured by the aesthetic's roles.) */
39
83
  declare function FlairToggleSwitch({ checked, onCheckedChange, label, className, style }: FlairToggleSwitchProps): React.JSX.Element;
40
84
 
41
- export { FlairProgressBar, type FlairProgressBarProps, FlairToggleSwitch, type FlairToggleSwitchProps, Gauge, type GaugeProps };
85
+ export { FlairFlameLoader, type FlairFlameLoaderProps, FlairGeneratingField, type FlairGeneratingFieldProps, FlairProgressBar, type FlairProgressBarProps, FlairSlopVat, type FlairSlopVatProps, FlairToggleSwitch, type FlairToggleSwitchProps, Gauge, type GaugeProps, Loader, type LoaderProps };
@@ -43,30 +43,34 @@ function Gauge({ value, max, unit, label, className, style }) {
43
43
  );
44
44
  }
45
45
 
46
- // ../../components/progress/alternatives/flair-progress-bar/react.tsx
46
+ // ../../components/loader/react.tsx
47
47
  import * as React2 from "react";
48
48
  import { FlairEffect as FlairEffect2 } from "@pixerate/flair/react";
49
49
  import { jsx as jsx2 } from "react/jsx-runtime";
50
- var ROLES2 = ["accent", "track-off", "ink"];
51
- var CONTROLS2 = { accent: "accent", "track-off": "track", ink: "ink" };
52
- function FlairProgressBar({ value, label, className, style }) {
50
+ var ROLES2 = ["accent", "track-off", "border"];
51
+ var CONTROLS2 = {
52
+ accent: "uLiquid",
53
+ "track-off": "uBack",
54
+ border: "uGlass"
55
+ };
56
+ function Loader({ value, label, className, style }) {
53
57
  const ref = React2.useRef(null);
54
58
  const colors = useRoleColors(ref, ROLES2);
55
59
  const values = React2.useMemo(
56
60
  () => colors ? Object.fromEntries(ROLES2.map((role) => [CONTROLS2[role], colors.rgb[role]])) : void 0,
57
61
  [colors]
58
62
  );
59
- const data = { value, label };
63
+ const data = { value };
60
64
  return /* @__PURE__ */ jsx2(
61
65
  "span",
62
66
  {
63
67
  ref,
64
68
  className: ["sui-provider", className].filter(Boolean).join(" "),
65
- style: { display: "inline-block", width: 240, height: 59, ...style },
69
+ style: { display: "inline-block", width: "100%", height: 240, ...style },
66
70
  children: values && /* @__PURE__ */ jsx2(
67
71
  FlairEffect2,
68
72
  {
69
- effect: "progress-bar",
73
+ effect: "liquid-loader",
70
74
  values,
71
75
  data: Object.fromEntries(Object.entries(data).filter(([, v]) => v !== void 0)),
72
76
  label,
@@ -77,12 +81,157 @@ function FlairProgressBar({ value, label, className, style }) {
77
81
  );
78
82
  }
79
83
 
80
- // ../../components/switch/alternatives/flair-toggle-switch/react.tsx
84
+ // ../../components/loader/alternatives/flair-flame-loader/react.tsx
81
85
  import * as React3 from "react";
82
86
  import { FlairEffect as FlairEffect3 } from "@pixerate/flair/react";
83
87
  import { jsx as jsx3 } from "react/jsx-runtime";
84
- var ROLES3 = ["surface", "track-off", "track-on", "surface-raised"];
85
- var CONTROLS3 = {
88
+ var ROLES3 = ["track-off"];
89
+ var CONTROLS3 = { "track-off": "uTrack" };
90
+ function FlairFlameLoader({ value, label, className, style }) {
91
+ const ref = React3.useRef(null);
92
+ const colors = useRoleColors(ref, ROLES3);
93
+ const values = React3.useMemo(
94
+ () => colors ? Object.fromEntries(ROLES3.map((role) => [CONTROLS3[role], colors.rgb[role]])) : void 0,
95
+ [colors]
96
+ );
97
+ const data = { value };
98
+ return /* @__PURE__ */ jsx3(
99
+ "span",
100
+ {
101
+ ref,
102
+ className: ["sui-provider", className].filter(Boolean).join(" "),
103
+ style: { display: "inline-block", width: "100%", height: 240, ...style },
104
+ children: values && /* @__PURE__ */ jsx3(
105
+ FlairEffect3,
106
+ {
107
+ effect: "flame-loader",
108
+ values,
109
+ data: Object.fromEntries(Object.entries(data).filter(([, v]) => v !== void 0)),
110
+ label,
111
+ style: { width: "100%", height: "100%" }
112
+ }
113
+ )
114
+ }
115
+ );
116
+ }
117
+
118
+ // ../../components/loader/alternatives/flair-generating-field/react.tsx
119
+ import * as React4 from "react";
120
+ import { FlairEffect as FlairEffect4 } from "@pixerate/flair/react";
121
+ import { jsx as jsx4 } from "react/jsx-runtime";
122
+ var ROLES4 = ["accent", "accent-ink", "focus"];
123
+ var CONTROLS4 = {
124
+ accent: "uColorA",
125
+ "accent-ink": "uColorB",
126
+ focus: "uColorC"
127
+ };
128
+ function FlairGeneratingField({
129
+ value,
130
+ label,
131
+ className,
132
+ style
133
+ }) {
134
+ const ref = React4.useRef(null);
135
+ const colors = useRoleColors(ref, ROLES4);
136
+ const values = React4.useMemo(
137
+ () => colors ? Object.fromEntries(ROLES4.map((role) => [CONTROLS4[role], colors.rgb[role]])) : void 0,
138
+ [colors]
139
+ );
140
+ const data = { value };
141
+ return /* @__PURE__ */ jsx4(
142
+ "span",
143
+ {
144
+ ref,
145
+ className: ["sui-provider", className].filter(Boolean).join(" "),
146
+ style: { display: "inline-block", width: "100%", height: 240, ...style },
147
+ children: values && /* @__PURE__ */ jsx4(
148
+ FlairEffect4,
149
+ {
150
+ effect: "generating-field",
151
+ values,
152
+ data: Object.fromEntries(Object.entries(data).filter(([, v]) => v !== void 0)),
153
+ label,
154
+ style: { width: "100%", height: "100%" }
155
+ }
156
+ )
157
+ }
158
+ );
159
+ }
160
+
161
+ // ../../components/loader/alternatives/flair-slop-vat/react.tsx
162
+ import * as React5 from "react";
163
+ import { FlairEffect as FlairEffect5 } from "@pixerate/flair/react";
164
+ import { jsx as jsx5 } from "react/jsx-runtime";
165
+ var ROLES5 = ["accent", "surface", "ink"];
166
+ var CONTROLS5 = { accent: "slop", surface: "vat", ink: "inkColor" };
167
+ function FlairSlopVat({ value, label, className, style }) {
168
+ const ref = React5.useRef(null);
169
+ const colors = useRoleColors(ref, ROLES5);
170
+ const values = React5.useMemo(
171
+ () => colors ? Object.fromEntries(ROLES5.map((role) => [CONTROLS5[role], colors.rgb[role]])) : void 0,
172
+ [colors]
173
+ );
174
+ const data = { value };
175
+ return /* @__PURE__ */ jsx5(
176
+ "span",
177
+ {
178
+ ref,
179
+ className: ["sui-provider", className].filter(Boolean).join(" "),
180
+ style: { display: "inline-block", width: "100%", height: 240, ...style },
181
+ children: values && /* @__PURE__ */ jsx5(
182
+ FlairEffect5,
183
+ {
184
+ effect: "slop-vat",
185
+ values,
186
+ data: Object.fromEntries(Object.entries(data).filter(([, v]) => v !== void 0)),
187
+ label,
188
+ style: { width: "100%", height: "100%" }
189
+ }
190
+ )
191
+ }
192
+ );
193
+ }
194
+
195
+ // ../../components/progress/alternatives/flair-progress-bar/react.tsx
196
+ import * as React6 from "react";
197
+ import { FlairEffect as FlairEffect6 } from "@pixerate/flair/react";
198
+ import { jsx as jsx6 } from "react/jsx-runtime";
199
+ var ROLES6 = ["accent", "track-off", "ink"];
200
+ var CONTROLS6 = { accent: "accent", "track-off": "track", ink: "ink" };
201
+ function FlairProgressBar({ value, label, className, style }) {
202
+ const ref = React6.useRef(null);
203
+ const colors = useRoleColors(ref, ROLES6);
204
+ const values = React6.useMemo(
205
+ () => colors ? Object.fromEntries(ROLES6.map((role) => [CONTROLS6[role], colors.rgb[role]])) : void 0,
206
+ [colors]
207
+ );
208
+ const data = { value, label };
209
+ return /* @__PURE__ */ jsx6(
210
+ "span",
211
+ {
212
+ ref,
213
+ className: ["sui-provider", className].filter(Boolean).join(" "),
214
+ style: { display: "inline-block", width: 240, height: 59, ...style },
215
+ children: values && /* @__PURE__ */ jsx6(
216
+ FlairEffect6,
217
+ {
218
+ effect: "progress-bar",
219
+ values,
220
+ data: Object.fromEntries(Object.entries(data).filter(([, v]) => v !== void 0)),
221
+ label,
222
+ style: { width: "100%", height: "100%" }
223
+ }
224
+ )
225
+ }
226
+ );
227
+ }
228
+
229
+ // ../../components/switch/alternatives/flair-toggle-switch/react.tsx
230
+ import * as React7 from "react";
231
+ import { FlairEffect as FlairEffect7 } from "@pixerate/flair/react";
232
+ import { jsx as jsx7 } from "react/jsx-runtime";
233
+ var ROLES7 = ["surface", "track-off", "track-on", "surface-raised"];
234
+ var CONTROLS7 = {
86
235
  surface: "background",
87
236
  "track-off": "off",
88
237
  "track-on": "on",
@@ -95,20 +244,20 @@ function FlairToggleSwitch({
95
244
  className,
96
245
  style
97
246
  }) {
98
- const ref = React3.useRef(null);
99
- const colors = useRoleColors(ref, ROLES3);
100
- const values = React3.useMemo(
101
- () => colors ? Object.fromEntries(ROLES3.map((role) => [CONTROLS3[role], colors.rgb[role]])) : void 0,
247
+ const ref = React7.useRef(null);
248
+ const colors = useRoleColors(ref, ROLES7);
249
+ const values = React7.useMemo(
250
+ () => colors ? Object.fromEntries(ROLES7.map((role) => [CONTROLS7[role], colors.rgb[role]])) : void 0,
102
251
  [colors]
103
252
  );
104
- return /* @__PURE__ */ jsx3(
253
+ return /* @__PURE__ */ jsx7(
105
254
  "span",
106
255
  {
107
256
  ref,
108
257
  className: ["sui-provider", className].filter(Boolean).join(" "),
109
258
  style: { display: "inline-block", width: 40, height: 24, ...style },
110
- children: values && /* @__PURE__ */ jsx3(
111
- FlairEffect3,
259
+ children: values && /* @__PURE__ */ jsx7(
260
+ FlairEffect7,
112
261
  {
113
262
  effect: "toggle-switch",
114
263
  values,
@@ -124,7 +273,11 @@ function FlairToggleSwitch({
124
273
  );
125
274
  }
126
275
  export {
276
+ FlairFlameLoader,
277
+ FlairGeneratingField,
127
278
  FlairProgressBar,
279
+ FlairSlopVat,
128
280
  FlairToggleSwitch,
129
- Gauge
281
+ Gauge,
282
+ Loader
130
283
  };
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (bar-chart). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (bar-chart). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { useRoleColors } from '@surreal-ui/catalog/react';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (braid). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (braid). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { createLinkFocus } from '@pixerate/editor/tools';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (donut-chart). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (donut-chart). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { useRoleColors } from '@surreal-ui/catalog/react';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (flow). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (flow). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { diagramUiComponents } from '@pixerate/editor/canvas';
4
4
  import { useRoleColors } from '@surreal-ui/catalog/react';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/flair 0.121.0 (gauge). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/flair 0.146.0 (gauge). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { FlairEffect } from '@pixerate/flair/react';
4
4
  import { useRoleColors } from '@surreal-ui/catalog/react';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (line-chart). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (line-chart). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { useRoleColors } from '@surreal-ui/catalog/react';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (lineage). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (lineage). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { createLinkFocus } from '@pixerate/editor/tools';
@@ -0,0 +1,52 @@
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/flair 0.146.0 (liquid-loader). Do not edit.
2
+ import * as React from 'react';
3
+ import { FlairEffect } from '@pixerate/flair/react';
4
+ import { useRoleColors } from '@surreal-ui/catalog/react';
5
+
6
+ const ROLES = ['accent', 'track-off', 'border'] as const;
7
+ const CONTROLS: Record<string, string> = {
8
+ accent: 'uLiquid',
9
+ 'track-off': 'uBack',
10
+ border: 'uGlass'
11
+ };
12
+
13
+ export interface LoaderProps {
14
+ /** How far along the job is, 0–1; null (or left out) while it cannot tell, so the loader plays its own loop. */
15
+ value?: number | null;
16
+ /** Accessible name. */
17
+ label?: string;
18
+ className?: string;
19
+ style?: React.CSSProperties;
20
+ }
21
+
22
+ /** A glass circle filling with sloshing liquid, two waves rolling across its surface and bubbles rising, then draining to fill again. (Flair `liquid-loader`, coloured by the aesthetic's roles.) */
23
+ export function Loader({ value, label, className, style }: LoaderProps) {
24
+ const ref = React.useRef<HTMLSpanElement>(null);
25
+ const colors = useRoleColors(ref, ROLES);
26
+ const values = React.useMemo(
27
+ () =>
28
+ colors
29
+ ? Object.fromEntries(ROLES.map((role) => [CONTROLS[role]!, colors.rgb[role]!]))
30
+ : undefined,
31
+ [colors]
32
+ );
33
+ const data = { value };
34
+ return (
35
+ <span
36
+ ref={ref}
37
+ className={['sui-provider', className].filter(Boolean).join(' ')}
38
+ style={{ display: 'inline-block', width: '100%', height: 240, ...style }}
39
+ >
40
+ {values && (
41
+ <FlairEffect
42
+ effect="liquid-loader"
43
+ values={values}
44
+ data={Object.fromEntries(Object.entries(data).filter(([, v]) => v !== undefined))}
45
+
46
+ label={label}
47
+ style={{ width: '100%', height: '100%' }}
48
+ />
49
+ )}
50
+ </span>
51
+ );
52
+ }
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (mindmap). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (mindmap). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { diagramUiComponents } from '@pixerate/editor/canvas';
4
4
  import { useRoleColors } from '@surreal-ui/catalog/react';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (sparkline). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (sparkline). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { useRoleColors } from '@surreal-ui/catalog/react';
@@ -22,6 +22,15 @@
22
22
  class: className = '',
23
23
  ...rest
24
24
  }: Props = $props();
25
+
26
+ // A column is numeric when it has a number and every other cell is a number or empty.
27
+ const numeric = $derived(
28
+ columns.map(
29
+ (_, c) =>
30
+ rows.some((r) => typeof r[c] === 'number') &&
31
+ rows.every((r) => r[c] === null || r[c] === undefined || typeof r[c] === 'number')
32
+ )
33
+ );
25
34
  </script>
26
35
 
27
36
  <div class="sui-table">
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (timeline). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (timeline). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { diagramUiComponents } from '@pixerate/editor/canvas';
4
4
  import { useRoleColors } from '@surreal-ui/catalog/react';
@@ -1,4 +1,4 @@
1
- // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.336.0 (weave). Do not edit.
1
+ // Generated by packages/catalog/scripts/sync-providers.ts from @pixerate/editor 0.355.0 (weave). Do not edit.
2
2
  import * as React from 'react';
3
3
  import { uiComponents } from '@pixerate/editor/chart';
4
4
  import { createLinkFocus } from '@pixerate/editor/tools';
@@ -22,6 +22,15 @@
22
22
  class: className = '',
23
23
  ...rest
24
24
  }: Props = $props();
25
+
26
+ // A column is numeric when it has a number and every other cell is a number or empty.
27
+ const numeric = $derived(
28
+ columns.map(
29
+ (_, c) =>
30
+ rows.some((r) => typeof r[c] === 'number') &&
31
+ rows.every((r) => r[c] === null || r[c] === undefined || typeof r[c] === 'number')
32
+ )
33
+ );
25
34
  </script>
26
35
 
27
36
  <div class="sui-table">
package/llms.txt CHANGED
@@ -44,6 +44,10 @@
44
44
  - label: Label (form). Accessible labeling for form controls. Import `Label` from `@surreal-ui/catalog/react`; element `<surreal-label>`.
45
45
  - line-chart: Line chart (data-visual). Lines showing how values change across ordered categories (time), one colour per series, with a value axis and a legend for several series. Import `LineChart` from `@surreal-ui/catalog/react/editor`.
46
46
  - lineage: Lineage (data-visual). One root fanned out to a row of items with rounded connectors that never cross, labels sized to fit their columns; draws on from the root, and focusing an item lights its branch. Import `Lineage` from `@surreal-ui/catalog/react/editor`.
47
+ - loader: Liquid loader (feedback). A glass circle filling with sloshing liquid, two waves rolling across its surface and bubbles rising, then draining to fill again. Import `Loader` from `@surreal-ui/catalog/react/flair`.
48
+ - flair-flame-loader: Flame loader (feedback, implements loader). A progress bar that burns along its length: the filled part glows like embers under flames, tallest at the leading edge, sparks flying off it. Import `FlairFlameLoader` from `@surreal-ui/catalog/react/flair`.
49
+ - flair-generating-field: Generating field (feedback, implements loader). A soft field brewing over a card while a job runs, its motion set by what is being made, with a glowing front that sweeps across as the job gets further along. Import `FlairGeneratingField` from `@surreal-ui/catalog/react/flair`.
50
+ - flair-slop-vat: Slop vat (feedback, implements loader). A stroked machine vat filling with bubbling slop to how far a job has got, gooey lobes bobbing on the surface and a nozzle dripping into a puddle below. Import `FlairSlopVat` from `@surreal-ui/catalog/react/flair`.
47
51
  - mindmap: Mind map (data-visual). A central idea with branches and sub-branches spread round it, one colour per branch. Import `Mindmap` from `@surreal-ui/catalog/react/editor`.
48
52
  - progress: Progress (feedback). Displays an indicator showing the completion progress of a task. Import `Progress` from `@surreal-ui/catalog/react`; element `<surreal-progress>`.
49
53
  - flair-progress-bar: Progress bar (feedback, implements progress). A striped progress bar filling to a value while its percentage counts up, the stripes marching all the while. Import `FlairProgressBar` from `@surreal-ui/catalog/react/flair`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surreal-ui/catalog",
3
- "version": "0.14.1",
3
+ "version": "0.16.0",
4
4
  "description": "Drop-in UI components with a catalog API and aesthetic packs: one implementation per component type, restyled by aesthetics defined as skills.",
5
5
  "license": "MIT",
6
6
  "author": "Pixerate",
@@ -100,12 +100,12 @@
100
100
  "access": "public"
101
101
  },
102
102
  "dependencies": {
103
- "@pixerate/schemas": "^1.52.0"
103
+ "@pixerate/schemas": "^2.12.0"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "@dagrejs/dagre": ">=1.1.8",
107
- "@pixerate/editor": ">=0.334.1",
108
- "@pixerate/flair": ">=0.121.0",
107
+ "@pixerate/editor": ">=0.348.0",
108
+ "@pixerate/flair": ">=0.143.0",
109
109
  "react": ">=18.0.0",
110
110
  "svelte": ">=5.20.0"
111
111
  },
@@ -128,8 +128,8 @@
128
128
  },
129
129
  "devDependencies": {
130
130
  "@dagrejs/dagre": "^1.1.8",
131
- "@pixerate/editor": "^0.336.0",
132
- "@pixerate/flair": "^0.121.0",
131
+ "@pixerate/editor": "^0.355.0",
132
+ "@pixerate/flair": "^0.146.0",
133
133
  "@playwright/test": "^1.64.1",
134
134
  "@types/node": "^22.20.1",
135
135
  "@types/react": "^18.3.0",
@@ -143,7 +143,7 @@
143
143
  "tsup": "^8.0.2",
144
144
  "tsx": "^4.23.15",
145
145
  "typescript": "^5.5.0",
146
- "zod": "^3.25.76"
146
+ "zod": "^4.6.6"
147
147
  },
148
148
  "scripts": {
149
149
  "generate": "tsx scripts/build-catalog.ts",