@opencxh/ui-kit 3.137.8 → 3.137.9

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,71 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { PageHeaderAction } from './PageHeader';
3
+ /**
4
+ * What a panel adds to the frame it is rendered in: the record it drilled into,
5
+ * and the way back out. The settings frame already draws the app breadcrumb and
6
+ * the page title, so a panel that repeats them produces the double bar this
7
+ * component exists to remove.
8
+ */
9
+ export interface SettingsTrailEntry {
10
+ /** Appended to the frame breadcrumb; usually the detail record's name. */
11
+ title?: string;
12
+ /** When set, the frame renders the back affordance and calls this. */
13
+ onBack?: () => void;
14
+ }
15
+ export interface SettingsFrameApi {
16
+ /**
17
+ * `ownerId` scopes the write to one panel instance. Stable across renders,
18
+ * so it is safe to use as a hook dependency.
19
+ */
20
+ setTrail: (ownerId: string, entry: SettingsTrailEntry | null) => void;
21
+ }
22
+ /**
23
+ * Provided by the settings frame (the shell overlay), consumed by panels that
24
+ * are federated remotes. Safe across the module-federation boundary because
25
+ * React and `@opencxh/ui-kit` are both shared singletons — a second copy of
26
+ * either would hand panels a different context object and the trail would
27
+ * silently never arrive.
28
+ */
29
+ export declare const SettingsFrameProvider: React.Provider<SettingsFrameApi | null>;
30
+ export declare function useSettingsFrame(): SettingsFrameApi | null;
31
+ /**
32
+ * State half of the frame contract, for the host to own. Returns the current
33
+ * trail plus the stable api to hand down through `SettingsFrameProvider`.
34
+ */
35
+ export declare function useSettingsFrameHost(): {
36
+ trail: SettingsTrailEntry | null;
37
+ api: SettingsFrameApi;
38
+ };
39
+ declare const paddingClasses: {
40
+ readonly none: "";
41
+ readonly sm: "px-3 py-3";
42
+ readonly md: "px-5 py-4";
43
+ };
44
+ export interface SettingsPageProps {
45
+ children: ReactNode;
46
+ /**
47
+ * Primary actions, right-aligned in the sticky footer — the Cancel/Save pair
48
+ * of a form. Omit entirely on a read-only or list page and no footer renders.
49
+ */
50
+ actions?: PageHeaderAction[];
51
+ /** Left-aligned footer actions, set apart from the primary pair (e.g. Delete). */
52
+ secondaryActions?: PageHeaderAction[];
53
+ /** Renders the back affordance in the frame header (or inline when unframed). */
54
+ onBack?: () => void;
55
+ backLabel?: string;
56
+ /** The record's own name, appended to the frame breadcrumb. */
57
+ title?: string;
58
+ /** Swaps the body for a skeleton while keeping the footer in place. */
59
+ loading?: boolean;
60
+ padding?: keyof typeof paddingClasses;
61
+ className?: string;
62
+ contentClassName?: string;
63
+ }
64
+ /**
65
+ * The body of one settings panel. Owns the three things every panel used to
66
+ * re-invent: the scroll container, the content padding, and where the actions
67
+ * live. Title, description and breadcrumb belong to the frame — pass `title`
68
+ * and `onBack` to extend them rather than drawing a second header here.
69
+ */
70
+ export declare const SettingsPage: React.FC<SettingsPageProps>;
71
+ export {};
@@ -59,6 +59,12 @@ export interface FormGroupItem<T = any> {
59
59
  width?: string | number;
60
60
  /** Placeholder text */
61
61
  placeholder?: string;
62
+ /**
63
+ * Visible rows for `textarea`. Defaults to 4, which is right for a note and
64
+ * far too small for a field that holds an instruction someone actually reads
65
+ * back while editing (a system prompt).
66
+ */
67
+ rows?: number;
62
68
  /** Autocomplete attribute */
63
69
  autocomplete?: string;
64
70
  /** Options for select/radio/checkbox types */
@@ -46,6 +46,7 @@ export { PageToolbar, PageToolbarActions, type PageToolbarActionsProps, type Pag
46
46
  export { RichText, type RichTextProps } from './content/RichText';
47
47
  export { SectionCaption, type SectionCaptionProps } from './content/SectionCaption';
48
48
  export { SectionDivider, type SectionDividerProps } from './content/SectionDivider';
49
+ export { SettingsFrameProvider, SettingsPage, useSettingsFrame, useSettingsFrameHost, type SettingsFrameApi, type SettingsPageProps, type SettingsTrailEntry } from './content/SettingsPage';
49
50
  export { SettingsRow, SettingsSection, type SettingsRowProps, type SettingsSectionProps } from './content/SettingsRow';
50
51
  export { SourceChip, type SourceChipProps } from './content/SourceChip';
51
52
  export { Table, dateFilterHandler, selectFilterHandler, type TableAction, type TableColumn, type TableFilter, type TableProps } from './content/Table';
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@opencxh/ui-kit",
3
- "version": "3.137.8",
3
+ "version": "3.137.9",
4
4
  "description": "Theme-aware UI component library for OpenCXH platform",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
8
+ "source": "./src/index.ts",
8
9
  "types": "./dist/index.d.ts",
9
10
  "import": "./dist/index.js",
10
11
  "require": "./dist/index.cjs"