@bfrs/agentic-components 0.3.3 → 0.3.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.
@@ -119,7 +119,7 @@ Registered tags cover the documented component surface: `bfrs-box`, `bfrs-contai
119
119
 
120
120
  Use attributes for simple props: `variant`, `size`, `tone`, `label`, `loading`, `disabled`, `required`, `error-message`, `error-text`, `helper-text`, `prefix`, `suffix`, `min`, `max`, `step`, and `value`. Use `[props]` or the `props` JSON attribute for structured props like `options`, palette arrays, `items`, `columns`, `data`, `sections`, `steps`, and `toasts`.
121
121
 
122
- Common component events: `(value-change)`, `(checked-change)`, `(open-change)`, `(reveal-change)`, `(copy)`, `(copy-error)`, `(close)`, `(confirm)`, `(cancel)`, `(cell-action)`, `(row-click)`, `(sort-change)`, `(page-change)`, `(page-size-change)`, `(action-select)`, `(dropdown-select)`, `(date-range-change)`, `(search-change)`, `(open-filters)`, `(apply)`, `(reset)`, and `(submit)`. Payloads are available on `$event.detail`.
122
+ Common component events: `(value-change)`, `(checked-change)`, `(open-change)`, `(reveal-change)`, `(copy)`, `(copy-error)`, `(close)`, `(confirm)`, `(cancel)`, `(cell-action)`, `(cell-event)`, `(row-click)`, `(sort-change)`, `(page-change)`, `(page-size-change)`, `(action-select)`, `(dropdown-select)`, `(date-range-change)`, `(search-change)`, `(open-filters)`, `(apply)`, `(reset)`, and `(submit)`. Payloads are available on `$event.detail`.
123
123
 
124
124
  For validated forms, keep client validation, API validation, and submit side effects in the consuming app. In React, pass field errors through `FormField errorText` and set `Input error`. In Angular, use `bfrs-input` with `[attr.error]` and `[attr.error-message]`, listen to `(value-change)`, and manage success/failure notifications with `bfrs-toast-manager`.
125
125
 
@@ -1318,6 +1318,72 @@ Custom-element DataTable action cells must be declarative because Angular/HTML c
1318
1318
  </bfrs-data-table>
1319
1319
  ```
1320
1320
 
1321
+ Angular/HTML consumers can also render framework-neutral rich cells with
1322
+ `cellType: "text" | "chip" | "chips" | "badge" | "badges" | "image" |
1323
+ "avatar" | "link" | "custom-element"`. Configure them through the serializable
1324
+ `cellConfig` object:
1325
+
1326
+ ```ts
1327
+ columns = [
1328
+ {
1329
+ id: "status",
1330
+ header: "Status",
1331
+ accessorKey: "status",
1332
+ cellType: "chip",
1333
+ cellConfig: {
1334
+ caption: "Current status",
1335
+ labelKey: "status",
1336
+ toneKey: "statusTone"
1337
+ }
1338
+ },
1339
+ {
1340
+ id: "tags",
1341
+ header: "Tags",
1342
+ cellType: "chips",
1343
+ cellConfig: {
1344
+ itemsKey: "tags",
1345
+ itemLabelKey: "label",
1346
+ itemToneKey: "tone"
1347
+ }
1348
+ },
1349
+ {
1350
+ id: "channel",
1351
+ header: "Channel",
1352
+ cellType: "image",
1353
+ cellConfig: {
1354
+ srcKey: "channel.logo",
1355
+ altKey: "channel.name",
1356
+ width: 32,
1357
+ height: 32
1358
+ }
1359
+ },
1360
+ {
1361
+ id: "customer",
1362
+ header: "Customer",
1363
+ cellType: "custom-element",
1364
+ cellConfig: {
1365
+ tagName: "customer-summary",
1366
+ attributeMap: {
1367
+ name: "customer.name",
1368
+ email: "customer.email"
1369
+ },
1370
+ propertyMap: {
1371
+ customerId: "customer.id"
1372
+ },
1373
+ events: ["open", "change"]
1374
+ }
1375
+ }
1376
+ ];
1377
+ ```
1378
+
1379
+ `caption`/`captionKey` adds a small label above any rich cell. Key fields
1380
+ support dot-separated row paths. For custom elements, register the hyphenated
1381
+ tag before the table renders. `attributeMap` sets scalar attributes,
1382
+ `propertyMap` assigns JavaScript properties, and `rowProperty` can pass the
1383
+ complete row when the nested custom element explicitly supports it. Raw HTML is
1384
+ not rendered. Listed custom-element events are re-emitted as `cell-event` with
1385
+ `{ eventName, detail, columnId, row, rowId, rowIndex }`.
1386
+
1321
1387
  ---
