@kahitsan/ksui 0.51.0-solid2.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -10
- package/package.json +6 -8
- package/src/components/base/AccountAvatar.tsx +1 -1
- package/src/components/base/ActionMenu.tsx +5 -7
- package/src/components/base/AddAttachmentTile.tsx +6 -6
- package/src/components/base/BadgeSelect.tsx +9 -11
- package/src/components/base/Button.tsx +41 -35
- package/src/components/base/CameraCapture.tsx +2 -5
- package/src/components/base/CopyButton.tsx +1 -2
- package/src/components/base/DataTable.tsx +112 -89
- package/src/components/base/DatePicker.tsx +17 -15
- package/src/components/base/DateTile.tsx +12 -14
- package/src/components/base/Dropdown.tsx +5 -6
- package/src/components/base/ExistingAttachmentTile.test.tsx +3 -3
- package/src/components/base/ExistingAttachmentTile.tsx +4 -6
- package/src/components/base/EyebrowBadge.tsx +1 -2
- package/src/components/base/FormErrorBanner.tsx +1 -2
- package/src/components/base/FormField.tsx +1 -1
- package/src/components/base/ImageCropper.tsx +3 -3
- package/src/components/base/ImageViewer.test.tsx +0 -2
- package/src/components/base/ImageViewer.tsx +3 -4
- package/src/components/base/KpiCard.tsx +2 -3
- package/src/components/base/Modal.test.tsx +2 -3
- package/src/components/base/Modal.tsx +12 -11
- package/src/components/base/ModalHeader.tsx +1 -2
- package/src/components/base/MonthCalendar.tsx +1 -2
- package/src/components/base/MultiSelectGroup.tsx +5 -7
- package/src/components/base/ProgressBar.tsx +17 -8
- package/src/components/base/RadioCardGroup.tsx +12 -14
- package/src/components/base/SectionHeading.tsx +1 -2
- package/src/components/base/SegmentedFilter.tsx +8 -10
- package/src/components/base/SocialLinksBar.tsx +1 -2
- package/src/components/base/StatusIndicator.tsx +1 -2
- package/src/components/base/StatusPill.tsx +1 -1
- package/src/components/base/TagPill.tsx +1 -1
- package/src/components/base/ThemeToggle.tsx +11 -5
- package/src/components/base/Tooltip.tsx +1 -2
- package/src/components/composite/AccountRadioPicker.tsx +11 -14
- package/src/components/composite/ComboBox.tsx +13 -18
- package/src/components/composite/CustomRenderer.tsx +1 -1
- package/src/components/composite/FileField.tsx +3 -6
- package/src/components/composite/FlowGraph.tsx +12 -15
- package/src/components/composite/FlowRunner.test.tsx +0 -2
- package/src/components/composite/FlowRunner.tsx +1 -2
- package/src/components/composite/FormActions.tsx +1 -1
- package/src/components/composite/FormAdvancedSection.tsx +13 -13
- package/src/components/composite/LiveTimer.tsx +14 -8
- package/src/components/composite/MarkdownNotes.tsx +1 -2
- package/src/components/composite/MentionTextarea.tsx +22 -31
- package/src/components/composite/MultiPeriodPicker.tsx +9 -11
- package/src/components/composite/NotFound.tsx +15 -4
- package/src/components/composite/PaymentAccountPicker.tsx +24 -19
- package/src/components/composite/SalesBodyEditor.tsx +7 -10
- package/src/components/composite/SearchableSelect.tsx +13 -14
- package/src/components/composite/SecretReveal.tsx +2 -2
- package/src/components/composite/TransactionForm.tsx +42 -52
- package/src/components/composite/TransferAccountsPicker.tsx +10 -11
- package/src/components/composite/TransferFeeChip.tsx +6 -7
- package/src/components/composite/VoucherPicker.test.tsx +48 -55
- package/src/components/composite/VoucherPicker.tsx +27 -36
- package/src/components/composite/picker-engine.ts +14 -20
- package/src/components/composite/resource/ResourcePage.test.tsx +1 -1
- package/src/components/composite/resource/ResourcePage.tsx +7 -21
- package/src/components/composite/resource/cells.tsx +1 -1
- package/src/icons/README.md +3 -1
- package/src/icons/artwork/bir-croc.ts +2 -0
- package/src/icons/bir-croc.tsx +4 -0
- package/src/icons/create-artwork-icon.test.tsx +1 -4
- package/src/icons/create-artwork-icon.tsx +24 -10
- package/src/icons/index.ts +1 -0
- package/src/icons/registry.ts +1 -0
- package/src/utils/account-icons.ts +1 -2
- package/src/utils/accounts-index.tsx +5 -8
- package/src/utils/confirm.tsx +1 -1
- package/src/utils/dom.ts +6 -7
- package/src/utils/highlight.tsx +1 -1
- package/src/utils/modal-layer.ts +3 -3
- package/src/utils/object-url-resource.ts +8 -11
- package/src/utils/top-layer.ts +8 -9
- package/src/components/base/Button.test.tsx +0 -23
- package/src/utils/aria.ts +0 -13
- package/src/utils/fetch-resource.ts +0 -59
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { For, type Component } from "solid-js";
|
|
2
|
-
import type { JSX } from "@solidjs/web";
|
|
1
|
+
import { For, type Component, type JSX } from "solid-js";
|
|
3
2
|
import { injectCSS } from "../../utils/inject-css";
|
|
4
3
|
|
|
5
4
|
/** Icon component shape: any component that accepts a numeric `size`
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
// are injected once at runtime via a <style> tag — the same pattern ProgressBar
|
|
10
10
|
// uses — and referenced by plain, unscoped class names.
|
|
11
11
|
|
|
12
|
-
import type { JSX } from "
|
|
13
|
-
import {
|
|
12
|
+
import type { JSX } from "solid-js";
|
|
13
|
+
import { splitProps } from "solid-js";
|
|
14
14
|
import Sun from "../../icons/sun";
|
|
15
15
|
import Moon from "../../icons/moon";
|
|
16
16
|
import { injectCSS } from "../../utils/inject-css";
|
|
@@ -63,8 +63,14 @@ const defaultAriaLabel = (next: ThemeToggleValue): string => `Switch to ${next}
|
|
|
63
63
|
export default function ThemeToggle(props: ThemeToggleProps): JSX.Element {
|
|
64
64
|
injectCSS(THEME_TOGGLE_STYLE_ID, THEME_TOGGLE_CSS);
|
|
65
65
|
|
|
66
|
-
const local = props
|
|
67
|
-
|
|
66
|
+
const [local, rest] = splitProps(props, [
|
|
67
|
+
"value",
|
|
68
|
+
"onToggle",
|
|
69
|
+
"ariaLabel",
|
|
70
|
+
"testId",
|
|
71
|
+
"class",
|
|
72
|
+
"onClick",
|
|
73
|
+
]);
|
|
68
74
|
|
|
69
75
|
const isLight = (): boolean => local.value === "light";
|
|
70
76
|
const next = (): ThemeToggleValue => (isLight() ? "dark" : "light");
|
|
@@ -78,7 +84,7 @@ export default function ThemeToggle(props: ThemeToggleProps): JSX.Element {
|
|
|
78
84
|
return (
|
|
79
85
|
<button
|
|
80
86
|
type="button"
|
|
81
|
-
class={
|
|
87
|
+
class={cn("ks-theme-toggle", local.class)}
|
|
82
88
|
aria-label={label()}
|
|
83
89
|
title={label()}
|
|
84
90
|
data-testid={local.testId}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createEffect, Show, For } from "solid-js";
|
|
2
2
|
import AccountAvatar from "../base/AccountAvatar";
|
|
3
3
|
import type { PaymentAccountOption } from "./PaymentAccountPicker";
|
|
4
|
-
import { ariaTri } from "../../utils/aria";
|
|
5
4
|
|
|
6
5
|
export interface AccountRadioPickerProps {
|
|
7
6
|
accounts: PaymentAccountOption[];
|
|
@@ -18,14 +17,12 @@ export default function AccountRadioPicker(props: AccountRadioPickerProps) {
|
|
|
18
17
|
(a) => !props.excludeId || a.id.toString() !== props.excludeId
|
|
19
18
|
);
|
|
20
19
|
|
|
21
|
-
createEffect(
|
|
22
|
-
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
if (value) return;
|
|
20
|
+
createEffect(() => {
|
|
21
|
+
if (props.autoDefault === false) return;
|
|
22
|
+
if (props.value) return;
|
|
23
|
+
const first = visible()[0];
|
|
26
24
|
if (first) props.onChange(first.id.toString());
|
|
27
|
-
}
|
|
28
|
-
);
|
|
25
|
+
});
|
|
29
26
|
|
|
30
27
|
const buttonRefs: (HTMLButtonElement | undefined)[] = [];
|
|
31
28
|
|
|
@@ -83,7 +80,7 @@ export default function AccountRadioPicker(props: AccountRadioPickerProps) {
|
|
|
83
80
|
<div
|
|
84
81
|
role="radiogroup"
|
|
85
82
|
aria-label={props.ariaLabel}
|
|
86
|
-
|
|
83
|
+
tabIndex={-1}
|
|
87
84
|
class="grid max-sm:grid-cols-2 sm:grid-cols-3 gap-2"
|
|
88
85
|
onKeyDown={onKeyDown}
|
|
89
86
|
>
|
|
@@ -96,16 +93,16 @@ export default function AccountRadioPicker(props: AccountRadioPickerProps) {
|
|
|
96
93
|
ref={(el) => (buttonRefs[i()] = el)}
|
|
97
94
|
type="button"
|
|
98
95
|
role="radio"
|
|
99
|
-
aria-checked={
|
|
100
|
-
|
|
96
|
+
aria-checked={selected()}
|
|
97
|
+
tabIndex={isTabStop() ? 0 : -1}
|
|
101
98
|
onClick={() => props.onChange(a.id.toString())}
|
|
102
|
-
class=
|
|
99
|
+
class="group flex items-center gap-2 rounded-lg border px-3 py-3 text-left text-sm transition-colors cursor-pointer ks-hud-clip-top-left-bottom-right"
|
|
100
|
+
classList={{
|
|
103
101
|
"border-[color-mix(in_srgb,var(--ks-accent,#fbbf24)_50%,transparent)] bg-[color-mix(in_srgb,var(--ks-accent,#fbbf24)_10%,transparent)] text-[var(--ks-accent-hover,#fcd34d)]":
|
|
104
102
|
selected(),
|
|
105
103
|
"border-[var(--ks-border-strong,#3f3f46)] bg-[color-mix(in_srgb,var(--ks-surface-raised,#1a1a1a)_50%,transparent)] text-[var(--ks-fg-muted,#a1a1aa)] hover:border-[var(--ks-border-strong,#3f3f46)] hover:bg-[var(--ks-surface-raised,#1a1a1a)]":
|
|
106
104
|
!selected(),
|
|
107
|
-
}
|
|
108
|
-
|
|
105
|
+
}}
|
|
109
106
|
>
|
|
110
107
|
<AccountAvatar
|
|
111
108
|
account={a}
|
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
// (star) with click-to-promote, `invalid` paints the required/empty tone,
|
|
20
20
|
// and `lockedIds` anchors specific chips.
|
|
21
21
|
|
|
22
|
-
import { Portal } from "
|
|
23
|
-
import { createEffect, createSignal, For, onCleanup,
|
|
24
|
-
import type { JSX } from "@solidjs/web";
|
|
22
|
+
import { Portal } from "solid-js/web";
|
|
23
|
+
import { createEffect, createSignal, For, onCleanup, onMount, Show, type JSX } from "solid-js";
|
|
25
24
|
import { useTopLayer } from "../../utils/top-layer";
|
|
26
25
|
import { usePopoverMount } from "../../utils/modal-layer";
|
|
27
26
|
import { highlightMatch } from "../../utils/highlight";
|
|
@@ -31,7 +30,6 @@ import Star from "../../icons/star";
|
|
|
31
30
|
import X from "../../icons/x";
|
|
32
31
|
import Loader2 from "../../icons/loader-2";
|
|
33
32
|
import { createPickerPopup } from "./picker-engine";
|
|
34
|
-
import { ariaBool } from "../../utils/aria";
|
|
35
33
|
|
|
36
34
|
interface ComboBoxCommonProps<T> {
|
|
37
35
|
/** Search the backing list. Receives the trimmed query (may be empty for the
|
|
@@ -131,12 +129,9 @@ function SingleComboBox<T>(props: ComboBoxSingleProps<T>): JSX.Element {
|
|
|
131
129
|
if (props.defaultOpen) queueMicrotask(() => eng.setOpen(true));
|
|
132
130
|
|
|
133
131
|
// Focus the popup's search input whenever it opens.
|
|
134
|
-
createEffect(
|
|
135
|
-
eng.open
|
|
136
|
-
|
|
137
|
-
if (isOpen) queueMicrotask(() => inputRef?.focus());
|
|
138
|
-
},
|
|
139
|
-
);
|
|
132
|
+
createEffect(() => {
|
|
133
|
+
if (eng.open()) queueMicrotask(() => inputRef?.focus());
|
|
134
|
+
});
|
|
140
135
|
|
|
141
136
|
const hasExactMatch = () => {
|
|
142
137
|
const q = eng.trimmedQuery().toLowerCase();
|
|
@@ -191,7 +186,7 @@ function SingleComboBox<T>(props: ComboBoxSingleProps<T>): JSX.Element {
|
|
|
191
186
|
onClick={() => !props.disabled && eng.setOpen((o) => !o)}
|
|
192
187
|
class="w-full flex items-center gap-2 px-3 py-2.5 rounded-lg bg-[color-mix(in_srgb,var(--ks-surface-raised,#1a1a1a)_30%,transparent)] border border-[color-mix(in_srgb,var(--ks-border-strong,#3f3f46)_50%,transparent)] hover:border-[color-mix(in_srgb,var(--ks-primary,#c9a961)_40%,transparent)] hover:bg-[color-mix(in_srgb,var(--ks-primary,#c9a961)_5%,transparent)] transition-colors text-sm text-left cursor-pointer disabled:cursor-not-allowed disabled:opacity-60"
|
|
193
188
|
aria-haspopup="listbox"
|
|
194
|
-
aria-expanded={
|
|
189
|
+
aria-expanded={eng.open()}
|
|
195
190
|
>
|
|
196
191
|
<Icon size={16} class="shrink-0 text-[var(--ks-fg-muted,#a1a1aa)]" />
|
|
197
192
|
<Show when={triggerLabel()} fallback={<span class="text-[var(--ks-fg-subtle,#71717a)] italic">{placeholder()}</span>}>
|
|
@@ -216,7 +211,7 @@ function SingleComboBox<T>(props: ComboBoxSingleProps<T>): JSX.Element {
|
|
|
216
211
|
<div
|
|
217
212
|
ref={(el) => {
|
|
218
213
|
popupRef = el;
|
|
219
|
-
useTopLayer(el);
|
|
214
|
+
onCleanup(useTopLayer(el));
|
|
220
215
|
}}
|
|
221
216
|
data-testid={tid("popup")}
|
|
222
217
|
class="z-[10000] rounded-md border border-[var(--ks-border-strong,#3f3f46)] bg-[color-mix(in_srgb,var(--ks-overlay-surface,#18181b)_95%,transparent)] backdrop-blur shadow-xl overflow-hidden flex flex-col"
|
|
@@ -229,7 +224,7 @@ function SingleComboBox<T>(props: ComboBoxSingleProps<T>): JSX.Element {
|
|
|
229
224
|
type="text"
|
|
230
225
|
data-testid={tid("input")}
|
|
231
226
|
role="combobox"
|
|
232
|
-
aria-expanded={
|
|
227
|
+
aria-expanded={eng.open()}
|
|
233
228
|
aria-controls={`${tid("listbox")}`}
|
|
234
229
|
aria-autocomplete="list"
|
|
235
230
|
aria-label={`Search ${props.noun}s`}
|
|
@@ -267,7 +262,7 @@ function SingleComboBox<T>(props: ComboBoxSingleProps<T>): JSX.Element {
|
|
|
267
262
|
const isSel = () =>
|
|
268
263
|
props.selected != null && props.idOf(props.selected) === props.idOf(item);
|
|
269
264
|
return (
|
|
270
|
-
<li role="option" aria-selected={
|
|
265
|
+
<li role="option" aria-selected={isSel()}>
|
|
271
266
|
<button
|
|
272
267
|
type="button"
|
|
273
268
|
data-testid={`${tid("result")}-${props.idOf(item)}`}
|
|
@@ -447,7 +442,7 @@ function MultiComboBox<T>(props: ComboBoxMultiProps<T>): JSX.Element {
|
|
|
447
442
|
}
|
|
448
443
|
};
|
|
449
444
|
|
|
450
|
-
|
|
445
|
+
onMount(() => {
|
|
451
446
|
if (props.autoFocusOnMount) queueMicrotask(() => inputRef?.focus());
|
|
452
447
|
});
|
|
453
448
|
|
|
@@ -569,7 +564,7 @@ function MultiComboBox<T>(props: ComboBoxMultiProps<T>): JSX.Element {
|
|
|
569
564
|
<div
|
|
570
565
|
ref={(el) => {
|
|
571
566
|
popupRef = el;
|
|
572
|
-
useTopLayer(el);
|
|
567
|
+
onCleanup(useTopLayer(el));
|
|
573
568
|
}}
|
|
574
569
|
data-testid={tid("popup")}
|
|
575
570
|
role="listbox"
|
|
@@ -601,7 +596,7 @@ function MultiComboBox<T>(props: ComboBoxMultiProps<T>): JSX.Element {
|
|
|
601
596
|
<button
|
|
602
597
|
type="button"
|
|
603
598
|
role="option"
|
|
604
|
-
aria-selected={
|
|
599
|
+
aria-selected={focusedIdx() === 0}
|
|
605
600
|
data-testid={tid("create")}
|
|
606
601
|
onMouseEnter={() => setFocusedIdx(0)}
|
|
607
602
|
onClick={() => void createAndAdd()}
|
|
@@ -637,7 +632,7 @@ function MultiComboBox<T>(props: ComboBoxMultiProps<T>): JSX.Element {
|
|
|
637
632
|
<button
|
|
638
633
|
type="button"
|
|
639
634
|
role="option"
|
|
640
|
-
aria-selected={
|
|
635
|
+
aria-selected={isFocused()}
|
|
641
636
|
data-testid={`${tid("result")}-${idOf(item)}`}
|
|
642
637
|
onMouseEnter={() => setFocusedIdx(displayIdx())}
|
|
643
638
|
onClick={() => addToPool(item)}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import type { Component } from "solid-js";
|
|
11
11
|
import { Show, createMemo } from "solid-js";
|
|
12
|
-
import { Dynamic } from "
|
|
12
|
+
import { Dynamic } from "solid-js/web";
|
|
13
13
|
import AlertTriangle from "../../icons/triangle-alert";
|
|
14
14
|
import {
|
|
15
15
|
getRenderer,
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
// its CSS (ksui-ff-* unscoped classes + CSS custom props); no Tailwind, no
|
|
14
14
|
// host-brand classes (standalone-library rule).
|
|
15
15
|
|
|
16
|
-
import type { Component } from "solid-js";
|
|
17
|
-
import
|
|
18
|
-
import { Match, Show, Switch, createSignal, onSettled } from "solid-js";
|
|
16
|
+
import type { Component, JSX } from "solid-js";
|
|
17
|
+
import { Match, Show, Switch, createSignal } from "solid-js";
|
|
19
18
|
import UploadCloud from "../../icons/cloud-upload";
|
|
20
19
|
import FileIcon from "../../icons/file";
|
|
21
20
|
import ImageOff from "../../icons/image-off";
|
|
@@ -137,9 +136,7 @@ export const FileField: Component<FileFieldProps> = (props) => {
|
|
|
137
136
|
};
|
|
138
137
|
|
|
139
138
|
// If a value handle is supplied at mount, load its preview eagerly.
|
|
140
|
-
|
|
141
|
-
if (props.value) loadPreview(props.value);
|
|
142
|
-
});
|
|
139
|
+
if (props.value) loadPreview(props.value);
|
|
143
140
|
|
|
144
141
|
const pick = () => {
|
|
145
142
|
if (props.disabled) return;
|
|
@@ -11,9 +11,8 @@
|
|
|
11
11
|
// layoutGraph. Connectors are drawn BEHIND the opaque cards so an edge never
|
|
12
12
|
// visibly crosses a node block.
|
|
13
13
|
|
|
14
|
-
import type { Component } from "solid-js";
|
|
15
|
-
import
|
|
16
|
-
import { Dynamic } from "@solidjs/web";
|
|
14
|
+
import type { Component, JSX } from "solid-js";
|
|
15
|
+
import { Dynamic } from "solid-js/web";
|
|
17
16
|
import { For, Show, createEffect, createMemo, createSignal } from "solid-js";
|
|
18
17
|
import Database from "../../icons/database";
|
|
19
18
|
import MousePointerClick from "../../icons/mouse-pointer-click";
|
|
@@ -262,10 +261,9 @@ export const FlowGraph: Component<FlowGraphProps> = (props) => {
|
|
|
262
261
|
// instead of leaving the view on the previous flow's now-empty region.
|
|
263
262
|
const nodeSig = createMemo(() => props.nodes.map((n) => n.id).join("|"));
|
|
264
263
|
let lastSig: string | null = null;
|
|
265
|
-
createEffect(
|
|
266
|
-
|
|
267
|
-
(
|
|
268
|
-
if (hasCanvas && sig !== lastSig && count > 0 && svgRef) {
|
|
264
|
+
createEffect(() => {
|
|
265
|
+
const sig = nodeSig();
|
|
266
|
+
if (canvas() && sig !== lastSig && laid().nodes.length > 0 && svgRef) {
|
|
269
267
|
lastSig = sig;
|
|
270
268
|
setOffsets({});
|
|
271
269
|
requestAnimationFrame(() => {
|
|
@@ -280,8 +278,7 @@ export const FlowGraph: Component<FlowGraphProps> = (props) => {
|
|
|
280
278
|
setView({ x: vw / 2 - (minX + maxX) / 2, y: pad - minY, k: 1 });
|
|
281
279
|
});
|
|
282
280
|
}
|
|
283
|
-
}
|
|
284
|
-
);
|
|
281
|
+
});
|
|
285
282
|
|
|
286
283
|
const clampK = (k: number) => Math.min(ZOOM_MAX, Math.max(ZOOM_MIN, k));
|
|
287
284
|
const zoomBy = (factor: number, cx?: number, cy?: number) => {
|
|
@@ -383,8 +380,8 @@ export const FlowGraph: Component<FlowGraphProps> = (props) => {
|
|
|
383
380
|
|
|
384
381
|
return (
|
|
385
382
|
<div
|
|
386
|
-
class=
|
|
387
|
-
|
|
383
|
+
class="ksui-fg-wrap"
|
|
384
|
+
classList={{ interactive: canvas(), scroll: vertical(), grabbing: grabbing() }}
|
|
388
385
|
style={
|
|
389
386
|
canvas()
|
|
390
387
|
? { height: `${props.height ?? 360}px` }
|
|
@@ -453,7 +450,7 @@ export const FlowGraph: Component<FlowGraphProps> = (props) => {
|
|
|
453
450
|
const m = () => mid(a(), b());
|
|
454
451
|
const lbl = () => clip(e.label ?? "", 18);
|
|
455
452
|
return (
|
|
456
|
-
<g
|
|
453
|
+
<g classList={{ "ksui-fg-dim": edgeDim(e) }}>
|
|
457
454
|
<path
|
|
458
455
|
class={`ksui-fg-edge ${e.accent ?? ""} ${e.dashed ? "dashed" : ""} ${
|
|
459
456
|
props.animated ? "flow" : ""
|
|
@@ -493,8 +490,8 @@ export const FlowGraph: Component<FlowGraphProps> = (props) => {
|
|
|
493
490
|
y={n().y}
|
|
494
491
|
width={nodeW}
|
|
495
492
|
height={nodeH}
|
|
496
|
-
class=
|
|
497
|
-
|
|
493
|
+
class="ksui-fg-node"
|
|
494
|
+
classList={{ clickable: clickable(), "ksui-fg-dim": nodeDim(base.id) }}
|
|
498
495
|
data-testid={tid(`node-${base.id}`)}
|
|
499
496
|
role={clickable() ? "button" : undefined}
|
|
500
497
|
tabindex={clickable() ? 0 : undefined}
|
|
@@ -535,7 +532,7 @@ export const FlowGraph: Component<FlowGraphProps> = (props) => {
|
|
|
535
532
|
const outs = () => ports().outBySource.get(base.id) ?? [];
|
|
536
533
|
const hasIn = () => ports().incoming.has(base.id);
|
|
537
534
|
return (
|
|
538
|
-
<g
|
|
535
|
+
<g classList={{ "ksui-fg-dim": nodeDim(base.id) }}>
|
|
539
536
|
{/* cx/cy are accessor-driven so handles follow a dragged node. */}
|
|
540
537
|
<Show when={hasIn()}>
|
|
541
538
|
<circle
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// U7 — FlowRunner component tests: renders each node kind, calls advance with the
|
|
2
2
|
// node's input, handles a terminal node + an error.
|
|
3
|
-
import { flush } from "solid-js";
|
|
4
3
|
import { describe, expect, it, vi } from "vitest";
|
|
5
4
|
import { render, fireEvent, waitFor } from "@solidjs/testing-library";
|
|
6
5
|
import FlowRunner from "./FlowRunner";
|
|
@@ -27,7 +26,6 @@ describe("FlowRunner", () => {
|
|
|
27
26
|
/>
|
|
28
27
|
));
|
|
29
28
|
fireEvent.input(getByTestId("fr-field-amount"), { target: { value: "50" } });
|
|
30
|
-
flush(); // the input handler's write must commit before the click reads it
|
|
31
29
|
fireEvent.click(getByTestId("fr-submit"));
|
|
32
30
|
await waitFor(() => expect(advance).toHaveBeenCalledWith({ token: "abc" }, { amount: "50" }));
|
|
33
31
|
await waitFor(() => expect(getByTestId("fr-terminal")).toBeTruthy());
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
// error UI. Self-contained CSS (ksui-fr-* unscoped classes + CSS custom props);
|
|
10
10
|
// no Tailwind, no host-brand classes (standalone-library rule).
|
|
11
11
|
|
|
12
|
-
import type { Component } from "solid-js";
|
|
13
|
-
import type { JSX } from "@solidjs/web";
|
|
12
|
+
import type { Component, JSX } from "solid-js";
|
|
14
13
|
import { For, Match, Show, Switch, createSignal } from "solid-js";
|
|
15
14
|
import {
|
|
16
15
|
collectsInput,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// tokens. Only the body chrome the Modal does not cover (FormErrorBanner +
|
|
14
14
|
// FormActions) is promoted.
|
|
15
15
|
|
|
16
|
-
import type { JSX } from "
|
|
16
|
+
import type { JSX } from "solid-js";
|
|
17
17
|
import { Show } from "solid-js";
|
|
18
18
|
import Button from "../base/Button";
|
|
19
19
|
|
|
@@ -149,8 +149,8 @@ export default function FormAdvancedSection(props: FormAdvancedSectionProps) {
|
|
|
149
149
|
</div>
|
|
150
150
|
|
|
151
151
|
<div
|
|
152
|
-
class=
|
|
153
|
-
|
|
152
|
+
class="rounded-lg border border-[color-mix(in_srgb,var(--ks-border-strong,#3f3f46)_50%,transparent)] bg-[color-mix(in_srgb,var(--ks-bg,#0a0a0a)_40%,transparent)] p-4 relative"
|
|
153
|
+
classList={{ "opacity-60": !props.canShare }}
|
|
154
154
|
title={
|
|
155
155
|
props.canShare
|
|
156
156
|
? undefined
|
|
@@ -177,8 +177,8 @@ export default function FormAdvancedSection(props: FormAdvancedSectionProps) {
|
|
|
177
177
|
if (!props.canShare) return;
|
|
178
178
|
props.setIsPrivate(!props.isPrivate);
|
|
179
179
|
}}
|
|
180
|
-
class=
|
|
181
|
-
|
|
180
|
+
class="ks-theme-toggle shrink-0"
|
|
181
|
+
classList={{ "cursor-not-allowed": !props.canShare }}
|
|
182
182
|
>
|
|
183
183
|
<span
|
|
184
184
|
class="ks-theme-toggle-track"
|
|
@@ -238,13 +238,13 @@ export default function FormAdvancedSection(props: FormAdvancedSectionProps) {
|
|
|
238
238
|
]);
|
|
239
239
|
}
|
|
240
240
|
}}
|
|
241
|
-
class=
|
|
241
|
+
class="px-3 py-2 text-xs rounded-lg border cursor-pointer min-h-[36px] capitalize transition-colors active:opacity-80"
|
|
242
|
+
classList={{
|
|
242
243
|
"border-[color-mix(in_srgb,var(--ks-primary,#c9a961)_40%,transparent)] bg-[color-mix(in_srgb,var(--ks-primary,#c9a961)_10%,transparent)] text-[var(--ks-accent,#fbbf24)]":
|
|
243
244
|
selected(),
|
|
244
245
|
"border-[var(--ks-border-strong,#3f3f46)] bg-[color-mix(in_srgb,var(--ks-surface-raised,#1a1a1a)_50%,transparent)] text-[var(--ks-fg-muted,#a1a1aa)] hover:border-[var(--ks-border-strong,#3f3f46)]":
|
|
245
246
|
!selected(),
|
|
246
|
-
}
|
|
247
|
-
|
|
247
|
+
}}
|
|
248
248
|
>
|
|
249
249
|
All {role.label}s
|
|
250
250
|
<Show when={membersInRole().length > 0}>
|
|
@@ -279,23 +279,23 @@ export default function FormAdvancedSection(props: FormAdvancedSectionProps) {
|
|
|
279
279
|
props.sharedWith.includes(m.user_id) || !!coveringRole();
|
|
280
280
|
return (
|
|
281
281
|
<label
|
|
282
|
-
class=
|
|
282
|
+
class="flex items-center gap-3 text-sm py-2 px-2 rounded-lg min-h-[40px] transition-colors"
|
|
283
|
+
classList={{
|
|
283
284
|
"text-[var(--ks-fg-muted,#a1a1aa)] cursor-pointer hover:bg-[color-mix(in_srgb,var(--ks-surface-raised,#1a1a1a)_30%,transparent)] active:bg-[color-mix(in_srgb,var(--ks-surface-raised,#1a1a1a)_50%,transparent)]":
|
|
284
285
|
!coveringRole(),
|
|
285
286
|
"text-[var(--ks-fg-subtle,#71717a)] cursor-not-allowed bg-[color-mix(in_srgb,var(--ks-overlay-surface,#18181b)_40%,transparent)]":
|
|
286
287
|
!!coveringRole(),
|
|
287
|
-
}
|
|
288
|
-
|
|
288
|
+
}}
|
|
289
289
|
>
|
|
290
290
|
<div
|
|
291
|
-
class=
|
|
291
|
+
class="w-5 h-5 rounded border-2 flex items-center justify-center shrink-0 transition-colors"
|
|
292
|
+
classList={{
|
|
292
293
|
"border-[var(--ks-primary,#c9a961)] bg-[var(--ks-primary,#c9a961)]":
|
|
293
294
|
checked() && !coveringRole(),
|
|
294
295
|
"border-[color-mix(in_srgb,var(--ks-primary,#c9a961)_40%,transparent)] bg-[color-mix(in_srgb,var(--ks-primary,#c9a961)_40%,transparent)]":
|
|
295
296
|
checked() && !!coveringRole(),
|
|
296
297
|
"border-[var(--ks-border-strong,#3f3f46)] bg-transparent": !checked(),
|
|
297
|
-
}
|
|
298
|
-
|
|
298
|
+
}}
|
|
299
299
|
>
|
|
300
300
|
<Show when={checked()}>
|
|
301
301
|
<svg
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
// N intervals when N cards are on screen — the home page session
|
|
5
5
|
// manager already proved this pattern at scale, so we lift it as-is.
|
|
6
6
|
|
|
7
|
-
import type { Component } from "solid-js";
|
|
8
|
-
import
|
|
9
|
-
import { Show, createMemo, createSignal, onCleanup, omit, untrack } from "solid-js";
|
|
7
|
+
import type { Component, JSX } from "solid-js";
|
|
8
|
+
import { Show, createMemo, createSignal, onCleanup, splitProps } from "solid-js";
|
|
10
9
|
import Clock from "../../icons/clock";
|
|
11
10
|
import Play from "../../icons/play";
|
|
12
11
|
import AlertTriangle from "../../icons/triangle-alert";
|
|
@@ -243,8 +242,16 @@ const COLOR_AMBER = "border border-[color-mix(in_srgb,var(--ks-accent,#fbbf24)_6
|
|
|
243
242
|
const COLOR_RED = "border border-red-600/60 text-[var(--ks-danger-fg,#f87171)] hover:border-[var(--ks-danger,#ef4444)]";
|
|
244
243
|
|
|
245
244
|
const LiveTimer: Component<LiveTimerProps> = (props) => {
|
|
246
|
-
const local = props
|
|
247
|
-
|
|
245
|
+
const [local, others] = splitProps(props, [
|
|
246
|
+
"startAt",
|
|
247
|
+
"endAt",
|
|
248
|
+
"overdue",
|
|
249
|
+
"icon",
|
|
250
|
+
"class",
|
|
251
|
+
"label",
|
|
252
|
+
"hidePercentage",
|
|
253
|
+
"totalLabel",
|
|
254
|
+
]);
|
|
248
255
|
|
|
249
256
|
const timestamps = createMemo(() => {
|
|
250
257
|
const start = ensureDate(local.startAt);
|
|
@@ -257,9 +264,8 @@ const LiveTimer: Component<LiveTimerProps> = (props) => {
|
|
|
257
264
|
});
|
|
258
265
|
|
|
259
266
|
// Subscribe to the shared tickers.
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
const dynamicTick = getDynamicTick(startSec, endSec, overdue);
|
|
267
|
+
const { startSec, endSec } = timestamps();
|
|
268
|
+
const dynamicTick = getDynamicTick(startSec, endSec, local.overdue ?? false);
|
|
263
269
|
const slowTick = getSlowTick();
|
|
264
270
|
|
|
265
271
|
const scenario = createMemo<Scenario>(() => {
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
// fetches the SIBLING clients plugin at /api/clients/:id and degrades to a
|
|
10
10
|
// non-hovering chip when that 404s.
|
|
11
11
|
|
|
12
|
-
import { For, Show, createMemo, createSignal, createUniqueId, onCleanup } from "solid-js";
|
|
13
|
-
import type { JSX } from "@solidjs/web";
|
|
12
|
+
import { For, Show, createMemo, createSignal, createUniqueId, onCleanup, type JSX } from "solid-js";
|
|
14
13
|
import { highlightMatch } from "../../utils/highlight";
|
|
15
14
|
import { canAccess } from "../../utils/integration";
|
|
16
15
|
|
|
@@ -6,14 +6,12 @@
|
|
|
6
6
|
// /api/clients; when it 404s the popup just shows no results and the field
|
|
7
7
|
// still works as a plain notes editor.
|
|
8
8
|
|
|
9
|
-
import { Portal } from "
|
|
9
|
+
import { Portal } from "solid-js/web";
|
|
10
10
|
import { useTopLayer } from "../../utils/top-layer";
|
|
11
11
|
import { usePopoverMount } from "../../utils/modal-layer";
|
|
12
|
-
import { createEffect, createSignal, createUniqueId, For, onCleanup,
|
|
13
|
-
import type { JSX } from "@solidjs/web";
|
|
12
|
+
import { createEffect, createSignal, createUniqueId, For, onCleanup, onMount, Show, type JSX } from "solid-js";
|
|
14
13
|
import UserRound from "../../icons/user-round";
|
|
15
14
|
import Loader2 from "../../icons/loader-2";
|
|
16
|
-
import { ariaBool } from "../../utils/aria";
|
|
17
15
|
|
|
18
16
|
const POPUP_MAX_HEIGHT = 240;
|
|
19
17
|
const POPUP_MIN_WIDTH = 280;
|
|
@@ -183,22 +181,18 @@ export default function MentionTextarea(props: MentionTextareaProps): JSX.Elemen
|
|
|
183
181
|
});
|
|
184
182
|
};
|
|
185
183
|
|
|
186
|
-
createEffect(
|
|
187
|
-
query
|
|
188
|
-
(q) => {
|
|
184
|
+
createEffect(() => {
|
|
185
|
+
const q = query();
|
|
189
186
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
190
187
|
debounceTimer = setTimeout(() => setDebouncedQuery(q), SEARCH_DEBOUNCE_MS);
|
|
191
|
-
|
|
188
|
+
onCleanup(() => {
|
|
192
189
|
if (debounceTimer) clearTimeout(debounceTimer);
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
196
192
|
|
|
197
|
-
createEffect(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
if (!isOpen) return;
|
|
201
|
-
const q = debounced.trim();
|
|
193
|
+
createEffect(() => {
|
|
194
|
+
if (!open()) return;
|
|
195
|
+
const q = debouncedQuery().trim();
|
|
202
196
|
const token = ++activeFetchToken;
|
|
203
197
|
setLoading(true);
|
|
204
198
|
const params = new URLSearchParams({ status: "active", limit: String(FETCH_LIMIT) });
|
|
@@ -219,11 +213,10 @@ export default function MentionTextarea(props: MentionTextareaProps): JSX.Elemen
|
|
|
219
213
|
if (token !== activeFetchToken) return;
|
|
220
214
|
setLoading(false);
|
|
221
215
|
});
|
|
222
|
-
}
|
|
223
|
-
);
|
|
216
|
+
});
|
|
224
217
|
|
|
225
|
-
createEffect(
|
|
226
|
-
if (!
|
|
218
|
+
createEffect(() => {
|
|
219
|
+
if (!open()) return;
|
|
227
220
|
updatePosition();
|
|
228
221
|
const onDocClick = (e: MouseEvent) => {
|
|
229
222
|
const t = e.target as Node;
|
|
@@ -235,16 +228,15 @@ export default function MentionTextarea(props: MentionTextareaProps): JSX.Elemen
|
|
|
235
228
|
document.addEventListener("mousedown", onDocClick);
|
|
236
229
|
window.addEventListener("resize", onReflow);
|
|
237
230
|
window.addEventListener("scroll", onReflow, true);
|
|
238
|
-
|
|
231
|
+
onCleanup(() => {
|
|
239
232
|
document.removeEventListener("mousedown", onDocClick);
|
|
240
233
|
window.removeEventListener("resize", onReflow);
|
|
241
234
|
window.removeEventListener("scroll", onReflow, true);
|
|
242
|
-
};
|
|
235
|
+
});
|
|
243
236
|
});
|
|
244
237
|
|
|
245
|
-
createEffect(
|
|
246
|
-
|
|
247
|
-
(v) => {
|
|
238
|
+
createEffect(() => {
|
|
239
|
+
const v = props.value;
|
|
248
240
|
if (!editorRef) return;
|
|
249
241
|
if (isHydrating) return;
|
|
250
242
|
if (serialize(editorRef) === v) {
|
|
@@ -255,10 +247,9 @@ export default function MentionTextarea(props: MentionTextareaProps): JSX.Elemen
|
|
|
255
247
|
hydrateInto(editorRef, v);
|
|
256
248
|
isHydrating = false;
|
|
257
249
|
setIsEmpty(v.length === 0);
|
|
258
|
-
}
|
|
259
|
-
);
|
|
250
|
+
});
|
|
260
251
|
|
|
261
|
-
|
|
252
|
+
onMount(() => {
|
|
262
253
|
if (!editorRef) return;
|
|
263
254
|
hydrateInto(editorRef, props.value);
|
|
264
255
|
setIsEmpty(props.value.length === 0);
|
|
@@ -402,7 +393,7 @@ export default function MentionTextarea(props: MentionTextareaProps): JSX.Elemen
|
|
|
402
393
|
tabindex={props.disabled ? -1 : 0}
|
|
403
394
|
role="combobox"
|
|
404
395
|
aria-haspopup="listbox"
|
|
405
|
-
aria-expanded={
|
|
396
|
+
aria-expanded={open()}
|
|
406
397
|
aria-controls={open() ? listboxId : undefined}
|
|
407
398
|
aria-autocomplete="list"
|
|
408
399
|
aria-label={props.ariaLabel}
|
|
@@ -442,7 +433,7 @@ export default function MentionTextarea(props: MentionTextareaProps): JSX.Elemen
|
|
|
442
433
|
<div
|
|
443
434
|
ref={(el) => {
|
|
444
435
|
popupRef = el;
|
|
445
|
-
useTopLayer(el);
|
|
436
|
+
onCleanup(useTopLayer(el));
|
|
446
437
|
}}
|
|
447
438
|
data-testid="mention-popup"
|
|
448
439
|
class="z-[120] rounded-md border border-[var(--ks-border-strong,#3f3f46)] bg-[color-mix(in_srgb,var(--ks-overlay-surface,#18181b)_95%,transparent)] backdrop-blur shadow-xl overflow-hidden flex flex-col"
|
|
@@ -469,7 +460,7 @@ export default function MentionTextarea(props: MentionTextareaProps): JSX.Elemen
|
|
|
469
460
|
>
|
|
470
461
|
<For each={results()}>
|
|
471
462
|
{(c, idx) => (
|
|
472
|
-
<li id={optionId(c.id)} role="option" aria-selected={
|
|
463
|
+
<li id={optionId(c.id)} role="option" aria-selected={idx() === activeIdx()}>
|
|
473
464
|
<button
|
|
474
465
|
type="button"
|
|
475
466
|
data-testid={`mention-result-${c.id}`}
|