@prediktif/ui 0.1.17 → 0.1.18
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/index.d.mts +22 -2
- package/dist/index.d.ts +22 -2
- package/dist/index.js +140 -2
- package/dist/index.mjs +138 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, ComponentProps } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
6
|
|
|
4
7
|
interface NavItem {
|
|
5
8
|
title: string;
|
|
@@ -58,4 +61,21 @@ interface HeaderTitleProps {
|
|
|
58
61
|
}
|
|
59
62
|
declare const HeaderTitle: react.NamedExoticComponent<HeaderTitleProps>;
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
declare const buttonVariants: (props?: ({
|
|
65
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
66
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
67
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
68
|
+
declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): react.JSX.Element;
|
|
69
|
+
|
|
70
|
+
interface StateEmptyProps {
|
|
71
|
+
icon: React.ComponentType<{
|
|
72
|
+
className?: string;
|
|
73
|
+
}> | ReactNode;
|
|
74
|
+
title: ReactNode;
|
|
75
|
+
description: ReactNode;
|
|
76
|
+
buttonText: string;
|
|
77
|
+
render?: ComponentProps<typeof Button>["render"];
|
|
78
|
+
}
|
|
79
|
+
declare const StateEmpty: react.NamedExoticComponent<StateEmptyProps>;
|
|
80
|
+
|
|
81
|
+
export { AppSidebar, type AppSidebarProps, type HeaderTabItem, HeaderTabs, type HeaderTabsProps, HeaderTitle, type HeaderTitleProps, type NavItem, type OrganizationItem, StateEmpty, type StateEmptyProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, ComponentProps } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
6
|
|
|
4
7
|
interface NavItem {
|
|
5
8
|
title: string;
|
|
@@ -58,4 +61,21 @@ interface HeaderTitleProps {
|
|
|
58
61
|
}
|
|
59
62
|
declare const HeaderTitle: react.NamedExoticComponent<HeaderTitleProps>;
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
declare const buttonVariants: (props?: ({
|
|
65
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
66
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
67
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
68
|
+
declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): react.JSX.Element;
|
|
69
|
+
|
|
70
|
+
interface StateEmptyProps {
|
|
71
|
+
icon: React.ComponentType<{
|
|
72
|
+
className?: string;
|
|
73
|
+
}> | ReactNode;
|
|
74
|
+
title: ReactNode;
|
|
75
|
+
description: ReactNode;
|
|
76
|
+
buttonText: string;
|
|
77
|
+
render?: ComponentProps<typeof Button>["render"];
|
|
78
|
+
}
|
|
79
|
+
declare const StateEmpty: react.NamedExoticComponent<StateEmptyProps>;
|
|
80
|
+
|
|
81
|
+
export { AppSidebar, type AppSidebarProps, type HeaderTabItem, HeaderTabs, type HeaderTabsProps, HeaderTitle, type HeaderTitleProps, type NavItem, type OrganizationItem, StateEmpty, type StateEmptyProps };
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,8 @@ var index_exports = {};
|
|
|
62
62
|
__export(index_exports, {
|
|
63
63
|
AppSidebar: () => AppSidebar,
|
|
64
64
|
HeaderTabs: () => HeaderTabs,
|
|
65
|
-
HeaderTitle: () => HeaderTitle
|
|
65
|
+
HeaderTitle: () => HeaderTitle,
|
|
66
|
+
StateEmpty: () => StateEmpty
|
|
66
67
|
});
|
|
67
68
|
module.exports = __toCommonJS(index_exports);
|
|
68
69
|
|
|
@@ -1575,9 +1576,146 @@ var HeaderTitle = (0, import_react3.memo)(function HeaderTitle2({
|
|
|
1575
1576
|
children
|
|
1576
1577
|
] });
|
|
1577
1578
|
});
|
|
1579
|
+
|
|
1580
|
+
// src/components/composed/state-empty.tsx
|
|
1581
|
+
var import_react4 = require("react");
|
|
1582
|
+
|
|
1583
|
+
// src/components/ui/empty.tsx
|
|
1584
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
1585
|
+
var import_cn13 = require("cn");
|
|
1586
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1587
|
+
function Empty(_a) {
|
|
1588
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1590
|
+
"div",
|
|
1591
|
+
__spreadValues({
|
|
1592
|
+
"data-slot": "empty",
|
|
1593
|
+
className: (0, import_cn13.cn)(
|
|
1594
|
+
"flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",
|
|
1595
|
+
className
|
|
1596
|
+
)
|
|
1597
|
+
}, props)
|
|
1598
|
+
);
|
|
1599
|
+
}
|
|
1600
|
+
function EmptyHeader(_a) {
|
|
1601
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1603
|
+
"div",
|
|
1604
|
+
__spreadValues({
|
|
1605
|
+
"data-slot": "empty-header",
|
|
1606
|
+
className: (0, import_cn13.cn)("flex max-w-sm flex-col items-center gap-1", className)
|
|
1607
|
+
}, props)
|
|
1608
|
+
);
|
|
1609
|
+
}
|
|
1610
|
+
var emptyMediaVariants = (0, import_class_variance_authority4.cva)(
|
|
1611
|
+
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1612
|
+
{
|
|
1613
|
+
variants: {
|
|
1614
|
+
variant: {
|
|
1615
|
+
default: "bg-transparent",
|
|
1616
|
+
icon: "flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"
|
|
1617
|
+
}
|
|
1618
|
+
},
|
|
1619
|
+
defaultVariants: {
|
|
1620
|
+
variant: "default"
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
);
|
|
1624
|
+
function EmptyMedia(_a) {
|
|
1625
|
+
var _b = _a, {
|
|
1626
|
+
className,
|
|
1627
|
+
variant = "default"
|
|
1628
|
+
} = _b, props = __objRest(_b, [
|
|
1629
|
+
"className",
|
|
1630
|
+
"variant"
|
|
1631
|
+
]);
|
|
1632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1633
|
+
"div",
|
|
1634
|
+
__spreadValues({
|
|
1635
|
+
"data-slot": "empty-icon",
|
|
1636
|
+
"data-variant": variant,
|
|
1637
|
+
className: (0, import_cn13.cn)(emptyMediaVariants({ variant, className }))
|
|
1638
|
+
}, props)
|
|
1639
|
+
);
|
|
1640
|
+
}
|
|
1641
|
+
function EmptyTitle(_a) {
|
|
1642
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1644
|
+
"div",
|
|
1645
|
+
__spreadValues({
|
|
1646
|
+
"data-slot": "empty-title",
|
|
1647
|
+
className: (0, import_cn13.cn)(
|
|
1648
|
+
"font-heading text-sm font-medium tracking-tight",
|
|
1649
|
+
className
|
|
1650
|
+
)
|
|
1651
|
+
}, props)
|
|
1652
|
+
);
|
|
1653
|
+
}
|
|
1654
|
+
function EmptyDescription(_a) {
|
|
1655
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1657
|
+
"div",
|
|
1658
|
+
__spreadValues({
|
|
1659
|
+
"data-slot": "empty-description",
|
|
1660
|
+
className: (0, import_cn13.cn)(
|
|
1661
|
+
"text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
1662
|
+
className
|
|
1663
|
+
)
|
|
1664
|
+
}, props)
|
|
1665
|
+
);
|
|
1666
|
+
}
|
|
1667
|
+
function EmptyContent(_a) {
|
|
1668
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1670
|
+
"div",
|
|
1671
|
+
__spreadValues({
|
|
1672
|
+
"data-slot": "empty-content",
|
|
1673
|
+
className: (0, import_cn13.cn)(
|
|
1674
|
+
"flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance",
|
|
1675
|
+
className
|
|
1676
|
+
)
|
|
1677
|
+
}, props)
|
|
1678
|
+
);
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
// src/components/composed/state-empty.tsx
|
|
1682
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1683
|
+
function renderStateIcon(icon) {
|
|
1684
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
1685
|
+
const IconComp = icon;
|
|
1686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconComp, {});
|
|
1687
|
+
}
|
|
1688
|
+
return icon;
|
|
1689
|
+
}
|
|
1690
|
+
var StateEmpty = (0, import_react4.memo)(function StateEmpty2({
|
|
1691
|
+
icon,
|
|
1692
|
+
title,
|
|
1693
|
+
description,
|
|
1694
|
+
buttonText,
|
|
1695
|
+
render
|
|
1696
|
+
}) {
|
|
1697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Empty, { className: "w-full border border-dashed", children: [
|
|
1698
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(EmptyHeader, { children: [
|
|
1699
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EmptyMedia, { variant: "icon", children: renderStateIcon(icon) }),
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EmptyTitle, { children: title }),
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EmptyDescription, { children: description })
|
|
1702
|
+
] }),
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EmptyContent, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1704
|
+
Button,
|
|
1705
|
+
{
|
|
1706
|
+
variant: "outline",
|
|
1707
|
+
size: "sm",
|
|
1708
|
+
nativeButton: !render,
|
|
1709
|
+
render,
|
|
1710
|
+
children: buttonText
|
|
1711
|
+
}
|
|
1712
|
+
) })
|
|
1713
|
+
] });
|
|
1714
|
+
});
|
|
1578
1715
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1579
1716
|
0 && (module.exports = {
|
|
1580
1717
|
AppSidebar,
|
|
1581
1718
|
HeaderTabs,
|
|
1582
|
-
HeaderTitle
|
|
1719
|
+
HeaderTitle,
|
|
1720
|
+
StateEmpty
|
|
1583
1721
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1540,8 +1540,145 @@ var HeaderTitle = memo3(function HeaderTitle2({
|
|
|
1540
1540
|
children
|
|
1541
1541
|
] });
|
|
1542
1542
|
});
|
|
1543
|
+
|
|
1544
|
+
// src/components/composed/state-empty.tsx
|
|
1545
|
+
import { memo as memo4 } from "react";
|
|
1546
|
+
|
|
1547
|
+
// src/components/ui/empty.tsx
|
|
1548
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
1549
|
+
import { cn as cn13 } from "cn";
|
|
1550
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1551
|
+
function Empty(_a) {
|
|
1552
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1553
|
+
return /* @__PURE__ */ jsx16(
|
|
1554
|
+
"div",
|
|
1555
|
+
__spreadValues({
|
|
1556
|
+
"data-slot": "empty",
|
|
1557
|
+
className: cn13(
|
|
1558
|
+
"flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",
|
|
1559
|
+
className
|
|
1560
|
+
)
|
|
1561
|
+
}, props)
|
|
1562
|
+
);
|
|
1563
|
+
}
|
|
1564
|
+
function EmptyHeader(_a) {
|
|
1565
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1566
|
+
return /* @__PURE__ */ jsx16(
|
|
1567
|
+
"div",
|
|
1568
|
+
__spreadValues({
|
|
1569
|
+
"data-slot": "empty-header",
|
|
1570
|
+
className: cn13("flex max-w-sm flex-col items-center gap-1", className)
|
|
1571
|
+
}, props)
|
|
1572
|
+
);
|
|
1573
|
+
}
|
|
1574
|
+
var emptyMediaVariants = cva4(
|
|
1575
|
+
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1576
|
+
{
|
|
1577
|
+
variants: {
|
|
1578
|
+
variant: {
|
|
1579
|
+
default: "bg-transparent",
|
|
1580
|
+
icon: "flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"
|
|
1581
|
+
}
|
|
1582
|
+
},
|
|
1583
|
+
defaultVariants: {
|
|
1584
|
+
variant: "default"
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
);
|
|
1588
|
+
function EmptyMedia(_a) {
|
|
1589
|
+
var _b = _a, {
|
|
1590
|
+
className,
|
|
1591
|
+
variant = "default"
|
|
1592
|
+
} = _b, props = __objRest(_b, [
|
|
1593
|
+
"className",
|
|
1594
|
+
"variant"
|
|
1595
|
+
]);
|
|
1596
|
+
return /* @__PURE__ */ jsx16(
|
|
1597
|
+
"div",
|
|
1598
|
+
__spreadValues({
|
|
1599
|
+
"data-slot": "empty-icon",
|
|
1600
|
+
"data-variant": variant,
|
|
1601
|
+
className: cn13(emptyMediaVariants({ variant, className }))
|
|
1602
|
+
}, props)
|
|
1603
|
+
);
|
|
1604
|
+
}
|
|
1605
|
+
function EmptyTitle(_a) {
|
|
1606
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1607
|
+
return /* @__PURE__ */ jsx16(
|
|
1608
|
+
"div",
|
|
1609
|
+
__spreadValues({
|
|
1610
|
+
"data-slot": "empty-title",
|
|
1611
|
+
className: cn13(
|
|
1612
|
+
"font-heading text-sm font-medium tracking-tight",
|
|
1613
|
+
className
|
|
1614
|
+
)
|
|
1615
|
+
}, props)
|
|
1616
|
+
);
|
|
1617
|
+
}
|
|
1618
|
+
function EmptyDescription(_a) {
|
|
1619
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1620
|
+
return /* @__PURE__ */ jsx16(
|
|
1621
|
+
"div",
|
|
1622
|
+
__spreadValues({
|
|
1623
|
+
"data-slot": "empty-description",
|
|
1624
|
+
className: cn13(
|
|
1625
|
+
"text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
1626
|
+
className
|
|
1627
|
+
)
|
|
1628
|
+
}, props)
|
|
1629
|
+
);
|
|
1630
|
+
}
|
|
1631
|
+
function EmptyContent(_a) {
|
|
1632
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1633
|
+
return /* @__PURE__ */ jsx16(
|
|
1634
|
+
"div",
|
|
1635
|
+
__spreadValues({
|
|
1636
|
+
"data-slot": "empty-content",
|
|
1637
|
+
className: cn13(
|
|
1638
|
+
"flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance",
|
|
1639
|
+
className
|
|
1640
|
+
)
|
|
1641
|
+
}, props)
|
|
1642
|
+
);
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
// src/components/composed/state-empty.tsx
|
|
1646
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1647
|
+
function renderStateIcon(icon) {
|
|
1648
|
+
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "render" in icon) {
|
|
1649
|
+
const IconComp = icon;
|
|
1650
|
+
return /* @__PURE__ */ jsx17(IconComp, {});
|
|
1651
|
+
}
|
|
1652
|
+
return icon;
|
|
1653
|
+
}
|
|
1654
|
+
var StateEmpty = memo4(function StateEmpty2({
|
|
1655
|
+
icon,
|
|
1656
|
+
title,
|
|
1657
|
+
description,
|
|
1658
|
+
buttonText,
|
|
1659
|
+
render
|
|
1660
|
+
}) {
|
|
1661
|
+
return /* @__PURE__ */ jsxs10(Empty, { className: "w-full border border-dashed", children: [
|
|
1662
|
+
/* @__PURE__ */ jsxs10(EmptyHeader, { children: [
|
|
1663
|
+
/* @__PURE__ */ jsx17(EmptyMedia, { variant: "icon", children: renderStateIcon(icon) }),
|
|
1664
|
+
/* @__PURE__ */ jsx17(EmptyTitle, { children: title }),
|
|
1665
|
+
/* @__PURE__ */ jsx17(EmptyDescription, { children: description })
|
|
1666
|
+
] }),
|
|
1667
|
+
/* @__PURE__ */ jsx17(EmptyContent, { children: /* @__PURE__ */ jsx17(
|
|
1668
|
+
Button,
|
|
1669
|
+
{
|
|
1670
|
+
variant: "outline",
|
|
1671
|
+
size: "sm",
|
|
1672
|
+
nativeButton: !render,
|
|
1673
|
+
render,
|
|
1674
|
+
children: buttonText
|
|
1675
|
+
}
|
|
1676
|
+
) })
|
|
1677
|
+
] });
|
|
1678
|
+
});
|
|
1543
1679
|
export {
|
|
1544
1680
|
AppSidebar,
|
|
1545
1681
|
HeaderTabs,
|
|
1546
|
-
HeaderTitle
|
|
1682
|
+
HeaderTitle,
|
|
1683
|
+
StateEmpty
|
|
1547
1684
|
};
|