@bfrs/agentic-components 0.6.5 → 0.6.6

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.
@@ -14,6 +14,19 @@ Install from the public npm registry:
14
14
  npm install @bfrs/agentic-components
15
15
  ```
16
16
 
17
+ During install, the package copies this file into the consuming project, updates `AGENTS.md` and `CLAUDE.md` with a reference to it, and wires the shared BFRS lint guard into `package.json`:
18
+
19
+ ```json
20
+ {
21
+ "scripts": {
22
+ "check:bfrs-agentic-lint": "bfrs-agentic-lint all",
23
+ "build": "bfrs-agentic-lint all && ..."
24
+ }
25
+ }
26
+ ```
27
+
28
+ The guard is shipped by the package as the `bfrs-agentic-lint` binary. It fails builds when app code bypasses the component library, uses raw color tokens, defines local components with library names, or overrides library styling through raw tag selectors, `:has()`, `.bfrs-*` / Emotion / Radix internals, structural attributes, library token declarations, or `!important`. Set `BFRS_AGENTIC_COMPONENTS_SKIP_SETUP=1` during install to skip automatic docs and lint script setup.
29
+
17
30
  ## Setup
18
31
 
19
32
  Import the stylesheet once at your app entry point:
@@ -58,7 +71,10 @@ import {
58
71
  DataTable,
59
72
  TableColumnVisibility,
60
73
  TableSaveView,
74
+ TableViewSelector,
61
75
  TableToolbar,
76
+ createLocalSaveView,
77
+ createLocalViewStore,
62
78
  DateRangePicker,
63
79
  ToastProvider,
64
80
  useToast
@@ -145,7 +161,7 @@ Registered tags cover the documented component surface, including
145
161
  `bfrs-button-group`, `bfrs-toast-provider`, `bfrs-table-toolbar`,
146
162
  `bfrs-table-empty-state`, `bfrs-table-error-state`, `bfrs-table-skeleton`,
147
163
  `bfrs-table-row-actions`, `bfrs-table-bulk-actions`,
148
- `bfrs-table-column-visibility`, and `bfrs-table-save-view` in addition to the existing component tags.
164
+ `bfrs-table-column-visibility`, `bfrs-table-save-view`, and `bfrs-table-view-selector` in addition to the existing component tags.
149
165
  Primitive table building blocks `bfrs-table`, `bfrs-thead`, `bfrs-tbody`, `bfrs-tfoot`,
150
166
  `bfrs-tr`, `bfrs-th`, and `bfrs-td` are also registered for custom layouts where `bfrs-data-table`
151
167
  is too prescriptive.
@@ -506,7 +522,7 @@ Standalone label. Prefer `FormField` which renders this automatically.
506
522
  Standard text input.
507
523
 
508
524
  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`).
509
- 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`.
525
+ Text-entry input boxes, affixed input chrome, and select-family triggers use a single active border without an additional focus outline/ring. Open select popovers keep that same visual state through `aria-expanded`.
510
526
 
511
527
  ```tsx
512
528
  <Input
@@ -560,7 +576,7 @@ Accepts all native `<textarea>` props.
560
576
  Single-value dropdown. Options are `{ value: string; label: string }`.
561
577
 
562
578
  The Figma trigger style is the only select size: 28px high with 12.5px text, 7px radius, and a 10px chevron.
563
- The trigger chevron rotates 180deg while open. This open/close motion and focused/open border treatment is shared by `Select`, `SearchableSelect`, and `MultiSelect`.
579
+ The trigger chevron rotates 180deg while open. This open/close motion and focused/open single-border treatment is shared by `Select`, `SearchableSelect`, and `MultiSelect`.
564
580
  Selected option rows render with bold text across select-style listboxes: `Select`, `SearchableSelect`, `MultiSelect`, and `SuggestInput`.
565
581
 
566
582
  ```tsx
@@ -1722,20 +1738,48 @@ For pinned columns, declare `width` / `minWidth` for predictable layout. `DataTa
1722
1738
 
1723
1739
  When `loading` is true, `DataTable` renders built-in table-row skeleton placeholders rather than a spinner. The consumer app only owns the loading boolean.
1724
1740
 
