@ship-it-ui/ui 0.0.8 → 0.0.10
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.cjs +1162 -485
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +305 -26
- package/dist/index.d.ts +305 -26
- package/dist/index.js +1159 -483
- package/dist/index.js.map +1 -1
- package/package.json +27 -27
package/dist/index.cjs
CHANGED
|
@@ -105,6 +105,7 @@ __export(index_exports, {
|
|
|
105
105
|
LargeTitle: () => LargeTitle,
|
|
106
106
|
Lightbox: () => Lightbox,
|
|
107
107
|
ListingCard: () => ListingCard,
|
|
108
|
+
ListingDetail: () => ListingDetail,
|
|
108
109
|
MenuCheckboxItem: () => MenuCheckboxItem,
|
|
109
110
|
MenuItem: () => MenuItem,
|
|
110
111
|
MenuSeparator: () => MenuSeparator,
|
|
@@ -343,11 +344,13 @@ function useOutsideClick(ref, handler, enabled = true) {
|
|
|
343
344
|
var import_react7 = require("react");
|
|
344
345
|
function useTheme() {
|
|
345
346
|
const [theme, setThemeState] = (0, import_react7.useState)("dark");
|
|
347
|
+
const internalMutation = (0, import_react7.useRef)(false);
|
|
346
348
|
const setTheme = (0, import_react7.useCallback)((next) => {
|
|
347
349
|
if (typeof document === "undefined") {
|
|
348
350
|
setThemeState(next);
|
|
349
351
|
return;
|
|
350
352
|
}
|
|
353
|
+
internalMutation.current = true;
|
|
351
354
|
if (next === "light") {
|
|
352
355
|
document.documentElement.setAttribute("data-theme", "light");
|
|
353
356
|
} else {
|
|
@@ -362,6 +365,10 @@ function useTheme() {
|
|
|
362
365
|
const initial = document.documentElement.getAttribute("data-theme");
|
|
363
366
|
setThemeState(initial === "light" ? "light" : "dark");
|
|
364
367
|
const observer = new MutationObserver(() => {
|
|
368
|
+
if (internalMutation.current) {
|
|
369
|
+
internalMutation.current = false;
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
365
372
|
const attr = document.documentElement.getAttribute("data-theme");
|
|
366
373
|
setThemeState(attr === "light" ? "light" : "dark");
|
|
367
374
|
});
|
|
@@ -1741,6 +1748,53 @@ AccordionContent.displayName = "AccordionContent";
|
|
|
1741
1748
|
var RadixAvatar = __toESM(require("@radix-ui/react-avatar"), 1);
|
|
1742
1749
|
var import_react28 = require("react");
|
|
1743
1750
|
|
|
1751
|
+
// src/utils/color-override.ts
|
|
1752
|
+
var HEX = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
1753
|
+
var FUNCTIONAL = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix)\([^()]*(?:\([^()]*\)[^()]*)*\)$/;
|
|
1754
|
+
var KEYWORDS = /* @__PURE__ */ new Set([
|
|
1755
|
+
"transparent",
|
|
1756
|
+
"currentColor",
|
|
1757
|
+
"currentcolor",
|
|
1758
|
+
"inherit",
|
|
1759
|
+
"initial",
|
|
1760
|
+
"unset",
|
|
1761
|
+
"red",
|
|
1762
|
+
"green",
|
|
1763
|
+
"blue",
|
|
1764
|
+
"black",
|
|
1765
|
+
"white",
|
|
1766
|
+
"gray",
|
|
1767
|
+
"grey",
|
|
1768
|
+
"orange",
|
|
1769
|
+
"yellow",
|
|
1770
|
+
"purple",
|
|
1771
|
+
"pink",
|
|
1772
|
+
"brown",
|
|
1773
|
+
"cyan",
|
|
1774
|
+
"magenta"
|
|
1775
|
+
]);
|
|
1776
|
+
var isValid = (value) => {
|
|
1777
|
+
const v = value.trim();
|
|
1778
|
+
if (!v) return false;
|
|
1779
|
+
if (typeof CSS !== "undefined" && typeof CSS.supports === "function") {
|
|
1780
|
+
return CSS.supports("color", v);
|
|
1781
|
+
}
|
|
1782
|
+
return HEX.test(v) || FUNCTIONAL.test(v) || KEYWORDS.has(v);
|
|
1783
|
+
};
|
|
1784
|
+
var warnIfInvalidColor = (value, component) => {
|
|
1785
|
+
if (isValid(value)) return true;
|
|
1786
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1787
|
+
console.warn(
|
|
1788
|
+
`[${component}] Invalid color value "${value}". Falling back to the default variant. Use a hex, rgb/rgba, hsl, oklch, lab/lch, color(), color-mix(), or a CSS color keyword.`
|
|
1789
|
+
);
|
|
1790
|
+
}
|
|
1791
|
+
return false;
|
|
1792
|
+
};
|
|
1793
|
+
var tintStyle = (color) => ({
|
|
1794
|
+
background: `color-mix(in oklab, ${color}, transparent 85%)`,
|
|
1795
|
+
color
|
|
1796
|
+
});
|
|
1797
|
+
|
|
1744
1798
|
// src/components/StatusDot/StatusDot.tsx
|
|
1745
1799
|
var import_react27 = require("react");
|
|
1746
1800
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -1768,13 +1822,14 @@ var stateLabel = {
|
|
|
1768
1822
|
sync: "Syncing",
|
|
1769
1823
|
accent: "Active"
|
|
1770
1824
|
};
|
|
1771
|
-
var StatusDot = (0, import_react27.forwardRef)(function StatusDot2({ state = "ok", label, pulse, size = 8, className, ...props }, ref) {
|
|
1825
|
+
var StatusDot = (0, import_react27.forwardRef)(function StatusDot2({ state = "ok", color, label, pulse, size = 8, className, ...props }, ref) {
|
|
1826
|
+
const useColor = color && warnIfInvalidColor(color, "StatusDot");
|
|
1772
1827
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1773
1828
|
"span",
|
|
1774
1829
|
{
|
|
1775
1830
|
ref,
|
|
1776
1831
|
role: label ? "status" : "img",
|
|
1777
|
-
"aria-label": !label ? stateLabel[state] : void 0,
|
|
1832
|
+
"aria-label": !label ? useColor ? "Status" : stateLabel[state] : void 0,
|
|
1778
1833
|
className: cn("inline-flex items-center gap-[6px]", className),
|
|
1779
1834
|
...props,
|
|
1780
1835
|
children: [
|
|
@@ -1783,11 +1838,15 @@ var StatusDot = (0, import_react27.forwardRef)(function StatusDot2({ state = "ok
|
|
|
1783
1838
|
{
|
|
1784
1839
|
className: cn(
|
|
1785
1840
|
"inline-block rounded-full",
|
|
1786
|
-
stateColor[state],
|
|
1787
|
-
|
|
1788
|
-
|
|
1841
|
+
!useColor && stateColor[state],
|
|
1842
|
+
!useColor && stateText[state],
|
|
1843
|
+
pulse && "animate-[ship-pulse-ring_1.6s_infinite]"
|
|
1789
1844
|
),
|
|
1790
|
-
style: {
|
|
1845
|
+
style: {
|
|
1846
|
+
width: size,
|
|
1847
|
+
height: size,
|
|
1848
|
+
...useColor ? { backgroundColor: color, color } : {}
|
|
1849
|
+
}
|
|
1791
1850
|
}
|
|
1792
1851
|
),
|
|
1793
1852
|
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-muted text-[12px]", children: label })
|
|
@@ -1822,10 +1881,12 @@ function hashHue(str) {
|
|
|
1822
1881
|
for (let i = 0; i < str.length; i++) h = (h * 31 + str.charCodeAt(i)) % 360;
|
|
1823
1882
|
return h;
|
|
1824
1883
|
}
|
|
1825
|
-
var Avatar = (0, import_react28.forwardRef)(function Avatar2({ name = "?", src, size = "md", status, initials, className, style, ...props }, ref) {
|
|
1884
|
+
var Avatar = (0, import_react28.forwardRef)(function Avatar2({ name = "?", src, size = "md", status, initials, color, className, style, ...props }, ref) {
|
|
1826
1885
|
const dim = sizePx[size];
|
|
1827
1886
|
const hue = hashHue(name);
|
|
1828
1887
|
const computedInitials = initials ?? initialsFor(name);
|
|
1888
|
+
const useColor = color && warnIfInvalidColor(color, "Avatar");
|
|
1889
|
+
const fallbackBg = useColor ? color : `oklch(var(--color-avatar-fallback-l) var(--color-avatar-fallback-c) ${hue})`;
|
|
1829
1890
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1830
1891
|
"span",
|
|
1831
1892
|
{
|
|
@@ -1839,7 +1900,7 @@ var Avatar = (0, import_react28.forwardRef)(function Avatar2({ name = "?", src,
|
|
|
1839
1900
|
{
|
|
1840
1901
|
className: "border-border relative inline-flex h-full w-full shrink-0 overflow-hidden rounded-full border",
|
|
1841
1902
|
style: {
|
|
1842
|
-
background: src ? void 0 :
|
|
1903
|
+
background: src ? void 0 : fallbackBg
|
|
1843
1904
|
},
|
|
1844
1905
|
children: [
|
|
1845
1906
|
src && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(RadixAvatar.Image, { src, alt: name, className: "h-full w-full object-cover" }),
|
|
@@ -1907,6 +1968,16 @@ AvatarGroup.displayName = "AvatarGroup";
|
|
|
1907
1968
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
1908
1969
|
var import_react30 = require("react");
|
|
1909
1970
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1971
|
+
var badgeStructural = (0, import_class_variance_authority6.cva)("inline-flex items-center font-sans leading-none whitespace-nowrap", {
|
|
1972
|
+
variants: {
|
|
1973
|
+
size: {
|
|
1974
|
+
sm: "h-[18px] px-[6px] py-[1px] text-[10px] gap-1 rounded-full",
|
|
1975
|
+
md: "h-[22px] px-2 py-[2px] text-[11px] gap-[5px] rounded-full",
|
|
1976
|
+
lg: "h-[26px] px-[10px] py-[3px] text-[12px] gap-[6px] rounded-full"
|
|
1977
|
+
}
|
|
1978
|
+
},
|
|
1979
|
+
defaultVariants: { size: "md" }
|
|
1980
|
+
});
|
|
1910
1981
|
var badgeStyles = (0, import_class_variance_authority6.cva)("inline-flex items-center font-sans leading-none whitespace-nowrap", {
|
|
1911
1982
|
variants: {
|
|
1912
1983
|
variant: {
|
|
@@ -1940,20 +2011,53 @@ var dotColorClass = {
|
|
|
1940
2011
|
solid: "bg-bg"
|
|
1941
2012
|
};
|
|
1942
2013
|
var dotSize = { sm: "h-[5px] w-[5px]", md: "h-[6px] w-[6px]", lg: "h-[7px] w-[7px]" };
|
|
1943
|
-
var Badge = (0, import_react30.forwardRef)(function Badge2({ variant = "neutral", size = "md", dot, icon, className, children, ...props }, ref) {
|
|
2014
|
+
var Badge = (0, import_react30.forwardRef)(function Badge2({ variant = "neutral", size = "md", dot, icon, className, children, color, style, ...props }, ref) {
|
|
1944
2015
|
const sz = size ?? "md";
|
|
1945
|
-
const
|
|
1946
|
-
|
|
1947
|
-
|
|
2016
|
+
const useColor = color && warnIfInvalidColor(color, "Badge");
|
|
2017
|
+
if (useColor) {
|
|
2018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1948
2019
|
"span",
|
|
1949
2020
|
{
|
|
1950
|
-
|
|
1951
|
-
className: cn(
|
|
2021
|
+
ref,
|
|
2022
|
+
className: cn(badgeStructural({ size }), className),
|
|
2023
|
+
style: { ...tintStyle(color), ...style },
|
|
2024
|
+
...props,
|
|
2025
|
+
children: [
|
|
2026
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2027
|
+
"span",
|
|
2028
|
+
{
|
|
2029
|
+
"aria-hidden": true,
|
|
2030
|
+
className: cn("inline-block rounded-full", dotSize[sz]),
|
|
2031
|
+
style: { background: color }
|
|
2032
|
+
}
|
|
2033
|
+
),
|
|
2034
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "inline-flex leading-none", children: icon }),
|
|
2035
|
+
children
|
|
2036
|
+
]
|
|
1952
2037
|
}
|
|
1953
|
-
)
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
2038
|
+
);
|
|
2039
|
+
}
|
|
2040
|
+
const v = variant ?? "neutral";
|
|
2041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2042
|
+
"span",
|
|
2043
|
+
{
|
|
2044
|
+
ref,
|
|
2045
|
+
className: cn(badgeStyles({ variant, size }), className),
|
|
2046
|
+
style,
|
|
2047
|
+
...props,
|
|
2048
|
+
children: [
|
|
2049
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2050
|
+
"span",
|
|
2051
|
+
{
|
|
2052
|
+
"aria-hidden": true,
|
|
2053
|
+
className: cn("inline-block rounded-full", dotSize[sz], dotColorClass[v])
|
|
2054
|
+
}
|
|
2055
|
+
),
|
|
2056
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "inline-flex leading-none", children: icon }),
|
|
2057
|
+
children
|
|
2058
|
+
]
|
|
2059
|
+
}
|
|
2060
|
+
);
|
|
1957
2061
|
});
|
|
1958
2062
|
Badge.displayName = "Badge";
|
|
1959
2063
|
|
|
@@ -2101,18 +2205,23 @@ StatCard.displayName = "StatCard";
|
|
|
2101
2205
|
// src/components/Chip/Chip.tsx
|
|
2102
2206
|
var import_react33 = require("react");
|
|
2103
2207
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2104
|
-
var Chip = (0, import_react33.forwardRef)(function Chip2({ icon, onRemove, density = "comfortable", className, children, ...props }, ref) {
|
|
2208
|
+
var Chip = (0, import_react33.forwardRef)(function Chip2({ icon, onRemove, density = "comfortable", color, className, children, style, ...props }, ref) {
|
|
2105
2209
|
const isTouch = density === "touch";
|
|
2210
|
+
const useColor = color && warnIfInvalidColor(color, "Chip");
|
|
2211
|
+
const structural = cn(
|
|
2212
|
+
"inline-flex items-center gap-[6px] font-sans rounded-full border",
|
|
2213
|
+
isTouch ? "text-m-mono h-8 py-[5px] pr-[6px] pl-3" : "h-[26px] py-[4px] pr-1 pl-[10px] text-[12px]"
|
|
2214
|
+
);
|
|
2215
|
+
const defaultPaint = "bg-panel-2 text-text border-border";
|
|
2106
2216
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2107
2217
|
"span",
|
|
2108
2218
|
{
|
|
2109
2219
|
ref,
|
|
2110
|
-
className: cn(
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
),
|
|
2220
|
+
className: cn(structural, !useColor && defaultPaint, className),
|
|
2221
|
+
style: {
|
|
2222
|
+
...useColor ? { ...tintStyle(color), borderColor: "transparent" } : {},
|
|
2223
|
+
...style
|
|
2224
|
+
},
|
|
2116
2225
|
...props,
|
|
2117
2226
|
children: [
|
|
2118
2227
|
icon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: cn("text-text-dim inline-flex", isTouch ? "text-[12px]" : "text-[10px]"), children: icon }),
|
|
@@ -2176,8 +2285,10 @@ var Rating = (0, import_react35.forwardRef)(function Rating2({
|
|
|
2176
2285
|
readOnly = false,
|
|
2177
2286
|
className,
|
|
2178
2287
|
"aria-label": ariaLabel,
|
|
2288
|
+
color,
|
|
2179
2289
|
...props
|
|
2180
2290
|
}, ref) {
|
|
2291
|
+
const useColor = color && warnIfInvalidColor(color, "Rating");
|
|
2181
2292
|
const [current, setCurrent] = useControllableState({
|
|
2182
2293
|
value,
|
|
2183
2294
|
defaultValue: defaultValue ?? 0,
|
|
@@ -2231,10 +2342,19 @@ var Rating = (0, import_react35.forwardRef)(function Rating2({
|
|
|
2231
2342
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2232
2343
|
"div",
|
|
2233
2344
|
{
|
|
2345
|
+
"data-filled-stars": true,
|
|
2234
2346
|
className: "pointer-events-none absolute inset-0 inline-flex items-center gap-0.5 overflow-hidden",
|
|
2235
|
-
style: { width: `${fillPct}
|
|
2347
|
+
style: { width: `${fillPct}%`, ...useColor ? { color } : {} },
|
|
2236
2348
|
"aria-hidden": true,
|
|
2237
|
-
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2349
|
+
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2350
|
+
import_icons4.IconGlyph,
|
|
2351
|
+
{
|
|
2352
|
+
name: "star",
|
|
2353
|
+
size: px,
|
|
2354
|
+
className: cn("shrink-0", !useColor && "text-rating")
|
|
2355
|
+
},
|
|
2356
|
+
i
|
|
2357
|
+
))
|
|
2238
2358
|
}
|
|
2239
2359
|
)
|
|
2240
2360
|
]
|
|
@@ -2249,6 +2369,7 @@ var Rating = (0, import_react35.forwardRef)(function Rating2({
|
|
|
2249
2369
|
"aria-label": ariaLabel ?? "Rating",
|
|
2250
2370
|
tabIndex: -1,
|
|
2251
2371
|
className: cn("inline-flex items-center gap-0.5", className),
|
|
2372
|
+
style: useColor ? { color } : void 0,
|
|
2252
2373
|
onKeyDown: handleKey,
|
|
2253
2374
|
...props,
|
|
2254
2375
|
children: Array.from({ length: max }).map((_, i) => {
|
|
@@ -2272,8 +2393,8 @@ var Rating = (0, import_react35.forwardRef)(function Rating2({
|
|
|
2272
2393
|
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm",
|
|
2273
2394
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]",
|
|
2274
2395
|
"transition-colors duration-(--duration-micro)",
|
|
2275
|
-
filled ? "text-rating" : "text-rating-dim",
|
|
2276
|
-
"hover:text-rating"
|
|
2396
|
+
useColor ? filled ? "" : "opacity-30" : filled ? "text-rating" : "text-rating-dim",
|
|
2397
|
+
!useColor && "hover:text-rating"
|
|
2277
2398
|
),
|
|
2278
2399
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_icons4.IconGlyph, { name: "star", size: px })
|
|
2279
2400
|
},
|
|
@@ -2399,17 +2520,20 @@ SkeletonGroup.displayName = "SkeletonGroup";
|
|
|
2399
2520
|
// src/components/Tag/Tag.tsx
|
|
2400
2521
|
var import_react38 = require("react");
|
|
2401
2522
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2402
|
-
var Tag = (0, import_react38.forwardRef)(function Tag2({ onRemove, icon, size = 22, className, children, ...props }, ref) {
|
|
2523
|
+
var Tag = (0, import_react38.forwardRef)(function Tag2({ onRemove, icon, size = 22, color, className, children, style, ...props }, ref) {
|
|
2524
|
+
const useColor = color && warnIfInvalidColor(color, "Tag");
|
|
2525
|
+
const structural = "inline-flex items-center gap-[6px] px-2 py-[3px] font-sans text-[11px] rounded-xs border";
|
|
2526
|
+
const defaultPaint = "bg-panel-2 text-text border-border";
|
|
2403
2527
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2404
2528
|
"span",
|
|
2405
2529
|
{
|
|
2406
2530
|
ref,
|
|
2407
|
-
className: cn(
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2531
|
+
className: cn(structural, !useColor && defaultPaint, className),
|
|
2532
|
+
style: {
|
|
2533
|
+
height: size,
|
|
2534
|
+
...useColor ? { ...tintStyle(color), borderColor: "transparent" } : {},
|
|
2535
|
+
...style
|
|
2536
|
+
},
|
|
2413
2537
|
...props,
|
|
2414
2538
|
children: [
|
|
2415
2539
|
icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-text-dim inline-flex", children: icon }),
|
|
@@ -2538,18 +2662,25 @@ var DialogContent = (0, import_react40.forwardRef)(function DialogContent2({ cla
|
|
|
2538
2662
|
});
|
|
2539
2663
|
DialogContent.displayName = "DialogContent";
|
|
2540
2664
|
function Dialog({ title, description, footer, width, children, ...rootProps }) {
|
|
2541
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DialogRoot, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DialogRoot, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2666
|
+
DialogContent,
|
|
2667
|
+
{
|
|
2668
|
+
width,
|
|
2669
|
+
...description ? {} : { "aria-describedby": void 0 },
|
|
2670
|
+
children: [
|
|
2671
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2672
|
+
RadixDialog.Title,
|
|
2673
|
+
{
|
|
2674
|
+
className: cn("text-[16px] font-medium", description ? "mb-[6px]" : "mb-4"),
|
|
2675
|
+
children: title
|
|
2676
|
+
}
|
|
2677
|
+
),
|
|
2678
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RadixDialog.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }),
|
|
2679
|
+
children,
|
|
2680
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
2681
|
+
]
|
|
2682
|
+
}
|
|
2683
|
+
) });
|
|
2553
2684
|
}
|
|
2554
2685
|
|
|
2555
2686
|
// src/components/Dialog/Drawer.tsx
|
|
@@ -2667,7 +2798,13 @@ var AlertDialog = (0, import_react43.forwardRef)(function AlertDialog2({ title,
|
|
|
2667
2798
|
children: title
|
|
2668
2799
|
}
|
|
2669
2800
|
),
|
|
2670
|
-
description
|
|
2801
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixAlert.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }) : (
|
|
2802
|
+
// Radix AlertDialog requires a description for screen-reader users
|
|
2803
|
+
// and warns in dev mode when one is missing. When the caller opts
|
|
2804
|
+
// out of a visible description, fall back to the title text in a
|
|
2805
|
+
// visually-hidden Description so the a11y contract is still met.
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixAlert.Description, { className: "sr-only", children: title })
|
|
2807
|
+
),
|
|
2671
2808
|
children,
|
|
2672
2809
|
footer && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
2673
2810
|
]
|
|
@@ -3682,7 +3819,7 @@ function DataTable(props) {
|
|
|
3682
3819
|
return next;
|
|
3683
3820
|
});
|
|
3684
3821
|
};
|
|
3685
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("table", { ref, className: cn("w-full border-collapse text-[12px]", className), children: [
|
|
3822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("table", { ref, className: cn("relative w-full border-collapse text-[12px]", className), children: [
|
|
3686
3823
|
caption && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("caption", { className: "sr-only", children: caption }),
|
|
3687
3824
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("thead", { className: cn("bg-panel-2", stickyHeader && "z-raised sticky top-0"), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("tr", { children: [
|
|
3688
3825
|
selectable && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { scope: "col", className: "border-border w-8 border-b px-3 py-2 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
@@ -4357,10 +4494,31 @@ Lightbox.displayName = "Lightbox";
|
|
|
4357
4494
|
|
|
4358
4495
|
// src/patterns/ListingCard/ListingCard.tsx
|
|
4359
4496
|
var import_icons8 = require("@ship-it-ui/icons");
|
|
4497
|
+
var import_class_variance_authority11 = require("class-variance-authority");
|
|
4360
4498
|
var import_react60 = require("react");
|
|
4361
4499
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4500
|
+
var hoverVariants = (0, import_class_variance_authority11.cva)("", {
|
|
4501
|
+
variants: {
|
|
4502
|
+
hoverEffect: {
|
|
4503
|
+
lift: "transition-[transform,box-shadow,border-color] duration-(--duration-micro) hover:-translate-y-px hover:shadow hover:border-border-strong",
|
|
4504
|
+
glow: "transition-[box-shadow,border-color] duration-(--duration-micro) hover:ring-[3px] hover:ring-accent-dim hover:border-accent",
|
|
4505
|
+
none: ""
|
|
4506
|
+
}
|
|
4507
|
+
}
|
|
4508
|
+
});
|
|
4509
|
+
var flagToneClass = {
|
|
4510
|
+
accent: "bg-accent-dim text-accent",
|
|
4511
|
+
purple: "bg-[color-mix(in_oklab,var(--color-purple),transparent_75%)] text-purple",
|
|
4512
|
+
pink: "bg-[color-mix(in_oklab,var(--color-pink),transparent_75%)] text-pink",
|
|
4513
|
+
ok: "bg-[color-mix(in_oklab,var(--color-ok),transparent_75%)] text-ok",
|
|
4514
|
+
warn: "bg-[color-mix(in_oklab,var(--color-warn),transparent_75%)] text-warn"
|
|
4515
|
+
};
|
|
4362
4516
|
var ListingCard = (0, import_react60.forwardRef)(function ListingCard2({
|
|
4517
|
+
variant = "default",
|
|
4363
4518
|
photos,
|
|
4519
|
+
renderPhoto,
|
|
4520
|
+
onClick,
|
|
4521
|
+
hoverEffect,
|
|
4364
4522
|
title,
|
|
4365
4523
|
eyebrow,
|
|
4366
4524
|
rating,
|
|
@@ -4368,31 +4526,50 @@ var ListingCard = (0, import_react60.forwardRef)(function ListingCard2({
|
|
|
4368
4526
|
price,
|
|
4369
4527
|
priceUnit = "/day",
|
|
4370
4528
|
originalPrice,
|
|
4529
|
+
pricePrefix,
|
|
4371
4530
|
host,
|
|
4372
4531
|
distance,
|
|
4373
4532
|
verified,
|
|
4374
4533
|
href,
|
|
4375
4534
|
onFavorite,
|
|
4376
4535
|
favorited,
|
|
4377
|
-
width = 280,
|
|
4536
|
+
width = variant === "spec" ? 320 : 280,
|
|
4537
|
+
flag,
|
|
4538
|
+
category,
|
|
4539
|
+
meta,
|
|
4540
|
+
specs,
|
|
4541
|
+
cta,
|
|
4542
|
+
hidePhotoCounter,
|
|
4543
|
+
classNames: cls = {},
|
|
4378
4544
|
className,
|
|
4379
4545
|
...props
|
|
4380
4546
|
}, ref) {
|
|
4547
|
+
const [photoIndex, setPhotoIndex] = (0, import_react60.useState)(0);
|
|
4548
|
+
const isSpec = variant === "spec";
|
|
4549
|
+
const stretchedLinkSupported = !isSpec || !cta && !!href;
|
|
4550
|
+
const isInteractive = Boolean(onClick) || Boolean(href);
|
|
4551
|
+
const effectiveHover = hoverEffect ?? (isInteractive ? "lift" : "none");
|
|
4552
|
+
const hoverClass = hoverVariants({ hoverEffect: effectiveHover });
|
|
4381
4553
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4382
4554
|
Card,
|
|
4383
4555
|
{
|
|
4384
4556
|
ref,
|
|
4385
|
-
className: cn("relative overflow-hidden !p-0", className),
|
|
4557
|
+
className: cn("relative isolate overflow-hidden !p-0", hoverClass, cls.root, className),
|
|
4386
4558
|
style: { width },
|
|
4387
4559
|
...props,
|
|
4388
4560
|
children: [
|
|
4389
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "relative", children: [
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("relative", cls.photos), children: [
|
|
4390
4562
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4391
4563
|
Carousel,
|
|
4392
4564
|
{
|
|
4393
4565
|
items: photos,
|
|
4566
|
+
...isSpec ? {
|
|
4567
|
+
index: photoIndex,
|
|
4568
|
+
onIndexChange: setPhotoIndex,
|
|
4569
|
+
showDots: false
|
|
4570
|
+
} : {},
|
|
4394
4571
|
"aria-label": typeof title === "string" ? `${title} photos` : "Listing photos",
|
|
4395
|
-
renderItem: (src) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4572
|
+
renderItem: (src, i) => renderPhoto ? renderPhoto(src, i) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4396
4573
|
"img",
|
|
4397
4574
|
{
|
|
4398
4575
|
src,
|
|
@@ -4403,15 +4580,133 @@ var ListingCard = (0, import_react60.forwardRef)(function ListingCard2({
|
|
|
4403
4580
|
)
|
|
4404
4581
|
}
|
|
4405
4582
|
),
|
|
4406
|
-
verified && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pointer-events-none absolute top-3 left-3 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Badge, { variant: "ok", size: "sm", children: [
|
|
4583
|
+
!isSpec && verified && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pointer-events-none absolute top-3 left-3 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Badge, { variant: "ok", size: "sm", children: [
|
|
4407
4584
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons8.IconGlyph, { name: "verified", size: 11 }),
|
|
4408
4585
|
" Verified host"
|
|
4409
|
-
] }) })
|
|
4586
|
+
] }) }),
|
|
4587
|
+
isSpec && flag && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pointer-events-none absolute top-3 left-3 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4588
|
+
"span",
|
|
4589
|
+
{
|
|
4590
|
+
className: cn(
|
|
4591
|
+
"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-medium backdrop-blur",
|
|
4592
|
+
flagToneClass[flag.tone ?? "accent"],
|
|
4593
|
+
cls.flag
|
|
4594
|
+
),
|
|
4595
|
+
children: [
|
|
4596
|
+
flag.icon && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons8.IconGlyph, { name: flag.icon, size: 11 }),
|
|
4597
|
+
flag.label
|
|
4598
|
+
]
|
|
4599
|
+
}
|
|
4600
|
+
) }),
|
|
4601
|
+
isSpec && !hidePhotoCounter && photos.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4602
|
+
"div",
|
|
4603
|
+
{
|
|
4604
|
+
"aria-hidden": true,
|
|
4605
|
+
className: cn(
|
|
4606
|
+
"pointer-events-none absolute top-3 right-3 z-10 rounded-full bg-black/55 px-2.5 py-1 font-mono text-[11px] text-white backdrop-blur",
|
|
4607
|
+
cls.photoCounter
|
|
4608
|
+
),
|
|
4609
|
+
children: [
|
|
4610
|
+
photoIndex + 1,
|
|
4611
|
+
" / ",
|
|
4612
|
+
photos.length
|
|
4613
|
+
]
|
|
4614
|
+
}
|
|
4615
|
+
)
|
|
4410
4616
|
] }),
|
|
4411
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex flex-col
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4617
|
+
isSpec ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("flex flex-col", cls.body), children: [
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("flex flex-col gap-2 p-4 pb-3", cls.header), children: [
|
|
4619
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
4620
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: cn("text-text text-[15px] leading-snug font-semibold", cls.title), children: title }),
|
|
4621
|
+
category && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4622
|
+
"span",
|
|
4623
|
+
{
|
|
4624
|
+
className: cn(
|
|
4625
|
+
"border-border bg-panel-2 text-text-muted shrink-0 rounded-full border px-2 py-0.5 text-[10px] tracking-wide uppercase",
|
|
4626
|
+
cls.category
|
|
4627
|
+
),
|
|
4628
|
+
children: category
|
|
4629
|
+
}
|
|
4630
|
+
)
|
|
4631
|
+
] }),
|
|
4632
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: cn("text-text-dim font-mono text-[11px] tracking-wide", cls.meta), children: meta }),
|
|
4633
|
+
specs && specs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4634
|
+
"dl",
|
|
4635
|
+
{
|
|
4636
|
+
className: cn(
|
|
4637
|
+
"border-border mt-1 grid gap-2 border-t pt-3",
|
|
4638
|
+
specs.length === 2 && "grid-cols-2",
|
|
4639
|
+
specs.length === 3 && "grid-cols-3",
|
|
4640
|
+
specs.length >= 4 && "grid-cols-4",
|
|
4641
|
+
cls.specs
|
|
4642
|
+
),
|
|
4643
|
+
children: specs.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("flex flex-col gap-0.5", cls.specCell), children: [
|
|
4644
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4645
|
+
"dt",
|
|
4646
|
+
{
|
|
4647
|
+
className: cn(
|
|
4648
|
+
"text-text-dim text-[10px] tracking-wider uppercase",
|
|
4649
|
+
cls.specLabel
|
|
4650
|
+
),
|
|
4651
|
+
children: s.label
|
|
4652
|
+
}
|
|
4653
|
+
),
|
|
4654
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("dd", { className: cn("text-text text-[13px] font-medium", cls.specValue), children: s.value })
|
|
4655
|
+
] }, i))
|
|
4656
|
+
}
|
|
4657
|
+
)
|
|
4658
|
+
] }),
|
|
4659
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
4660
|
+
"div",
|
|
4661
|
+
{
|
|
4662
|
+
className: cn(
|
|
4663
|
+
"border-border bg-panel-2 relative z-10 flex items-center justify-between gap-2 border-t px-4 py-3",
|
|
4664
|
+
cls.footer
|
|
4665
|
+
),
|
|
4666
|
+
children: [
|
|
4667
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-col leading-tight", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex items-baseline gap-1.5", children: [
|
|
4668
|
+
pricePrefix && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-text-dim text-[11px]", children: pricePrefix }),
|
|
4669
|
+
originalPrice && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-text-dim decoration-sale text-[11px] line-through", children: originalPrice }),
|
|
4670
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: cn("text-text text-[15px] font-semibold", cls.price), children: price }),
|
|
4671
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: cn("text-text-dim text-[11px]", cls.priceUnit), children: priceUnit })
|
|
4672
|
+
] }) }),
|
|
4673
|
+
cta && (cta.href ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4674
|
+
Button,
|
|
4675
|
+
{
|
|
4676
|
+
asChild: true,
|
|
4677
|
+
variant: "primary",
|
|
4678
|
+
size: "sm",
|
|
4679
|
+
disabled: cta.disabled,
|
|
4680
|
+
className: cls.cta,
|
|
4681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("a", { href: cta.href, onClick: cta.onClick, children: cta.label })
|
|
4682
|
+
}
|
|
4683
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4684
|
+
Button,
|
|
4685
|
+
{
|
|
4686
|
+
variant: "primary",
|
|
4687
|
+
size: "sm",
|
|
4688
|
+
onClick: cta.onClick,
|
|
4689
|
+
disabled: cta.disabled,
|
|
4690
|
+
className: cls.cta,
|
|
4691
|
+
children: cta.label
|
|
4692
|
+
}
|
|
4693
|
+
))
|
|
4694
|
+
]
|
|
4695
|
+
}
|
|
4696
|
+
)
|
|
4697
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("flex flex-col gap-1 p-3", cls.body), children: [
|
|
4698
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4699
|
+
"span",
|
|
4700
|
+
{
|
|
4701
|
+
className: cn(
|
|
4702
|
+
"text-text-dim font-mono text-[10px] tracking-wide uppercase",
|
|
4703
|
+
cls.eyebrow
|
|
4704
|
+
),
|
|
4705
|
+
children: eyebrow
|
|
4706
|
+
}
|
|
4707
|
+
),
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("flex items-start justify-between gap-2", cls.header), children: [
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: cn("text-text text-[14px] leading-snug font-semibold", cls.title), children: title }),
|
|
4415
4710
|
rating !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "inline-flex shrink-0 items-center gap-1 text-[12px]", children: [
|
|
4416
4711
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons8.IconGlyph, { name: "star", size: 12, className: "text-rating" }),
|
|
4417
4712
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-text font-medium", children: rating.toFixed(1) }),
|
|
@@ -4422,19 +4717,29 @@ var ListingCard = (0, import_react60.forwardRef)(function ListingCard2({
|
|
|
4422
4717
|
] })
|
|
4423
4718
|
] })
|
|
4424
4719
|
] }),
|
|
4425
|
-
(host || distance) && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "text-text-dim flex items-center gap-2 text-[12px]", children: [
|
|
4720
|
+
(host || distance) && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("text-text-dim flex items-center gap-2 text-[12px]", cls.meta), children: [
|
|
4426
4721
|
host && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: host }),
|
|
4427
4722
|
host && distance && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { "aria-hidden": true, children: "\xB7" }),
|
|
4428
4723
|
distance && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: distance })
|
|
4429
4724
|
] }),
|
|
4430
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "mt-2 flex items-baseline gap-2", children: [
|
|
4725
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("mt-2 flex items-baseline gap-2", cls.footer), children: [
|
|
4431
4726
|
originalPrice && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-text-dim decoration-sale text-[12px] line-through", children: originalPrice }),
|
|
4432
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-text text-[15px] font-semibold", children: price }),
|
|
4433
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-text-dim text-[12px]", children: priceUnit })
|
|
4727
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: cn("text-text text-[15px] font-semibold", cls.price), children: price }),
|
|
4728
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: cn("text-text-dim text-[12px]", cls.priceUnit), children: priceUnit })
|
|
4434
4729
|
] }),
|
|
4435
|
-
rating !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4730
|
+
rating !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4731
|
+
Rating,
|
|
4732
|
+
{
|
|
4733
|
+
value: rating,
|
|
4734
|
+
max: 5,
|
|
4735
|
+
precision: "half",
|
|
4736
|
+
size: "sm",
|
|
4737
|
+
readOnly: true,
|
|
4738
|
+
className: "sr-only"
|
|
4739
|
+
}
|
|
4740
|
+
)
|
|
4436
4741
|
] }),
|
|
4437
|
-
href && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4742
|
+
href && stretchedLinkSupported && !onClick && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4438
4743
|
"a",
|
|
4439
4744
|
{
|
|
4440
4745
|
href,
|
|
@@ -4442,7 +4747,16 @@ var ListingCard = (0, import_react60.forwardRef)(function ListingCard2({
|
|
|
4442
4747
|
className: "absolute inset-0 z-0 no-underline"
|
|
4443
4748
|
}
|
|
4444
4749
|
),
|
|
4445
|
-
|
|
4750
|
+
onClick && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4751
|
+
"button",
|
|
4752
|
+
{
|
|
4753
|
+
type: "button",
|
|
4754
|
+
onClick,
|
|
4755
|
+
"aria-label": typeof title === "string" ? `View ${title}` : "View listing",
|
|
4756
|
+
className: "focus-visible:ring-accent-dim absolute inset-0 z-0 cursor-pointer bg-transparent outline-none focus-visible:ring-[3px]"
|
|
4757
|
+
}
|
|
4758
|
+
),
|
|
4759
|
+
!isSpec && onFavorite && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4446
4760
|
"button",
|
|
4447
4761
|
{
|
|
4448
4762
|
type: "button",
|
|
@@ -4452,7 +4766,8 @@ var ListingCard = (0, import_react60.forwardRef)(function ListingCard2({
|
|
|
4452
4766
|
className: cn(
|
|
4453
4767
|
"absolute top-3 right-3 z-20 inline-grid h-8 w-8 cursor-pointer place-items-center rounded-full",
|
|
4454
4768
|
"bg-panel/85 hover:bg-panel border-border border shadow-sm backdrop-blur",
|
|
4455
|
-
favorited ? "text-err" : "text-text-dim hover:text-text"
|
|
4769
|
+
favorited ? "text-err" : "text-text-dim hover:text-text",
|
|
4770
|
+
cls.favorite
|
|
4456
4771
|
),
|
|
4457
4772
|
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons8.IconGlyph, { name: "heart", size: 16 })
|
|
4458
4773
|
}
|
|
@@ -4463,8 +4778,355 @@ var ListingCard = (0, import_react60.forwardRef)(function ListingCard2({
|
|
|
4463
4778
|
});
|
|
4464
4779
|
ListingCard.displayName = "ListingCard";
|
|
4465
4780
|
|
|
4466
|
-
// src/patterns/
|
|
4781
|
+
// src/patterns/ListingDetail/ListingDetail.tsx
|
|
4782
|
+
var RadixDialog6 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
4783
|
+
var import_icons9 = require("@ship-it-ui/icons");
|
|
4467
4784
|
var import_react61 = require("react");
|
|
4785
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4786
|
+
function renderAction(action, variant) {
|
|
4787
|
+
if (action.href) {
|
|
4788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Button, { asChild: true, variant, disabled: action.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("a", { href: action.href, onClick: action.onClick, children: action.label }) });
|
|
4789
|
+
}
|
|
4790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Button, { variant, onClick: action.onClick, disabled: action.disabled, children: action.label });
|
|
4791
|
+
}
|
|
4792
|
+
var flagToneClass2 = {
|
|
4793
|
+
accent: "bg-accent-dim text-accent",
|
|
4794
|
+
purple: "bg-[color-mix(in_oklab,var(--color-purple),transparent_75%)] text-purple",
|
|
4795
|
+
pink: "bg-[color-mix(in_oklab,var(--color-pink),transparent_75%)] text-pink",
|
|
4796
|
+
ok: "bg-[color-mix(in_oklab,var(--color-ok),transparent_75%)] text-ok",
|
|
4797
|
+
warn: "bg-[color-mix(in_oklab,var(--color-warn),transparent_75%)] text-warn"
|
|
4798
|
+
};
|
|
4799
|
+
var ListingDetail = (0, import_react61.forwardRef)(function ListingDetail2({
|
|
4800
|
+
variant = "default",
|
|
4801
|
+
open,
|
|
4802
|
+
defaultOpen,
|
|
4803
|
+
onOpenChange,
|
|
4804
|
+
photos,
|
|
4805
|
+
renderPhoto,
|
|
4806
|
+
title,
|
|
4807
|
+
eyebrow,
|
|
4808
|
+
description,
|
|
4809
|
+
rating,
|
|
4810
|
+
reviewCount,
|
|
4811
|
+
price,
|
|
4812
|
+
priceUnit = "/day",
|
|
4813
|
+
originalPrice,
|
|
4814
|
+
pricePrefix,
|
|
4815
|
+
host,
|
|
4816
|
+
features,
|
|
4817
|
+
primaryAction,
|
|
4818
|
+
secondaryAction,
|
|
4819
|
+
flag,
|
|
4820
|
+
category,
|
|
4821
|
+
meta,
|
|
4822
|
+
specs,
|
|
4823
|
+
cta,
|
|
4824
|
+
hidePhotoCounter,
|
|
4825
|
+
classNames: cls = {}
|
|
4826
|
+
}, ref) {
|
|
4827
|
+
const [galleryIndex, setGalleryIndex] = (0, import_react61.useState)(0);
|
|
4828
|
+
const [lightboxOpen, setLightboxOpen] = (0, import_react61.useState)(false);
|
|
4829
|
+
const isSpec = variant === "spec";
|
|
4830
|
+
const lightboxTitle = typeof title === "string" ? `${title} photos` : "Listing photos";
|
|
4831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(RadixDialog6.Root, { open, defaultOpen, onOpenChange, children: [
|
|
4832
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(RadixDialog6.Portal, { children: [
|
|
4833
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4834
|
+
RadixDialog6.Overlay,
|
|
4835
|
+
{
|
|
4836
|
+
className: cn(
|
|
4837
|
+
"z-overlay fixed inset-0 bg-black/55 backdrop-blur-[4px]",
|
|
4838
|
+
"data-[state=open]:animate-[ship-fade-in_150ms_ease]",
|
|
4839
|
+
cls.overlay
|
|
4840
|
+
)
|
|
4841
|
+
}
|
|
4842
|
+
),
|
|
4843
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4844
|
+
RadixDialog6.Content,
|
|
4845
|
+
{
|
|
4846
|
+
ref,
|
|
4847
|
+
...description ? {} : { "aria-describedby": void 0 },
|
|
4848
|
+
className: cn(
|
|
4849
|
+
"z-modal fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
|
|
4850
|
+
"w-[calc(100%-32px)] max-w-[960px]",
|
|
4851
|
+
"max-h-[min(92vh,820px)] overflow-hidden",
|
|
4852
|
+
"bg-panel border-border-strong rounded-lg border shadow-lg outline-none",
|
|
4853
|
+
"data-[state=open]:animate-[ship-dialog-in_180ms_var(--easing-out)]",
|
|
4854
|
+
"flex flex-col",
|
|
4855
|
+
cls.content
|
|
4856
|
+
),
|
|
4857
|
+
children: [
|
|
4858
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4859
|
+
"div",
|
|
4860
|
+
{
|
|
4861
|
+
className: cn(
|
|
4862
|
+
"grid grid-cols-1 gap-6 overflow-y-auto p-6 md:grid-cols-[1.1fr_1fr]",
|
|
4863
|
+
isSpec && cta && "pb-4",
|
|
4864
|
+
cls.grid
|
|
4865
|
+
),
|
|
4866
|
+
children: [
|
|
4867
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: cn("flex flex-col gap-3", cls.photos), children: [
|
|
4868
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "relative overflow-hidden rounded-md", children: [
|
|
4869
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4870
|
+
Carousel,
|
|
4871
|
+
{
|
|
4872
|
+
items: photos,
|
|
4873
|
+
index: galleryIndex,
|
|
4874
|
+
onIndexChange: setGalleryIndex,
|
|
4875
|
+
...isSpec ? { showDots: false } : {},
|
|
4876
|
+
"aria-label": typeof title === "string" ? `${title} photos` : "Listing photos",
|
|
4877
|
+
renderItem: (src, i) => renderPhoto ? renderPhoto(src, i, "gallery") : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4878
|
+
"img",
|
|
4879
|
+
{
|
|
4880
|
+
src,
|
|
4881
|
+
alt: "",
|
|
4882
|
+
className: "block h-full w-full object-cover",
|
|
4883
|
+
loading: "lazy"
|
|
4884
|
+
}
|
|
4885
|
+
)
|
|
4886
|
+
}
|
|
4887
|
+
),
|
|
4888
|
+
isSpec && flag ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pointer-events-none absolute top-3 left-3 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4889
|
+
"span",
|
|
4890
|
+
{
|
|
4891
|
+
className: cn(
|
|
4892
|
+
"inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-medium backdrop-blur",
|
|
4893
|
+
flagToneClass2[flag.tone ?? "accent"],
|
|
4894
|
+
cls.flag
|
|
4895
|
+
),
|
|
4896
|
+
children: [
|
|
4897
|
+
flag.icon && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons9.IconGlyph, { name: flag.icon, size: 11 }),
|
|
4898
|
+
flag.label
|
|
4899
|
+
]
|
|
4900
|
+
}
|
|
4901
|
+
) }) : null,
|
|
4902
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4903
|
+
"button",
|
|
4904
|
+
{
|
|
4905
|
+
type: "button",
|
|
4906
|
+
onClick: () => setLightboxOpen(true),
|
|
4907
|
+
"aria-label": "Open photo viewer",
|
|
4908
|
+
className: cn(
|
|
4909
|
+
"bg-panel/85 hover:bg-panel border-border text-text-muted hover:text-text focus-visible:ring-accent-dim absolute z-10 inline-grid h-8 w-8 cursor-pointer place-items-center rounded-full border shadow-sm backdrop-blur outline-none focus-visible:ring-[3px]",
|
|
4910
|
+
isSpec ? "right-3 bottom-3" : "top-3 left-3"
|
|
4911
|
+
),
|
|
4912
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons9.IconGlyph, { name: "maximize", size: 14 })
|
|
4913
|
+
}
|
|
4914
|
+
),
|
|
4915
|
+
isSpec && !hidePhotoCounter && photos.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4916
|
+
"div",
|
|
4917
|
+
{
|
|
4918
|
+
"aria-hidden": true,
|
|
4919
|
+
className: cn(
|
|
4920
|
+
"pointer-events-none absolute top-3 right-3 z-10 rounded-full bg-black/55 px-2.5 py-1 font-mono text-[11px] text-white backdrop-blur",
|
|
4921
|
+
cls.photoCounter
|
|
4922
|
+
),
|
|
4923
|
+
children: [
|
|
4924
|
+
galleryIndex + 1,
|
|
4925
|
+
" / ",
|
|
4926
|
+
photos.length
|
|
4927
|
+
]
|
|
4928
|
+
}
|
|
4929
|
+
)
|
|
4930
|
+
] }),
|
|
4931
|
+
!isSpec && features && features.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("ul", { className: cn("flex flex-wrap gap-2", cls.features), children: features.map((f, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
4932
|
+
"li",
|
|
4933
|
+
{
|
|
4934
|
+
className: "border-border bg-panel-2 text-text-muted inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px]",
|
|
4935
|
+
children: [
|
|
4936
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons9.IconGlyph, { name: f.icon, size: 12 }),
|
|
4937
|
+
f.label
|
|
4938
|
+
]
|
|
4939
|
+
},
|
|
4940
|
+
i
|
|
4941
|
+
)) })
|
|
4942
|
+
] }),
|
|
4943
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: cn("flex flex-col gap-4", cls.info), children: [
|
|
4944
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("header", { className: cn("flex flex-col gap-1.5", cls.header), children: [
|
|
4945
|
+
eyebrow && !isSpec && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-text-dim font-mono text-[10px] tracking-wide uppercase", children: eyebrow }),
|
|
4946
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
4947
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RadixDialog6.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4948
|
+
"h2",
|
|
4949
|
+
{
|
|
4950
|
+
className: cn("text-text text-[22px] leading-tight font-semibold", cls.title),
|
|
4951
|
+
children: title
|
|
4952
|
+
}
|
|
4953
|
+
) }),
|
|
4954
|
+
isSpec && category && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4955
|
+
"span",
|
|
4956
|
+
{
|
|
4957
|
+
className: cn(
|
|
4958
|
+
"border-border bg-panel-2 text-text-muted mt-1 shrink-0 rounded-full border px-2 py-0.5 text-[10px] tracking-wide uppercase",
|
|
4959
|
+
cls.category
|
|
4960
|
+
),
|
|
4961
|
+
children: category
|
|
4962
|
+
}
|
|
4963
|
+
)
|
|
4964
|
+
] }),
|
|
4965
|
+
isSpec && meta && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4966
|
+
"span",
|
|
4967
|
+
{
|
|
4968
|
+
className: cn("text-text-dim font-mono text-[12px] tracking-wide", cls.meta),
|
|
4969
|
+
children: meta
|
|
4970
|
+
}
|
|
4971
|
+
),
|
|
4972
|
+
rating !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "text-text-muted mt-1 flex items-center gap-2 text-[13px]", children: [
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons9.IconGlyph, { name: "star", size: 13, className: "text-rating" }),
|
|
4974
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-text font-medium", children: rating.toFixed(2) }),
|
|
4975
|
+
reviewCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { children: [
|
|
4976
|
+
"(",
|
|
4977
|
+
reviewCount,
|
|
4978
|
+
" reviews)"
|
|
4979
|
+
] }),
|
|
4980
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4981
|
+
Rating,
|
|
4982
|
+
{
|
|
4983
|
+
value: rating,
|
|
4984
|
+
max: 5,
|
|
4985
|
+
precision: "half",
|
|
4986
|
+
size: "sm",
|
|
4987
|
+
readOnly: true,
|
|
4988
|
+
className: "sr-only"
|
|
4989
|
+
}
|
|
4990
|
+
)
|
|
4991
|
+
] })
|
|
4992
|
+
] }),
|
|
4993
|
+
isSpec && specs && specs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4994
|
+
"dl",
|
|
4995
|
+
{
|
|
4996
|
+
className: cn(
|
|
4997
|
+
"border-border grid grid-cols-2 gap-3 border-t pt-4 sm:grid-cols-3",
|
|
4998
|
+
cls.specs
|
|
4999
|
+
),
|
|
5000
|
+
children: specs.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: cn("flex flex-col gap-0.5", cls.specCell), children: [
|
|
5001
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5002
|
+
"dt",
|
|
5003
|
+
{
|
|
5004
|
+
className: cn(
|
|
5005
|
+
"text-text-dim text-[10px] tracking-wider uppercase",
|
|
5006
|
+
cls.specLabel
|
|
5007
|
+
),
|
|
5008
|
+
children: s.label
|
|
5009
|
+
}
|
|
5010
|
+
),
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("dd", { className: cn("text-text text-[15px] font-semibold", cls.specValue), children: s.value })
|
|
5012
|
+
] }, i))
|
|
5013
|
+
}
|
|
5014
|
+
),
|
|
5015
|
+
host && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5016
|
+
"div",
|
|
5017
|
+
{
|
|
5018
|
+
className: cn("border-border flex items-center gap-3 border-t pt-4", cls.host),
|
|
5019
|
+
children: [
|
|
5020
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5021
|
+
Avatar,
|
|
5022
|
+
{
|
|
5023
|
+
size: "md",
|
|
5024
|
+
name: typeof host.name === "string" ? host.name : "Host",
|
|
5025
|
+
src: host.avatarUrl
|
|
5026
|
+
}
|
|
5027
|
+
),
|
|
5028
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col", children: [
|
|
5029
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "text-text inline-flex items-center gap-1.5 text-[13px] font-medium", children: [
|
|
5030
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { children: [
|
|
5031
|
+
"Hosted by ",
|
|
5032
|
+
host.name
|
|
5033
|
+
] }),
|
|
5034
|
+
host.verified && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Badge, { variant: "ok", size: "sm", children: [
|
|
5035
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons9.IconGlyph, { name: "verified", size: 11 }),
|
|
5036
|
+
" Verified"
|
|
5037
|
+
] })
|
|
5038
|
+
] }),
|
|
5039
|
+
host.meta && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-text-dim text-[12px]", children: host.meta })
|
|
5040
|
+
] })
|
|
5041
|
+
]
|
|
5042
|
+
}
|
|
5043
|
+
),
|
|
5044
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RadixDialog6.Description, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: cn("text-text-muted text-[13px] leading-[1.6]", cls.description), children: description }) }),
|
|
5045
|
+
!isSpec && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5046
|
+
"div",
|
|
5047
|
+
{
|
|
5048
|
+
className: cn(
|
|
5049
|
+
"border-border mt-auto flex flex-col gap-3 border-t pt-4",
|
|
5050
|
+
cls.footer
|
|
5051
|
+
),
|
|
5052
|
+
children: [
|
|
5053
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-baseline gap-2", children: [
|
|
5054
|
+
originalPrice && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-text-dim decoration-sale text-[13px] line-through", children: originalPrice }),
|
|
5055
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: cn("text-text text-[22px] font-semibold", cls.price), children: price }),
|
|
5056
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: cn("text-text-dim text-[13px]", cls.priceUnit), children: priceUnit })
|
|
5057
|
+
] }),
|
|
5058
|
+
(primaryAction || secondaryAction) && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end", children: [
|
|
5059
|
+
secondaryAction && renderAction(secondaryAction, "ghost"),
|
|
5060
|
+
primaryAction && renderAction(primaryAction, "primary")
|
|
5061
|
+
] })
|
|
5062
|
+
]
|
|
5063
|
+
}
|
|
5064
|
+
)
|
|
5065
|
+
] })
|
|
5066
|
+
]
|
|
5067
|
+
}
|
|
5068
|
+
),
|
|
5069
|
+
isSpec && (cta || price) && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
5070
|
+
"div",
|
|
5071
|
+
{
|
|
5072
|
+
className: cn(
|
|
5073
|
+
"border-border bg-panel-2 flex items-center justify-between gap-3 border-t px-6 py-4",
|
|
5074
|
+
cls.footer
|
|
5075
|
+
),
|
|
5076
|
+
children: [
|
|
5077
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-baseline gap-2", children: [
|
|
5078
|
+
pricePrefix && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-text-dim text-[12px]", children: pricePrefix }),
|
|
5079
|
+
originalPrice && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-text-dim decoration-sale text-[13px] line-through", children: originalPrice }),
|
|
5080
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: cn("text-text text-[20px] font-semibold", cls.price), children: price }),
|
|
5081
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: cn("text-text-dim text-[13px]", cls.priceUnit), children: priceUnit })
|
|
5082
|
+
] }),
|
|
5083
|
+
cta && (cta.href ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Button, { asChild: true, variant: "primary", disabled: cta.disabled, className: cls.cta, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("a", { href: cta.href, onClick: cta.onClick, children: cta.label }) }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5084
|
+
Button,
|
|
5085
|
+
{
|
|
5086
|
+
variant: "primary",
|
|
5087
|
+
onClick: cta.onClick,
|
|
5088
|
+
disabled: cta.disabled,
|
|
5089
|
+
className: cls.cta,
|
|
5090
|
+
children: cta.label
|
|
5091
|
+
}
|
|
5092
|
+
))
|
|
5093
|
+
]
|
|
5094
|
+
}
|
|
5095
|
+
),
|
|
5096
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RadixDialog6.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5097
|
+
"button",
|
|
5098
|
+
{
|
|
5099
|
+
type: "button",
|
|
5100
|
+
"aria-label": "Close listing details",
|
|
5101
|
+
className: cn(
|
|
5102
|
+
"bg-panel-2 hover:bg-panel-2/80 text-text-muted hover:text-text border-border focus-visible:ring-accent-dim absolute top-3 right-3 inline-grid h-9 w-9 cursor-pointer place-items-center rounded-full border outline-none focus-visible:ring-[3px]",
|
|
5103
|
+
cls.close
|
|
5104
|
+
),
|
|
5105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons9.IconGlyph, { name: "close", size: 16 })
|
|
5106
|
+
}
|
|
5107
|
+
) })
|
|
5108
|
+
]
|
|
5109
|
+
}
|
|
5110
|
+
)
|
|
5111
|
+
] }),
|
|
5112
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5113
|
+
Lightbox,
|
|
5114
|
+
{
|
|
5115
|
+
open: lightboxOpen,
|
|
5116
|
+
onOpenChange: setLightboxOpen,
|
|
5117
|
+
items: photos,
|
|
5118
|
+
index: galleryIndex,
|
|
5119
|
+
onIndexChange: setGalleryIndex,
|
|
5120
|
+
title: lightboxTitle,
|
|
5121
|
+
renderItem: (src, i) => renderPhoto ? renderPhoto(src, i, "lightbox") : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("img", { src, alt: "", className: "max-h-[88vh] max-w-[92vw] object-contain" })
|
|
5122
|
+
}
|
|
5123
|
+
)
|
|
5124
|
+
] });
|
|
5125
|
+
});
|
|
5126
|
+
ListingDetail.displayName = "ListingDetail";
|
|
5127
|
+
|
|
5128
|
+
// src/patterns/PhoneInput/PhoneInput.tsx
|
|
5129
|
+
var import_react62 = require("react");
|
|
4468
5130
|
|
|
4469
5131
|
// src/patterns/PhoneInput/countries.ts
|
|
4470
5132
|
var phoneCountries = [
|
|
@@ -4508,7 +5170,7 @@ var phoneCountries = [
|
|
|
4508
5170
|
];
|
|
4509
5171
|
|
|
4510
5172
|
// src/patterns/PhoneInput/PhoneInput.tsx
|
|
4511
|
-
var
|
|
5173
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4512
5174
|
function parseE164(value, list) {
|
|
4513
5175
|
if (!value.startsWith("+")) return null;
|
|
4514
5176
|
const digits = value.slice(1);
|
|
@@ -4522,7 +5184,7 @@ function toE164(country, national) {
|
|
|
4522
5184
|
if (cleaned.length === 0) return "";
|
|
4523
5185
|
return `+${country.dialCode}${cleaned}`;
|
|
4524
5186
|
}
|
|
4525
|
-
var PhoneInput = (0,
|
|
5187
|
+
var PhoneInput = (0, import_react62.forwardRef)(function PhoneInput2({
|
|
4526
5188
|
value,
|
|
4527
5189
|
defaultValue,
|
|
4528
5190
|
onValueChange,
|
|
@@ -4537,13 +5199,13 @@ var PhoneInput = (0, import_react61.forwardRef)(function PhoneInput2({
|
|
|
4537
5199
|
defaultValue: defaultValue ?? "",
|
|
4538
5200
|
onChange: onValueChange
|
|
4539
5201
|
});
|
|
4540
|
-
const parsed = (0,
|
|
4541
|
-
const [country, setCountry] = (0,
|
|
5202
|
+
const parsed = (0, import_react62.useMemo)(() => parseE164(committed ?? "", countries), [committed, countries]);
|
|
5203
|
+
const [country, setCountry] = (0, import_react62.useState)(
|
|
4542
5204
|
parsed?.country ?? countries.find((c) => c.code === defaultCountry) ?? countries[0]
|
|
4543
5205
|
);
|
|
4544
|
-
const [national, setNational] = (0,
|
|
4545
|
-
const lastEmittedRef = (0,
|
|
4546
|
-
(0,
|
|
5206
|
+
const [national, setNational] = (0, import_react62.useState)(parsed?.national ?? "");
|
|
5207
|
+
const lastEmittedRef = (0, import_react62.useRef)(committed ?? "");
|
|
5208
|
+
(0, import_react62.useEffect)(() => {
|
|
4547
5209
|
const current = committed ?? "";
|
|
4548
5210
|
if (current === lastEmittedRef.current) return;
|
|
4549
5211
|
lastEmittedRef.current = current;
|
|
@@ -4568,14 +5230,14 @@ var PhoneInput = (0, import_react61.forwardRef)(function PhoneInput2({
|
|
|
4568
5230
|
lastEmittedRef.current = emitted;
|
|
4569
5231
|
setCommitted(emitted);
|
|
4570
5232
|
};
|
|
4571
|
-
const selectOptions = (0,
|
|
5233
|
+
const selectOptions = (0, import_react62.useMemo)(
|
|
4572
5234
|
() => countries.map((c) => ({
|
|
4573
5235
|
value: c.code,
|
|
4574
5236
|
label: `${c.flag} +${c.dialCode}`
|
|
4575
5237
|
})),
|
|
4576
5238
|
[countries]
|
|
4577
5239
|
);
|
|
4578
|
-
return /* @__PURE__ */ (0,
|
|
5240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
4579
5241
|
"div",
|
|
4580
5242
|
{
|
|
4581
5243
|
className: cn(
|
|
@@ -4584,7 +5246,7 @@ var PhoneInput = (0, import_react61.forwardRef)(function PhoneInput2({
|
|
|
4584
5246
|
disabled && "opacity-50"
|
|
4585
5247
|
),
|
|
4586
5248
|
children: [
|
|
4587
|
-
/* @__PURE__ */ (0,
|
|
5249
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4588
5250
|
Select,
|
|
4589
5251
|
{
|
|
4590
5252
|
options: selectOptions,
|
|
@@ -4594,7 +5256,7 @@ var PhoneInput = (0, import_react61.forwardRef)(function PhoneInput2({
|
|
|
4594
5256
|
"aria-label": "Country"
|
|
4595
5257
|
}
|
|
4596
5258
|
),
|
|
4597
|
-
/* @__PURE__ */ (0,
|
|
5259
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4598
5260
|
"input",
|
|
4599
5261
|
{
|
|
4600
5262
|
ref,
|
|
@@ -4616,8 +5278,8 @@ var PhoneInput = (0, import_react61.forwardRef)(function PhoneInput2({
|
|
|
4616
5278
|
PhoneInput.displayName = "PhoneInput";
|
|
4617
5279
|
|
|
4618
5280
|
// src/patterns/PriceBreakdown/PriceBreakdown.tsx
|
|
4619
|
-
var
|
|
4620
|
-
var
|
|
5281
|
+
var import_react63 = require("react");
|
|
5282
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4621
5283
|
function PriceBreakdownRoot({
|
|
4622
5284
|
items,
|
|
4623
5285
|
total,
|
|
@@ -4627,30 +5289,30 @@ function PriceBreakdownRoot({
|
|
|
4627
5289
|
children,
|
|
4628
5290
|
...props
|
|
4629
5291
|
}, ref) {
|
|
4630
|
-
return /* @__PURE__ */ (0,
|
|
4631
|
-
items?.map((item, i) => /* @__PURE__ */ (0,
|
|
5292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { ref, className: cn("flex flex-col gap-2", className), ...props, children: [
|
|
5293
|
+
items?.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PriceBreakdownLine, { ...item }, i)),
|
|
4632
5294
|
children,
|
|
4633
|
-
total !== void 0 && /* @__PURE__ */ (0,
|
|
4634
|
-
/* @__PURE__ */ (0,
|
|
4635
|
-
/* @__PURE__ */ (0,
|
|
5295
|
+
total !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "border-border mt-2 flex items-baseline justify-between border-t pt-3", children: [
|
|
5296
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text text-[14px] font-semibold", children: totalLabel }),
|
|
5297
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "text-text text-[16px] font-semibold", children: [
|
|
4636
5298
|
total,
|
|
4637
|
-
currency && /* @__PURE__ */ (0,
|
|
5299
|
+
currency && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text-dim ml-1 text-[12px] font-normal", children: currency })
|
|
4638
5300
|
] })
|
|
4639
5301
|
] })
|
|
4640
5302
|
] });
|
|
4641
5303
|
}
|
|
4642
|
-
var PriceBreakdown = (0,
|
|
5304
|
+
var PriceBreakdown = (0, import_react63.forwardRef)(PriceBreakdownRoot);
|
|
4643
5305
|
PriceBreakdown.displayName = "PriceBreakdown";
|
|
4644
|
-
var PriceBreakdownLine = (0,
|
|
5306
|
+
var PriceBreakdownLine = (0, import_react63.forwardRef)(
|
|
4645
5307
|
function PriceBreakdownLine2({ label, subLabel, amount, originalAmount, discount, className }, ref) {
|
|
4646
|
-
return /* @__PURE__ */ (0,
|
|
4647
|
-
/* @__PURE__ */ (0,
|
|
4648
|
-
/* @__PURE__ */ (0,
|
|
4649
|
-
subLabel && /* @__PURE__ */ (0,
|
|
5308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { ref, className: cn("flex items-baseline justify-between gap-3", className), children: [
|
|
5309
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex min-w-0 flex-col", children: [
|
|
5310
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text text-[13px]", children: label }),
|
|
5311
|
+
subLabel && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text-dim text-[11px]", children: subLabel })
|
|
4650
5312
|
] }),
|
|
4651
|
-
/* @__PURE__ */ (0,
|
|
4652
|
-
originalAmount && /* @__PURE__ */ (0,
|
|
4653
|
-
/* @__PURE__ */ (0,
|
|
5313
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "inline-flex shrink-0 items-baseline gap-2", children: [
|
|
5314
|
+
originalAmount && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-text-dim decoration-sale text-[12px] line-through", children: originalAmount }),
|
|
5315
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4654
5316
|
"span",
|
|
4655
5317
|
{
|
|
4656
5318
|
className: cn("text-[13px] font-medium", discount ? "text-sale-text" : "text-text"),
|
|
@@ -4665,19 +5327,19 @@ PriceBreakdownLine.displayName = "PriceBreakdownLine";
|
|
|
4665
5327
|
PriceBreakdown.Line = PriceBreakdownLine;
|
|
4666
5328
|
|
|
4667
5329
|
// src/patterns/ReviewCard/ReviewCard.tsx
|
|
4668
|
-
var
|
|
4669
|
-
var
|
|
4670
|
-
var
|
|
4671
|
-
var ReviewCard = (0,
|
|
4672
|
-
return /* @__PURE__ */ (0,
|
|
5330
|
+
var import_icons10 = require("@ship-it-ui/icons");
|
|
5331
|
+
var import_react64 = require("react");
|
|
5332
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5333
|
+
var ReviewCard = (0, import_react64.forwardRef)(function ReviewCard2({ author, authorAvatar, rating, date, body, photos, verified, subtitle, className, ...props }, ref) {
|
|
5334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
4673
5335
|
"article",
|
|
4674
5336
|
{
|
|
4675
5337
|
ref,
|
|
4676
5338
|
className: cn("border-border bg-panel flex flex-col gap-3 rounded-md border p-4", className),
|
|
4677
5339
|
...props,
|
|
4678
5340
|
children: [
|
|
4679
|
-
/* @__PURE__ */ (0,
|
|
4680
|
-
/* @__PURE__ */ (0,
|
|
5341
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("header", { className: "flex items-start gap-3", children: [
|
|
5342
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4681
5343
|
Avatar,
|
|
4682
5344
|
{
|
|
4683
5345
|
src: authorAvatar,
|
|
@@ -4685,24 +5347,24 @@ var ReviewCard = (0, import_react63.forwardRef)(function ReviewCard2({ author, a
|
|
|
4685
5347
|
size: "md"
|
|
4686
5348
|
}
|
|
4687
5349
|
),
|
|
4688
|
-
/* @__PURE__ */ (0,
|
|
4689
|
-
/* @__PURE__ */ (0,
|
|
4690
|
-
/* @__PURE__ */ (0,
|
|
4691
|
-
verified && /* @__PURE__ */ (0,
|
|
4692
|
-
/* @__PURE__ */ (0,
|
|
5350
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
5351
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5352
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-text text-[14px] leading-tight font-semibold", children: author }),
|
|
5353
|
+
verified && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Badge, { variant: "ok", size: "sm", children: [
|
|
5354
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons10.IconGlyph, { name: "verified", size: 11 }),
|
|
4693
5355
|
" Verified trip"
|
|
4694
5356
|
] })
|
|
4695
5357
|
] }),
|
|
4696
|
-
subtitle && /* @__PURE__ */ (0,
|
|
4697
|
-
/* @__PURE__ */ (0,
|
|
4698
|
-
/* @__PURE__ */ (0,
|
|
4699
|
-
/* @__PURE__ */ (0,
|
|
4700
|
-
/* @__PURE__ */ (0,
|
|
5358
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-text-dim text-[11px]", children: subtitle }),
|
|
5359
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "mt-1 flex items-center gap-2", children: [
|
|
5360
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Rating, { value: rating, max: 5, precision: "half", size: "sm", readOnly: true }),
|
|
5361
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-text-dim text-[11px]", children: "\xB7" }),
|
|
5362
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("time", { className: "text-text-dim text-[11px]", children: date })
|
|
4701
5363
|
] })
|
|
4702
5364
|
] })
|
|
4703
5365
|
] }),
|
|
4704
|
-
/* @__PURE__ */ (0,
|
|
4705
|
-
photos && photos.length > 0 && /* @__PURE__ */ (0,
|
|
5366
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-text text-[13px] leading-relaxed", children: body }),
|
|
5367
|
+
photos && photos.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex gap-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: photos.map((src, i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
4706
5368
|
"img",
|
|
4707
5369
|
{
|
|
4708
5370
|
src,
|
|
@@ -4719,11 +5381,11 @@ var ReviewCard = (0, import_react63.forwardRef)(function ReviewCard2({ author, a
|
|
|
4719
5381
|
ReviewCard.displayName = "ReviewCard";
|
|
4720
5382
|
|
|
4721
5383
|
// src/patterns/Dots/Dots.tsx
|
|
4722
|
-
var
|
|
4723
|
-
var
|
|
4724
|
-
var Dots = (0,
|
|
5384
|
+
var import_react65 = require("react");
|
|
5385
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5386
|
+
var Dots = (0, import_react65.forwardRef)(function Dots2({ total, current, onChange, className, "aria-label": ariaLabel = "Progress", ...props }, ref) {
|
|
4725
5387
|
const interactive = typeof onChange === "function";
|
|
4726
|
-
return /* @__PURE__ */ (0,
|
|
5388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4727
5389
|
"nav",
|
|
4728
5390
|
{
|
|
4729
5391
|
ref,
|
|
@@ -4737,7 +5399,7 @@ var Dots = (0, import_react64.forwardRef)(function Dots2({ total, current, onCha
|
|
|
4737
5399
|
isActive ? "w-[18px] bg-accent" : "w-[6px] bg-panel-2"
|
|
4738
5400
|
);
|
|
4739
5401
|
if (interactive) {
|
|
4740
|
-
return /* @__PURE__ */ (0,
|
|
5402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4741
5403
|
"button",
|
|
4742
5404
|
{
|
|
4743
5405
|
type: "button",
|
|
@@ -4754,7 +5416,7 @@ var Dots = (0, import_react64.forwardRef)(function Dots2({ total, current, onCha
|
|
|
4754
5416
|
i
|
|
4755
5417
|
);
|
|
4756
5418
|
}
|
|
4757
|
-
return /* @__PURE__ */ (0,
|
|
5419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { "aria-hidden": true, className: sharedClass }, i);
|
|
4758
5420
|
})
|
|
4759
5421
|
}
|
|
4760
5422
|
);
|
|
@@ -4762,13 +5424,13 @@ var Dots = (0, import_react64.forwardRef)(function Dots2({ total, current, onCha
|
|
|
4762
5424
|
Dots.displayName = "Dots";
|
|
4763
5425
|
|
|
4764
5426
|
// src/patterns/Dropzone/Dropzone.tsx
|
|
4765
|
-
var
|
|
4766
|
-
var
|
|
5427
|
+
var import_react66 = require("react");
|
|
5428
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4767
5429
|
function listToArray(list) {
|
|
4768
5430
|
if (!list) return [];
|
|
4769
5431
|
return Array.from(list);
|
|
4770
5432
|
}
|
|
4771
|
-
var Dropzone = (0,
|
|
5433
|
+
var Dropzone = (0, import_react66.forwardRef)(function Dropzone2({
|
|
4772
5434
|
onFiles,
|
|
4773
5435
|
accept,
|
|
4774
5436
|
multiple = true,
|
|
@@ -4779,7 +5441,7 @@ var Dropzone = (0, import_react65.forwardRef)(function Dropzone2({
|
|
|
4779
5441
|
className,
|
|
4780
5442
|
...props
|
|
4781
5443
|
}, ref) {
|
|
4782
|
-
const [isDragging, setIsDragging] = (0,
|
|
5444
|
+
const [isDragging, setIsDragging] = (0, import_react66.useState)(false);
|
|
4783
5445
|
const onDragOver = (e) => {
|
|
4784
5446
|
if (disabled) return;
|
|
4785
5447
|
e.preventDefault();
|
|
@@ -4793,7 +5455,7 @@ var Dropzone = (0, import_react65.forwardRef)(function Dropzone2({
|
|
|
4793
5455
|
const files = listToArray(e.dataTransfer.files);
|
|
4794
5456
|
if (files.length) onFiles?.(files);
|
|
4795
5457
|
};
|
|
4796
|
-
return /* @__PURE__ */ (0,
|
|
5458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
4797
5459
|
"label",
|
|
4798
5460
|
{
|
|
4799
5461
|
ref,
|
|
@@ -4810,7 +5472,7 @@ var Dropzone = (0, import_react65.forwardRef)(function Dropzone2({
|
|
|
4810
5472
|
),
|
|
4811
5473
|
...props,
|
|
4812
5474
|
children: [
|
|
4813
|
-
/* @__PURE__ */ (0,
|
|
5475
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4814
5476
|
"input",
|
|
4815
5477
|
{
|
|
4816
5478
|
type: "file",
|
|
@@ -4826,7 +5488,7 @@ var Dropzone = (0, import_react65.forwardRef)(function Dropzone2({
|
|
|
4826
5488
|
}
|
|
4827
5489
|
}
|
|
4828
5490
|
),
|
|
4829
|
-
/* @__PURE__ */ (0,
|
|
5491
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4830
5492
|
"div",
|
|
4831
5493
|
{
|
|
4832
5494
|
"aria-hidden": true,
|
|
@@ -4834,8 +5496,8 @@ var Dropzone = (0, import_react65.forwardRef)(function Dropzone2({
|
|
|
4834
5496
|
children: icon
|
|
4835
5497
|
}
|
|
4836
5498
|
),
|
|
4837
|
-
/* @__PURE__ */ (0,
|
|
4838
|
-
description && /* @__PURE__ */ (0,
|
|
5499
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "mb-1 text-[13px] font-medium", children: title }),
|
|
5500
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "text-text-dim text-[11px]", children: description })
|
|
4839
5501
|
]
|
|
4840
5502
|
}
|
|
4841
5503
|
);
|
|
@@ -4843,10 +5505,10 @@ var Dropzone = (0, import_react65.forwardRef)(function Dropzone2({
|
|
|
4843
5505
|
Dropzone.displayName = "Dropzone";
|
|
4844
5506
|
|
|
4845
5507
|
// src/patterns/EmptyState/EmptyState.tsx
|
|
4846
|
-
var
|
|
4847
|
-
var
|
|
4848
|
-
var
|
|
4849
|
-
var plateStyles = (0,
|
|
5508
|
+
var import_class_variance_authority12 = require("class-variance-authority");
|
|
5509
|
+
var import_react67 = require("react");
|
|
5510
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5511
|
+
var plateStyles = (0, import_class_variance_authority12.cva)("grid h-12 w-12 place-items-center rounded-base text-[22px]", {
|
|
4850
5512
|
variants: {
|
|
4851
5513
|
tone: {
|
|
4852
5514
|
neutral: "bg-panel-2 text-text-muted",
|
|
@@ -4858,8 +5520,8 @@ var plateStyles = (0, import_class_variance_authority11.cva)("grid h-12 w-12 pla
|
|
|
4858
5520
|
},
|
|
4859
5521
|
defaultVariants: { tone: "neutral" }
|
|
4860
5522
|
});
|
|
4861
|
-
var EmptyState = (0,
|
|
4862
|
-
return /* @__PURE__ */ (0,
|
|
5523
|
+
var EmptyState = (0, import_react67.forwardRef)(function EmptyState2({ icon, title, description, action, chips, tone, className, ...props }, ref) {
|
|
5524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
4863
5525
|
"div",
|
|
4864
5526
|
{
|
|
4865
5527
|
ref,
|
|
@@ -4869,10 +5531,10 @@ var EmptyState = (0, import_react66.forwardRef)(function EmptyState2({ icon, tit
|
|
|
4869
5531
|
),
|
|
4870
5532
|
...props,
|
|
4871
5533
|
children: [
|
|
4872
|
-
icon != null && /* @__PURE__ */ (0,
|
|
4873
|
-
/* @__PURE__ */ (0,
|
|
4874
|
-
description && /* @__PURE__ */ (0,
|
|
4875
|
-
chips && chips.length > 0 && /* @__PURE__ */ (0,
|
|
5534
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { "aria-hidden": true, className: plateStyles({ tone: tone ?? "neutral" }), children: icon }),
|
|
5535
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "text-[14px] font-medium", children: title }),
|
|
5536
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "text-text-muted max-w-[260px] text-[12px] leading-[1.5]", children: description }),
|
|
5537
|
+
chips && chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex w-full flex-col gap-1", children: chips.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4876
5538
|
"button",
|
|
4877
5539
|
{
|
|
4878
5540
|
type: "button",
|
|
@@ -4894,18 +5556,18 @@ var EmptyState = (0, import_react66.forwardRef)(function EmptyState2({ icon, tit
|
|
|
4894
5556
|
EmptyState.displayName = "EmptyState";
|
|
4895
5557
|
|
|
4896
5558
|
// src/patterns/FileChip/FileChip.tsx
|
|
4897
|
-
var
|
|
4898
|
-
var
|
|
5559
|
+
var import_react68 = require("react");
|
|
5560
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4899
5561
|
function deriveExt(name) {
|
|
4900
5562
|
const dot = name.lastIndexOf(".");
|
|
4901
5563
|
if (dot < 0) return "FILE";
|
|
4902
5564
|
return name.slice(dot + 1).slice(0, 4).toUpperCase();
|
|
4903
5565
|
}
|
|
4904
|
-
var FileChip = (0,
|
|
5566
|
+
var FileChip = (0, import_react68.forwardRef)(function FileChip2({ name, size, progress, icon, onRemove, failed, className, ...props }, ref) {
|
|
4905
5567
|
const ext = deriveExt(name);
|
|
4906
5568
|
const showProgress = typeof progress === "number";
|
|
4907
5569
|
const isComplete = showProgress && progress >= 100;
|
|
4908
|
-
return /* @__PURE__ */ (0,
|
|
5570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
4909
5571
|
"div",
|
|
4910
5572
|
{
|
|
4911
5573
|
ref,
|
|
@@ -4915,7 +5577,7 @@ var FileChip = (0, import_react67.forwardRef)(function FileChip2({ name, size, p
|
|
|
4915
5577
|
),
|
|
4916
5578
|
...props,
|
|
4917
5579
|
children: [
|
|
4918
|
-
/* @__PURE__ */ (0,
|
|
5580
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4919
5581
|
"span",
|
|
4920
5582
|
{
|
|
4921
5583
|
"aria-hidden": true,
|
|
@@ -4923,17 +5585,17 @@ var FileChip = (0, import_react67.forwardRef)(function FileChip2({ name, size, p
|
|
|
4923
5585
|
children: icon ?? ext
|
|
4924
5586
|
}
|
|
4925
5587
|
),
|
|
4926
|
-
/* @__PURE__ */ (0,
|
|
4927
|
-
/* @__PURE__ */ (0,
|
|
4928
|
-
/* @__PURE__ */ (0,
|
|
5588
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5589
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "truncate text-[12px] font-medium", children: name }),
|
|
5590
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: cn("font-mono text-[10px]", failed ? "text-err" : "text-text-dim"), children: [
|
|
4929
5591
|
size,
|
|
4930
|
-
showProgress && !isComplete && /* @__PURE__ */ (0,
|
|
5592
|
+
showProgress && !isComplete && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("span", { children: [
|
|
4931
5593
|
" \xB7 ",
|
|
4932
5594
|
Math.round(progress),
|
|
4933
5595
|
"%"
|
|
4934
5596
|
] })
|
|
4935
5597
|
] }),
|
|
4936
|
-
showProgress && !isComplete && /* @__PURE__ */ (0,
|
|
5598
|
+
showProgress && !isComplete && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-panel mt-1 h-[2px] overflow-hidden rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4937
5599
|
"div",
|
|
4938
5600
|
{
|
|
4939
5601
|
className: cn(
|
|
@@ -4944,7 +5606,7 @@ var FileChip = (0, import_react67.forwardRef)(function FileChip2({ name, size, p
|
|
|
4944
5606
|
}
|
|
4945
5607
|
) })
|
|
4946
5608
|
] }),
|
|
4947
|
-
onRemove && /* @__PURE__ */ (0,
|
|
5609
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4948
5610
|
"button",
|
|
4949
5611
|
{
|
|
4950
5612
|
type: "button",
|
|
@@ -4964,10 +5626,10 @@ var FileChip = (0, import_react67.forwardRef)(function FileChip2({ name, size, p
|
|
|
4964
5626
|
FileChip.displayName = "FileChip";
|
|
4965
5627
|
|
|
4966
5628
|
// src/patterns/FilterPanel/FilterPanel.tsx
|
|
4967
|
-
var
|
|
4968
|
-
var
|
|
5629
|
+
var import_react69 = require("react");
|
|
5630
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4969
5631
|
var EMPTY = Object.freeze({});
|
|
4970
|
-
var FilterPanel = (0,
|
|
5632
|
+
var FilterPanel = (0, import_react69.forwardRef)(function FilterPanel2({
|
|
4971
5633
|
facets,
|
|
4972
5634
|
value,
|
|
4973
5635
|
defaultValue,
|
|
@@ -4985,7 +5647,7 @@ var FilterPanel = (0, import_react68.forwardRef)(function FilterPanel2({
|
|
|
4985
5647
|
onChange: onValueChange
|
|
4986
5648
|
});
|
|
4987
5649
|
const total = facets.reduce((sum, facet) => sum + (selection[facet.id]?.length ?? 0), 0);
|
|
4988
|
-
const toggle = (0,
|
|
5650
|
+
const toggle = (0, import_react69.useCallback)(
|
|
4989
5651
|
(facetId, optionValue, next) => {
|
|
4990
5652
|
setSelection((prev) => {
|
|
4991
5653
|
const current = prev?.[facetId] ?? [];
|
|
@@ -4996,11 +5658,11 @@ var FilterPanel = (0, import_react68.forwardRef)(function FilterPanel2({
|
|
|
4996
5658
|
},
|
|
4997
5659
|
[setSelection]
|
|
4998
5660
|
);
|
|
4999
|
-
const handleReset = (0,
|
|
5661
|
+
const handleReset = (0, import_react69.useCallback)(() => {
|
|
5000
5662
|
setSelection(EMPTY);
|
|
5001
5663
|
onReset?.();
|
|
5002
5664
|
}, [setSelection, onReset]);
|
|
5003
|
-
return /* @__PURE__ */ (0,
|
|
5665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
5004
5666
|
"div",
|
|
5005
5667
|
{
|
|
5006
5668
|
ref,
|
|
@@ -5012,10 +5674,10 @@ var FilterPanel = (0, import_react68.forwardRef)(function FilterPanel2({
|
|
|
5012
5674
|
),
|
|
5013
5675
|
...props,
|
|
5014
5676
|
children: [
|
|
5015
|
-
/* @__PURE__ */ (0,
|
|
5016
|
-
/* @__PURE__ */ (0,
|
|
5017
|
-
total > 0 && /* @__PURE__ */ (0,
|
|
5018
|
-
/* @__PURE__ */ (0,
|
|
5677
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5678
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-text-dim font-mono text-[10px] tracking-[1.4px] uppercase", children: title }),
|
|
5679
|
+
total > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Badge, { size: "sm", variant: "accent", children: total }),
|
|
5680
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5019
5681
|
Button,
|
|
5020
5682
|
{
|
|
5021
5683
|
type: "button",
|
|
@@ -5028,7 +5690,7 @@ var FilterPanel = (0, import_react68.forwardRef)(function FilterPanel2({
|
|
|
5028
5690
|
}
|
|
5029
5691
|
)
|
|
5030
5692
|
] }),
|
|
5031
|
-
facets.map((facet) => /* @__PURE__ */ (0,
|
|
5693
|
+
facets.map((facet) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5032
5694
|
FilterFacetGroup,
|
|
5033
5695
|
{
|
|
5034
5696
|
facet,
|
|
@@ -5045,12 +5707,12 @@ var FilterPanel = (0, import_react68.forwardRef)(function FilterPanel2({
|
|
|
5045
5707
|
FilterPanel.displayName = "FilterPanel";
|
|
5046
5708
|
function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
5047
5709
|
const collapsible = facet.collapsible ?? true;
|
|
5048
|
-
const [open, setOpen] = (0,
|
|
5710
|
+
const [open, setOpen] = (0, import_react69.useState)(facet.defaultOpen ?? true);
|
|
5049
5711
|
const isOpen = !collapsible || open;
|
|
5050
5712
|
const selectedCount = selected.length;
|
|
5051
5713
|
const headingClass = "text-text-muted flex items-center gap-[6px] font-mono text-[10px] tracking-[1.4px] uppercase";
|
|
5052
|
-
return /* @__PURE__ */ (0,
|
|
5053
|
-
collapsible ? /* @__PURE__ */ (0,
|
|
5714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("section", { className: "flex flex-col gap-1", children: [
|
|
5715
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
5054
5716
|
"button",
|
|
5055
5717
|
{
|
|
5056
5718
|
type: "button",
|
|
@@ -5063,20 +5725,20 @@ function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
|
5063
5725
|
"hover:text-text"
|
|
5064
5726
|
),
|
|
5065
5727
|
children: [
|
|
5066
|
-
/* @__PURE__ */ (0,
|
|
5067
|
-
selectedCount > 0 && /* @__PURE__ */ (0,
|
|
5068
|
-
/* @__PURE__ */ (0,
|
|
5728
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "flex-1 text-left", children: facet.label }),
|
|
5729
|
+
selectedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Badge, { size: "sm", variant: "neutral", children: selectedCount }),
|
|
5730
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
5069
5731
|
]
|
|
5070
5732
|
}
|
|
5071
|
-
) : /* @__PURE__ */ (0,
|
|
5072
|
-
/* @__PURE__ */ (0,
|
|
5073
|
-
selectedCount > 0 && /* @__PURE__ */ (0,
|
|
5733
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: cn(headingClass, "px-1 py-[2px]"), children: [
|
|
5734
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "flex-1", children: facet.label }),
|
|
5735
|
+
selectedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Badge, { size: "sm", variant: "neutral", children: selectedCount })
|
|
5074
5736
|
] }),
|
|
5075
|
-
isOpen && /* @__PURE__ */ (0,
|
|
5737
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("ul", { className: "m-0 flex list-none flex-col gap-[2px] p-0", children: facet.options.map((option) => {
|
|
5076
5738
|
const isSelected = selected.includes(option.value);
|
|
5077
5739
|
const count = counts?.[option.value];
|
|
5078
|
-
return /* @__PURE__ */ (0,
|
|
5079
|
-
/* @__PURE__ */ (0,
|
|
5740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("li", { className: "flex items-center gap-2 px-1 py-[3px]", children: [
|
|
5741
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5080
5742
|
Checkbox,
|
|
5081
5743
|
{
|
|
5082
5744
|
checked: isSelected,
|
|
@@ -5084,25 +5746,25 @@ function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
|
5084
5746
|
label: option.label
|
|
5085
5747
|
}
|
|
5086
5748
|
),
|
|
5087
|
-
typeof count === "number" && /* @__PURE__ */ (0,
|
|
5749
|
+
typeof count === "number" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-text-dim ml-auto font-mono text-[10px] tabular-nums", children: count })
|
|
5088
5750
|
] }, option.value);
|
|
5089
5751
|
}) })
|
|
5090
5752
|
] });
|
|
5091
5753
|
}
|
|
5092
5754
|
|
|
5093
5755
|
// src/patterns/HealthScore/HealthScore.tsx
|
|
5094
|
-
var
|
|
5756
|
+
var import_react71 = require("react");
|
|
5095
5757
|
|
|
5096
5758
|
// src/patterns/RadialProgress/RadialProgress.tsx
|
|
5097
|
-
var
|
|
5098
|
-
var
|
|
5759
|
+
var import_react70 = require("react");
|
|
5760
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5099
5761
|
var toneStrokeClass = {
|
|
5100
5762
|
accent: "stroke-accent",
|
|
5101
5763
|
ok: "stroke-ok",
|
|
5102
5764
|
warn: "stroke-warn",
|
|
5103
5765
|
err: "stroke-err"
|
|
5104
5766
|
};
|
|
5105
|
-
var RadialProgress = (0,
|
|
5767
|
+
var RadialProgress = (0, import_react70.forwardRef)(
|
|
5106
5768
|
function RadialProgress2({
|
|
5107
5769
|
value,
|
|
5108
5770
|
max = 100,
|
|
@@ -5120,7 +5782,7 @@ var RadialProgress = (0, import_react69.forwardRef)(
|
|
|
5120
5782
|
const c = 2 * Math.PI * r;
|
|
5121
5783
|
const dash = pct / 100 * c;
|
|
5122
5784
|
const resolvedTone = tone ?? (clamped >= max ? "ok" : "accent");
|
|
5123
|
-
return /* @__PURE__ */ (0,
|
|
5785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
5124
5786
|
"div",
|
|
5125
5787
|
{
|
|
5126
5788
|
ref,
|
|
@@ -5133,8 +5795,8 @@ var RadialProgress = (0, import_react69.forwardRef)(
|
|
|
5133
5795
|
style: { width: size, height: size },
|
|
5134
5796
|
...props,
|
|
5135
5797
|
children: [
|
|
5136
|
-
/* @__PURE__ */ (0,
|
|
5137
|
-
/* @__PURE__ */ (0,
|
|
5798
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [
|
|
5799
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5138
5800
|
"circle",
|
|
5139
5801
|
{
|
|
5140
5802
|
cx: size / 2,
|
|
@@ -5145,7 +5807,7 @@ var RadialProgress = (0, import_react69.forwardRef)(
|
|
|
5145
5807
|
className: "stroke-panel-2"
|
|
5146
5808
|
}
|
|
5147
5809
|
),
|
|
5148
|
-
/* @__PURE__ */ (0,
|
|
5810
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5149
5811
|
"circle",
|
|
5150
5812
|
{
|
|
5151
5813
|
cx: size / 2,
|
|
@@ -5163,7 +5825,7 @@ var RadialProgress = (0, import_react69.forwardRef)(
|
|
|
5163
5825
|
}
|
|
5164
5826
|
)
|
|
5165
5827
|
] }),
|
|
5166
|
-
/* @__PURE__ */ (0,
|
|
5828
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "absolute inset-0 grid place-items-center font-mono text-[11px] font-medium tabular-nums", children: children ?? `${Math.round(pct)}%` })
|
|
5167
5829
|
]
|
|
5168
5830
|
}
|
|
5169
5831
|
);
|
|
@@ -5172,7 +5834,7 @@ var RadialProgress = (0, import_react69.forwardRef)(
|
|
|
5172
5834
|
RadialProgress.displayName = "RadialProgress";
|
|
5173
5835
|
|
|
5174
5836
|
// src/patterns/HealthScore/HealthScore.tsx
|
|
5175
|
-
var
|
|
5837
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5176
5838
|
function deltaTone(delta) {
|
|
5177
5839
|
if (delta > 0) return "ok";
|
|
5178
5840
|
if (delta < 0) return "err";
|
|
@@ -5189,7 +5851,7 @@ var toneTextClass = {
|
|
|
5189
5851
|
warn: "text-warn",
|
|
5190
5852
|
err: "text-err"
|
|
5191
5853
|
};
|
|
5192
|
-
var HealthScore = (0,
|
|
5854
|
+
var HealthScore = (0, import_react71.forwardRef)(function HealthScore2({
|
|
5193
5855
|
value,
|
|
5194
5856
|
max = 100,
|
|
5195
5857
|
delta,
|
|
@@ -5204,7 +5866,7 @@ var HealthScore = (0, import_react70.forwardRef)(function HealthScore2({
|
|
|
5204
5866
|
const pct = max > 0 ? Math.round(Math.min(max, Math.max(0, value)) / max * 100) : 0;
|
|
5205
5867
|
const resolvedTone = tone ?? (pct >= 80 ? "ok" : pct >= 50 ? "accent" : "warn");
|
|
5206
5868
|
const indicatorTone = typeof delta === "number" ? deltaTone(delta) : "accent";
|
|
5207
|
-
const core = /* @__PURE__ */ (0,
|
|
5869
|
+
const core = /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
5208
5870
|
"div",
|
|
5209
5871
|
{
|
|
5210
5872
|
ref,
|
|
@@ -5212,10 +5874,10 @@ var HealthScore = (0, import_react70.forwardRef)(function HealthScore2({
|
|
|
5212
5874
|
"aria-label": ariaLabel ?? `${pct}% health`,
|
|
5213
5875
|
...props,
|
|
5214
5876
|
children: [
|
|
5215
|
-
/* @__PURE__ */ (0,
|
|
5216
|
-
label && /* @__PURE__ */ (0,
|
|
5217
|
-
typeof delta === "number" && /* @__PURE__ */ (0,
|
|
5218
|
-
/* @__PURE__ */ (0,
|
|
5877
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RadialProgress, { value, max, size, tone: resolvedTone }),
|
|
5878
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "text-text-muted mt-1 text-[12px] leading-tight", children: label }),
|
|
5879
|
+
typeof delta === "number" && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: cn("font-mono text-[11px] tabular-nums", toneTextClass[indicatorTone]), children: [
|
|
5880
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { "aria-hidden": true, children: deltaGlyph(delta) }),
|
|
5219
5881
|
" ",
|
|
5220
5882
|
Math.abs(delta)
|
|
5221
5883
|
] })
|
|
@@ -5225,15 +5887,15 @@ var HealthScore = (0, import_react70.forwardRef)(function HealthScore2({
|
|
|
5225
5887
|
if (!breakdown || breakdown.length === 0) {
|
|
5226
5888
|
return core;
|
|
5227
5889
|
}
|
|
5228
|
-
return /* @__PURE__ */ (0,
|
|
5890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5229
5891
|
HoverCard,
|
|
5230
5892
|
{
|
|
5231
|
-
trigger: /* @__PURE__ */ (0,
|
|
5232
|
-
content: /* @__PURE__ */ (0,
|
|
5233
|
-
/* @__PURE__ */ (0,
|
|
5234
|
-
/* @__PURE__ */ (0,
|
|
5235
|
-
/* @__PURE__ */ (0,
|
|
5236
|
-
/* @__PURE__ */ (0,
|
|
5893
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "inline-flex", children: core }),
|
|
5894
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex min-w-[180px] flex-col gap-2", children: [
|
|
5895
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "text-text-dim font-mono text-[9px] tracking-[1.4px] uppercase", children: "Breakdown" }),
|
|
5896
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("ul", { className: "m-0 flex list-none flex-col gap-1 p-0 text-[12px]", children: breakdown.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("li", { className: "flex items-center gap-2", children: [
|
|
5897
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "text-text-muted flex-1 truncate", children: entry.label }),
|
|
5898
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5237
5899
|
"span",
|
|
5238
5900
|
{
|
|
5239
5901
|
className: cn(
|
|
@@ -5251,21 +5913,21 @@ var HealthScore = (0, import_react70.forwardRef)(function HealthScore2({
|
|
|
5251
5913
|
HealthScore.displayName = "HealthScore";
|
|
5252
5914
|
|
|
5253
5915
|
// src/patterns/LargeTitle/LargeTitle.tsx
|
|
5254
|
-
var
|
|
5255
|
-
var
|
|
5256
|
-
var LargeTitle = (0,
|
|
5257
|
-
return /* @__PURE__ */ (0,
|
|
5916
|
+
var import_react72 = require("react");
|
|
5917
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5918
|
+
var LargeTitle = (0, import_react72.forwardRef)(function LargeTitle2({ title, eyebrow, trailing, className, ...props }, ref) {
|
|
5919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5258
5920
|
"header",
|
|
5259
5921
|
{
|
|
5260
5922
|
ref,
|
|
5261
5923
|
className: cn("px-screen flex items-end justify-between gap-3 py-3 pb-4", className),
|
|
5262
5924
|
...props,
|
|
5263
5925
|
children: [
|
|
5264
|
-
/* @__PURE__ */ (0,
|
|
5265
|
-
eyebrow && /* @__PURE__ */ (0,
|
|
5266
|
-
/* @__PURE__ */ (0,
|
|
5926
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
5927
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "text-m-eyebrow text-accent mb-[6px] font-mono tracking-wide uppercase", children: eyebrow }),
|
|
5928
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h1", { className: "text-m-h1 m-0 truncate leading-tight font-medium tracking-tight", children: title })
|
|
5267
5929
|
] }),
|
|
5268
|
-
trailing && /* @__PURE__ */ (0,
|
|
5930
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "shrink-0", children: trailing })
|
|
5269
5931
|
]
|
|
5270
5932
|
}
|
|
5271
5933
|
);
|
|
@@ -5274,10 +5936,10 @@ LargeTitle.displayName = "LargeTitle";
|
|
|
5274
5936
|
|
|
5275
5937
|
// src/patterns/Menubar/Menubar.tsx
|
|
5276
5938
|
var RadixMenubar = __toESM(require("@radix-ui/react-menubar"), 1);
|
|
5277
|
-
var
|
|
5278
|
-
var
|
|
5279
|
-
var Menubar = (0,
|
|
5280
|
-
return /* @__PURE__ */ (0,
|
|
5939
|
+
var import_react73 = require("react");
|
|
5940
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5941
|
+
var Menubar = (0, import_react73.forwardRef)(function Menubar2({ className, ...props }, ref) {
|
|
5942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5281
5943
|
RadixMenubar.Root,
|
|
5282
5944
|
{
|
|
5283
5945
|
ref,
|
|
@@ -5291,9 +5953,9 @@ var Menubar = (0, import_react72.forwardRef)(function Menubar2({ className, ...p
|
|
|
5291
5953
|
});
|
|
5292
5954
|
Menubar.displayName = "Menubar";
|
|
5293
5955
|
var MenubarMenu = RadixMenubar.Menu;
|
|
5294
|
-
var MenubarTrigger = (0,
|
|
5956
|
+
var MenubarTrigger = (0, import_react73.forwardRef)(
|
|
5295
5957
|
function MenubarTrigger2({ className, ...props }, ref) {
|
|
5296
|
-
return /* @__PURE__ */ (0,
|
|
5958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5297
5959
|
RadixMenubar.Trigger,
|
|
5298
5960
|
{
|
|
5299
5961
|
ref,
|
|
@@ -5310,9 +5972,9 @@ var MenubarTrigger = (0, import_react72.forwardRef)(
|
|
|
5310
5972
|
}
|
|
5311
5973
|
);
|
|
5312
5974
|
MenubarTrigger.displayName = "MenubarTrigger";
|
|
5313
|
-
var MenubarContent = (0,
|
|
5975
|
+
var MenubarContent = (0, import_react73.forwardRef)(
|
|
5314
5976
|
function MenubarContent2({ className, sideOffset = 6, align = "start", ...props }, ref) {
|
|
5315
|
-
return /* @__PURE__ */ (0,
|
|
5977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(RadixMenubar.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5316
5978
|
RadixMenubar.Content,
|
|
5317
5979
|
{
|
|
5318
5980
|
ref,
|
|
@@ -5334,24 +5996,24 @@ var itemBase3 = cn(
|
|
|
5334
5996
|
"data-[highlighted]:bg-panel-2",
|
|
5335
5997
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
5336
5998
|
);
|
|
5337
|
-
var MenubarItem = (0,
|
|
5338
|
-
return /* @__PURE__ */ (0,
|
|
5999
|
+
var MenubarItem = (0, import_react73.forwardRef)(function MenubarItem2({ trailing, destructive, className, children, ...props }, ref) {
|
|
6000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
5339
6001
|
RadixMenubar.Item,
|
|
5340
6002
|
{
|
|
5341
6003
|
ref,
|
|
5342
6004
|
className: cn(itemBase3, destructive ? "text-err" : "text-text", className),
|
|
5343
6005
|
...props,
|
|
5344
6006
|
children: [
|
|
5345
|
-
/* @__PURE__ */ (0,
|
|
5346
|
-
trailing && /* @__PURE__ */ (0,
|
|
6007
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "flex-1", children }),
|
|
6008
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
5347
6009
|
]
|
|
5348
6010
|
}
|
|
5349
6011
|
);
|
|
5350
6012
|
});
|
|
5351
6013
|
MenubarItem.displayName = "MenubarItem";
|
|
5352
|
-
var MenubarSeparator = (0,
|
|
6014
|
+
var MenubarSeparator = (0, import_react73.forwardRef)(
|
|
5353
6015
|
function MenubarSeparator2({ className, ...props }, ref) {
|
|
5354
|
-
return /* @__PURE__ */ (0,
|
|
6016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5355
6017
|
RadixMenubar.Separator,
|
|
5356
6018
|
{
|
|
5357
6019
|
ref,
|
|
@@ -5365,13 +6027,13 @@ MenubarSeparator.displayName = "MenubarSeparator";
|
|
|
5365
6027
|
|
|
5366
6028
|
// src/patterns/NavBar/NavBar.tsx
|
|
5367
6029
|
var RadixNav = __toESM(require("@radix-ui/react-navigation-menu"), 1);
|
|
5368
|
-
var
|
|
6030
|
+
var import_react75 = require("react");
|
|
5369
6031
|
|
|
5370
6032
|
// src/patterns/Sidebar/Sidebar.tsx
|
|
5371
|
-
var
|
|
5372
|
-
var
|
|
5373
|
-
var Sidebar = (0,
|
|
5374
|
-
return /* @__PURE__ */ (0,
|
|
6033
|
+
var import_react74 = require("react");
|
|
6034
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
6035
|
+
var Sidebar = (0, import_react74.forwardRef)(function Sidebar2({ width = 240, className, style, ...props }, ref) {
|
|
6036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5375
6037
|
"aside",
|
|
5376
6038
|
{
|
|
5377
6039
|
ref,
|
|
@@ -5385,12 +6047,12 @@ var Sidebar = (0, import_react73.forwardRef)(function Sidebar2({ width = 240, cl
|
|
|
5385
6047
|
);
|
|
5386
6048
|
});
|
|
5387
6049
|
Sidebar.displayName = "Sidebar";
|
|
5388
|
-
var NavItem = (0,
|
|
6050
|
+
var NavItem = (0, import_react74.forwardRef)(
|
|
5389
6051
|
function NavItem2({ icon, label, active, badge, href, disabled, className, ...props }, ref) {
|
|
5390
|
-
const inner = /* @__PURE__ */ (0,
|
|
5391
|
-
icon && /* @__PURE__ */ (0,
|
|
5392
|
-
/* @__PURE__ */ (0,
|
|
5393
|
-
badge != null && /* @__PURE__ */ (0,
|
|
6052
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
6053
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: icon }),
|
|
6054
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "flex-1 truncate", children: label }),
|
|
6055
|
+
badge != null && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5394
6056
|
"span",
|
|
5395
6057
|
{
|
|
5396
6058
|
className: cn(
|
|
@@ -5411,7 +6073,7 @@ var NavItem = (0, import_react73.forwardRef)(
|
|
|
5411
6073
|
);
|
|
5412
6074
|
if (href) {
|
|
5413
6075
|
const anchorProps = props;
|
|
5414
|
-
return /* @__PURE__ */ (0,
|
|
6076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5415
6077
|
"a",
|
|
5416
6078
|
{
|
|
5417
6079
|
ref,
|
|
@@ -5425,7 +6087,7 @@ var NavItem = (0, import_react73.forwardRef)(
|
|
|
5425
6087
|
);
|
|
5426
6088
|
}
|
|
5427
6089
|
const buttonProps = props;
|
|
5428
|
-
return /* @__PURE__ */ (0,
|
|
6090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5429
6091
|
"button",
|
|
5430
6092
|
{
|
|
5431
6093
|
ref,
|
|
@@ -5440,7 +6102,7 @@ var NavItem = (0, import_react73.forwardRef)(
|
|
|
5440
6102
|
}
|
|
5441
6103
|
);
|
|
5442
6104
|
NavItem.displayName = "NavItem";
|
|
5443
|
-
var NavSection = (0,
|
|
6105
|
+
var NavSection = (0, import_react74.forwardRef)(function NavSection2({
|
|
5444
6106
|
label,
|
|
5445
6107
|
icon,
|
|
5446
6108
|
action,
|
|
@@ -5454,16 +6116,16 @@ var NavSection = (0, import_react73.forwardRef)(function NavSection2({
|
|
|
5454
6116
|
...props
|
|
5455
6117
|
}, ref) {
|
|
5456
6118
|
const isControlled = open !== void 0;
|
|
5457
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
6119
|
+
const [internalOpen, setInternalOpen] = (0, import_react74.useState)(defaultOpen);
|
|
5458
6120
|
const isOpen = !collapsible || (isControlled ? open : internalOpen);
|
|
5459
|
-
const toggle = (0,
|
|
6121
|
+
const toggle = (0, import_react74.useCallback)(() => {
|
|
5460
6122
|
const next = !isOpen;
|
|
5461
6123
|
if (!isControlled) setInternalOpen(next);
|
|
5462
6124
|
onOpenChange?.(next);
|
|
5463
6125
|
}, [isOpen, isControlled, onOpenChange]);
|
|
5464
6126
|
const eyebrowClass = "text-text-dim flex items-center gap-[6px] px-2 pt-2 font-mono text-[9px] tracking-[1.4px] uppercase";
|
|
5465
|
-
return /* @__PURE__ */ (0,
|
|
5466
|
-
collapsible ? /* @__PURE__ */ (0,
|
|
6127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
|
|
6128
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
5467
6129
|
"button",
|
|
5468
6130
|
{
|
|
5469
6131
|
type: "button",
|
|
@@ -5476,18 +6138,18 @@ var NavSection = (0, import_react73.forwardRef)(function NavSection2({
|
|
|
5476
6138
|
"hover:text-text-muted"
|
|
5477
6139
|
),
|
|
5478
6140
|
children: [
|
|
5479
|
-
icon != null && /* @__PURE__ */ (0,
|
|
5480
|
-
/* @__PURE__ */ (0,
|
|
6141
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
6142
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "flex-1 text-left", children: label }),
|
|
5481
6143
|
action,
|
|
5482
|
-
/* @__PURE__ */ (0,
|
|
6144
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
5483
6145
|
]
|
|
5484
6146
|
}
|
|
5485
|
-
) : /* @__PURE__ */ (0,
|
|
5486
|
-
icon != null && /* @__PURE__ */ (0,
|
|
5487
|
-
/* @__PURE__ */ (0,
|
|
6147
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: eyebrowClass, children: [
|
|
6148
|
+
icon != null && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
6149
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "flex-1", children: label }),
|
|
5488
6150
|
action
|
|
5489
6151
|
] }),
|
|
5490
|
-
isOpen && /* @__PURE__ */ (0,
|
|
6152
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
5491
6153
|
"div",
|
|
5492
6154
|
{
|
|
5493
6155
|
className: cn("flex flex-col gap-[2px]", indent > 0 && "border-border ml-2 border-l"),
|
|
@@ -5500,12 +6162,12 @@ var NavSection = (0, import_react73.forwardRef)(function NavSection2({
|
|
|
5500
6162
|
NavSection.displayName = "NavSection";
|
|
5501
6163
|
|
|
5502
6164
|
// src/patterns/NavBar/NavBar.tsx
|
|
5503
|
-
var
|
|
6165
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5504
6166
|
function isActiveTree(item, activeId) {
|
|
5505
6167
|
if (item.id === activeId) return true;
|
|
5506
6168
|
return item.children?.some((c) => isActiveTree(c, activeId)) ?? false;
|
|
5507
6169
|
}
|
|
5508
|
-
var NavBar = (0,
|
|
6170
|
+
var NavBar = (0, import_react75.forwardRef)(function NavBar2({
|
|
5509
6171
|
orientation = "horizontal",
|
|
5510
6172
|
items,
|
|
5511
6173
|
brand,
|
|
@@ -5519,17 +6181,17 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5519
6181
|
...props
|
|
5520
6182
|
}, ref) {
|
|
5521
6183
|
const isControlled = value !== void 0;
|
|
5522
|
-
const [internalValue, setInternalValue] = (0,
|
|
6184
|
+
const [internalValue, setInternalValue] = (0, import_react75.useState)(defaultValue);
|
|
5523
6185
|
const activeId = isControlled ? value : internalValue;
|
|
5524
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
5525
|
-
const select = (0,
|
|
6186
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react75.useState)(false);
|
|
6187
|
+
const select = (0, import_react75.useCallback)(
|
|
5526
6188
|
(id) => {
|
|
5527
6189
|
if (!isControlled) setInternalValue(id);
|
|
5528
6190
|
onValueChange?.(id);
|
|
5529
6191
|
},
|
|
5530
6192
|
[isControlled, onValueChange]
|
|
5531
6193
|
);
|
|
5532
|
-
const handleItemActivate = (0,
|
|
6194
|
+
const handleItemActivate = (0, import_react75.useCallback)(
|
|
5533
6195
|
(id) => {
|
|
5534
6196
|
select(id);
|
|
5535
6197
|
setDrawerOpen(false);
|
|
@@ -5541,7 +6203,7 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5541
6203
|
// drawer is open on a viewport that's resizing past `md`, both navs can
|
|
5542
6204
|
// sit in the DOM together. Identical accessible names would trip axe's
|
|
5543
6205
|
// `landmark-unique` rule.
|
|
5544
|
-
/* @__PURE__ */ (0,
|
|
6206
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("nav", { "aria-label": "Mobile navigation", className: "flex flex-col gap-1", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5545
6207
|
VerticalItem,
|
|
5546
6208
|
{
|
|
5547
6209
|
item,
|
|
@@ -5551,14 +6213,14 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5551
6213
|
item.id
|
|
5552
6214
|
)) })
|
|
5553
6215
|
);
|
|
5554
|
-
const mobileBar = responsive ? /* @__PURE__ */ (0,
|
|
6216
|
+
const mobileBar = responsive ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5555
6217
|
"div",
|
|
5556
6218
|
{
|
|
5557
6219
|
className: cn(
|
|
5558
6220
|
"border-border bg-panel z-overlay sticky top-0 flex h-[52px] items-center gap-4 border-b px-5 md:hidden"
|
|
5559
6221
|
),
|
|
5560
6222
|
children: [
|
|
5561
|
-
/* @__PURE__ */ (0,
|
|
6223
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5562
6224
|
"button",
|
|
5563
6225
|
{
|
|
5564
6226
|
type: "button",
|
|
@@ -5568,15 +6230,15 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5568
6230
|
children: "\u2630"
|
|
5569
6231
|
}
|
|
5570
6232
|
),
|
|
5571
|
-
brand && /* @__PURE__ */ (0,
|
|
5572
|
-
actions && /* @__PURE__ */ (0,
|
|
6233
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex flex-1 items-center text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
6234
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex items-center gap-3", children: actions })
|
|
5573
6235
|
]
|
|
5574
6236
|
}
|
|
5575
6237
|
) : null;
|
|
5576
6238
|
if (orientation === "horizontal") {
|
|
5577
|
-
return /* @__PURE__ */ (0,
|
|
6239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
5578
6240
|
mobileBar,
|
|
5579
|
-
/* @__PURE__ */ (0,
|
|
6241
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5580
6242
|
"header",
|
|
5581
6243
|
{
|
|
5582
6244
|
ref,
|
|
@@ -5587,10 +6249,10 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5587
6249
|
),
|
|
5588
6250
|
...props,
|
|
5589
6251
|
children: [
|
|
5590
|
-
brand && /* @__PURE__ */ (0,
|
|
5591
|
-
/* @__PURE__ */ (0,
|
|
5592
|
-
/* @__PURE__ */ (0,
|
|
5593
|
-
(item) => item.children?.length ? /* @__PURE__ */ (0,
|
|
6252
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "shrink-0 text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
6253
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(RadixNav.Root, { className: "relative flex-1", delayDuration: 120, children: [
|
|
6254
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(RadixNav.List, { className: "m-0! flex list-none! items-center gap-1 p-0! [&_li]:m-0!", children: items.map(
|
|
6255
|
+
(item) => item.children?.length ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5594
6256
|
HorizontalDropdown,
|
|
5595
6257
|
{
|
|
5596
6258
|
item,
|
|
@@ -5599,7 +6261,7 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5599
6261
|
onActivate: handleItemActivate
|
|
5600
6262
|
},
|
|
5601
6263
|
item.id
|
|
5602
|
-
) : /* @__PURE__ */ (0,
|
|
6264
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(RadixNav.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5603
6265
|
HorizontalLink,
|
|
5604
6266
|
{
|
|
5605
6267
|
item,
|
|
@@ -5608,13 +6270,13 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5608
6270
|
}
|
|
5609
6271
|
) }, item.id)
|
|
5610
6272
|
) }),
|
|
5611
|
-
/* @__PURE__ */ (0,
|
|
6273
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "z-popover absolute top-full left-0 flex justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(RadixNav.Viewport, { className: "origin-top-left data-[state=open]:animate-[ship-fade-in_120ms_var(--easing-out)]" }) })
|
|
5612
6274
|
] }),
|
|
5613
|
-
actions && /* @__PURE__ */ (0,
|
|
6275
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "flex items-center gap-3", children: actions })
|
|
5614
6276
|
]
|
|
5615
6277
|
}
|
|
5616
6278
|
),
|
|
5617
|
-
responsive && /* @__PURE__ */ (0,
|
|
6279
|
+
responsive && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5618
6280
|
Drawer,
|
|
5619
6281
|
{
|
|
5620
6282
|
open: drawerOpen,
|
|
@@ -5627,9 +6289,9 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5627
6289
|
)
|
|
5628
6290
|
] });
|
|
5629
6291
|
}
|
|
5630
|
-
return /* @__PURE__ */ (0,
|
|
6292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
5631
6293
|
mobileBar,
|
|
5632
|
-
/* @__PURE__ */ (0,
|
|
6294
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5633
6295
|
"aside",
|
|
5634
6296
|
{
|
|
5635
6297
|
ref,
|
|
@@ -5642,8 +6304,8 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5642
6304
|
),
|
|
5643
6305
|
...props,
|
|
5644
6306
|
children: [
|
|
5645
|
-
brand && /* @__PURE__ */ (0,
|
|
5646
|
-
/* @__PURE__ */ (0,
|
|
6307
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "px-2 py-1 text-[13px] font-medium", children: brand }),
|
|
6308
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("nav", { "aria-label": "Sidebar navigation", className: "flex flex-1 flex-col gap-1 overflow-y-auto", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5647
6309
|
VerticalItem,
|
|
5648
6310
|
{
|
|
5649
6311
|
item,
|
|
@@ -5652,11 +6314,11 @@ var NavBar = (0, import_react74.forwardRef)(function NavBar2({
|
|
|
5652
6314
|
},
|
|
5653
6315
|
item.id
|
|
5654
6316
|
)) }),
|
|
5655
|
-
actions && /* @__PURE__ */ (0,
|
|
6317
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "border-border mt-auto flex flex-col gap-2 border-t pt-3", children: actions })
|
|
5656
6318
|
]
|
|
5657
6319
|
}
|
|
5658
6320
|
),
|
|
5659
|
-
responsive && /* @__PURE__ */ (0,
|
|
6321
|
+
responsive && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5660
6322
|
Drawer,
|
|
5661
6323
|
{
|
|
5662
6324
|
open: drawerOpen,
|
|
@@ -5685,13 +6347,13 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
5685
6347
|
}
|
|
5686
6348
|
onActivate(item.id);
|
|
5687
6349
|
};
|
|
5688
|
-
const inner = /* @__PURE__ */ (0,
|
|
5689
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
5690
|
-
/* @__PURE__ */ (0,
|
|
5691
|
-
item.badge != null && /* @__PURE__ */ (0,
|
|
6350
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
6351
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
6352
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: item.label }),
|
|
6353
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ItemBadge, { active, children: item.badge })
|
|
5692
6354
|
] });
|
|
5693
6355
|
if (item.href) {
|
|
5694
|
-
return /* @__PURE__ */ (0,
|
|
6356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5695
6357
|
"a",
|
|
5696
6358
|
{
|
|
5697
6359
|
href: item.href,
|
|
@@ -5703,7 +6365,7 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
5703
6365
|
}
|
|
5704
6366
|
) });
|
|
5705
6367
|
}
|
|
5706
|
-
return /* @__PURE__ */ (0,
|
|
6368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5707
6369
|
"button",
|
|
5708
6370
|
{
|
|
5709
6371
|
type: "button",
|
|
@@ -5716,8 +6378,8 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
5716
6378
|
) });
|
|
5717
6379
|
}
|
|
5718
6380
|
function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
5719
|
-
return /* @__PURE__ */ (0,
|
|
5720
|
-
/* @__PURE__ */ (0,
|
|
6381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(RadixNav.Item, { children: [
|
|
6382
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5721
6383
|
RadixNav.Trigger,
|
|
5722
6384
|
{
|
|
5723
6385
|
className: cn(
|
|
@@ -5729,9 +6391,9 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
5729
6391
|
),
|
|
5730
6392
|
disabled: item.disabled,
|
|
5731
6393
|
children: [
|
|
5732
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
5733
|
-
/* @__PURE__ */ (0,
|
|
5734
|
-
/* @__PURE__ */ (0,
|
|
6394
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
6395
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: item.label }),
|
|
6396
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5735
6397
|
"span",
|
|
5736
6398
|
{
|
|
5737
6399
|
"aria-hidden": true,
|
|
@@ -5742,7 +6404,7 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
5742
6404
|
]
|
|
5743
6405
|
}
|
|
5744
6406
|
),
|
|
5745
|
-
/* @__PURE__ */ (0,
|
|
6407
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(RadixNav.Content, { className: "border-border bg-panel min-w-[220px] rounded-xs border p-2 shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("ul", { className: "m-0! flex list-none! flex-col gap-[2px] p-0! [&_li]:m-0!", children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(DropdownLink, { item: child, active: child.id === activeId, onActivate }) }, child.id)) }) })
|
|
5746
6408
|
] });
|
|
5747
6409
|
}
|
|
5748
6410
|
function DropdownLink({ item, active, onActivate }) {
|
|
@@ -5759,13 +6421,13 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
5759
6421
|
}
|
|
5760
6422
|
onActivate(item.id);
|
|
5761
6423
|
};
|
|
5762
|
-
const inner = /* @__PURE__ */ (0,
|
|
5763
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
5764
|
-
/* @__PURE__ */ (0,
|
|
5765
|
-
item.badge != null && /* @__PURE__ */ (0,
|
|
6424
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
6425
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
6426
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "flex-1", children: item.label }),
|
|
6427
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ItemBadge, { active, children: item.badge })
|
|
5766
6428
|
] });
|
|
5767
6429
|
if (item.href) {
|
|
5768
|
-
return /* @__PURE__ */ (0,
|
|
6430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5769
6431
|
"a",
|
|
5770
6432
|
{
|
|
5771
6433
|
href: item.href,
|
|
@@ -5777,7 +6439,7 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
5777
6439
|
}
|
|
5778
6440
|
) });
|
|
5779
6441
|
}
|
|
5780
|
-
return /* @__PURE__ */ (0,
|
|
6442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5781
6443
|
"button",
|
|
5782
6444
|
{
|
|
5783
6445
|
type: "button",
|
|
@@ -5792,9 +6454,9 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
5792
6454
|
function VerticalItem({ item, activeId, onActivate }) {
|
|
5793
6455
|
const hasChildren = (item.children?.length ?? 0) > 0;
|
|
5794
6456
|
const treeActive = isActiveTree(item, activeId);
|
|
5795
|
-
const [open, setOpen] = (0,
|
|
5796
|
-
const prevTreeActive = (0,
|
|
5797
|
-
(0,
|
|
6457
|
+
const [open, setOpen] = (0, import_react75.useState)(treeActive);
|
|
6458
|
+
const prevTreeActive = (0, import_react75.useRef)(treeActive);
|
|
6459
|
+
(0, import_react75.useEffect)(() => {
|
|
5798
6460
|
if (treeActive && !prevTreeActive.current) setOpen(true);
|
|
5799
6461
|
prevTreeActive.current = treeActive;
|
|
5800
6462
|
}, [treeActive]);
|
|
@@ -5806,7 +6468,7 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
5806
6468
|
}
|
|
5807
6469
|
onActivate(item.id);
|
|
5808
6470
|
};
|
|
5809
|
-
return /* @__PURE__ */ (0,
|
|
6471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5810
6472
|
NavItem,
|
|
5811
6473
|
{
|
|
5812
6474
|
icon: item.icon,
|
|
@@ -5819,8 +6481,8 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
5819
6481
|
}
|
|
5820
6482
|
);
|
|
5821
6483
|
}
|
|
5822
|
-
return /* @__PURE__ */ (0,
|
|
5823
|
-
/* @__PURE__ */ (0,
|
|
6484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex flex-col", children: [
|
|
6485
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
5824
6486
|
"button",
|
|
5825
6487
|
{
|
|
5826
6488
|
type: "button",
|
|
@@ -5836,18 +6498,18 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
5836
6498
|
item.disabled && "pointer-events-none opacity-50"
|
|
5837
6499
|
),
|
|
5838
6500
|
children: [
|
|
5839
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
5840
|
-
/* @__PURE__ */ (0,
|
|
5841
|
-
item.badge != null && /* @__PURE__ */ (0,
|
|
5842
|
-
/* @__PURE__ */ (0,
|
|
6501
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: item.icon }),
|
|
6502
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "flex-1 truncate", children: item.label }),
|
|
6503
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ItemBadge, { active: treeActive, children: item.badge }),
|
|
6504
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { "aria-hidden": true, className: "text-[10px] opacity-60", children: open ? "\u25BE" : "\u25B8" })
|
|
5843
6505
|
]
|
|
5844
6506
|
}
|
|
5845
6507
|
),
|
|
5846
|
-
open && /* @__PURE__ */ (0,
|
|
6508
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "border-border mt-1 ml-[18px] flex flex-col gap-[2px] border-l pl-3", children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(VerticalItem, { item: child, activeId, onActivate }, child.id)) })
|
|
5847
6509
|
] });
|
|
5848
6510
|
}
|
|
5849
6511
|
function ItemBadge({ active, children }) {
|
|
5850
|
-
return /* @__PURE__ */ (0,
|
|
6512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5851
6513
|
"span",
|
|
5852
6514
|
{
|
|
5853
6515
|
className: cn(
|
|
@@ -5860,8 +6522,8 @@ function ItemBadge({ active, children }) {
|
|
|
5860
6522
|
}
|
|
5861
6523
|
|
|
5862
6524
|
// src/patterns/OnboardingChecklist/OnboardingChecklist.tsx
|
|
5863
|
-
var
|
|
5864
|
-
var
|
|
6525
|
+
var import_react76 = require("react");
|
|
6526
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5865
6527
|
var statusDot = {
|
|
5866
6528
|
pending: "off",
|
|
5867
6529
|
"in-progress": "sync",
|
|
@@ -5872,11 +6534,11 @@ var labelStateClass = {
|
|
|
5872
6534
|
"in-progress": "text-text",
|
|
5873
6535
|
done: "text-text-dim line-through"
|
|
5874
6536
|
};
|
|
5875
|
-
var OnboardingChecklist = (0,
|
|
6537
|
+
var OnboardingChecklist = (0, import_react76.forwardRef)(
|
|
5876
6538
|
function OnboardingChecklist2({ items, onItemClick, title = "Get started", progressLabel, hideProgress, className, ...props }, ref) {
|
|
5877
6539
|
const total = items.length;
|
|
5878
6540
|
const done = items.filter((i) => i.status === "done").length;
|
|
5879
|
-
return /* @__PURE__ */ (0,
|
|
6541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
5880
6542
|
"section",
|
|
5881
6543
|
{
|
|
5882
6544
|
ref,
|
|
@@ -5887,11 +6549,11 @@ var OnboardingChecklist = (0, import_react75.forwardRef)(
|
|
|
5887
6549
|
),
|
|
5888
6550
|
...props,
|
|
5889
6551
|
children: [
|
|
5890
|
-
/* @__PURE__ */ (0,
|
|
5891
|
-
/* @__PURE__ */ (0,
|
|
5892
|
-
/* @__PURE__ */ (0,
|
|
6552
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("header", { className: "flex items-center gap-2", children: [
|
|
6553
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-[14px] font-medium", children: title }),
|
|
6554
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-text-dim ml-auto font-mono text-[11px] tabular-nums", children: progressLabel ?? `${done} of ${total} complete` })
|
|
5893
6555
|
] }),
|
|
5894
|
-
!hideProgress && total > 0 && /* @__PURE__ */ (0,
|
|
6556
|
+
!hideProgress && total > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5895
6557
|
"div",
|
|
5896
6558
|
{
|
|
5897
6559
|
role: "progressbar",
|
|
@@ -5900,7 +6562,7 @@ var OnboardingChecklist = (0, import_react75.forwardRef)(
|
|
|
5900
6562
|
"aria-valuenow": done,
|
|
5901
6563
|
"aria-label": typeof title === "string" ? `${title} progress` : "Setup progress",
|
|
5902
6564
|
className: "bg-panel-2 h-[3px] w-full overflow-hidden rounded-full",
|
|
5903
|
-
children: /* @__PURE__ */ (0,
|
|
6565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5904
6566
|
"span",
|
|
5905
6567
|
{
|
|
5906
6568
|
"aria-hidden": true,
|
|
@@ -5913,10 +6575,10 @@ var OnboardingChecklist = (0, import_react75.forwardRef)(
|
|
|
5913
6575
|
)
|
|
5914
6576
|
}
|
|
5915
6577
|
),
|
|
5916
|
-
/* @__PURE__ */ (0,
|
|
6578
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("ul", { className: "m-0 flex list-none flex-col gap-1 p-0", children: items.map((item) => {
|
|
5917
6579
|
const interactive = typeof onItemClick === "function";
|
|
5918
|
-
const labelBlock = /* @__PURE__ */ (0,
|
|
5919
|
-
/* @__PURE__ */ (0,
|
|
6580
|
+
const labelBlock = /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
6581
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5920
6582
|
StatusDot,
|
|
5921
6583
|
{
|
|
5922
6584
|
state: statusDot[item.status],
|
|
@@ -5925,17 +6587,17 @@ var OnboardingChecklist = (0, import_react75.forwardRef)(
|
|
|
5925
6587
|
className: "mt-[3px]"
|
|
5926
6588
|
}
|
|
5927
6589
|
),
|
|
5928
|
-
/* @__PURE__ */ (0,
|
|
5929
|
-
/* @__PURE__ */ (0,
|
|
5930
|
-
item.description && /* @__PURE__ */ (0,
|
|
6590
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
|
|
6591
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: cn("text-[13px]", labelStateClass[item.status]), children: item.label }),
|
|
6592
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "text-text-muted text-[12px] leading-[1.45]", children: item.description })
|
|
5931
6593
|
] })
|
|
5932
6594
|
] });
|
|
5933
6595
|
const labelRegionClass = cn(
|
|
5934
6596
|
"flex flex-1 items-start gap-3 rounded-md px-2 py-2 text-left transition-colors duration-(--duration-micro)",
|
|
5935
6597
|
interactive && "cursor-pointer outline-none hover:bg-panel-2 focus-visible:ring-[3px] focus-visible:ring-accent-dim"
|
|
5936
6598
|
);
|
|
5937
|
-
return /* @__PURE__ */ (0,
|
|
5938
|
-
interactive ? /* @__PURE__ */ (0,
|
|
6599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("li", { className: "flex items-start gap-2", children: [
|
|
6600
|
+
interactive ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5939
6601
|
"button",
|
|
5940
6602
|
{
|
|
5941
6603
|
type: "button",
|
|
@@ -5944,8 +6606,8 @@ var OnboardingChecklist = (0, import_react75.forwardRef)(
|
|
|
5944
6606
|
className: labelRegionClass,
|
|
5945
6607
|
children: labelBlock
|
|
5946
6608
|
}
|
|
5947
|
-
) : /* @__PURE__ */ (0,
|
|
5948
|
-
item.action && /* @__PURE__ */ (0,
|
|
6609
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: labelRegionClass, children: labelBlock }),
|
|
6610
|
+
item.action && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "shrink-0 self-center", children: item.action })
|
|
5949
6611
|
] }, item.id);
|
|
5950
6612
|
}) })
|
|
5951
6613
|
]
|
|
@@ -5956,8 +6618,8 @@ var OnboardingChecklist = (0, import_react75.forwardRef)(
|
|
|
5956
6618
|
OnboardingChecklist.displayName = "OnboardingChecklist";
|
|
5957
6619
|
|
|
5958
6620
|
// src/patterns/Pagination/Pagination.tsx
|
|
5959
|
-
var
|
|
5960
|
-
var
|
|
6621
|
+
var import_react77 = require("react");
|
|
6622
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5961
6623
|
function buildRange(page, total, siblings) {
|
|
5962
6624
|
if (total <= 0) return [];
|
|
5963
6625
|
const items = [];
|
|
@@ -5970,9 +6632,9 @@ function buildRange(page, total, siblings) {
|
|
|
5970
6632
|
if (total > 1) items.push(total);
|
|
5971
6633
|
return items;
|
|
5972
6634
|
}
|
|
5973
|
-
var Pagination = (0,
|
|
6635
|
+
var Pagination = (0, import_react77.forwardRef)(function Pagination2({ page, total, onPageChange, siblings = 1, className, ...props }, ref) {
|
|
5974
6636
|
const items = buildRange(page, total, siblings);
|
|
5975
|
-
return /* @__PURE__ */ (0,
|
|
6637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
5976
6638
|
"nav",
|
|
5977
6639
|
{
|
|
5978
6640
|
ref,
|
|
@@ -5980,7 +6642,7 @@ var Pagination = (0, import_react76.forwardRef)(function Pagination2({ page, tot
|
|
|
5980
6642
|
className: cn("inline-flex items-center gap-1", className),
|
|
5981
6643
|
...props,
|
|
5982
6644
|
children: [
|
|
5983
|
-
/* @__PURE__ */ (0,
|
|
6645
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5984
6646
|
IconButton,
|
|
5985
6647
|
{
|
|
5986
6648
|
size: "sm",
|
|
@@ -5993,7 +6655,7 @@ var Pagination = (0, import_react76.forwardRef)(function Pagination2({ page, tot
|
|
|
5993
6655
|
),
|
|
5994
6656
|
items.map((item, i) => {
|
|
5995
6657
|
if (item === "start-ellipsis" || item === "end-ellipsis") {
|
|
5996
|
-
return /* @__PURE__ */ (0,
|
|
6658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5997
6659
|
"span",
|
|
5998
6660
|
{
|
|
5999
6661
|
"aria-hidden": true,
|
|
@@ -6004,7 +6666,7 @@ var Pagination = (0, import_react76.forwardRef)(function Pagination2({ page, tot
|
|
|
6004
6666
|
);
|
|
6005
6667
|
}
|
|
6006
6668
|
const isActive = item === page;
|
|
6007
|
-
return /* @__PURE__ */ (0,
|
|
6669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6008
6670
|
"button",
|
|
6009
6671
|
{
|
|
6010
6672
|
type: "button",
|
|
@@ -6022,7 +6684,7 @@ var Pagination = (0, import_react76.forwardRef)(function Pagination2({ page, tot
|
|
|
6022
6684
|
item
|
|
6023
6685
|
);
|
|
6024
6686
|
}),
|
|
6025
|
-
/* @__PURE__ */ (0,
|
|
6687
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6026
6688
|
IconButton,
|
|
6027
6689
|
{
|
|
6028
6690
|
size: "sm",
|
|
@@ -6040,10 +6702,10 @@ var Pagination = (0, import_react76.forwardRef)(function Pagination2({ page, tot
|
|
|
6040
6702
|
Pagination.displayName = "Pagination";
|
|
6041
6703
|
|
|
6042
6704
|
// src/patterns/Progress/Progress.tsx
|
|
6043
|
-
var
|
|
6044
|
-
var
|
|
6045
|
-
var
|
|
6046
|
-
var trackStyles = (0,
|
|
6705
|
+
var import_class_variance_authority13 = require("class-variance-authority");
|
|
6706
|
+
var import_react78 = require("react");
|
|
6707
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
6708
|
+
var trackStyles = (0, import_class_variance_authority13.cva)("w-full rounded-full bg-panel-2 overflow-hidden", {
|
|
6047
6709
|
variants: {
|
|
6048
6710
|
size: {
|
|
6049
6711
|
sm: "h-[3px]",
|
|
@@ -6053,7 +6715,7 @@ var trackStyles = (0, import_class_variance_authority12.cva)("w-full rounded-ful
|
|
|
6053
6715
|
},
|
|
6054
6716
|
defaultVariants: { size: "md" }
|
|
6055
6717
|
});
|
|
6056
|
-
var fillStyles = (0,
|
|
6718
|
+
var fillStyles = (0, import_class_variance_authority13.cva)("h-full rounded-full transition-[width] duration-(--duration-step)", {
|
|
6057
6719
|
variants: {
|
|
6058
6720
|
tone: {
|
|
6059
6721
|
accent: "bg-accent",
|
|
@@ -6064,7 +6726,7 @@ var fillStyles = (0, import_class_variance_authority12.cva)("h-full rounded-full
|
|
|
6064
6726
|
},
|
|
6065
6727
|
defaultVariants: { tone: "accent" }
|
|
6066
6728
|
});
|
|
6067
|
-
var Progress = (0,
|
|
6729
|
+
var Progress = (0, import_react78.forwardRef)(function Progress2({
|
|
6068
6730
|
value = 0,
|
|
6069
6731
|
max = 100,
|
|
6070
6732
|
indeterminate = false,
|
|
@@ -6078,15 +6740,15 @@ var Progress = (0, import_react77.forwardRef)(function Progress2({
|
|
|
6078
6740
|
const clamped = Math.min(max, Math.max(0, value));
|
|
6079
6741
|
const pct = max > 0 ? clamped / max * 100 : 0;
|
|
6080
6742
|
const display = Math.round(pct);
|
|
6081
|
-
return /* @__PURE__ */ (0,
|
|
6082
|
-
label != null && /* @__PURE__ */ (0,
|
|
6083
|
-
/* @__PURE__ */ (0,
|
|
6084
|
-
showValue && !indeterminate && /* @__PURE__ */ (0,
|
|
6743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
6744
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex text-[12px]", children: [
|
|
6745
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "text-text-muted", children: label }),
|
|
6746
|
+
showValue && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("span", { className: "text-text ml-auto font-mono tabular-nums", children: [
|
|
6085
6747
|
display,
|
|
6086
6748
|
"%"
|
|
6087
6749
|
] })
|
|
6088
6750
|
] }),
|
|
6089
|
-
/* @__PURE__ */ (0,
|
|
6751
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6090
6752
|
"div",
|
|
6091
6753
|
{
|
|
6092
6754
|
role: "progressbar",
|
|
@@ -6095,7 +6757,7 @@ var Progress = (0, import_react77.forwardRef)(function Progress2({
|
|
|
6095
6757
|
"aria-valuenow": indeterminate ? void 0 : display,
|
|
6096
6758
|
"aria-label": typeof label === "string" ? label : void 0,
|
|
6097
6759
|
className: trackStyles({ size }),
|
|
6098
|
-
children: indeterminate ? /* @__PURE__ */ (0,
|
|
6760
|
+
children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6099
6761
|
"span",
|
|
6100
6762
|
{
|
|
6101
6763
|
"aria-hidden": true,
|
|
@@ -6105,7 +6767,7 @@ var Progress = (0, import_react77.forwardRef)(function Progress2({
|
|
|
6105
6767
|
"animate-[ship-indeterminate_1.4s_linear_infinite]"
|
|
6106
6768
|
)
|
|
6107
6769
|
}
|
|
6108
|
-
) : /* @__PURE__ */ (0,
|
|
6770
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { "aria-hidden": true, className: fillStyles({ tone }), style: { width: `${pct}%` } })
|
|
6109
6771
|
}
|
|
6110
6772
|
)
|
|
6111
6773
|
] });
|
|
@@ -6113,18 +6775,18 @@ var Progress = (0, import_react77.forwardRef)(function Progress2({
|
|
|
6113
6775
|
Progress.displayName = "Progress";
|
|
6114
6776
|
|
|
6115
6777
|
// src/patterns/PullToRefresh/PullToRefresh.tsx
|
|
6116
|
-
var
|
|
6117
|
-
var
|
|
6778
|
+
var import_react79 = require("react");
|
|
6779
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
6118
6780
|
var labels = {
|
|
6119
6781
|
idle: "Pull to refresh",
|
|
6120
6782
|
pulling: "Pull to refresh",
|
|
6121
6783
|
ready: "Release to refresh",
|
|
6122
6784
|
loading: "Refreshing\u2026"
|
|
6123
6785
|
};
|
|
6124
|
-
var PullToRefresh = (0,
|
|
6786
|
+
var PullToRefresh = (0, import_react79.forwardRef)(function PullToRefresh2({ state = "idle", label, className, ...props }, ref) {
|
|
6125
6787
|
const isLoading = state === "loading";
|
|
6126
6788
|
const transform = state === "ready" ? "rotate(180deg)" : state === "pulling" ? "rotate(90deg)" : "rotate(0deg)";
|
|
6127
|
-
return /* @__PURE__ */ (0,
|
|
6789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
6128
6790
|
"div",
|
|
6129
6791
|
{
|
|
6130
6792
|
ref,
|
|
@@ -6134,7 +6796,7 @@ var PullToRefresh = (0, import_react78.forwardRef)(function PullToRefresh2({ sta
|
|
|
6134
6796
|
className: cn("text-text-muted flex flex-col items-center gap-[6px] py-3", className),
|
|
6135
6797
|
...props,
|
|
6136
6798
|
children: [
|
|
6137
|
-
/* @__PURE__ */ (0,
|
|
6799
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6138
6800
|
"div",
|
|
6139
6801
|
{
|
|
6140
6802
|
"aria-hidden": true,
|
|
@@ -6150,7 +6812,7 @@ var PullToRefresh = (0, import_react78.forwardRef)(function PullToRefresh2({ sta
|
|
|
6150
6812
|
}
|
|
6151
6813
|
}
|
|
6152
6814
|
),
|
|
6153
|
-
/* @__PURE__ */ (0,
|
|
6815
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "text-m-eyebrow font-mono tracking-wide uppercase", children: label ?? labels[state] })
|
|
6154
6816
|
]
|
|
6155
6817
|
}
|
|
6156
6818
|
);
|
|
@@ -6158,8 +6820,8 @@ var PullToRefresh = (0, import_react78.forwardRef)(function PullToRefresh2({ sta
|
|
|
6158
6820
|
PullToRefresh.displayName = "PullToRefresh";
|
|
6159
6821
|
|
|
6160
6822
|
// src/patterns/Sparkline/Sparkline.tsx
|
|
6161
|
-
var
|
|
6162
|
-
var
|
|
6823
|
+
var import_react80 = require("react");
|
|
6824
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
6163
6825
|
function buildPath(values, w, h) {
|
|
6164
6826
|
if (values.length === 0) return { line: "", area: "" };
|
|
6165
6827
|
const pad = 2;
|
|
@@ -6178,7 +6840,7 @@ function buildPath(values, w, h) {
|
|
|
6178
6840
|
)} L${pad.toFixed(2)},${(h - pad).toFixed(2)} Z`;
|
|
6179
6841
|
return { line, area };
|
|
6180
6842
|
}
|
|
6181
|
-
var Sparkline = (0,
|
|
6843
|
+
var Sparkline = (0, import_react80.forwardRef)(function Sparkline2({
|
|
6182
6844
|
values,
|
|
6183
6845
|
width = 160,
|
|
6184
6846
|
height = 32,
|
|
@@ -6189,8 +6851,8 @@ var Sparkline = (0, import_react79.forwardRef)(function Sparkline2({
|
|
|
6189
6851
|
"aria-label": ariaLabel = "Trend",
|
|
6190
6852
|
...props
|
|
6191
6853
|
}, ref) {
|
|
6192
|
-
const { line, area } = (0,
|
|
6193
|
-
return /* @__PURE__ */ (0,
|
|
6854
|
+
const { line, area } = (0, import_react80.useMemo)(() => buildPath(values, width, height), [values, width, height]);
|
|
6855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
6194
6856
|
"svg",
|
|
6195
6857
|
{
|
|
6196
6858
|
ref,
|
|
@@ -6202,8 +6864,8 @@ var Sparkline = (0, import_react79.forwardRef)(function Sparkline2({
|
|
|
6202
6864
|
className: cn("inline-block", className),
|
|
6203
6865
|
...props,
|
|
6204
6866
|
children: [
|
|
6205
|
-
fill && /* @__PURE__ */ (0,
|
|
6206
|
-
/* @__PURE__ */ (0,
|
|
6867
|
+
fill && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("path", { d: area, fill: stroke, fillOpacity: 0.16, stroke: "none" }),
|
|
6868
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6207
6869
|
"path",
|
|
6208
6870
|
{
|
|
6209
6871
|
d: line,
|
|
@@ -6221,16 +6883,16 @@ var Sparkline = (0, import_react79.forwardRef)(function Sparkline2({
|
|
|
6221
6883
|
Sparkline.displayName = "Sparkline";
|
|
6222
6884
|
|
|
6223
6885
|
// src/patterns/Spinner/Spinner.tsx
|
|
6224
|
-
var
|
|
6225
|
-
var
|
|
6886
|
+
var import_react81 = require("react");
|
|
6887
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
6226
6888
|
var sizes = {
|
|
6227
6889
|
sm: { box: "h-3 w-3", border: "border-[2px]" },
|
|
6228
6890
|
md: { box: "h-4 w-4", border: "border-[2px]" },
|
|
6229
6891
|
lg: { box: "h-5 w-5", border: "border-[2px]" }
|
|
6230
6892
|
};
|
|
6231
|
-
var Spinner2 = (0,
|
|
6893
|
+
var Spinner2 = (0, import_react81.forwardRef)(function Spinner3({ size = "md", label = "Loading", className, ...props }, ref) {
|
|
6232
6894
|
const s = sizes[size];
|
|
6233
|
-
return /* @__PURE__ */ (0,
|
|
6895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6234
6896
|
"span",
|
|
6235
6897
|
{
|
|
6236
6898
|
ref,
|
|
@@ -6238,7 +6900,7 @@ var Spinner2 = (0, import_react80.forwardRef)(function Spinner3({ size = "md", l
|
|
|
6238
6900
|
"aria-label": label,
|
|
6239
6901
|
className: cn("inline-block", className),
|
|
6240
6902
|
...props,
|
|
6241
|
-
children: /* @__PURE__ */ (0,
|
|
6903
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6242
6904
|
"span",
|
|
6243
6905
|
{
|
|
6244
6906
|
"aria-hidden": true,
|
|
@@ -6255,8 +6917,8 @@ var Spinner2 = (0, import_react80.forwardRef)(function Spinner3({ size = "md", l
|
|
|
6255
6917
|
Spinner2.displayName = "Spinner";
|
|
6256
6918
|
|
|
6257
6919
|
// src/patterns/Stepper/Stepper.tsx
|
|
6258
|
-
var
|
|
6259
|
-
var
|
|
6920
|
+
var import_react82 = require("react");
|
|
6921
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
6260
6922
|
var dotBase = "h-6 w-6 rounded-full grid place-items-center text-[11px] font-mono font-semibold border";
|
|
6261
6923
|
var dotStateClass = {
|
|
6262
6924
|
done: "bg-accent text-on-accent border-accent",
|
|
@@ -6273,8 +6935,8 @@ function stateFor(index, current) {
|
|
|
6273
6935
|
if (index === current) return "current";
|
|
6274
6936
|
return "upcoming";
|
|
6275
6937
|
}
|
|
6276
|
-
var Stepper = (0,
|
|
6277
|
-
return /* @__PURE__ */ (0,
|
|
6938
|
+
var Stepper = (0, import_react82.forwardRef)(function Stepper2({ steps, current, className, ...props }, ref) {
|
|
6939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6278
6940
|
"ol",
|
|
6279
6941
|
{
|
|
6280
6942
|
ref,
|
|
@@ -6286,19 +6948,19 @@ var Stepper = (0, import_react81.forwardRef)(function Stepper2({ steps, current,
|
|
|
6286
6948
|
const id = typeof step === "string" ? void 0 : step.id;
|
|
6287
6949
|
const state = stateFor(i, current);
|
|
6288
6950
|
const connectorActive = i < current;
|
|
6289
|
-
return /* @__PURE__ */ (0,
|
|
6290
|
-
/* @__PURE__ */ (0,
|
|
6951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_react82.Fragment, { children: [
|
|
6952
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
6291
6953
|
"li",
|
|
6292
6954
|
{
|
|
6293
6955
|
"aria-current": state === "current" ? "step" : void 0,
|
|
6294
6956
|
className: "flex items-center gap-2",
|
|
6295
6957
|
children: [
|
|
6296
|
-
/* @__PURE__ */ (0,
|
|
6297
|
-
/* @__PURE__ */ (0,
|
|
6958
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { "aria-hidden": true, className: cn(dotBase, dotStateClass[state]), children: state === "done" ? "\u2713" : i + 1 }),
|
|
6959
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: cn("text-[12px]", labelStateClass2[state]), children: label })
|
|
6298
6960
|
]
|
|
6299
6961
|
}
|
|
6300
6962
|
),
|
|
6301
|
-
i < steps.length - 1 && /* @__PURE__ */ (0,
|
|
6963
|
+
i < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6302
6964
|
"span",
|
|
6303
6965
|
{
|
|
6304
6966
|
"aria-hidden": true,
|
|
@@ -6313,13 +6975,13 @@ var Stepper = (0, import_react81.forwardRef)(function Stepper2({ steps, current,
|
|
|
6313
6975
|
Stepper.displayName = "Stepper";
|
|
6314
6976
|
|
|
6315
6977
|
// src/patterns/TabBar/TabBar.tsx
|
|
6316
|
-
var
|
|
6317
|
-
var
|
|
6318
|
-
var TabBar = (0,
|
|
6978
|
+
var import_react83 = require("react");
|
|
6979
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
6980
|
+
var TabBar = (0, import_react83.forwardRef)(function TabBar2({ items, value, defaultValue, onValueChange, className, ...props }, ref) {
|
|
6319
6981
|
const isControlled = value !== void 0;
|
|
6320
|
-
const [internalValue, setInternalValue] = (0,
|
|
6982
|
+
const [internalValue, setInternalValue] = (0, import_react83.useState)(defaultValue);
|
|
6321
6983
|
const activeId = isControlled ? value : internalValue;
|
|
6322
|
-
const handleSelect = (0,
|
|
6984
|
+
const handleSelect = (0, import_react83.useCallback)(
|
|
6323
6985
|
(id, e) => {
|
|
6324
6986
|
if (!isControlled) setInternalValue(id);
|
|
6325
6987
|
onValueChange?.(id);
|
|
@@ -6327,7 +6989,7 @@ var TabBar = (0, import_react82.forwardRef)(function TabBar2({ items, value, def
|
|
|
6327
6989
|
},
|
|
6328
6990
|
[isControlled, onValueChange]
|
|
6329
6991
|
);
|
|
6330
|
-
return /* @__PURE__ */ (0,
|
|
6992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6331
6993
|
"nav",
|
|
6332
6994
|
{
|
|
6333
6995
|
ref,
|
|
@@ -6342,7 +7004,7 @@ var TabBar = (0, import_react82.forwardRef)(function TabBar2({ items, value, def
|
|
|
6342
7004
|
children: items.map((item) => {
|
|
6343
7005
|
const isActive = item.id === activeId;
|
|
6344
7006
|
if (item.elevated) {
|
|
6345
|
-
return /* @__PURE__ */ (0,
|
|
7007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "grid place-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
6346
7008
|
"button",
|
|
6347
7009
|
{
|
|
6348
7010
|
type: "button",
|
|
@@ -6358,13 +7020,13 @@ var TabBar = (0, import_react82.forwardRef)(function TabBar2({ items, value, def
|
|
|
6358
7020
|
"disabled:cursor-not-allowed disabled:opacity-40"
|
|
6359
7021
|
),
|
|
6360
7022
|
children: [
|
|
6361
|
-
/* @__PURE__ */ (0,
|
|
6362
|
-
/* @__PURE__ */ (0,
|
|
7023
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { "aria-hidden": true, children: item.icon }),
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "sr-only", children: item.label })
|
|
6363
7025
|
]
|
|
6364
7026
|
}
|
|
6365
7027
|
) }, item.id);
|
|
6366
7028
|
}
|
|
6367
|
-
return /* @__PURE__ */ (0,
|
|
7029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
6368
7030
|
"button",
|
|
6369
7031
|
{
|
|
6370
7032
|
type: "button",
|
|
@@ -6379,9 +7041,9 @@ var TabBar = (0, import_react82.forwardRef)(function TabBar2({ items, value, def
|
|
|
6379
7041
|
isActive ? "text-accent-text" : "text-text-muted hover:text-text"
|
|
6380
7042
|
),
|
|
6381
7043
|
children: [
|
|
6382
|
-
/* @__PURE__ */ (0,
|
|
7044
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("span", { className: "relative inline-flex", "aria-hidden": true, children: [
|
|
6383
7045
|
item.icon,
|
|
6384
|
-
item.badge != null && /* @__PURE__ */ (0,
|
|
7046
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6385
7047
|
"span",
|
|
6386
7048
|
{
|
|
6387
7049
|
className: cn(
|
|
@@ -6392,9 +7054,9 @@ var TabBar = (0, import_react82.forwardRef)(function TabBar2({ items, value, def
|
|
|
6392
7054
|
}
|
|
6393
7055
|
)
|
|
6394
7056
|
] }),
|
|
6395
|
-
/* @__PURE__ */ (0,
|
|
7057
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("span", { className: "text-[10px] font-medium tracking-tight", children: [
|
|
6396
7058
|
item.label,
|
|
6397
|
-
item.badge != null && /* @__PURE__ */ (0,
|
|
7059
|
+
item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("span", { className: "sr-only", children: [
|
|
6398
7060
|
", ",
|
|
6399
7061
|
item.badge,
|
|
6400
7062
|
" unread"
|
|
@@ -6412,11 +7074,11 @@ TabBar.displayName = "TabBar";
|
|
|
6412
7074
|
|
|
6413
7075
|
// src/patterns/Tabs/Tabs.tsx
|
|
6414
7076
|
var RadixTabs = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
6415
|
-
var
|
|
6416
|
-
var
|
|
6417
|
-
var
|
|
6418
|
-
var TabsVariantContext = (0,
|
|
6419
|
-
var tabsListStyles = (0,
|
|
7077
|
+
var import_class_variance_authority14 = require("class-variance-authority");
|
|
7078
|
+
var import_react84 = require("react");
|
|
7079
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
7080
|
+
var TabsVariantContext = (0, import_react84.createContext)("underline");
|
|
7081
|
+
var tabsListStyles = (0, import_class_variance_authority14.cva)("", {
|
|
6420
7082
|
variants: {
|
|
6421
7083
|
variant: {
|
|
6422
7084
|
underline: "flex gap-6 border-b border-border",
|
|
@@ -6424,7 +7086,7 @@ var tabsListStyles = (0, import_class_variance_authority13.cva)("", {
|
|
|
6424
7086
|
}
|
|
6425
7087
|
}
|
|
6426
7088
|
});
|
|
6427
|
-
var tabsTriggerStyles = (0,
|
|
7089
|
+
var tabsTriggerStyles = (0, import_class_variance_authority14.cva)(
|
|
6428
7090
|
"cursor-pointer outline-none transition-colors duration-(--duration-micro) focus-visible:ring-[3px] focus-visible:ring-accent-dim",
|
|
6429
7091
|
{
|
|
6430
7092
|
variants: {
|
|
@@ -6445,8 +7107,8 @@ var tabsTriggerStyles = (0, import_class_variance_authority13.cva)(
|
|
|
6445
7107
|
}
|
|
6446
7108
|
}
|
|
6447
7109
|
);
|
|
6448
|
-
var Tabs = (0,
|
|
6449
|
-
return /* @__PURE__ */ (0,
|
|
7110
|
+
var Tabs = (0, import_react84.forwardRef)(function Tabs2({ variant = "underline", className, ...props }, ref) {
|
|
7111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(TabsVariantContext.Provider, { value: variant, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6450
7112
|
RadixTabs.Root,
|
|
6451
7113
|
{
|
|
6452
7114
|
ref,
|
|
@@ -6456,14 +7118,14 @@ var Tabs = (0, import_react83.forwardRef)(function Tabs2({ variant = "underline"
|
|
|
6456
7118
|
) });
|
|
6457
7119
|
});
|
|
6458
7120
|
Tabs.displayName = "Tabs";
|
|
6459
|
-
var TabsList = (0,
|
|
6460
|
-
const variant = (0,
|
|
6461
|
-
return /* @__PURE__ */ (0,
|
|
7121
|
+
var TabsList = (0, import_react84.forwardRef)(function TabsList2({ className, ...props }, ref) {
|
|
7122
|
+
const variant = (0, import_react84.useContext)(TabsVariantContext);
|
|
7123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(RadixTabs.List, { ref, className: cn(tabsListStyles({ variant }), className), ...props });
|
|
6462
7124
|
});
|
|
6463
7125
|
TabsList.displayName = "TabsList";
|
|
6464
|
-
var Tab = (0,
|
|
6465
|
-
const variant = (0,
|
|
6466
|
-
return /* @__PURE__ */ (0,
|
|
7126
|
+
var Tab = (0, import_react84.forwardRef)(function Tab2({ className, ...props }, ref) {
|
|
7127
|
+
const variant = (0, import_react84.useContext)(TabsVariantContext);
|
|
7128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6467
7129
|
RadixTabs.Trigger,
|
|
6468
7130
|
{
|
|
6469
7131
|
ref,
|
|
@@ -6473,9 +7135,9 @@ var Tab = (0, import_react83.forwardRef)(function Tab2({ className, ...props },
|
|
|
6473
7135
|
);
|
|
6474
7136
|
});
|
|
6475
7137
|
Tab.displayName = "Tab";
|
|
6476
|
-
var TabsContent = (0,
|
|
7138
|
+
var TabsContent = (0, import_react84.forwardRef)(
|
|
6477
7139
|
function TabsContent2({ className, ...props }, ref) {
|
|
6478
|
-
return /* @__PURE__ */ (0,
|
|
7140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
6479
7141
|
RadixTabs.Content,
|
|
6480
7142
|
{
|
|
6481
7143
|
ref,
|
|
@@ -6491,8 +7153,8 @@ var TabsContent = (0, import_react83.forwardRef)(
|
|
|
6491
7153
|
TabsContent.displayName = "TabsContent";
|
|
6492
7154
|
|
|
6493
7155
|
// src/patterns/Timeline/Timeline.tsx
|
|
6494
|
-
var
|
|
6495
|
-
var
|
|
7156
|
+
var import_react85 = require("react");
|
|
7157
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
6496
7158
|
var ringClass = {
|
|
6497
7159
|
accent: "border-accent",
|
|
6498
7160
|
ok: "border-ok",
|
|
@@ -6500,8 +7162,8 @@ var ringClass = {
|
|
|
6500
7162
|
err: "border-err",
|
|
6501
7163
|
muted: "border-text-dim"
|
|
6502
7164
|
};
|
|
6503
|
-
var Timeline = (0,
|
|
6504
|
-
return /* @__PURE__ */ (0,
|
|
7165
|
+
var Timeline = (0, import_react85.forwardRef)(function Timeline2({ events, className, children, ...props }, ref) {
|
|
7166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6505
7167
|
"ol",
|
|
6506
7168
|
{
|
|
6507
7169
|
ref,
|
|
@@ -6511,14 +7173,14 @@ var Timeline = (0, import_react84.forwardRef)(function Timeline2({ events, class
|
|
|
6511
7173
|
className
|
|
6512
7174
|
),
|
|
6513
7175
|
...props,
|
|
6514
|
-
children: events ? events.map((e, i) => /* @__PURE__ */ (0,
|
|
7176
|
+
children: events ? events.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TimelineItem, { tone: e.tone, time: e.time, description: e.description, children: e.title }, i)) : children
|
|
6515
7177
|
}
|
|
6516
7178
|
);
|
|
6517
7179
|
});
|
|
6518
7180
|
Timeline.displayName = "Timeline";
|
|
6519
|
-
var TimelineItem = (0,
|
|
6520
|
-
return /* @__PURE__ */ (0,
|
|
6521
|
-
/* @__PURE__ */ (0,
|
|
7181
|
+
var TimelineItem = (0, import_react85.forwardRef)(function TimelineItem2({ tone = "accent", description, time, className, children, ...props }, ref) {
|
|
7182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("li", { ref, className: cn("relative mb-[18px] last:mb-0", className), ...props, children: [
|
|
7183
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
6522
7184
|
"span",
|
|
6523
7185
|
{
|
|
6524
7186
|
"aria-hidden": true,
|
|
@@ -6528,15 +7190,15 @@ var TimelineItem = (0, import_react84.forwardRef)(function TimelineItem2({ tone
|
|
|
6528
7190
|
)
|
|
6529
7191
|
}
|
|
6530
7192
|
),
|
|
6531
|
-
/* @__PURE__ */ (0,
|
|
6532
|
-
description && /* @__PURE__ */ (0,
|
|
6533
|
-
time && /* @__PURE__ */ (0,
|
|
7193
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "text-[13px] font-medium", children }),
|
|
7194
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "text-text-muted text-[12px]", children: description }),
|
|
7195
|
+
time && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "text-text-dim mt-[2px] font-mono text-[10px]", children: time })
|
|
6534
7196
|
] });
|
|
6535
7197
|
});
|
|
6536
7198
|
TimelineItem.displayName = "TimelineItem";
|
|
6537
7199
|
|
|
6538
7200
|
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
6539
|
-
var
|
|
7201
|
+
var import_react86 = require("react");
|
|
6540
7202
|
|
|
6541
7203
|
// src/patterns/Timeline/formatRelative.ts
|
|
6542
7204
|
var SECOND = 1e3;
|
|
@@ -6571,7 +7233,7 @@ function formatRelative(input, now = /* @__PURE__ */ new Date()) {
|
|
|
6571
7233
|
}
|
|
6572
7234
|
|
|
6573
7235
|
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
6574
|
-
var
|
|
7236
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
6575
7237
|
var ringClass2 = {
|
|
6576
7238
|
accent: "border-accent",
|
|
6577
7239
|
ok: "border-ok",
|
|
@@ -6579,10 +7241,10 @@ var ringClass2 = {
|
|
|
6579
7241
|
err: "border-err",
|
|
6580
7242
|
muted: "border-text-dim"
|
|
6581
7243
|
};
|
|
6582
|
-
var ActivityTimeline = (0,
|
|
7244
|
+
var ActivityTimeline = (0, import_react86.forwardRef)(
|
|
6583
7245
|
function ActivityTimeline2({ events, relativeNow, className, ...props }, ref) {
|
|
6584
7246
|
const now = relativeNow ?? /* @__PURE__ */ new Date();
|
|
6585
|
-
return /* @__PURE__ */ (0,
|
|
7247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
6586
7248
|
"ol",
|
|
6587
7249
|
{
|
|
6588
7250
|
ref,
|
|
@@ -6595,8 +7257,8 @@ var ActivityTimeline = (0, import_react85.forwardRef)(
|
|
|
6595
7257
|
children: events.map((event) => {
|
|
6596
7258
|
const tone = event.tone ?? "accent";
|
|
6597
7259
|
const time = formatRelative(event.at, now);
|
|
6598
|
-
return /* @__PURE__ */ (0,
|
|
6599
|
-
/* @__PURE__ */ (0,
|
|
7260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("li", { className: "relative mb-4 last:mb-0", children: [
|
|
7261
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
6600
7262
|
"span",
|
|
6601
7263
|
{
|
|
6602
7264
|
"aria-hidden": true,
|
|
@@ -6606,16 +7268,16 @@ var ActivityTimeline = (0, import_react85.forwardRef)(
|
|
|
6606
7268
|
)
|
|
6607
7269
|
}
|
|
6608
7270
|
),
|
|
6609
|
-
/* @__PURE__ */ (0,
|
|
6610
|
-
event.icon && /* @__PURE__ */ (0,
|
|
6611
|
-
/* @__PURE__ */ (0,
|
|
6612
|
-
time && /* @__PURE__ */ (0,
|
|
7271
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex items-baseline gap-2", children: [
|
|
7272
|
+
event.icon && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { "aria-hidden": true, className: "text-text-muted font-mono text-[12px]", children: event.icon }),
|
|
7273
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "text-[13px] font-medium", children: event.title }),
|
|
7274
|
+
time && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("time", { className: "text-text-dim ml-auto font-mono text-[10px]", children: time })
|
|
6613
7275
|
] }),
|
|
6614
|
-
event.actor && /* @__PURE__ */ (0,
|
|
6615
|
-
event.actor.avatar && /* @__PURE__ */ (0,
|
|
6616
|
-
/* @__PURE__ */ (0,
|
|
7276
|
+
event.actor && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "text-text-muted mt-[2px] flex items-center gap-[6px] text-[12px]", children: [
|
|
7277
|
+
event.actor.avatar && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { "aria-hidden": true, className: "inline-flex", children: event.actor.avatar }),
|
|
7278
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { children: event.actor.name })
|
|
6617
7279
|
] }),
|
|
6618
|
-
event.payload && /* @__PURE__ */ (0,
|
|
7280
|
+
event.payload && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "border-border bg-panel-2 mt-2 rounded-md border px-3 py-2 font-mono text-[11px] leading-[1.5]", children: event.payload })
|
|
6619
7281
|
] }, event.id);
|
|
6620
7282
|
})
|
|
6621
7283
|
}
|
|
@@ -6625,9 +7287,9 @@ var ActivityTimeline = (0, import_react85.forwardRef)(
|
|
|
6625
7287
|
ActivityTimeline.displayName = "ActivityTimeline";
|
|
6626
7288
|
|
|
6627
7289
|
// src/patterns/Topbar/Topbar.tsx
|
|
6628
|
-
var
|
|
6629
|
-
var
|
|
6630
|
-
var Topbar = (0,
|
|
7290
|
+
var import_react87 = require("react");
|
|
7291
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
7292
|
+
var Topbar = (0, import_react87.forwardRef)(function Topbar2({
|
|
6631
7293
|
title,
|
|
6632
7294
|
eyebrow,
|
|
6633
7295
|
leading,
|
|
@@ -6641,7 +7303,7 @@ var Topbar = (0, import_react86.forwardRef)(function Topbar2({
|
|
|
6641
7303
|
}, ref) {
|
|
6642
7304
|
const isTouch = density === "touch";
|
|
6643
7305
|
const backHandler = typeof back === "function" ? back : back ? onBack : void 0;
|
|
6644
|
-
return /* @__PURE__ */ (0,
|
|
7306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
6645
7307
|
"header",
|
|
6646
7308
|
{
|
|
6647
7309
|
ref,
|
|
@@ -6652,7 +7314,7 @@ var Topbar = (0, import_react86.forwardRef)(function Topbar2({
|
|
|
6652
7314
|
),
|
|
6653
7315
|
...props,
|
|
6654
7316
|
children: [
|
|
6655
|
-
isTouch && back && /* @__PURE__ */ (0,
|
|
7317
|
+
isTouch && back && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6656
7318
|
"button",
|
|
6657
7319
|
{
|
|
6658
7320
|
type: "button",
|
|
@@ -6666,7 +7328,7 @@ var Topbar = (0, import_react86.forwardRef)(function Topbar2({
|
|
|
6666
7328
|
"hover:bg-panel-2 h-touch w-touch",
|
|
6667
7329
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]"
|
|
6668
7330
|
),
|
|
6669
|
-
children: /* @__PURE__ */ (0,
|
|
7331
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6670
7332
|
"svg",
|
|
6671
7333
|
{
|
|
6672
7334
|
width: "20",
|
|
@@ -6676,15 +7338,15 @@ var Topbar = (0, import_react86.forwardRef)(function Topbar2({
|
|
|
6676
7338
|
stroke: "currentColor",
|
|
6677
7339
|
strokeWidth: "2",
|
|
6678
7340
|
"aria-hidden": true,
|
|
6679
|
-
children: /* @__PURE__ */ (0,
|
|
7341
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("path", { d: "m15 18-6-6 6-6" })
|
|
6680
7342
|
}
|
|
6681
7343
|
)
|
|
6682
7344
|
}
|
|
6683
7345
|
),
|
|
6684
7346
|
leading,
|
|
6685
|
-
(title || isTouch && eyebrow) && /* @__PURE__ */ (0,
|
|
6686
|
-
isTouch && eyebrow && /* @__PURE__ */ (0,
|
|
6687
|
-
title && /* @__PURE__ */ (0,
|
|
7347
|
+
(title || isTouch && eyebrow) && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: cn("min-w-0", isTouch && "flex-1"), children: [
|
|
7348
|
+
isTouch && eyebrow && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "text-m-eyebrow text-accent font-mono tracking-wide uppercase", children: eyebrow }),
|
|
7349
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
6688
7350
|
"div",
|
|
6689
7351
|
{
|
|
6690
7352
|
className: cn(
|
|
@@ -6694,8 +7356,8 @@ var Topbar = (0, import_react86.forwardRef)(function Topbar2({
|
|
|
6694
7356
|
}
|
|
6695
7357
|
)
|
|
6696
7358
|
] }),
|
|
6697
|
-
!isTouch && /* @__PURE__ */ (0,
|
|
6698
|
-
actions && /* @__PURE__ */ (0,
|
|
7359
|
+
!isTouch && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex flex-1 items-center" }),
|
|
7360
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: cn("flex items-center", isTouch ? "gap-1" : "gap-3"), children: actions }),
|
|
6699
7361
|
children
|
|
6700
7362
|
]
|
|
6701
7363
|
}
|
|
@@ -6704,8 +7366,9 @@ var Topbar = (0, import_react86.forwardRef)(function Topbar2({
|
|
|
6704
7366
|
Topbar.displayName = "Topbar";
|
|
6705
7367
|
|
|
6706
7368
|
// src/patterns/Tree/Tree.tsx
|
|
6707
|
-
var
|
|
6708
|
-
var
|
|
7369
|
+
var import_react88 = require("react");
|
|
7370
|
+
var import_react_dom = require("react-dom");
|
|
7371
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
6709
7372
|
var EMPTY_SET2 = /* @__PURE__ */ new Set();
|
|
6710
7373
|
function flattenVisible(items, expanded, level, parentId, out) {
|
|
6711
7374
|
for (const item of items) {
|
|
@@ -6716,7 +7379,7 @@ function flattenVisible(items, expanded, level, parentId, out) {
|
|
|
6716
7379
|
}
|
|
6717
7380
|
}
|
|
6718
7381
|
}
|
|
6719
|
-
var Tree = (0,
|
|
7382
|
+
var Tree = (0, import_react88.forwardRef)(function Tree2({
|
|
6720
7383
|
items,
|
|
6721
7384
|
expanded: expandedProp,
|
|
6722
7385
|
defaultExpanded,
|
|
@@ -6739,24 +7402,24 @@ var Tree = (0, import_react87.forwardRef)(function Tree2({
|
|
|
6739
7402
|
onChange: onValueChange
|
|
6740
7403
|
});
|
|
6741
7404
|
const expandedSet = expanded ?? EMPTY_SET2;
|
|
6742
|
-
const flatVisible = (0,
|
|
7405
|
+
const flatVisible = (0, import_react88.useMemo)(() => {
|
|
6743
7406
|
const out = [];
|
|
6744
7407
|
flattenVisible(items, expandedSet, 1, null, out);
|
|
6745
7408
|
return out;
|
|
6746
7409
|
}, [items, expandedSet]);
|
|
6747
|
-
const [activeId, setActiveId] = (0,
|
|
6748
|
-
(0,
|
|
7410
|
+
const [activeId, setActiveId] = (0, import_react88.useState)(null);
|
|
7411
|
+
(0, import_react88.useEffect)(() => {
|
|
6749
7412
|
if (activeId && !flatVisible.some((f) => f.id === activeId)) {
|
|
6750
7413
|
setActiveId(null);
|
|
6751
7414
|
}
|
|
6752
7415
|
}, [activeId, flatVisible]);
|
|
6753
|
-
const tabStopId = (0,
|
|
7416
|
+
const tabStopId = (0, import_react88.useMemo)(() => {
|
|
6754
7417
|
if (activeId && flatVisible.some((f) => f.id === activeId)) return activeId;
|
|
6755
7418
|
if (value && flatVisible.some((f) => f.id === value)) return value;
|
|
6756
7419
|
return flatVisible[0]?.id ?? null;
|
|
6757
7420
|
}, [activeId, flatVisible, value]);
|
|
6758
|
-
const listRef = (0,
|
|
6759
|
-
const setRefs = (0,
|
|
7421
|
+
const listRef = (0, import_react88.useRef)(null);
|
|
7422
|
+
const setRefs = (0, import_react88.useCallback)(
|
|
6760
7423
|
(node) => {
|
|
6761
7424
|
listRef.current = node;
|
|
6762
7425
|
if (typeof ref === "function") ref(node);
|
|
@@ -6764,20 +7427,20 @@ var Tree = (0, import_react87.forwardRef)(function Tree2({
|
|
|
6764
7427
|
},
|
|
6765
7428
|
[ref]
|
|
6766
7429
|
);
|
|
6767
|
-
const focusItem = (0,
|
|
7430
|
+
const focusItem = (0, import_react88.useCallback)((id) => {
|
|
6768
7431
|
const root = listRef.current;
|
|
6769
7432
|
if (!root) return;
|
|
6770
7433
|
const el = root.querySelector(`[data-treeitem-id="${CSS.escape(id)}"]`);
|
|
6771
7434
|
el?.focus();
|
|
6772
7435
|
}, []);
|
|
6773
|
-
const moveActive = (0,
|
|
7436
|
+
const moveActive = (0, import_react88.useCallback)(
|
|
6774
7437
|
(id) => {
|
|
6775
|
-
setActiveId(id);
|
|
6776
|
-
|
|
7438
|
+
(0, import_react_dom.flushSync)(() => setActiveId(id));
|
|
7439
|
+
focusItem(id);
|
|
6777
7440
|
},
|
|
6778
7441
|
[focusItem]
|
|
6779
7442
|
);
|
|
6780
|
-
const toggle = (0,
|
|
7443
|
+
const toggle = (0, import_react88.useCallback)(
|
|
6781
7444
|
(id) => {
|
|
6782
7445
|
setExpanded((prev) => {
|
|
6783
7446
|
const next = new Set(prev ?? EMPTY_SET2);
|
|
@@ -6788,7 +7451,7 @@ var Tree = (0, import_react87.forwardRef)(function Tree2({
|
|
|
6788
7451
|
},
|
|
6789
7452
|
[setExpanded]
|
|
6790
7453
|
);
|
|
6791
|
-
const expand = (0,
|
|
7454
|
+
const expand = (0, import_react88.useCallback)(
|
|
6792
7455
|
(id) => {
|
|
6793
7456
|
setExpanded((prev) => {
|
|
6794
7457
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -6800,7 +7463,7 @@ var Tree = (0, import_react87.forwardRef)(function Tree2({
|
|
|
6800
7463
|
},
|
|
6801
7464
|
[setExpanded]
|
|
6802
7465
|
);
|
|
6803
|
-
const collapse = (0,
|
|
7466
|
+
const collapse = (0, import_react88.useCallback)(
|
|
6804
7467
|
(id) => {
|
|
6805
7468
|
setExpanded((prev) => {
|
|
6806
7469
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -6812,13 +7475,13 @@ var Tree = (0, import_react87.forwardRef)(function Tree2({
|
|
|
6812
7475
|
},
|
|
6813
7476
|
[setExpanded]
|
|
6814
7477
|
);
|
|
6815
|
-
const selectItem = (0,
|
|
7478
|
+
const selectItem = (0, import_react88.useCallback)(
|
|
6816
7479
|
(id) => {
|
|
6817
7480
|
setValue(id);
|
|
6818
7481
|
},
|
|
6819
7482
|
[setValue]
|
|
6820
7483
|
);
|
|
6821
|
-
const handleKeyDown = (0,
|
|
7484
|
+
const handleKeyDown = (0, import_react88.useCallback)(
|
|
6822
7485
|
(e) => {
|
|
6823
7486
|
onKeyDown?.(e);
|
|
6824
7487
|
if (e.defaultPrevented) return;
|
|
@@ -6898,7 +7561,7 @@ var Tree = (0, import_react87.forwardRef)(function Tree2({
|
|
|
6898
7561
|
toggle
|
|
6899
7562
|
]
|
|
6900
7563
|
);
|
|
6901
|
-
return /* @__PURE__ */ (0,
|
|
7564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
6902
7565
|
"ul",
|
|
6903
7566
|
{
|
|
6904
7567
|
ref: setRefs,
|
|
@@ -6906,7 +7569,7 @@ var Tree = (0, import_react87.forwardRef)(function Tree2({
|
|
|
6906
7569
|
className: cn("flex flex-col gap-px text-[12px]", className),
|
|
6907
7570
|
onKeyDown: handleKeyDown,
|
|
6908
7571
|
...props,
|
|
6909
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
7572
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
6910
7573
|
TreeItemRow,
|
|
6911
7574
|
{
|
|
6912
7575
|
item,
|
|
@@ -6941,8 +7604,8 @@ function TreeItemRow({
|
|
|
6941
7604
|
const isExpanded = hasChildren && expanded.has(item.id);
|
|
6942
7605
|
const isSelected = selected === item.id;
|
|
6943
7606
|
const isTabStop = tabStopId === item.id;
|
|
6944
|
-
return /* @__PURE__ */ (0,
|
|
6945
|
-
/* @__PURE__ */ (0,
|
|
7607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("li", { role: "none", children: [
|
|
7608
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
6946
7609
|
"div",
|
|
6947
7610
|
{
|
|
6948
7611
|
role: "treeitem",
|
|
@@ -6965,14 +7628,14 @@ function TreeItemRow({
|
|
|
6965
7628
|
isSelected ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2"
|
|
6966
7629
|
),
|
|
6967
7630
|
children: [
|
|
6968
|
-
/* @__PURE__ */ (0,
|
|
6969
|
-
item.icon && /* @__PURE__ */ (0,
|
|
6970
|
-
/* @__PURE__ */ (0,
|
|
7631
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { "aria-hidden": true, className: "text-text-dim grid w-3 place-items-center text-[10px]", children: hasChildren ? isExpanded ? "\u25BE" : "\u25B8" : "" }),
|
|
7632
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { "aria-hidden": true, className: "text-[12px] opacity-80", children: item.icon }),
|
|
7633
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "flex-1 truncate", children: item.label }),
|
|
6971
7634
|
item.trailing
|
|
6972
7635
|
]
|
|
6973
7636
|
}
|
|
6974
7637
|
),
|
|
6975
|
-
hasChildren && isExpanded && /* @__PURE__ */ (0,
|
|
7638
|
+
hasChildren && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("ul", { role: "group", className: "flex flex-col gap-px", children: (item.children ?? []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
6976
7639
|
TreeItemRow,
|
|
6977
7640
|
{
|
|
6978
7641
|
item: child,
|
|
@@ -6990,10 +7653,10 @@ function TreeItemRow({
|
|
|
6990
7653
|
}
|
|
6991
7654
|
|
|
6992
7655
|
// src/patterns/WizardDialog/WizardDialog.tsx
|
|
6993
|
-
var
|
|
6994
|
-
var
|
|
6995
|
-
var
|
|
6996
|
-
var WizardDialog = (0,
|
|
7656
|
+
var RadixDialog7 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
7657
|
+
var import_react89 = require("react");
|
|
7658
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
7659
|
+
var WizardDialog = (0, import_react89.forwardRef)(function WizardDialog2({
|
|
6997
7660
|
open,
|
|
6998
7661
|
defaultOpen,
|
|
6999
7662
|
onOpenChange,
|
|
@@ -7009,19 +7672,19 @@ var WizardDialog = (0, import_react88.forwardRef)(function WizardDialog2({
|
|
|
7009
7672
|
cancelLabel,
|
|
7010
7673
|
onCancel
|
|
7011
7674
|
}, ref) {
|
|
7012
|
-
const [current, setCurrent] = (0,
|
|
7675
|
+
const [current, setCurrent] = (0, import_react89.useState)(initialStep);
|
|
7013
7676
|
const total = steps.length;
|
|
7014
7677
|
const safeCurrent = Math.min(current, Math.max(0, total - 1));
|
|
7015
7678
|
const step = steps[safeCurrent];
|
|
7016
|
-
const goTo = (0,
|
|
7679
|
+
const goTo = (0, import_react89.useCallback)(
|
|
7017
7680
|
(index) => {
|
|
7018
7681
|
setCurrent(Math.min(Math.max(0, index), Math.max(0, total - 1)));
|
|
7019
7682
|
},
|
|
7020
7683
|
[total]
|
|
7021
7684
|
);
|
|
7022
|
-
const goNext = (0,
|
|
7023
|
-
const goBack = (0,
|
|
7024
|
-
const ctx = (0,
|
|
7685
|
+
const goNext = (0, import_react89.useCallback)(() => setCurrent((c) => Math.min(c + 1, total - 1)), [total]);
|
|
7686
|
+
const goBack = (0, import_react89.useCallback)(() => setCurrent((c) => Math.max(c - 1, 0)), []);
|
|
7687
|
+
const ctx = (0, import_react89.useMemo)(
|
|
7025
7688
|
() => ({
|
|
7026
7689
|
current: safeCurrent,
|
|
7027
7690
|
total,
|
|
@@ -7033,7 +7696,7 @@ var WizardDialog = (0, import_react88.forwardRef)(function WizardDialog2({
|
|
|
7033
7696
|
}),
|
|
7034
7697
|
[safeCurrent, total, goNext, goBack, goTo]
|
|
7035
7698
|
);
|
|
7036
|
-
const stepperSteps = (0,
|
|
7699
|
+
const stepperSteps = (0, import_react89.useMemo)(() => steps.map((s) => ({ id: s.id, label: s.label })), [steps]);
|
|
7037
7700
|
if (!step) return null;
|
|
7038
7701
|
const canAdvance = step.canAdvance ? step.canAdvance(ctx) : true;
|
|
7039
7702
|
const body = typeof step.content === "function" ? step.content(ctx) : step.content;
|
|
@@ -7044,23 +7707,36 @@ var WizardDialog = (0, import_react88.forwardRef)(function WizardDialog2({
|
|
|
7044
7707
|
goNext();
|
|
7045
7708
|
}
|
|
7046
7709
|
};
|
|
7047
|
-
return /* @__PURE__ */ (0,
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(DialogRoot, { open, defaultOpen, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
7711
|
+
DialogContent,
|
|
7712
|
+
{
|
|
7713
|
+
ref,
|
|
7714
|
+
width,
|
|
7715
|
+
...description ? {} : { "aria-describedby": void 0 },
|
|
7716
|
+
children: [
|
|
7717
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(WizardTitle, { children: title }) : (
|
|
7718
|
+
// Radix Dialog requires a Title for assistive tech and warns in dev
|
|
7719
|
+
// mode without one. Fall back to a visually-hidden generic title so
|
|
7720
|
+
// the contract is met even when no title prop is supplied.
|
|
7721
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(RadixDialog7.Title, { className: "sr-only", children: "Wizard" })
|
|
7722
|
+
),
|
|
7723
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(WizardDescription, { children: description }),
|
|
7724
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Stepper, { steps: stepperSteps, current: safeCurrent }) }),
|
|
7725
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "mb-5", children: body }),
|
|
7726
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
7727
|
+
cancelLabel && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { type: "button", variant: "ghost", onClick: onCancel, children: cancelLabel }),
|
|
7728
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { type: "button", variant: "secondary", onClick: goBack, disabled: ctx.isFirst, children: backLabel }),
|
|
7729
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button, { type: "button", variant: "primary", onClick: handlePrimary, disabled: !canAdvance, children: ctx.isLast ? completeLabel : nextLabel })
|
|
7730
|
+
] })
|
|
7731
|
+
]
|
|
7732
|
+
}
|
|
7733
|
+
) });
|
|
7058
7734
|
});
|
|
7059
7735
|
function WizardTitle({ children }) {
|
|
7060
|
-
return /* @__PURE__ */ (0,
|
|
7736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(RadixDialog7.Title, { className: "mb-2 text-[16px] font-medium", children });
|
|
7061
7737
|
}
|
|
7062
7738
|
function WizardDescription({ children }) {
|
|
7063
|
-
return /* @__PURE__ */ (0,
|
|
7739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(RadixDialog7.Description, { className: "text-text-muted mb-4 text-[13px] leading-[1.55]", children });
|
|
7064
7740
|
}
|
|
7065
7741
|
WizardDialog.displayName = "WizardDialog";
|
|
7066
7742
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -7138,6 +7814,7 @@ WizardDialog.displayName = "WizardDialog";
|
|
|
7138
7814
|
LargeTitle,
|
|
7139
7815
|
Lightbox,
|
|
7140
7816
|
ListingCard,
|
|
7817
|
+
ListingDetail,
|
|
7141
7818
|
MenuCheckboxItem,
|
|
7142
7819
|
MenuItem,
|
|
7143
7820
|
MenuSeparator,
|