@shware/workflow-ui 2.0.1 → 2.0.3
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.mjs +56 -56
- package/dist/index.mjs.map +1 -1
- package/dist/postgres.mjs +4 -4
- package/dist/postgres.mjs.map +1 -1
- package/package.json +2 -2
- package/src/app/integrations/toast/toast-provider.tsx +2 -2
- package/src/app/routes/__root.tsx +9 -9
- package/src/app/routes/emails.tsx +2 -2
- package/src/app/routes/home.tsx +4 -4
- package/src/app/routes/metrics.tsx +19 -19
- package/src/app/routes/segment-overview.tsx +21 -21
- package/src/app/routes/segments.tsx +2 -2
- package/src/app/routes/settings.tsx +6 -6
- package/src/app/routes/workflows.tsx +5 -5
- package/src/components/avatar.tsx +1 -1
- package/src/components/breadcrumb.tsx +3 -3
- package/src/components/button/index.tsx +4 -4
- package/src/components/chat-markup.tsx +6 -6
- package/src/components/date-range.tsx +6 -6
- package/src/components/dropdown/index.tsx +8 -8
- package/src/components/email-defaults.tsx +3 -3
- package/src/components/email-list.tsx +6 -6
- package/src/components/flag.tsx +7 -4
- package/src/components/input/index.tsx +2 -2
- package/src/components/input/search-input.tsx +1 -1
- package/src/components/menu/index.tsx +2 -2
- package/src/components/metric-card.tsx +7 -7
- package/src/components/modal/index.tsx +2 -2
- package/src/components/nav-drawer.tsx +3 -3
- package/src/components/node-inspector.tsx +5 -5
- package/src/components/profile-drawer.tsx +8 -8
- package/src/components/segment-list.tsx +9 -9
- package/src/components/select/index.tsx +3 -3
- package/src/components/tabs/index.tsx +2 -2
- package/src/components/templates-page.tsx +23 -23
- package/src/components/textarea/index.tsx +2 -2
- package/src/components/thumbnail-window.tsx +1 -1
- package/src/components/workflow-list.tsx +8 -8
- package/src/postgres.ts +4 -2
package/dist/index.mjs
CHANGED
|
@@ -58,12 +58,12 @@ const SIZE_STYLE$2 = {
|
|
|
58
58
|
xl: "h-14 px-8 text-lg rounded-2xl focus-visible:ring-4"
|
|
59
59
|
};
|
|
60
60
|
const VARIANT_STYLE = {
|
|
61
|
-
text: clsx("
|
|
62
|
-
accent: clsx("bg-accent active:bg-accent/80
|
|
61
|
+
text: clsx("border-none bg-transparent text-primary", "hover:bg-gray-100 focus-visible:ring-black/10 active:bg-gray-200/80", "dark:hover:bg-gray-800 dark:focus-visible:ring-white/20 dark:active:bg-gray-700/80"),
|
|
62
|
+
accent: clsx("bg-accent text-white active:bg-accent/80", "focus-visible:ring-accent/40 dark:focus-visible:ring-accent/50"),
|
|
63
63
|
default: clsx("border-none bg-black text-white focus-visible:ring-black/20 dark:bg-white dark:text-black", "active:bg-black/80 dark:focus-visible:ring-white/30 dark:active:bg-white/80"),
|
|
64
|
-
secondary: clsx("
|
|
64
|
+
secondary: clsx("bg-gray-100 text-primary focus-visible:ring-black/10 active:bg-gray-200/80", "dark:bg-gray-800 dark:focus-visible:ring-white/20 dark:active:bg-gray-700/80"),
|
|
65
65
|
destructive: clsx("text-white focus-visible:ring-red-400/40", "bg-red-400 active:bg-red-500/90", "dark:bg-red-400/70 dark:active:bg-red-400/90"),
|
|
66
|
-
outline: clsx("text-primary
|
|
66
|
+
outline: clsx("border text-primary", "bg-white focus-visible:ring-black/10 active:bg-gray-100/70", "dark:bg-gray-900/70 dark:focus-visible:ring-white/30 dark:active:bg-gray-900")
|
|
67
67
|
};
|
|
68
68
|
function Button({ children, className, size = "md", style, type = "button", variant = "default", ...props }) {
|
|
69
69
|
return /* @__PURE__ */ jsx("button", {
|
|
@@ -805,11 +805,11 @@ const RULES = {
|
|
|
805
805
|
discord: [
|
|
806
806
|
{
|
|
807
807
|
pattern: /`([^`]+)`/,
|
|
808
|
-
render: (m, key) => code(m[1]
|
|
808
|
+
render: (m, key) => code(m[1], key)
|
|
809
809
|
},
|
|
810
810
|
{
|
|
811
811
|
pattern: /\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/,
|
|
812
|
-
render: (m, key, linkClass) => link(m[2]
|
|
812
|
+
render: (m, key, linkClass) => link(m[2], m[1], key, linkClass)
|
|
813
813
|
},
|
|
814
814
|
{
|
|
815
815
|
pattern: /\*\*([^*]+)\*\*/,
|
|
@@ -825,21 +825,21 @@ const RULES = {
|
|
|
825
825
|
},
|
|
826
826
|
{
|
|
827
827
|
pattern: /\*([^*]+)\*|(?<!\w)_([^_]+)_(?!\w)/,
|
|
828
|
-
render: (m, key) => /* @__PURE__ */ jsx("em", { children: m
|
|
828
|
+
render: (m, key) => /* @__PURE__ */ jsx("em", { children: m.at(1) ?? m.at(2) }, key)
|
|
829
829
|
},
|
|
830
830
|
{
|
|
831
831
|
pattern: /(https?:\/\/[^\s<]+)/,
|
|
832
|
-
render: (m, key, linkClass) => link(m[1]
|
|
832
|
+
render: (m, key, linkClass) => link(m[1], m[1], key, linkClass)
|
|
833
833
|
}
|
|
834
834
|
],
|
|
835
835
|
slack: [
|
|
836
836
|
{
|
|
837
837
|
pattern: /`([^`]+)`/,
|
|
838
|
-
render: (m, key) => code(m[1]
|
|
838
|
+
render: (m, key) => code(m[1], key)
|
|
839
839
|
},
|
|
840
840
|
{
|
|
841
841
|
pattern: /<((?:https?:\/\/|mailto:|tel:)[^|>]+)(?:\|([^>]+))?>/,
|
|
842
|
-
render: (m, key, linkClass) => link(m[1]
|
|
842
|
+
render: (m, key, linkClass) => link(m[1], m.at(2) ?? m[1], key, linkClass)
|
|
843
843
|
},
|
|
844
844
|
{
|
|
845
845
|
pattern: /(?<!\w)\*([^*]+)\*(?!\w)/,
|
|
@@ -1620,7 +1620,7 @@ const SIZE_STYLE$1 = {
|
|
|
1620
1620
|
function Textarea({ size = "md", className, ...props }) {
|
|
1621
1621
|
return /* @__PURE__ */ jsx("textarea", {
|
|
1622
1622
|
...props,
|
|
1623
|
-
className: cn("transition-colors duration-100 focus:outline-none", "
|
|
1623
|
+
className: cn("transition-colors duration-100 focus:outline-none", "border bg-textfield placeholder-placeholder focus-visible:border-accent", "focus-visible:ring-accent/40 dark:focus-visible:ring-accent/50", SIZE_STYLE$1[size], className)
|
|
1624
1624
|
});
|
|
1625
1625
|
}
|
|
1626
1626
|
//#endregion
|
|
@@ -1633,10 +1633,10 @@ function Textarea({ size = "md", className, ...props }) {
|
|
|
1633
1633
|
*/
|
|
1634
1634
|
function Field({ label, children }) {
|
|
1635
1635
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1636
|
-
className: "text-muted
|
|
1636
|
+
className: "whitespace-nowrap text-muted",
|
|
1637
1637
|
children: label
|
|
1638
1638
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1639
|
-
className: "
|
|
1639
|
+
className: "min-w-0 break-words text-secondary",
|
|
1640
1640
|
children
|
|
1641
1641
|
})] });
|
|
1642
1642
|
}
|
|
@@ -1670,13 +1670,13 @@ function PreviewPropsEditor({ initial, onChange, onInvalid, onReset }) {
|
|
|
1670
1670
|
const [draft, setDraft] = useState(void 0);
|
|
1671
1671
|
const text = draft ?? JSON.stringify(initial, null, 2);
|
|
1672
1672
|
return /* @__PURE__ */ jsxs("div", {
|
|
1673
|
-
className: "border-border bg-card
|
|
1673
|
+
className: "border-b border-border bg-card px-6 py-4",
|
|
1674
1674
|
children: [
|
|
1675
1675
|
/* @__PURE__ */ jsxs("div", {
|
|
1676
1676
|
className: "flex items-center justify-between",
|
|
1677
1677
|
children: [/* @__PURE__ */ jsx("label", {
|
|
1678
1678
|
htmlFor: "preview-props",
|
|
1679
|
-
className: "text-
|
|
1679
|
+
className: "text-sm text-muted",
|
|
1680
1680
|
children: t("emails.previewProps")
|
|
1681
1681
|
}), /* @__PURE__ */ jsx("button", {
|
|
1682
1682
|
type: "button",
|
|
@@ -1684,7 +1684,7 @@ function PreviewPropsEditor({ initial, onChange, onInvalid, onReset }) {
|
|
|
1684
1684
|
setDraft(void 0);
|
|
1685
1685
|
onReset();
|
|
1686
1686
|
},
|
|
1687
|
-
className: "text-muted hover:text-primary
|
|
1687
|
+
className: "text-xs text-muted transition-colors hover:text-primary",
|
|
1688
1688
|
children: t("emails.previewPropsReset")
|
|
1689
1689
|
})]
|
|
1690
1690
|
}),
|
|
@@ -1713,7 +1713,7 @@ function PreviewPropsEditor({ initial, onChange, onInvalid, onReset }) {
|
|
|
1713
1713
|
}
|
|
1714
1714
|
}),
|
|
1715
1715
|
/* @__PURE__ */ jsx("p", {
|
|
1716
|
-
className: "
|
|
1716
|
+
className: "mt-1.5 text-xs text-muted",
|
|
1717
1717
|
children: t("emails.previewPropsHint")
|
|
1718
1718
|
})
|
|
1719
1719
|
]
|
|
@@ -1773,13 +1773,13 @@ function TemplatesPage({ refs, emails, pushes = {}, discords = {}, slacks = {},
|
|
|
1773
1773
|
return /* @__PURE__ */ jsx("div", {
|
|
1774
1774
|
className: "flex flex-1",
|
|
1775
1775
|
children: /* @__PURE__ */ jsx("section", {
|
|
1776
|
-
className: "
|
|
1776
|
+
className: "flex min-w-0 flex-1 flex-col bg-page",
|
|
1777
1777
|
children: active === void 0 ? /* @__PURE__ */ jsx("div", {
|
|
1778
|
-
className: "
|
|
1778
|
+
className: "flex flex-1 items-center justify-center text-sm text-muted",
|
|
1779
1779
|
children: selected === void 0 ? t("emails.empty") : t("emails.notFound", { key: selected })
|
|
1780
1780
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1781
1781
|
(isEmail && activeEmail !== void 0 || push !== void 0) && /* @__PURE__ */ jsx("div", {
|
|
1782
|
-
className: "border-border bg-card
|
|
1782
|
+
className: "border-b border-border bg-card px-6 py-4",
|
|
1783
1783
|
children: /* @__PURE__ */ jsxs("dl", {
|
|
1784
1784
|
className: "grid grid-cols-[max-content_1fr] gap-x-8 gap-y-2.5 text-sm",
|
|
1785
1785
|
children: [isEmail && activeEmail !== void 0 && resolved !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1840,13 +1840,13 @@ function TemplatesPage({ refs, emails, pushes = {}, discords = {}, slacks = {},
|
|
|
1840
1840
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1841
1841
|
className: "flex-1 p-6 pb-4",
|
|
1842
1842
|
children: isChat ? (isDiscord ? activeDiscord : activeSlack) === void 0 ? /* @__PURE__ */ jsxs("div", {
|
|
1843
|
-
className: "
|
|
1843
|
+
className: "mx-auto max-w-xl rounded-2xl border border-dashed border-border bg-card p-8 text-center",
|
|
1844
1844
|
style: superellipse,
|
|
1845
1845
|
children: [/* @__PURE__ */ jsx("p", {
|
|
1846
|
-
className: "text-
|
|
1846
|
+
className: "text-sm font-medium text-primary",
|
|
1847
1847
|
children: t("emails.notRegistered")
|
|
1848
1848
|
}), /* @__PURE__ */ jsx("p", {
|
|
1849
|
-
className: "
|
|
1849
|
+
className: "mt-2 text-sm text-muted",
|
|
1850
1850
|
children: t("emails.chatNotRegisteredHint", {
|
|
1851
1851
|
key: active.key,
|
|
1852
1852
|
channel: isDiscord ? "discord" : "slack"
|
|
@@ -1863,13 +1863,13 @@ function TemplatesPage({ refs, emails, pushes = {}, discords = {}, slacks = {},
|
|
|
1863
1863
|
scheme,
|
|
1864
1864
|
zoom
|
|
1865
1865
|
}) : null : isPush ? activePush === void 0 ? /* @__PURE__ */ jsxs("div", {
|
|
1866
|
-
className: "
|
|
1866
|
+
className: "mx-auto max-w-xl rounded-2xl border border-dashed border-border bg-card p-8 text-center",
|
|
1867
1867
|
style: superellipse,
|
|
1868
1868
|
children: [/* @__PURE__ */ jsx("p", {
|
|
1869
|
-
className: "text-
|
|
1869
|
+
className: "text-sm font-medium text-primary",
|
|
1870
1870
|
children: t("emails.notRegistered")
|
|
1871
1871
|
}), /* @__PURE__ */ jsx("p", {
|
|
1872
|
-
className: "
|
|
1872
|
+
className: "mt-2 text-sm text-muted",
|
|
1873
1873
|
children: t("emails.pushNotRegisteredHint", { key: active.key })
|
|
1874
1874
|
})]
|
|
1875
1875
|
}) : pushFailure !== void 0 ? /* @__PURE__ */ jsx(TemplateFailurePanel, { failure: pushFailure }) : /* @__PURE__ */ jsx(PushPreview, {
|
|
@@ -1879,17 +1879,17 @@ function TemplatesPage({ refs, emails, pushes = {}, discords = {}, slacks = {},
|
|
|
1879
1879
|
scheme,
|
|
1880
1880
|
zoom
|
|
1881
1881
|
}) : activeEmail === void 0 ? /* @__PURE__ */ jsxs("div", {
|
|
1882
|
-
className: "
|
|
1882
|
+
className: "mx-auto max-w-xl rounded-2xl border border-dashed border-border bg-card p-8 text-center",
|
|
1883
1883
|
style: superellipse,
|
|
1884
1884
|
children: [/* @__PURE__ */ jsx("p", {
|
|
1885
|
-
className: "text-
|
|
1885
|
+
className: "text-sm font-medium text-primary",
|
|
1886
1886
|
children: t("emails.notRegistered")
|
|
1887
1887
|
}), /* @__PURE__ */ jsx("p", {
|
|
1888
|
-
className: "
|
|
1888
|
+
className: "mt-2 text-sm text-muted",
|
|
1889
1889
|
children: t("emails.notRegisteredHint", { key: active.key })
|
|
1890
1890
|
})]
|
|
1891
1891
|
}) : failure !== void 0 ? /* @__PURE__ */ jsx(TemplateFailurePanel, { failure }) : loading ? /* @__PURE__ */ jsx("div", {
|
|
1892
|
-
className: "text-
|
|
1892
|
+
className: "text-center text-sm text-muted",
|
|
1893
1893
|
children: t("emails.rendering")
|
|
1894
1894
|
}) : error !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
1895
1895
|
className: "mx-auto max-w-xl rounded-2xl border border-red-200 bg-red-50 p-6 text-sm text-red-700 dark:border-red-400/20 dark:bg-red-400/10 dark:text-red-300",
|
|
@@ -1918,7 +1918,7 @@ function TemplatesPage({ refs, emails, pushes = {}, discords = {}, slacks = {},
|
|
|
1918
1918
|
}), (isChat ? chatReady : isPush ? push !== void 0 : activeEmail !== void 0 && !loading && error === void 0 && failure === void 0) && /* @__PURE__ */ jsx("div", {
|
|
1919
1919
|
className: "pointer-events-none sticky bottom-0 z-10 flex justify-center pt-2 pb-4",
|
|
1920
1920
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1921
|
-
className: "
|
|
1921
|
+
className: "pointer-events-auto flex items-center gap-0.5 rounded-full border border-border bg-card p-1 shadow-lg",
|
|
1922
1922
|
children: [
|
|
1923
1923
|
/* @__PURE__ */ jsx(ToolButton, {
|
|
1924
1924
|
active: scheme === "light",
|
|
@@ -1941,7 +1941,7 @@ function TemplatesPage({ refs, emails, pushes = {}, discords = {}, slacks = {},
|
|
|
1941
1941
|
})
|
|
1942
1942
|
}),
|
|
1943
1943
|
isEmail && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1944
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
1944
|
+
/* @__PURE__ */ jsx("div", { className: "mx-1 h-4 w-px bg-border" }),
|
|
1945
1945
|
/* @__PURE__ */ jsx(ToolButton, {
|
|
1946
1946
|
active: device === "desktop",
|
|
1947
1947
|
label: t("emails.previewDesktop"),
|
|
@@ -1963,7 +1963,7 @@ function TemplatesPage({ refs, emails, pushes = {}, discords = {}, slacks = {},
|
|
|
1963
1963
|
})
|
|
1964
1964
|
})
|
|
1965
1965
|
] }),
|
|
1966
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
1966
|
+
/* @__PURE__ */ jsx("div", { className: "mx-1 h-4 w-px bg-border" }),
|
|
1967
1967
|
/* @__PURE__ */ jsx(ToolButton, {
|
|
1968
1968
|
label: t("emails.zoomOut"),
|
|
1969
1969
|
onClick: () => setZoom((level) => Math.max(.5, level - .25)),
|
|
@@ -1977,7 +1977,7 @@ function TemplatesPage({ refs, emails, pushes = {}, discords = {}, slacks = {},
|
|
|
1977
1977
|
type: "button",
|
|
1978
1978
|
title: t("emails.zoomReset"),
|
|
1979
1979
|
onClick: () => setZoom(1),
|
|
1980
|
-
className: "
|
|
1980
|
+
className: "w-11 text-center text-xs font-medium text-secondary tabular-nums transition-colors hover:text-primary",
|
|
1981
1981
|
children: [Math.round(zoom * 100), "%"]
|
|
1982
1982
|
}),
|
|
1983
1983
|
/* @__PURE__ */ jsx(ToolButton, {
|
|
@@ -2085,14 +2085,14 @@ function WorkflowList({ items, reports, onOpen }) {
|
|
|
2085
2085
|
const { t } = useTranslation();
|
|
2086
2086
|
const byId = new Map((reports ?? []).map((report) => [report.id, report]));
|
|
2087
2087
|
return /* @__PURE__ */ jsx("div", {
|
|
2088
|
-
className: "border-border bg-card
|
|
2088
|
+
className: "rounded-2xl border border-border bg-card",
|
|
2089
2089
|
style: superellipse,
|
|
2090
2090
|
children: /* @__PURE__ */ jsxs("table", {
|
|
2091
2091
|
className: "w-full table-fixed border-separate border-spacing-0 text-sm max-md:block",
|
|
2092
2092
|
children: [/* @__PURE__ */ jsx("thead", {
|
|
2093
2093
|
className: "max-md:hidden",
|
|
2094
2094
|
children: /* @__PURE__ */ jsxs("tr", {
|
|
2095
|
-
className: "text-
|
|
2095
|
+
className: "text-left text-xs font-medium text-muted",
|
|
2096
2096
|
children: [
|
|
2097
2097
|
/* @__PURE__ */ jsx("th", {
|
|
2098
2098
|
className: clsx(HEAD_CELL, "min-w-0 px-6"),
|
|
@@ -2123,7 +2123,7 @@ function WorkflowList({ items, reports, onOpen }) {
|
|
|
2123
2123
|
};
|
|
2124
2124
|
return /* @__PURE__ */ jsxs("tr", {
|
|
2125
2125
|
onClick: () => onOpen(key),
|
|
2126
|
-
className: clsx("cursor-pointer align-top [&>td]:transition-colors", "md:
|
|
2126
|
+
className: clsx("cursor-pointer align-top [&>td]:transition-colors", "md:last:[&>td]:border-b-0 md:hover:[&>td]:bg-hover", "md:last:[&>td:first-child]:rounded-bl-2xl md:last:[&>td:last-child]:rounded-br-2xl", "border-border max-md:grid max-md:grid-cols-6 max-md:hover:bg-hover", "max-md:border-b max-md:px-3 max-md:first:rounded-t-2xl", "max-md:last:rounded-b-2xl max-md:last:border-b-0"),
|
|
2127
2127
|
style: superellipse,
|
|
2128
2128
|
children: [
|
|
2129
2129
|
/* @__PURE__ */ jsx("td", {
|
|
@@ -2132,7 +2132,7 @@ function WorkflowList({ items, reports, onOpen }) {
|
|
|
2132
2132
|
children: /* @__PURE__ */ jsxs("div", {
|
|
2133
2133
|
className: "flex items-start gap-3",
|
|
2134
2134
|
children: [/* @__PURE__ */ jsx(Workflow, {
|
|
2135
|
-
className: "
|
|
2135
|
+
className: "mt-0.5 size-4 shrink-0 text-muted",
|
|
2136
2136
|
strokeWidth: 2
|
|
2137
2137
|
}), /* @__PURE__ */ jsxs("div", {
|
|
2138
2138
|
className: "min-w-0",
|
|
@@ -2142,11 +2142,11 @@ function WorkflowList({ items, reports, onOpen }) {
|
|
|
2142
2142
|
children: displayName(ir.meta?.name, t("common.untitled"))
|
|
2143
2143
|
}),
|
|
2144
2144
|
ir.meta?.description !== void 0 && /* @__PURE__ */ jsx("p", {
|
|
2145
|
-
className: "
|
|
2145
|
+
className: "mt-1 truncate text-sm text-muted max-md:-ml-7",
|
|
2146
2146
|
children: ir.meta.description
|
|
2147
2147
|
}),
|
|
2148
2148
|
/* @__PURE__ */ jsxs("div", {
|
|
2149
|
-
className: "
|
|
2149
|
+
className: "mt-2 flex items-center gap-3 text-xs text-muted max-md:-ml-7",
|
|
2150
2150
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
2151
2151
|
className: "flex items-center gap-1",
|
|
2152
2152
|
children: [/* @__PURE__ */ jsx(Mail, {
|
|
@@ -2178,7 +2178,7 @@ function WorkflowList({ items, reports, onOpen }) {
|
|
|
2178
2178
|
style: superellipse,
|
|
2179
2179
|
children: [
|
|
2180
2180
|
/* @__PURE__ */ jsx("div", {
|
|
2181
|
-
className: "
|
|
2181
|
+
className: "mb-1 truncate text-xs text-muted md:hidden",
|
|
2182
2182
|
children: t(`workflows.columns.${column}`)
|
|
2183
2183
|
}),
|
|
2184
2184
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -2286,7 +2286,7 @@ function MetricCard({ label, value, delta, dates, series, format }) {
|
|
|
2286
2286
|
setActive(Math.min(Math.max(index, 0), dates.length - 1));
|
|
2287
2287
|
};
|
|
2288
2288
|
return /* @__PURE__ */ jsxs("section", {
|
|
2289
|
-
className: "
|
|
2289
|
+
className: "flex flex-col overflow-hidden rounded-2xl border border-border bg-card",
|
|
2290
2290
|
style: superellipse,
|
|
2291
2291
|
children: [
|
|
2292
2292
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -2358,10 +2358,10 @@ function MetricCard({ label, value, delta, dates, series, format }) {
|
|
|
2358
2358
|
]
|
|
2359
2359
|
}),
|
|
2360
2360
|
all.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
2361
|
-
className: "
|
|
2361
|
+
className: "pointer-events-none absolute top-0 left-4 text-xs text-muted tabular-nums",
|
|
2362
2362
|
children: format(max)
|
|
2363
2363
|
}), /* @__PURE__ */ jsx("span", {
|
|
2364
|
-
className: "
|
|
2364
|
+
className: "pointer-events-none absolute right-4 bottom-1 text-xs text-muted tabular-nums",
|
|
2365
2365
|
children: format(min)
|
|
2366
2366
|
})] }),
|
|
2367
2367
|
hovered !== void 0 && /* @__PURE__ */ jsx(HoverReadout, {
|
|
@@ -2399,11 +2399,11 @@ function HoverReadout({ x, date, rows }) {
|
|
|
2399
2399
|
className: "pointer-events-none",
|
|
2400
2400
|
children: [
|
|
2401
2401
|
/* @__PURE__ */ jsx("div", {
|
|
2402
|
-
className: "
|
|
2402
|
+
className: "absolute inset-y-0 w-px bg-border",
|
|
2403
2403
|
style: { left }
|
|
2404
2404
|
}),
|
|
2405
2405
|
rows.map((row) => /* @__PURE__ */ jsx("div", {
|
|
2406
|
-
className: "
|
|
2406
|
+
className: "absolute size-2.5 rounded-full border-2 border-card",
|
|
2407
2407
|
style: {
|
|
2408
2408
|
left,
|
|
2409
2409
|
top: row.y,
|
|
@@ -2412,7 +2412,7 @@ function HoverReadout({ x, date, rows }) {
|
|
|
2412
2412
|
}
|
|
2413
2413
|
}, row.label)),
|
|
2414
2414
|
/* @__PURE__ */ jsxs("div", {
|
|
2415
|
-
className: "
|
|
2415
|
+
className: "absolute top-0 grid w-max items-center gap-x-3 gap-y-1 rounded-lg border border-border bg-card px-2.5 py-2 text-xs shadow-md shadow-card-shadow",
|
|
2416
2416
|
style: {
|
|
2417
2417
|
...superellipse,
|
|
2418
2418
|
left,
|
|
@@ -2431,7 +2431,7 @@ function HoverReadout({ x, date, rows }) {
|
|
|
2431
2431
|
}
|
|
2432
2432
|
}),
|
|
2433
2433
|
/* @__PURE__ */ jsx("span", {
|
|
2434
|
-
className: "text-secondary
|
|
2434
|
+
className: "whitespace-nowrap text-secondary",
|
|
2435
2435
|
children: row.label
|
|
2436
2436
|
}),
|
|
2437
2437
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -2457,7 +2457,7 @@ function Input({ size = "md", type = "text", htmlSize, className, ...props }) {
|
|
|
2457
2457
|
...props,
|
|
2458
2458
|
type,
|
|
2459
2459
|
size: htmlSize,
|
|
2460
|
-
className: cn("transition-colors duration-100 focus:outline-none", "
|
|
2460
|
+
className: cn("transition-colors duration-100 focus:outline-none", "border bg-textfield placeholder-placeholder focus-visible:border-accent", "focus-visible:ring-accent/40 dark:focus-visible:ring-accent/50", SIZE_STYLE[size], className)
|
|
2461
2461
|
});
|
|
2462
2462
|
}
|
|
2463
2463
|
//#endregion
|
|
@@ -2550,7 +2550,7 @@ function DateRangePicker({ value, onChange, className }) {
|
|
|
2550
2550
|
size: 16,
|
|
2551
2551
|
strokeWidth: 2,
|
|
2552
2552
|
"aria-hidden": true,
|
|
2553
|
-
className: "text-secondary
|
|
2553
|
+
className: "shrink-0 text-secondary"
|
|
2554
2554
|
}), /* @__PURE__ */ jsxs("span", {
|
|
2555
2555
|
className: "tabular-nums",
|
|
2556
2556
|
children: [
|
|
@@ -2568,11 +2568,11 @@ function DateRangePicker({ value, onChange, className }) {
|
|
|
2568
2568
|
...floatingStyles,
|
|
2569
2569
|
...superellipse
|
|
2570
2570
|
},
|
|
2571
|
-
className: "
|
|
2571
|
+
className: "z-50 w-64 rounded-xl border border-border bg-card p-2 shadow-lg shadow-card-shadow",
|
|
2572
2572
|
...getFloatingProps(),
|
|
2573
2573
|
children: [PRESETS.map((days) => /* @__PURE__ */ jsx("button", {
|
|
2574
2574
|
type: "button",
|
|
2575
|
-
className: "
|
|
2575
|
+
className: "block w-full rounded-lg px-2.5 py-1.5 text-left text-sm hover:bg-hover",
|
|
2576
2576
|
style: superellipse,
|
|
2577
2577
|
onClick: () => {
|
|
2578
2578
|
onChange(lastDays(days));
|
|
@@ -2580,11 +2580,11 @@ function DateRangePicker({ value, onChange, className }) {
|
|
|
2580
2580
|
},
|
|
2581
2581
|
children: t("metrics.range.lastDays", { count: days })
|
|
2582
2582
|
}, days)), /* @__PURE__ */ jsxs("div", {
|
|
2583
|
-
className: "
|
|
2583
|
+
className: "mt-2 space-y-2 border-t border-border pt-2",
|
|
2584
2584
|
children: [/* @__PURE__ */ jsxs("label", {
|
|
2585
2585
|
className: "block",
|
|
2586
2586
|
children: [/* @__PURE__ */ jsx("span", {
|
|
2587
|
-
className: "text-
|
|
2587
|
+
className: "text-xs text-muted",
|
|
2588
2588
|
children: t("metrics.range.from")
|
|
2589
2589
|
}), /* @__PURE__ */ jsx(Input, {
|
|
2590
2590
|
size: "sm",
|
|
@@ -2597,7 +2597,7 @@ function DateRangePicker({ value, onChange, className }) {
|
|
|
2597
2597
|
}), /* @__PURE__ */ jsxs("label", {
|
|
2598
2598
|
className: "block",
|
|
2599
2599
|
children: [/* @__PURE__ */ jsx("span", {
|
|
2600
|
-
className: "text-
|
|
2600
|
+
className: "text-xs text-muted",
|
|
2601
2601
|
children: t("metrics.range.to")
|
|
2602
2602
|
}), /* @__PURE__ */ jsx(Input, {
|
|
2603
2603
|
size: "sm",
|
|
@@ -2653,7 +2653,7 @@ function Avatar({ picture, label, size = "md" }) {
|
|
|
2653
2653
|
});
|
|
2654
2654
|
return /* @__PURE__ */ jsx("div", {
|
|
2655
2655
|
"aria-hidden": true,
|
|
2656
|
-
className: cn("
|
|
2656
|
+
className: cn("flex shrink-0 items-center justify-center rounded-full bg-selected font-medium text-secondary", SIZES[size]),
|
|
2657
2657
|
children: label.trim().charAt(0).toUpperCase()
|
|
2658
2658
|
});
|
|
2659
2659
|
}
|