@storm-ds/ui 1.0.0 → 1.0.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/dist/index.d.mts +71 -28
- package/dist/index.d.ts +71 -28
- package/dist/index.js +184 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +183 -0
- package/dist/index.mjs.map +1 -1
- package/dist/plugin.js +2 -2
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +2 -2
- package/dist/plugin.mjs.map +1 -1
- package/package.json +7 -3
package/dist/index.mjs
CHANGED
|
@@ -3800,6 +3800,184 @@ function SonnerToastItem({ toast, onDismiss }) {
|
|
|
3800
3800
|
}
|
|
3801
3801
|
SonnerProvider.displayName = "SonnerProvider";
|
|
3802
3802
|
SonnerToaster.displayName = "SonnerToaster";
|
|
3803
|
+
|
|
3804
|
+
// src/components/MetricCard.tsx
|
|
3805
|
+
import { forwardRef as forwardRef59 } from "react";
|
|
3806
|
+
import { jsx as jsx59, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3807
|
+
var MetricCard = forwardRef59(
|
|
3808
|
+
({ className, label, value, change, changeLabel, ...props }, ref) => {
|
|
3809
|
+
const isPositive = change?.startsWith("+");
|
|
3810
|
+
const isNegative = change?.startsWith("-");
|
|
3811
|
+
return /* @__PURE__ */ jsxs23(
|
|
3812
|
+
"div",
|
|
3813
|
+
{
|
|
3814
|
+
ref,
|
|
3815
|
+
className: cn(
|
|
3816
|
+
"rounded-storm-lg border border-storm-border bg-storm-background p-3",
|
|
3817
|
+
className
|
|
3818
|
+
),
|
|
3819
|
+
...props,
|
|
3820
|
+
children: [
|
|
3821
|
+
/* @__PURE__ */ jsx59("p", { className: "text-[10px] font-medium text-storm-muted-foreground", children: label }),
|
|
3822
|
+
/* @__PURE__ */ jsx59("p", { className: "text-lg font-bold text-storm-foreground mt-0.5", children: value }),
|
|
3823
|
+
change && /* @__PURE__ */ jsxs23("p", { className: "text-[10px] text-storm-muted-foreground mt-0.5", children: [
|
|
3824
|
+
/* @__PURE__ */ jsx59("span", { className: cn(isPositive && "text-green-500", isNegative && "text-red-500"), children: change }),
|
|
3825
|
+
changeLabel && /* @__PURE__ */ jsxs23("span", { children: [
|
|
3826
|
+
" ",
|
|
3827
|
+
changeLabel
|
|
3828
|
+
] })
|
|
3829
|
+
] })
|
|
3830
|
+
]
|
|
3831
|
+
}
|
|
3832
|
+
);
|
|
3833
|
+
}
|
|
3834
|
+
);
|
|
3835
|
+
MetricCard.displayName = "MetricCard";
|
|
3836
|
+
|
|
3837
|
+
// src/components/PasswordInput.tsx
|
|
3838
|
+
import { forwardRef as forwardRef60, useState as useState16 } from "react";
|
|
3839
|
+
import { jsx as jsx60, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3840
|
+
var sizeStyles17 = {
|
|
3841
|
+
sm: "h-8 px-3 py-1.5 text-sm",
|
|
3842
|
+
md: "h-10 px-4 py-2 text-base",
|
|
3843
|
+
lg: "h-12 px-6 py-3 text-lg"
|
|
3844
|
+
};
|
|
3845
|
+
var toggleSizeStyles = {
|
|
3846
|
+
sm: "right-1 h-6 w-6",
|
|
3847
|
+
md: "right-1.5 h-7 w-7",
|
|
3848
|
+
lg: "right-2 h-8 w-8"
|
|
3849
|
+
};
|
|
3850
|
+
var iconSizeStyles = {
|
|
3851
|
+
sm: "h-3.5 w-3.5",
|
|
3852
|
+
md: "h-4 w-4",
|
|
3853
|
+
lg: "h-5 w-5"
|
|
3854
|
+
};
|
|
3855
|
+
var PasswordInput = forwardRef60(
|
|
3856
|
+
({ className, size = "md", error, ...props }, ref) => {
|
|
3857
|
+
const [visible, setVisible] = useState16(false);
|
|
3858
|
+
return /* @__PURE__ */ jsxs24("div", { className: "relative", children: [
|
|
3859
|
+
/* @__PURE__ */ jsx60(
|
|
3860
|
+
"input",
|
|
3861
|
+
{
|
|
3862
|
+
ref,
|
|
3863
|
+
type: visible ? "text" : "password",
|
|
3864
|
+
"aria-invalid": error || void 0,
|
|
3865
|
+
className: cn(
|
|
3866
|
+
"w-full rounded-storm-md border bg-storm-background text-storm-foreground transition-colors pr-10",
|
|
3867
|
+
"placeholder:text-storm-muted-foreground",
|
|
3868
|
+
error ? "border-storm-destructive focus-visible:ring-storm-destructive" : "border-storm-border focus-visible:border-storm-primary",
|
|
3869
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
3870
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
3871
|
+
sizeStyles17[size],
|
|
3872
|
+
className
|
|
3873
|
+
),
|
|
3874
|
+
...props
|
|
3875
|
+
}
|
|
3876
|
+
),
|
|
3877
|
+
/* @__PURE__ */ jsx60(
|
|
3878
|
+
"button",
|
|
3879
|
+
{
|
|
3880
|
+
type: "button",
|
|
3881
|
+
tabIndex: -1,
|
|
3882
|
+
onClick: () => setVisible((v) => !v),
|
|
3883
|
+
className: cn(
|
|
3884
|
+
"absolute top-1/2 -translate-y-1/2 inline-flex items-center justify-center rounded-storm-sm",
|
|
3885
|
+
"text-storm-muted-foreground hover:text-storm-foreground transition-colors",
|
|
3886
|
+
toggleSizeStyles[size]
|
|
3887
|
+
),
|
|
3888
|
+
children: visible ? /* @__PURE__ */ jsxs24("svg", { className: iconSizeStyles[size], viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3889
|
+
/* @__PURE__ */ jsx60("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94" }),
|
|
3890
|
+
/* @__PURE__ */ jsx60("path", { d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" }),
|
|
3891
|
+
/* @__PURE__ */ jsx60("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
3892
|
+
] }) : /* @__PURE__ */ jsxs24("svg", { className: iconSizeStyles[size], viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3893
|
+
/* @__PURE__ */ jsx60("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
3894
|
+
/* @__PURE__ */ jsx60("circle", { cx: "12", cy: "12", r: "3" })
|
|
3895
|
+
] })
|
|
3896
|
+
}
|
|
3897
|
+
)
|
|
3898
|
+
] });
|
|
3899
|
+
}
|
|
3900
|
+
);
|
|
3901
|
+
PasswordInput.displayName = "PasswordInput";
|
|
3902
|
+
|
|
3903
|
+
// src/components/ListItem.tsx
|
|
3904
|
+
import { forwardRef as forwardRef61 } from "react";
|
|
3905
|
+
import { jsx as jsx61, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3906
|
+
var ListItem = forwardRef61(
|
|
3907
|
+
({ className, leading, title, subtitle, trailing, truncate = true, ...props }, ref) => {
|
|
3908
|
+
return /* @__PURE__ */ jsxs25(
|
|
3909
|
+
"div",
|
|
3910
|
+
{
|
|
3911
|
+
ref,
|
|
3912
|
+
className: cn("flex items-center gap-3", className),
|
|
3913
|
+
...props,
|
|
3914
|
+
children: [
|
|
3915
|
+
leading && /* @__PURE__ */ jsx61("div", { className: "shrink-0", children: leading }),
|
|
3916
|
+
/* @__PURE__ */ jsxs25("div", { className: cn("flex-1", truncate && "min-w-0"), children: [
|
|
3917
|
+
/* @__PURE__ */ jsx61("p", { className: cn("text-sm font-medium text-storm-foreground", truncate && "truncate"), children: title }),
|
|
3918
|
+
subtitle && /* @__PURE__ */ jsx61("p", { className: cn("text-xs text-storm-muted-foreground", truncate && "truncate"), children: subtitle })
|
|
3919
|
+
] }),
|
|
3920
|
+
trailing && /* @__PURE__ */ jsx61("div", { className: "shrink-0", children: trailing })
|
|
3921
|
+
]
|
|
3922
|
+
}
|
|
3923
|
+
);
|
|
3924
|
+
}
|
|
3925
|
+
);
|
|
3926
|
+
ListItem.displayName = "ListItem";
|
|
3927
|
+
|
|
3928
|
+
// src/components/NavItem.tsx
|
|
3929
|
+
import { forwardRef as forwardRef62 } from "react";
|
|
3930
|
+
import { jsx as jsx62, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3931
|
+
var NavItem = forwardRef62(
|
|
3932
|
+
({ className, active, icon, badge, children, ...props }, ref) => {
|
|
3933
|
+
return /* @__PURE__ */ jsxs26(
|
|
3934
|
+
"button",
|
|
3935
|
+
{
|
|
3936
|
+
ref,
|
|
3937
|
+
type: "button",
|
|
3938
|
+
className: cn(
|
|
3939
|
+
"w-full flex items-center gap-3 rounded-storm-sm px-2 py-1.5 text-sm font-medium transition-colors",
|
|
3940
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-storm-ring",
|
|
3941
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
3942
|
+
active ? "bg-storm-muted text-storm-foreground" : "text-storm-muted-foreground hover:text-storm-foreground hover:bg-storm-accent/10",
|
|
3943
|
+
className
|
|
3944
|
+
),
|
|
3945
|
+
...props,
|
|
3946
|
+
children: [
|
|
3947
|
+
icon && /* @__PURE__ */ jsx62("span", { className: "shrink-0", children: icon }),
|
|
3948
|
+
/* @__PURE__ */ jsx62("span", { className: "flex-1 text-left", children }),
|
|
3949
|
+
badge && /* @__PURE__ */ jsx62("span", { className: "shrink-0", children: badge })
|
|
3950
|
+
]
|
|
3951
|
+
}
|
|
3952
|
+
);
|
|
3953
|
+
}
|
|
3954
|
+
);
|
|
3955
|
+
NavItem.displayName = "NavItem";
|
|
3956
|
+
|
|
3957
|
+
// src/components/PageHeader.tsx
|
|
3958
|
+
import { forwardRef as forwardRef63 } from "react";
|
|
3959
|
+
import { jsx as jsx63, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3960
|
+
var PageHeader = forwardRef63(
|
|
3961
|
+
({ className, title, description, badge, actions, ...props }, ref) => {
|
|
3962
|
+
return /* @__PURE__ */ jsxs27(
|
|
3963
|
+
"div",
|
|
3964
|
+
{
|
|
3965
|
+
ref,
|
|
3966
|
+
className: cn("flex items-start justify-between gap-4", className),
|
|
3967
|
+
...props,
|
|
3968
|
+
children: [
|
|
3969
|
+
/* @__PURE__ */ jsxs27("div", { children: [
|
|
3970
|
+
badge && /* @__PURE__ */ jsx63("div", { className: "mb-1", children: badge }),
|
|
3971
|
+
/* @__PURE__ */ jsx63("h2", { className: "text-xl font-bold text-storm-foreground", children: title }),
|
|
3972
|
+
description && /* @__PURE__ */ jsx63("p", { className: "text-sm text-storm-muted-foreground mt-1", children: description })
|
|
3973
|
+
] }),
|
|
3974
|
+
actions && /* @__PURE__ */ jsx63("div", { className: "shrink-0 flex items-center gap-2", children: actions })
|
|
3975
|
+
]
|
|
3976
|
+
}
|
|
3977
|
+
);
|
|
3978
|
+
}
|
|
3979
|
+
);
|
|
3980
|
+
PageHeader.displayName = "PageHeader";
|
|
3803
3981
|
export {
|
|
3804
3982
|
Accordion,
|
|
3805
3983
|
AccordionContent,
|
|
@@ -3894,6 +4072,7 @@ export {
|
|
|
3894
4072
|
Item,
|
|
3895
4073
|
Kbd,
|
|
3896
4074
|
Label,
|
|
4075
|
+
ListItem,
|
|
3897
4076
|
Menubar,
|
|
3898
4077
|
MenubarContent,
|
|
3899
4078
|
MenubarItem,
|
|
@@ -3901,15 +4080,19 @@ export {
|
|
|
3901
4080
|
MenubarSeparator,
|
|
3902
4081
|
MenubarShortcut,
|
|
3903
4082
|
MenubarTrigger,
|
|
4083
|
+
MetricCard,
|
|
3904
4084
|
NativeSelect,
|
|
4085
|
+
NavItem,
|
|
3905
4086
|
NavigationMenu,
|
|
3906
4087
|
NavigationMenuItem,
|
|
3907
4088
|
NavigationMenuLink,
|
|
4089
|
+
PageHeader,
|
|
3908
4090
|
Pagination,
|
|
3909
4091
|
PaginationEllipsis,
|
|
3910
4092
|
PaginationItem,
|
|
3911
4093
|
PaginationNext,
|
|
3912
4094
|
PaginationPrevious,
|
|
4095
|
+
PasswordInput,
|
|
3913
4096
|
Popover,
|
|
3914
4097
|
PopoverContent,
|
|
3915
4098
|
PopoverTrigger,
|