@pstdio/ui 0.12.0 → 0.12.2

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.
@@ -0,0 +1,2 @@
1
+ export declare const suppressNextDataRendererCardClick: () => void;
2
+ export declare const isDataRendererCardClickSuppressed: () => boolean;
@@ -0,0 +1,7 @@
1
+ import { AttributeBadge } from './data-renderer-helpers';
2
+ interface DataRendererAttributeBadgeProps {
3
+ badge: AttributeBadge;
4
+ onChange?: (attributeId: string, value: unknown) => void;
5
+ }
6
+ export declare const DataRendererAttributeBadge: (props: DataRendererAttributeBadgeProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,46 @@
1
+ import { AttributeDescriptor, AttributeType, EnumOption } from './types';
2
+ export interface AttributeBadge {
3
+ attributeId: string;
4
+ attributeLabel?: string;
5
+ label: string;
6
+ color?: string;
7
+ icon?: string | null;
8
+ value?: string | string[];
9
+ options?: EnumOption[];
10
+ isEditable?: boolean;
11
+ }
12
+ export declare const getAttributeBadgeColorPalette: (_badge: AttributeBadge) => string;
13
+ export declare const renderEnumBadge: (descriptor: AttributeDescriptor, type: AttributeType, value: unknown) => {
14
+ attributeId: string;
15
+ attributeLabel: string;
16
+ label: string;
17
+ value: string | undefined;
18
+ options: EnumOption[];
19
+ isEditable: boolean;
20
+ } | {
21
+ value?: string | undefined;
22
+ options?: EnumOption[] | undefined;
23
+ isEditable?: boolean | undefined;
24
+ attributeId: string;
25
+ attributeLabel: string;
26
+ label: string;
27
+ color: string | undefined;
28
+ icon: string | null | undefined;
29
+ } | null;
30
+ export declare const renderMultiEnumBadge: (descriptor: AttributeDescriptor, type: AttributeType, value: unknown) => {
31
+ attributeId: string;
32
+ attributeLabel: string;
33
+ label: string;
34
+ value: string[];
35
+ options: EnumOption[];
36
+ isEditable: boolean;
37
+ } | {
38
+ value?: string[] | undefined;
39
+ options?: EnumOption[] | undefined;
40
+ isEditable?: boolean | undefined;
41
+ attributeId: string;
42
+ attributeLabel: string;
43
+ label: string;
44
+ color: string | undefined;
45
+ icon: string | null | undefined;
46
+ } | null;
@@ -8,6 +8,7 @@ export interface DataRendererCardProps {
8
8
  workspaceBadge?: WorkspaceBadgeProps;
9
9
  isSelected?: boolean;
10
10
  draggable?: boolean;
11
+ onBadgeChange?: (attributeId: string, value: unknown) => void;
11
12
  onDragStart?: DragEventHandler<HTMLDivElement>;
12
13
  onDragEnd?: DragEventHandler<HTMLDivElement>;
13
14
  onClick?: () => void;
@@ -0,0 +1,10 @@
1
+ import { AttributeType } from './types';
2
+ /**
3
+ * Normalize an enum / enum-multi attribute's `options` to a plain option list.
4
+ * Sources resolve via `getSnapshot()` on every call, so callers naturally see
5
+ * the latest values.
6
+ */
7
+ export declare const getEnumOptions: (type: AttributeType) => import('./types').EnumOption[];
8
+ export declare const toTitleCase: (value: string) => string;
9
+ export declare const findEnumOption: (type: AttributeType, value: string) => import('./types').EnumOption | undefined;
10
+ export declare const enumOptionLabel: (type: AttributeType, value: string) => string;
@@ -1,28 +1,15 @@
1
1
  import { ReactNode } from 'react';
2
- import { AttributeDescriptor, AttributeType, DataRendererFilterState, DataRendererRow, DataRendererSettings, EnumOption } from './types';
3
- /**
4
- * Normalize an enum / enum-multi attribute's `options` to a plain `EnumOption[]`.
5
- * Sources resolve via `getSnapshot()` on every call, so callers naturally see
6
- * the latest values pair with `useResolvedAttributes` to also rerender on
7
- * source change.
8
- */
9
- export declare const getEnumOptions: (type: AttributeType) => EnumOption[];
10
- export declare const toTitleCase: (value: string) => string;
2
+ import { AttributeBadge } from './data-renderer-badge-helpers';
3
+ import { AttributeDescriptor, DataRendererFilterState, DataRendererRow, DataRendererSettings } from './types';
4
+ export type { AttributeBadge } from './data-renderer-badge-helpers';
5
+ export { getAttributeBadgeColorPalette } from './data-renderer-badge-helpers';
6
+ export { enumOptionLabel, findEnumOption, getEnumOptions, toTitleCase } from './data-renderer-enum-helpers';
11
7
  /**
12
8
  * Read a typed attribute value out of a row. enum-multi normalizes to an array;
13
9
  * single-valued kinds normalize to undefined when missing.
14
10
  */
15
11
  export declare const getAttributeValue: (row: DataRendererRow, descriptor: AttributeDescriptor) => unknown;
16
12
  export declare const getAttributeStringValues: (row: DataRendererRow, descriptor: AttributeDescriptor) => string[];
17
- export declare const findEnumOption: (type: AttributeType, value: string) => EnumOption | undefined;
18
- export declare const enumOptionLabel: (type: AttributeType, value: string) => string;
19
- export interface AttributeBadge {
20
- attributeId: string;
21
- label: string;
22
- color?: string;
23
- icon?: string | null;
24
- }
25
- export declare const getAttributeBadgeColorPalette: (_badge: AttributeBadge) => string;
26
13
  /**
27
14
  * Per-type default cell summary used by the card / list end-content. Returns
28
15
  * null when the attribute has no displayable value.
@@ -14,6 +14,7 @@ export interface DataRendererListItem {
14
14
  customSlots?: ReactNode[];
15
15
  children?: DataRendererListItem[];
16
16
  onClick?: () => void;
17
+ onBadgeChange?: (attributeId: string, value: unknown) => void;
17
18
  contextMenuActions?: ResourceContextAction[];
18
19
  draggable?: boolean;
19
20
  onDropRow?: (rowId: string) => void;
@@ -19,6 +19,8 @@ export interface ListRowActionMenuItem {
19
19
  }>;
20
20
  disabled?: boolean;
21
21
  readOnly?: boolean;
22
+ /** Render a separator before this item when it follows a different action group. */
23
+ separatorBefore?: boolean;
22
24
  /** Trailing content rendered after the label. Use for Kbd shortcuts, counts, or badges. */
23
25
  endContent?: ReactNode;
24
26
  onAction?: () => void;
@@ -8,6 +8,7 @@ export interface ResourceContextAction {
8
8
  isDisabled?: boolean;
9
9
  icon?: ReactNode;
10
10
  endContent?: ReactNode;
11
+ separatorBefore?: boolean;
11
12
  }
12
13
  interface ResourceContextMenuProps {
13
14
  actions: ResourceContextAction[];