@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
|
@@ -53,7 +53,7 @@ function WorkflowsIndex() {
|
|
|
53
53
|
|
|
54
54
|
if (items.length === 0) {
|
|
55
55
|
return (
|
|
56
|
-
<div className="
|
|
56
|
+
<div className="flex flex-1 items-center justify-center text-sm text-muted">
|
|
57
57
|
{t('workflows.empty')}
|
|
58
58
|
</div>
|
|
59
59
|
);
|
|
@@ -78,7 +78,7 @@ function WorkflowsIndex() {
|
|
|
78
78
|
</div>
|
|
79
79
|
<div className="px-6 pb-6">
|
|
80
80
|
{filtered.length === 0 ? (
|
|
81
|
-
<div className="
|
|
81
|
+
<div className="flex items-center justify-center py-24 text-sm text-muted">
|
|
82
82
|
{t('workflows.noMatches', { query: query.trim() })}
|
|
83
83
|
</div>
|
|
84
84
|
) : (
|
|
@@ -129,7 +129,7 @@ function WorkflowDetail() {
|
|
|
129
129
|
|
|
130
130
|
if (ir === undefined) {
|
|
131
131
|
return (
|
|
132
|
-
<div className="
|
|
132
|
+
<div className="flex flex-1 flex-col items-center justify-center gap-3 text-sm text-muted">
|
|
133
133
|
<p>{t('workflows.notFound', { id })}</p>
|
|
134
134
|
<Link to="/workflows" className="text-primary underline">
|
|
135
135
|
{t('common.back')}
|
|
@@ -288,7 +288,7 @@ function CanvasTab() {
|
|
|
288
288
|
preview = (
|
|
289
289
|
<PushThumbnail
|
|
290
290
|
appName={config.title ?? 'App'}
|
|
291
|
-
title={push?.ok === true ?
|
|
291
|
+
title={push?.ok === true ? push.push.title : message.template}
|
|
292
292
|
body={push?.ok === true ? push.push.body : ''}
|
|
293
293
|
{...(push?.ok === false ? { error: formatIssues(push.failure) } : {})}
|
|
294
294
|
registered={pushModule !== undefined}
|
|
@@ -301,7 +301,7 @@ function CanvasTab() {
|
|
|
301
301
|
return (
|
|
302
302
|
/* The exception to the shell's one-scrollport rule: this pane is pinned to
|
|
303
303
|
the viewport rather than growing the page. */
|
|
304
|
-
<div className="
|
|
304
|
+
<div className="relative flex min-h-0 flex-1 flex-col border-t border-border">
|
|
305
305
|
{/*
|
|
306
306
|
Absolute rather than a flex child: the shell's main column is sized by
|
|
307
307
|
min-height, so its height is `auto` and the canvas's own `height: 100%`
|
|
@@ -47,7 +47,7 @@ export function Avatar({ picture, label, size = 'md' }: AvatarProps) {
|
|
|
47
47
|
<div
|
|
48
48
|
aria-hidden
|
|
49
49
|
className={cn(
|
|
50
|
-
'
|
|
50
|
+
'flex shrink-0 items-center justify-center rounded-full bg-selected font-medium text-secondary',
|
|
51
51
|
SIZES[size]
|
|
52
52
|
)}
|
|
53
53
|
>
|
|
@@ -23,20 +23,20 @@ export function Breadcrumb({ items }: { items: readonly Crumb[] }) {
|
|
|
23
23
|
return (
|
|
24
24
|
<Fragment key={index}>
|
|
25
25
|
{index > 0 && (
|
|
26
|
-
<ChevronRight className="
|
|
26
|
+
<ChevronRight className="size-3.5 shrink-0 text-muted" strokeWidth={2} aria-hidden />
|
|
27
27
|
)}
|
|
28
28
|
{item.to !== undefined && !last ? (
|
|
29
29
|
<Link
|
|
30
30
|
to={item.to as LinkProps['to']}
|
|
31
31
|
params={item.params as LinkProps['params']}
|
|
32
32
|
search={item.search as LinkProps['search']}
|
|
33
|
-
className="text-muted hover:text-primary
|
|
33
|
+
className="shrink-0 truncate text-muted transition-colors hover:text-primary"
|
|
34
34
|
>
|
|
35
35
|
{item.label}
|
|
36
36
|
</Link>
|
|
37
37
|
) : (
|
|
38
38
|
<span
|
|
39
|
-
className={last ? '
|
|
39
|
+
className={last ? 'min-w-0 truncate text-primary' : 'shrink-0 truncate text-muted'}
|
|
40
40
|
>
|
|
41
41
|
{item.label}
|
|
42
42
|
</span>
|
|
@@ -28,12 +28,12 @@ const SIZE_STYLE: Record<Size, string> = {
|
|
|
28
28
|
|
|
29
29
|
const VARIANT_STYLE = {
|
|
30
30
|
text: clsx(
|
|
31
|
-
'
|
|
31
|
+
'border-none bg-transparent text-primary',
|
|
32
32
|
'hover:bg-gray-100 focus-visible:ring-black/10 active:bg-gray-200/80',
|
|
33
33
|
'dark:hover:bg-gray-800 dark:focus-visible:ring-white/20 dark:active:bg-gray-700/80'
|
|
34
34
|
),
|
|
35
35
|
accent: clsx(
|
|
36
|
-
'bg-accent active:bg-accent/80
|
|
36
|
+
'bg-accent text-white active:bg-accent/80',
|
|
37
37
|
'focus-visible:ring-accent/40 dark:focus-visible:ring-accent/50'
|
|
38
38
|
),
|
|
39
39
|
default: clsx(
|
|
@@ -41,7 +41,7 @@ const VARIANT_STYLE = {
|
|
|
41
41
|
'active:bg-black/80 dark:focus-visible:ring-white/30 dark:active:bg-white/80'
|
|
42
42
|
),
|
|
43
43
|
secondary: clsx(
|
|
44
|
-
'
|
|
44
|
+
'bg-gray-100 text-primary focus-visible:ring-black/10 active:bg-gray-200/80',
|
|
45
45
|
'dark:bg-gray-800 dark:focus-visible:ring-white/20 dark:active:bg-gray-700/80'
|
|
46
46
|
),
|
|
47
47
|
destructive: clsx(
|
|
@@ -50,7 +50,7 @@ const VARIANT_STYLE = {
|
|
|
50
50
|
'dark:bg-red-400/70 dark:active:bg-red-400/90'
|
|
51
51
|
),
|
|
52
52
|
outline: clsx(
|
|
53
|
-
'text-primary
|
|
53
|
+
'border text-primary',
|
|
54
54
|
'bg-white focus-visible:ring-black/10 active:bg-gray-100/70',
|
|
55
55
|
'dark:bg-gray-900/70 dark:focus-visible:ring-white/30 dark:active:bg-gray-900'
|
|
56
56
|
),
|
|
@@ -31,28 +31,28 @@ const link = (href: string, text: string, key: string, className: string) => (
|
|
|
31
31
|
|
|
32
32
|
const RULES: Record<Dialect, Rule[]> = {
|
|
33
33
|
discord: [
|
|
34
|
-
{ pattern: /`([^`]+)`/, render: (m, key) => code(m[1]
|
|
34
|
+
{ pattern: /`([^`]+)`/, render: (m, key) => code(m[1], key) },
|
|
35
35
|
{
|
|
36
36
|
pattern: /\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/,
|
|
37
|
-
render: (m, key, linkClass) => link(m[2]
|
|
37
|
+
render: (m, key, linkClass) => link(m[2], m[1], key, linkClass),
|
|
38
38
|
},
|
|
39
39
|
{ pattern: /\*\*([^*]+)\*\*/, render: (m, key) => <strong key={key}>{m[1]}</strong> },
|
|
40
40
|
{ pattern: /(?<!\w)__([^_]+)__(?!\w)/, render: (m, key) => <u key={key}>{m[1]}</u> },
|
|
41
41
|
{ pattern: /~~([^~]+)~~/, render: (m, key) => <s key={key}>{m[1]}</s> },
|
|
42
42
|
{
|
|
43
43
|
pattern: /\*([^*]+)\*|(?<!\w)_([^_]+)_(?!\w)/,
|
|
44
|
-
render: (m, key) => <em key={key}>{m
|
|
44
|
+
render: (m, key) => <em key={key}>{m.at(1) ?? m.at(2)}</em>,
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
pattern: /(https?:\/\/[^\s<]+)/,
|
|
48
|
-
render: (m, key, linkClass) => link(m[1]
|
|
48
|
+
render: (m, key, linkClass) => link(m[1], m[1], key, linkClass),
|
|
49
49
|
},
|
|
50
50
|
],
|
|
51
51
|
slack: [
|
|
52
|
-
{ pattern: /`([^`]+)`/, render: (m, key) => code(m[1]
|
|
52
|
+
{ pattern: /`([^`]+)`/, render: (m, key) => code(m[1], key) },
|
|
53
53
|
{
|
|
54
54
|
pattern: /<((?:https?:\/\/|mailto:|tel:)[^|>]+)(?:\|([^>]+))?>/,
|
|
55
|
-
render: (m, key, linkClass) => link(m[1]
|
|
55
|
+
render: (m, key, linkClass) => link(m[1], m.at(2) ?? m[1], key, linkClass),
|
|
56
56
|
},
|
|
57
57
|
{ pattern: /(?<!\w)\*([^*]+)\*(?!\w)/, render: (m, key) => <strong key={key}>{m[1]}</strong> },
|
|
58
58
|
{ pattern: /(?<!\w)_([^_]+)_(?!\w)/, render: (m, key) => <em key={key}>{m[1]}</em> },
|
|
@@ -130,7 +130,7 @@ export function DateRangePicker({ value, onChange, className }: Props) {
|
|
|
130
130
|
className={cn('gap-2 font-normal', className)}
|
|
131
131
|
{...getReferenceProps()}
|
|
132
132
|
>
|
|
133
|
-
<Calendar size={16} strokeWidth={2} aria-hidden className="text-secondary
|
|
133
|
+
<Calendar size={16} strokeWidth={2} aria-hidden className="shrink-0 text-secondary" />
|
|
134
134
|
<span className="tabular-nums">
|
|
135
135
|
{formatDay(value.from, i18n.language)} – {formatDay(value.to, i18n.language)}
|
|
136
136
|
</span>
|
|
@@ -140,14 +140,14 @@ export function DateRangePicker({ value, onChange, className }: Props) {
|
|
|
140
140
|
<div
|
|
141
141
|
ref={setFloating}
|
|
142
142
|
style={{ ...floatingStyles, ...superellipse }}
|
|
143
|
-
className="
|
|
143
|
+
className="z-50 w-64 rounded-xl border border-border bg-card p-2 shadow-lg shadow-card-shadow"
|
|
144
144
|
{...getFloatingProps()}
|
|
145
145
|
>
|
|
146
146
|
{PRESETS.map((days) => (
|
|
147
147
|
<button
|
|
148
148
|
key={days}
|
|
149
149
|
type="button"
|
|
150
|
-
className="
|
|
150
|
+
className="block w-full rounded-lg px-2.5 py-1.5 text-left text-sm hover:bg-hover"
|
|
151
151
|
style={superellipse}
|
|
152
152
|
onClick={() => {
|
|
153
153
|
onChange(lastDays(days));
|
|
@@ -157,9 +157,9 @@ export function DateRangePicker({ value, onChange, className }: Props) {
|
|
|
157
157
|
{t('metrics.range.lastDays', { count: days })}
|
|
158
158
|
</button>
|
|
159
159
|
))}
|
|
160
|
-
<div className="
|
|
160
|
+
<div className="mt-2 space-y-2 border-t border-border pt-2">
|
|
161
161
|
<label className="block">
|
|
162
|
-
<span className="text-
|
|
162
|
+
<span className="text-xs text-muted">{t('metrics.range.from')}</span>
|
|
163
163
|
<Input
|
|
164
164
|
size="sm"
|
|
165
165
|
type="date"
|
|
@@ -170,7 +170,7 @@ export function DateRangePicker({ value, onChange, className }: Props) {
|
|
|
170
170
|
/>
|
|
171
171
|
</label>
|
|
172
172
|
<label className="block">
|
|
173
|
-
<span className="text-
|
|
173
|
+
<span className="text-xs text-muted">{t('metrics.range.to')}</span>
|
|
174
174
|
<Input
|
|
175
175
|
size="sm"
|
|
176
176
|
type="date"
|
|
@@ -104,12 +104,12 @@ export function Dropdown({ value, options, onChange, placeholder, className }: P
|
|
|
104
104
|
size={16}
|
|
105
105
|
strokeWidth={2}
|
|
106
106
|
aria-hidden
|
|
107
|
-
className="text-secondary
|
|
107
|
+
className="shrink-0 text-secondary"
|
|
108
108
|
/>
|
|
109
109
|
)}
|
|
110
110
|
<span className="truncate">{selected?.label ?? placeholder}</span>
|
|
111
111
|
</span>
|
|
112
|
-
<ChevronDown size={16} strokeWidth={2} aria-hidden className="text-secondary
|
|
112
|
+
<ChevronDown size={16} strokeWidth={2} aria-hidden className="shrink-0 text-secondary" />
|
|
113
113
|
</Button>
|
|
114
114
|
{open && (
|
|
115
115
|
<FloatingFocusManager context={context} modal={false}>
|
|
@@ -117,8 +117,8 @@ export function Dropdown({ value, options, onChange, placeholder, className }: P
|
|
|
117
117
|
ref={setFloating}
|
|
118
118
|
style={floatingStyles}
|
|
119
119
|
className={cn(
|
|
120
|
-
'
|
|
121
|
-
'shadow-card-shadow
|
|
120
|
+
'z-50 max-w-96 min-w-64 overflow-y-auto rounded-xl border border-border bg-card p-1',
|
|
121
|
+
'shadow-lg shadow-card-shadow'
|
|
122
122
|
)}
|
|
123
123
|
{...getFloatingProps()}
|
|
124
124
|
>
|
|
@@ -152,22 +152,22 @@ export function Dropdown({ value, options, onChange, placeholder, className }: P
|
|
|
152
152
|
size={16}
|
|
153
153
|
strokeWidth={2}
|
|
154
154
|
aria-hidden
|
|
155
|
-
className="text-secondary
|
|
155
|
+
className="shrink-0 text-secondary"
|
|
156
156
|
/>
|
|
157
157
|
)}
|
|
158
158
|
<span className="min-w-0 flex-1">
|
|
159
159
|
{/* One weight for every option: the accent check is what
|
|
160
160
|
marks the current value, and a bolder label on top of
|
|
161
161
|
it says the same thing twice. */}
|
|
162
|
-
<span className="
|
|
162
|
+
<span className="block truncate text-sm text-primary">{option.label}</span>
|
|
163
163
|
{option.description !== undefined && option.description !== '' && (
|
|
164
|
-
<span className="
|
|
164
|
+
<span className="block truncate text-xs text-muted">
|
|
165
165
|
{option.description}
|
|
166
166
|
</span>
|
|
167
167
|
)}
|
|
168
168
|
</span>
|
|
169
169
|
{isSelected && (
|
|
170
|
-
<Check size={16} strokeWidth={2} aria-hidden className="text-accent
|
|
170
|
+
<Check size={16} strokeWidth={2} aria-hidden className="shrink-0 text-accent" />
|
|
171
171
|
)}
|
|
172
172
|
</button>
|
|
173
173
|
);
|
|
@@ -28,16 +28,16 @@ export function EmailDefaults({ unsubscribeUrl, quickClickMs }: EmailDefaultsPro
|
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<section
|
|
31
|
-
className="
|
|
31
|
+
className="mt-4 max-w-xl rounded-2xl border border-border bg-card p-5"
|
|
32
32
|
style={superellipse}
|
|
33
33
|
>
|
|
34
34
|
<h2 className="text-sm font-medium">{t('settings.emailDefaults')}</h2>
|
|
35
|
-
<p className="
|
|
35
|
+
<p className="mt-1 text-xs text-muted">{t('settings.emailDefaultsHint')}</p>
|
|
36
36
|
<dl className="mt-3 grid grid-cols-[max-content_1fr] gap-x-8 gap-y-2 text-sm">
|
|
37
37
|
{rows.map((row) => (
|
|
38
38
|
<div key={row.label} className="contents">
|
|
39
39
|
<dt className="text-muted">{row.label}</dt>
|
|
40
|
-
<dd className="
|
|
40
|
+
<dd className="min-w-0 truncate text-secondary">
|
|
41
41
|
{row.value ?? t('common.notConfigured')}
|
|
42
42
|
</dd>
|
|
43
43
|
</div>
|
|
@@ -46,7 +46,7 @@ function RowIcon({ channel }: { channel: string | undefined }) {
|
|
|
46
46
|
: channel === 'slack'
|
|
47
47
|
? MessagesSquare
|
|
48
48
|
: Mail;
|
|
49
|
-
return <Icon className="
|
|
49
|
+
return <Icon className="mt-0.5 size-4 shrink-0 text-muted" strokeWidth={2} />;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export function EmailList({ items, onOpen }: EmailListProps) {
|
|
@@ -59,10 +59,10 @@ export function EmailList({ items, onOpen }: EmailListProps) {
|
|
|
59
59
|
* the page is the one scroller (see __root). Nothing clips, so the corners
|
|
60
60
|
* are re-cut on the first and last cells below.
|
|
61
61
|
*/
|
|
62
|
-
<div className="border-border bg-card
|
|
62
|
+
<div className="rounded-2xl border border-border bg-card" style={superellipse}>
|
|
63
63
|
<table className="w-full table-fixed border-separate border-spacing-0 text-sm max-md:block">
|
|
64
64
|
<thead className="max-md:hidden">
|
|
65
|
-
<tr className="text-
|
|
65
|
+
<tr className="text-left text-xs font-medium text-muted">
|
|
66
66
|
<th className={clsx(HEAD_CELL, 'min-w-0 px-6')} style={superellipse}>
|
|
67
67
|
{t('common.name')}
|
|
68
68
|
</th>
|
|
@@ -87,8 +87,8 @@ export function EmailList({ items, onOpen }: EmailListProps) {
|
|
|
87
87
|
own grid, so the fill and the radius live on it there. */
|
|
88
88
|
'max-md:grid max-md:grid-cols-6 max-md:border-b max-md:px-3',
|
|
89
89
|
'border-border max-md:first:rounded-t-2xl max-md:last:rounded-b-2xl',
|
|
90
|
-
'max-md:
|
|
91
|
-
'
|
|
90
|
+
'max-md:last:border-b-0 max-md:hover:bg-hover',
|
|
91
|
+
'last:[&>td]:border-b-0 md:hover:[&>td]:bg-hover',
|
|
92
92
|
'md:last:[&>td:first-child]:rounded-bl-2xl',
|
|
93
93
|
'md:last:[&>td:last-child]:rounded-br-2xl'
|
|
94
94
|
)}
|
|
@@ -110,7 +110,7 @@ export function EmailList({ items, onOpen }: EmailListProps) {
|
|
|
110
110
|
{displayName(item.name, t('common.untitled'))}
|
|
111
111
|
</div>
|
|
112
112
|
{item.description !== undefined && (
|
|
113
|
-
<p className="
|
|
113
|
+
<p className="mt-1 truncate text-sm text-muted">{item.description}</p>
|
|
114
114
|
)}
|
|
115
115
|
</div>
|
|
116
116
|
</div>
|
package/src/components/flag.tsx
CHANGED
|
@@ -7,10 +7,13 @@ import { type ComponentType, type SVGProps, useEffect, useState } from 'react';
|
|
|
7
7
|
* by the module system from then on. vite-only (glob + svgr) — this component
|
|
8
8
|
* is app-internal and deliberately not part of the library exports.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
type FlagComponent = ComponentType<SVGProps<SVGSVGElement>>;
|
|
11
|
+
|
|
12
|
+
const FLAGS: Partial<Record<string, () => Promise<FlagComponent>>> =
|
|
13
|
+
import.meta.glob<FlagComponent>('../app/assets/flags/*.svg', {
|
|
14
|
+
query: '?react',
|
|
15
|
+
import: 'default',
|
|
16
|
+
});
|
|
14
17
|
|
|
15
18
|
export interface FlagProps {
|
|
16
19
|
/** ISO 3166-1 alpha-2, case-insensitive. Unknown codes render nothing. */
|
|
@@ -30,8 +30,8 @@ export function Input({ size = 'md', type = 'text', htmlSize, className, ...prop
|
|
|
30
30
|
size={htmlSize}
|
|
31
31
|
className={cn(
|
|
32
32
|
'transition-colors duration-100 focus:outline-none',
|
|
33
|
-
'
|
|
34
|
-
'
|
|
33
|
+
'border bg-textfield placeholder-placeholder focus-visible:border-accent',
|
|
34
|
+
'focus-visible:ring-accent/40 dark:focus-visible:ring-accent/50',
|
|
35
35
|
SIZE_STYLE[size],
|
|
36
36
|
className
|
|
37
37
|
)}
|
|
@@ -16,7 +16,7 @@ export function SearchInput({ size = 'sm', className, ...props }: Props) {
|
|
|
16
16
|
size={16}
|
|
17
17
|
strokeWidth={2}
|
|
18
18
|
aria-hidden
|
|
19
|
-
className="
|
|
19
|
+
className="pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-muted"
|
|
20
20
|
/>
|
|
21
21
|
<Input {...props} size={size} type="search" className="w-full rounded-full pl-8" />
|
|
22
22
|
</div>
|
|
@@ -70,7 +70,7 @@ export function Menu({ items, className, ...aria }: Props) {
|
|
|
70
70
|
type="button"
|
|
71
71
|
ref={setReference}
|
|
72
72
|
className={cn(
|
|
73
|
-
'text-muted hover:bg-hover hover:text-primary
|
|
73
|
+
'flex size-8 items-center justify-center text-muted hover:bg-hover hover:text-primary',
|
|
74
74
|
'rounded-lg transition-colors focus:outline-none',
|
|
75
75
|
className
|
|
76
76
|
)}
|
|
@@ -89,7 +89,7 @@ export function Menu({ items, className, ...aria }: Props) {
|
|
|
89
89
|
<div
|
|
90
90
|
ref={setFloating}
|
|
91
91
|
style={floatingStyles}
|
|
92
|
-
className="
|
|
92
|
+
className="z-50 min-w-36 rounded-xl border border-border bg-card p-1 shadow-lg"
|
|
93
93
|
{...getFloatingProps()}
|
|
94
94
|
>
|
|
95
95
|
{items.map((item, index) => (
|
|
@@ -165,7 +165,7 @@ export function MetricCard({ label, value, delta, dates, series, format }: Metri
|
|
|
165
165
|
|
|
166
166
|
return (
|
|
167
167
|
<section
|
|
168
|
-
className="
|
|
168
|
+
className="flex flex-col overflow-hidden rounded-2xl border border-border bg-card"
|
|
169
169
|
style={superellipse}
|
|
170
170
|
>
|
|
171
171
|
<div className="px-4 pt-4">
|
|
@@ -224,10 +224,10 @@ export function MetricCard({ label, value, delta, dates, series, format }: Metri
|
|
|
224
224
|
</svg>
|
|
225
225
|
{all.length > 0 && (
|
|
226
226
|
<>
|
|
227
|
-
<span className="
|
|
227
|
+
<span className="pointer-events-none absolute top-0 left-4 text-xs text-muted tabular-nums">
|
|
228
228
|
{format(max)}
|
|
229
229
|
</span>
|
|
230
|
-
<span className="
|
|
230
|
+
<span className="pointer-events-none absolute right-4 bottom-1 text-xs text-muted tabular-nums">
|
|
231
231
|
{format(min)}
|
|
232
232
|
</span>
|
|
233
233
|
</>
|
|
@@ -275,11 +275,11 @@ function HoverReadout({ x, date, rows }: { x: number; date: string; rows: readon
|
|
|
275
275
|
const left = `${x * 100}%`;
|
|
276
276
|
return (
|
|
277
277
|
<div aria-hidden className="pointer-events-none">
|
|
278
|
-
<div className="
|
|
278
|
+
<div className="absolute inset-y-0 w-px bg-border" style={{ left }} />
|
|
279
279
|
{rows.map((row) => (
|
|
280
280
|
<div
|
|
281
281
|
key={row.label}
|
|
282
|
-
className="
|
|
282
|
+
className="absolute size-2.5 rounded-full border-2 border-card"
|
|
283
283
|
style={{ left, top: row.y, background: row.color, transform: 'translate(-50%, -50%)' }}
|
|
284
284
|
/>
|
|
285
285
|
))}
|
|
@@ -296,7 +296,7 @@ function HoverReadout({ x, date, rows }: { x: number; date: string; rows: readon
|
|
|
296
296
|
the label, which keeps the value flush right.
|
|
297
297
|
*/}
|
|
298
298
|
<div
|
|
299
|
-
className="
|
|
299
|
+
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"
|
|
300
300
|
style={{
|
|
301
301
|
...superellipse,
|
|
302
302
|
left,
|
|
@@ -311,7 +311,7 @@ function HoverReadout({ x, date, rows }: { x: number; date: string; rows: readon
|
|
|
311
311
|
className="size-3 rounded-sm"
|
|
312
312
|
style={{ ...superellipse, background: row.color }}
|
|
313
313
|
/>
|
|
314
|
-
<span className="text-secondary
|
|
314
|
+
<span className="whitespace-nowrap text-secondary">{row.label}</span>
|
|
315
315
|
<span className="text-right font-medium tabular-nums">{row.value}</span>
|
|
316
316
|
</Fragment>
|
|
317
317
|
))}
|
|
@@ -52,7 +52,7 @@ export function Modal({ visible = false, className, disabled = false, children,
|
|
|
52
52
|
ref={setFloating}
|
|
53
53
|
style={superellipse}
|
|
54
54
|
className={cn(
|
|
55
|
-
'
|
|
55
|
+
'relative max-h-dvh max-w-dvw overflow-y-auto rounded-3xl bg-card',
|
|
56
56
|
'shadow-lg dark:shadow-gray-700',
|
|
57
57
|
className
|
|
58
58
|
)}
|
|
@@ -67,5 +67,5 @@ export function Modal({ visible = false, className, disabled = false, children,
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export function ModalTitle({ children }: { children: ReactNode }) {
|
|
70
|
-
return <h2 className="text-
|
|
70
|
+
return <h2 className="text-lg font-semibold text-primary">{children}</h2>;
|
|
71
71
|
}
|
|
@@ -61,7 +61,7 @@ export function NavDrawer({ open, onClose, children }: NavDrawerProps) {
|
|
|
61
61
|
*/}
|
|
62
62
|
<aside
|
|
63
63
|
inert={!open}
|
|
64
|
-
className={`
|
|
64
|
+
className={`fixed inset-y-0 left-0 z-30 flex w-60 max-w-[80%] flex-col border-r border-border bg-card shadow-xl transition-transform duration-200 ease-out md:hidden ${
|
|
65
65
|
open ? 'translate-x-0' : '-translate-x-full'
|
|
66
66
|
}`}
|
|
67
67
|
>
|
|
@@ -69,10 +69,10 @@ export function NavDrawer({ open, onClose, children }: NavDrawerProps) {
|
|
|
69
69
|
lands the logo exactly where the header would have drawn it. */}
|
|
70
70
|
<div className="flex h-14 shrink-0 items-center gap-2.5 px-4">
|
|
71
71
|
<div
|
|
72
|
-
className="
|
|
72
|
+
className="flex size-7 shrink-0 items-center justify-center rounded-lg bg-primary"
|
|
73
73
|
style={superellipse}
|
|
74
74
|
>
|
|
75
|
-
<Workflow className="text-card
|
|
75
|
+
<Workflow className="size-4 text-card" strokeWidth={2} />
|
|
76
76
|
</div>
|
|
77
77
|
<strong className="text-sm font-semibold whitespace-nowrap">Workflow Studio</strong>
|
|
78
78
|
</div>
|
|
@@ -36,8 +36,8 @@ export interface NodeInspectorProps {
|
|
|
36
36
|
function Field({ label, children }: { label: string; children: ReactNode }) {
|
|
37
37
|
return (
|
|
38
38
|
<>
|
|
39
|
-
<dt className="text-muted
|
|
40
|
-
<dd className="
|
|
39
|
+
<dt className="whitespace-nowrap text-muted">{label}</dt>
|
|
40
|
+
<dd className="min-w-0 break-words text-secondary">{children}</dd>
|
|
41
41
|
</>
|
|
42
42
|
);
|
|
43
43
|
}
|
|
@@ -185,17 +185,17 @@ export function NodeInspector({ node, source, onClose, preview }: NodeInspectorP
|
|
|
185
185
|
|
|
186
186
|
return (
|
|
187
187
|
<aside
|
|
188
|
-
className="
|
|
188
|
+
className="flex max-h-full w-80 flex-col overflow-hidden rounded-2xl border border-border bg-card shadow-[0_4px_12px_var(--color-card-shadow)]"
|
|
189
189
|
style={superellipse}
|
|
190
190
|
>
|
|
191
191
|
<div className="flex h-12 shrink-0 items-center gap-3 pr-2.5 pl-4">
|
|
192
|
-
<span className="
|
|
192
|
+
<span className="flex-1 text-sm font-semibold text-primary">
|
|
193
193
|
{t(`inspector.type.${node.type}`)}
|
|
194
194
|
</span>
|
|
195
195
|
<button
|
|
196
196
|
type="button"
|
|
197
197
|
onClick={onClose}
|
|
198
|
-
className="
|
|
198
|
+
className="flex size-7 items-center justify-center rounded-lg text-muted transition-colors hover:bg-hover hover:text-primary"
|
|
199
199
|
style={superellipse}
|
|
200
200
|
aria-label={t('inspector.close')}
|
|
201
201
|
>
|
|
@@ -67,14 +67,14 @@ function Section({
|
|
|
67
67
|
}) {
|
|
68
68
|
/* Top border, inset by the drawer's padding — the divider stops short of the edges. */
|
|
69
69
|
return (
|
|
70
|
-
<section className="border-
|
|
70
|
+
<section className="border-t border-border py-4">
|
|
71
71
|
<button
|
|
72
72
|
type="button"
|
|
73
73
|
aria-expanded={open}
|
|
74
74
|
onClick={onToggle}
|
|
75
75
|
className="flex w-full items-center justify-between text-left"
|
|
76
76
|
>
|
|
77
|
-
<span className="text-
|
|
77
|
+
<span className="text-sm font-semibold text-primary">{title}</span>
|
|
78
78
|
<ChevronDown
|
|
79
79
|
size={16}
|
|
80
80
|
strokeWidth={2}
|
|
@@ -106,8 +106,8 @@ function Row({
|
|
|
106
106
|
}) {
|
|
107
107
|
return (
|
|
108
108
|
<>
|
|
109
|
-
<dt className="text-muted
|
|
110
|
-
<dd className="
|
|
109
|
+
<dt className="whitespace-nowrap text-muted">{label}</dt>
|
|
110
|
+
<dd className="flex min-w-0 items-center justify-end gap-1.5 text-secondary">
|
|
111
111
|
{leading}
|
|
112
112
|
<span className="min-w-0 truncate text-right" title={formatValue(value)}>
|
|
113
113
|
{formatValue(value)}
|
|
@@ -161,7 +161,7 @@ function CopyButton({ label, value }: { label: string; value: string }) {
|
|
|
161
161
|
onClick={() => {
|
|
162
162
|
void copyText(value).then(setCopied);
|
|
163
163
|
}}
|
|
164
|
-
className="
|
|
164
|
+
className="flex size-6 shrink-0 items-center justify-center rounded-md text-muted transition-colors hover:bg-hover hover:text-primary"
|
|
165
165
|
style={superellipse}
|
|
166
166
|
>
|
|
167
167
|
{copied ? (
|
|
@@ -228,7 +228,7 @@ export function ProfileDrawer({ profile, onClose }: ProfileDrawerProps) {
|
|
|
228
228
|
|
|
229
229
|
<aside
|
|
230
230
|
aria-hidden={!open}
|
|
231
|
-
className={`
|
|
231
|
+
className={`fixed inset-y-0 right-0 z-30 flex w-96 max-w-full flex-col border-l border-border bg-card shadow-xl transition-transform duration-200 ease-out ${
|
|
232
232
|
open ? 'translate-x-0' : 'translate-x-full'
|
|
233
233
|
}`}
|
|
234
234
|
>
|
|
@@ -244,7 +244,7 @@ export function ProfileDrawer({ profile, onClose }: ProfileDrawerProps) {
|
|
|
244
244
|
<div className="truncate text-sm font-semibold">
|
|
245
245
|
{name ?? email ?? profile?.id ?? ''}
|
|
246
246
|
</div>
|
|
247
|
-
<div className="text-
|
|
247
|
+
<div className="truncate text-xs text-muted">
|
|
248
248
|
{name !== undefined ? (email ?? profile?.id ?? '') : (profile?.id ?? '')}
|
|
249
249
|
</div>
|
|
250
250
|
</div>
|
|
@@ -252,7 +252,7 @@ export function ProfileDrawer({ profile, onClose }: ProfileDrawerProps) {
|
|
|
252
252
|
type="button"
|
|
253
253
|
onClick={onClose}
|
|
254
254
|
aria-label={t('common.close')}
|
|
255
|
-
className="
|
|
255
|
+
className="flex size-8 shrink-0 items-center justify-center rounded-lg text-muted transition-colors hover:bg-hover hover:text-primary"
|
|
256
256
|
style={superellipse}
|
|
257
257
|
>
|
|
258
258
|
<X className="size-4" strokeWidth={2} />
|
|
@@ -70,10 +70,10 @@ export function SegmentList({ items, reports, onOpen }: SegmentListProps) {
|
|
|
70
70
|
* the page is the one scroller (see __root). Nothing clips, so the corners
|
|
71
71
|
* are re-cut on the first and last cells below.
|
|
72
72
|
*/
|
|
73
|
-
<div className="border-border bg-card
|
|
73
|
+
<div className="rounded-2xl border border-border bg-card" style={superellipse}>
|
|
74
74
|
<table className="w-full table-fixed border-separate border-spacing-0 text-sm max-md:block">
|
|
75
75
|
<thead className="max-md:hidden">
|
|
76
|
-
<tr className="text-
|
|
76
|
+
<tr className="text-left text-xs font-medium text-muted">
|
|
77
77
|
<th className={clsx(HEAD_CELL, 'min-w-0 px-6')} style={superellipse}>
|
|
78
78
|
{t('common.name')}
|
|
79
79
|
</th>
|
|
@@ -112,7 +112,7 @@ export function SegmentList({ items, reports, onOpen }: SegmentListProps) {
|
|
|
112
112
|
'max-md:last:border-b-0',
|
|
113
113
|
'last:[&>td]:border-b-0 md:last:[&>td:first-child]:rounded-bl-2xl',
|
|
114
114
|
'md:last:[&>td:last-child]:rounded-br-2xl',
|
|
115
|
-
onOpen && 'max-md:hover:bg-hover md:hover:[&>td]:bg-hover
|
|
115
|
+
onOpen && 'cursor-pointer max-md:hover:bg-hover md:hover:[&>td]:bg-hover'
|
|
116
116
|
)}
|
|
117
117
|
style={superellipse}
|
|
118
118
|
>
|
|
@@ -121,7 +121,7 @@ export function SegmentList({ items, reports, onOpen }: SegmentListProps) {
|
|
|
121
121
|
style={superellipse}
|
|
122
122
|
>
|
|
123
123
|
<div className="flex items-start gap-3">
|
|
124
|
-
<Users className="
|
|
124
|
+
<Users className="mt-0.5 size-4 shrink-0 text-muted" strokeWidth={2} />
|
|
125
125
|
<div className="min-w-0">
|
|
126
126
|
<div className="flex items-center gap-2 font-medium">
|
|
127
127
|
{label !== '' ? (
|
|
@@ -139,9 +139,9 @@ export function SegmentList({ items, reports, onOpen }: SegmentListProps) {
|
|
|
139
139
|
)}
|
|
140
140
|
</div>
|
|
141
141
|
{item.description !== undefined && (
|
|
142
|
-
<p className="
|
|
142
|
+
<p className="mt-1 truncate text-sm text-secondary">{item.description}</p>
|
|
143
143
|
)}
|
|
144
|
-
<div className="
|
|
144
|
+
<div className="mt-2 truncate text-xs text-muted">
|
|
145
145
|
{item.usedBy.length === 0
|
|
146
146
|
? t('segments.unused')
|
|
147
147
|
: `${t('segments.usedBy')}: ${item.usedBy.join(', ')}`}
|
|
@@ -154,14 +154,14 @@ export function SegmentList({ items, reports, onOpen }: SegmentListProps) {
|
|
|
154
154
|
className={clsx(CELL, 'px-3 max-md:order-2 max-md:pt-0 max-md:pb-4')}
|
|
155
155
|
style={superellipse}
|
|
156
156
|
>
|
|
157
|
-
<div className="
|
|
157
|
+
<div className="mb-1 truncate text-xs text-muted md:hidden">
|
|
158
158
|
{t('segments.size')}
|
|
159
159
|
</div>
|
|
160
160
|
<div className="tabular-nums">
|
|
161
161
|
{report === undefined ? '—' : compact(report.size)}
|
|
162
162
|
</div>
|
|
163
163
|
{movement !== undefined && (
|
|
164
|
-
<div className="
|
|
164
|
+
<div className="mt-1 text-xs text-muted tabular-nums">{movement.text}</div>
|
|
165
165
|
)}
|
|
166
166
|
</td>
|
|
167
167
|
|
|
@@ -169,7 +169,7 @@ export function SegmentList({ items, reports, onOpen }: SegmentListProps) {
|
|
|
169
169
|
className={clsx(CELL, 'px-3 max-md:order-3 max-md:pt-0 max-md:pb-4')}
|
|
170
170
|
style={superellipse}
|
|
171
171
|
>
|
|
172
|
-
<div className="
|
|
172
|
+
<div className="mb-1 truncate text-xs text-muted md:hidden">
|
|
173
173
|
{t('segments.overTime')}
|
|
174
174
|
</div>
|
|
175
175
|
<Sparkline values={report?.series ?? []} />
|