@starasia/admin 8.9.0 → 8.10.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/components/SidePanel/SidePanelItem.d.ts +63 -0
- package/dist/components/SidePanel/index.d.ts +2 -0
- package/dist/index.cjs.js +53 -2
- package/dist/index.es.js +1534 -1393
- package/dist/index.umd.js +53 -2
- package/package.json +1 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface SidePanelItemProps {
|
|
4
|
+
/**
|
|
5
|
+
* Highlight this row as the currently selected one — paints the accent
|
|
6
|
+
* bar (`--sa-border-focused`) + a subtle brand fill.
|
|
7
|
+
*/
|
|
8
|
+
active?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Which edge the active/focus accent bar sits on. Match it to the
|
|
11
|
+
* `SidePanel`'s `side` so the bar hugs the panel's outer edge.
|
|
12
|
+
* @default 'left'
|
|
13
|
+
*/
|
|
14
|
+
accentSide?: "left" | "right";
|
|
15
|
+
/** Click handler for selecting the row. */
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Top line — typically a document code / id (e.g. "SJ-BIB/03-2026/0004").
|
|
19
|
+
* Truncates with an ellipsis when it overflows.
|
|
20
|
+
*/
|
|
21
|
+
title?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Trailing element on the title row — usually a `<Badge />` (e.g. status).
|
|
24
|
+
* Pinned to the right, never shrinks.
|
|
25
|
+
*/
|
|
26
|
+
badge?: React.ReactNode;
|
|
27
|
+
/** Main bold line — e.g. the entity / company name. */
|
|
28
|
+
heading?: React.ReactNode;
|
|
29
|
+
/** Subtle bottom line — e.g. "Created By: …". */
|
|
30
|
+
meta?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Custom body — when provided, overrides the
|
|
33
|
+
* `title`/`badge`/`heading`/`meta` layout entirely.
|
|
34
|
+
*/
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
/** Render the bottom divider between rows. @default true */
|
|
37
|
+
divider?: boolean;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
className?: string;
|
|
40
|
+
style?: React.CSSProperties;
|
|
41
|
+
/** aria-label when the row content isn't plain readable text. */
|
|
42
|
+
"aria-label"?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* SidePanelItem — a selectable list-row card for use inside `SidePanel`'s
|
|
46
|
+
* `children`. Shows a document code (`title`) with an optional `badge`, a
|
|
47
|
+
* bold `heading`, and a subtle `meta` line. The `active` row gets an accent
|
|
48
|
+
* left border; every row has a hover and keyboard-focus state.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* {records.map((r) => (
|
|
52
|
+
* <SidePanelItem
|
|
53
|
+
* key={r.id}
|
|
54
|
+
* active={r.id === activeId}
|
|
55
|
+
* onClick={() => setActiveId(r.id)}
|
|
56
|
+
* title={r.code}
|
|
57
|
+
* badge={<Badge variant="warning" size="sm" text={r.status} />}
|
|
58
|
+
* heading={r.company}
|
|
59
|
+
* meta={`Created By: ${r.createdBy}`}
|
|
60
|
+
* />
|
|
61
|
+
* ))}
|
|
62
|
+
*/
|
|
63
|
+
export declare const SidePanelItem: React.FC<SidePanelItemProps>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { BoxProps } from '@starasia/box';
|
|
3
3
|
|
|
4
|
+
export { SidePanelItem } from './SidePanelItem';
|
|
5
|
+
export type { SidePanelItemProps } from './SidePanelItem';
|
|
4
6
|
export interface SidePanelToggleLabel {
|
|
5
7
|
/** aria-label when the panel is currently open (clicking will collapse it). */
|
|
6
8
|
collapse: string;
|