@bfrs/agentic-components 0.6.6 → 0.6.8
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/BFRS_AGENTIC_COMPONENTS.md +45 -8
- package/dist/components/data-display/DataTable/DataTable.d.ts +1 -1
- package/dist/components/data-display/DataTable/DataTable.types.d.ts +10 -1
- package/dist/components/data-display/DataTable/TableSaveView.d.ts +10 -3
- package/dist/components/data-display/DataTable/TableViewSelector.d.ts +5 -2
- package/dist/components/data-display/DataTable/index.d.ts +4 -2
- package/dist/components/data-display/DataTable/saveViewApi.d.ts +23 -7
- package/dist/components/data-display/DataTable/useSavedViews.d.ts +23 -0
- package/dist/components/data-display/DataTable/viewStore.d.ts +9 -3
- package/dist/components/data-display/Table/Table.d.ts +3 -5
- package/dist/components/navigation/Tabs/Tabs.types.d.ts +2 -0
- package/dist/components/primitives/Button/Button.types.d.ts +1 -1
- package/dist/components/primitives/Input/Input.d.ts +2 -1
- package/dist/components/primitives/Input/Input.types.d.ts +2 -0
- package/dist/components/ui/data-display/Avatar/Avatar.d.ts +4 -0
- package/dist/components/ui/patterns/ChatComposer/ChatComposer.d.ts +12 -0
- package/dist/components/ui/patterns/SideNav/SideNav.d.ts +11 -1
- package/dist/components/ui/patterns/StepProgressCard/StepProgressCard.d.ts +6 -0
- package/dist/custom-elements.js +20093 -14719
- package/dist/custom-elements.js.map +1 -1
- package/dist/index.js +7271 -7179
- package/dist/index.js.map +1 -1
- package/dist/lib/documentStyles.d.ts +1 -0
- package/dist/public-api.d.ts +0 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/lib/emotionCache.d.ts +0 -14
- package/dist/shadow/BfrsShadowRoot.d.ts +0 -30
- package/dist/shadow/autoShadow.d.ts +0 -18
- package/dist/shadow/index.d.ts +0 -2
- package/dist/shadow/shadowStyles.d.ts +0 -15
|
@@ -170,7 +170,7 @@ Existing form and pattern tags include `bfrs-date-range-picker`,
|
|
|
170
170
|
`bfrs-modal`, `bfrs-tabs`, and the rest of the documented `bfrs-*` surface.
|
|
171
171
|
|
|
172
172
|
ReactNode-based composition is exposed through native named slots. Angular
|
|
173
|
-
components placed in these slots remain live
|
|
173
|
+
components placed in these slots remain live in the light DOM:
|
|
174
174
|
|
|
175
175
|
```html
|
|
176
176
|
<bfrs-page-header title="Orders">
|
|
@@ -410,7 +410,7 @@ Default sizing follows the Shiprocket 4.0 compact control scale from Figma: `xs`
|
|
|
410
410
|
|
|
411
411
|
| Prop | Type | Default |
|
|
412
412
|
|------|------|---------|
|
|
413
|
-
| `variant` | `"primary" \| "secondary" \| "tertiary" \| "outline" \| "ghost" \| "danger" \| "destructive" \| "link"` | `"primary"` |
|
|
413
|
+
| `variant` | `"primary" \| "secondary" \| "tertiary" \| "outline" \| "ghost" \| "danger" \| "destructive" \| "link" \| "unstyled"` | `"primary"` |
|
|
414
414
|
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | `"md"` |
|
|
415
415
|
| `fullWidth` | `boolean` | `false` |
|
|
416
416
|
| `leftIcon` | `ReactNode` | — |
|
|
@@ -418,6 +418,8 @@ Default sizing follows the Shiprocket 4.0 compact control scale from Figma: `xs`
|
|
|
418
418
|
| `loading` | `boolean` | `false` |
|
|
419
419
|
| `disabled` | `boolean` | `false` |
|
|
420
420
|
|
|
421
|
+
Use `variant="unstyled"` only when migrating a legacy visual treatment into the library contract: it preserves native button semantics and loading/disabled behavior while removing the library's visual chrome, padding, border, background, and label wrapper. Prefer the named variants for normal product UI.
|
|
422
|
+
|
|
421
423
|
---
|
|
422
424
|
|
|
423
425
|
#### `IconButton`
|
|
@@ -440,7 +442,7 @@ Icon-only buttons inherit the same compact control scale: `xs` is 26px, `sm` is
|
|
|
440
442
|
|------|------|---------|
|
|
441
443
|
| `icon` | `ReactNode` | **required** |
|
|
442
444
|
| `aria-label` | `string` | **required** |
|
|
443
|
-
| `variant` | `"primary" \| "secondary" \| "outline" \| "ghost" \| "danger"` | `"ghost"` |
|
|
445
|
+
| `variant` | `"primary" \| "secondary" \| "outline" \| "ghost" \| "danger" \| "unstyled"` | `"ghost"` |
|
|
444
446
|
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | `"md"` |
|
|
445
447
|
| `loading` | `boolean` | `false` |
|
|
446
448
|
|
|
@@ -544,9 +546,12 @@ Text-entry input boxes, affixed input chrome, and select-family triggers use a s
|
|
|
544
546
|
| `leftIcon` | `ReactNode` | — |
|
|
545
547
|
| `rightIcon` | `ReactNode` | — |
|
|
546
548
|
| `loading` | `boolean` | `false` |
|
|
549
|
+
| `appearance` | `"default" \| "unstyled"` | `"default"` |
|
|
547
550
|
|
|
548
551
|
Accepts all native `<input>` props.
|
|
549
552
|
|
|
553
|
+
Use `appearance="unstyled"` for legacy search fields or embedded inputs that already have their own wrapper chrome. It keeps the library input behavior and native attributes but removes the default border, background, padding, shadow, and focus ring.
|
|
554
|
+
|
|
550
555
|
---
|
|
551
556
|
|
|
552
557
|
#### `Textarea`
|
|
@@ -1632,6 +1637,8 @@ User avatar with image, initials fallback, and online status.
|
|
|
1632
1637
|
| `name` | `string` | — |
|
|
1633
1638
|
| `size` | `"sm" \| "md" \| "lg"` | `"md"` |
|
|
1634
1639
|
| `status` | `"online" \| "busy" \| "offline"` | — |
|
|
1640
|
+
| `circleClassName` | `string` | — |
|
|
1641
|
+
| `imageClassName` | `string` | — |
|
|
1635
1642
|
|
|
1636
1643
|
> When `src` is absent, renders initials derived from `name`.
|
|
1637
1644
|
|
|
@@ -1715,6 +1722,11 @@ DataTable has one default visual density, matching the Figma orders table: 8px o
|
|
|
1715
1722
|
| `defaultSorting` | `{ columnId: string; direction: "asc" \| "desc" } \| null` | `null` |
|
|
1716
1723
|
| `maxHeight` | `number \| string` | — |
|
|
1717
1724
|
| `stickyHeader` | `boolean` | `true` |
|
|
1725
|
+
| `fill` | `boolean` | `false` |
|
|
1726
|
+
| `headerTextOverflow` | `"truncate" \| "visible"` | `"truncate"` |
|
|
1727
|
+
| `cellTextSize` | `"default" \| "compact"` | `"default"` |
|
|
1728
|
+
| `scrollerClassName` | `string` | — |
|
|
1729
|
+
| `cellClassName` | `string \| (row, index, column) => string \| undefined` | — |
|
|
1718
1730
|
|
|
1719
1731
|
Angular: pass `sorting` as JSON attribute `[sorting]='{"columnId":"name","direction":"asc"}'`; `default-sorting`, `max-height`, `sticky-header` attributes are fully supported. `show-all-label` and `(show-all)` event are supported on `bfrs-table-column-visibility`.
|
|
1720
1732
|
|
|
@@ -1726,7 +1738,7 @@ Angular: pass `sorting` as JSON attribute `[sorting]='{"columnId":"name","direct
|
|
|
1726
1738
|
accessorKey?: keyof T;
|
|
1727
1739
|
accessorFn?: (row: T) => unknown;
|
|
1728
1740
|
sortable?: boolean;
|
|
1729
|
-
cell?: (row: T) => ReactNode;
|
|
1741
|
+
cell?: (row: T, context: { value: unknown; rowIndex: number; selected: boolean; hovered: boolean }) => ReactNode;
|
|
1730
1742
|
width?: number | string;
|
|
1731
1743
|
minWidth?: number | string;
|
|
1732
1744
|
}
|
|
@@ -1738,11 +1750,14 @@ For pinned columns, declare `width` / `minWidth` for predictable layout. `DataTa
|
|
|
1738
1750
|
|
|
1739
1751
|
When `loading` is true, `DataTable` renders built-in table-row skeleton placeholders rather than a spinner. The consumer app only owns the loading boolean.
|
|
1740
1752
|
|
|
1753
|
+
Use `fill` when the table must stretch inside a height-constrained layout; pair it with `scrollerClassName` for scroll-region layout classes instead of targeting the internal wrapper. `headerTextOverflow="visible"` keeps long header labels fully readable, and `cellTextSize="compact"` applies 12px cell text for dense legacy tables. Use callback `cellClassName` only for row/column-specific body-cell classes.
|
|
1754
|
+
|
|
1741
1755
|
Use `TableViewSelector` with `TableSaveView` when a list page needs named saved views. Put the selector in the `ListPageLayout` filter band beside the filters, not inside `TableToolbar`. The selector uses a free-form `screenName`, reads/writes the matching local view store, selects the primary view by default, and stays hidden until that screen has at least one saved view. `TableSaveView` opens the "Save this view" modal and submits an API-shaped `SaveViewPayload` with `{ view_type, name, columns, filters, priority }`.
|
|
1742
1756
|
|
|
1743
1757
|
```tsx
|
|
1744
1758
|
const screenName = "orders.list";
|
|
1745
|
-
const
|
|
1759
|
+
const saveApi = useMemo(() => ({ baseUrl: import.meta.env.VITE_PLATFORM_BASE_URL, viewType: "orders", tab: "all" }), []);
|
|
1760
|
+
const { views } = useSavedViews(screenName);
|
|
1746
1761
|
|
|
1747
1762
|
<ListPageLayout
|
|
1748
1763
|
title="Orders"
|
|
@@ -1750,6 +1765,7 @@ const saveCurrentView = createLocalSaveView(screenName);
|
|
|
1750
1765
|
<>
|
|
1751
1766
|
<TableViewSelector
|
|
1752
1767
|
screenName={screenName}
|
|
1768
|
+
saveApi={saveApi}
|
|
1753
1769
|
onValueChange={(_, view) => {
|
|
1754
1770
|
if (!view) return;
|
|
1755
1771
|
setVisibleColumnIds(view.columns.filter((column) => column.visible).map((column) => column.key));
|
|
@@ -1758,12 +1774,14 @@ const saveCurrentView = createLocalSaveView(screenName);
|
|
|
1758
1774
|
/>
|
|
1759
1775
|
<Select size="sm" value={status} onValueChange={setStatus} options={statusOptions} />
|
|
1760
1776
|
<TableSaveView
|
|
1777
|
+
screenName={screenName}
|
|
1778
|
+
saveApi={saveApi}
|
|
1761
1779
|
viewType={screenName}
|
|
1762
1780
|
columns={visibilityColumns}
|
|
1763
1781
|
visibleColumnIds={visibleColumnIds}
|
|
1764
1782
|
filters={filters}
|
|
1765
1783
|
filtersCount={filters.length}
|
|
1766
|
-
|
|
1784
|
+
onSaved={({ view }) => setActiveViewId(view.view_id)}
|
|
1767
1785
|
/>
|
|
1768
1786
|
</>
|
|
1769
1787
|
}
|
|
@@ -1771,7 +1789,7 @@ const saveCurrentView = createLocalSaveView(screenName);
|
|
|
1771
1789
|
/>
|
|
1772
1790
|
```
|
|
1773
1791
|
|
|
1774
|
-
|
|
1792
|
+
Pass `saveApi` directly to `TableViewSelector` and `TableSaveView` when saved views should use the Shiprocket endpoints and keep localStorage as the mirror/fallback. App code should not call the saved-view list/get/update/delete helpers directly; those calls are owned by the selector. `TableSaveView` owns create/save when `screenName` and `saveApi` are supplied, then fires `onSaved` so the app can update its selected-view state. Use `useSavedViews(screenName)` when app state needs a read-only list of the locally mirrored views. `saveApi.viewType` maps to the backend `view_type`, and `saveApi.tab` maps to the `tab` query/body scope. Backend reads/mutations run only when both are explicitly supplied, which avoids sending UI-only `screenName` values such as `"orders.list"` as API `view_type`. The built-in component adapter calls `GET listviews`, `GET getview`, `PUT updateview`, and `DELETE deleteview`; API rows are merged into localStorage so local-only saved views remain visible. Because the update/delete endpoints do not take `view_id`, rename/delete/reset call the backend only for the primary view for that `view_type` + `tab`. `createLocalViewStore` and `createLocalSaveView` remain localStorage helpers for local-only saved views.
|
|
1775
1793
|
|
|
1776
1794
|
Column visibility still belongs in `TableToolbar`; keep that table-local save/discard flow separate from saved-view listing controls.
|
|
1777
1795
|
|
|
@@ -1791,7 +1809,7 @@ Column visibility still belongs in `TableToolbar`; keep that table-local save/di
|
|
|
1791
1809
|
/>
|
|
1792
1810
|
```
|
|
1793
1811
|
|
|
1794
|
-
Angular custom-element consumers can use `<bfrs-table-view-selector>` and `<bfrs-table-save-view>` with the same `screen-name`. The selector emits `value-change`, `view-select`, `primary-view-change`, `rename-view`, `delete-view`, and `reset-saved-filters`; `bfrs-table-save-view` emits `saved-view` after a successful save.
|
|
1812
|
+
Angular custom-element consumers can use `<bfrs-table-view-selector>` and `<bfrs-table-save-view>` with the same `screen-name`. Pass `saveApi` through the element `props` object to enable the same backend + localStorage behavior. The selector emits `value-change`, `view-select`, `primary-view-change`, `rename-view`, `delete-view`, and `reset-saved-filters`; `bfrs-table-save-view` emits `saved-view` after a successful save.
|
|
1795
1813
|
|
|
1796
1814
|
Custom-element DataTable action cells must be declarative because Angular/HTML cannot pass React `cell` functions through JSON. Use `cellType: "button"` for one inline button, `cellType: "buttons"` for multiple inline buttons, or `cellType: "actions"` for an action menu. Action clicks emit `cell-action` with `{ actionId, columnId, row, rowId, rowIndex }` and do not trigger `row-click`.
|
|
1797
1815
|
|
|
@@ -1984,6 +2002,9 @@ Tabbed content switcher.
|
|
|
1984
2002
|
| `defaultValue` | `string` | — |
|
|
1985
2003
|
| `value` | `string` | — |
|
|
1986
2004
|
| `onValueChange` | `(value: string) => void` | — |
|
|
2005
|
+
| `renderPanels` | `boolean` | `true` |
|
|
2006
|
+
|
|
2007
|
+
Set `renderPanels={false}` when `items` should render a tab-like navigation strip and the selected route/panel content is owned by the page. Do not use that mode for ordinary in-place tab panels.
|
|
1987
2008
|
|
|
1988
2009
|
---
|
|
1989
2010
|
|
|
@@ -2163,6 +2184,11 @@ Expanded default width is 216px. Rows are 32px high with 8px radius, 12px labels
|
|
|
2163
2184
|
| `header` | `ReactNode` | — |
|
|
2164
2185
|
| `children` | `ReactNode` | — |
|
|
2165
2186
|
| `footer` | `ReactNode` | — |
|
|
2187
|
+
| `rowClassName` | `string` | — |
|
|
2188
|
+
| `footerClassName` | `string` | — |
|
|
2189
|
+
| `inactiveRowHoverBackground` | `string` | standard primary tint |
|
|
2190
|
+
| `flyoutLeft` | `number \| string` | `"15rem"` |
|
|
2191
|
+
| `flyoutZIndex` | `number` | `50` |
|
|
2166
2192
|
|
|
2167
2193
|
- `SideNavSection`: `{ id?, title?, items, action? }` — `title` (uppercase) and `action` are hidden when collapsed.
|
|
2168
2194
|
- `SideNavItem`: `{ id, label, icon?, active?, badge?, nested?, onSelect? }` — `badge` is hidden when collapsed; `nested` opens a hover flyout (expanded only).
|
|
@@ -2226,9 +2252,17 @@ Chat input with attachment and action slots. Submits on `Ctrl+Enter`.
|
|
|
2226
2252
|
| `placeholder` | `string` | `"Ask me anything"` |
|
|
2227
2253
|
| `attachmentSlot` | `ReactNode` | — |
|
|
2228
2254
|
| `actionSlot` | `ReactNode` | — |
|
|
2255
|
+
| `autoHeight` | `boolean` | `false` |
|
|
2256
|
+
| `compactPadding` | `string` | `"6px"` |
|
|
2257
|
+
| `compactActionButtonSize` | `number \| string` | compact icon size |
|
|
2258
|
+
| `placeholderVariant` | `"default" \| "large"` | `"default"` |
|
|
2259
|
+
| `textareaClassName` | `string` | — |
|
|
2260
|
+
| `sendButtonClassName` | `string` | — |
|
|
2229
2261
|
|
|
2230
2262
|
Use `size="sm"` for a compact composer in sidebars, inline threads, or dense workspace rails.
|
|
2231
2263
|
|
|
2264
|
+
The class slots are for app-owned placement details such as an existing composer row height or send-button affordance during migration. Do not target the generated Emotion class names from app CSS.
|
|
2265
|
+
|
|
2232
2266
|
---
|
|
2233
2267
|
|
|
2234
2268
|
#### `FullPageLoader`
|
|
@@ -2533,7 +2567,10 @@ Step-by-step progress indicator. Calculates `done` / `active` / `pending` state
|
|
|
2533
2567
|
| `steps` | `{ label: ReactNode; status?: "done" \| "active" \| "pending" \| "disabled"; disabled?: boolean }[]` | **required** |
|
|
2534
2568
|
| `currentStep` | `number` | `0` |
|
|
2535
2569
|
| `eyebrow` | `ReactNode` | `"Identity & Contact"` |
|
|
2570
|
+
| `eyebrowColor` | `string` | component token value |
|
|
2536
2571
|
| `title` | `ReactNode` | `"Getting your details ready…"` |
|
|
2572
|
+
| `headerClassName` | `string` | — |
|
|
2573
|
+
| `titleClassName` | `string` | — |
|
|
2537
2574
|
| `surface` | `"card" \| "plain"` | `"plain"` |
|
|
2538
2575
|
| `animated` | `boolean` | `true` |
|
|
2539
2576
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DataTableProps } from './DataTable.types';
|
|
2
|
-
export declare function DataTable<Row>({ data, columns, getRowId, loading, error, emptyState, emptyTitle, emptyDescription, pagination, enableSorting, sorting, defaultSorting, onSortingChange, visibleColumnIds, columnOrder, defaultColumnOrder, onColumnOrderChange, enableColumnPinning, pinnedColumnCount, defaultPinnedColumnCount, onPinnedColumnCountChange, pinLeadingColumn, defaultPinLeadingColumn, onPinLeadingColumnChange, enableColumnReordering, resetKey, showSortIcon, leadingColumn, rowActions, rowActionsHeader, rowActionsWidth, stickyRowActions, selection, selectedRowIds, onSelectedRowIdsChange, stickyHeader, minWidth, maxHeight, className, tableClassName, headerClassName, rowClassName, cellClassName, onRowClick, "aria-label": ariaLabel }: DataTableProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function DataTable<Row>({ data, columns, getRowId, loading, error, emptyState, emptyTitle, emptyDescription, pagination, enableSorting, sorting, defaultSorting, onSortingChange, visibleColumnIds, columnOrder, defaultColumnOrder, onColumnOrderChange, enableColumnPinning, pinnedColumnCount, defaultPinnedColumnCount, onPinnedColumnCountChange, pinLeadingColumn, defaultPinLeadingColumn, onPinLeadingColumnChange, enableColumnReordering, resetKey, showSortIcon, leadingColumn, rowActions, rowActionsHeader, rowActionsWidth, stickyRowActions, selection, selectedRowIds, onSelectedRowIdsChange, stickyHeader, fill, headerTextOverflow, cellTextSize, minWidth, maxHeight, className, scrollerClassName, tableClassName, headerClassName, rowClassName, cellClassName, onRowClick, "aria-label": ariaLabel }: DataTableProps<Row>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -91,6 +91,12 @@ export type DataTableProps<Row> = {
|
|
|
91
91
|
selectedRowIds?: string[];
|
|
92
92
|
onSelectedRowIdsChange?: (ids: string[]) => void;
|
|
93
93
|
stickyHeader?: boolean;
|
|
94
|
+
/** Let the table root fill the available flex height. */
|
|
95
|
+
fill?: boolean;
|
|
96
|
+
/** Header label overflow behavior. Defaults to truncating long labels. */
|
|
97
|
+
headerTextOverflow?: "truncate" | "visible";
|
|
98
|
+
/** Compact body text applies 12px text to cells and their contents. */
|
|
99
|
+
cellTextSize?: "default" | "compact";
|
|
94
100
|
minWidth?: number | string;
|
|
95
101
|
/**
|
|
96
102
|
* Caps the height of the scrollable region so the body scrolls vertically
|
|
@@ -99,10 +105,11 @@ export type DataTableProps<Row> = {
|
|
|
99
105
|
*/
|
|
100
106
|
maxHeight?: number | string;
|
|
101
107
|
className?: string;
|
|
108
|
+
scrollerClassName?: string;
|
|
102
109
|
tableClassName?: string;
|
|
103
110
|
headerClassName?: string;
|
|
104
111
|
rowClassName?: string | ((row: Row, index: number) => string | undefined);
|
|
105
|
-
cellClassName?: string;
|
|
112
|
+
cellClassName?: string | ((row: Row, index: number, column: DataTableColumn<Row>) => string | undefined);
|
|
106
113
|
onRowClick?: (row: Row) => void;
|
|
107
114
|
"aria-label"?: string;
|
|
108
115
|
};
|
|
@@ -184,6 +191,7 @@ export type SavedView = {
|
|
|
184
191
|
view_id: string;
|
|
185
192
|
name: string;
|
|
186
193
|
view_type: ViewType;
|
|
194
|
+
tab?: string;
|
|
187
195
|
columns: ViewColumn[];
|
|
188
196
|
filters: ViewFilter[];
|
|
189
197
|
priority: number;
|
|
@@ -192,6 +200,7 @@ export type SavedView = {
|
|
|
192
200
|
};
|
|
193
201
|
export type SaveViewPayload = {
|
|
194
202
|
view_type: ViewType;
|
|
203
|
+
tab?: string;
|
|
195
204
|
name: string;
|
|
196
205
|
columns: ViewColumn[];
|
|
197
206
|
filters?: ViewFilter[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { TableColumnVisibilityColumn, ViewFilter, ViewType, SaveViewPayload, SaveViewResult } from './DataTable.types';
|
|
3
|
+
import { SaveViewApiConfig } from './saveViewApi';
|
|
3
4
|
export type TableSaveViewProps = {
|
|
4
5
|
open?: boolean;
|
|
5
6
|
defaultOpen?: boolean;
|
|
@@ -27,17 +28,23 @@ export type TableSaveViewProps = {
|
|
|
27
28
|
filters?: ViewFilter[];
|
|
28
29
|
/** View priority. Higher wins on resolution. Defaults to 0. */
|
|
29
30
|
priority?: number;
|
|
31
|
+
/** Screen key for component-owned persistence through the saved-view store. */
|
|
32
|
+
screenName?: string;
|
|
33
|
+
/** Component-owned backend config used when `screenName` is supplied. */
|
|
34
|
+
saveApi?: SaveViewApiConfig;
|
|
30
35
|
cancelLabel?: ReactNode;
|
|
31
36
|
saveLabel?: ReactNode;
|
|
32
37
|
onCancel?: () => void;
|
|
33
38
|
/**
|
|
34
39
|
* Called on submit with the API-formatted payload.
|
|
35
|
-
* Return a `SaveViewResult`
|
|
36
|
-
*
|
|
40
|
+
* Return a `SaveViewResult` to trigger `onSaved` and allow the component to
|
|
41
|
+
* detect duplicates.
|
|
37
42
|
*/
|
|
38
43
|
onSave?: (payload: SaveViewPayload) => void | Promise<SaveViewResult | void>;
|
|
39
44
|
/** Fires after a successful save with the resolved view and duplicate flag. */
|
|
40
45
|
onSaved?: (result: SaveViewResult) => void;
|
|
46
|
+
/** Fires when the save callback or component-owned store rejects. */
|
|
47
|
+
onError?: (error: unknown) => void;
|
|
41
48
|
loading?: boolean;
|
|
42
49
|
disabled?: boolean;
|
|
43
50
|
closeOnSave?: boolean;
|
|
@@ -47,4 +54,4 @@ export type TableSaveViewProps = {
|
|
|
47
54
|
className?: string;
|
|
48
55
|
triggerClassName?: string;
|
|
49
56
|
};
|
|
50
|
-
export declare function TableSaveView({ open, defaultOpen, onOpenChange, onClose, trigger, triggerLabel, title, description, viewName, defaultViewName, onViewNameChange, viewNameLabel, viewNamePlaceholder, appliedLabel, appliedSettings, appliedSettingLabels, columns, visibleColumnIds, hiddenColumnCount, filtersCount, viewType, filters, priority, cancelLabel, saveLabel, onCancel, onSave, onSaved, loading, disabled, closeOnSave, closeOnOverlayClick, closeOnEscape, preventClose, className, triggerClassName }: TableSaveViewProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare function TableSaveView({ open, defaultOpen, onOpenChange, onClose, trigger, triggerLabel, title, description, viewName, defaultViewName, onViewNameChange, viewNameLabel, viewNamePlaceholder, appliedLabel, appliedSettings, appliedSettingLabels, columns, visibleColumnIds, hiddenColumnCount, filtersCount, viewType, filters, priority, screenName, saveApi, cancelLabel, saveLabel, onCancel, onSave, onSaved, onError, loading, disabled, closeOnSave, closeOnOverlayClick, closeOnEscape, preventClose, className, triggerClassName }: TableSaveViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SavedView } from './DataTable.types';
|
|
3
3
|
import { ViewStore } from './viewStore';
|
|
4
|
+
import { SaveViewApiConfig } from './saveViewApi';
|
|
4
5
|
export type TableViewSelectorProps = {
|
|
5
6
|
/** Free-form screen key used for localStorage scoping, e.g. "orders_new". */
|
|
6
7
|
screenName: string;
|
|
7
|
-
/** Optional store adapter. Defaults to
|
|
8
|
+
/** Optional store adapter. Defaults to the component-owned local/API store for this screen. */
|
|
8
9
|
store?: ViewStore;
|
|
10
|
+
/** Optional API adapter config for the default local store. Ignored when `store` is supplied. */
|
|
11
|
+
saveApi?: SaveViewApiConfig;
|
|
9
12
|
/** Controlled selected view id. Selection is separate from the persisted primary view. */
|
|
10
13
|
value?: string | null;
|
|
11
14
|
/** Initial selected view id for uncontrolled mode. Falls back to the store's primary view. */
|
|
@@ -41,4 +44,4 @@ export type TableViewSelectorProps = {
|
|
|
41
44
|
contentClassName?: string;
|
|
42
45
|
actionMenuClassName?: string;
|
|
43
46
|
};
|
|
44
|
-
export declare function TableViewSelector({ screenName, store, value, defaultValue, selectPrimaryByDefault, onValueChange, onViewSelect, onPrimaryViewChange, onRenameView, onDeleteView, onResetSavedFilters, onError, triggerLabel, placeholder, viewsLabel, emptyLabel, loadingLabel, resetLabel, setPrimaryLabel, renameLabel, deleteLabel, renameTitle, renameDescription, renameInputLabel, renameCancelLabel, renameSaveLabel, size, disabled, className, triggerClassName, contentClassName, actionMenuClassName }: TableViewSelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
47
|
+
export declare function TableViewSelector({ screenName, store, saveApi, value, defaultValue, selectPrimaryByDefault, onValueChange, onViewSelect, onPrimaryViewChange, onRenameView, onDeleteView, onResetSavedFilters, onError, triggerLabel, placeholder, viewsLabel, emptyLabel, loadingLabel, resetLabel, setPrimaryLabel, renameLabel, deleteLabel, renameTitle, renameDescription, renameInputLabel, renameCancelLabel, renameSaveLabel, size, disabled, className, triggerClassName, contentClassName, actionMenuClassName }: TableViewSelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -10,5 +10,7 @@ export * from './TableBulkActions';
|
|
|
10
10
|
export * from './TableColumnVisibility';
|
|
11
11
|
export * from './TableSaveView';
|
|
12
12
|
export * from './TableViewSelector';
|
|
13
|
-
export * from './
|
|
14
|
-
export
|
|
13
|
+
export * from './useSavedViews';
|
|
14
|
+
export type { SaveViewApiConfig, SaveViewHeaderSource, SaveViewTokenSource } from './saveViewApi';
|
|
15
|
+
export { createLocalSaveView, createLocalViewStore } from './viewStore';
|
|
16
|
+
export type { LocalViewStoreOptions, RemoteSaveView, ViewStore } from './viewStore';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaveViewPayload, SaveViewResult } from './DataTable.types';
|
|
1
|
+
import { SavedView, SaveViewPayload, SaveViewResult, ViewType } from './DataTable.types';
|
|
2
2
|
export type SaveViewHeaderSource = Record<string, string | null | undefined> | (() => Record<string, string | null | undefined>);
|
|
3
3
|
export type SaveViewTokenSource = string | null | undefined | (() => string | null | undefined);
|
|
4
4
|
export type SaveViewApiConfig = {
|
|
@@ -8,8 +8,22 @@ export type SaveViewApiConfig = {
|
|
|
8
8
|
* `https://platform.shiprocket.in/api/v1/`.
|
|
9
9
|
*/
|
|
10
10
|
baseUrl?: string;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Back-compat endpoint override for direct saves. Prefer `saveEndpoint` for
|
|
13
|
+
* new code. Component-owned saved-view flows only POST when `endpoint`,
|
|
14
|
+
* `saveEndpoint`, or `remoteSave` is supplied explicitly.
|
|
15
|
+
*/
|
|
12
16
|
endpoint?: string;
|
|
17
|
+
/** Optional create/save endpoint. Omit when save should remain localStorage-only. */
|
|
18
|
+
saveEndpoint?: string;
|
|
19
|
+
listEndpoint?: string;
|
|
20
|
+
getEndpoint?: string;
|
|
21
|
+
updateEndpoint?: string;
|
|
22
|
+
deleteEndpoint?: string;
|
|
23
|
+
/** Backend view_type. Defaults to the save payload's view_type. */
|
|
24
|
+
viewType?: ViewType;
|
|
25
|
+
/** Backend tab scope, e.g. "all" or "new". Added to query/body when present. */
|
|
26
|
+
tab?: string;
|
|
13
27
|
/** Auth token or lazy token reader. Defaults to common Shiprocket localStorage keys. */
|
|
14
28
|
token?: SaveViewTokenSource;
|
|
15
29
|
/** Extra headers or lazy header reader. */
|
|
@@ -26,13 +40,15 @@ export type SaveViewOptions = SaveViewApiConfig & {
|
|
|
26
40
|
* Saves a user view. Returns the saved view and whether it was a duplicate.
|
|
27
41
|
* Throws on HTTP error (auth, validation, network).
|
|
28
42
|
*/
|
|
29
|
-
export declare function saveView({ baseUrl, endpoint, token, headers, credentials, fetcher, payload, }: SaveViewOptions): Promise<SaveViewResult>;
|
|
43
|
+
export declare function saveView({ baseUrl, endpoint, saveEndpoint, viewType, tab, token, headers, credentials, fetcher, payload, }: SaveViewOptions): Promise<SaveViewResult>;
|
|
44
|
+
export declare function listViews(config: SaveViewApiConfig): Promise<SavedView[]>;
|
|
45
|
+
export declare function getView(config: SaveViewApiConfig): Promise<SavedView | null>;
|
|
46
|
+
export declare function updateView(config: SaveViewApiConfig & {
|
|
47
|
+
payload: SaveViewPayload;
|
|
48
|
+
}): Promise<SavedView | null>;
|
|
49
|
+
export declare function deleteView(config: SaveViewApiConfig): Promise<void>;
|
|
30
50
|
/**
|
|
31
51
|
* Creates a pre-configured save function bound to a base URL and token.
|
|
32
52
|
* The returned function matches the `TableSaveView.onSave` signature directly.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* const save = createSaveView({ baseUrl: import.meta.env.VITE_AGENTIC_BASE_URL });
|
|
36
|
-
* <TableSaveView onSave={save} onSaved={...} />
|
|
37
53
|
*/
|
|
38
54
|
export declare function createSaveView(config?: SaveViewApiConfig): (payload: SaveViewPayload) => Promise<SaveViewResult>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SavedView } from './DataTable.types';
|
|
2
|
+
import { ViewStore } from './viewStore';
|
|
3
|
+
export type UseSavedViewsOptions = {
|
|
4
|
+
/** Optional read adapter. Defaults to the localStorage-backed store for `screenName`. */
|
|
5
|
+
store?: ViewStore;
|
|
6
|
+
/** Set false to keep the hook idle while a screen key is still resolving. */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type UseSavedViewsResult = {
|
|
10
|
+
views: SavedView[];
|
|
11
|
+
primaryView: SavedView | null;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
error: unknown;
|
|
14
|
+
refresh: () => Promise<SavedView[]>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Read saved views for a screen without exposing the saved-view HTTP helpers.
|
|
18
|
+
*
|
|
19
|
+
* Components that own the backend sync write into the same screen-scoped local
|
|
20
|
+
* store; this hook subscribes to that store so consumers can react to the latest
|
|
21
|
+
* mirrored list.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useSavedViews(screenName: string | undefined, options?: UseSavedViewsOptions): UseSavedViewsResult;
|
|
@@ -35,7 +35,13 @@ export type LocalViewStoreOptions = {
|
|
|
35
35
|
* only mirrors the view into localStorage after the remote save succeeds.
|
|
36
36
|
*/
|
|
37
37
|
remoteSave?: RemoteSaveView;
|
|
38
|
-
|
|
38
|
+
};
|
|
39
|
+
export type TableViewSelectorStoreOptions = LocalViewStoreOptions & {
|
|
40
|
+
/**
|
|
41
|
+
* Component-owned API config for Shiprocket saved-view endpoints. This is
|
|
42
|
+
* intentionally used only by TableViewSelector and custom elements so app
|
|
43
|
+
* code does not call saved-view APIs directly.
|
|
44
|
+
*/
|
|
39
45
|
saveApi?: SaveViewApiConfig;
|
|
40
46
|
};
|
|
41
47
|
/**
|
|
@@ -43,10 +49,10 @@ export type LocalViewStoreOptions = {
|
|
|
43
49
|
* Views for a screen live under `bfrs.savedViews.<screenName>`.
|
|
44
50
|
*/
|
|
45
51
|
export declare function createLocalViewStore(screenName: string, options?: LocalViewStoreOptions): ViewStore;
|
|
52
|
+
export declare function createTableViewSelectorStore(screenName: string, options?: TableViewSelectorStoreOptions): ViewStore;
|
|
46
53
|
/**
|
|
47
54
|
* A pre-bound save function for a screen's local store, matching the
|
|
48
|
-
* `TableSaveView.onSave` signature
|
|
49
|
-
* `createSaveView`.
|
|
55
|
+
* `TableSaveView.onSave` signature.
|
|
50
56
|
*
|
|
51
57
|
* @example
|
|
52
58
|
* const onSave = createLocalSaveView("orders_new");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { TableDensity } from '../DataTable/DataTable.types';
|
|
3
3
|
export interface TableProps {
|
|
4
4
|
children?: ReactNode;
|
|
@@ -26,12 +26,10 @@ export interface TfootProps {
|
|
|
26
26
|
className?: string;
|
|
27
27
|
}
|
|
28
28
|
export declare function Tfoot({ children, className }: TfootProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export interface TrProps {
|
|
29
|
+
export interface TrProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
30
30
|
children?: ReactNode;
|
|
31
|
-
onClick?: () => void;
|
|
32
|
-
className?: string;
|
|
33
31
|
}
|
|
34
|
-
export declare function Tr({ children, onClick, className }: TrProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function Tr({ children, onClick, className, ...props }: TrProps): import("react/jsx-runtime").JSX.Element;
|
|
35
33
|
export interface ThProps {
|
|
36
34
|
children?: ReactNode;
|
|
37
35
|
align?: "left" | "center" | "right";
|
|
@@ -11,6 +11,8 @@ export type TabsProps = RadixTabs.TabsProps & {
|
|
|
11
11
|
items?: TabItem[];
|
|
12
12
|
variant?: "line" | "pill";
|
|
13
13
|
size?: "xs" | "sm" | "md" | "lg";
|
|
14
|
+
/** Set false when `items` are used as a navigation strip and content renders elsewhere. */
|
|
15
|
+
renderPanels?: boolean;
|
|
14
16
|
listClassName?: string;
|
|
15
17
|
triggerClassName?: string;
|
|
16
18
|
contentClassName?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export type ButtonVariant = "primary" | "secondary" | "tertiary" | "outline" | "ghost" | "destructive" | "danger" | "link";
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "tertiary" | "outline" | "ghost" | "destructive" | "danger" | "link" | "unstyled";
|
|
3
3
|
export type ButtonSize = "xs" | "sm" | "md" | "lg";
|
|
4
4
|
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
5
|
variant?: ButtonVariant;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { InputSize } from './Input.types';
|
|
1
|
+
import { InputAppearance, InputSize } from './Input.types';
|
|
2
2
|
export declare const Input: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> & {
|
|
3
3
|
size?: InputSize;
|
|
4
|
+
appearance?: InputAppearance;
|
|
4
5
|
label?: import('react').ReactNode;
|
|
5
6
|
helperText?: import('react').ReactNode;
|
|
6
7
|
errorMessage?: import('react').ReactNode;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export type InputSize = "xs" | "sm" | "md" | "lg";
|
|
3
|
+
export type InputAppearance = "default" | "unstyled";
|
|
3
4
|
export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> & {
|
|
4
5
|
size?: InputSize;
|
|
6
|
+
appearance?: InputAppearance;
|
|
5
7
|
label?: ReactNode;
|
|
6
8
|
helperText?: ReactNode;
|
|
7
9
|
errorMessage?: ReactNode;
|
|
@@ -5,6 +5,8 @@ export type AvatarProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
5
5
|
name?: string;
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
7
|
status?: "online" | "busy" | "offline";
|
|
8
|
+
circleClassName?: string;
|
|
9
|
+
imageClassName?: string;
|
|
8
10
|
};
|
|
9
11
|
export declare const Avatar: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
10
12
|
src?: string;
|
|
@@ -12,4 +14,6 @@ export declare const Avatar: import('react').ForwardRefExoticComponent<HTMLAttri
|
|
|
12
14
|
name?: string;
|
|
13
15
|
size?: "sm" | "md" | "lg";
|
|
14
16
|
status?: "online" | "busy" | "offline";
|
|
17
|
+
circleClassName?: string;
|
|
18
|
+
imageClassName?: string;
|
|
15
19
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -9,6 +9,12 @@ export type ChatComposerProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
9
9
|
size?: "sm" | "md";
|
|
10
10
|
attachmentSlot?: ReactNode;
|
|
11
11
|
actionSlot?: ReactNode;
|
|
12
|
+
autoHeight?: boolean;
|
|
13
|
+
compactPadding?: string;
|
|
14
|
+
compactActionButtonSize?: number | string;
|
|
15
|
+
placeholderVariant?: "default" | "large";
|
|
16
|
+
textareaClassName?: string;
|
|
17
|
+
sendButtonClassName?: string;
|
|
12
18
|
};
|
|
13
19
|
export declare const ChatComposer: import('react').ForwardRefExoticComponent<Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "onSubmit"> & {
|
|
14
20
|
value: string;
|
|
@@ -20,4 +26,10 @@ export declare const ChatComposer: import('react').ForwardRefExoticComponent<Omi
|
|
|
20
26
|
size?: "sm" | "md";
|
|
21
27
|
attachmentSlot?: ReactNode;
|
|
22
28
|
actionSlot?: ReactNode;
|
|
29
|
+
autoHeight?: boolean;
|
|
30
|
+
compactPadding?: string;
|
|
31
|
+
compactActionButtonSize?: number | string;
|
|
32
|
+
placeholderVariant?: "default" | "large";
|
|
33
|
+
textareaClassName?: string;
|
|
34
|
+
sendButtonClassName?: string;
|
|
23
35
|
} & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -37,6 +37,16 @@ export type SideNavProps = {
|
|
|
37
37
|
children?: ReactNode;
|
|
38
38
|
/** Bottom slot (e.g. user + settings). */
|
|
39
39
|
footer?: ReactNode;
|
|
40
|
+
/** Class applied to each row button. */
|
|
41
|
+
rowClassName?: string;
|
|
42
|
+
/** Class applied to the footer wrapper. */
|
|
43
|
+
footerClassName?: string;
|
|
44
|
+
/** Hover background for inactive rows. Defaults to the standard primary tint. */
|
|
45
|
+
inactiveRowHoverBackground?: string;
|
|
46
|
+
/** Left offset for expanded hover flyouts. Defaults to the historical 15rem offset. */
|
|
47
|
+
flyoutLeft?: number | string;
|
|
48
|
+
/** z-index for expanded hover flyouts. */
|
|
49
|
+
flyoutZIndex?: number;
|
|
40
50
|
className?: string;
|
|
41
51
|
style?: CSSProperties;
|
|
42
52
|
};
|
|
@@ -46,7 +56,7 @@ export type SideNavProps = {
|
|
|
46
56
|
* dedicated `header` and `footer` slots. All data (labels, icons, handlers) is
|
|
47
57
|
* passed in — the component owns layout, collapse behavior, and chrome only.
|
|
48
58
|
*/
|
|
49
|
-
export declare function SideNav({ sections, collapsed, width, collapsedWidth, header, children, footer, className, style }: SideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare function SideNav({ sections, collapsed, width, collapsedWidth, header, children, footer, rowClassName, footerClassName, inactiveRowHoverBackground, flyoutLeft, flyoutZIndex, className, style }: SideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
50
60
|
export declare namespace SideNav {
|
|
51
61
|
var displayName: string;
|
|
52
62
|
}
|
|
@@ -8,7 +8,10 @@ export type StepProgressStep = {
|
|
|
8
8
|
};
|
|
9
9
|
export type StepProgressCardProps = HTMLAttributes<HTMLElement> & {
|
|
10
10
|
eyebrow?: ReactNode;
|
|
11
|
+
eyebrowColor?: string;
|
|
11
12
|
title?: ReactNode;
|
|
13
|
+
headerClassName?: string;
|
|
14
|
+
titleClassName?: string;
|
|
12
15
|
steps: StepProgressStep[];
|
|
13
16
|
currentStep?: number;
|
|
14
17
|
surface?: "card" | "plain";
|
|
@@ -16,7 +19,10 @@ export type StepProgressCardProps = HTMLAttributes<HTMLElement> & {
|
|
|
16
19
|
};
|
|
17
20
|
export declare const StepProgressCard: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
18
21
|
eyebrow?: ReactNode;
|
|
22
|
+
eyebrowColor?: string;
|
|
19
23
|
title?: ReactNode;
|
|
24
|
+
headerClassName?: string;
|
|
25
|
+
titleClassName?: string;
|
|
20
26
|
steps: StepProgressStep[];
|
|
21
27
|
currentStep?: number;
|
|
22
28
|
surface?: "card" | "plain";
|