@bfrs/agentic-components 0.5.0 → 0.5.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 +23 -5
- package/README.md +1 -1
- package/dist/components/ui/feedback/Alert/Alert.d.ts +4 -0
- package/dist/components/ui/feedback/warningVisual.d.ts +12 -0
- package/dist/components/ui/forms/MultiSelect/MultiSelect.d.ts +5 -3
- package/dist/components/ui/forms/TagInput/TagInput.d.ts +23 -0
- package/dist/components/ui/forms/TagInput/index.d.ts +2 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/custom-elements.d.ts +15 -0
- package/dist/custom-elements.js +7673 -7488
- package/dist/custom-elements.js.map +1 -1
- package/dist/index.js +4453 -4328
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -215,6 +215,7 @@ For validated forms, keep client validation, API validation, and submit side eff
|
|
|
215
215
|
|
|
216
216
|
- **Control sizes** use `"xs" | "sm" | "md" | "lg"` where supported — default is `"md"` unless noted. Use `xs` for extra-compact dashboard toolbar/filter controls.
|
|
217
217
|
- **Tones** are always `"neutral" | "primary" | "brand" | "success" | "warning" | "danger" | "info"`
|
|
218
|
+
- **Warning visuals** use the shared 11px triangle warning SVG with `#D97706`, `background: rgba(217, 119, 6, 0.08)`, and `border: 1px solid rgba(217, 119, 6, 0.2)` for warning surfaces. Dot, progress, and accent-only warning treatments use the same `#D97706` accent.
|
|
218
219
|
- **Variants** control visual style (filled vs. outline vs. ghost, etc.)
|
|
219
220
|
- All interactive components forward refs and spread native HTML props
|
|
220
221
|
- Styling uses **Tailwind CSS** + **CVA** with the `bfrs-` utility prefix. Use classes such as `bfrs-flex`, `hover:bfrs-bg-primary`, and `bfrs-animate-shimmer` when you intentionally depend on library utilities. Unprefixed classes are treated as host-app classes.
|
|
@@ -655,7 +656,7 @@ Combobox with search. Use when options list is long (10+).
|
|
|
655
656
|
#### `MultiSelect`
|
|
656
657
|
|
|
657
658
|
Searchable multi-value select. Use for channel/category filters or any bounded list where more than one option can be selected.
|
|
658
|
-
The popover keeps the embedded search input on the same 28px field style as `Input` and `Select`, scrolls only the option list, and keeps Apply/
|
|
659
|
+
The popover keeps the embedded search input on the same 28px field style as `Input` and `Select`, scrolls only the option list, and keeps Apply/Cancel footer actions visible. In apply mode, Cancel closes the dropdown and discards the draft while Apply commits it; the two default footer buttons each take half of the full dropdown width.
|
|
659
660
|
|
|
660
661
|
```tsx
|
|
661
662
|
<MultiSelect
|
|
@@ -691,6 +692,11 @@ Angular custom element:
|
|
|
691
692
|
| `error` | `boolean` | `false` |
|
|
692
693
|
| `clearable` | `boolean` | `true` |
|
|
693
694
|
| `maxVisibleValues` | `number` | `2` |
|
|
695
|
+
| `commitMode` | `"change" \| "apply"` | `"change"` |
|
|
696
|
+
| `applyLabel` | `string` | `"Apply"` |
|
|
697
|
+
| `cancelLabel` | `string` | `"Cancel"` |
|
|
698
|
+
| `applyVariant` | `ButtonVariant` | `"primary"` |
|
|
699
|
+
| `cancelVariant` | `ButtonVariant` | `"secondary"` |
|
|
694
700
|
|
|
695
701
|
---
|
|
696
702
|
|
|
@@ -1245,15 +1251,18 @@ Angular: use `left-icon="package"` / `right-icon="arrow-right"` for named Phosph
|
|
|
1245
1251
|
#### `Alert`
|
|
1246
1252
|
|
|
1247
1253
|
Contextual message banner. Auto-selects an icon based on tone.
|
|
1254
|
+
The warning tone uses the shared 11px triangle warning SVG with `#D97706`, `background: rgba(217, 119, 6, 0.08)`, and `border: 1px solid rgba(217, 119, 6, 0.2)`.
|
|
1248
1255
|
|
|
1249
1256
|
```tsx
|
|
1250
1257
|
<Alert
|
|
1251
1258
|
tone="warning"
|
|
1252
1259
|
title="Your trial ends in 3 days"
|
|
1260
|
+
message="Upgrade to keep access to all features."
|
|
1253
1261
|
action={<Button size="sm">Upgrade now</Button>}
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1262
|
+
/>
|
|
1263
|
+
|
|
1264
|
+
{/* Title-only single-line alert */}
|
|
1265
|
+
<Alert tone="danger" title="Payment failed" />
|
|
1257
1266
|
|
|
1258
1267
|
{/* Sizes: xs | sm | md (default) | lg */}
|
|
1259
1268
|
<Alert size="xs" tone="info" title="XSmall">Ultra-compact inline alert.</Alert>
|
|
@@ -1267,9 +1276,18 @@ Contextual message banner. Auto-selects an icon based on tone.
|
|
|
1267
1276
|
| `tone` | `"info" \| "success" \| "warning" \| "danger"` | `"info"` |
|
|
1268
1277
|
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | `"md"` |
|
|
1269
1278
|
| `title` | `ReactNode` | — |
|
|
1279
|
+
| `message` | `ReactNode` | — |
|
|
1280
|
+
| `description` | `ReactNode` | — |
|
|
1270
1281
|
| `action` | `ReactNode` | — |
|
|
1271
1282
|
| `icon` | `ReactNode` | auto (from tone) |
|
|
1272
1283
|
|
|
1284
|
+
Angular: use the default slot for supporting text, or use `message` / `description` attributes for inline body copy. Omit supporting text for a single-line alert.
|
|
1285
|
+
|
|
1286
|
+
```html
|
|
1287
|
+
<bfrs-alert tone="danger" title="Payment failed" message="Update payment details and retry."></bfrs-alert>
|
|
1288
|
+
<bfrs-alert tone="warning" title="Review required"></bfrs-alert>
|
|
1289
|
+
```
|
|
1290
|
+
|
|
1273
1291
|
---
|
|
1274
1292
|
|
|
1275
1293
|
#### `InfoCard`
|
|
@@ -1636,7 +1654,7 @@ Angular: `items-per-page-label` attribute.
|
|
|
1636
1654
|
|
|
1637
1655
|
Generic data table with sorting, loading skeleton, row actions, selection, pagination, and empty/error states.
|
|
1638
1656
|
|
|
1639
|
-
DataTable has one default visual density, matching the Figma orders table: 8px outer radius, strong `#D3DFD7` outer/header stroke,
|
|
1657
|
+
DataTable has one default visual density, matching the Figma orders table: 8px outer radius, strong `#D3DFD7` outer/header stroke, 38px header, 64px rows, 12px header/body type, 0.24px header letter spacing, 12px selection checkboxes, and a 146px sticky actions column headed `Actions`.
|
|
1640
1658
|
|
|
1641
1659
|
```tsx
|
|
1642
1660
|
<DataTable
|
package/README.md
CHANGED
|
@@ -257,7 +257,7 @@ save() {
|
|
|
257
257
|
|
|
258
258
|
DataTable also accepts declarative `leadingColumn`, `rowActions`,
|
|
259
259
|
`rowClassRules`, `rowIdKey`, `accessorPath`, and `sortValueKey` configuration.
|
|
260
|
-
The default table chrome matches Shiprocket 4.0 Figma: 8px outer radius, strong `#D3DFD7` outer/header stroke,
|
|
260
|
+
The default table chrome matches Shiprocket 4.0 Figma: 8px outer radius, strong `#D3DFD7` outer/header stroke, 38px header, 64px rows, 12px text, 12px selection checkboxes, and a 146px sticky actions column headed `Actions`.
|
|
261
261
|
The standalone helpers are available as `bfrs-table-toolbar`,
|
|
262
262
|
`bfrs-table-empty-state`, `bfrs-table-error-state`, `bfrs-table-skeleton`,
|
|
263
263
|
`bfrs-table-row-actions`, `bfrs-table-bulk-actions`, and
|
|
@@ -6,6 +6,8 @@ declare const alertVariants: (props?: ({
|
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export type AlertProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & VariantProps<typeof alertVariants> & {
|
|
8
8
|
title?: ReactNode;
|
|
9
|
+
message?: ReactNode;
|
|
10
|
+
description?: ReactNode;
|
|
9
11
|
action?: ReactNode;
|
|
10
12
|
icon?: ReactNode;
|
|
11
13
|
};
|
|
@@ -14,6 +16,8 @@ export declare const Alert: import('react').ForwardRefExoticComponent<Omit<HTMLA
|
|
|
14
16
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
15
17
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
|
|
16
18
|
title?: ReactNode;
|
|
19
|
+
message?: ReactNode;
|
|
20
|
+
description?: ReactNode;
|
|
17
21
|
action?: ReactNode;
|
|
18
22
|
icon?: ReactNode;
|
|
19
23
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export declare const warningAccentColor = "#D97706";
|
|
3
|
+
export declare const warningSurfaceBackground = "rgba(217, 119, 6, 0.08)";
|
|
4
|
+
export declare const warningSurfaceBorder = "1px solid rgba(217, 119, 6, 0.2)";
|
|
5
|
+
export declare const warningSurfaceBorderColor = "rgba(217, 119, 6, 0.2)";
|
|
6
|
+
export declare const warningSurfaceStyle: CSSProperties;
|
|
7
|
+
export declare const warningSurfaceTextStyle: CSSProperties;
|
|
8
|
+
export declare const warningTextStyle: CSSProperties;
|
|
9
|
+
export declare const warningAccentBackgroundStyle: CSSProperties;
|
|
10
|
+
export declare const warningAccentBorderStyle: CSSProperties;
|
|
11
|
+
export declare const warningSoftBorderStyle: CSSProperties;
|
|
12
|
+
export declare function WarningAlertIcon(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { SelectMenuWidth, SelectOption } from '../Select';
|
|
|
6
6
|
* - `"change"` (default) — on every toggle, immediately.
|
|
7
7
|
* - `"apply"` — only when the user confirms with the Apply button (or a custom
|
|
8
8
|
* footer action). Toggles update an internal draft; closing without applying
|
|
9
|
-
* discards the draft.
|
|
9
|
+
* discards the draft. An Apply/Cancel footer is shown automatically.
|
|
10
10
|
*/
|
|
11
11
|
export type MultiSelectCommitMode = "change" | "apply";
|
|
12
12
|
export type MultiSelectProps = {
|
|
@@ -30,13 +30,15 @@ export type MultiSelectProps = {
|
|
|
30
30
|
menuWidth?: SelectMenuWidth;
|
|
31
31
|
/** Defer committing the value until applied. Defaults to `"change"`. */
|
|
32
32
|
commitMode?: MultiSelectCommitMode;
|
|
33
|
-
/** Custom popover footer. Overrides the default
|
|
33
|
+
/** Custom popover footer. Overrides the default Apply/Cancel footer. */
|
|
34
34
|
footer?: ReactNode;
|
|
35
35
|
applyLabel?: string;
|
|
36
|
+
cancelLabel?: string;
|
|
36
37
|
clearLabel?: string;
|
|
37
38
|
/** Button variant for the default footer Apply action. Defaults to `"primary"`. */
|
|
38
39
|
applyVariant?: ButtonVariant;
|
|
39
|
-
/** Button variant for the default footer
|
|
40
|
+
/** Button variant for the default footer Cancel action. Defaults to `"secondary"`. */
|
|
41
|
+
cancelVariant?: ButtonVariant;
|
|
40
42
|
clearVariant?: ButtonVariant;
|
|
41
43
|
className?: string;
|
|
42
44
|
id?: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type TagInputProps = {
|
|
2
|
+
/** Current tags (controlled). */
|
|
3
|
+
value: string[];
|
|
4
|
+
/** Fired with the updated list on add / remove. */
|
|
5
|
+
onChange: (value: string[]) => void;
|
|
6
|
+
/** Optional existing-tag suggestions for autocomplete (filtered as you type). */
|
|
7
|
+
suggestions?: string[];
|
|
8
|
+
/** Allow committing values outside `suggestions` (default true). */
|
|
9
|
+
creatable?: boolean;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
/** Max suggestions shown in the dropdown (default 8). */
|
|
12
|
+
maxSuggestions?: number;
|
|
13
|
+
size?: "sm" | "md";
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
error?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
"aria-describedby"?: string;
|
|
19
|
+
"aria-invalid"?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const TagInput: import('react').ForwardRefExoticComponent<TagInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export declare const TagsInput: import('react').ForwardRefExoticComponent<TagInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
|
+
export type TagsInputProps = TagInputProps;
|
|
@@ -17,6 +17,7 @@ export * from './forms/FormField';
|
|
|
17
17
|
export * from './forms/Select';
|
|
18
18
|
export * from './forms/SearchableSelect';
|
|
19
19
|
export * from './forms/MultiSelect';
|
|
20
|
+
export * from './forms/TagInput';
|
|
20
21
|
export * from './forms/SuggestInput';
|
|
21
22
|
export * from './forms/OptionCardGroup';
|
|
22
23
|
export * from './forms/SelectableChipGroup';
|
|
@@ -375,6 +375,20 @@ export declare class BfrsMultiSelectElement extends ReactCustomElement {
|
|
|
375
375
|
private propsValues;
|
|
376
376
|
private attributeValues;
|
|
377
377
|
}
|
|
378
|
+
export declare class BfrsTagInputElement extends ReactCustomElement {
|
|
379
|
+
static readonly tagName = "tag-input";
|
|
380
|
+
static get observedAttributes(): string[];
|
|
381
|
+
private controlledValues;
|
|
382
|
+
get values(): string[];
|
|
383
|
+
set values(values: string[] | undefined);
|
|
384
|
+
get value(): string[] | string | undefined;
|
|
385
|
+
set value(value: string[] | string | undefined);
|
|
386
|
+
attributeChangedCallback(name?: string, oldValue?: string | null, newValue?: string | null): void;
|
|
387
|
+
protected defaultDisplay(): string;
|
|
388
|
+
protected renderElement(): unknown;
|
|
389
|
+
private propsValues;
|
|
390
|
+
private attributeValues;
|
|
391
|
+
}
|
|
378
392
|
export declare class BfrsSuggestInputElement extends ValueCustomElement {
|
|
379
393
|
static readonly tagName = "suggest-input";
|
|
380
394
|
static get observedAttributes(): string[];
|
|
@@ -939,6 +953,7 @@ declare global {
|
|
|
939
953
|
"bfrs-step-progress-card": BfrsStepProgressCardElement;
|
|
940
954
|
"bfrs-step-progress-card-skeleton": BfrsStepProgressCardSkeletonElement;
|
|
941
955
|
"bfrs-suggest-input": BfrsSuggestInputElement;
|
|
956
|
+
"bfrs-tag-input": BfrsTagInputElement;
|
|
942
957
|
"bfrs-summary-bar": BfrsSummaryBarElement;
|
|
943
958
|
"bfrs-switch": BfrsSwitchElement;
|
|
944
959
|
"bfrs-table": BfrsTableElement;
|