@cytario/design 7.0.0 → 7.1.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/index.css +1 -1
- package/dist/index.d.ts +52 -5
- package/dist/index.js +298 -190
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -736,6 +736,7 @@ function IconButtonBase({
|
|
|
736
736
|
isLoading = false,
|
|
737
737
|
isDisabled,
|
|
738
738
|
className,
|
|
739
|
+
ref,
|
|
739
740
|
...props
|
|
740
741
|
}) {
|
|
741
742
|
const cx = twMerge4(
|
|
@@ -751,6 +752,7 @@ function IconButtonBase({
|
|
|
751
752
|
Component,
|
|
752
753
|
{
|
|
753
754
|
...props,
|
|
755
|
+
ref,
|
|
754
756
|
"aria-label": label,
|
|
755
757
|
isDisabled: isDisabled || isLoading,
|
|
756
758
|
className: cx,
|
|
@@ -1935,14 +1937,19 @@ import {
|
|
|
1935
1937
|
MenuItem as AriaMenuItem,
|
|
1936
1938
|
Popover as Popover2
|
|
1937
1939
|
} from "react-aria-components";
|
|
1940
|
+
import { twMerge as twMerge10 } from "tailwind-merge";
|
|
1941
|
+
|
|
1942
|
+
// src/components/Menu/menuStyles.ts
|
|
1943
|
+
var popoverStyles = `
|
|
1944
|
+
bg-background rounded-md shadow-lg
|
|
1945
|
+
border border-border
|
|
1946
|
+
py-1 min-w-48
|
|
1947
|
+
entering:animate-in entering:fade-in entering:zoom-in-95
|
|
1948
|
+
exiting:animate-out exiting:fade-out exiting:zoom-out-95
|
|
1949
|
+
`;
|
|
1950
|
+
|
|
1951
|
+
// src/components/Menu/Menu.tsx
|
|
1938
1952
|
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1939
|
-
var popoverStyles = [
|
|
1940
|
-
"bg-background rounded-md",
|
|
1941
|
-
"shadow-lg border border-border",
|
|
1942
|
-
"py-1 min-w-48",
|
|
1943
|
-
"entering:animate-in entering:fade-in entering:zoom-in-95",
|
|
1944
|
-
"exiting:animate-out exiting:fade-out exiting:zoom-out-95"
|
|
1945
|
-
].join(" ");
|
|
1946
1953
|
function Menu({
|
|
1947
1954
|
items,
|
|
1948
1955
|
content,
|
|
@@ -1957,61 +1964,161 @@ function Menu({
|
|
|
1957
1964
|
const selectionProps = selectionMode && selectionMode !== "none" ? { selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange } : {};
|
|
1958
1965
|
return /* @__PURE__ */ jsxs18(MenuTrigger, { children: [
|
|
1959
1966
|
children,
|
|
1960
|
-
/* @__PURE__ */ jsx24(
|
|
1961
|
-
|
|
1967
|
+
/* @__PURE__ */ jsx24(Popover2, { className: twMerge10(popoverStyles, className), children: items ? /* @__PURE__ */ jsx24(
|
|
1968
|
+
AriaMenu,
|
|
1962
1969
|
{
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1970
|
+
items,
|
|
1971
|
+
onAction: (key) => {
|
|
1972
|
+
const item = items.find((i) => i.id === key);
|
|
1973
|
+
item?.onAction?.();
|
|
1974
|
+
onAction?.(key);
|
|
1975
|
+
},
|
|
1976
|
+
...selectionProps,
|
|
1977
|
+
className: "outline-none",
|
|
1978
|
+
children: (item) => /* @__PURE__ */ jsxs18(
|
|
1979
|
+
AriaMenuItem,
|
|
1966
1980
|
{
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1981
|
+
id: item.id,
|
|
1982
|
+
href: item.href,
|
|
1983
|
+
target: item.target,
|
|
1984
|
+
isDisabled: item.isDisabled,
|
|
1985
|
+
className: [
|
|
1986
|
+
"flex items-center gap-2 px-3 py-2 text-sm outline-none cursor-default",
|
|
1987
|
+
"transition-colors",
|
|
1988
|
+
"focus:bg-muted",
|
|
1989
|
+
"hover:bg-muted",
|
|
1990
|
+
"disabled:opacity-50 disabled:pointer-events-none",
|
|
1991
|
+
item.isDanger ? "text-destructive" : "text-foreground"
|
|
1992
|
+
].filter(Boolean).join(" "),
|
|
1993
|
+
children: [
|
|
1994
|
+
item.icon && /* @__PURE__ */ jsx24(Icon, { icon: item.icon, size: "sm" }),
|
|
1995
|
+
/* @__PURE__ */ jsx24("span", { className: "flex-1", children: item.label }),
|
|
1996
|
+
item.endContent && /* @__PURE__ */ jsx24("span", { className: "ml-auto flex items-center", children: item.endContent })
|
|
1997
|
+
]
|
|
1998
|
+
}
|
|
1999
|
+
)
|
|
2000
|
+
}
|
|
2001
|
+
) : /* @__PURE__ */ jsx24(
|
|
2002
|
+
AriaMenu,
|
|
2003
|
+
{
|
|
2004
|
+
onAction: (key) => onAction?.(key),
|
|
2005
|
+
...selectionProps,
|
|
2006
|
+
className: "outline-none",
|
|
2007
|
+
children: content
|
|
2008
|
+
}
|
|
2009
|
+
) })
|
|
2010
|
+
] });
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
// src/components/Menu/useContextMenu.tsx
|
|
2014
|
+
import {
|
|
2015
|
+
useCallback as useCallback3,
|
|
2016
|
+
useEffect as useEffect3,
|
|
2017
|
+
useRef as useRef5,
|
|
2018
|
+
useState as useState7
|
|
2019
|
+
} from "react";
|
|
2020
|
+
import {
|
|
2021
|
+
Menu as AriaMenu2,
|
|
2022
|
+
MenuTrigger as MenuTrigger2,
|
|
2023
|
+
Popover as Popover3,
|
|
2024
|
+
Pressable
|
|
2025
|
+
} from "react-aria-components";
|
|
2026
|
+
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
2027
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2028
|
+
function useContextMenu({
|
|
2029
|
+
content,
|
|
2030
|
+
onAction,
|
|
2031
|
+
className
|
|
2032
|
+
}) {
|
|
2033
|
+
const [anchor, setAnchor] = useState7(null);
|
|
2034
|
+
const anchorRef = useRef5(null);
|
|
2035
|
+
const popoverRef = useRef5(null);
|
|
2036
|
+
const isOpen = anchor !== null;
|
|
2037
|
+
const close = useCallback3(() => setAnchor(null), []);
|
|
2038
|
+
const onContextMenu = useCallback3((event) => {
|
|
2039
|
+
event.preventDefault();
|
|
2040
|
+
setAnchor({ x: event.clientX, y: event.clientY });
|
|
2041
|
+
}, []);
|
|
2042
|
+
const onPress = useCallback3((event) => {
|
|
2043
|
+
const rect = event.target.getBoundingClientRect();
|
|
2044
|
+
setAnchor({ x: rect.left, y: rect.bottom });
|
|
2045
|
+
}, []);
|
|
2046
|
+
useEffect3(() => {
|
|
2047
|
+
if (!isOpen) return;
|
|
2048
|
+
const isInside = (target) => popoverRef.current?.contains(target) ?? false;
|
|
2049
|
+
const onPointerDown = (event) => {
|
|
2050
|
+
if (!isInside(event.target)) close();
|
|
2051
|
+
};
|
|
2052
|
+
const onOutsideContextMenu = (event) => {
|
|
2053
|
+
if (isInside(event.target)) return;
|
|
2054
|
+
event.preventDefault();
|
|
2055
|
+
close();
|
|
2056
|
+
};
|
|
2057
|
+
const onKeyDown = (event) => {
|
|
2058
|
+
if (event.key === "Escape") close();
|
|
2059
|
+
};
|
|
2060
|
+
document.addEventListener("pointerdown", onPointerDown, true);
|
|
2061
|
+
document.addEventListener("contextmenu", onOutsideContextMenu, true);
|
|
2062
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
2063
|
+
return () => {
|
|
2064
|
+
document.removeEventListener("pointerdown", onPointerDown, true);
|
|
2065
|
+
document.removeEventListener("contextmenu", onOutsideContextMenu, true);
|
|
2066
|
+
document.removeEventListener("keydown", onKeyDown, true);
|
|
2067
|
+
};
|
|
2068
|
+
}, [isOpen, close]);
|
|
2069
|
+
const menu = /* @__PURE__ */ jsxs19(
|
|
2070
|
+
MenuTrigger2,
|
|
2071
|
+
{
|
|
2072
|
+
isOpen,
|
|
2073
|
+
onOpenChange: (open) => {
|
|
2074
|
+
if (!open) close();
|
|
2075
|
+
},
|
|
2076
|
+
children: [
|
|
2077
|
+
/* @__PURE__ */ jsx25(Pressable, { children: /* @__PURE__ */ jsx25(
|
|
2078
|
+
"span",
|
|
2079
|
+
{
|
|
2080
|
+
ref: anchorRef,
|
|
2081
|
+
"aria-hidden": true,
|
|
2082
|
+
className: "pointer-events-none fixed h-0 w-0",
|
|
2083
|
+
style: { left: anchor?.x ?? 0, top: anchor?.y ?? 0 }
|
|
2084
|
+
}
|
|
2085
|
+
) }),
|
|
2086
|
+
/* @__PURE__ */ jsx25(
|
|
2087
|
+
Popover3,
|
|
2088
|
+
{
|
|
2089
|
+
isNonModal: true,
|
|
2090
|
+
placement: "bottom start",
|
|
2091
|
+
ref: popoverRef,
|
|
2092
|
+
className: twMerge11(popoverStyles, className),
|
|
2093
|
+
children: /* @__PURE__ */ jsx25(
|
|
2094
|
+
AriaMenu2,
|
|
1977
2095
|
{
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
"focus:bg-muted",
|
|
1986
|
-
"hover:bg-muted",
|
|
1987
|
-
"disabled:opacity-50 disabled:pointer-events-none",
|
|
1988
|
-
item.isDanger ? "text-destructive" : "text-foreground"
|
|
1989
|
-
].filter(Boolean).join(" "),
|
|
1990
|
-
children: [
|
|
1991
|
-
item.icon && /* @__PURE__ */ jsx24(Icon, { icon: item.icon, size: "sm" }),
|
|
1992
|
-
/* @__PURE__ */ jsx24("span", { className: "flex-1", children: item.label }),
|
|
1993
|
-
item.endContent && /* @__PURE__ */ jsx24("span", { className: "ml-auto flex items-center", children: item.endContent })
|
|
1994
|
-
]
|
|
2096
|
+
autoFocus: "first",
|
|
2097
|
+
onAction: (key) => {
|
|
2098
|
+
onAction?.(String(key));
|
|
2099
|
+
close();
|
|
2100
|
+
},
|
|
2101
|
+
className: "outline-none",
|
|
2102
|
+
children: content
|
|
1995
2103
|
}
|
|
1996
2104
|
)
|
|
1997
2105
|
}
|
|
1998
|
-
) : /* @__PURE__ */ jsx24(
|
|
1999
|
-
AriaMenu,
|
|
2000
|
-
{
|
|
2001
|
-
onAction: (key) => onAction?.(key),
|
|
2002
|
-
...selectionProps,
|
|
2003
|
-
className: "outline-none",
|
|
2004
|
-
children: content
|
|
2005
|
-
}
|
|
2006
2106
|
)
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2107
|
+
]
|
|
2108
|
+
}
|
|
2109
|
+
);
|
|
2110
|
+
return {
|
|
2111
|
+
targetProps: { onContextMenu },
|
|
2112
|
+
triggerProps: { onPress },
|
|
2113
|
+
menu,
|
|
2114
|
+
isOpen,
|
|
2115
|
+
close
|
|
2116
|
+
};
|
|
2010
2117
|
}
|
|
2011
2118
|
|
|
2012
2119
|
// src/components/Menu/MenuItem.tsx
|
|
2013
2120
|
import { MenuItem as AriaMenuItem2 } from "react-aria-components";
|
|
2014
|
-
import { jsx as
|
|
2121
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2015
2122
|
function MenuItem({
|
|
2016
2123
|
id,
|
|
2017
2124
|
children,
|
|
@@ -2025,7 +2132,7 @@ function MenuItem({
|
|
|
2025
2132
|
textValue,
|
|
2026
2133
|
className
|
|
2027
2134
|
}) {
|
|
2028
|
-
return /* @__PURE__ */
|
|
2135
|
+
return /* @__PURE__ */ jsxs20(
|
|
2029
2136
|
AriaMenuItem2,
|
|
2030
2137
|
{
|
|
2031
2138
|
id,
|
|
@@ -2044,9 +2151,9 @@ function MenuItem({
|
|
|
2044
2151
|
className
|
|
2045
2152
|
].filter(Boolean).join(" "),
|
|
2046
2153
|
children: [
|
|
2047
|
-
icon && /* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
endContent && /* @__PURE__ */
|
|
2154
|
+
icon && /* @__PURE__ */ jsx26(Icon, { icon, size: "sm" }),
|
|
2155
|
+
/* @__PURE__ */ jsx26("span", { className: "flex-1", children }),
|
|
2156
|
+
endContent && /* @__PURE__ */ jsx26("span", { className: "ml-auto flex items-center", children: endContent })
|
|
2050
2157
|
]
|
|
2051
2158
|
}
|
|
2052
2159
|
);
|
|
@@ -2055,7 +2162,7 @@ function MenuItem({
|
|
|
2055
2162
|
// src/components/Menu/MenuCheckboxItem.tsx
|
|
2056
2163
|
import { MenuItem as AriaMenuItem3 } from "react-aria-components";
|
|
2057
2164
|
import { Check as Check4 } from "lucide-react";
|
|
2058
|
-
import { Fragment as Fragment7, jsx as
|
|
2165
|
+
import { Fragment as Fragment7, jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2059
2166
|
function MenuCheckboxItem({
|
|
2060
2167
|
id,
|
|
2061
2168
|
children,
|
|
@@ -2063,7 +2170,7 @@ function MenuCheckboxItem({
|
|
|
2063
2170
|
isDisabled,
|
|
2064
2171
|
className
|
|
2065
2172
|
}) {
|
|
2066
|
-
return /* @__PURE__ */
|
|
2173
|
+
return /* @__PURE__ */ jsx27(
|
|
2067
2174
|
AriaMenuItem3,
|
|
2068
2175
|
{
|
|
2069
2176
|
id,
|
|
@@ -2079,9 +2186,9 @@ function MenuCheckboxItem({
|
|
|
2079
2186
|
isSelected ? "font-medium" : "",
|
|
2080
2187
|
className
|
|
2081
2188
|
].filter(Boolean).join(" "),
|
|
2082
|
-
children: ({ isSelected }) => /* @__PURE__ */
|
|
2083
|
-
/* @__PURE__ */
|
|
2084
|
-
/* @__PURE__ */
|
|
2189
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs21(Fragment7, { children: [
|
|
2190
|
+
/* @__PURE__ */ jsx27("span", { className: "flex items-center justify-center w-4 h-4 shrink-0", children: isSelected && /* @__PURE__ */ jsx27(Check4, { size: 14, className: "text-primary", "aria-hidden": "true" }) }),
|
|
2191
|
+
/* @__PURE__ */ jsx27("span", { className: "flex-1", children })
|
|
2085
2192
|
] })
|
|
2086
2193
|
}
|
|
2087
2194
|
);
|
|
@@ -2092,15 +2199,15 @@ import {
|
|
|
2092
2199
|
MenuSection as AriaMenuSection,
|
|
2093
2200
|
Header
|
|
2094
2201
|
} from "react-aria-components";
|
|
2095
|
-
import { jsx as
|
|
2202
|
+
import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2096
2203
|
function MenuSection({
|
|
2097
2204
|
header,
|
|
2098
2205
|
children,
|
|
2099
2206
|
"aria-label": ariaLabel,
|
|
2100
2207
|
className
|
|
2101
2208
|
}) {
|
|
2102
|
-
return /* @__PURE__ */
|
|
2103
|
-
header && /* @__PURE__ */
|
|
2209
|
+
return /* @__PURE__ */ jsxs22(AriaMenuSection, { className, "aria-label": ariaLabel, children: [
|
|
2210
|
+
header && /* @__PURE__ */ jsx28(
|
|
2104
2211
|
Header,
|
|
2105
2212
|
{
|
|
2106
2213
|
className: [
|
|
@@ -2119,16 +2226,16 @@ function MenuSection({
|
|
|
2119
2226
|
|
|
2120
2227
|
// src/components/Menu/MenuHeader.tsx
|
|
2121
2228
|
import { Header as Header2 } from "react-aria-components";
|
|
2122
|
-
import { jsx as
|
|
2229
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2123
2230
|
function MenuHeader({ children, className }) {
|
|
2124
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ jsx29(Header2, { className, children });
|
|
2125
2232
|
}
|
|
2126
2233
|
|
|
2127
2234
|
// src/components/Menu/MenuSeparator.tsx
|
|
2128
2235
|
import { Separator } from "react-aria-components";
|
|
2129
|
-
import { jsx as
|
|
2236
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2130
2237
|
function MenuSeparator({ className }) {
|
|
2131
|
-
return /* @__PURE__ */
|
|
2238
|
+
return /* @__PURE__ */ jsx30(
|
|
2132
2239
|
Separator,
|
|
2133
2240
|
{
|
|
2134
2241
|
className: [
|
|
@@ -2145,17 +2252,17 @@ import {
|
|
|
2145
2252
|
Popover as AriaPopover,
|
|
2146
2253
|
Button as AriaButton3
|
|
2147
2254
|
} from "react-aria-components";
|
|
2148
|
-
import { twMerge as
|
|
2149
|
-
import { jsx as
|
|
2150
|
-
function
|
|
2151
|
-
return /* @__PURE__ */
|
|
2255
|
+
import { twMerge as twMerge12 } from "tailwind-merge";
|
|
2256
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2257
|
+
function Popover4({ children, isOpen, onOpenChange }) {
|
|
2258
|
+
return /* @__PURE__ */ jsx31(DialogTrigger, { isOpen, onOpenChange, children });
|
|
2152
2259
|
}
|
|
2153
2260
|
function PopoverTrigger({ children, className }) {
|
|
2154
2261
|
const cx = `
|
|
2155
2262
|
inline-flex items-center bg-transparent border-none p-0 outline-none cursor-pointer
|
|
2156
2263
|
focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm
|
|
2157
2264
|
`;
|
|
2158
|
-
return /* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ jsx31(AriaButton3, { className: twMerge12(cx, className), children });
|
|
2159
2266
|
}
|
|
2160
2267
|
function PopoverContent({
|
|
2161
2268
|
placement = "bottom",
|
|
@@ -2176,13 +2283,13 @@ function PopoverContent({
|
|
|
2176
2283
|
entering:placement-left:slide-in-from-right-1
|
|
2177
2284
|
entering:placement-right:slide-in-from-left-1
|
|
2178
2285
|
`;
|
|
2179
|
-
return /* @__PURE__ */
|
|
2286
|
+
return /* @__PURE__ */ jsx31(
|
|
2180
2287
|
AriaPopover,
|
|
2181
2288
|
{
|
|
2182
2289
|
...rest,
|
|
2183
2290
|
placement,
|
|
2184
2291
|
offset: offsetPx,
|
|
2185
|
-
className:
|
|
2292
|
+
className: twMerge12(cx, className),
|
|
2186
2293
|
children
|
|
2187
2294
|
}
|
|
2188
2295
|
);
|
|
@@ -2190,14 +2297,14 @@ function PopoverContent({
|
|
|
2190
2297
|
|
|
2191
2298
|
// src/components/Tabs/Tabs.tsx
|
|
2192
2299
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
2193
|
-
import { twMerge as
|
|
2300
|
+
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
2194
2301
|
import {
|
|
2195
2302
|
Tabs as AriaTabs,
|
|
2196
2303
|
TabList as AriaTabList,
|
|
2197
2304
|
Tab as AriaTab,
|
|
2198
2305
|
TabPanel as AriaTabPanel
|
|
2199
2306
|
} from "react-aria-components";
|
|
2200
|
-
import { jsx as
|
|
2307
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2201
2308
|
var TabsContext = createContext2({
|
|
2202
2309
|
variant: "underline",
|
|
2203
2310
|
size: "md"
|
|
@@ -2215,12 +2322,12 @@ function Tabs({
|
|
|
2215
2322
|
children,
|
|
2216
2323
|
...props
|
|
2217
2324
|
}) {
|
|
2218
|
-
return /* @__PURE__ */
|
|
2325
|
+
return /* @__PURE__ */ jsx32(TabsContext.Provider, { value: { variant, size }, children: /* @__PURE__ */ jsx32(
|
|
2219
2326
|
AriaTabs,
|
|
2220
2327
|
{
|
|
2221
2328
|
...props,
|
|
2222
2329
|
orientation,
|
|
2223
|
-
className:
|
|
2330
|
+
className: twMerge13(
|
|
2224
2331
|
orientation === "vertical" ? "flex" : "",
|
|
2225
2332
|
className
|
|
2226
2333
|
),
|
|
@@ -2235,11 +2342,11 @@ function TabList({
|
|
|
2235
2342
|
const { variant } = useContext2(TabsContext);
|
|
2236
2343
|
const baseStyles = variant === "unstyled" ? "flex items-center" : variant === "underline" ? "flex items-center border-b border-border" : "inline-flex items-center bg-muted rounded-lg p-1 gap-1";
|
|
2237
2344
|
const verticalStyles = variant === "unstyled" ? "flex-col" : variant === "underline" ? "flex-col border-b-0 border-r border-border" : "flex-col";
|
|
2238
|
-
return /* @__PURE__ */
|
|
2345
|
+
return /* @__PURE__ */ jsx32(
|
|
2239
2346
|
AriaTabList,
|
|
2240
2347
|
{
|
|
2241
2348
|
...props,
|
|
2242
|
-
className: ({ orientation }) =>
|
|
2349
|
+
className: ({ orientation }) => twMerge13(
|
|
2243
2350
|
baseStyles,
|
|
2244
2351
|
orientation === "vertical" ? verticalStyles : "",
|
|
2245
2352
|
className
|
|
@@ -2249,20 +2356,20 @@ function TabList({
|
|
|
2249
2356
|
}
|
|
2250
2357
|
function Tab({ className, ...props }) {
|
|
2251
2358
|
const { variant, size } = useContext2(TabsContext);
|
|
2252
|
-
return /* @__PURE__ */
|
|
2359
|
+
return /* @__PURE__ */ jsx32(
|
|
2253
2360
|
AriaTab,
|
|
2254
2361
|
{
|
|
2255
2362
|
...props,
|
|
2256
2363
|
className: ({ isSelected, isDisabled, isHovered, isPressed }) => {
|
|
2257
2364
|
if (variant === "unstyled") {
|
|
2258
|
-
return
|
|
2365
|
+
return twMerge13(
|
|
2259
2366
|
"cursor-pointer outline-none",
|
|
2260
2367
|
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
2261
2368
|
isDisabled ? "opacity-50 pointer-events-none" : "",
|
|
2262
2369
|
className
|
|
2263
2370
|
);
|
|
2264
2371
|
}
|
|
2265
|
-
return
|
|
2372
|
+
return twMerge13(
|
|
2266
2373
|
// Base
|
|
2267
2374
|
"cursor-pointer outline-none transition-colors",
|
|
2268
2375
|
"font-medium",
|
|
@@ -2306,11 +2413,11 @@ function getTabVariantStyles(variant, state) {
|
|
|
2306
2413
|
}
|
|
2307
2414
|
function TabPanel({ className, ...props }) {
|
|
2308
2415
|
const { variant } = useContext2(TabsContext);
|
|
2309
|
-
return /* @__PURE__ */
|
|
2416
|
+
return /* @__PURE__ */ jsx32(
|
|
2310
2417
|
AriaTabPanel,
|
|
2311
2418
|
{
|
|
2312
2419
|
...props,
|
|
2313
|
-
className:
|
|
2420
|
+
className: twMerge13(
|
|
2314
2421
|
variant === "unstyled" ? "outline-none" : "mt-4 outline-none",
|
|
2315
2422
|
className
|
|
2316
2423
|
)
|
|
@@ -2328,12 +2435,12 @@ import {
|
|
|
2328
2435
|
|
|
2329
2436
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
2330
2437
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
2331
|
-
import { twMerge as
|
|
2438
|
+
import { twMerge as twMerge14 } from "tailwind-merge";
|
|
2332
2439
|
import {
|
|
2333
2440
|
ToggleButtonGroup as AriaToggleButtonGroup,
|
|
2334
2441
|
ToggleButton as AriaToggleButton3
|
|
2335
2442
|
} from "react-aria-components";
|
|
2336
|
-
import { jsx as
|
|
2443
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2337
2444
|
var SegmentedControlContext = createContext3({
|
|
2338
2445
|
size: "md"
|
|
2339
2446
|
});
|
|
@@ -2353,7 +2460,7 @@ function SegmentedControl({
|
|
|
2353
2460
|
...props
|
|
2354
2461
|
}) {
|
|
2355
2462
|
const isNoneMode = selectionMode === "none";
|
|
2356
|
-
return /* @__PURE__ */
|
|
2463
|
+
return /* @__PURE__ */ jsx33(SegmentedControlContext.Provider, { value: { size }, children: /* @__PURE__ */ jsx33(
|
|
2357
2464
|
AriaToggleButtonGroup,
|
|
2358
2465
|
{
|
|
2359
2466
|
...props,
|
|
@@ -2361,7 +2468,7 @@ function SegmentedControl({
|
|
|
2361
2468
|
selectedKeys: isNoneMode ? /* @__PURE__ */ new Set() : selectedKeys,
|
|
2362
2469
|
defaultSelectedKeys: isNoneMode ? void 0 : defaultSelectedKeys,
|
|
2363
2470
|
onSelectionChange: isNoneMode ? void 0 : onSelectionChange,
|
|
2364
|
-
className:
|
|
2471
|
+
className: twMerge14(
|
|
2365
2472
|
"inline-flex items-center rounded-lg border border-border bg-muted p-0.5 gap-0.5",
|
|
2366
2473
|
className
|
|
2367
2474
|
),
|
|
@@ -2374,11 +2481,11 @@ function SegmentedControlItem({
|
|
|
2374
2481
|
...props
|
|
2375
2482
|
}) {
|
|
2376
2483
|
const { size } = useContext3(SegmentedControlContext);
|
|
2377
|
-
return /* @__PURE__ */
|
|
2484
|
+
return /* @__PURE__ */ jsx33(
|
|
2378
2485
|
AriaToggleButton3,
|
|
2379
2486
|
{
|
|
2380
2487
|
...props,
|
|
2381
|
-
className: ({ isSelected, isHovered, isPressed, isDisabled }) =>
|
|
2488
|
+
className: ({ isSelected, isHovered, isPressed, isDisabled }) => twMerge14(
|
|
2382
2489
|
// Base layout
|
|
2383
2490
|
"inline-flex items-center justify-center",
|
|
2384
2491
|
"rounded-md",
|
|
@@ -2399,8 +2506,8 @@ function SegmentedControlItem({
|
|
|
2399
2506
|
}
|
|
2400
2507
|
|
|
2401
2508
|
// src/components/Badge/Badge.tsx
|
|
2402
|
-
import { twMerge as
|
|
2403
|
-
import { jsx as
|
|
2509
|
+
import { twMerge as twMerge15 } from "tailwind-merge";
|
|
2510
|
+
import { jsx as jsx34, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2404
2511
|
var variantStyles4 = {
|
|
2405
2512
|
neutral: "bg-(--color-badge-neutral-bg) text-(--color-badge-neutral-text)",
|
|
2406
2513
|
purple: "bg-(--color-badge-purple-bg) text-(--color-badge-purple-text)",
|
|
@@ -2421,18 +2528,18 @@ function Badge({
|
|
|
2421
2528
|
icon,
|
|
2422
2529
|
className
|
|
2423
2530
|
}) {
|
|
2424
|
-
return /* @__PURE__ */
|
|
2531
|
+
return /* @__PURE__ */ jsxs23(
|
|
2425
2532
|
"span",
|
|
2426
2533
|
{
|
|
2427
|
-
className:
|
|
2534
|
+
className: twMerge15(
|
|
2428
2535
|
"inline-flex items-center gap-1 rounded-full",
|
|
2429
|
-
"text-xs font-medium leading-tight",
|
|
2536
|
+
"text-xs font-medium leading-tight tracking-wider tabular-nums",
|
|
2430
2537
|
variantStyles4[variant],
|
|
2431
2538
|
sizeStyles6[size],
|
|
2432
2539
|
className
|
|
2433
2540
|
),
|
|
2434
2541
|
children: [
|
|
2435
|
-
icon && /* @__PURE__ */
|
|
2542
|
+
icon && /* @__PURE__ */ jsx34(Icon, { icon, size: "xs" }),
|
|
2436
2543
|
children
|
|
2437
2544
|
]
|
|
2438
2545
|
}
|
|
@@ -2440,9 +2547,9 @@ function Badge({
|
|
|
2440
2547
|
}
|
|
2441
2548
|
|
|
2442
2549
|
// src/components/Card/Card.tsx
|
|
2443
|
-
import { useCallback as
|
|
2444
|
-
import { twMerge as
|
|
2445
|
-
import { Fragment as Fragment8, jsx as
|
|
2550
|
+
import { useCallback as useCallback4 } from "react";
|
|
2551
|
+
import { twMerge as twMerge16 } from "tailwind-merge";
|
|
2552
|
+
import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2446
2553
|
var paddingStyles = {
|
|
2447
2554
|
none: "p-0",
|
|
2448
2555
|
sm: "p-3",
|
|
@@ -2460,13 +2567,13 @@ function Card({
|
|
|
2460
2567
|
className
|
|
2461
2568
|
}) {
|
|
2462
2569
|
const isInteractive = interactive || !!href || !!onPress;
|
|
2463
|
-
const containerClass =
|
|
2570
|
+
const containerClass = twMerge16(
|
|
2464
2571
|
"bg-background border border-border rounded-lg overflow-hidden shadow-sm",
|
|
2465
2572
|
isInteractive && "transition-all hover:shadow-md hover:border-ring cursor-pointer",
|
|
2466
2573
|
(href || onPress) && "block focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none",
|
|
2467
2574
|
className
|
|
2468
2575
|
);
|
|
2469
|
-
const handleKeyDown =
|
|
2576
|
+
const handleKeyDown = useCallback4(
|
|
2470
2577
|
(e) => {
|
|
2471
2578
|
if (onPress && (e.key === "Enter" || e.key === " ")) {
|
|
2472
2579
|
e.preventDefault();
|
|
@@ -2475,22 +2582,22 @@ function Card({
|
|
|
2475
2582
|
},
|
|
2476
2583
|
[onPress]
|
|
2477
2584
|
);
|
|
2478
|
-
const content = /* @__PURE__ */
|
|
2479
|
-
header && /* @__PURE__ */
|
|
2585
|
+
const content = /* @__PURE__ */ jsxs24(Fragment8, { children: [
|
|
2586
|
+
header && /* @__PURE__ */ jsx35(
|
|
2480
2587
|
"div",
|
|
2481
2588
|
{
|
|
2482
|
-
className:
|
|
2589
|
+
className: twMerge16(
|
|
2483
2590
|
"border-b border-border",
|
|
2484
2591
|
paddingStyles[padding]
|
|
2485
2592
|
),
|
|
2486
2593
|
children: header
|
|
2487
2594
|
}
|
|
2488
2595
|
),
|
|
2489
|
-
/* @__PURE__ */
|
|
2490
|
-
footer && /* @__PURE__ */
|
|
2596
|
+
/* @__PURE__ */ jsx35("div", { className: paddingStyles[padding], children }),
|
|
2597
|
+
footer && /* @__PURE__ */ jsx35(
|
|
2491
2598
|
"div",
|
|
2492
2599
|
{
|
|
2493
|
-
className:
|
|
2600
|
+
className: twMerge16(
|
|
2494
2601
|
"border-t border-border",
|
|
2495
2602
|
paddingStyles[padding]
|
|
2496
2603
|
),
|
|
@@ -2499,10 +2606,10 @@ function Card({
|
|
|
2499
2606
|
)
|
|
2500
2607
|
] });
|
|
2501
2608
|
if (href) {
|
|
2502
|
-
return /* @__PURE__ */
|
|
2609
|
+
return /* @__PURE__ */ jsx35("a", { href, className: containerClass, children: content });
|
|
2503
2610
|
}
|
|
2504
2611
|
if (onPress) {
|
|
2505
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ jsx35(
|
|
2506
2613
|
"div",
|
|
2507
2614
|
{
|
|
2508
2615
|
role: "button",
|
|
@@ -2514,13 +2621,13 @@ function Card({
|
|
|
2514
2621
|
}
|
|
2515
2622
|
);
|
|
2516
2623
|
}
|
|
2517
|
-
return /* @__PURE__ */
|
|
2624
|
+
return /* @__PURE__ */ jsx35("div", { className: containerClass, children: content });
|
|
2518
2625
|
}
|
|
2519
2626
|
|
|
2520
2627
|
// src/components/DeltaIndicator/DeltaIndicator.tsx
|
|
2521
2628
|
import { ArrowUp as ArrowUp2, ArrowDown as ArrowDown2, Minus as Minus2 } from "lucide-react";
|
|
2522
|
-
import { twMerge as
|
|
2523
|
-
import { jsx as
|
|
2629
|
+
import { twMerge as twMerge17 } from "tailwind-merge";
|
|
2630
|
+
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2524
2631
|
function getDirection(current, previous) {
|
|
2525
2632
|
const diff = current - previous;
|
|
2526
2633
|
if (diff > 0) return "increase";
|
|
@@ -2573,16 +2680,16 @@ function DeltaIndicator({
|
|
|
2573
2680
|
className
|
|
2574
2681
|
}) {
|
|
2575
2682
|
if (unavailable) {
|
|
2576
|
-
return /* @__PURE__ */
|
|
2683
|
+
return /* @__PURE__ */ jsxs25(
|
|
2577
2684
|
"span",
|
|
2578
2685
|
{
|
|
2579
|
-
className:
|
|
2686
|
+
className: twMerge17(
|
|
2580
2687
|
"inline-flex items-center gap-1 font-medium",
|
|
2581
2688
|
"text-muted-foreground",
|
|
2582
2689
|
className
|
|
2583
2690
|
),
|
|
2584
2691
|
children: [
|
|
2585
|
-
label && /* @__PURE__ */
|
|
2692
|
+
label && /* @__PURE__ */ jsx36("span", { className: "text-sm text-muted-foreground mr-1", children: label }),
|
|
2586
2693
|
unavailableText
|
|
2587
2694
|
]
|
|
2588
2695
|
}
|
|
@@ -2612,10 +2719,10 @@ function DeltaIndicator({
|
|
|
2612
2719
|
}
|
|
2613
2720
|
}
|
|
2614
2721
|
const isPill = mode === "pill";
|
|
2615
|
-
return /* @__PURE__ */
|
|
2722
|
+
return /* @__PURE__ */ jsxs25(
|
|
2616
2723
|
"span",
|
|
2617
2724
|
{
|
|
2618
|
-
className:
|
|
2725
|
+
className: twMerge17(
|
|
2619
2726
|
"inline-flex items-center gap-1 font-medium",
|
|
2620
2727
|
colorStyles2,
|
|
2621
2728
|
isPill && [
|
|
@@ -2626,8 +2733,8 @@ function DeltaIndicator({
|
|
|
2626
2733
|
className
|
|
2627
2734
|
),
|
|
2628
2735
|
children: [
|
|
2629
|
-
label && /* @__PURE__ */
|
|
2630
|
-
/* @__PURE__ */
|
|
2736
|
+
label && /* @__PURE__ */ jsx36("span", { className: "text-sm text-muted-foreground mr-1", children: label }),
|
|
2737
|
+
/* @__PURE__ */ jsx36(IconComponent, { size: 14, "aria-hidden": true }),
|
|
2631
2738
|
valueText
|
|
2632
2739
|
]
|
|
2633
2740
|
}
|
|
@@ -2635,8 +2742,8 @@ function DeltaIndicator({
|
|
|
2635
2742
|
}
|
|
2636
2743
|
|
|
2637
2744
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
2638
|
-
import { twMerge as
|
|
2639
|
-
import { jsx as
|
|
2745
|
+
import { twMerge as twMerge18 } from "tailwind-merge";
|
|
2746
|
+
import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2640
2747
|
var fillStyles = {
|
|
2641
2748
|
brand: "bg-(--color-progress-fill)",
|
|
2642
2749
|
success: "bg-(--color-progress-fill-success)",
|
|
@@ -2659,12 +2766,12 @@ function ProgressBar({
|
|
|
2659
2766
|
className
|
|
2660
2767
|
}) {
|
|
2661
2768
|
const clampedValue = Math.min(100, Math.max(0, value));
|
|
2662
|
-
return /* @__PURE__ */
|
|
2663
|
-
(label || description || showValue) && /* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2769
|
+
return /* @__PURE__ */ jsxs26("div", { className: twMerge18("w-full", className), children: [
|
|
2770
|
+
(label || description || showValue) && /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between mb-2", children: [
|
|
2771
|
+
/* @__PURE__ */ jsx37("span", { className: "text-sm font-medium text-foreground", children: label }),
|
|
2772
|
+
/* @__PURE__ */ jsx37("span", { className: "text-sm text-muted-foreground", children: description ?? (showValue ? `${clampedValue}%` : null) })
|
|
2666
2773
|
] }),
|
|
2667
|
-
/* @__PURE__ */
|
|
2774
|
+
/* @__PURE__ */ jsx37(
|
|
2668
2775
|
"div",
|
|
2669
2776
|
{
|
|
2670
2777
|
role: "progressbar",
|
|
@@ -2672,14 +2779,14 @@ function ProgressBar({
|
|
|
2672
2779
|
"aria-valuemin": 0,
|
|
2673
2780
|
"aria-valuemax": 100,
|
|
2674
2781
|
"aria-label": label ?? "Progress",
|
|
2675
|
-
className:
|
|
2782
|
+
className: twMerge18(
|
|
2676
2783
|
"w-full rounded-full bg-(--color-progress-track)",
|
|
2677
2784
|
sizeStyles7[size]
|
|
2678
2785
|
),
|
|
2679
|
-
children: /* @__PURE__ */
|
|
2786
|
+
children: /* @__PURE__ */ jsx37(
|
|
2680
2787
|
"div",
|
|
2681
2788
|
{
|
|
2682
|
-
className:
|
|
2789
|
+
className: twMerge18(
|
|
2683
2790
|
"h-full rounded-full transition-all duration-300",
|
|
2684
2791
|
fillStyles[variant]
|
|
2685
2792
|
),
|
|
@@ -2692,15 +2799,15 @@ function ProgressBar({
|
|
|
2692
2799
|
}
|
|
2693
2800
|
|
|
2694
2801
|
// src/components/Banner/Banner.tsx
|
|
2695
|
-
import { useState as
|
|
2802
|
+
import { useState as useState8 } from "react";
|
|
2696
2803
|
import {
|
|
2697
2804
|
Info as Info3,
|
|
2698
2805
|
AlertTriangle as AlertTriangle2,
|
|
2699
2806
|
AlertCircle as AlertCircle2,
|
|
2700
2807
|
CheckCircle2 as CheckCircle22
|
|
2701
2808
|
} from "lucide-react";
|
|
2702
|
-
import { twMerge as
|
|
2703
|
-
import { jsx as
|
|
2809
|
+
import { twMerge as twMerge19 } from "tailwind-merge";
|
|
2810
|
+
import { jsx as jsx38, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2704
2811
|
var variantConfig2 = {
|
|
2705
2812
|
info: {
|
|
2706
2813
|
icon: Info3,
|
|
@@ -2736,7 +2843,7 @@ function Banner({
|
|
|
2736
2843
|
onDismiss,
|
|
2737
2844
|
className
|
|
2738
2845
|
}) {
|
|
2739
|
-
const [dismissed, setDismissed] =
|
|
2846
|
+
const [dismissed, setDismissed] = useState8(false);
|
|
2740
2847
|
if (dismissed) return null;
|
|
2741
2848
|
const config = variantConfig2[variant];
|
|
2742
2849
|
const resolvedIcon = icon ?? config.icon;
|
|
@@ -2744,40 +2851,40 @@ function Banner({
|
|
|
2744
2851
|
setDismissed(true);
|
|
2745
2852
|
onDismiss?.();
|
|
2746
2853
|
};
|
|
2747
|
-
return /* @__PURE__ */
|
|
2854
|
+
return /* @__PURE__ */ jsxs27(
|
|
2748
2855
|
"div",
|
|
2749
2856
|
{
|
|
2750
2857
|
role: config.role,
|
|
2751
|
-
className:
|
|
2858
|
+
className: twMerge19(
|
|
2752
2859
|
"flex items-start gap-3 rounded-lg border px-4 py-3",
|
|
2753
2860
|
"text-sm",
|
|
2754
2861
|
config.containerClass,
|
|
2755
2862
|
className
|
|
2756
2863
|
),
|
|
2757
2864
|
children: [
|
|
2758
|
-
/* @__PURE__ */
|
|
2865
|
+
/* @__PURE__ */ jsx38(
|
|
2759
2866
|
Icon,
|
|
2760
2867
|
{
|
|
2761
2868
|
icon: resolvedIcon,
|
|
2762
2869
|
size: "md",
|
|
2763
|
-
className:
|
|
2870
|
+
className: twMerge19("mt-0.5", config.iconClass)
|
|
2764
2871
|
}
|
|
2765
2872
|
),
|
|
2766
|
-
/* @__PURE__ */
|
|
2767
|
-
title && /* @__PURE__ */
|
|
2873
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex-1", children: [
|
|
2874
|
+
title && /* @__PURE__ */ jsxs27("span", { className: "font-medium", children: [
|
|
2768
2875
|
title,
|
|
2769
2876
|
" \u2014 "
|
|
2770
2877
|
] }),
|
|
2771
2878
|
children
|
|
2772
2879
|
] }),
|
|
2773
|
-
dismissible && /* @__PURE__ */
|
|
2880
|
+
dismissible && /* @__PURE__ */ jsx38(
|
|
2774
2881
|
"button",
|
|
2775
2882
|
{
|
|
2776
2883
|
type: "button",
|
|
2777
2884
|
onClick: handleDismiss,
|
|
2778
2885
|
className: "shrink-0 rounded-sm p-0.5 opacity-70 hover:opacity-100 transition-opacity outline-none focus-visible:ring-2 focus-visible:ring-current",
|
|
2779
2886
|
"aria-label": "Dismiss",
|
|
2780
|
-
children: /* @__PURE__ */
|
|
2887
|
+
children: /* @__PURE__ */ jsx38(Icon, { icon: "X", size: "sm" })
|
|
2781
2888
|
}
|
|
2782
2889
|
)
|
|
2783
2890
|
]
|
|
@@ -2786,8 +2893,8 @@ function Banner({
|
|
|
2786
2893
|
}
|
|
2787
2894
|
|
|
2788
2895
|
// src/components/MetricCard/MetricCard.tsx
|
|
2789
|
-
import { twMerge as
|
|
2790
|
-
import { Fragment as Fragment9, jsx as
|
|
2896
|
+
import { twMerge as twMerge20 } from "tailwind-merge";
|
|
2897
|
+
import { Fragment as Fragment9, jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2791
2898
|
var sizeConfig = {
|
|
2792
2899
|
sm: {
|
|
2793
2900
|
padding: "p-3",
|
|
@@ -2809,58 +2916,58 @@ function MetricCard({
|
|
|
2809
2916
|
className
|
|
2810
2917
|
}) {
|
|
2811
2918
|
const config = sizeConfig[size];
|
|
2812
|
-
const containerClass =
|
|
2919
|
+
const containerClass = twMerge20(
|
|
2813
2920
|
"bg-background border border-border rounded-lg shadow-sm",
|
|
2814
2921
|
config.padding,
|
|
2815
2922
|
href && "block transition-shadow hover:shadow-md hover:border-ring focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none",
|
|
2816
2923
|
className
|
|
2817
2924
|
);
|
|
2818
|
-
const content = /* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
/* @__PURE__ */
|
|
2925
|
+
const content = /* @__PURE__ */ jsxs28(Fragment9, { children: [
|
|
2926
|
+
/* @__PURE__ */ jsx39("div", { className: twMerge20(config.labelClass, "text-muted-foreground"), children: label }),
|
|
2927
|
+
/* @__PURE__ */ jsx39(
|
|
2821
2928
|
"div",
|
|
2822
2929
|
{
|
|
2823
|
-
className:
|
|
2930
|
+
className: twMerge20(
|
|
2824
2931
|
config.valueClass,
|
|
2825
2932
|
"font-semibold text-foreground mt-1 tabular-nums"
|
|
2826
2933
|
),
|
|
2827
2934
|
children: value
|
|
2828
2935
|
}
|
|
2829
2936
|
),
|
|
2830
|
-
secondary && /* @__PURE__ */
|
|
2937
|
+
secondary && /* @__PURE__ */ jsx39("div", { className: "mt-1 text-sm", children: secondary })
|
|
2831
2938
|
] });
|
|
2832
2939
|
if (href) {
|
|
2833
|
-
return /* @__PURE__ */
|
|
2940
|
+
return /* @__PURE__ */ jsx39("a", { href, className: containerClass, children: content });
|
|
2834
2941
|
}
|
|
2835
|
-
return /* @__PURE__ */
|
|
2942
|
+
return /* @__PURE__ */ jsx39("div", { className: containerClass, children: content });
|
|
2836
2943
|
}
|
|
2837
2944
|
|
|
2838
2945
|
// src/components/SectionHeader/SectionHeader.tsx
|
|
2839
|
-
import { twMerge as
|
|
2840
|
-
import { jsx as
|
|
2946
|
+
import { twMerge as twMerge21 } from "tailwind-merge";
|
|
2947
|
+
import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2841
2948
|
function SectionHeader({
|
|
2842
2949
|
title,
|
|
2843
2950
|
children,
|
|
2844
2951
|
className
|
|
2845
2952
|
}) {
|
|
2846
|
-
return /* @__PURE__ */
|
|
2953
|
+
return /* @__PURE__ */ jsxs29(
|
|
2847
2954
|
"div",
|
|
2848
2955
|
{
|
|
2849
|
-
className:
|
|
2956
|
+
className: twMerge21(
|
|
2850
2957
|
"flex flex-wrap items-center gap-3 py-4",
|
|
2851
2958
|
className
|
|
2852
2959
|
),
|
|
2853
2960
|
children: [
|
|
2854
|
-
/* @__PURE__ */
|
|
2855
|
-
children && /* @__PURE__ */
|
|
2961
|
+
/* @__PURE__ */ jsx40(H2, { children: title }),
|
|
2962
|
+
children && /* @__PURE__ */ jsx40("div", { className: "ml-auto flex flex-wrap items-center gap-2", children })
|
|
2856
2963
|
]
|
|
2857
2964
|
}
|
|
2858
2965
|
);
|
|
2859
2966
|
}
|
|
2860
2967
|
|
|
2861
2968
|
// src/components/Pill/Pill.tsx
|
|
2862
|
-
import { twMerge as
|
|
2863
|
-
import { jsx as
|
|
2969
|
+
import { twMerge as twMerge22 } from "tailwind-merge";
|
|
2970
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2864
2971
|
var hashColors = {
|
|
2865
2972
|
purple: "bg-(--color-badge-purple-bg) text-(--color-badge-purple-text) border-(--color-badge-purple-text)/20",
|
|
2866
2973
|
teal: "bg-(--color-badge-teal-bg) text-(--color-badge-teal-text) border-(--color-badge-teal-text)/20",
|
|
@@ -2886,7 +2993,7 @@ function Pill({
|
|
|
2886
2993
|
className,
|
|
2887
2994
|
...rest
|
|
2888
2995
|
}) {
|
|
2889
|
-
const cx =
|
|
2996
|
+
const cx = twMerge22(
|
|
2890
2997
|
`
|
|
2891
2998
|
inline-flex items-center
|
|
2892
2999
|
rounded-full
|
|
@@ -2898,12 +3005,12 @@ function Pill({
|
|
|
2898
3005
|
colorStyles[color],
|
|
2899
3006
|
className
|
|
2900
3007
|
);
|
|
2901
|
-
return /* @__PURE__ */
|
|
3008
|
+
return /* @__PURE__ */ jsx41("span", { className: cx, ...rest, children });
|
|
2902
3009
|
}
|
|
2903
3010
|
|
|
2904
3011
|
// src/components/Pill/PathPill.tsx
|
|
2905
|
-
import { twMerge as
|
|
2906
|
-
import { jsx as
|
|
3012
|
+
import { twMerge as twMerge23 } from "tailwind-merge";
|
|
3013
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2907
3014
|
function PathPill({
|
|
2908
3015
|
children,
|
|
2909
3016
|
visibleCount,
|
|
@@ -2915,17 +3022,17 @@ function PathPill({
|
|
|
2915
3022
|
const effectiveVisible = visibleCount ?? segments.length;
|
|
2916
3023
|
const dotCount = Math.max(0, segments.length - effectiveVisible);
|
|
2917
3024
|
const fullPath = segments.join(" / ");
|
|
2918
|
-
return /* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ jsx42(
|
|
2919
3026
|
"div",
|
|
2920
3027
|
{
|
|
2921
|
-
className:
|
|
3028
|
+
className: twMerge23("relative flex", className),
|
|
2922
3029
|
"aria-label": `Path: ${fullPath}`,
|
|
2923
3030
|
children: segments.map((segment, i) => {
|
|
2924
3031
|
const isCollapsed = i < dotCount;
|
|
2925
3032
|
const isLast = i === segments.length - 1;
|
|
2926
|
-
const cx =
|
|
3033
|
+
const cx = twMerge23(!isLast && "pr-5 -mr-4", isCollapsed && "pr-3");
|
|
2927
3034
|
const color = colorFn ? colorFn(segment, i) : pillColorFromName(segment);
|
|
2928
|
-
return /* @__PURE__ */
|
|
3035
|
+
return /* @__PURE__ */ jsx42(
|
|
2929
3036
|
Pill,
|
|
2930
3037
|
{
|
|
2931
3038
|
className: cx,
|
|
@@ -2941,8 +3048,8 @@ function PathPill({
|
|
|
2941
3048
|
}
|
|
2942
3049
|
|
|
2943
3050
|
// src/components/FormWizard/FormWizard.tsx
|
|
2944
|
-
import { createContext as createContext4, useContext as useContext4, useCallback as
|
|
2945
|
-
import { jsx as
|
|
3051
|
+
import { createContext as createContext4, useContext as useContext4, useCallback as useCallback5, useMemo } from "react";
|
|
3052
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2946
3053
|
var FormWizardContext = createContext4({
|
|
2947
3054
|
currentStep: 0,
|
|
2948
3055
|
totalSteps: 1,
|
|
@@ -2962,7 +3069,7 @@ function FormWizard({
|
|
|
2962
3069
|
}) {
|
|
2963
3070
|
const canGoBack = currentStep > 0;
|
|
2964
3071
|
const isLastStep = currentStep >= totalSteps - 1;
|
|
2965
|
-
const goBack =
|
|
3072
|
+
const goBack = useCallback5(() => {
|
|
2966
3073
|
if (currentStep > 0) {
|
|
2967
3074
|
onStepChange(currentStep - 1);
|
|
2968
3075
|
}
|
|
@@ -2977,13 +3084,13 @@ function FormWizard({
|
|
|
2977
3084
|
}),
|
|
2978
3085
|
[currentStep, totalSteps, canGoBack, goBack, isLastStep]
|
|
2979
3086
|
);
|
|
2980
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ jsx43(FormWizardContext.Provider, { value, children });
|
|
2981
3088
|
}
|
|
2982
3089
|
|
|
2983
3090
|
// src/components/FormWizard/FormWizardProgress.tsx
|
|
2984
|
-
import { jsx as
|
|
3091
|
+
import { jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2985
3092
|
function CheckIcon() {
|
|
2986
|
-
return /* @__PURE__ */
|
|
3093
|
+
return /* @__PURE__ */ jsx44(
|
|
2987
3094
|
"svg",
|
|
2988
3095
|
{
|
|
2989
3096
|
"aria-hidden": "true",
|
|
@@ -2994,24 +3101,24 @@ function CheckIcon() {
|
|
|
2994
3101
|
strokeWidth: "2",
|
|
2995
3102
|
strokeLinecap: "round",
|
|
2996
3103
|
strokeLinejoin: "round",
|
|
2997
|
-
children: /* @__PURE__ */
|
|
3104
|
+
children: /* @__PURE__ */ jsx44("path", { d: "M3 8.5l3.5 3.5 6.5-7" })
|
|
2998
3105
|
}
|
|
2999
3106
|
);
|
|
3000
3107
|
}
|
|
3001
3108
|
function FormWizardProgress({ labels }) {
|
|
3002
3109
|
const { currentStep, totalSteps } = useFormWizard();
|
|
3003
|
-
return /* @__PURE__ */
|
|
3110
|
+
return /* @__PURE__ */ jsx44("nav", { "aria-label": "Form progress", children: /* @__PURE__ */ jsx44("ol", { className: "flex items-start", role: "list", children: labels.map((label, index) => {
|
|
3004
3111
|
const isCompleted = index < currentStep;
|
|
3005
3112
|
const isCurrent = index === currentStep;
|
|
3006
3113
|
const isFuture = index > currentStep;
|
|
3007
|
-
return /* @__PURE__ */
|
|
3114
|
+
return /* @__PURE__ */ jsxs30(
|
|
3008
3115
|
"li",
|
|
3009
3116
|
{
|
|
3010
3117
|
className: "flex flex-1 flex-col items-center",
|
|
3011
3118
|
"aria-current": isCurrent ? "step" : void 0,
|
|
3012
3119
|
children: [
|
|
3013
|
-
/* @__PURE__ */
|
|
3014
|
-
index > 0 ? /* @__PURE__ */
|
|
3120
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex w-full items-center", children: [
|
|
3121
|
+
index > 0 ? /* @__PURE__ */ jsx44(
|
|
3015
3122
|
"div",
|
|
3016
3123
|
{
|
|
3017
3124
|
"aria-hidden": "true",
|
|
@@ -3020,8 +3127,8 @@ function FormWizardProgress({ labels }) {
|
|
|
3020
3127
|
index <= currentStep ? "bg-primary" : "bg-border"
|
|
3021
3128
|
].join(" ")
|
|
3022
3129
|
}
|
|
3023
|
-
) : /* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */
|
|
3130
|
+
) : /* @__PURE__ */ jsx44("div", { className: "flex-1", "aria-hidden": "true" }),
|
|
3131
|
+
/* @__PURE__ */ jsx44(
|
|
3025
3132
|
"div",
|
|
3026
3133
|
{
|
|
3027
3134
|
className: [
|
|
@@ -3033,10 +3140,10 @@ function FormWizardProgress({ labels }) {
|
|
|
3033
3140
|
isFuture ? "border-2 border-border bg-background text-muted-foreground" : ""
|
|
3034
3141
|
].join(" "),
|
|
3035
3142
|
"aria-hidden": "true",
|
|
3036
|
-
children: isCompleted ? /* @__PURE__ */
|
|
3143
|
+
children: isCompleted ? /* @__PURE__ */ jsx44(CheckIcon, {}) : index + 1
|
|
3037
3144
|
}
|
|
3038
3145
|
),
|
|
3039
|
-
index < totalSteps - 1 ? /* @__PURE__ */
|
|
3146
|
+
index < totalSteps - 1 ? /* @__PURE__ */ jsx44(
|
|
3040
3147
|
"div",
|
|
3041
3148
|
{
|
|
3042
3149
|
"aria-hidden": "true",
|
|
@@ -3045,9 +3152,9 @@ function FormWizardProgress({ labels }) {
|
|
|
3045
3152
|
index < currentStep ? "bg-primary" : "bg-border"
|
|
3046
3153
|
].join(" ")
|
|
3047
3154
|
}
|
|
3048
|
-
) : /* @__PURE__ */
|
|
3155
|
+
) : /* @__PURE__ */ jsx44("div", { className: "flex-1", "aria-hidden": "true" })
|
|
3049
3156
|
] }),
|
|
3050
|
-
/* @__PURE__ */
|
|
3157
|
+
/* @__PURE__ */ jsx44(
|
|
3051
3158
|
"span",
|
|
3052
3159
|
{
|
|
3053
3160
|
className: [
|
|
@@ -3065,15 +3172,15 @@ function FormWizardProgress({ labels }) {
|
|
|
3065
3172
|
}
|
|
3066
3173
|
|
|
3067
3174
|
// src/components/FormWizard/FormWizardNav.tsx
|
|
3068
|
-
import { jsx as
|
|
3175
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3069
3176
|
function FormWizardNav({
|
|
3070
3177
|
onNext,
|
|
3071
3178
|
isSubmitting = false,
|
|
3072
3179
|
submitLabel = "Submit"
|
|
3073
3180
|
}) {
|
|
3074
3181
|
const { canGoBack, goBack, isLastStep } = useFormWizard();
|
|
3075
|
-
return /* @__PURE__ */
|
|
3076
|
-
canGoBack && /* @__PURE__ */
|
|
3182
|
+
return /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-end gap-3", children: [
|
|
3183
|
+
canGoBack && /* @__PURE__ */ jsx45(
|
|
3077
3184
|
Button,
|
|
3078
3185
|
{
|
|
3079
3186
|
variant: "secondary",
|
|
@@ -3083,7 +3190,7 @@ function FormWizardNav({
|
|
|
3083
3190
|
children: "Back"
|
|
3084
3191
|
}
|
|
3085
3192
|
),
|
|
3086
|
-
/* @__PURE__ */
|
|
3193
|
+
/* @__PURE__ */ jsx45(
|
|
3087
3194
|
Button,
|
|
3088
3195
|
{
|
|
3089
3196
|
variant: "primary",
|
|
@@ -3513,7 +3620,7 @@ export {
|
|
|
3513
3620
|
MetricCard,
|
|
3514
3621
|
PathPill,
|
|
3515
3622
|
Pill,
|
|
3516
|
-
|
|
3623
|
+
Popover4 as Popover,
|
|
3517
3624
|
PopoverContent,
|
|
3518
3625
|
PopoverTrigger,
|
|
3519
3626
|
ProgressBar,
|
|
@@ -3554,6 +3661,7 @@ export {
|
|
|
3554
3661
|
createToastBridge,
|
|
3555
3662
|
iconRegistry,
|
|
3556
3663
|
pillColorFromName,
|
|
3664
|
+
useContextMenu,
|
|
3557
3665
|
useFormWizard,
|
|
3558
3666
|
useToast
|
|
3559
3667
|
};
|