@bfrs/agentic-components 0.2.1 → 0.2.3
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 +146 -3
- package/README.md +57 -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 +3 -0
- package/dist/custom-elements.d.ts +34 -0
- package/dist/custom-elements.js +9609 -9249
- package/dist/custom-elements.js.map +1 -1
- package/dist/index.js +2928 -2914
- 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, 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,12 +96,14 @@ 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`, 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
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`.
|
|
90
104
|
|
|
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
|
+
|
|
91
107
|
```html
|
|
92
108
|
<bfrs-select
|
|
93
109
|
placeholder="Channel"
|
|
@@ -493,6 +509,133 @@ Combobox with search. Use when options list is long (10+).
|
|
|
493
509
|
|
|
494
510
|
---
|
|
495
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
|
+
|
|
496
639
|
#### `Checkbox`
|
|
497
640
|
|
|
498
641
|
Square checklist control for independent true/false decisions or multi-select choices.
|
package/README.md
CHANGED
|
@@ -112,7 +112,63 @@ 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`, 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
|
+
```
|
|
150
|
+
|
|
151
|
+
### Validated Forms
|
|
152
|
+
|
|
153
|
+
Keep form validation and API checks in the app. Render field errors below inputs, then show success or failure through the toast API.
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
<FormField label="Pickup pincode" errorText={errors.pickupPincode}>
|
|
157
|
+
<Input error={Boolean(errors.pickupPincode)} value={pickupPincode} onChange={updatePickupPincode} />
|
|
158
|
+
</FormField>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<bfrs-input
|
|
163
|
+
label="Pickup pincode"
|
|
164
|
+
[value]="pickupPincode"
|
|
165
|
+
[attr.error]="errors.pickupPincode ? true : null"
|
|
166
|
+
[attr.error-message]="errors.pickupPincode || null"
|
|
167
|
+
(value-change)="pickupPincode = $event.detail.value">
|
|
168
|
+
</bfrs-input>
|
|
169
|
+
|
|
170
|
+
<bfrs-toast-manager [props]="{ toasts: toasts }" (dismiss)="dismissToast($event.detail.id)"></bfrs-toast-manager>
|
|
171
|
+
```
|
|
116
172
|
|
|
117
173
|
### DateRangePicker
|
|
118
174
|
|
|
@@ -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';
|
|
@@ -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[];
|
|
@@ -460,6 +491,8 @@ declare global {
|
|
|
460
491
|
"bfrs-chat-composer": BfrsChatComposerElement;
|
|
461
492
|
"bfrs-checkbox": BfrsCheckboxElement;
|
|
462
493
|
"bfrs-chip": BfrsChipElement;
|
|
494
|
+
"bfrs-color-picker": BfrsColorPickerElement;
|
|
495
|
+
"bfrs-color-swatch-group": BfrsColorSwatchGroupElement;
|
|
463
496
|
"bfrs-command-menu": BfrsCommandMenuElement;
|
|
464
497
|
"bfrs-confirm-dialog": BfrsConfirmDialogElement;
|
|
465
498
|
"bfrs-container": BfrsContainerElement;
|
|
@@ -494,6 +527,7 @@ declare global {
|
|
|
494
527
|
"bfrs-section-header": BfrsSectionHeaderElement;
|
|
495
528
|
"bfrs-select": BfrsSelectElement;
|
|
496
529
|
"bfrs-side-nav": BfrsSideNavElement;
|
|
530
|
+
"bfrs-slider": BfrsSliderElement;
|
|
497
531
|
"bfrs-skeleton": BfrsSkeletonElement;
|
|
498
532
|
"bfrs-spinner": BfrsSpinnerElement;
|
|
499
533
|
"bfrs-stack": BfrsStackElement;
|