@bfrs/agentic-components 0.3.0 → 0.3.2
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 +18 -1
- package/README.md +15 -1
- package/dist/components/ui/patterns/ChatComposer/ChatComposer.d.ts +4 -0
- package/dist/components/ui/primitives/Text/Text.d.ts +4 -2
- package/dist/custom-elements.js +1064 -1037
- package/dist/custom-elements.js.map +1 -1
- package/dist/font/sfprofonts/SF-Pro-Display-Black.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-BlackItalic.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-Bold.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-BoldItalic.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-Heavy.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-HeavyItalic.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-Light.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-LightItalic.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-Medium.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-MediumItalic.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-Regular.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-RegularItalic.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-Semibold.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-SemiboldItalic.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-Thin.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-ThinItalic.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-Ultralight.otf +0 -0
- package/dist/font/sfprofonts/SF-Pro-Display-UltralightItalic.otf +0 -0
- package/dist/fonts.css +152 -0
- package/dist/index.js +281 -253
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +8 -2
|
@@ -24,6 +24,15 @@ import "@bfrs/agentic-components/styles";
|
|
|
24
24
|
|
|
25
25
|
The stylesheet is safe to import globally. It does not ship Tailwind preflight, page-level resets, font-face declarations, unprefixed utilities, or generic keyframes.
|
|
26
26
|
|
|
27
|
+
The main stylesheet references the SF Pro family by name only (`--bfrs-font-sans`) and ships no font files. To have the library download and apply SF Pro across the **whole app**, additionally import the opt-in font stylesheet:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import "@bfrs/agentic-components/styles";
|
|
31
|
+
import "@bfrs/agentic-components/fonts.css";
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`fonts.css` bundles the SF Pro Display webfont (relative URLs, so any base path works), defines `--bfrs-font-sans` at the document root, and applies it to `html, body`. Angular consumers import it the same way (`@import "@bfrs/agentic-components/fonts.css";` in `styles.scss`, or add `dist/fonts.css` to the `angular.json` styles array). Skip it if the host app provides its own font.
|
|
35
|
+
|
|
27
36
|
Import components by name:
|
|
28
37
|
|
|
29
38
|
```tsx
|
|
@@ -248,14 +257,19 @@ Semantic typography. Always use this instead of raw `<p>`, `<h1>`, `<span>` for
|
|
|
248
257
|
```tsx
|
|
249
258
|
<Text variant="h2">Welcome back</Text>
|
|
250
259
|
<Text variant="body" tone="muted">Last seen 2 hours ago</Text>
|
|
260
|
+
<Text variant="caption" weight="bold">Bold small label</Text>
|
|
261
|
+
<Text variant="h1" weight="normal">Light large heading</Text>
|
|
251
262
|
```
|
|
252
263
|
|
|
253
264
|
| Prop | Type | Default |
|
|
254
265
|
|------|------|---------|
|
|
255
|
-
| `variant` | `"display" \| "h1" \| "h2" \| "h3" \| "title" \| "body" \| "body-sm" \| "caption" \| "label"` | `"body"` |
|
|
266
|
+
| `variant` | `"display" \| "h1" \| "h2" \| "h3" \| "title" \| "body" \| "body-sm" \| "body-xs" \| "caption" \| "label"` | `"body"` |
|
|
256
267
|
| `tone` | `"primary" \| "secondary" \| "muted" \| "disabled" \| "danger" \| "success" \| "accent"` | `"primary"` |
|
|
268
|
+
| `weight` | `"normal" \| "medium" \| "semibold" \| "bold"` | per variant |
|
|
257
269
|
| `as` | `ElementType` | inferred from variant |
|
|
258
270
|
|
|
271
|
+
Each variant ships a sensible default weight; pass `weight` to override it — e.g. make a small `caption`/`body-xs` bold, or a large `h1`/`display` normal.
|
|
272
|
+
|
|
259
273
|
---
|
|
260
274
|
|
|
261
275
|
#### `Icon`
|
|
@@ -1544,10 +1558,13 @@ Chat input with attachment and action slots. Submits on `Ctrl+Enter`.
|
|
|
1544
1558
|
| `onSubmit` | `() => void` | — |
|
|
1545
1559
|
| `loading` | `boolean` | `false` |
|
|
1546
1560
|
| `disabled` | `boolean` | `false` |
|
|
1561
|
+
| `size` | `"sm" \| "md"` | `"md"` |
|
|
1547
1562
|
| `placeholder` | `string` | `"Ask me anything"` |
|
|
1548
1563
|
| `attachmentSlot` | `ReactNode` | — |
|
|
1549
1564
|
| `actionSlot` | `ReactNode` | — |
|
|
1550
1565
|
|
|
1566
|
+
Use `size="sm"` for a compact composer in sidebars, inline threads, or dense workspace rails.
|
|
1567
|
+
|
|
1551
1568
|
---
|
|
1552
1569
|
|
|
1553
1570
|
#### `FullPageLoader`
|
package/README.md
CHANGED
|
@@ -42,6 +42,17 @@ export function Example() {
|
|
|
42
42
|
|
|
43
43
|
The stylesheet is safe to import globally: it does not ship Tailwind preflight, page-level resets, global font-face declarations, unprefixed utilities, or generic keyframes. React surfaces should still render inside `BfrsProvider`; the provider owns `--bfrs-*` theme variables and passes the same scope to Radix portals.
|
|
44
44
|
|
|
45
|
+
### Optional: bundled SF Pro font
|
|
46
|
+
|
|
47
|
+
The main stylesheet only references the SF Pro family by name (`--bfrs-font-sans`) — it ships no font files, so by default you supply the font. To have the library download and apply SF Pro across your **whole app**, additionally import the opt-in font stylesheet once at your entry point:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import "@bfrs/agentic-components/styles";
|
|
51
|
+
import "@bfrs/agentic-components/fonts.css";
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This bundles the SF Pro Display webfont (relative URLs, so any base path works), defines `--bfrs-font-sans` at the document root, and applies it to `html, body`. Keeping it separate means the main stylesheet stays free of global `@font-face`/`html`/`body` rules.
|
|
55
|
+
|
|
45
56
|
Most DOM-backed components forward compatible React props such as `onClick`, `onKeyDown`, `aria-*`, `data-*`, `className`, `style`, and refs. Controlled components expose explicit callbacks such as `onValueChange`, `onOpenChange`, `onSort`, `onRowClick`, and `onPageChange`.
|
|
46
57
|
|
|
47
58
|
Library-owned Tailwind utilities are prefixed with `bfrs-`, for example `bfrs-flex`, `hover:bfrs-bg-primary`, and `bfrs-animate-shimmer`. Unprefixed classes passed through `className` are treated as host-app classes.
|
|
@@ -60,14 +71,17 @@ import "@bfrs/agentic-components/custom-elements";
|
|
|
60
71
|
```scss
|
|
61
72
|
/* styles.scss */
|
|
62
73
|
@import "@bfrs/agentic-components/styles";
|
|
74
|
+
/* Optional — bundled SF Pro, applied to the whole app: */
|
|
75
|
+
@import "@bfrs/agentic-components/fonts.css";
|
|
63
76
|
```
|
|
64
77
|
|
|
65
|
-
If Angular does not resolve the package style export, add the built CSS
|
|
78
|
+
If Angular does not resolve the package style export, add the built CSS files in `angular.json`:
|
|
66
79
|
|
|
67
80
|
```json
|
|
68
81
|
{
|
|
69
82
|
"styles": [
|
|
70
83
|
"node_modules/@bfrs/agentic-components/dist/style.css",
|
|
84
|
+
"node_modules/@bfrs/agentic-components/dist/fonts.css",
|
|
71
85
|
"src/styles.scss"
|
|
72
86
|
]
|
|
73
87
|
}
|
|
@@ -5,6 +5,8 @@ export type ChatComposerProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
5
5
|
onSubmit?: () => void;
|
|
6
6
|
loading?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
/** `"sm"` is a compact composer for inline/sidebar placements; `"md"` is the default. */
|
|
9
|
+
size?: "sm" | "md";
|
|
8
10
|
attachmentSlot?: ReactNode;
|
|
9
11
|
actionSlot?: ReactNode;
|
|
10
12
|
};
|
|
@@ -14,6 +16,8 @@ export declare const ChatComposer: import('react').ForwardRefExoticComponent<Omi
|
|
|
14
16
|
onSubmit?: () => void;
|
|
15
17
|
loading?: boolean;
|
|
16
18
|
disabled?: boolean;
|
|
19
|
+
/** `"sm"` is a compact composer for inline/sidebar placements; `"md"` is the default. */
|
|
20
|
+
size?: "sm" | "md";
|
|
17
21
|
attachmentSlot?: ReactNode;
|
|
18
22
|
actionSlot?: ReactNode;
|
|
19
23
|
} & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const textVariants: (props?: ({
|
|
4
|
-
variant?: "caption" | "display" | "body" | "title" | "h1" | "h2" | "h3" | "label" | "body-sm" | null | undefined;
|
|
4
|
+
variant?: "caption" | "display" | "body" | "title" | "h1" | "h2" | "h3" | "label" | "body-sm" | "body-xs" | null | undefined;
|
|
5
5
|
tone?: "accent" | "primary" | "success" | "danger" | "disabled" | "muted" | "secondary" | null | undefined;
|
|
6
|
+
weight?: "normal" | "medium" | "bold" | "semibold" | null | undefined;
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
8
|
export type TextProps = HTMLAttributes<HTMLElement> & VariantProps<typeof textVariants> & {
|
|
8
9
|
as?: ElementType;
|
|
9
10
|
};
|
|
10
11
|
export declare const Text: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & VariantProps<(props?: ({
|
|
11
|
-
variant?: "caption" | "display" | "body" | "title" | "h1" | "h2" | "h3" | "label" | "body-sm" | null | undefined;
|
|
12
|
+
variant?: "caption" | "display" | "body" | "title" | "h1" | "h2" | "h3" | "label" | "body-sm" | "body-xs" | null | undefined;
|
|
12
13
|
tone?: "accent" | "primary" | "success" | "danger" | "disabled" | "muted" | "secondary" | null | undefined;
|
|
14
|
+
weight?: "normal" | "medium" | "bold" | "semibold" | null | undefined;
|
|
13
15
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
|
|
14
16
|
as?: ElementType;
|
|
15
17
|
} & import('react').RefAttributes<HTMLElement>>;
|