@opencxh/ui-kit 3.137.11 → 3.137.12
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +755 -693
- package/dist/index.js.map +1 -1
- package/dist/src/content/Page.d.ts +85 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { ContentLoadingShape } from '../feedback/ContentLoading';
|
|
3
|
+
import { PageHeaderAction } from './PageHeader';
|
|
4
|
+
/**
|
|
5
|
+
* The `md` gutter matches `PageHeader`'s own horizontal padding, so the table
|
|
6
|
+
* or form below lines up with the title above it. The top value is small
|
|
7
|
+
* because the header already supplies most of that gap (`pt-4 pb-2.5`).
|
|
8
|
+
*/
|
|
9
|
+
declare const paddingClasses: {
|
|
10
|
+
readonly none: "";
|
|
11
|
+
readonly sm: "px-3 pb-3 pt-1";
|
|
12
|
+
readonly md: "px-5 pb-5 pt-1.5";
|
|
13
|
+
};
|
|
14
|
+
export interface PageProps {
|
|
15
|
+
/** Page title, rendered by `PageHeader`. */
|
|
16
|
+
title: string;
|
|
17
|
+
/** Short description beside the title. */
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
/** Line under the title — a count, a record, a timestamp. */
|
|
20
|
+
meta?: ReactNode;
|
|
21
|
+
/** Toolbar actions, right-aligned in the header. */
|
|
22
|
+
actions?: PageHeaderAction[];
|
|
23
|
+
/** Renders the back chevron beside the title. */
|
|
24
|
+
onBack?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Draws the rule under the header. Defaults to `scroll`, because a header
|
|
27
|
+
* that stays put while the body scrolls needs an edge — without it the first
|
|
28
|
+
* row slides up against the title with nothing between them. A page that
|
|
29
|
+
* scrolls as a whole does not, so the rule would just be a stray line.
|
|
30
|
+
*/
|
|
31
|
+
surface?: boolean;
|
|
32
|
+
/** Full-width row at the bottom of the header — a filter strip, a tab bar. */
|
|
33
|
+
headerContent?: ReactNode;
|
|
34
|
+
/** Swaps the body for a skeleton. */
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* What the body is about to render, so the placeholder has the right shape.
|
|
38
|
+
* Most app pages are a table; a detail page is usually a form.
|
|
39
|
+
*/
|
|
40
|
+
loadingShape?: ContentLoadingShape;
|
|
41
|
+
/**
|
|
42
|
+
* Rendered instead of `children` when there is nothing to show — pass an
|
|
43
|
+
* `EmptyState`. Ignored while `loading`, so an empty list does not flash its
|
|
44
|
+
* "nothing here" message during the first fetch.
|
|
45
|
+
*/
|
|
46
|
+
empty?: ReactNode;
|
|
47
|
+
padding?: keyof typeof paddingClasses;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the page owns its scroll. `true` (default) pins the header and
|
|
50
|
+
* scrolls the body — the right behaviour for a table you page through.
|
|
51
|
+
* Set `false` when the page is rendered inside something that already
|
|
52
|
+
* scrolls and should flow with it.
|
|
53
|
+
*/
|
|
54
|
+
scroll?: boolean;
|
|
55
|
+
className?: string;
|
|
56
|
+
contentClassName?: string;
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* One app page: the header, the content gutter, the scroll container, and the
|
|
61
|
+
* loading and empty states.
|
|
62
|
+
*
|
|
63
|
+
* These four were re-invented per page — 24 times in `eylo-voip` alone, each
|
|
64
|
+
* with its own gutter — which is how `p-4` there and `px-5` everywhere else
|
|
65
|
+
* ended up side by side in the same product. Reach for this instead of pairing
|
|
66
|
+
* a `PageHeader` with a padded `div`.
|
|
67
|
+
*
|
|
68
|
+
* Settings panels are the exception: they live inside the settings frame, which
|
|
69
|
+
* draws its own title and scrolls itself, so they use `SettingsPage`.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* <Page
|
|
74
|
+
* title={t("interactions")}
|
|
75
|
+
* subtitle={t("interactions_description")}
|
|
76
|
+
* actions={[{ id: "refresh", label: t("refresh"), onClick: reload }]}
|
|
77
|
+
* loading={loading}
|
|
78
|
+
* empty={!interactions.length && <EmptyState title={t("interaction_no_records_found")} />}
|
|
79
|
+
* >
|
|
80
|
+
* <InteractionsTable interactions={interactions} />
|
|
81
|
+
* </Page>
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare const Page: React.FC<PageProps>;
|
|
85
|
+
export {};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export { Image, type ImageProps } from './content/Image';
|
|
|
44
44
|
export { List, ListBulkAction, type ListGroup, type ListProps } from './content/List';
|
|
45
45
|
export { MessageBubble, type MessageBubbleProps } from './content/MessageBubble';
|
|
46
46
|
export { KpiCard, type KpiCardProps } from './content/KpiCard';
|
|
47
|
+
export { Page, type PageProps } from './content/Page';
|
|
47
48
|
export { PageHeader, type PageHeaderAction, type PageHeaderProps } from './content/PageHeader';
|
|
48
49
|
export { PageToolbar, PageToolbarActions, type PageToolbarActionsProps, type PageToolbarProps } from './content/PageToolbar';
|
|
49
50
|
export { RichText, type RichTextProps } from './content/RichText';
|