@bfrs/agentic-components 0.1.9 → 0.2.1
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 +19 -1
- package/README.md +18 -0
- package/dist/components/ui/index.d.ts +3 -0
- package/dist/components/ui/patterns/CommandMenu/CommandMenu.d.ts +47 -0
- package/dist/components/ui/patterns/CommandMenu/index.d.ts +1 -0
- package/dist/components/ui/patterns/SideNav/SideNav.d.ts +52 -0
- package/dist/components/ui/patterns/SideNav/index.d.ts +1 -0
- package/dist/components/ui/patterns/WorkspaceHeader/WorkspaceHeader.d.ts +35 -0
- package/dist/components/ui/patterns/WorkspaceHeader/index.d.ts +1 -0
- package/dist/custom-elements.d.ts +28 -0
- package/dist/custom-elements.js +9925 -9537
- package/dist/custom-elements.js.map +1 -1
- package/dist/index.js +2616 -2368
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -44,6 +44,17 @@ import "@bfrs/agentic-components/custom-elements";
|
|
|
44
44
|
@import "@bfrs/agentic-components/styles";
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
If Angular does not resolve the package style export, add the built CSS file in `angular.json`:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"styles": [
|
|
52
|
+
"node_modules/@bfrs/agentic-components/dist/style.css",
|
|
53
|
+
"src/styles.scss"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
47
58
|
Add `CUSTOM_ELEMENTS_SCHEMA` where the tags are rendered:
|
|
48
59
|
|
|
49
60
|
```ts
|
|
@@ -64,11 +75,18 @@ export class AgenticExampleComponent {
|
|
|
64
75
|
}
|
|
65
76
|
```
|
|
66
77
|
|
|
78
|
+
Use native Angular DOM event bindings for interactions. Do not pass React-style `onClick` in Angular templates:
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<bfrs-button variant="primary" (click)="continue()">Continue</bfrs-button>
|
|
82
|
+
<bfrs-paper (click)="openDetails()">Open details</bfrs-paper>
|
|
83
|
+
```
|
|
84
|
+
|
|
67
85
|
Registered tags cover the documented component surface: `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-textarea`, `bfrs-select`, `bfrs-date-range-picker`, `bfrs-searchable-select`, `bfrs-checkbox`, `bfrs-radio`, `bfrs-switch`, `bfrs-badge`, `bfrs-chip`, `bfrs-alert`, `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`, and `bfrs-step-progress-card`.
|
|
68
86
|
|
|
69
87
|
Use attributes for simple props: `variant`, `size`, `tone`, `label`, `loading`, `disabled`, `required`, `error-message`, `helper-text`, `prefix`, `suffix`. Use `[props]` or the `props` JSON attribute for structured props like `options`, `items`, `columns`, `data`, `sections`, `steps`, and `toasts`.
|
|
70
88
|
|
|
71
|
-
Common
|
|
89
|
+
Common component events: `(value-change)`, `(checked-change)`, `(open-change)`, `(close)`, `(confirm)`, `(cancel)`, `(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`.
|
|
72
90
|
|
|
73
91
|
```html
|
|
74
92
|
<bfrs-select
|
package/README.md
CHANGED
|
@@ -56,6 +56,17 @@ import "@bfrs/agentic-components/custom-elements";
|
|
|
56
56
|
@import "@bfrs/agentic-components/styles";
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
If Angular does not resolve the package style export, add the built CSS file in `angular.json`:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"styles": [
|
|
64
|
+
"node_modules/@bfrs/agentic-components/dist/style.css",
|
|
65
|
+
"src/styles.scss"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
59
70
|
Add `CUSTOM_ELEMENTS_SCHEMA` to the module or standalone component that renders the tags:
|
|
60
71
|
|
|
61
72
|
```ts
|
|
@@ -76,6 +87,13 @@ export class ExampleComponent {
|
|
|
76
87
|
}
|
|
77
88
|
```
|
|
78
89
|
|
|
90
|
+
Use native Angular DOM event bindings for interactions. Do not pass React-style `onClick` in Angular templates:
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<bfrs-button variant="primary" (click)="continue()">Continue</bfrs-button>
|
|
94
|
+
<bfrs-paper (click)="openDetails()">Open details</bfrs-paper>
|
|
95
|
+
```
|
|
96
|
+
|
|
79
97
|
The custom-elements entrypoint registers Angular-friendly tags for the documented component surface, including layout, forms, feedback, overlays, filters, data display, navigation, and agentic pattern components.
|
|
80
98
|
|
|
81
99
|
Use simple attributes for primitive values and `[props]` for structured values or callback-capable advanced props:
|
|
@@ -51,3 +51,6 @@ export * from './patterns/ChatComposer';
|
|
|
51
51
|
export * from './patterns/FullPageLoader';
|
|
52
52
|
export * from './patterns/BusinessInfoDisplayCard';
|
|
53
53
|
export * from './patterns/StepProgressCard';
|
|
54
|
+
export * from './patterns/CommandMenu';
|
|
55
|
+
export * from './patterns/WorkspaceHeader';
|
|
56
|
+
export * from './patterns/SideNav';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type CommandMenuTone = "neutral" | "primary" | "success" | "warning" | "danger" | "info";
|
|
3
|
+
export type CommandMenuItem = {
|
|
4
|
+
/** Stable id for the item. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Primary label, e.g. a command name. */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/** Secondary description line. */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** Leading icon node, rendered inside a tinted square. */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** Extra text used for filtering (in addition to a string `label`). */
|
|
13
|
+
keywords?: string;
|
|
14
|
+
/** Optional trailing status badge. */
|
|
15
|
+
status?: {
|
|
16
|
+
label: ReactNode;
|
|
17
|
+
tone?: CommandMenuTone;
|
|
18
|
+
};
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type CommandMenuProps = {
|
|
22
|
+
/** Items to render. */
|
|
23
|
+
items: CommandMenuItem[];
|
|
24
|
+
/** Current filter query. When set and `filter` is not false, items are filtered. */
|
|
25
|
+
query?: string;
|
|
26
|
+
/** Optional uppercase title shown above the list. */
|
|
27
|
+
title?: ReactNode;
|
|
28
|
+
/** Text shown when no items match. */
|
|
29
|
+
emptyText?: ReactNode;
|
|
30
|
+
/** Whether to internally filter `items` by `query`. Defaults to true. */
|
|
31
|
+
filter?: boolean;
|
|
32
|
+
/** Called when an item is selected. */
|
|
33
|
+
onSelect?: (item: CommandMenuItem) => void;
|
|
34
|
+
className?: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Searchable command / option palette. Renders a floating-style surface with a
|
|
38
|
+
* list of icon + label + description rows and optional status badges. Filtering
|
|
39
|
+
* is internal by default; pass `filter={false}` to control the list yourself.
|
|
40
|
+
*
|
|
41
|
+
* The component is position-agnostic — wrap it (or pass `className`) to place it
|
|
42
|
+
* as a popover above an input, in a dropdown, etc.
|
|
43
|
+
*/
|
|
44
|
+
export declare function CommandMenu({ items, query, title, emptyText, filter, onSelect, className }: CommandMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare namespace CommandMenu {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CommandMenu';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export type SideNavSubItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
onSelect?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export type SideNavItem = {
|
|
8
|
+
id: string;
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
/** Leading icon node. */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
/** Trailing badge/slot (hidden when collapsed). */
|
|
14
|
+
badge?: ReactNode;
|
|
15
|
+
/** Hover flyout entries. When present, clicking the row does not call `onSelect`. */
|
|
16
|
+
nested?: SideNavSubItem[];
|
|
17
|
+
onSelect?: () => void;
|
|
18
|
+
};
|
|
19
|
+
export type SideNavSection = {
|
|
20
|
+
id?: string;
|
|
21
|
+
/** Uppercase section title (hidden when collapsed). */
|
|
22
|
+
title?: ReactNode;
|
|
23
|
+
items: SideNavItem[];
|
|
24
|
+
/** Optional action row shown under the items (e.g. "Create new"). Hidden when collapsed. */
|
|
25
|
+
action?: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
export type SideNavProps = {
|
|
28
|
+
sections: SideNavSection[];
|
|
29
|
+
collapsed?: boolean;
|
|
30
|
+
/** Expanded width in px. Defaults to 240. */
|
|
31
|
+
width?: number;
|
|
32
|
+
/** Collapsed width in px. Defaults to 56. */
|
|
33
|
+
collapsedWidth?: number;
|
|
34
|
+
/** Top slot, above the scrollable nav (e.g. a primary CTA). */
|
|
35
|
+
header?: ReactNode;
|
|
36
|
+
/** Extra content rendered inside the scroll area after the sections (e.g. a recents list). */
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
/** Bottom slot (e.g. user + settings). */
|
|
39
|
+
footer?: ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
style?: CSSProperties;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Collapsible application sidebar navigation. Renders grouped sections of items
|
|
45
|
+
* with active state, optional badges, and hover flyouts for nested items, plus
|
|
46
|
+
* dedicated `header` and `footer` slots. All data (labels, icons, handlers) is
|
|
47
|
+
* passed in — the component owns layout, collapse behavior, and chrome only.
|
|
48
|
+
*/
|
|
49
|
+
export declare function SideNav({ sections, collapsed, width, collapsedWidth, header, children, footer, className, style }: SideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare namespace SideNav {
|
|
51
|
+
var displayName: string;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SideNav';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export type WorkspaceHeaderProps = {
|
|
3
|
+
/** Brand block (logo + product name) rendered at the far left. */
|
|
4
|
+
brand?: ReactNode;
|
|
5
|
+
/** Fixed width (px) for the brand rail, e.g. to align with a sidebar. Auto when omitted. */
|
|
6
|
+
brandWidth?: number;
|
|
7
|
+
/** When provided, renders a sidebar-toggle button next to the brand. */
|
|
8
|
+
onToggleSidebar?: () => void;
|
|
9
|
+
/** Accessible label for the sidebar-toggle button. */
|
|
10
|
+
toggleLabel?: string;
|
|
11
|
+
/** Optional tab strip, rendered as its own bordered column after the brand. */
|
|
12
|
+
tabs?: ReactNode;
|
|
13
|
+
/** Fixed width (px) for the tabs column, e.g. to align with a secondary pane. Auto when omitted. */
|
|
14
|
+
tabsWidth?: number;
|
|
15
|
+
/** Search control, placed at the start of the trailing actions area. */
|
|
16
|
+
search?: ReactNode;
|
|
17
|
+
/** Trailing action controls (wallet, apps, avatar, …). */
|
|
18
|
+
actions?: ReactNode;
|
|
19
|
+
/** Free-form content placed in the main (flex) region before the spacer. */
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
/** Header height in px. Defaults to 52. */
|
|
22
|
+
height?: number;
|
|
23
|
+
className?: string;
|
|
24
|
+
style?: CSSProperties;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Application top bar for workspace-style layouts. Slot-based: drop in a brand
|
|
28
|
+
* block, an optional sidebar toggle, a tab strip, a search control, and trailing
|
|
29
|
+
* actions. All product-specific logic (which tabs exist, wallet balance, etc.)
|
|
30
|
+
* stays in the consuming app — this component only owns layout and chrome.
|
|
31
|
+
*/
|
|
32
|
+
export declare function WorkspaceHeader({ brand, brandWidth, onToggleSidebar, toggleLabel, tabs, tabsWidth, search, actions, children, height, className, style }: WorkspaceHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace WorkspaceHeader {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WorkspaceHeader';
|
|
@@ -5,8 +5,11 @@ export type BfrsCustomElementRegistryOptions = {
|
|
|
5
5
|
};
|
|
6
6
|
declare abstract class ReactCustomElement extends HTMLElement {
|
|
7
7
|
private root;
|
|
8
|
+
private mountNode;
|
|
8
9
|
private initialText;
|
|
9
10
|
private initialHtml;
|
|
11
|
+
private hasCapturedInitialContent;
|
|
12
|
+
private initialRenderQueued;
|
|
10
13
|
private propertyProps;
|
|
11
14
|
get props(): UnknownProps;
|
|
12
15
|
set props(value: UnknownProps);
|
|
@@ -31,6 +34,9 @@ declare abstract class ReactCustomElement extends HTMLElement {
|
|
|
31
34
|
protected objectValue<Value extends UnknownProps>(name: string, fallback: Value): Value;
|
|
32
35
|
protected emit(name: string, detail?: unknown): void;
|
|
33
36
|
private applyDefaultDisplay;
|
|
37
|
+
private ensureMountNode;
|
|
38
|
+
private scheduleInitialUpdate;
|
|
39
|
+
private captureInitialContent;
|
|
34
40
|
}
|
|
35
41
|
declare abstract class ComponentCustomElement extends ReactCustomElement {
|
|
36
42
|
protected abstract component(): unknown;
|
|
@@ -352,6 +358,7 @@ export declare class BfrsFilterBarElement extends ReactCustomElement {
|
|
|
352
358
|
static readonly tagName = "filter-bar";
|
|
353
359
|
static get observedAttributes(): string[];
|
|
354
360
|
private searchValue;
|
|
361
|
+
attributeChangedCallback(name?: string, oldValue?: string | null, newValue?: string | null): void;
|
|
355
362
|
protected defaultDisplay(): string;
|
|
356
363
|
protected renderElement(): unknown;
|
|
357
364
|
}
|
|
@@ -415,6 +422,24 @@ export declare class BfrsStepProgressCardSkeletonElement extends ReactCustomElem
|
|
|
415
422
|
static get observedAttributes(): string[];
|
|
416
423
|
protected renderElement(): unknown;
|
|
417
424
|
}
|
|
425
|
+
export declare class BfrsCommandMenuElement extends ReactCustomElement {
|
|
426
|
+
static readonly tagName = "command-menu";
|
|
427
|
+
static get observedAttributes(): string[];
|
|
428
|
+
protected defaultDisplay(): string;
|
|
429
|
+
protected renderElement(): unknown;
|
|
430
|
+
}
|
|
431
|
+
export declare class BfrsWorkspaceHeaderElement extends ReactCustomElement {
|
|
432
|
+
static readonly tagName = "workspace-header";
|
|
433
|
+
static get observedAttributes(): string[];
|
|
434
|
+
protected defaultDisplay(): string;
|
|
435
|
+
protected renderElement(): unknown;
|
|
436
|
+
}
|
|
437
|
+
export declare class BfrsSideNavElement extends ReactCustomElement {
|
|
438
|
+
static readonly tagName = "side-nav";
|
|
439
|
+
static get observedAttributes(): string[];
|
|
440
|
+
protected defaultDisplay(): string;
|
|
441
|
+
protected renderElement(): unknown;
|
|
442
|
+
}
|
|
418
443
|
export declare function defineBfrsAgenticElements(options?: BfrsCustomElementRegistryOptions): void;
|
|
419
444
|
declare global {
|
|
420
445
|
interface HTMLElementTagNameMap {
|
|
@@ -435,6 +460,7 @@ declare global {
|
|
|
435
460
|
"bfrs-chat-composer": BfrsChatComposerElement;
|
|
436
461
|
"bfrs-checkbox": BfrsCheckboxElement;
|
|
437
462
|
"bfrs-chip": BfrsChipElement;
|
|
463
|
+
"bfrs-command-menu": BfrsCommandMenuElement;
|
|
438
464
|
"bfrs-confirm-dialog": BfrsConfirmDialogElement;
|
|
439
465
|
"bfrs-container": BfrsContainerElement;
|
|
440
466
|
"bfrs-data-table": BfrsDataTableElement;
|
|
@@ -467,6 +493,7 @@ declare global {
|
|
|
467
493
|
"bfrs-searchable-select": BfrsSearchableSelectElement;
|
|
468
494
|
"bfrs-section-header": BfrsSectionHeaderElement;
|
|
469
495
|
"bfrs-select": BfrsSelectElement;
|
|
496
|
+
"bfrs-side-nav": BfrsSideNavElement;
|
|
470
497
|
"bfrs-skeleton": BfrsSkeletonElement;
|
|
471
498
|
"bfrs-spinner": BfrsSpinnerElement;
|
|
472
499
|
"bfrs-stack": BfrsStackElement;
|
|
@@ -479,6 +506,7 @@ declare global {
|
|
|
479
506
|
"bfrs-textarea": BfrsTextareaElement;
|
|
480
507
|
"bfrs-toast-manager": BfrsToastManagerElement;
|
|
481
508
|
"bfrs-tooltip": BfrsTooltipElement;
|
|
509
|
+
"bfrs-workspace-header": BfrsWorkspaceHeaderElement;
|
|
482
510
|
}
|
|
483
511
|
}
|
|
484
512
|
export {};
|