@ship-it-ui/ui 0.0.8 → 0.0.9
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 +213 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -12
- package/dist/index.d.ts +38 -12
- package/dist/index.js +239 -89
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -343,11 +343,13 @@ function useOutsideClick(ref, handler, enabled = true) {
|
|
|
343
343
|
var import_react7 = require("react");
|
|
344
344
|
function useTheme() {
|
|
345
345
|
const [theme, setThemeState] = (0, import_react7.useState)("dark");
|
|
346
|
+
const internalMutation = (0, import_react7.useRef)(false);
|
|
346
347
|
const setTheme = (0, import_react7.useCallback)((next) => {
|
|
347
348
|
if (typeof document === "undefined") {
|
|
348
349
|
setThemeState(next);
|
|
349
350
|
return;
|
|
350
351
|
}
|
|
352
|
+
internalMutation.current = true;
|
|
351
353
|
if (next === "light") {
|
|
352
354
|
document.documentElement.setAttribute("data-theme", "light");
|
|
353
355
|
} else {
|
|
@@ -362,6 +364,10 @@ function useTheme() {
|
|
|
362
364
|
const initial = document.documentElement.getAttribute("data-theme");
|
|
363
365
|
setThemeState(initial === "light" ? "light" : "dark");
|
|
364
366
|
const observer = new MutationObserver(() => {
|
|
367
|
+
if (internalMutation.current) {
|
|
368
|
+
internalMutation.current = false;
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
365
371
|
const attr = document.documentElement.getAttribute("data-theme");
|
|
366
372
|
setThemeState(attr === "light" ? "light" : "dark");
|
|
367
373
|
});
|
|
@@ -1741,6 +1747,53 @@ AccordionContent.displayName = "AccordionContent";
|
|
|
1741
1747
|
var RadixAvatar = __toESM(require("@radix-ui/react-avatar"), 1);
|
|
1742
1748
|
var import_react28 = require("react");
|
|
1743
1749
|
|
|
1750
|
+
// src/utils/color-override.ts
|
|
1751
|
+
var HEX = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
1752
|
+
var FUNCTIONAL = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix)\([^()]*(?:\([^()]*\)[^()]*)*\)$/;
|
|
1753
|
+
var KEYWORDS = /* @__PURE__ */ new Set([
|
|
1754
|
+
"transparent",
|
|
1755
|
+
"currentColor",
|
|
1756
|
+
"currentcolor",
|
|
1757
|
+
"inherit",
|
|
1758
|
+
"initial",
|
|
1759
|
+
"unset",
|
|
1760
|
+
"red",
|
|
1761
|
+
"green",
|
|
1762
|
+
"blue",
|
|
1763
|
+
"black",
|
|
1764
|
+
"white",
|
|
1765
|
+
"gray",
|
|
1766
|
+
"grey",
|
|
1767
|
+
"orange",
|
|
1768
|
+
"yellow",
|
|
1769
|
+
"purple",
|
|
1770
|
+
"pink",
|
|
1771
|
+
"brown",
|
|
1772
|
+
"cyan",
|
|
1773
|
+
"magenta"
|
|
1774
|
+
]);
|
|
1775
|
+
var isValid = (value) => {
|
|
1776
|
+
const v = value.trim();
|
|
1777
|
+
if (!v) return false;
|
|
1778
|
+
if (typeof CSS !== "undefined" && typeof CSS.supports === "function") {
|
|
1779
|
+
return CSS.supports("color", v);
|
|
1780
|
+
}
|
|
1781
|
+
return HEX.test(v) || FUNCTIONAL.test(v) || KEYWORDS.has(v);
|
|
1782
|
+
};
|
|
1783
|
+
var warnIfInvalidColor = (value, component) => {
|
|
1784
|
+
if (isValid(value)) return true;
|
|
1785
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1786
|
+
console.warn(
|
|
1787
|
+
`[${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.`
|
|
1788
|
+
);
|
|
1789
|
+
}
|
|
1790
|
+
return false;
|
|
1791
|
+
};
|
|
1792
|
+
var tintStyle = (color) => ({
|
|
1793
|
+
background: `color-mix(in oklab, ${color}, transparent 85%)`,
|
|
1794
|
+
color
|
|
1795
|
+
});
|
|
1796
|
+
|
|
1744
1797
|
// src/components/StatusDot/StatusDot.tsx
|
|
1745
1798
|
var import_react27 = require("react");
|
|
1746
1799
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -1768,13 +1821,14 @@ var stateLabel = {
|
|
|
1768
1821
|
sync: "Syncing",
|
|
1769
1822
|
accent: "Active"
|
|
1770
1823
|
};
|
|
1771
|
-
var StatusDot = (0, import_react27.forwardRef)(function StatusDot2({ state = "ok", label, pulse, size = 8, className, ...props }, ref) {
|
|
1824
|
+
var StatusDot = (0, import_react27.forwardRef)(function StatusDot2({ state = "ok", color, label, pulse, size = 8, className, ...props }, ref) {
|
|
1825
|
+
const useColor = color && warnIfInvalidColor(color, "StatusDot");
|
|
1772
1826
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1773
1827
|
"span",
|
|
1774
1828
|
{
|
|
1775
1829
|
ref,
|
|
1776
1830
|
role: label ? "status" : "img",
|
|
1777
|
-
"aria-label": !label ? stateLabel[state] : void 0,
|
|
1831
|
+
"aria-label": !label ? useColor ? "Status" : stateLabel[state] : void 0,
|
|
1778
1832
|
className: cn("inline-flex items-center gap-[6px]", className),
|
|
1779
1833
|
...props,
|
|
1780
1834
|
children: [
|
|
@@ -1783,11 +1837,15 @@ var StatusDot = (0, import_react27.forwardRef)(function StatusDot2({ state = "ok
|
|
|
1783
1837
|
{
|
|
1784
1838
|
className: cn(
|
|
1785
1839
|
"inline-block rounded-full",
|
|
1786
|
-
stateColor[state],
|
|
1787
|
-
|
|
1788
|
-
|
|
1840
|
+
!useColor && stateColor[state],
|
|
1841
|
+
!useColor && stateText[state],
|
|
1842
|
+
pulse && "animate-[ship-pulse-ring_1.6s_infinite]"
|
|
1789
1843
|
),
|
|
1790
|
-
style: {
|
|
1844
|
+
style: {
|
|
1845
|
+
width: size,
|
|
1846
|
+
height: size,
|
|
1847
|
+
...useColor ? { backgroundColor: color, color } : {}
|
|
1848
|
+
}
|
|
1791
1849
|
}
|
|
1792
1850
|
),
|
|
1793
1851
|
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-text-muted text-[12px]", children: label })
|
|
@@ -1822,10 +1880,12 @@ function hashHue(str) {
|
|
|
1822
1880
|
for (let i = 0; i < str.length; i++) h = (h * 31 + str.charCodeAt(i)) % 360;
|
|
1823
1881
|
return h;
|
|
1824
1882
|
}
|
|
1825
|
-
var Avatar = (0, import_react28.forwardRef)(function Avatar2({ name = "?", src, size = "md", status, initials, className, style, ...props }, ref) {
|
|
1883
|
+
var Avatar = (0, import_react28.forwardRef)(function Avatar2({ name = "?", src, size = "md", status, initials, color, className, style, ...props }, ref) {
|
|
1826
1884
|
const dim = sizePx[size];
|
|
1827
1885
|
const hue = hashHue(name);
|
|
1828
1886
|
const computedInitials = initials ?? initialsFor(name);
|
|
1887
|
+
const useColor = color && warnIfInvalidColor(color, "Avatar");
|
|
1888
|
+
const fallbackBg = useColor ? color : `oklch(var(--color-avatar-fallback-l) var(--color-avatar-fallback-c) ${hue})`;
|
|
1829
1889
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1830
1890
|
"span",
|
|
1831
1891
|
{
|
|
@@ -1839,7 +1899,7 @@ var Avatar = (0, import_react28.forwardRef)(function Avatar2({ name = "?", src,
|
|
|
1839
1899
|
{
|
|
1840
1900
|
className: "border-border relative inline-flex h-full w-full shrink-0 overflow-hidden rounded-full border",
|
|
1841
1901
|
style: {
|
|
1842
|
-
background: src ? void 0 :
|
|
1902
|
+
background: src ? void 0 : fallbackBg
|
|
1843
1903
|
},
|
|
1844
1904
|
children: [
|
|
1845
1905
|
src && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(RadixAvatar.Image, { src, alt: name, className: "h-full w-full object-cover" }),
|
|
@@ -1907,6 +1967,16 @@ AvatarGroup.displayName = "AvatarGroup";
|
|
|
1907
1967
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
1908
1968
|
var import_react30 = require("react");
|
|
1909
1969
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1970
|
+
var badgeStructural = (0, import_class_variance_authority6.cva)("inline-flex items-center font-sans leading-none whitespace-nowrap", {
|
|
1971
|
+
variants: {
|
|
1972
|
+
size: {
|
|
1973
|
+
sm: "h-[18px] px-[6px] py-[1px] text-[10px] gap-1 rounded-full",
|
|
1974
|
+
md: "h-[22px] px-2 py-[2px] text-[11px] gap-[5px] rounded-full",
|
|
1975
|
+
lg: "h-[26px] px-[10px] py-[3px] text-[12px] gap-[6px] rounded-full"
|
|
1976
|
+
}
|
|
1977
|
+
},
|
|
1978
|
+
defaultVariants: { size: "md" }
|
|
1979
|
+
});
|
|
1910
1980
|
var badgeStyles = (0, import_class_variance_authority6.cva)("inline-flex items-center font-sans leading-none whitespace-nowrap", {
|
|
1911
1981
|
variants: {
|
|
1912
1982
|
variant: {
|
|
@@ -1940,20 +2010,53 @@ var dotColorClass = {
|
|
|
1940
2010
|
solid: "bg-bg"
|
|
1941
2011
|
};
|
|
1942
2012
|
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) {
|
|
2013
|
+
var Badge = (0, import_react30.forwardRef)(function Badge2({ variant = "neutral", size = "md", dot, icon, className, children, color, style, ...props }, ref) {
|
|
1944
2014
|
const sz = size ?? "md";
|
|
1945
|
-
const
|
|
1946
|
-
|
|
1947
|
-
|
|
2015
|
+
const useColor = color && warnIfInvalidColor(color, "Badge");
|
|
2016
|
+
if (useColor) {
|
|
2017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1948
2018
|
"span",
|
|
1949
2019
|
{
|
|
1950
|
-
|
|
1951
|
-
className: cn(
|
|
2020
|
+
ref,
|
|
2021
|
+
className: cn(badgeStructural({ size }), className),
|
|
2022
|
+
style: { ...tintStyle(color), ...style },
|
|
2023
|
+
...props,
|
|
2024
|
+
children: [
|
|
2025
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2026
|
+
"span",
|
|
2027
|
+
{
|
|
2028
|
+
"aria-hidden": true,
|
|
2029
|
+
className: cn("inline-block rounded-full", dotSize[sz]),
|
|
2030
|
+
style: { background: color }
|
|
2031
|
+
}
|
|
2032
|
+
),
|
|
2033
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "inline-flex leading-none", children: icon }),
|
|
2034
|
+
children
|
|
2035
|
+
]
|
|
1952
2036
|
}
|
|
1953
|
-
)
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
2037
|
+
);
|
|
2038
|
+
}
|
|
2039
|
+
const v = variant ?? "neutral";
|
|
2040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2041
|
+
"span",
|
|
2042
|
+
{
|
|
2043
|
+
ref,
|
|
2044
|
+
className: cn(badgeStyles({ variant, size }), className),
|
|
2045
|
+
style,
|
|
2046
|
+
...props,
|
|
2047
|
+
children: [
|
|
2048
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2049
|
+
"span",
|
|
2050
|
+
{
|
|
2051
|
+
"aria-hidden": true,
|
|
2052
|
+
className: cn("inline-block rounded-full", dotSize[sz], dotColorClass[v])
|
|
2053
|
+
}
|
|
2054
|
+
),
|
|
2055
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "inline-flex leading-none", children: icon }),
|
|
2056
|
+
children
|
|
2057
|
+
]
|
|
2058
|
+
}
|
|
2059
|
+
);
|
|
1957
2060
|
});
|
|
1958
2061
|
Badge.displayName = "Badge";
|
|
1959
2062
|
|
|
@@ -2101,18 +2204,23 @@ StatCard.displayName = "StatCard";
|
|
|
2101
2204
|
// src/components/Chip/Chip.tsx
|
|
2102
2205
|
var import_react33 = require("react");
|
|
2103
2206
|
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) {
|
|
2207
|
+
var Chip = (0, import_react33.forwardRef)(function Chip2({ icon, onRemove, density = "comfortable", color, className, children, style, ...props }, ref) {
|
|
2105
2208
|
const isTouch = density === "touch";
|
|
2209
|
+
const useColor = color && warnIfInvalidColor(color, "Chip");
|
|
2210
|
+
const structural = cn(
|
|
2211
|
+
"inline-flex items-center gap-[6px] font-sans rounded-full border",
|
|
2212
|
+
isTouch ? "text-m-mono h-8 py-[5px] pr-[6px] pl-3" : "h-[26px] py-[4px] pr-1 pl-[10px] text-[12px]"
|
|
2213
|
+
);
|
|
2214
|
+
const defaultPaint = "bg-panel-2 text-text border-border";
|
|
2106
2215
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2107
2216
|
"span",
|
|
2108
2217
|
{
|
|
2109
2218
|
ref,
|
|
2110
|
-
className: cn(
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
),
|
|
2219
|
+
className: cn(structural, !useColor && defaultPaint, className),
|
|
2220
|
+
style: {
|
|
2221
|
+
...useColor ? { ...tintStyle(color), borderColor: "transparent" } : {},
|
|
2222
|
+
...style
|
|
2223
|
+
},
|
|
2116
2224
|
...props,
|
|
2117
2225
|
children: [
|
|
2118
2226
|
icon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: cn("text-text-dim inline-flex", isTouch ? "text-[12px]" : "text-[10px]"), children: icon }),
|
|
@@ -2176,8 +2284,10 @@ var Rating = (0, import_react35.forwardRef)(function Rating2({
|
|
|
2176
2284
|
readOnly = false,
|
|
2177
2285
|
className,
|
|
2178
2286
|
"aria-label": ariaLabel,
|
|
2287
|
+
color,
|
|
2179
2288
|
...props
|
|
2180
2289
|
}, ref) {
|
|
2290
|
+
const useColor = color && warnIfInvalidColor(color, "Rating");
|
|
2181
2291
|
const [current, setCurrent] = useControllableState({
|
|
2182
2292
|
value,
|
|
2183
2293
|
defaultValue: defaultValue ?? 0,
|
|
@@ -2231,10 +2341,19 @@ var Rating = (0, import_react35.forwardRef)(function Rating2({
|
|
|
2231
2341
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2232
2342
|
"div",
|
|
2233
2343
|
{
|
|
2344
|
+
"data-filled-stars": true,
|
|
2234
2345
|
className: "pointer-events-none absolute inset-0 inline-flex items-center gap-0.5 overflow-hidden",
|
|
2235
|
-
style: { width: `${fillPct}
|
|
2346
|
+
style: { width: `${fillPct}%`, ...useColor ? { color } : {} },
|
|
2236
2347
|
"aria-hidden": true,
|
|
2237
|
-
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2348
|
+
children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2349
|
+
import_icons4.IconGlyph,
|
|
2350
|
+
{
|
|
2351
|
+
name: "star",
|
|
2352
|
+
size: px,
|
|
2353
|
+
className: cn("shrink-0", !useColor && "text-rating")
|
|
2354
|
+
},
|
|
2355
|
+
i
|
|
2356
|
+
))
|
|
2238
2357
|
}
|
|
2239
2358
|
)
|
|
2240
2359
|
]
|
|
@@ -2249,6 +2368,7 @@ var Rating = (0, import_react35.forwardRef)(function Rating2({
|
|
|
2249
2368
|
"aria-label": ariaLabel ?? "Rating",
|
|
2250
2369
|
tabIndex: -1,
|
|
2251
2370
|
className: cn("inline-flex items-center gap-0.5", className),
|
|
2371
|
+
style: useColor ? { color } : void 0,
|
|
2252
2372
|
onKeyDown: handleKey,
|
|
2253
2373
|
...props,
|
|
2254
2374
|
children: Array.from({ length: max }).map((_, i) => {
|
|
@@ -2272,8 +2392,8 @@ var Rating = (0, import_react35.forwardRef)(function Rating2({
|
|
|
2272
2392
|
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm",
|
|
2273
2393
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]",
|
|
2274
2394
|
"transition-colors duration-(--duration-micro)",
|
|
2275
|
-
filled ? "text-rating" : "text-rating-dim",
|
|
2276
|
-
"hover:text-rating"
|
|
2395
|
+
useColor ? filled ? "" : "opacity-30" : filled ? "text-rating" : "text-rating-dim",
|
|
2396
|
+
!useColor && "hover:text-rating"
|
|
2277
2397
|
),
|
|
2278
2398
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_icons4.IconGlyph, { name: "star", size: px })
|
|
2279
2399
|
},
|
|
@@ -2399,17 +2519,20 @@ SkeletonGroup.displayName = "SkeletonGroup";
|
|
|
2399
2519
|
// src/components/Tag/Tag.tsx
|
|
2400
2520
|
var import_react38 = require("react");
|
|
2401
2521
|
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) {
|
|
2522
|
+
var Tag = (0, import_react38.forwardRef)(function Tag2({ onRemove, icon, size = 22, color, className, children, style, ...props }, ref) {
|
|
2523
|
+
const useColor = color && warnIfInvalidColor(color, "Tag");
|
|
2524
|
+
const structural = "inline-flex items-center gap-[6px] px-2 py-[3px] font-sans text-[11px] rounded-xs border";
|
|
2525
|
+
const defaultPaint = "bg-panel-2 text-text border-border";
|
|
2403
2526
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2404
2527
|
"span",
|
|
2405
2528
|
{
|
|
2406
2529
|
ref,
|
|
2407
|
-
className: cn(
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2530
|
+
className: cn(structural, !useColor && defaultPaint, className),
|
|
2531
|
+
style: {
|
|
2532
|
+
height: size,
|
|
2533
|
+
...useColor ? { ...tintStyle(color), borderColor: "transparent" } : {},
|
|
2534
|
+
...style
|
|
2535
|
+
},
|
|
2413
2536
|
...props,
|
|
2414
2537
|
children: [
|
|
2415
2538
|
icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-text-dim inline-flex", children: icon }),
|
|
@@ -2538,18 +2661,25 @@ var DialogContent = (0, import_react40.forwardRef)(function DialogContent2({ cla
|
|
|
2538
2661
|
});
|
|
2539
2662
|
DialogContent.displayName = "DialogContent";
|
|
2540
2663
|
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
|
-
|
|
2664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DialogRoot, { ...rootProps, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2665
|
+
DialogContent,
|
|
2666
|
+
{
|
|
2667
|
+
width,
|
|
2668
|
+
...description ? {} : { "aria-describedby": void 0 },
|
|
2669
|
+
children: [
|
|
2670
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2671
|
+
RadixDialog.Title,
|
|
2672
|
+
{
|
|
2673
|
+
className: cn("text-[16px] font-medium", description ? "mb-[6px]" : "mb-4"),
|
|
2674
|
+
children: title
|
|
2675
|
+
}
|
|
2676
|
+
),
|
|
2677
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RadixDialog.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }),
|
|
2678
|
+
children,
|
|
2679
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
2680
|
+
]
|
|
2681
|
+
}
|
|
2682
|
+
) });
|
|
2553
2683
|
}
|
|
2554
2684
|
|
|
2555
2685
|
// src/components/Dialog/Drawer.tsx
|
|
@@ -2667,7 +2797,13 @@ var AlertDialog = (0, import_react43.forwardRef)(function AlertDialog2({ title,
|
|
|
2667
2797
|
children: title
|
|
2668
2798
|
}
|
|
2669
2799
|
),
|
|
2670
|
-
description
|
|
2800
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixAlert.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }) : (
|
|
2801
|
+
// Radix AlertDialog requires a description for screen-reader users
|
|
2802
|
+
// and warns in dev mode when one is missing. When the caller opts
|
|
2803
|
+
// out of a visible description, fall back to the title text in a
|
|
2804
|
+
// visually-hidden Description so the a11y contract is still met.
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(RadixAlert.Description, { className: "sr-only", children: title })
|
|
2806
|
+
),
|
|
2671
2807
|
children,
|
|
2672
2808
|
footer && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
2673
2809
|
]
|
|
@@ -3682,7 +3818,7 @@ function DataTable(props) {
|
|
|
3682
3818
|
return next;
|
|
3683
3819
|
});
|
|
3684
3820
|
};
|
|
3685
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("table", { ref, className: cn("w-full border-collapse text-[12px]", className), children: [
|
|
3821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("table", { ref, className: cn("relative w-full border-collapse text-[12px]", className), children: [
|
|
3686
3822
|
caption && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("caption", { className: "sr-only", children: caption }),
|
|
3687
3823
|
/* @__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
3824
|
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)(
|
|
@@ -6705,6 +6841,7 @@ Topbar.displayName = "Topbar";
|
|
|
6705
6841
|
|
|
6706
6842
|
// src/patterns/Tree/Tree.tsx
|
|
6707
6843
|
var import_react87 = require("react");
|
|
6844
|
+
var import_react_dom = require("react-dom");
|
|
6708
6845
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
6709
6846
|
var EMPTY_SET2 = /* @__PURE__ */ new Set();
|
|
6710
6847
|
function flattenVisible(items, expanded, level, parentId, out) {
|
|
@@ -6772,8 +6909,8 @@ var Tree = (0, import_react87.forwardRef)(function Tree2({
|
|
|
6772
6909
|
}, []);
|
|
6773
6910
|
const moveActive = (0, import_react87.useCallback)(
|
|
6774
6911
|
(id) => {
|
|
6775
|
-
setActiveId(id);
|
|
6776
|
-
|
|
6912
|
+
(0, import_react_dom.flushSync)(() => setActiveId(id));
|
|
6913
|
+
focusItem(id);
|
|
6777
6914
|
},
|
|
6778
6915
|
[focusItem]
|
|
6779
6916
|
);
|
|
@@ -7044,17 +7181,30 @@ var WizardDialog = (0, import_react88.forwardRef)(function WizardDialog2({
|
|
|
7044
7181
|
goNext();
|
|
7045
7182
|
}
|
|
7046
7183
|
};
|
|
7047
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(DialogRoot, { open, defaultOpen, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(DialogRoot, { open, defaultOpen, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
7185
|
+
DialogContent,
|
|
7186
|
+
{
|
|
7187
|
+
ref,
|
|
7188
|
+
width,
|
|
7189
|
+
...description ? {} : { "aria-describedby": void 0 },
|
|
7190
|
+
children: [
|
|
7191
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WizardTitle, { children: title }) : (
|
|
7192
|
+
// Radix Dialog requires a Title for assistive tech and warns in dev
|
|
7193
|
+
// mode without one. Fall back to a visually-hidden generic title so
|
|
7194
|
+
// the contract is met even when no title prop is supplied.
|
|
7195
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(RadixDialog6.Title, { className: "sr-only", children: "Wizard" })
|
|
7196
|
+
),
|
|
7197
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WizardDescription, { children: description }),
|
|
7198
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "mb-5", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Stepper, { steps: stepperSteps, current: safeCurrent }) }),
|
|
7199
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "mb-5", children: body }),
|
|
7200
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex justify-end gap-2", children: [
|
|
7201
|
+
cancelLabel && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Button, { type: "button", variant: "ghost", onClick: onCancel, children: cancelLabel }),
|
|
7202
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Button, { type: "button", variant: "secondary", onClick: goBack, disabled: ctx.isFirst, children: backLabel }),
|
|
7203
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Button, { type: "button", variant: "primary", onClick: handlePrimary, disabled: !canAdvance, children: ctx.isLast ? completeLabel : nextLabel })
|
|
7204
|
+
] })
|
|
7205
|
+
]
|
|
7206
|
+
}
|
|
7207
|
+
) });
|
|
7058
7208
|
});
|
|
7059
7209
|
function WizardTitle({ children }) {
|
|
7060
7210
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(RadixDialog6.Title, { className: "mb-2 text-[16px] font-medium", children });
|