@nullplatform/ui-plugin-sdk 0.8.0 → 0.9.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.
package/dist/catalog.d.ts CHANGED
@@ -70,6 +70,9 @@ export declare const CATALOG_PROP_VALUES: {
70
70
  readonly Skeleton: {
71
71
  readonly variant: readonly ["text", "rectangular", "rounded", "circular"];
72
72
  };
73
+ readonly Card: {
74
+ readonly tone: readonly ["default", "accent"];
75
+ };
73
76
  readonly Stack: {
74
77
  readonly direction: readonly ["row", "column"];
75
78
  };
@@ -94,6 +97,7 @@ export type ChipColor = (typeof CATALOG_PROP_VALUES.Chip.color)[number];
94
97
  export type ChipVariant = (typeof CATALOG_PROP_VALUES.Chip.variant)[number];
95
98
  export type ChipSize = (typeof CATALOG_PROP_VALUES.Chip.size)[number];
96
99
  export type SkeletonVariant = (typeof CATALOG_PROP_VALUES.Skeleton.variant)[number];
100
+ export type CardTone = (typeof CATALOG_PROP_VALUES.Card.tone)[number];
97
101
  export type ButtonSize = (typeof CATALOG_PROP_VALUES.Button.size)[number];
98
102
  export type StackDirection = (typeof CATALOG_PROP_VALUES.Stack.direction)[number];
99
103
  export type AlertSeverity = (typeof CATALOG_PROP_VALUES.Alert.severity)[number];
package/dist/catalog.js CHANGED
@@ -43,6 +43,10 @@ export const CATALOG_PROP_VALUES = {
43
43
  Skeleton: {
44
44
  variant: ["text", "rectangular", "rounded", "circular"],
45
45
  },
46
+ // accent: a soft tint of the primary color, for content set apart from the page (an AI answer, a highlight)
47
+ Card: {
48
+ tone: ["default", "accent"],
49
+ },
46
50
  Stack: {
47
51
  direction: ["row", "column"],
48
52
  },
@@ -113,8 +117,10 @@ const OWN_CATALOG = [
113
117
  padding: "string",
114
118
  to: "string",
115
119
  params: "object",
120
+ tone: "string",
116
121
  },
117
122
  events: { press: "onPress" },
123
+ values: CATALOG_PROP_VALUES.Card,
118
124
  slots: ["action", "avatar", "header"],
119
125
  children: true,
120
126
  },
@@ -401,6 +407,19 @@ const OWN_CATALOG = [
401
407
  values: CATALOG_PROP_VALUES.Scatter,
402
408
  cssValues: ["points[].color"],
403
409
  },
410
+ {
411
+ // Groups as soft circles with their members inside as bubbles, sized by `size`. `groups: [{ id?, label, color?,
412
+ // nodes: [{ id, label, size? }] }]`; a node may sit in several groups. Not every host draws it: see `hostRenders`.
413
+ tag: "np-cluster-map",
414
+ component: "ClusterMap",
415
+ properties: {
416
+ groups: "array",
417
+ selected: "string",
418
+ sizeLabel: "string",
419
+ },
420
+ events: { nodePress: "onNodePress" },
421
+ cssValues: ["groups[].color"],
422
+ },
404
423
  {
405
424
  // Horizontal share bar, 0..1.
406
425
  tag: "np-progress-bar",
@@ -4,8 +4,8 @@ import "./polyfill.js";
4
4
  * the host decides how it looks.
5
5
  */
6
6
  import type { ReactNode } from "react";
7
- import { type AlertSeverity, type ButtonColor, type ButtonSize, type ButtonVariant, type ChipColor, type ChipSize, type ChipVariant, type LinkColor, type LinkUnderline, type ScatterScale, type SkeletonVariant, type StackDirection, type TextAlign, type TextVariant } from "./catalog.js";
8
- export type { AlertSeverity, ButtonColor, ButtonSize, ButtonVariant, ChipColor, ChipSize, ChipVariant, LinkColor, LinkUnderline, ScatterScale, SkeletonVariant, StackDirection, TextAlign, TextVariant, } from "./catalog.js";
7
+ import { type AlertSeverity, type ButtonColor, type ButtonSize, type ButtonVariant, type CardTone, type ChipColor, type ChipSize, type ChipVariant, type LinkColor, type LinkUnderline, type ScatterScale, type SkeletonVariant, type StackDirection, type TextAlign, type TextVariant } from "./catalog.js";
8
+ export type { AlertSeverity, ButtonColor, ButtonSize, ButtonVariant, CardTone, ChipColor, ChipSize, ChipVariant, LinkColor, LinkUnderline, ScatterScale, SkeletonVariant, StackDirection, TextAlign, TextVariant, } from "./catalog.js";
9
9
  export * from "./components.generated.js";
10
10
  export type { ContractProps, UiComponentsTag } from "./contractProps.js";
11
11
  export type { DataTableAvatar, DataTableColor, DataTableColumn, DataTableFormatter, DataTableLabelVariant, DataTableLink, DataTablePagination, DataTableRow, DataTableRowAction, DataTableState, DataTableTypography, } from "./dataTable.js";
@@ -83,6 +83,8 @@ export declare const Card: import("react").ComponentType<{
83
83
  /** A logical route of the host: the whole card links to it. */
84
84
  to?: string;
85
85
  params?: Record<string, string | number>;
86
+ /** `accent` tints the card softly with the primary color, to set its content apart (an AI answer, a highlight). */
87
+ tone?: CardTone;
86
88
  /** Makes the whole card clickable. `action` stays outside the clickable area; keep other controls out of it. */
87
89
  onPress?: () => void;
88
90
  } & {
@@ -390,6 +392,39 @@ export declare const Scatter: import("react").ComponentType<{
390
392
  } & {
391
393
  children?: ReactNode;
392
394
  }>;
395
+ export interface ClusterMapNode {
396
+ /** What `selected` and the press payload identify the node by; the same id in two groups is the same node. */
397
+ id: string;
398
+ label: string;
399
+ /** Relative area: the largest node gets the largest bubble. A middle-sized bubble when left out. */
400
+ size?: number;
401
+ }
402
+ export interface ClusterMapGroup {
403
+ /** What the press payload names the group by; the label when left out. */
404
+ id?: string;
405
+ label: string;
406
+ nodes: ClusterMapNode[];
407
+ color?: ThemeColor | string;
408
+ }
409
+ /**
410
+ * Who or what belongs where: each group a soft circle with its members inside as bubbles with their initials, sized
411
+ * by `size`. A node can sit in several groups; selecting it marks it in each and fades the groups without it.
412
+ * Not every host draws it: check `hostRenders(ClusterMap)`.
413
+ */
414
+ export declare const ClusterMap: import("react").ComponentType<{
415
+ groups: ClusterMapGroup[];
416
+ /** The `id` of the node drawn as chosen. */
417
+ selected?: string;
418
+ /** What `size` counts, for the hover; the hover shows only the name without it. */
419
+ sizeLabel?: string;
420
+ onNodePress?: (node: {
421
+ id: string;
422
+ label: string;
423
+ group: string;
424
+ }) => void;
425
+ } & {
426
+ children?: ReactNode;
427
+ }>;
393
428
  /** Horizontal share bar, `value` in 0..1. */
394
429
  export declare const ProgressBar: import("react").ComponentType<{
395
430
  value: number;
@@ -45,5 +45,11 @@ export const Donut = component("np-donut");
45
45
  * Not every host draws it: check `hostRenders(Scatter)`.
46
46
  */
47
47
  export const Scatter = component("np-scatter");
48
+ /**
49
+ * Who or what belongs where: each group a soft circle with its members inside as bubbles with their initials, sized
50
+ * by `size`. A node can sit in several groups; selecting it marks it in each and fades the groups without it.
51
+ * Not every host draws it: check `hostRenders(ClusterMap)`.
52
+ */
53
+ export const ClusterMap = component("np-cluster-map");
48
54
  /** Horizontal share bar, `value` in 0..1. */
49
55
  export const ProgressBar = component("np-progress-bar");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nullplatform/ui-plugin-sdk",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "SDK for nullplatform UI plugins: catalog components, bridge client and defineUI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",