@bfrs/agentic-components 0.3.0 → 0.3.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 +15 -1
- package/README.md +15 -1
- package/dist/components/ui/primitives/Text/Text.d.ts +4 -2
- package/dist/custom-elements.js +20 -8
- 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 +17 -6
- 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`
|
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
|
}
|
|
@@ -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>>;
|
package/dist/custom-elements.js
CHANGED
|
@@ -34070,10 +34070,10 @@ const fR = f.forwardRef(
|
|
|
34070
34070
|
const D = b !== void 0, [O, _] = f.useState(w), L = D ? b : O, z = (J = n.find((ee) => ee.value === L)) == null ? void 0 : J.label, F = f.useRef(null), [H, W] = f.useState(!1);
|
|
34071
34071
|
f.useEffect(() => {
|
|
34072
34072
|
const ee = F.current;
|
|
34073
|
-
if (!ee || typeof ResizeObserver > "u") return;
|
|
34073
|
+
if (!ee || typeof globalThis.ResizeObserver > "u") return;
|
|
34074
34074
|
const ye = () => W(ee.scrollWidth > ee.clientWidth + 1);
|
|
34075
34075
|
ye();
|
|
34076
|
-
const je = new ResizeObserver(ye);
|
|
34076
|
+
const je = new globalThis.ResizeObserver(ye);
|
|
34077
34077
|
return je.observe(ee), () => je.disconnect();
|
|
34078
34078
|
}, [z]);
|
|
34079
34079
|
const Y = (ee) => {
|
|
@@ -34258,6 +34258,7 @@ const _U = Ki("bfrs-tracking-normal", {
|
|
|
34258
34258
|
title: "bfrs-text-xl bfrs-font-semibold bfrs-leading-snug",
|
|
34259
34259
|
body: "bfrs-text-base bfrs-font-normal bfrs-leading-7",
|
|
34260
34260
|
"body-sm": "bfrs-text-sm bfrs-font-normal bfrs-leading-[1.45]",
|
|
34261
|
+
"body-xs": "bfrs-text-[12px] bfrs-font-normal bfrs-leading-[1.4]",
|
|
34261
34262
|
caption: "bfrs-text-xs bfrs-font-normal bfrs-leading-normal",
|
|
34262
34263
|
label: "bfrs-text-[10px] bfrs-font-bold bfrs-uppercase bfrs-leading-normal bfrs-tracking-[0.16em]"
|
|
34263
34264
|
},
|
|
@@ -34269,6 +34270,15 @@ const _U = Ki("bfrs-tracking-normal", {
|
|
|
34269
34270
|
danger: "bfrs-text-danger",
|
|
34270
34271
|
success: "bfrs-text-success",
|
|
34271
34272
|
accent: "bfrs-text-accent"
|
|
34273
|
+
},
|
|
34274
|
+
// Optional override for each variant's default weight — e.g. make a small
|
|
34275
|
+
// caption bold, or a large heading normal. Applied after the variant class,
|
|
34276
|
+
// so it wins the font-weight conflict via tailwind-merge in cn().
|
|
34277
|
+
weight: {
|
|
34278
|
+
normal: "bfrs-font-normal",
|
|
34279
|
+
medium: "bfrs-font-medium",
|
|
34280
|
+
semibold: "bfrs-font-semibold",
|
|
34281
|
+
bold: "bfrs-font-bold"
|
|
34272
34282
|
}
|
|
34273
34283
|
},
|
|
34274
34284
|
defaultVariants: {
|
|
@@ -34283,11 +34293,12 @@ const _U = Ki("bfrs-tracking-normal", {
|
|
|
34283
34293
|
title: "p",
|
|
34284
34294
|
body: "p",
|
|
34285
34295
|
"body-sm": "p",
|
|
34296
|
+
"body-xs": "p",
|
|
34286
34297
|
caption: "p",
|
|
34287
34298
|
label: "span"
|
|
34288
|
-
}, O1 = f.forwardRef(({ as: n, className: i, variant: o, tone: d,
|
|
34289
|
-
const
|
|
34290
|
-
return /* @__PURE__ */ p.jsx(
|
|
34299
|
+
}, O1 = f.forwardRef(({ as: n, className: i, variant: o, tone: d, weight: m, ...g }, b) => {
|
|
34300
|
+
const w = o ?? "body", E = n ?? LU[w];
|
|
34301
|
+
return /* @__PURE__ */ p.jsx(E, { ref: b, className: G(_U({ variant: w, tone: d, weight: m }), i), ...g });
|
|
34291
34302
|
});
|
|
34292
34303
|
O1.displayName = "Text";
|
|
34293
34304
|
const oS = {
|
|
@@ -35338,7 +35349,7 @@ function GR({
|
|
|
35338
35349
|
{
|
|
35339
35350
|
"aria-label": g,
|
|
35340
35351
|
title: g,
|
|
35341
|
-
variant: "
|
|
35352
|
+
variant: "secondary",
|
|
35342
35353
|
size: "sm",
|
|
35343
35354
|
className: G(
|
|
35344
35355
|
"bfrs-size-[26px] bfrs-rounded-[6px] bfrs-bg-surface-card bfrs-text-text-muted hover:bfrs-bg-primary-soft",
|
|
@@ -36201,7 +36212,7 @@ class ck extends ys {
|
|
|
36201
36212
|
Re(ck, "tagName", "grid");
|
|
36202
36213
|
class fk extends ys {
|
|
36203
36214
|
static get observedAttributes() {
|
|
36204
|
-
return ["as", "tone", "variant", ...Be];
|
|
36215
|
+
return ["as", "tone", "variant", "weight", ...Be];
|
|
36205
36216
|
}
|
|
36206
36217
|
component() {
|
|
36207
36218
|
return O1;
|
|
@@ -36211,7 +36222,8 @@ class fk extends ys {
|
|
|
36211
36222
|
as: this.textAttribute("as"),
|
|
36212
36223
|
className: this.classNameAttribute(),
|
|
36213
36224
|
tone: this.textAttribute("tone", "primary"),
|
|
36214
|
-
variant: this.textAttribute("variant", "body")
|
|
36225
|
+
variant: this.textAttribute("variant", "body"),
|
|
36226
|
+
weight: this.textAttribute("weight")
|
|
36215
36227
|
};
|
|
36216
36228
|
}
|
|
36217
36229
|
}
|