@bfrs/agentic-components 0.2.2 → 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 +193 -4
- package/README.md +35 -1
- package/dist/components/ui/forms/ColorPicker/ColorPicker.d.ts +28 -0
- package/dist/components/ui/forms/ColorPicker/index.d.ts +1 -0
- package/dist/components/ui/forms/ColorSwatchGroup/ColorSwatchGroup.d.ts +16 -0
- package/dist/components/ui/forms/ColorSwatchGroup/index.d.ts +1 -0
- package/dist/components/ui/forms/Slider/Slider.d.ts +36 -0
- package/dist/components/ui/forms/Slider/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts +4 -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 +40 -0
- package/dist/custom-elements.js +11636 -11073
- package/dist/custom-elements.js.map +1 -1
- package/dist/index.js +3420 -3250
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/overrides.d.ts +318 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +520 -0
- package/dist/theme.js.map +1 -0
- package/dist/tokens/shadows.d.ts +1 -0
- package/package.json +5 -1
|
@@ -25,9 +25,23 @@ import "@bfrs/agentic-components/styles";
|
|
|
25
25
|
Import components by name:
|
|
26
26
|
|
|
27
27
|
```tsx
|
|
28
|
-
import { Button, Input, 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
|
+
For whole-app theme overrides, import the framework-neutral theme helper:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { applyAgenticTheme, createAgenticThemeVariables } from "@bfrs/agentic-components/theme";
|
|
35
|
+
|
|
36
|
+
applyAgenticTheme({
|
|
37
|
+
colors: { primary: "#5B45C2", primarySoft: "#F1ECFB", borderFocus: "#5B45C2" },
|
|
38
|
+
radius: { control: "14px", card: "18px" },
|
|
39
|
+
shadows: { card: "0 12px 32px rgb(91 69 194 / 0.16)" }
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Plain CSS variable overrides are also supported. Direct `--color-*` overrides should use HSL channels because component styles call them through `hsl(var(--color-...))`.
|
|
44
|
+
|
|
31
45
|
**Peer dependencies required:** `react >= 18.2.0`, `react-dom >= 18.2.0`
|
|
32
46
|
|
|
33
47
|
### Angular / Custom Elements
|
|
@@ -82,11 +96,11 @@ Use native Angular DOM event bindings for interactions. Do not pass React-style
|
|
|
82
96
|
<bfrs-paper (click)="openDetails()">Open details</bfrs-paper>
|
|
83
97
|
```
|
|
84
98
|
|
|
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`.
|
|
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`.
|
|
86
100
|
|
|
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`.
|
|
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`.
|
|
88
102
|
|
|
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`.
|
|
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`.
|
|
90
104
|
|
|
91
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`.
|
|
92
106
|
|
|
@@ -495,6 +509,133 @@ Combobox with search. Use when options list is long (10+).
|
|
|
495
509
|
|
|
496
510
|
---
|
|
497
511
|
|
|
512
|
+
#### `Slider`
|
|
513
|
+
|
|
514
|
+
Controlled numeric range control. Use instead of raw `<input type="range">`.
|
|
515
|
+
|
|
516
|
+
```tsx
|
|
517
|
+
<Slider
|
|
518
|
+
label="Confidence threshold"
|
|
519
|
+
value={confidence}
|
|
520
|
+
min={0}
|
|
521
|
+
max={100}
|
|
522
|
+
step={5}
|
|
523
|
+
formatValue={(value) => `${value}%`}
|
|
524
|
+
onValueChange={setConfidence}
|
|
525
|
+
/>
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
| Prop | Type | Default |
|
|
529
|
+
|------|------|---------|
|
|
530
|
+
| `value` | `number` | **required** |
|
|
531
|
+
| `onValueChange` | `(value: number) => void` | **required** |
|
|
532
|
+
| `min` | `number` | `0` |
|
|
533
|
+
| `max` | `number` | `100` |
|
|
534
|
+
| `step` | `number` | `1` |
|
|
535
|
+
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | `"md"` |
|
|
536
|
+
| `label` | `ReactNode` | — |
|
|
537
|
+
| `helperText` | `ReactNode` | — |
|
|
538
|
+
| `errorText` | `ReactNode` | — |
|
|
539
|
+
| `formatValue` | `(value: number) => ReactNode` | — |
|
|
540
|
+
| `disabled` | `boolean` | `false` |
|
|
541
|
+
|
|
542
|
+
Uses a native range input internally for keyboard and assistive technology support.
|
|
543
|
+
|
|
544
|
+
Angular:
|
|
545
|
+
|
|
546
|
+
```html
|
|
547
|
+
<bfrs-slider
|
|
548
|
+
label="Confidence threshold"
|
|
549
|
+
min="0"
|
|
550
|
+
max="100"
|
|
551
|
+
step="5"
|
|
552
|
+
[value]="confidence"
|
|
553
|
+
(value-change)="confidence = $event.detail.value">
|
|
554
|
+
</bfrs-slider>
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
#### `ColorPicker`
|
|
560
|
+
|
|
561
|
+
Controlled single-color selector. Use instead of raw `<input type="color">`.
|
|
562
|
+
|
|
563
|
+
```tsx
|
|
564
|
+
<ColorPicker
|
|
565
|
+
label="Brand color"
|
|
566
|
+
value={brandColor}
|
|
567
|
+
onValueChange={setBrandColor}
|
|
568
|
+
helperText="Accepts six-digit hex values."
|
|
569
|
+
/>
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
| Prop | Type | Default |
|
|
573
|
+
|------|------|---------|
|
|
574
|
+
| `value` | `string` | **required** |
|
|
575
|
+
| `onValueChange` | `(value: string) => void` | **required** |
|
|
576
|
+
| `label` | `ReactNode` | — |
|
|
577
|
+
| `helperText` | `ReactNode` | — |
|
|
578
|
+
| `errorText` | `ReactNode` | — |
|
|
579
|
+
| `size` | `"xs" \| "sm" \| "md" \| "lg"` | `"md"` |
|
|
580
|
+
| `disabled` | `boolean` | `false` |
|
|
581
|
+
|
|
582
|
+
Accepts six-digit hex values such as `#2563eb`. Renders a visible swatch, native color input, and editable hex value field internally.
|
|
583
|
+
|
|
584
|
+
Angular:
|
|
585
|
+
|
|
586
|
+
```html
|
|
587
|
+
<bfrs-color-picker
|
|
588
|
+
label="Brand color"
|
|
589
|
+
[value]="brandColor"
|
|
590
|
+
(value-change)="brandColor = $event.detail.value">
|
|
591
|
+
</bfrs-color-picker>
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
#### `ColorSwatchGroup`
|
|
597
|
+
|
|
598
|
+
Controlled radio-style color or palette picker. Use instead of raw palette buttons with `role="radio"`.
|
|
599
|
+
|
|
600
|
+
```tsx
|
|
601
|
+
const options = [
|
|
602
|
+
"#5B45C2",
|
|
603
|
+
"#2563EB",
|
|
604
|
+
["#5B45C2", "#2563EB", "#059669"]
|
|
605
|
+
];
|
|
606
|
+
|
|
607
|
+
<ColorSwatchGroup
|
|
608
|
+
label="Palette"
|
|
609
|
+
value={palette}
|
|
610
|
+
options={options}
|
|
611
|
+
onValueChange={setPalette}
|
|
612
|
+
/>
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
| Prop | Type | Default |
|
|
616
|
+
|------|------|---------|
|
|
617
|
+
| `value` | `string \| string[]` | **required** |
|
|
618
|
+
| `onValueChange` | `(value: string \| string[]) => void` | **required** |
|
|
619
|
+
| `options` | `Array<string \| string[]>` | **required** |
|
|
620
|
+
| `label` | `ReactNode` | — |
|
|
621
|
+
| `disabled` | `boolean` | `false` |
|
|
622
|
+
| `getOptionLabel` | `(option, index) => string` | generated label |
|
|
623
|
+
| `aria-label` | `string` | `"Color options"` when `label` is absent |
|
|
624
|
+
|
|
625
|
+
Uses a Radix radio group internally, so arrow-key navigation and selected-state semantics are handled by the component.
|
|
626
|
+
|
|
627
|
+
Angular:
|
|
628
|
+
|
|
629
|
+
```html
|
|
630
|
+
<bfrs-color-swatch-group
|
|
631
|
+
label="Palette"
|
|
632
|
+
[props]="{ options: paletteOptions, value: palette }"
|
|
633
|
+
(value-change)="palette = $event.detail.value">
|
|
634
|
+
</bfrs-color-swatch-group>
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
498
639
|
#### `Checkbox`
|
|
499
640
|
|
|
500
641
|
Square checklist control for independent true/false decisions or multi-select choices.
|
|
@@ -1175,6 +1316,54 @@ Branded full-screen loading screen. Use during auth redirects and account setup.
|
|
|
1175
1316
|
|
|
1176
1317
|
---
|
|
1177
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
|
+
|
|
1178
1367
|
#### `BusinessInfoDisplayCard`
|
|
1179
1368
|
|
|
1180
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,41 @@ 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-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
|
+
|
|
117
|
+
## Theme Overrides
|
|
118
|
+
|
|
119
|
+
The package exposes a framework-neutral theme helper for app-wide token overrides. Use it from React, Angular, or plain TypeScript without importing the React component entry:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
import { applyAgenticTheme } from "@bfrs/agentic-components/theme";
|
|
123
|
+
|
|
124
|
+
applyAgenticTheme({
|
|
125
|
+
colors: {
|
|
126
|
+
primary: "#5B45C2",
|
|
127
|
+
primaryHover: "#4C35AE",
|
|
128
|
+
primarySoft: "#F1ECFB",
|
|
129
|
+
borderFocus: "#5B45C2"
|
|
130
|
+
},
|
|
131
|
+
radius: {
|
|
132
|
+
control: "14px",
|
|
133
|
+
card: "18px"
|
|
134
|
+
},
|
|
135
|
+
shadows: {
|
|
136
|
+
card: "0 12px 32px rgb(91 69 194 / 0.16)"
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The helper accepts hex, rgb, hsl, or raw HSL channel values for semantic color tokens. Plain CSS variable overrides also work:
|
|
142
|
+
|
|
143
|
+
```css
|
|
144
|
+
:root {
|
|
145
|
+
--color-primary: 251 51% 52%;
|
|
146
|
+
--radius-control: 14px;
|
|
147
|
+
--shadow-card: 0 12px 32px rgb(91 69 194 / 0.16);
|
|
148
|
+
}
|
|
149
|
+
```
|
|
116
150
|
|
|
117
151
|
### Validated Forms
|
|
118
152
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ColorPickerSize = "xs" | "sm" | "md" | "lg";
|
|
3
|
+
export type ColorPickerProps = Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "size" | "type" | "value"> & {
|
|
4
|
+
value: string;
|
|
5
|
+
onValueChange: (value: string) => void;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
helperText?: ReactNode;
|
|
8
|
+
errorText?: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
size?: ColorPickerSize;
|
|
11
|
+
containerClassName?: string;
|
|
12
|
+
labelClassName?: string;
|
|
13
|
+
inputClassName?: string;
|
|
14
|
+
swatchClassName?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const ColorPicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "value" | "size" | "type"> & {
|
|
17
|
+
value: string;
|
|
18
|
+
onValueChange: (value: string) => void;
|
|
19
|
+
label?: ReactNode;
|
|
20
|
+
helperText?: ReactNode;
|
|
21
|
+
errorText?: ReactNode;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
size?: ColorPickerSize;
|
|
24
|
+
containerClassName?: string;
|
|
25
|
+
labelClassName?: string;
|
|
26
|
+
inputClassName?: string;
|
|
27
|
+
swatchClassName?: string;
|
|
28
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ColorPicker';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
+
export type ColorSwatchValue = string | string[];
|
|
4
|
+
export type ColorSwatchGroupProps = Omit<RadioGroupPrimitive.RadioGroupProps, "defaultValue" | "disabled" | "onValueChange" | "value"> & {
|
|
5
|
+
value: ColorSwatchValue;
|
|
6
|
+
onValueChange: (value: ColorSwatchValue) => void;
|
|
7
|
+
options: ColorSwatchValue[];
|
|
8
|
+
label?: ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
getOptionLabel?: (option: ColorSwatchValue, index: number) => string;
|
|
11
|
+
optionClassName?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function ColorSwatchGroup({ className, optionClassName, value, onValueChange, options, label, disabled, getOptionLabel, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorSwatchGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare namespace ColorSwatchGroup {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ColorSwatchGroup';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type SliderSize = "xs" | "sm" | "md" | "lg";
|
|
3
|
+
export type SliderProps = Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "max" | "min" | "onChange" | "size" | "step" | "type" | "value"> & {
|
|
4
|
+
value: number;
|
|
5
|
+
onValueChange: (value: number) => void;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
label?: ReactNode;
|
|
11
|
+
helperText?: ReactNode;
|
|
12
|
+
errorText?: ReactNode;
|
|
13
|
+
size?: SliderSize;
|
|
14
|
+
formatValue?: (value: number) => ReactNode;
|
|
15
|
+
containerClassName?: string;
|
|
16
|
+
labelClassName?: string;
|
|
17
|
+
valueClassName?: string;
|
|
18
|
+
inputClassName?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const Slider: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "value" | "size" | "type" | "step" | "max" | "min"> & {
|
|
21
|
+
value: number;
|
|
22
|
+
onValueChange: (value: number) => void;
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
25
|
+
step?: number;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
label?: ReactNode;
|
|
28
|
+
helperText?: ReactNode;
|
|
29
|
+
errorText?: ReactNode;
|
|
30
|
+
size?: SliderSize;
|
|
31
|
+
formatValue?: (value: number) => ReactNode;
|
|
32
|
+
containerClassName?: string;
|
|
33
|
+
labelClassName?: string;
|
|
34
|
+
valueClassName?: string;
|
|
35
|
+
inputClassName?: string;
|
|
36
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Slider';
|
|
@@ -17,6 +17,9 @@ export * from './forms/SearchableSelect';
|
|
|
17
17
|
export * from './forms/Checkbox';
|
|
18
18
|
export * from './forms/Radio';
|
|
19
19
|
export * from './forms/Switch';
|
|
20
|
+
export * from './forms/Slider';
|
|
21
|
+
export * from './forms/ColorPicker';
|
|
22
|
+
export * from './forms/ColorSwatchGroup';
|
|
20
23
|
export * from './feedback/Chip';
|
|
21
24
|
export * from './feedback/Badge';
|
|
22
25
|
export * from './feedback/Alert';
|
|
@@ -51,6 +54,7 @@ export * from './patterns/ChatComposer';
|
|
|
51
54
|
export * from './patterns/FullPageLoader';
|
|
52
55
|
export * from './patterns/BusinessInfoDisplayCard';
|
|
53
56
|
export * from './patterns/StepProgressCard';
|
|
57
|
+
export * from './patterns/RevealAndCopy';
|
|
54
58
|
export * from './patterns/CommandMenu';
|
|
55
59
|
export * from './patterns/WorkspaceHeader';
|
|
56
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>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ColorSwatchValue } from './components/ui/forms/ColorSwatchGroup';
|
|
1
2
|
type UnknownProps = Record<string, unknown>;
|
|
2
3
|
type CheckedValue = boolean | "indeterminate";
|
|
3
4
|
export type BfrsCustomElementRegistryOptions = {
|
|
@@ -60,6 +61,26 @@ export declare class BfrsInputElement extends ReactCustomElement {
|
|
|
60
61
|
protected renderElement(): unknown;
|
|
61
62
|
private dispatchValueChange;
|
|
62
63
|
}
|
|
64
|
+
export declare class BfrsSliderElement extends ReactCustomElement {
|
|
65
|
+
static readonly tagName = "slider";
|
|
66
|
+
static get observedAttributes(): string[];
|
|
67
|
+
private controlledValue;
|
|
68
|
+
get value(): number;
|
|
69
|
+
set value(value: number);
|
|
70
|
+
attributeChangedCallback(name?: string, oldValue?: string | null, newValue?: string | null): void;
|
|
71
|
+
protected defaultDisplay(): string;
|
|
72
|
+
protected renderElement(): unknown;
|
|
73
|
+
}
|
|
74
|
+
export declare class BfrsColorPickerElement extends ReactCustomElement {
|
|
75
|
+
static readonly tagName = "color-picker";
|
|
76
|
+
static get observedAttributes(): string[];
|
|
77
|
+
private controlledValue;
|
|
78
|
+
get value(): string;
|
|
79
|
+
set value(value: string);
|
|
80
|
+
attributeChangedCallback(name?: string, oldValue?: string | null, newValue?: string | null): void;
|
|
81
|
+
protected defaultDisplay(): string;
|
|
82
|
+
protected renderElement(): unknown;
|
|
83
|
+
}
|
|
63
84
|
export declare class BfrsBadgeElement extends ReactCustomElement {
|
|
64
85
|
static readonly tagName = "badge";
|
|
65
86
|
static get observedAttributes(): string[];
|
|
@@ -213,6 +234,16 @@ export declare class BfrsRadioElement extends ValueCustomElement {
|
|
|
213
234
|
static get observedAttributes(): string[];
|
|
214
235
|
protected renderElement(): unknown;
|
|
215
236
|
}
|
|
237
|
+
export declare class BfrsColorSwatchGroupElement extends ReactCustomElement {
|
|
238
|
+
static readonly tagName = "color-swatch-group";
|
|
239
|
+
static get observedAttributes(): string[];
|
|
240
|
+
private controlledValue;
|
|
241
|
+
get value(): ColorSwatchValue;
|
|
242
|
+
set value(value: ColorSwatchValue);
|
|
243
|
+
attributeChangedCallback(name?: string, oldValue?: string | null, newValue?: string | null): void;
|
|
244
|
+
protected defaultDisplay(): string;
|
|
245
|
+
protected renderElement(): unknown;
|
|
246
|
+
}
|
|
216
247
|
export declare class BfrsSwitchElement extends ReactCustomElement {
|
|
217
248
|
static readonly tagName = "switch";
|
|
218
249
|
static get observedAttributes(): string[];
|
|
@@ -411,6 +442,11 @@ export declare class BfrsBusinessInfoDisplayCardSkeletonElement extends ReactCus
|
|
|
411
442
|
static get observedAttributes(): string[];
|
|
412
443
|
protected renderElement(): unknown;
|
|
413
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
|
+
}
|
|
414
450
|
export declare class BfrsStepProgressCardElement extends ReactCustomElement {
|
|
415
451
|
static readonly tagName = "step-progress-card";
|
|
416
452
|
static get observedAttributes(): string[];
|
|
@@ -460,6 +496,8 @@ declare global {
|
|
|
460
496
|
"bfrs-chat-composer": BfrsChatComposerElement;
|
|
461
497
|
"bfrs-checkbox": BfrsCheckboxElement;
|
|
462
498
|
"bfrs-chip": BfrsChipElement;
|
|
499
|
+
"bfrs-color-picker": BfrsColorPickerElement;
|
|
500
|
+
"bfrs-color-swatch-group": BfrsColorSwatchGroupElement;
|
|
463
501
|
"bfrs-command-menu": BfrsCommandMenuElement;
|
|
464
502
|
"bfrs-confirm-dialog": BfrsConfirmDialogElement;
|
|
465
503
|
"bfrs-container": BfrsContainerElement;
|
|
@@ -490,10 +528,12 @@ declare global {
|
|
|
490
528
|
"bfrs-paper": BfrsPaperElement;
|
|
491
529
|
"bfrs-popover": BfrsPopoverElement;
|
|
492
530
|
"bfrs-radio": BfrsRadioElement;
|
|
531
|
+
"bfrs-reveal-and-copy": BfrsRevealAndCopyElement;
|
|
493
532
|
"bfrs-searchable-select": BfrsSearchableSelectElement;
|
|
494
533
|
"bfrs-section-header": BfrsSectionHeaderElement;
|
|
495
534
|
"bfrs-select": BfrsSelectElement;
|
|
496
535
|
"bfrs-side-nav": BfrsSideNavElement;
|
|
536
|
+
"bfrs-slider": BfrsSliderElement;
|
|
497
537
|
"bfrs-skeleton": BfrsSkeletonElement;
|
|
498
538
|
"bfrs-spinner": BfrsSpinnerElement;
|
|
499
539
|
"bfrs-stack": BfrsStackElement;
|