@bfrs/agentic-components 0.4.9 → 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 +34 -12
- 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
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
NumberStepper,
|
|
50
50
|
SuggestInput,
|
|
51
51
|
TagInput,
|
|
52
|
+
TagsInput,
|
|
52
53
|
FileDropzone,
|
|
53
54
|
RevealField,
|
|
54
55
|
RevealAndCopy,
|
|
@@ -214,6 +215,7 @@ For validated forms, keep client validation, API validation, and submit side eff
|
|
|
214
215
|
|
|
215
216
|
- **Control sizes** use `"xs" | "sm" | "md" | "lg"` where supported — default is `"md"` unless noted. Use `xs` for extra-compact dashboard toolbar/filter controls.
|
|
216
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.
|
|
217
219
|
- **Variants** control visual style (filled vs. outline vs. ghost, etc.)
|
|
218
220
|
- All interactive components forward refs and spread native HTML props
|
|
219
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.
|
|
@@ -654,7 +656,7 @@ Combobox with search. Use when options list is long (10+).
|
|
|
654
656
|
#### `MultiSelect`
|
|
655
657
|
|
|
656
658
|
Searchable multi-value select. Use for channel/category filters or any bounded list where more than one option can be selected.
|
|
657
|
-
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.
|
|
658
660
|
|
|
659
661
|
```tsx
|
|
660
662
|
<MultiSelect
|
|
@@ -690,20 +692,26 @@ Angular custom element:
|
|
|
690
692
|
| `error` | `boolean` | `false` |
|
|
691
693
|
| `clearable` | `boolean` | `true` |
|
|
692
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"` |
|
|
693
700
|
|
|
694
701
|
---
|
|
695
702
|
|
|
696
|
-
#### `TagInput`
|
|
703
|
+
#### `TagInput` / `TagsInput`
|
|
697
704
|
|
|
698
|
-
Controlled chip input for free-form tags. Type and press Enter or comma to add, press Backspace on an empty input to remove the last tag, or remove individual chips with the chip close action. Pass `suggestions` to show an autocomplete list filtered by the current input.
|
|
705
|
+
Controlled chip input for free-form tags. This is intentionally separate from `MultiSelect`: `MultiSelect` selects bounded options, while `TagInput` / `TagsInput` can create arbitrary values and still autocomplete existing tags. Type and press Enter or comma to add, press Backspace on an empty input to remove the last tag, or remove individual chips with the chip close action. Pass `suggestions` to show an autocomplete list filtered by the current input. `creatable` defaults to `true`; set it to `false` to only commit suggestions.
|
|
699
706
|
|
|
700
707
|
```tsx
|
|
701
708
|
const [tags, setTags] = useState<string[]>([]);
|
|
702
709
|
|
|
703
|
-
<
|
|
710
|
+
<TagsInput
|
|
704
711
|
value={tags}
|
|
705
712
|
onChange={setTags}
|
|
706
713
|
suggestions={existingTags}
|
|
714
|
+
creatable
|
|
707
715
|
placeholder="Add Tag"
|
|
708
716
|
/>
|
|
709
717
|
```
|
|
@@ -715,7 +723,7 @@ React Hook Form:
|
|
|
715
723
|
name="order_tag"
|
|
716
724
|
control={control}
|
|
717
725
|
render={({ field }) => (
|
|
718
|
-
<
|
|
726
|
+
<TagsInput
|
|
719
727
|
value={field.value ?? []}
|
|
720
728
|
onChange={field.onChange}
|
|
721
729
|
suggestions={allTags}
|
|
@@ -730,7 +738,7 @@ Angular custom element:
|
|
|
730
738
|
```html
|
|
731
739
|
<bfrs-tag-input
|
|
732
740
|
placeholder="Add Tag"
|
|
733
|
-
[props]="{ values: orderTags, suggestions: allTags }"
|
|
741
|
+
[props]="{ values: orderTags, suggestions: allTags, creatable: true }"
|
|
734
742
|
(value-change)="orderTags = $event.detail.values">
|
|
735
743
|
</bfrs-tag-input>
|
|
736
744
|
```
|
|
@@ -740,6 +748,7 @@ Angular custom element:
|
|
|
740
748
|
| `value` | `string[]` | **required** |
|
|
741
749
|
| `onChange` | `(value: string[]) => void` | **required** |
|
|
742
750
|
| `suggestions` | `string[]` | `[]` |
|
|
751
|
+
| `creatable` | `boolean` | `true` |
|
|
743
752
|
| `placeholder` | `string` | `"Add tag"` |
|
|
744
753
|
| `maxSuggestions` | `number` | `8` |
|
|
745
754
|
| `size` | `"sm" \| "md"` | `"md"` |
|
|
@@ -914,10 +923,11 @@ Use `FormField` around controls that do not own a label. This keeps Quantity and
|
|
|
914
923
|
</FormField>
|
|
915
924
|
|
|
916
925
|
<FormField label="Order tags">
|
|
917
|
-
<
|
|
926
|
+
<TagsInput
|
|
918
927
|
value={orderTags}
|
|
919
928
|
onChange={setOrderTags}
|
|
920
929
|
suggestions={allTags}
|
|
930
|
+
creatable
|
|
921
931
|
placeholder="Add Tag"
|
|
922
932
|
/>
|
|
923
933
|
</FormField>
|
|
@@ -958,7 +968,7 @@ Angular / Custom Elements:
|
|
|
958
968
|
|
|
959
969
|
<bfrs-form-field label="Order tags">
|
|
960
970
|
<bfrs-tag-input
|
|
961
|
-
[props]="{ values: orderTags, suggestions: allTags }"
|
|
971
|
+
[props]="{ values: orderTags, suggestions: allTags, creatable: true }"
|
|
962
972
|
(value-change)="orderTags = $event.detail.values">
|
|
963
973
|
</bfrs-tag-input>
|
|
964
974
|
</bfrs-form-field>
|
|
@@ -1241,15 +1251,18 @@ Angular: use `left-icon="package"` / `right-icon="arrow-right"` for named Phosph
|
|
|
1241
1251
|
#### `Alert`
|
|
1242
1252
|
|
|
1243
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)`.
|
|
1244
1255
|
|
|
1245
1256
|
```tsx
|
|
1246
1257
|
<Alert
|
|
1247
1258
|
tone="warning"
|
|
1248
1259
|
title="Your trial ends in 3 days"
|
|
1260
|
+
message="Upgrade to keep access to all features."
|
|
1249
1261
|
action={<Button size="sm">Upgrade now</Button>}
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1262
|
+
/>
|
|
1263
|
+
|
|
1264
|
+
{/* Title-only single-line alert */}
|
|
1265
|
+
<Alert tone="danger" title="Payment failed" />
|
|
1253
1266
|
|
|
1254
1267
|
{/* Sizes: xs | sm | md (default) | lg */}
|
|
1255
1268
|
<Alert size="xs" tone="info" title="XSmall">Ultra-compact inline alert.</Alert>
|
|
@@ -1263,9 +1276,18 @@ Contextual message banner. Auto-selects an icon based on tone.
|
|
|
1263
1276
|
| `tone` | `"info" \| "success" \| "warning" \| "danger"` | `"info"` |
|
|
1264
1277
|
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | `"md"` |
|
|
1265
1278
|
| `title` | `ReactNode` | — |
|
|
1279
|
+
| `message` | `ReactNode` | — |
|
|
1280
|
+
| `description` | `ReactNode` | — |
|
|
1266
1281
|
| `action` | `ReactNode` | — |
|
|
1267
1282
|
| `icon` | `ReactNode` | auto (from tone) |
|
|
1268
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
|
+
|
|
1269
1291
|
---
|
|
1270
1292
|
|
|
1271
1293
|
#### `InfoCard`
|
|
@@ -1632,7 +1654,7 @@ Angular: `items-per-page-label` attribute.
|
|
|
1632
1654
|
|
|
1633
1655
|
Generic data table with sorting, loading skeleton, row actions, selection, pagination, and empty/error states.
|
|
1634
1656
|
|
|
1635
|
-
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`.
|
|
1636
1658
|
|
|
1637
1659
|
```tsx
|
|
1638
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;
|