@bfrs/agentic-components 0.4.2 → 0.4.5
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 +32 -8
- package/README.md +4 -1
- package/dist/components/data-display/DataTable/DataTable.d.ts +1 -1
- package/dist/components/data-display/DataTable/DataTable.types.d.ts +0 -2
- package/dist/components/data-display/DataTable/TableSkeleton.d.ts +1 -1
- package/dist/components/ui/forms/MultiSelect/MultiSelect.d.ts +0 -3
- package/dist/components/ui/forms/SearchableSelect/SearchableSelect.d.ts +0 -3
- package/dist/components/ui/forms/Select/Select.d.ts +3 -1
- package/dist/components/ui/overlays/overlayPositioning.d.ts +1 -0
- package/dist/custom-elements.d.ts +0 -1
- package/dist/custom-elements.js +6032 -6051
- package/dist/custom-elements.js.map +1 -1
- package/dist/index.js +3261 -3276
- package/dist/index.js.map +1 -1
- package/dist/shadow/autoShadow.d.ts +2 -1
- package/dist/style.css +1 -1
- package/dist/theme.js +19 -19
- package/dist/theme.js.map +1 -1
- package/dist/tokens/sizes.d.ts +19 -19
- package/package.json +1 -1
|
@@ -371,6 +371,8 @@ import { MagnifyingGlass } from "@phosphor-icons/react";
|
|
|
371
371
|
|
|
372
372
|
Primary interactive element. Covers all CTA patterns.
|
|
373
373
|
|
|
374
|
+
Default sizing follows the Shiprocket 4.0 compact control scale from Figma: `xs` is 26px high, `sm` is 28px, `md` is 30px, and `lg` remains 40px. `primary` is the dark `#29343D` CTA, `secondary` is the white soft-stroke control, and `outline` is the selected/active filter-style control.
|
|
375
|
+
|
|
374
376
|
```tsx
|
|
375
377
|
<Button variant="primary" size="md" onClick={handleSave}>
|
|
376
378
|
Save changes
|
|
@@ -403,6 +405,8 @@ Primary interactive element. Covers all CTA patterns.
|
|
|
403
405
|
|
|
404
406
|
Square button for icon-only actions. Always provide `aria-label`.
|
|
405
407
|
|
|
408
|
+
Icon-only buttons inherit the same compact control scale: `xs` is 26px, `sm` is 28px, `md` is 32px, and `lg` is 40px.
|
|
409
|
+
|
|
406
410
|
```tsx
|
|
407
411
|
<IconButton
|
|
408
412
|
icon={<Icon icon={Trash} />}
|
|
@@ -498,6 +502,9 @@ Standalone label. Prefer `FormField` which renders this automatically.
|
|
|
498
502
|
|
|
499
503
|
Standard text input.
|
|
500
504
|
|
|
505
|
+
Inputs use the same 28px Figma trigger height as select controls across native input types such as `text`, `number`, `email`, and `search`. Placeholders render in secondary text (`#64737E`).
|
|
506
|
+
Focused inputs, affixed input chrome, and select-family triggers must show the focus border/ring; open select popovers keep that same visual state through `aria-expanded`.
|
|
507
|
+
|
|
501
508
|
```tsx
|
|
502
509
|
<Input
|
|
503
510
|
placeholder="Search…"
|
|
@@ -549,6 +556,9 @@ Accepts all native `<textarea>` props.
|
|
|
549
556
|
|
|
550
557
|
Single-value dropdown. Options are `{ value: string; label: string }`.
|
|
551
558
|
|
|
559
|
+
The Figma trigger style is the only select size: 28px high with 12.5px text, 7px radius, and a 10px chevron.
|
|
560
|
+
The trigger chevron rotates 180deg while open. This open/close motion and focused/open border treatment is shared by `Select`, `SearchableSelect`, and `MultiSelect`.
|
|
561
|
+
|
|
552
562
|
```tsx
|
|
553
563
|
<Select
|
|
554
564
|
options={[
|
|
@@ -567,7 +577,9 @@ Single-value dropdown. Options are `{ value: string; label: string }`.
|
|
|
567
577
|
| `value` | `string` | — |
|
|
568
578
|
| `onValueChange` | `(value: string) => void` | — |
|
|
569
579
|
| `placeholder` | `string` | `"Select"` |
|
|
570
|
-
| `
|
|
580
|
+
| `open` | `boolean` | — |
|
|
581
|
+
| `defaultOpen` | `boolean` | `false` |
|
|
582
|
+
| `onOpenChange` | `(open: boolean) => void` | — |
|
|
571
583
|
| `disabled` | `boolean` | `false` |
|
|
572
584
|
| `error` | `boolean` | `false` |
|
|
573
585
|
|
|
@@ -579,6 +591,8 @@ The selected value never wraps: it truncates with an ellipsis when it is too lon
|
|
|
579
591
|
|
|
580
592
|
Preset and custom calendar date-range filter. Presets commit immediately; custom ranges use Apply/Cancel.
|
|
581
593
|
|
|
594
|
+
The trigger uses the neutral secondary compact button by default so date filters visually match the Figma filter bar.
|
|
595
|
+
|
|
582
596
|
```tsx
|
|
583
597
|
import { DateRangePicker, presetToRange, type DateRangeValue } from "@bfrs/agentic-components";
|
|
584
598
|
|
|
@@ -632,13 +646,13 @@ Combobox with search. Use when options list is long (10+).
|
|
|
632
646
|
| `disabled` | `boolean` | `false` |
|
|
633
647
|
| `error` | `boolean` | `false` |
|
|
634
648
|
| `clearable` | `boolean` | `true` |
|
|
635
|
-
| `size` | `"sm" \| "md" \| "lg"` | `"md"` |
|
|
636
649
|
|
|
637
650
|
---
|
|
638
651
|
|
|
639
652
|
#### `MultiSelect`
|
|
640
653
|
|
|
641
654
|
Searchable multi-value select. Use for channel/category filters or any bounded list where more than one option can be selected.
|
|
655
|
+
The popover keeps the embedded search input on the same 28px field style as `Input` and `Select`, scrolls only the option list, and keeps Apply/Clear footer actions visible.
|
|
642
656
|
|
|
643
657
|
```tsx
|
|
644
658
|
<MultiSelect
|
|
@@ -674,7 +688,6 @@ Angular custom element:
|
|
|
674
688
|
| `error` | `boolean` | `false` |
|
|
675
689
|
| `clearable` | `boolean` | `true` |
|
|
676
690
|
| `maxVisibleValues` | `number` | `2` |
|
|
677
|
-
| `size` | `"sm" \| "md" \| "lg"` | `"md"` |
|
|
678
691
|
|
|
679
692
|
---
|
|
680
693
|
|
|
@@ -1013,6 +1026,8 @@ Angular:
|
|
|
1013
1026
|
Square checklist control for independent true/false decisions or multi-select choices.
|
|
1014
1027
|
Use `Radio` instead when exactly one option in a group can be selected.
|
|
1015
1028
|
|
|
1029
|
+
The default checkbox is the Figma `sm` control: 12px square, 0.8px secondary stroke (`#64737E`), and 2.5px radius.
|
|
1030
|
+
|
|
1016
1031
|
```tsx
|
|
1017
1032
|
<Checkbox
|
|
1018
1033
|
checked={agreed}
|
|
@@ -1028,7 +1043,7 @@ Use `Radio` instead when exactly one option in a group can be selected.
|
|
|
1028
1043
|
|------|------|---------|
|
|
1029
1044
|
| `label` | `ReactNode` | — |
|
|
1030
1045
|
| `description` | `ReactNode` | — |
|
|
1031
|
-
| `size` | `"sm" \| "md" \| "lg"` | `"
|
|
1046
|
+
| `size` | `"sm" \| "md" \| "lg"` | `"sm"` |
|
|
1032
1047
|
| `error` | `boolean` | `false` |
|
|
1033
1048
|
| `checked` | `boolean \| "indeterminate"` | — |
|
|
1034
1049
|
| `onCheckedChange` | `(checked: boolean \| "indeterminate") => void` | — |
|
|
@@ -1511,6 +1526,8 @@ User avatar with image, initials fallback, and online status.
|
|
|
1511
1526
|
|
|
1512
1527
|
Table page navigation. Handles ellipsis, edge pages, optional page-size controls, and two navigation variants: `indexed` (Prev, page indexes like `1 2 3 ... 10`, Next) and `simple` (Prev / Next only).
|
|
1513
1528
|
|
|
1529
|
+
Default pagination matches the Figma table footer: 40px row, 20px horizontal padding, 26px controls, active page background `#64737E`, and page-size labels such as `15 Orders` when `itemLabel="Orders"`.
|
|
1530
|
+
|
|
1514
1531
|
```tsx
|
|
1515
1532
|
<TablePagination
|
|
1516
1533
|
page={currentPage}
|
|
@@ -1542,6 +1559,8 @@ Angular: `items-per-page-label` attribute.
|
|
|
1542
1559
|
|
|
1543
1560
|
Generic data table with sorting, loading skeleton, row actions, selection, pagination, and empty/error states.
|
|
1544
1561
|
|
|
1562
|
+
DataTable has one default visual density, matching the Figma orders table: 8px outer radius, strong `#D3DFD7` outer/header stroke, 46px header, 64px rows, 12px header/body type, 0.24px header letter spacing, 12px selection checkboxes, and a 146px sticky actions column headed `Actions`.
|
|
1563
|
+
|
|
1545
1564
|
```tsx
|
|
1546
1565
|
<DataTable
|
|
1547
1566
|
columns={[
|
|
@@ -1573,8 +1592,9 @@ Generic data table with sorting, loading skeleton, row actions, selection, pagin
|
|
|
1573
1592
|
| `enableColumnReordering` | `boolean` | `true` |
|
|
1574
1593
|
| `onRowClick` | `(row: T) => void` | — |
|
|
1575
1594
|
| `rowActions` | `(row: T) => ReactNode` | — |
|
|
1595
|
+
| `rowActionsHeader` | `ReactNode` | `"Actions"` |
|
|
1596
|
+
| `rowActionsWidth` | `number \| string` | `146` |
|
|
1576
1597
|
| `selection` | `boolean` | `false` |
|
|
1577
|
-
| `density` | `"compact" \| "default" \| "comfortable"` | `"default"` |
|
|
1578
1598
|
| `emptyTitle` | `ReactNode` | `"No records found"` |
|
|
1579
1599
|
| `emptyDescription` | `ReactNode` | — |
|
|
1580
1600
|
| `defaultSorting` | `{ columnId: string; direction: "asc" \| "desc" } \| null` | `null` |
|
|
@@ -1854,6 +1874,8 @@ Navigation trail. Last item is rendered as plain text (current page).
|
|
|
1854
1874
|
|
|
1855
1875
|
Standardized page title section. Use at the top of every page.
|
|
1856
1876
|
|
|
1877
|
+
Default chrome matches the Shiprocket 4.0 page row: 52px minimum height, `#FBFCFB` background, strong bottom divider, and a 20px semibold title.
|
|
1878
|
+
|
|
1857
1879
|
```tsx
|
|
1858
1880
|
<PageHeader
|
|
1859
1881
|
eyebrow="Orders"
|
|
@@ -1899,7 +1921,7 @@ Full-page app shell with sticky header and collapsible sidebar.
|
|
|
1899
1921
|
|
|
1900
1922
|
#### `WorkspaceHeader`
|
|
1901
1923
|
|
|
1902
|
-
Slot-based top bar for Agentic Platform workspaces. It preserves the
|
|
1924
|
+
Slot-based top bar for Agentic Platform workspaces. It preserves the Shiprocket 4.0 Figma chrome by default: 52px header height, 216px brand rail, 380px chat/workspace rail, 280px search slot, strong dividers, and compact 26px sidebar toggle. Product-specific brand, tab title/collapse controls, search internals, wallet, launcher, and avatar remain app-owned slots.
|
|
1903
1925
|
|
|
1904
1926
|
```tsx
|
|
1905
1927
|
<WorkspaceHeader
|
|
@@ -1924,7 +1946,7 @@ Slot-based top bar for Agentic Platform workspaces. It preserves the standalone
|
|
|
1924
1946
|
| `tabsCollapsed` | `boolean` | `false` |
|
|
1925
1947
|
| `collapsedTabsWidth` | `number` | `40` |
|
|
1926
1948
|
| `search` | `ReactNode` | — |
|
|
1927
|
-
| `searchWidth` | `number` | `
|
|
1949
|
+
| `searchWidth` | `number` | `280` |
|
|
1928
1950
|
| `actions` | `ReactNode` | — |
|
|
1929
1951
|
| `children` | `ReactNode` | — |
|
|
1930
1952
|
| `height` | `number` | `52` |
|
|
@@ -1937,6 +1959,8 @@ Use `brandCollapsed` and `tabsCollapsed` to mirror the standalone collapsed side
|
|
|
1937
1959
|
|
|
1938
1960
|
Collapsible application sidebar navigation. Renders grouped sections of items with active state, badges, and hover flyouts for nested items, plus `header`, `footer`, and `children` slots. All data (labels, icons, handlers) is passed in — the component owns layout and collapse behavior.
|
|
1939
1961
|
|
|
1962
|
+
Expanded default width is 216px. Rows are 32px high with 8px radius, 12px labels, and active rows use the soft `#F6F9F6` surface.
|
|
1963
|
+
|
|
1940
1964
|
```tsx
|
|
1941
1965
|
<SideNav
|
|
1942
1966
|
collapsed={collapsed}
|
|
@@ -1959,7 +1983,7 @@ Collapsible application sidebar navigation. Renders grouped sections of items wi
|
|
|
1959
1983
|
|------|------|---------|
|
|
1960
1984
|
| `sections` | `SideNavSection[]` | **required** |
|
|
1961
1985
|
| `collapsed` | `boolean` | `false` |
|
|
1962
|
-
| `width` | `number` | `
|
|
1986
|
+
| `width` | `number` | `216` |
|
|
1963
1987
|
| `collapsedWidth` | `number` | `56` |
|
|
1964
1988
|
| `header` | `ReactNode` | — |
|
|
1965
1989
|
| `children` | `ReactNode` | — |
|
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ Most DOM-backed components forward compatible React props such as `onClick`, `on
|
|
|
57
57
|
|
|
58
58
|
Library-owned Tailwind utilities are prefixed with `bfrs-`, for example `bfrs-flex`, `hover:bfrs-bg-primary`, and `bfrs-animate-shimmer`. Unprefixed classes passed through `className` are treated as host-app classes.
|
|
59
59
|
|
|
60
|
-
Size-aware controls support `sm`, `md`, and `lg
|
|
60
|
+
Size-aware controls support `xs`, `sm`, `md`, and `lg` where applicable. Text inputs and select-family triggers render at the Figma 28px field height; button-like controls keep their own compact scale by component family.
|
|
61
61
|
|
|
62
62
|
## Angular Usage
|
|
63
63
|
|
|
@@ -257,6 +257,7 @@ save() {
|
|
|
257
257
|
|
|
258
258
|
DataTable also accepts declarative `leadingColumn`, `rowActions`,
|
|
259
259
|
`rowClassRules`, `rowIdKey`, `accessorPath`, and `sortValueKey` configuration.
|
|
260
|
+
The default table chrome matches Shiprocket 4.0 Figma: 8px outer radius, strong `#D3DFD7` outer/header stroke, 46px header, 64px rows, 12px text, 12px selection checkboxes, and a 146px sticky actions column headed `Actions`.
|
|
260
261
|
The standalone helpers are available as `bfrs-table-toolbar`,
|
|
261
262
|
`bfrs-table-empty-state`, `bfrs-table-error-state`, `bfrs-table-skeleton`,
|
|
262
263
|
`bfrs-table-row-actions`, `bfrs-table-bulk-actions`, and
|
|
@@ -351,6 +352,7 @@ Keep form validation and API checks in the app. Render field errors below inputs
|
|
|
351
352
|
### DateRangePicker
|
|
352
353
|
|
|
353
354
|
Use `DateRangePicker` for preset and custom date-range filters. Keep API date formatting in the consuming app.
|
|
355
|
+
The trigger uses the neutral compact secondary control by default so it aligns with filter bar dropdowns.
|
|
354
356
|
|
|
355
357
|
```tsx
|
|
356
358
|
import { DateRangePicker, presetToRange, type DateRangeValue } from "@bfrs/agentic-components";
|
|
@@ -384,6 +386,7 @@ function SaveButton() {
|
|
|
384
386
|
### Checkbox
|
|
385
387
|
|
|
386
388
|
Use `Checkbox` for independent true/false decisions or multi-select choices. It renders as a square checklist control, while `Radio` renders circular options for single-choice groups. Both support primary text plus secondary description text.
|
|
389
|
+
The default checkbox is the compact 12px Shiprocket 4.0 control with secondary stroke and 2.5px radius.
|
|
387
390
|
|
|
388
391
|
```tsx
|
|
389
392
|
import { Checkbox, Radio } from "@bfrs/agentic-components";
|
|
@@ -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,
|
|
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;
|
|
@@ -98,7 +98,6 @@ export type DataTableProps<Row> = {
|
|
|
98
98
|
* prop to keep the footer fixed below the scroll area.
|
|
99
99
|
*/
|
|
100
100
|
maxHeight?: number | string;
|
|
101
|
-
density?: TableDensity;
|
|
102
101
|
className?: string;
|
|
103
102
|
tableClassName?: string;
|
|
104
103
|
headerClassName?: string;
|
|
@@ -145,7 +144,6 @@ export type TableStateProps = {
|
|
|
145
144
|
export type TableSkeletonProps = {
|
|
146
145
|
rows?: number;
|
|
147
146
|
columns?: number;
|
|
148
|
-
density?: TableDensity;
|
|
149
147
|
colSpan?: number;
|
|
150
148
|
};
|
|
151
149
|
export type TableRowActionsProps<Row> = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableSkeletonProps } from './DataTable.types';
|
|
2
|
-
export declare function TableSkeleton({ rows, columns,
|
|
2
|
+
export declare function TableSkeleton({ rows, columns, colSpan }: TableSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonVariant } from '../../../primitives/Button';
|
|
3
3
|
import { SelectMenuWidth, SelectOption } from '../Select';
|
|
4
|
-
export type MultiSelectSize = "sm" | "md" | "lg";
|
|
5
4
|
/**
|
|
6
5
|
* When the value is committed back to the consumer via `onValueChange`:
|
|
7
6
|
* - `"change"` (default) — on every toggle, immediately.
|
|
@@ -25,8 +24,6 @@ export type MultiSelectProps = {
|
|
|
25
24
|
error?: boolean;
|
|
26
25
|
clearable?: boolean;
|
|
27
26
|
maxVisibleValues?: number;
|
|
28
|
-
/** Trigger size. Defaults to `"md"`. */
|
|
29
|
-
size?: MultiSelectSize;
|
|
30
27
|
/** Option popover width relative to the trigger. Defaults to `"auto"` (the
|
|
31
28
|
* popover grows to fit its content and can be wider than the trigger). */
|
|
32
29
|
menuWidth?: SelectMenuWidth;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SelectMenuWidth, SelectOption } from '../Select';
|
|
2
|
-
export type SearchableSelectSize = "sm" | "md" | "lg";
|
|
3
2
|
export type SearchableSelectProps = {
|
|
4
3
|
options: SelectOption[];
|
|
5
4
|
value?: string;
|
|
@@ -11,8 +10,6 @@ export type SearchableSelectProps = {
|
|
|
11
10
|
disabled?: boolean;
|
|
12
11
|
error?: boolean;
|
|
13
12
|
clearable?: boolean;
|
|
14
|
-
/** Trigger size. Defaults to `"md"`. */
|
|
15
|
-
size?: SearchableSelectSize;
|
|
16
13
|
/** Option popover width relative to the trigger. Defaults to `"auto"`. */
|
|
17
14
|
menuWidth?: SelectMenuWidth;
|
|
18
15
|
className?: string;
|
|
@@ -24,7 +24,9 @@ export type SelectProps = {
|
|
|
24
24
|
onValueChange?: (value: string) => void;
|
|
25
25
|
options: SelectOption[];
|
|
26
26
|
placeholder?: string;
|
|
27
|
-
|
|
27
|
+
open?: boolean;
|
|
28
|
+
defaultOpen?: boolean;
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
28
30
|
/** Option popover width relative to the trigger. Defaults to `"auto"`. */
|
|
29
31
|
menuWidth?: SelectMenuWidth;
|
|
30
32
|
disabled?: boolean;
|
|
@@ -5,4 +5,5 @@ export declare const popoverContentCollisionClassName = "bfrs-max-h-[min(32rem,v
|
|
|
5
5
|
export declare const selectContentCollisionClassName = "bfrs-max-h-[min(20rem,var(--radix-select-content-available-height))]";
|
|
6
6
|
export declare const searchableSelectContentCollisionClassName = "bfrs-max-h-[min(18rem,var(--radix-popover-content-available-height))] bfrs-w-[var(--radix-popover-trigger-width)] bfrs-overflow-hidden";
|
|
7
7
|
export declare const searchableSelectListboxCollisionClassName = "bfrs-max-h-[min(14rem,max(4rem,calc(var(--radix-popover-content-available-height)-3rem)))] bfrs-overflow-auto";
|
|
8
|
+
export declare const multiSelectListboxCollisionClassName = "bfrs-min-h-0 bfrs-flex-1 bfrs-max-h-[min(14rem,max(3rem,calc(var(--radix-popover-content-available-height)-6.5rem)))] bfrs-overflow-auto";
|
|
8
9
|
export declare const tooltipContentCollisionClassName = "bfrs-max-w-[min(16rem,var(--radix-tooltip-content-available-width))]";
|
|
@@ -125,7 +125,6 @@ export type BfrsCustomElementRegistryOptions = {
|
|
|
125
125
|
declare abstract class ReactCustomElement extends HTMLElement {
|
|
126
126
|
private root;
|
|
127
127
|
private mountNode;
|
|
128
|
-
private shadow;
|
|
129
128
|
private initialText;
|
|
130
129
|
private initialHtml;
|
|
131
130
|
private hasCapturedInitialContent;
|