@bfrs/agentic-components 0.1.6 → 0.1.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 +55 -6
- package/README.md +65 -14
- package/dist/components/navigation/ActionMenu/ActionMenu.types.d.ts +1 -1
- package/dist/components/navigation/Tabs/Tabs.types.d.ts +1 -1
- package/dist/components/primitives/Badge/Badge.types.d.ts +1 -1
- package/dist/components/primitives/Button/Button.types.d.ts +1 -1
- package/dist/components/primitives/Chip/Chip.types.d.ts +1 -1
- package/dist/components/primitives/Input/Input.types.d.ts +1 -1
- package/dist/components/ui/patterns/BusinessInfoDisplayCard/BusinessInfoDisplayCard.d.ts +1 -1
- package/dist/components/ui/primitives/Icon/Icon.d.ts +1 -1
- package/dist/custom-elements.d.ts +484 -0
- package/dist/custom-elements.js +35471 -0
- package/dist/custom-elements.js.map +1 -0
- package/dist/index.js +2421 -2390
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tokens/sizes.d.ts +11 -1
- package/package.json +16 -3
|
@@ -8,12 +8,7 @@ correct, idiomatic UI code without guessing.
|
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```ini
|
|
14
|
-
registry=https://registry.npmjs.org/
|
|
15
|
-
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
|
16
|
-
```
|
|
11
|
+
Install from the public npm registry:
|
|
17
12
|
|
|
18
13
|
```bash
|
|
19
14
|
npm install @bfrs/agentic-components
|
|
@@ -35,6 +30,60 @@ import { Button, Input, Modal, DataTable, DateRangePicker, ToastProvider, useToa
|
|
|
35
30
|
|
|
36
31
|
**Peer dependencies required:** `react >= 18.2.0`, `react-dom >= 18.2.0`
|
|
37
32
|
|
|
33
|
+
### Angular / Custom Elements
|
|
34
|
+
|
|
35
|
+
Angular consumers should use the Custom Elements bridge instead of importing React components directly:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
// main.ts
|
|
39
|
+
import "@bfrs/agentic-components/custom-elements";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```scss
|
|
43
|
+
/* styles.scss */
|
|
44
|
+
@import "@bfrs/agentic-components/styles";
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Add `CUSTOM_ELEMENTS_SCHEMA` where the tags are rendered:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { CUSTOM_ELEMENTS_SCHEMA, Component } from "@angular/core";
|
|
51
|
+
|
|
52
|
+
@Component({
|
|
53
|
+
selector: "app-agentic-example",
|
|
54
|
+
standalone: true,
|
|
55
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
56
|
+
template: `
|
|
57
|
+
<bfrs-input label="Pickup pincode" (value-change)="pickup = $event.detail.value"></bfrs-input>
|
|
58
|
+
<bfrs-button variant="primary" (click)="continue()">Continue</bfrs-button>
|
|
59
|
+
`
|
|
60
|
+
})
|
|
61
|
+
export class AgenticExampleComponent {
|
|
62
|
+
pickup = "";
|
|
63
|
+
continue() {}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
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
|
+
|
|
69
|
+
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
|
+
|
|
71
|
+
Common Angular 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)`.
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<bfrs-select
|
|
75
|
+
placeholder="Channel"
|
|
76
|
+
[props]="{ options: channelOptions, value: channel }"
|
|
77
|
+
(value-change)="channel = $event.detail.value">
|
|
78
|
+
</bfrs-select>
|
|
79
|
+
|
|
80
|
+
<bfrs-data-table
|
|
81
|
+
[props]="{ data: orders, columns: orderColumns, selection: true }"
|
|
82
|
+
(row-click)="openOrder($event.detail.row)"
|
|
83
|
+
(sort-change)="sorting = $event.detail.sorting">
|
|
84
|
+
</bfrs-data-table>
|
|
85
|
+
```
|
|
86
|
+
|
|
38
87
|
---
|
|
39
88
|
|
|
40
89
|
## Design System Conventions
|
package/README.md
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
# Agentic Components
|
|
2
2
|
|
|
3
|
-
Production-grade
|
|
3
|
+
Production-grade component library for Shiprocket agentic interfaces. React consumers use the native React exports; Angular consumers use the packaged Custom Elements bridge.
|
|
4
4
|
|
|
5
5
|
- Repository: https://github.com/bfrs/agentic-components
|
|
6
|
-
- Showcase: https://
|
|
6
|
+
- Showcase: https://agentic-components.vercel.app/
|
|
7
7
|
- Package: `@bfrs/agentic-components`
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```ini
|
|
14
|
-
registry=https://registry.npmjs.org/
|
|
15
|
-
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Then install:
|
|
11
|
+
Install from the public npm registry:
|
|
19
12
|
|
|
20
13
|
```bash
|
|
21
14
|
npm install @bfrs/agentic-components
|
|
@@ -27,7 +20,7 @@ During install, the package writes `BFRS_AGENTIC_COMPONENTS.md` into the consumi
|
|
|
27
20
|
Use BFRS_AGENTIC_COMPONENTS.md for knowledge regarding the component library.
|
|
28
21
|
```
|
|
29
22
|
|
|
30
|
-
## Usage
|
|
23
|
+
## React Usage
|
|
31
24
|
|
|
32
25
|
```tsx
|
|
33
26
|
import "@bfrs/agentic-components/styles";
|
|
@@ -49,6 +42,60 @@ Most DOM-backed components forward compatible React props such as `onClick`, `on
|
|
|
49
42
|
|
|
50
43
|
Size-aware controls support `sm`, `md`, and `lg`. `sm` is the compact dashboard size for dense controls and filters.
|
|
51
44
|
|
|
45
|
+
## Angular Usage
|
|
46
|
+
|
|
47
|
+
Angular apps should import the custom element registry once and include the shared stylesheet globally:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
// main.ts
|
|
51
|
+
import "@bfrs/agentic-components/custom-elements";
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```scss
|
|
55
|
+
/* styles.scss */
|
|
56
|
+
@import "@bfrs/agentic-components/styles";
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Add `CUSTOM_ELEMENTS_SCHEMA` to the module or standalone component that renders the tags:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { CUSTOM_ELEMENTS_SCHEMA, Component } from "@angular/core";
|
|
63
|
+
|
|
64
|
+
@Component({
|
|
65
|
+
selector: "app-example",
|
|
66
|
+
standalone: true,
|
|
67
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
68
|
+
template: `
|
|
69
|
+
<bfrs-input label="Pickup pincode" (value-change)="pickup = $event.detail.value"></bfrs-input>
|
|
70
|
+
<bfrs-button variant="primary" (click)="continue()">Continue</bfrs-button>
|
|
71
|
+
`
|
|
72
|
+
})
|
|
73
|
+
export class ExampleComponent {
|
|
74
|
+
pickup = "";
|
|
75
|
+
continue() {}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
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
|
+
|
|
81
|
+
Use simple attributes for primitive values and `[props]` for structured values or callback-capable advanced props:
|
|
82
|
+
|
|
83
|
+
```html
|
|
84
|
+
<bfrs-select
|
|
85
|
+
placeholder="Channel"
|
|
86
|
+
[props]="{ options: channelOptions, value: channel }"
|
|
87
|
+
(value-change)="channel = $event.detail.value">
|
|
88
|
+
</bfrs-select>
|
|
89
|
+
|
|
90
|
+
<bfrs-data-table
|
|
91
|
+
[props]="{ data: orders, columns: orderColumns, selection: true }"
|
|
92
|
+
(row-click)="openOrder($event.detail.row)"
|
|
93
|
+
(sort-change)="sorting = $event.detail.sorting">
|
|
94
|
+
</bfrs-data-table>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
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-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`.
|
|
98
|
+
|
|
52
99
|
### DateRangePicker
|
|
53
100
|
|
|
54
101
|
Use `DateRangePicker` for preset and custom date-range filters. Keep API date formatting in the consuming app.
|
|
@@ -114,7 +161,7 @@ npm run build:demo
|
|
|
114
161
|
|
|
115
162
|
## Publishing
|
|
116
163
|
|
|
117
|
-
Package publishing is configured for npmjs
|
|
164
|
+
Package publishing is configured for npmjs public packages. Publish only through the controlled release flow:
|
|
118
165
|
|
|
119
166
|
```bash
|
|
120
167
|
npm run changeset
|
|
@@ -127,6 +174,10 @@ The `Publish Package` GitHub Action publishes to npmjs on version tags, publishe
|
|
|
127
174
|
|
|
128
175
|
## Showcase Deployment
|
|
129
176
|
|
|
130
|
-
The
|
|
177
|
+
The public documentation is hosted at https://agentic-components.vercel.app/.
|
|
178
|
+
|
|
179
|
+
The showcase build target is `dist-demo`:
|
|
131
180
|
|
|
132
|
-
|
|
181
|
+
```bash
|
|
182
|
+
npm run build:demo
|
|
183
|
+
```
|
|
@@ -10,7 +10,7 @@ export type TabItem = {
|
|
|
10
10
|
export type TabsProps = RadixTabs.TabsProps & {
|
|
11
11
|
items?: TabItem[];
|
|
12
12
|
variant?: "line" | "pill";
|
|
13
|
-
size?: "sm" | "md" | "lg";
|
|
13
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
14
14
|
listClassName?: string;
|
|
15
15
|
triggerClassName?: string;
|
|
16
16
|
contentClassName?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { Tone } from '../../../tokens';
|
|
3
|
-
export type BadgeSize = "sm" | "md" | "lg";
|
|
3
|
+
export type BadgeSize = "xs" | "sm" | "md" | "lg";
|
|
4
4
|
export type BadgeTone = Tone;
|
|
5
5
|
export type BadgeVariant = "default" | BadgeTone;
|
|
6
6
|
export type BadgeProps = HTMLAttributes<HTMLSpanElement> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export type ButtonVariant = "primary" | "secondary" | "tertiary" | "outline" | "ghost" | "destructive" | "danger" | "link";
|
|
3
|
-
export type ButtonSize = "sm" | "md" | "lg";
|
|
3
|
+
export type ButtonSize = "xs" | "sm" | "md" | "lg";
|
|
4
4
|
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
5
|
variant?: ButtonVariant;
|
|
6
6
|
size?: ButtonSize;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { Tone } from '../../../tokens';
|
|
3
|
-
export type ChipSize = "sm" | "md" | "lg";
|
|
3
|
+
export type ChipSize = "xs" | "sm" | "md" | "lg";
|
|
4
4
|
export type ChipVariant = "default" | "soft" | "outline" | "filled";
|
|
5
5
|
export type ChipProps = HTMLAttributes<HTMLSpanElement> & {
|
|
6
6
|
variant?: ChipVariant;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export type InputSize = "sm" | "md" | "lg";
|
|
2
|
+
export type InputSize = "xs" | "sm" | "md" | "lg";
|
|
3
3
|
export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
4
4
|
size?: InputSize;
|
|
5
5
|
label?: ReactNode;
|
|
@@ -7,7 +7,7 @@ export type PhosphorIconComponent = ComponentType<{
|
|
|
7
7
|
}>;
|
|
8
8
|
export type IconProps = {
|
|
9
9
|
icon: PhosphorIconComponent;
|
|
10
|
-
size?: "sm" | "md" | "lg" | number;
|
|
10
|
+
size?: "xs" | "sm" | "md" | "lg" | number;
|
|
11
11
|
weight?: "thin" | "light" | "regular" | "bold" | "fill" | "duotone";
|
|
12
12
|
className?: string;
|
|
13
13
|
decorative?: boolean;
|