1725
- Use `TableSaveView` with `TableColumnVisibility` when the user changes columns or filters and needs to save the draft as a named view. It opens the "Save this view" modal, collects the view name, summarizes settings like hidden columns, and calls `onSave({ name, visibleColumnIds, hiddenColumnCount, filtersCount, appliedSettingLabels })`; persistence remains app-owned.
1741
+ 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
+
1743
+ ```tsx
1744
+ const screenName = "orders.list";
1745
+ const saveCurrentView = createLocalSaveView(screenName);
1746
+
1747
+ <ListPageLayout
1748
+ title="Orders"
1749
+ filters={
1750
+ <>
1751
+ <TableViewSelector
1752
+ screenName={screenName}
1753
+ onValueChange={(_, view) => {
1754
+ if (!view) return;
1755
+ setVisibleColumnIds(view.columns.filter((column) => column.visible).map((column) => column.key));
1756
+ setFilters(view.filters ?? []);
1757
+ }}
1758
+ />
1759
+ <Select size="sm" value={status} onValueChange={setStatus} options={statusOptions} />
1760
+ <TableSaveView
1761
+ viewType={screenName}
1762
+ columns={visibilityColumns}
1763
+ visibleColumnIds={visibleColumnIds}
1764
+ filters={filters}
1765
+ filtersCount={filters.length}
1766
+ onSave={saveCurrentView}
1767
+ />
1768
+ </>
1769
+ }
1770
+ table={<DataTable data={orders} columns={columns} visibleColumnIds={visibleColumnIds} />}
1771
+ />
1772
+ ```
1773
+
1774
+ Use `createLocalViewStore(screenName, { saveApi })` instead of `createLocalSaveView(screenName)` when save should call the library API adapter first and then mirror the saved view in localStorage. The selector's rename/delete/primary actions remain local unless you pass a custom `ViewStore`.
1775
+
1776
+ Column visibility still belongs in `TableToolbar`; keep that table-local save/discard flow separate from saved-view listing controls.
1726
1777
 
1727
1778
  ```tsx
1728
1779
  <TableToolbar
1729
1780
  title="Orders"
1730
1781
  actions={
1731
1782
  <div className="bfrs-flex bfrs-items-center bfrs-gap-2">
1732
- {dirty && (
1733
- <TableSaveView
1734
- columns={visibilityColumns}
1735
- visibleColumnIds={visibleColumnIds}
1736
- onSave={({ visibleColumnIds: nextSavedIds }) => setSavedColumnIds(nextSavedIds)}
1737
- />
1738
- )}
1739
1783
  <TableColumnVisibility
1740
1784
  columns={visibilityColumns}
1741
1785
  visibleColumnIds={visibleColumnIds}
@@ -1747,7 +1791,7 @@ Use `TableSaveView` with `TableColumnVisibility` when the user changes columns o
1747
1791
  />
1748
1792
  ```
1749
1793
 
1750
- Angular custom-element consumers can use `<bfrs-table-save-view>` and listen for `(save-view)` with the same payload.
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.
1751
1795
 
1752
1796
  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`.
1753
1797
 
package/README.md CHANGED
@@ -20,6 +20,19 @@ During install, the package writes `BFRS_AGENTIC_COMPONENTS.md` into the consumi
20
20
  Use BFRS_AGENTIC_COMPONENTS.md for knowledge regarding the component library.
21
21
  ```
22
22
 
23
+ The same install hook also wires the shared BFRS lint guard into the consumer package:
24
+
25
+ ```json
26
+ {
27
+ "scripts": {
28
+ "check:bfrs-agentic-lint": "bfrs-agentic-lint all",
29
+ "build": "bfrs-agentic-lint all && ..."
30
+ }
31
+ }
32
+ ```
33
+
34
+ The guard fails builds when app code bypasses the component library, uses raw color tokens, defines local components with library names, or overrides library styling through raw tag selectors, `:has()`, `.bfrs-*` / Emotion / Radix internals, structural attributes, library token declarations, or `!important`. Set `BFRS_AGENTIC_COMPONENTS_SKIP_SETUP=1` during install to skip automatic docs and lint script setup.
35
+
23
36
  ## React Usage
24
37
 
25
38
  ```tsx
@@ -41,4 +41,4 @@ export type TableViewSelectorProps = {
41
41
  contentClassName?: string;
42
42
  actionMenuClassName?: string;
43
43
  };
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;
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;