@fibery/ui-kit 9.1.3 → 9.2.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/lib/actions-menu/actions-menu-item.d.ts +2 -0
- package/lib/actions-menu/actions-menu-item.js +4 -4
- package/lib/actions-menu/context-actions-menu.js +11 -2
- package/lib/board-table-loader.js +1 -1
- package/lib/card-container.js +1 -1
- package/lib/design-system/alpha-coefficients.d.ts +2 -0
- package/lib/design-system/alpha-coefficients.js +2 -0
- package/lib/design-system/colors.d.ts +4 -0
- package/lib/design-system/colors.js +2 -0
- package/lib/design-system/skeleton.d.ts +7 -0
- package/lib/design-system/skeleton.js +18 -0
- package/lib/design-system/theme.d.ts +10 -0
- package/lib/design-system.d.ts +2 -1
- package/lib/design-system.js +2 -1
- package/lib/file-item.js +14 -14
- package/lib/file-item.wyw-in-js.css +10 -11
- package/lib/icons/react/integration-claude.js +1 -1
- package/lib/icons/react/integration-gemini.js +1 -1
- package/lib/icons/react/integration-openai.js +1 -1
- package/lib/loaders.js +4 -8
- package/lib/number-input/number-input.js +13 -5
- package/lib/pretty-size.d.ts +1 -1
- package/lib/pretty-size.js +3 -3
- package/lib/rich-input-loader.js +5 -11
- package/lib/rich-input-loader.wyw-in-js.css +2 -3
- package/lib/root-theme-provider.wyw-in-js.css +1 -1
- package/lib/scroll-fade.d.ts +6 -0
- package/lib/scroll-fade.js +16 -0
- package/lib/scroll-fade.wyw-in-js.css +13 -0
- package/lib/select/index.js +4 -3
- package/lib/select/index.wyw-in-js.css +3 -3
- package/lib/select/select-control-settings-context.d.ts +3 -1
- package/lib/select/select-control-settings-context.js +5 -3
- package/lib/select/select-in-popover.js +2 -0
- package/lib/skeleton-card.d.ts +7 -0
- package/lib/skeleton-card.js +16 -0
- package/lib/skeleton-card.wyw-in-js.css +2 -0
- package/lib/skeleton.d.ts +29 -7
- package/lib/skeleton.js +17 -6
- package/lib/skeleton.wyw-in-js.css +2 -0
- package/lib/spinner-box.d.ts +12 -0
- package/lib/spinner-box.js +23 -0
- package/lib/spinner-box.wyw-in-js.css +2 -0
- package/lib/tab-nav/tab-nav.js +1 -1
- package/lib/theme-provider.d.ts +2 -0
- package/lib/theming.generated.d.ts +10 -0
- package/lib/theming.generated.js +10 -0
- package/lib/tooltip.js +1 -0
- package/lib/tree-utils.d.ts +11 -19
- package/lib/unit/loading-unit-value.d.ts +1 -2
- package/lib/unit/loading-unit-value.js +1 -2
- package/lib/unit/maybe-unit-value.js +1 -4
- package/lib/unit/nav-button.d.ts +1 -0
- package/lib/unit/nav-button.js +8 -5
- package/package.json +3 -3
- package/lib/animated-number.d.ts +0 -12
- package/lib/animated-number.js +0 -32
- package/lib/tsfixme.d.ts +0 -4
- package/lib/tsfixme.js +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./skeleton-card.wyw-in-js.css";
|
|
2
|
+
import { Box } from "./box.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/skeleton-card.tsx
|
|
6
|
+
var cardStyle = "cp0t8zc-card";
|
|
7
|
+
var cardContentStyle = "c770980-cardContent";
|
|
8
|
+
var SkeletonCard = ({ children }) => /* @__PURE__ */ jsx("div", {
|
|
9
|
+
className: cardStyle,
|
|
10
|
+
children: jsx(Box, { children: /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: cardContentStyle,
|
|
12
|
+
children
|
|
13
|
+
}) })
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { SkeletonCard };
|
package/lib/skeleton.d.ts
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
|
+
import { SkeletonHeight, SkeletonWidth } from "./design-system/skeleton.js";
|
|
2
|
+
import "./design-system.js";
|
|
1
3
|
import { ComponentType, ReactNode } from "react";
|
|
2
4
|
//#region src/skeleton.d.ts
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type SkeletonBaseProps = {
|
|
6
|
+
/** Bar height, one step of the scale — the type scale it stands in for picks the step. */
|
|
7
|
+
height?: SkeletonHeight;
|
|
8
|
+
/**
|
|
9
|
+
* 1:1 plate sized to the element it replaces — an icon, a checkbox, an avatar — rather than to a
|
|
10
|
+
* step of the bar scale. Overrides height and width. dt#1620 replaces it with the Square shape.
|
|
11
|
+
*/
|
|
12
|
+
size?: number;
|
|
7
13
|
inverted?: boolean;
|
|
8
14
|
animateAppearance?: boolean;
|
|
9
15
|
margins?: boolean;
|
|
10
16
|
index?: number;
|
|
11
17
|
};
|
|
12
|
-
|
|
18
|
+
/**
|
|
19
|
+
* A bar is either one known width, or a range to generate one within when the width is not
|
|
20
|
+
* known. Both ends are required for a range, so a fixed width has exactly one spelling.
|
|
21
|
+
*/
|
|
22
|
+
type SkeletonWidthProps = {
|
|
23
|
+
width?: SkeletonWidth;
|
|
24
|
+
minWidth?: never;
|
|
25
|
+
maxWidth?: never;
|
|
26
|
+
} | {
|
|
27
|
+
width?: never;
|
|
28
|
+
minWidth: SkeletonWidth;
|
|
29
|
+
maxWidth: SkeletonWidth;
|
|
30
|
+
};
|
|
31
|
+
type SkeletonProps = SkeletonBaseProps & SkeletonWidthProps;
|
|
32
|
+
declare const Skeleton: import("react").MemoExoticComponent<({ height, width, minWidth, maxWidth, size, index, margins, animateAppearance }: SkeletonProps) => JSX.Element>;
|
|
13
33
|
type SkeletonListProps = {
|
|
14
34
|
amount?: number;
|
|
15
35
|
minAmount?: number;
|
|
@@ -17,7 +37,9 @@ type SkeletonListProps = {
|
|
|
17
37
|
WrapperComponent?: ComponentType<{
|
|
18
38
|
children: ReactNode;
|
|
19
39
|
}> | null;
|
|
20
|
-
} & Omit<
|
|
40
|
+
} & Omit<SkeletonBaseProps, "index"> & SkeletonWidthProps;
|
|
21
41
|
declare const SkeletonList: import("react").NamedExoticComponent<SkeletonListProps>;
|
|
42
|
+
declare const SkeletonTextLine: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
|
43
|
+
declare const PageContentSkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
22
44
|
//#endregion
|
|
23
|
-
export { Skeleton, SkeletonList, SkeletonProps };
|
|
45
|
+
export { PageContentSkeleton, Skeleton, SkeletonList, SkeletonProps, SkeletonTextLine };
|
package/lib/skeleton.js
CHANGED
|
@@ -16,13 +16,14 @@ var Container = /*#__PURE__*/ styled("div")({
|
|
|
16
16
|
propsAsIs: false,
|
|
17
17
|
vars: { "cjtjcsl-0": [_exp4()] }
|
|
18
18
|
});
|
|
19
|
-
var Skeleton = memo(function Skeleton({
|
|
20
|
-
const [
|
|
19
|
+
var Skeleton = memo(function Skeleton({ height = 12, width, minWidth, maxWidth, size, index, margins = true, animateAppearance = false }) {
|
|
20
|
+
const [generatedWidth] = useState(() => getRandomInt(minWidth ?? width ?? 80, maxWidth ?? width ?? 120, index));
|
|
21
|
+
const barHeight = size ?? height;
|
|
21
22
|
return /* @__PURE__ */ jsx(Container, {
|
|
22
|
-
height,
|
|
23
|
+
height: barHeight,
|
|
23
24
|
style: {
|
|
24
|
-
width,
|
|
25
|
-
height
|
|
25
|
+
width: size ?? generatedWidth,
|
|
26
|
+
height: barHeight
|
|
26
27
|
},
|
|
27
28
|
className: cx(skeletonStyle, margins && marginStyle, animateAppearance && skeletonAppearanceStyle)
|
|
28
29
|
});
|
|
@@ -43,5 +44,15 @@ var SkeletonList = memo(function SkeletonList({ amount, minAmount = 1, maxAmount
|
|
|
43
44
|
}, index);
|
|
44
45
|
}) });
|
|
45
46
|
});
|
|
47
|
+
var SkeletonTextLine = /*#__PURE__*/ styled("div")({
|
|
48
|
+
name: "SkeletonTextLine",
|
|
49
|
+
class: "s1uzetk8-SkeletonTextLine",
|
|
50
|
+
propsAsIs: false
|
|
51
|
+
});
|
|
52
|
+
var pageContentStyle = "p13qksqz-pageContent";
|
|
53
|
+
var PageContentSkeleton = () => /* @__PURE__ */ jsx("div", {
|
|
54
|
+
className: pageContentStyle,
|
|
55
|
+
children: jsx(SkeletonList, { amount: 3 })
|
|
56
|
+
});
|
|
46
57
|
//#endregion
|
|
47
|
-
export { Skeleton, SkeletonList };
|
|
58
|
+
export { PageContentSkeleton, Skeleton, SkeletonList, SkeletonTextLine };
|
|
@@ -2,3 +2,5 @@
|
|
|
2
2
|
.mzl91bk-margin{margin-top:4px;margin-bottom:4px;}
|
|
3
3
|
.siugmrr-skeletonAppearance{animation:OpacityAnim-siugmrr-skeletonAppearance 1s cubic-bezier(0.95, 0.05, 0.795, 0.035) 1;}@keyframes OpacityAnim-siugmrr-skeletonAppearance{0%{opacity:0;}100%{opacity:1;}}
|
|
4
4
|
.cjtjcsl-Container::before,.cjtjcsl-Container::after{border-radius:var(--cjtjcsl-0);}
|
|
5
|
+
.s1uzetk8-SkeletonTextLine{padding-top:1px;}
|
|
6
|
+
.p13qksqz-pageContent{padding:12px;}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IconBaseProps } from "./icons/types.js";
|
|
2
|
+
//#region src/spinner-box.d.ts
|
|
3
|
+
type SpinnerBoxProps = {
|
|
4
|
+
minHeight?: number;
|
|
5
|
+
height?: number | "fill";
|
|
6
|
+
width?: number | "fill";
|
|
7
|
+
overlay?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
} & IconBaseProps;
|
|
10
|
+
declare const SpinnerBox: import("react").NamedExoticComponent<SpinnerBoxProps>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { SpinnerBox, SpinnerBoxProps };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "./spinner-box.wyw-in-js.css";
|
|
2
|
+
import { Spinner } from "./spinner.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { memo } from "react";
|
|
6
|
+
import { cx } from "@linaria/core";
|
|
7
|
+
//#region src/spinner-box.tsx
|
|
8
|
+
var boxStyle = "ban45ip-box";
|
|
9
|
+
var overlayStyle = "om0do2z-overlay";
|
|
10
|
+
var fillable = (value) => value === "fill" ? "100%" : value;
|
|
11
|
+
var SpinnerBox = memo(function SpinnerBox({ minHeight, height, width, overlay = false, className, ...spinnerProps }) {
|
|
12
|
+
return /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: cx(boxStyle, overlay && overlayStyle, className),
|
|
14
|
+
style: {
|
|
15
|
+
minHeight,
|
|
16
|
+
height: fillable(height),
|
|
17
|
+
width: fillable(width)
|
|
18
|
+
},
|
|
19
|
+
children: jsx(Spinner, { ...spinnerProps })
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SpinnerBox };
|
package/lib/tab-nav/tab-nav.js
CHANGED
|
@@ -7,8 +7,8 @@ import { createContext } from "@fibery/react/src/create-context";
|
|
|
7
7
|
import { forwardRef, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
8
8
|
import { cx } from "@linaria/core";
|
|
9
9
|
import { useResizeObserver } from "@fibery/react/src/use-resize-observer";
|
|
10
|
-
import { useComposedRefs } from "@fibery/react/src/use-composed-refs";
|
|
11
10
|
import { useCallbackRef } from "@fibery/react/src/use-callback-ref";
|
|
11
|
+
import { useComposedRefs } from "@fibery/react/src/use-composed-refs";
|
|
12
12
|
import { NavigationMenu, NavigationMenuItem, NavigationMenuLink, NavigationMenuList } from "@radix-ui/react-navigation-menu";
|
|
13
13
|
//#region src/tab-nav/tab-nav.tsx
|
|
14
14
|
var tabNavIndicatorWidth = 100;
|
package/lib/theme-provider.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ declare const ThemeContext: import("react").Context<{
|
|
|
44
44
|
readonly mainBg: string;
|
|
45
45
|
readonly panelBg: string;
|
|
46
46
|
readonly panelBorder: string;
|
|
47
|
+
readonly panelShadowFocused: string;
|
|
48
|
+
readonly panelShadowUnfocused: string;
|
|
47
49
|
readonly panelContentBg: string;
|
|
48
50
|
readonly dbSettingsSidebarBg: string;
|
|
49
51
|
readonly dbSettingsSidebarItemHover: string;
|
|
@@ -58,6 +58,8 @@ declare const themeVars: {
|
|
|
58
58
|
readonly mainBg: "var(--mainBg)";
|
|
59
59
|
readonly panelBg: "var(--panelBg)";
|
|
60
60
|
readonly panelBorder: "var(--panelBorder)";
|
|
61
|
+
readonly panelShadowFocused: "var(--panelShadowFocused)";
|
|
62
|
+
readonly panelShadowUnfocused: "var(--panelShadowUnfocused)";
|
|
61
63
|
readonly panelContentBg: "var(--panelContentBg)";
|
|
62
64
|
readonly dbSettingsSidebarBg: "var(--dbSettingsSidebarBg)";
|
|
63
65
|
readonly dbSettingsSidebarItemHover: "var(--dbSettingsSidebarItemHover)";
|
|
@@ -618,6 +620,8 @@ declare const neutralStyles: {
|
|
|
618
620
|
readonly "--mainBg": "rgb(245,245,245)";
|
|
619
621
|
readonly "--panelBg": "rgb(255,255,255)";
|
|
620
622
|
readonly "--panelBorder": "0 0 0 1px rgba(199, 199, 199, 0.2)";
|
|
623
|
+
readonly "--panelShadowFocused": "0 0 0 1px rgba(199, 199, 199, 0.45), 0 8px 12px 0 rgba(0,0,0,0.09)";
|
|
624
|
+
readonly "--panelShadowUnfocused": "0 0 0 1px rgba(199, 199, 199, 0.2), 0 2px 4px 0 rgba(0,0,0,0.05)";
|
|
621
625
|
readonly "--panelContentBg": "rgb(247,247,247)";
|
|
622
626
|
readonly "--dbSettingsSidebarBg": "rgb(247,247,247)";
|
|
623
627
|
readonly "--dbSettingsSidebarItemHover": "rgb(237,237,237)";
|
|
@@ -1167,6 +1171,8 @@ declare const neutralStyles: {
|
|
|
1167
1171
|
readonly "--mainBg": "rgb(36,36,36)";
|
|
1168
1172
|
readonly "--panelBg": "rgb(23,23,23)";
|
|
1169
1173
|
readonly "--panelBorder": "0 0 0 1px rgba(82, 82, 82, 0.2)";
|
|
1174
|
+
readonly "--panelShadowFocused": "0 0 0 1px rgba(82, 82, 82, 0.5)";
|
|
1175
|
+
readonly "--panelShadowUnfocused": "0 0 0 1px rgba(82, 82, 82, 0.1)";
|
|
1170
1176
|
readonly "--panelContentBg": "rgb(23,23,23)";
|
|
1171
1177
|
readonly "--dbSettingsSidebarBg": "rgb(28,28,28)";
|
|
1172
1178
|
readonly "--dbSettingsSidebarItemHover": "rgb(41,41,41)";
|
|
@@ -1718,6 +1724,8 @@ declare const warmStyles: {
|
|
|
1718
1724
|
readonly "--mainBg": "rgb(250,244,236)";
|
|
1719
1725
|
readonly "--panelBg": "rgb(255,253,250)";
|
|
1720
1726
|
readonly "--panelBorder": "0 0 0 1px rgba(204, 198, 191, 0.2)";
|
|
1727
|
+
readonly "--panelShadowFocused": "0 0 0 1px rgba(204, 198, 191, 0.45), 0 8px 12px 0 rgba(0,0,0,0.09)";
|
|
1728
|
+
readonly "--panelShadowUnfocused": "0 0 0 1px rgba(204, 198, 191, 0.2), 0 2px 4px 0 rgba(0,0,0,0.05)";
|
|
1721
1729
|
readonly "--panelContentBg": "rgb(253,246,239)";
|
|
1722
1730
|
readonly "--dbSettingsSidebarBg": "rgb(253,246,239)";
|
|
1723
1731
|
readonly "--dbSettingsSidebarItemHover": "rgb(243,236,229)";
|
|
@@ -2267,6 +2275,8 @@ declare const warmStyles: {
|
|
|
2267
2275
|
readonly "--mainBg": "rgb(39,35,33)";
|
|
2268
2276
|
readonly "--panelBg": "rgb(26,22,20)";
|
|
2269
2277
|
readonly "--panelBorder": "0 0 0 1px rgba(86, 80, 78, 0.2)";
|
|
2278
|
+
readonly "--panelShadowFocused": "0 0 0 1px rgba(86, 80, 78, 0.5)";
|
|
2279
|
+
readonly "--panelShadowUnfocused": "0 0 0 1px rgba(86, 80, 78, 0.1)";
|
|
2270
2280
|
readonly "--panelContentBg": "rgb(26,22,20)";
|
|
2271
2281
|
readonly "--dbSettingsSidebarBg": "rgb(32,27,25)";
|
|
2272
2282
|
readonly "--dbSettingsSidebarItemHover": "rgb(45,40,38)";
|
package/lib/theming.generated.js
CHANGED
|
@@ -58,6 +58,8 @@ var themeVars = {
|
|
|
58
58
|
mainBg: "var(--mainBg)",
|
|
59
59
|
panelBg: "var(--panelBg)",
|
|
60
60
|
panelBorder: "var(--panelBorder)",
|
|
61
|
+
panelShadowFocused: "var(--panelShadowFocused)",
|
|
62
|
+
panelShadowUnfocused: "var(--panelShadowUnfocused)",
|
|
61
63
|
panelContentBg: "var(--panelContentBg)",
|
|
62
64
|
dbSettingsSidebarBg: "var(--dbSettingsSidebarBg)",
|
|
63
65
|
dbSettingsSidebarItemHover: "var(--dbSettingsSidebarItemHover)",
|
|
@@ -618,6 +620,8 @@ var neutralStyles = {
|
|
|
618
620
|
"--mainBg": "rgb(245,245,245)",
|
|
619
621
|
"--panelBg": "rgb(255,255,255)",
|
|
620
622
|
"--panelBorder": "0 0 0 1px rgba(199, 199, 199, 0.2)",
|
|
623
|
+
"--panelShadowFocused": "0 0 0 1px rgba(199, 199, 199, 0.45), 0 8px 12px 0 rgba(0,0,0,0.09)",
|
|
624
|
+
"--panelShadowUnfocused": "0 0 0 1px rgba(199, 199, 199, 0.2), 0 2px 4px 0 rgba(0,0,0,0.05)",
|
|
621
625
|
"--panelContentBg": "rgb(247,247,247)",
|
|
622
626
|
"--dbSettingsSidebarBg": "rgb(247,247,247)",
|
|
623
627
|
"--dbSettingsSidebarItemHover": "rgb(237,237,237)",
|
|
@@ -1167,6 +1171,8 @@ var neutralStyles = {
|
|
|
1167
1171
|
"--mainBg": "rgb(36,36,36)",
|
|
1168
1172
|
"--panelBg": "rgb(23,23,23)",
|
|
1169
1173
|
"--panelBorder": "0 0 0 1px rgba(82, 82, 82, 0.2)",
|
|
1174
|
+
"--panelShadowFocused": "0 0 0 1px rgba(82, 82, 82, 0.5)",
|
|
1175
|
+
"--panelShadowUnfocused": "0 0 0 1px rgba(82, 82, 82, 0.1)",
|
|
1170
1176
|
"--panelContentBg": "rgb(23,23,23)",
|
|
1171
1177
|
"--dbSettingsSidebarBg": "rgb(28,28,28)",
|
|
1172
1178
|
"--dbSettingsSidebarItemHover": "rgb(41,41,41)",
|
|
@@ -1718,6 +1724,8 @@ var warmStyles = {
|
|
|
1718
1724
|
"--mainBg": "rgb(250,244,236)",
|
|
1719
1725
|
"--panelBg": "rgb(255,253,250)",
|
|
1720
1726
|
"--panelBorder": "0 0 0 1px rgba(204, 198, 191, 0.2)",
|
|
1727
|
+
"--panelShadowFocused": "0 0 0 1px rgba(204, 198, 191, 0.45), 0 8px 12px 0 rgba(0,0,0,0.09)",
|
|
1728
|
+
"--panelShadowUnfocused": "0 0 0 1px rgba(204, 198, 191, 0.2), 0 2px 4px 0 rgba(0,0,0,0.05)",
|
|
1721
1729
|
"--panelContentBg": "rgb(253,246,239)",
|
|
1722
1730
|
"--dbSettingsSidebarBg": "rgb(253,246,239)",
|
|
1723
1731
|
"--dbSettingsSidebarItemHover": "rgb(243,236,229)",
|
|
@@ -2267,6 +2275,8 @@ var warmStyles = {
|
|
|
2267
2275
|
"--mainBg": "rgb(39,35,33)",
|
|
2268
2276
|
"--panelBg": "rgb(26,22,20)",
|
|
2269
2277
|
"--panelBorder": "0 0 0 1px rgba(86, 80, 78, 0.2)",
|
|
2278
|
+
"--panelShadowFocused": "0 0 0 1px rgba(86, 80, 78, 0.5)",
|
|
2279
|
+
"--panelShadowUnfocused": "0 0 0 1px rgba(86, 80, 78, 0.1)",
|
|
2270
2280
|
"--panelContentBg": "rgb(26,22,20)",
|
|
2271
2281
|
"--dbSettingsSidebarBg": "rgb(32,27,25)",
|
|
2272
2282
|
"--dbSettingsSidebarItemHover": "rgb(45,40,38)",
|
package/lib/tooltip.js
CHANGED
package/lib/tree-utils.d.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { $TSFixMe } from "./tsfixme.js";
|
|
2
1
|
//#region src/tree-utils.d.ts
|
|
3
2
|
type ItemId = string | number;
|
|
4
|
-
interface TreeData {
|
|
3
|
+
interface TreeData<Item extends TreeItem = TreeItem> {
|
|
5
4
|
rootId: ItemId;
|
|
6
|
-
items: Record<ItemId,
|
|
5
|
+
items: Record<ItemId, Item>;
|
|
7
6
|
}
|
|
8
|
-
type TreeItemData =
|
|
9
|
-
type TreeItem = {
|
|
7
|
+
type TreeItemData = object;
|
|
8
|
+
type TreeItem<Data extends TreeItemData = TreeItemData> = {
|
|
10
9
|
id: ItemId;
|
|
11
10
|
children: ItemId[];
|
|
12
11
|
hasChildren?: boolean;
|
|
13
12
|
isExpanded?: boolean;
|
|
14
13
|
isChildrenLoading?: boolean;
|
|
15
|
-
data?:
|
|
14
|
+
data?: Data;
|
|
16
15
|
};
|
|
17
|
-
type FlattenedTree = FlattenedItem[];
|
|
16
|
+
type FlattenedTree<Item extends TreeItem = TreeItem> = FlattenedItem<Item>[];
|
|
18
17
|
type Path = number[];
|
|
19
|
-
type FlattenedItem = {
|
|
20
|
-
item:
|
|
18
|
+
type FlattenedItem<Item extends TreeItem = TreeItem> = {
|
|
19
|
+
item: Item;
|
|
21
20
|
path: Path;
|
|
22
21
|
};
|
|
23
22
|
type TreeSourcePosition = {
|
|
@@ -28,15 +27,8 @@ type TreeDestinationPosition = {
|
|
|
28
27
|
parentId: ItemId;
|
|
29
28
|
index?: number;
|
|
30
29
|
};
|
|
31
|
-
type TreeItemMutation =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
hasChildren?: boolean;
|
|
35
|
-
isExpanded?: boolean;
|
|
36
|
-
isChildrenLoading?: boolean;
|
|
37
|
-
data?: TreeItemData;
|
|
38
|
-
};
|
|
39
|
-
declare const flattenTree: (tree: TreeData, path?: Path) => FlattenedTree;
|
|
40
|
-
declare const mutateTree: (tree: TreeData, itemId: ItemId, mutation: TreeItemMutation) => TreeData;
|
|
30
|
+
type TreeItemMutation<Item extends TreeItem = TreeItem> = Partial<Item>;
|
|
31
|
+
declare const flattenTree: <Item extends TreeItem>(tree: TreeData<Item>, path?: Path) => FlattenedTree<Item>;
|
|
32
|
+
declare const mutateTree: <Item extends TreeItem>(tree: TreeData<Item>, itemId: ItemId, mutation: TreeItemMutation<Item>) => TreeData<Item>;
|
|
41
33
|
//#endregion
|
|
42
34
|
export { FlattenedItem, FlattenedTree, ItemId, Path, TreeData, TreeDestinationPosition, TreeItem, TreeItemData, TreeItemMutation, TreeSourcePosition, flattenTree, mutateTree };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SkeletonProps } from "../skeleton.js";
|
|
2
2
|
//#region src/unit/loading-unit-value.d.ts
|
|
3
|
-
declare const unitTextHeight = 8;
|
|
4
3
|
declare const LoadingUnitValue: (props: SkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
//#endregion
|
|
6
|
-
export { LoadingUnitValue
|
|
5
|
+
export { LoadingUnitValue };
|
|
@@ -3,7 +3,6 @@ import { Skeleton } from "../skeleton.js";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/unit/loading-unit-value.tsx
|
|
6
|
-
var unitTextHeight = 8;
|
|
7
6
|
var LoadingUnitValue = (props) => /* @__PURE__ */ jsx("div", {
|
|
8
7
|
className: "cl6zvo6",
|
|
9
8
|
children: jsx(Skeleton, {
|
|
@@ -12,4 +11,4 @@ var LoadingUnitValue = (props) => /* @__PURE__ */ jsx("div", {
|
|
|
12
11
|
})
|
|
13
12
|
});
|
|
14
13
|
//#endregion
|
|
15
|
-
export { LoadingUnitValue
|
|
14
|
+
export { LoadingUnitValue };
|
|
@@ -2,10 +2,7 @@ import { LoadingUnitValue } from "./loading-unit-value.js";
|
|
|
2
2
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/unit/maybe-unit-value.tsx
|
|
4
4
|
var MaybeUnitValue = ({ value }) => {
|
|
5
|
-
return value === void 0 ? /* @__PURE__ */ jsx(LoadingUnitValue, {
|
|
6
|
-
minWidth: 18,
|
|
7
|
-
maxWidth: 18
|
|
8
|
-
}) : /* @__PURE__ */ jsx(Fragment, { children: value });
|
|
5
|
+
return value === void 0 ? /* @__PURE__ */ jsx(LoadingUnitValue, { width: 24 }) : /* @__PURE__ */ jsx(Fragment, { children: value });
|
|
9
6
|
};
|
|
10
7
|
//#endregion
|
|
11
8
|
export { MaybeUnitValue };
|
package/lib/unit/nav-button.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ type UnitNavButtonProps = {
|
|
|
7
7
|
declare const getNavButtonSize: (size: UnitSize) => number;
|
|
8
8
|
declare const UnitNavButton: ({ children }: UnitNavButtonProps) => ReactElement<{
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
|
+
"data-unit-nav-button"?: string;
|
|
10
11
|
}, string | import("react").JSXElementConstructor<any>>;
|
|
11
12
|
//#endregion
|
|
12
13
|
export { UnitNavButton, UnitNavButtonProps, getNavButtonSize };
|
package/lib/unit/nav-button.js
CHANGED
|
@@ -8,11 +8,14 @@ var UnitNavButton = ({ children }) => {
|
|
|
8
8
|
const { size } = useUnitContext();
|
|
9
9
|
const element = Children.only(children);
|
|
10
10
|
const slotSize = getNavButtonSize(size);
|
|
11
|
-
return cloneElement(element, {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
return cloneElement(element, {
|
|
12
|
+
style: {
|
|
13
|
+
...element.props.style,
|
|
14
|
+
width: slotSize,
|
|
15
|
+
height: slotSize
|
|
16
|
+
},
|
|
17
|
+
"data-unit-nav-button": ""
|
|
18
|
+
});
|
|
16
19
|
};
|
|
17
20
|
//#endregion
|
|
18
21
|
export { UnitNavButton, getNavButtonSize };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/ui-kit",
|
|
3
|
-
"version": "9.1
|
|
3
|
+
"version": "9.2.1",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
@@ -144,8 +144,8 @@
|
|
|
144
144
|
"vaul": "1.1.2",
|
|
145
145
|
"virtua": "0.50.4",
|
|
146
146
|
"@fibery/emoji-data": "3.0.0",
|
|
147
|
-
"@fibery/helpers": "
|
|
148
|
-
"@fibery/react": "2.0.
|
|
147
|
+
"@fibery/helpers": "4.0.0",
|
|
148
|
+
"@fibery/react": "2.0.5"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
151
151
|
"react": "18.3.1",
|
package/lib/animated-number.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
//#region src/animated-number.d.ts
|
|
3
|
-
type AnimatedNumberProps = {
|
|
4
|
-
children: number;
|
|
5
|
-
speed?: number;
|
|
6
|
-
fps?: number;
|
|
7
|
-
fixed?: number;
|
|
8
|
-
format?: (value: number) => ReactNode;
|
|
9
|
-
};
|
|
10
|
-
declare function AnimatedNumber({ children, speed, fps, fixed, format }: AnimatedNumberProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { AnimatedNumber };
|
package/lib/animated-number.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo, useState } from "react";
|
|
3
|
-
//#region src/animated-number.tsx
|
|
4
|
-
function AnimatedNumber({ children, speed = 300, fps = 12, fixed, format }) {
|
|
5
|
-
const [currentValue, setCurrentValue] = useState(children);
|
|
6
|
-
const frameTime = useMemo(() => 1e3 / fps, [fps]);
|
|
7
|
-
const step = useMemo(() => (children - currentValue) / (speed / frameTime), [
|
|
8
|
-
frameTime,
|
|
9
|
-
currentValue,
|
|
10
|
-
speed,
|
|
11
|
-
children
|
|
12
|
-
]);
|
|
13
|
-
const printedValue = fixed === void 0 ? currentValue : fixed === 0 ? Math.round(currentValue) : parseFloat(currentValue.toFixed(fixed));
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
let timeout;
|
|
16
|
-
if (step < 0 ? currentValue > children : currentValue < children && currentValue !== children) timeout = window.setTimeout(() => {
|
|
17
|
-
setCurrentValue(currentValue + step);
|
|
18
|
-
}, frameTime);
|
|
19
|
-
else setCurrentValue(children);
|
|
20
|
-
return () => {
|
|
21
|
-
window.clearTimeout(timeout);
|
|
22
|
-
};
|
|
23
|
-
}, [
|
|
24
|
-
children,
|
|
25
|
-
step,
|
|
26
|
-
currentValue,
|
|
27
|
-
frameTime
|
|
28
|
-
]);
|
|
29
|
-
return /* @__PURE__ */ jsx(Fragment, { children: format ? format(printedValue) : printedValue });
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { AnimatedNumber };
|
package/lib/tsfixme.d.ts
DELETED
package/lib/tsfixme.js
DELETED
|
File without changes
|