@bfrs/agentic-components 0.2.3 → 0.2.4
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 +51 -3
- package/README.md +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/patterns/RevealAndCopy/RevealAndCopy.d.ts +66 -0
- package/dist/components/ui/patterns/RevealAndCopy/index.d.ts +2 -0
- package/dist/custom-elements.d.ts +6 -0
- package/dist/custom-elements.js +8857 -8654
- package/dist/custom-elements.js.map +1 -1
- package/dist/index.js +2545 -2389
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ import "@bfrs/agentic-components/styles";
|
|
|
25
25
|
Import components by name:
|
|
26
26
|
|
|
27
27
|
```tsx
|
|
28
|
-
import { Button, Input, Slider, ColorPicker, ColorSwatchGroup, Modal, DataTable, DateRangePicker, ToastProvider, useToast } from "@bfrs/agentic-components";
|
|
28
|
+
import { Button, Input, Slider, ColorPicker, ColorSwatchGroup, RevealAndCopy, Modal, DataTable, DateRangePicker, ToastProvider, useToast } from "@bfrs/agentic-components";
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
For whole-app theme overrides, import the framework-neutral theme helper:
|
|
@@ -96,11 +96,11 @@ Use native Angular DOM event bindings for interactions. Do not pass React-style
|
|
|
96
96
|
<bfrs-paper (click)="openDetails()">Open details</bfrs-paper>
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
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-slider`, `bfrs-color-picker`, `bfrs-color-swatch-group`, `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`.
|
|
99
|
+
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-slider`, `bfrs-color-picker`, `bfrs-color-swatch-group`, `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`, `bfrs-reveal-and-copy`, and `bfrs-step-progress-card`.
|
|
100
100
|
|
|
101
101
|
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`.
|
|
102
102
|
|
|
103
|
-
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`.
|
|
103
|
+
Common component events: `(value-change)`, `(checked-change)`, `(open-change)`, `(reveal-change)`, `(copy)`, `(copy-error)`, `(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`.
|
|
104
104
|
|
|
105
105
|
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`.
|
|
106
106
|
|
|
@@ -1316,6 +1316,54 @@ Branded full-screen loading screen. Use during auth redirects and account setup.
|
|
|
1316
1316
|
|
|
1317
1317
|
---
|
|
1318
1318
|
|
|
1319
|
+
#### `RevealAndCopy`
|
|
1320
|
+
|
|
1321
|
+
Masked sensitive-value display with a reveal action and optional clipboard copy. Use for phone numbers, email addresses, tokens, and other values that should not render as plaintext until the user asks to reveal them. The plaintext value is not placed in the DOM while masked.
|
|
1322
|
+
|
|
1323
|
+
```tsx
|
|
1324
|
+
<RevealAndCopy value={customer.phone} allowCopy />
|
|
1325
|
+
|
|
1326
|
+
<RevealAndCopy
|
|
1327
|
+
value={customer.email}
|
|
1328
|
+
allowCopy={false}
|
|
1329
|
+
revealLabel="Show email"
|
|
1330
|
+
/>
|
|
1331
|
+
```
|
|
1332
|
+
|
|
1333
|
+
| Prop | Type | Default |
|
|
1334
|
+
|------|------|---------|
|
|
1335
|
+
| `value` | `string \| null` | — |
|
|
1336
|
+
| `allowCopy` | `boolean` | `true` |
|
|
1337
|
+
| `defaultRevealed` | `boolean` | `false` |
|
|
1338
|
+
| `revealed` | `boolean` | — |
|
|
1339
|
+
| `onRevealChange` | `(revealed: boolean) => void` | — |
|
|
1340
|
+
| `onCopy` | `(value: string) => void` | — |
|
|
1341
|
+
| `onCopyError` | `(error: unknown) => void` | — |
|
|
1342
|
+
| `copyValue` | `string` | `value` |
|
|
1343
|
+
| `emptyValue` | `ReactNode` | `"—"` |
|
|
1344
|
+
| `maskCharacter` | `string` | `"X"` |
|
|
1345
|
+
| `minMaskLength` | `number` | `4` |
|
|
1346
|
+
| `stopPropagation` | `boolean` | `true` |
|
|
1347
|
+
| `size` | `"xs" \| "sm" \| "md"` | `"sm"` |
|
|
1348
|
+
| `revealLabel` | `string` | `"Show value"` |
|
|
1349
|
+
| `copyLabel` | `string` | `"Copy value"` |
|
|
1350
|
+
| `copiedLabel` | `string` | `"Copied"` |
|
|
1351
|
+
|
|
1352
|
+
Angular:
|
|
1353
|
+
|
|
1354
|
+
```html
|
|
1355
|
+
<bfrs-reveal-and-copy
|
|
1356
|
+
value="9876543210"
|
|
1357
|
+
allow-copy="true"
|
|
1358
|
+
(reveal-change)="revealed = $event.detail.revealed"
|
|
1359
|
+
(copy)="lastCopied = $event.detail.value">
|
|
1360
|
+
</bfrs-reveal-and-copy>
|
|
1361
|
+
```
|
|
1362
|
+
|
|
1363
|
+
Use `allow-copy="false"` when the user should only reveal the value. The component treats empty strings and `—` as missing values and renders `emptyValue`.
|
|
1364
|
+
|
|
1365
|
+
---
|
|
1366
|
+
|
|
1319
1367
|
#### `BusinessInfoDisplayCard`
|
|
1320
1368
|
|
|
1321
1369
|
Rich business identity card with centered profile identity, metadata chips, and compact label-value details. Uses the standard card surface (faded green-grey gradient stroke, white gradient background, green-glow shadow) and the Figma-derived green header wash.
|
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ Use simple attributes for primitive values and `[props]` for structured values o
|
|
|
112
112
|
</bfrs-data-table>
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
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-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`.
|
|
115
|
+
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-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`, `bfrs-reveal-and-copy`, and `bfrs-step-progress-card`.
|
|
116
116
|
|
|
117
117
|
## Theme Overrides
|
|
118
118
|
|
|
@@ -54,6 +54,7 @@ export * from './patterns/ChatComposer';
|
|
|
54
54
|
export * from './patterns/FullPageLoader';
|
|
55
55
|
export * from './patterns/BusinessInfoDisplayCard';
|
|
56
56
|
export * from './patterns/StepProgressCard';
|
|
57
|
+
export * from './patterns/RevealAndCopy';
|
|
57
58
|
export * from './patterns/CommandMenu';
|
|
58
59
|
export * from './patterns/WorkspaceHeader';
|
|
59
60
|
export * from './patterns/SideNav';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type RevealAndCopySize = "xs" | "sm" | "md";
|
|
3
|
+
export type RevealAndCopyProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onCopy"> & {
|
|
4
|
+
/** The sensitive value to keep masked until the user reveals it. */
|
|
5
|
+
value?: string | null;
|
|
6
|
+
/** Enables the copy action after reveal. */
|
|
7
|
+
allowCopy?: boolean;
|
|
8
|
+
/** Initial reveal state for uncontrolled usage. */
|
|
9
|
+
defaultRevealed?: boolean;
|
|
10
|
+
/** Controlled reveal state. */
|
|
11
|
+
revealed?: boolean;
|
|
12
|
+
/** Called when the user reveals the value. */
|
|
13
|
+
onRevealChange?: (revealed: boolean) => void;
|
|
14
|
+
/** Called after a successful copy action. */
|
|
15
|
+
onCopy?: (value: string) => void;
|
|
16
|
+
/** Called when clipboard copy fails. */
|
|
17
|
+
onCopyError?: (error: unknown) => void;
|
|
18
|
+
/** Value written to the clipboard. Defaults to `value`. */
|
|
19
|
+
copyValue?: string;
|
|
20
|
+
/** Visible fallback for missing values. */
|
|
21
|
+
emptyValue?: ReactNode;
|
|
22
|
+
/** Character used to build the masked value. */
|
|
23
|
+
maskCharacter?: string;
|
|
24
|
+
/** Minimum masked length. */
|
|
25
|
+
minMaskLength?: number;
|
|
26
|
+
/** Stops button clicks from bubbling to parent rows/cards. */
|
|
27
|
+
stopPropagation?: boolean;
|
|
28
|
+
size?: RevealAndCopySize;
|
|
29
|
+
revealLabel?: string;
|
|
30
|
+
copyLabel?: string;
|
|
31
|
+
copiedLabel?: string;
|
|
32
|
+
valueClassName?: string;
|
|
33
|
+
actionClassName?: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const RevealAndCopy: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "onCopy"> & {
|
|
36
|
+
/** The sensitive value to keep masked until the user reveals it. */
|
|
37
|
+
value?: string | null;
|
|
38
|
+
/** Enables the copy action after reveal. */
|
|
39
|
+
allowCopy?: boolean;
|
|
40
|
+
/** Initial reveal state for uncontrolled usage. */
|
|
41
|
+
defaultRevealed?: boolean;
|
|
42
|
+
/** Controlled reveal state. */
|
|
43
|
+
revealed?: boolean;
|
|
44
|
+
/** Called when the user reveals the value. */
|
|
45
|
+
onRevealChange?: (revealed: boolean) => void;
|
|
46
|
+
/** Called after a successful copy action. */
|
|
47
|
+
onCopy?: (value: string) => void;
|
|
48
|
+
/** Called when clipboard copy fails. */
|
|
49
|
+
onCopyError?: (error: unknown) => void;
|
|
50
|
+
/** Value written to the clipboard. Defaults to `value`. */
|
|
51
|
+
copyValue?: string;
|
|
52
|
+
/** Visible fallback for missing values. */
|
|
53
|
+
emptyValue?: ReactNode;
|
|
54
|
+
/** Character used to build the masked value. */
|
|
55
|
+
maskCharacter?: string;
|
|
56
|
+
/** Minimum masked length. */
|
|
57
|
+
minMaskLength?: number;
|
|
58
|
+
/** Stops button clicks from bubbling to parent rows/cards. */
|
|
59
|
+
stopPropagation?: boolean;
|
|
60
|
+
size?: RevealAndCopySize;
|
|
61
|
+
revealLabel?: string;
|
|
62
|
+
copyLabel?: string;
|
|
63
|
+
copiedLabel?: string;
|
|
64
|
+
valueClassName?: string;
|
|
65
|
+
actionClassName?: string;
|
|
66
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -442,6 +442,11 @@ export declare class BfrsBusinessInfoDisplayCardSkeletonElement extends ReactCus
|
|
|
442
442
|
static get observedAttributes(): string[];
|
|
443
443
|
protected renderElement(): unknown;
|
|
444
444
|
}
|
|
445
|
+
export declare class BfrsRevealAndCopyElement extends ReactCustomElement {
|
|
446
|
+
static readonly tagName = "reveal-and-copy";
|
|
447
|
+
static get observedAttributes(): string[];
|
|
448
|
+
protected renderElement(): unknown;
|
|
449
|
+
}
|
|
445
450
|
export declare class BfrsStepProgressCardElement extends ReactCustomElement {
|
|
446
451
|
static readonly tagName = "step-progress-card";
|
|
447
452
|
static get observedAttributes(): string[];
|
|
@@ -523,6 +528,7 @@ declare global {
|
|
|
523
528
|
"bfrs-paper": BfrsPaperElement;
|
|
524
529
|
"bfrs-popover": BfrsPopoverElement;
|
|
525
530
|
"bfrs-radio": BfrsRadioElement;
|
|
531
|
+
"bfrs-reveal-and-copy": BfrsRevealAndCopyElement;
|
|
526
532
|
"bfrs-searchable-select": BfrsSearchableSelectElement;
|
|
527
533
|
"bfrs-section-header": BfrsSectionHeaderElement;
|
|
528
534
|
"bfrs-select": BfrsSelectElement;
|