1322
1388
 
1323
1389
  ### Navigation
package/README.md CHANGED
@@ -150,6 +150,41 @@ orderColumns = [
150
150
  ];
151
151
  ```
152
152
 
153
+ Rich Angular/HTML cells use the same serializable column approach. Supported
154
+ `cellType` values are `text`, `chip`, `chips`, `badge`, `badges`, `image`,
155
+ `avatar`, `link`, `custom-element`, `button`, `buttons`, and `actions`.
156
+
157
+ ```ts
158
+ orderColumns = [
159
+ {
160
+ id: "status",
161
+ header: "Status",
162
+ accessorKey: "status",
163
+ cellType: "chip",
164
+ cellConfig: { caption: "Current status", labelKey: "status", toneKey: "statusTone" }
165
+ },
166
+ {
167
+ id: "channel",
168
+ header: "Channel",
169
+ cellType: "image",
170
+ cellConfig: { srcKey: "channelLogo", altKey: "channelName", width: 32, height: 32 }
171
+ },
172
+ {
173
+ id: "customer",
174
+ header: "Customer",
175
+ cellType: "custom-element",
176
+ cellConfig: {
177
+ tagName: "customer-summary",
178
+ attributeMap: { name: "customer.name", email: "customer.email" },
179
+ events: ["open"]
180
+ }
181
+ }
182
+ ];
183
+ ```
184
+
185
+ Registered custom-element events are re-emitted by `bfrs-data-table` as
186
+ `cell-event` with `{ eventName, detail, columnId, row, rowId, rowIndex }`.
187
+
153
188
  Registered tags include `bfrs-box`, `bfrs-container`, `bfrs-paper`, `bfrs-stack`, `bfrs-grid`, `bfrs-text`, `bfrs-icon`, `bfrs-button`, `bfrs-icon-button`, `bfrs-form-field`, `bfrs-label`, `bfrs-input`, `bfrs-slider`, `bfrs-color-picker`, `bfrs-color-swatch-group`, `bfrs-textarea`, `bfrs-select`, `bfrs-date-range-picker`, `bfrs-searchable-select`, `bfrs-multi-select`, `bfrs-suggest-input`, `bfrs-option-card-group`, `bfrs-selectable-chip-group`, `bfrs-number-stepper`, `bfrs-file-dropzone`, `bfrs-reveal-field`, `bfrs-checkbox`, `bfrs-radio`, `bfrs-switch`, `bfrs-badge`, `bfrs-chip`, `bfrs-alert`, `bfrs-info-card`, `bfrs-tip`, `bfrs-toast-manager`, `bfrs-spinner`, `bfrs-skeleton`, `bfrs-empty-state`, `bfrs-error-state`, `bfrs-loading-state`, `bfrs-modal`, `bfrs-drawer`, `bfrs-confirm-dialog`, `bfrs-dropdown`, `bfrs-tooltip`, `bfrs-popover`, `bfrs-avatar`, `bfrs-metric-card`, `bfrs-table-pagination`, `bfrs-data-table`, `bfrs-tabs`, `bfrs-breadcrumbs`, `bfrs-action-menu`, `bfrs-page-header`, `bfrs-section-header`, `bfrs-layout-shell`, `bfrs-form-section`, `bfrs-filter-bar`, `bfrs-filter-drawer`, `bfrs-chat-bubble`, `bfrs-chat-composer`, `bfrs-full-page-loader`, `bfrs-business-info-display-card`, `bfrs-collapsible`, `bfrs-accordion`, `bfrs-summary-bar`, `bfrs-entity-display-card`, `bfrs-reveal-and-copy`, and `bfrs-step-progress-card`.
154
189
 
155
190
  ## Theme Overrides
@@ -1,7 +1,93 @@
1
+ import { ButtonProps } from './components/primitives/Button';
2
+ import { BadgeProps } from './components/primitives/Badge';
3
+ import { ChipProps } from './components/primitives/Chip';
4
+ import { AvatarProps } from './components/ui/data-display/Avatar';
1
5
  import { ColorSwatchValue } from './components/ui/forms/ColorSwatchGroup';
6
+ import { DataTableColumn } from './components/data-display/DataTable';
2
7
  import { BfrsColorScheme } from './components/ui/providers/BfrsProvider';
3
8
  type UnknownProps = Record<string, unknown>;
4
9
  type CheckedValue = boolean | "indeterminate";
10
+ export type DataTableElementCellAction = {
11
+ id?: string;
12
+ label?: string;
13
+ labelKey?: string;
14
+ variant?: ButtonProps["variant"];
15
+ size?: ButtonProps["size"];
16
+ display?: "button" | "icon" | "menu";
17
+ iconName?: string;
18
+ iconNameKey?: string;
19
+ ariaLabel?: string;
20
+ disabled?: boolean;
21
+ disabledKey?: string;
22
+ destructive?: boolean;
23
+ };
24
+ export type DataTableElementCellConfig = {
25
+ /** Optional small label rendered above the cell content. */
26
+ caption?: string;
27
+ captionKey?: string;
28
+ /** Main display value. Falls back to the column accessor value. */
29
+ label?: string;
30
+ labelKey?: string;
31
+ valueKey?: string;
32
+ secondary?: string;
33
+ secondaryKey?: string;
34
+ /** Chip / badge presentation. Dynamic keys are resolved from the row. */
35
+ tone?: BadgeProps["tone"] | ChipProps["tone"];
36
+ toneKey?: string;
37
+ variant?: BadgeProps["variant"] | ChipProps["variant"];
38
+ variantKey?: string;
39
+ size?: BadgeProps["size"] | ChipProps["size"] | AvatarProps["size"];
40
+ sizeKey?: string;
41
+ dot?: boolean;
42
+ dotKey?: string;
43
+ /** Use plural cell types with arrays of primitive values or objects. */
44
+ itemsKey?: string;
45
+ itemLabelKey?: string;
46
+ itemValueKey?: string;
47
+ itemToneKey?: string;
48
+ /** Image / avatar presentation. */
49
+ src?: string;
50
+ srcKey?: string;
51
+ alt?: string;
52
+ altKey?: string;
53
+ name?: string;
54
+ nameKey?: string;
55
+ status?: AvatarProps["status"];
56
+ statusKey?: string;
57
+ width?: number | string;
58
+ height?: number | string;
59
+ rounded?: boolean;
60
+ /** Link presentation. */
61
+ href?: string;
62
+ hrefKey?: string;
63
+ target?: "_blank" | "_self" | "_parent" | "_top";
64
+ rel?: string;
65
+ /** Registered custom-element presentation. Native tags are intentionally rejected. */
66
+ tagName?: string;
67
+ properties?: UnknownProps;
68
+ propertyMap?: Record<string, string>;
69
+ attributes?: Record<string, unknown>;
70
+ attributeMap?: Record<string, string>;
71
+ text?: string;
72
+ textKey?: string;
73
+ events?: string[];
74
+ /** Optionally assign the complete row object to this property on the custom element. */
75
+ rowProperty?: string;
76
+ };
77
+ export type DataTableElementCellType = "text" | "chip" | "chips" | "badge" | "badges" | "image" | "avatar" | "link" | "custom-element" | "button" | "buttons" | "actions";
78
+ export type DataTableElementColumn = DataTableColumn<UnknownProps> & {
79
+ cellType?: DataTableElementCellType;
80
+ cellConfig?: DataTableElementCellConfig;
81
+ action?: DataTableElementCellAction;
82
+ actions?: DataTableElementCellAction[];
83
+ actionsDisplay?: "inline" | "menu";
84
+ actionId?: string;
85
+ actionLabel?: string;
86
+ actionVariant?: ButtonProps["variant"];
87
+ actionSize?: ButtonProps["size"];
88
+ iconName?: string;
89
+ ariaLabel?: string;
90
+ };
5
91
  export type BfrsCustomElementRegistryOptions = {
6
92
  prefix?: string;
7
93
  };
@@ -424,6 +510,9 @@ export declare class BfrsDataTableElement extends ReactCustomElement {
424
510
  protected defaultDisplay(): string;
425
511
  protected renderElement(): unknown;
426
512
  private normalizeColumn;
513
+ private cellConfigValue;
514
+ private renderCaptionedCell;
515
+ private renderRichCell;
427
516
  private dataTableRowId;
428
517
  private actionDisabled;
429
518
  private emitCellAction;