@factorialco/f0-react 14.1.0 → 14.2.0
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/dist/component-status.js +2 -2
- package/dist/experimental.d.ts +3 -1
- package/dist/experimental.js +31 -29
- package/package.json +1 -1
package/dist/component-status.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useCallback as i, useEffect as a, useRef as o, useState as s } from "re
|
|
|
4
4
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
5
|
//#region \0virtual:f0-component-status-data
|
|
6
6
|
var u = {
|
|
7
|
-
generatedAt: "2026-11-
|
|
7
|
+
generatedAt: "2026-11-11T08:52:17.529Z",
|
|
8
8
|
stats: {
|
|
9
9
|
total: 313,
|
|
10
10
|
byStatus: {
|
|
@@ -1083,7 +1083,7 @@ var u = {
|
|
|
1083
1083
|
hasWhenToUse: !0,
|
|
1084
1084
|
hasWhenNotToUse: !0,
|
|
1085
1085
|
hasDoDonts: !0,
|
|
1086
|
-
exampleCount:
|
|
1086
|
+
exampleCount: 6
|
|
1087
1087
|
},
|
|
1088
1088
|
a11yTier: "enforced",
|
|
1089
1089
|
storyFile: "elements/F0Resizable/__stories__/F0Resizable.stories.tsx"
|
package/dist/experimental.d.ts
CHANGED
|
@@ -750,6 +750,8 @@ type ResizableDirection = (typeof resizableDirections)[number];
|
|
|
750
750
|
interface F0ResizableProps {
|
|
751
751
|
direction?: ResizableDirection;
|
|
752
752
|
children: ReactNode;
|
|
753
|
+
initialSize?: number;
|
|
754
|
+
onSizeChange?: (size: number) => void;
|
|
753
755
|
}
|
|
754
756
|
interface F0ResizablePanelProps {
|
|
755
757
|
children: ReactNode;
|
|
@@ -774,7 +776,7 @@ declare namespace F0ResizablePanel {
|
|
|
774
776
|
}
|
|
775
777
|
//#endregion
|
|
776
778
|
//#region src/elements/F0Resizable/F0Resizable.d.ts
|
|
777
|
-
declare const F0ResizableComponent: ({ direction, children }: F0ResizableProps) => import("react").JSX.Element;
|
|
779
|
+
declare const F0ResizableComponent: ({ direction, children, initialSize, onSizeChange }: F0ResizableProps) => import("react").JSX.Element;
|
|
778
780
|
export declare const F0Resizable: import("react").ForwardRefExoticComponent<F0ResizableProps & WithDataTestIdProps & import("react").RefAttributes<unknown>> & Pick<typeof F0ResizableComponent, never> & {
|
|
779
781
|
Panel: typeof F0ResizablePanel;
|
|
780
782
|
Handle: typeof F0ResizableHandle;
|
package/dist/experimental.js
CHANGED
|
@@ -2380,53 +2380,55 @@ var Tp = 30, Ep = 50, Dp = (e, t, n) => Math.min(Math.max(e, t), n), Op = (e) =>
|
|
|
2380
2380
|
max: r,
|
|
2381
2381
|
defaultSize: Dp(i, n, r)
|
|
2382
2382
|
};
|
|
2383
|
-
}, Mp = Object.assign(Sn(En("F0Resizable", ({ direction: e = "horizontal", children: t }) => {
|
|
2384
|
-
let
|
|
2385
|
-
if (
|
|
2386
|
-
let
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
]),
|
|
2392
|
-
|
|
2393
|
-
}, [
|
|
2383
|
+
}, Mp = Object.assign(Sn(En("F0Resizable", ({ direction: e = "horizontal", children: t, initialSize: n, onSizeChange: r }) => {
|
|
2384
|
+
let i = R(), a = Y(null), o = Y(null), s = Wn({ ref: a }), c = Op(t), [l, u, d] = c;
|
|
2385
|
+
if (c.length !== 3 || !kp(l) || !Ap(u) || !kp(d)) throw Error("F0Resizable: children must be exactly F0Resizable.Panel, F0Resizable.Handle and F0Resizable.Panel, in this order.");
|
|
2386
|
+
let f = l.props, p = d.props, m = u.props, { min: h, max: g, defaultSize: _ } = jp(f, p), v = e === "horizontal", y = (v ? s.width : s.height) ?? 0, [b, x] = X(() => n !== void 0 && Number.isFinite(n) ? n : _), S = Dp(b, h, g), C = (e) => Math.round(y * e / 100), w = G((e) => y > 0 ? Dp(e / y * 100, h, g) : S, [
|
|
2387
|
+
S,
|
|
2388
|
+
y,
|
|
2389
|
+
g,
|
|
2390
|
+
h
|
|
2391
|
+
]), T = G((e) => {
|
|
2392
|
+
o.current?.style.setProperty("flex-basis", `${w(e)}%`);
|
|
2393
|
+
}, [w]), E = (e) => {
|
|
2394
|
+
x(e), r?.(e);
|
|
2395
|
+
};
|
|
2394
2396
|
return /* @__PURE__ */ $(Ss, {
|
|
2395
|
-
ref:
|
|
2397
|
+
ref: a,
|
|
2396
2398
|
display: "flex",
|
|
2397
|
-
flexDirection:
|
|
2399
|
+
flexDirection: v ? "row" : "column",
|
|
2398
2400
|
width: "full",
|
|
2399
2401
|
height: "full",
|
|
2400
2402
|
minHeight: "0",
|
|
2401
2403
|
children: [
|
|
2402
2404
|
/* @__PURE__ */ Q("div", {
|
|
2403
|
-
ref:
|
|
2404
|
-
className: B("min-h-0 min-w-0 shrink-0 overflow-y-auto overflow-x-hidden",
|
|
2405
|
-
style: { flexBasis: `${
|
|
2406
|
-
children:
|
|
2405
|
+
ref: o,
|
|
2406
|
+
className: B("min-h-0 min-w-0 shrink-0 overflow-y-auto overflow-x-hidden", v ? "h-full" : "w-full"),
|
|
2407
|
+
style: { flexBasis: `${S}%` },
|
|
2408
|
+
children: f.children
|
|
2407
2409
|
}),
|
|
2408
2410
|
/* @__PURE__ */ Q(Sp, {
|
|
2409
|
-
value:
|
|
2410
|
-
min:
|
|
2411
|
-
max:
|
|
2412
|
-
growsTowards:
|
|
2413
|
-
ariaLabel:
|
|
2414
|
-
valueText:
|
|
2411
|
+
value: C(S),
|
|
2412
|
+
min: C(h),
|
|
2413
|
+
max: C(g),
|
|
2414
|
+
growsTowards: v ? "right" : "down",
|
|
2415
|
+
ariaLabel: m.ariaLabel ?? i.resizable.resize,
|
|
2416
|
+
valueText: i.t("resizable.size", { size: Math.round(S) }),
|
|
2415
2417
|
divider: !0,
|
|
2416
2418
|
grip: !0,
|
|
2417
|
-
onPreview:
|
|
2418
|
-
onCommit: (e) =>
|
|
2419
|
-
onReset: () =>
|
|
2419
|
+
onPreview: T,
|
|
2420
|
+
onCommit: (e) => E(w(e)),
|
|
2421
|
+
onReset: () => E(_)
|
|
2420
2422
|
}),
|
|
2421
2423
|
/* @__PURE__ */ Q(Ss, {
|
|
2422
2424
|
grow: !0,
|
|
2423
2425
|
minWidth: "0",
|
|
2424
2426
|
minHeight: "0",
|
|
2425
|
-
width:
|
|
2426
|
-
height:
|
|
2427
|
+
width: v ? void 0 : "full",
|
|
2428
|
+
height: v ? "full" : void 0,
|
|
2427
2429
|
overflowY: "auto",
|
|
2428
2430
|
overflowX: "hidden",
|
|
2429
|
-
children:
|
|
2431
|
+
children: p.children
|
|
2430
2432
|
})
|
|
2431
2433
|
]
|
|
2432
2434
|
});
|