@flopay/ui 1.13.0 → 1.14.1
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 +28 -0
- package/dist/index.cjs +43 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.mjs +38 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/styles/components.css +13 -0
package/README.md
CHANGED
|
@@ -402,6 +402,34 @@ import { CodeArea } from "@flopay/ui";
|
|
|
402
402
|
/>;
|
|
403
403
|
```
|
|
404
404
|
|
|
405
|
+
#### Select
|
|
406
|
+
|
|
407
|
+
A labelled native `<select>` (for example the email editor's language
|
|
408
|
+
switcher), laid out like `Field`: a `field-label` linked through `htmlFor`, then
|
|
409
|
+
the select with the `Input` look (`field field-select`). It stays a native
|
|
410
|
+
control, so Tab, the arrow keys and the platform picker work, and it keeps the
|
|
411
|
+
browser's chevron.
|
|
412
|
+
|
|
413
|
+
```tsx
|
|
414
|
+
import { Select } from "@flopay/ui";
|
|
415
|
+
|
|
416
|
+
<Select
|
|
417
|
+
id="locale"
|
|
418
|
+
label="Language"
|
|
419
|
+
value={locale} // "" selects the Default option
|
|
420
|
+
options={[
|
|
421
|
+
{ value: "", label: "Default" },
|
|
422
|
+
{ value: "fr", label: "French" },
|
|
423
|
+
{ value: "de", label: "German" },
|
|
424
|
+
]}
|
|
425
|
+
onChange={(next) => setLocale(next)} // the chosen value, not the event
|
|
426
|
+
/>;
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
It is controlled only: `value` picks the selected option and `onChange`
|
|
430
|
+
receives the chosen option's value as a string. `disabled` and `name` pass
|
|
431
|
+
through to the `<select>`; without them it has neither attribute.
|
|
432
|
+
|
|
405
433
|
#### VariablePicker
|
|
406
434
|
|
|
407
435
|
An "Insert variable" menu button attached to a `SlotTextField` or `CodeArea`
|
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
PreviewFrame: () => PreviewFrame,
|
|
38
38
|
Section: () => Section,
|
|
39
39
|
SectionHeader: () => SectionHeader,
|
|
40
|
+
Select: () => Select,
|
|
40
41
|
SlotTextField: () => SlotTextField,
|
|
41
42
|
Spinner: () => Spinner,
|
|
42
43
|
StepIndicator: () => StepIndicator,
|
|
@@ -568,6 +569,23 @@ function SectionHeader({ label, title, description, className }) {
|
|
|
568
569
|
] });
|
|
569
570
|
}
|
|
570
571
|
|
|
572
|
+
// src/components/select.tsx
|
|
573
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
574
|
+
function Select({ id, label, value, options, onChange, disabled, name }) {
|
|
575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Field, { label, htmlFor: id, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
576
|
+
"select",
|
|
577
|
+
{
|
|
578
|
+
id,
|
|
579
|
+
name,
|
|
580
|
+
className: "field field-select",
|
|
581
|
+
value,
|
|
582
|
+
disabled,
|
|
583
|
+
onChange: (event) => onChange(event.target.value),
|
|
584
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: option.value, children: option.label }, option.value))
|
|
585
|
+
}
|
|
586
|
+
) });
|
|
587
|
+
}
|
|
588
|
+
|
|
571
589
|
// src/components/slot-text-field.tsx
|
|
572
590
|
var import_react5 = require("react");
|
|
573
591
|
|
|
@@ -607,7 +625,7 @@ function assignRef(ref, node) {
|
|
|
607
625
|
}
|
|
608
626
|
|
|
609
627
|
// src/components/slot-text-field.tsx
|
|
610
|
-
var
|
|
628
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
611
629
|
var LINK_PLACEHOLDER = "https://";
|
|
612
630
|
function wrapWith(marker) {
|
|
613
631
|
return (selected) => ({
|
|
@@ -660,7 +678,7 @@ function SlotTextField({
|
|
|
660
678
|
className: multiline ? "field field-multiline" : "field",
|
|
661
679
|
"aria-invalid": error ? true : void 0
|
|
662
680
|
};
|
|
663
|
-
return /* @__PURE__ */ (0,
|
|
681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
664
682
|
Field,
|
|
665
683
|
{
|
|
666
684
|
label,
|
|
@@ -669,7 +687,7 @@ function SlotTextField({
|
|
|
669
687
|
htmlFor: controlId,
|
|
670
688
|
className,
|
|
671
689
|
children: [
|
|
672
|
-
/* @__PURE__ */ (0,
|
|
690
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "slot-toolbar", children: FORMATS.map((format) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
673
691
|
"button",
|
|
674
692
|
{
|
|
675
693
|
type: "button",
|
|
@@ -681,14 +699,14 @@ function SlotTextField({
|
|
|
681
699
|
},
|
|
682
700
|
format.name
|
|
683
701
|
)) }),
|
|
684
|
-
multiline ? /* @__PURE__ */ (0,
|
|
702
|
+
multiline ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("textarea", { ref: setControl, rows: 4, ...shared }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { ref: setControl, type: "text", ...shared })
|
|
685
703
|
]
|
|
686
704
|
}
|
|
687
705
|
);
|
|
688
706
|
}
|
|
689
707
|
|
|
690
708
|
// src/components/step-indicator.tsx
|
|
691
|
-
var
|
|
709
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
692
710
|
var defaultStatusLabels = {
|
|
693
711
|
done: "Done",
|
|
694
712
|
current: "Current",
|
|
@@ -700,21 +718,21 @@ var markerClass = {
|
|
|
700
718
|
upcoming: ""
|
|
701
719
|
};
|
|
702
720
|
function StepIndicator({ steps, statusLabels, className }) {
|
|
703
|
-
return /* @__PURE__ */ (0,
|
|
721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ol", { className: cn("step-indicator", className), children: steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
704
722
|
"li",
|
|
705
723
|
{
|
|
706
724
|
className: "step-indicator-step",
|
|
707
725
|
"aria-current": step.status === "current" ? "step" : void 0,
|
|
708
726
|
children: [
|
|
709
|
-
/* @__PURE__ */ (0,
|
|
727
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
710
728
|
"span",
|
|
711
729
|
{
|
|
712
730
|
className: cn("step-indicator-marker", markerClass[step.status]),
|
|
713
731
|
"aria-hidden": "true",
|
|
714
|
-
children: step.status === "done" ? /* @__PURE__ */ (0,
|
|
732
|
+
children: step.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CheckIcon, { className: "step-indicator-icon" }) : index + 1
|
|
715
733
|
}
|
|
716
734
|
),
|
|
717
|
-
/* @__PURE__ */ (0,
|
|
735
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
718
736
|
"span",
|
|
719
737
|
{
|
|
720
738
|
className: cn(
|
|
@@ -724,7 +742,7 @@ function StepIndicator({ steps, statusLabels, className }) {
|
|
|
724
742
|
children: step.label
|
|
725
743
|
}
|
|
726
744
|
),
|
|
727
|
-
/* @__PURE__ */ (0,
|
|
745
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "visually-hidden", children: statusLabels?.[step.status] ?? defaultStatusLabels[step.status] })
|
|
728
746
|
]
|
|
729
747
|
},
|
|
730
748
|
index
|
|
@@ -733,7 +751,7 @@ function StepIndicator({ steps, statusLabels, className }) {
|
|
|
733
751
|
|
|
734
752
|
// src/components/switch.tsx
|
|
735
753
|
var import_react6 = require("react");
|
|
736
|
-
var
|
|
754
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
737
755
|
function ignorePress(event) {
|
|
738
756
|
event.preventDefault();
|
|
739
757
|
}
|
|
@@ -760,8 +778,8 @@ function Switch({
|
|
|
760
778
|
if (checked === void 0) setOwnChecked(next);
|
|
761
779
|
onCheckedChange?.(next);
|
|
762
780
|
};
|
|
763
|
-
return /* @__PURE__ */ (0,
|
|
764
|
-
/* @__PURE__ */ (0,
|
|
781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: cn("switch", className), children: [
|
|
782
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
765
783
|
"button",
|
|
766
784
|
{
|
|
767
785
|
type: "button",
|
|
@@ -775,10 +793,10 @@ function Switch({
|
|
|
775
793
|
disabled,
|
|
776
794
|
onMouseDown: loading ? ignorePress : void 0,
|
|
777
795
|
onClick: toggle,
|
|
778
|
-
children: /* @__PURE__ */ (0,
|
|
796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "switch-thumb", "aria-hidden": "true" })
|
|
779
797
|
}
|
|
780
798
|
),
|
|
781
|
-
/* @__PURE__ */ (0,
|
|
799
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
782
800
|
"label",
|
|
783
801
|
{
|
|
784
802
|
id: labelId,
|
|
@@ -787,14 +805,14 @@ function Switch({
|
|
|
787
805
|
children: label
|
|
788
806
|
}
|
|
789
807
|
),
|
|
790
|
-
loading ? /* @__PURE__ */ (0,
|
|
791
|
-
name && isChecked && !disabled ? /* @__PURE__ */ (0,
|
|
808
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Spinner, { className: "switch-spinner" }) : null,
|
|
809
|
+
name && isChecked && !disabled ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("input", { type: "hidden", name, value: "on" }) : null
|
|
792
810
|
] });
|
|
793
811
|
}
|
|
794
812
|
|
|
795
813
|
// src/components/variable-picker.tsx
|
|
796
814
|
var import_react7 = require("react");
|
|
797
|
-
var
|
|
815
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
798
816
|
function liquidToken(name) {
|
|
799
817
|
return `{{ ${name} }}`;
|
|
800
818
|
}
|
|
@@ -861,8 +879,8 @@ function VariablePicker({ variables, targetRef, className }) {
|
|
|
861
879
|
const onItemBlur = (event) => {
|
|
862
880
|
if (!menu.current?.contains(event.relatedTarget)) setOpen(false);
|
|
863
881
|
};
|
|
864
|
-
return /* @__PURE__ */ (0,
|
|
865
|
-
/* @__PURE__ */ (0,
|
|
882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: cn("variable-picker", className), children: [
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
866
884
|
"button",
|
|
867
885
|
{
|
|
868
886
|
ref: trigger,
|
|
@@ -881,7 +899,7 @@ function VariablePicker({ variables, targetRef, className }) {
|
|
|
881
899
|
children: "Insert variable"
|
|
882
900
|
}
|
|
883
901
|
),
|
|
884
|
-
open ? /* @__PURE__ */ (0,
|
|
902
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
885
903
|
"div",
|
|
886
904
|
{
|
|
887
905
|
ref: menu,
|
|
@@ -889,7 +907,7 @@ function VariablePicker({ variables, targetRef, className }) {
|
|
|
889
907
|
role: "menu",
|
|
890
908
|
"aria-label": "Variables",
|
|
891
909
|
className: "variable-picker-menu",
|
|
892
|
-
children: variables.map((variable, index) => /* @__PURE__ */ (0,
|
|
910
|
+
children: variables.map((variable, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
893
911
|
"button",
|
|
894
912
|
{
|
|
895
913
|
ref: (node) => {
|
|
@@ -904,8 +922,8 @@ function VariablePicker({ variables, targetRef, className }) {
|
|
|
904
922
|
onKeyDown: (event) => onItemKeyDown(event, index),
|
|
905
923
|
onBlur: onItemBlur,
|
|
906
924
|
children: [
|
|
907
|
-
/* @__PURE__ */ (0,
|
|
908
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "variable-picker-item-label", children: variable.label }),
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { className: "variable-picker-item-token", children: liquidToken(variable.name) })
|
|
909
927
|
]
|
|
910
928
|
},
|
|
911
929
|
variable.name
|
|
@@ -933,6 +951,7 @@ function VariablePicker({ variables, targetRef, className }) {
|
|
|
933
951
|
PreviewFrame,
|
|
934
952
|
Section,
|
|
935
953
|
SectionHeader,
|
|
954
|
+
Select,
|
|
936
955
|
SlotTextField,
|
|
937
956
|
Spinner,
|
|
938
957
|
StepIndicator,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/cn.ts","../src/components/badge.tsx","../src/components/block-list.tsx","../src/components/button.tsx","../src/components/card.tsx","../src/components/checklist.tsx","../src/components/check-icon.tsx","../src/components/code-area.tsx","../src/components/field.tsx","../src/components/confirm-dialog.tsx","../src/components/container.tsx","../src/components/feedback.tsx","../src/components/preview-frame.tsx","../src/components/section.tsx","../src/components/slot-text-field.tsx","../src/components/text-selection.ts","../src/components/step-indicator.tsx","../src/components/switch.tsx","../src/components/variable-picker.tsx"],"sourcesContent":["export { cn } from './cn';\n\nexport type { BadgeProps, BadgeVariant } from './components/badge';\nexport { Badge } from './components/badge';\nexport type { BlockListItem, BlockListProps } from './components/block-list';\nexport { BlockList } from './components/block-list';\nexport type { ButtonProps, ButtonSize, ButtonVariant } from './components/button';\nexport { Button } from './components/button';\nexport type { CardPadding, CardProps } from './components/card';\nexport { Card } from './components/card';\nexport type {\n ChecklistProps,\n ChecklistRowProps,\n ChecklistSkeletonProps,\n} from './components/checklist';\nexport { Checklist, ChecklistRow, ChecklistSkeleton } from './components/checklist';\nexport type { CodeAreaProps } from './components/code-area';\nexport { CodeArea } from './components/code-area';\nexport type { ConfirmDialogProps } from './components/confirm-dialog';\nexport { ConfirmDialog } from './components/confirm-dialog';\nexport type { ContainerProps } from './components/container';\nexport { Container } from './components/container';\nexport type { EmptyStateProps, SpinnerProps } from './components/feedback';\nexport { EmptyState, Spinner } from './components/feedback';\nexport type { FieldProps, InputProps, LabelProps } from './components/field';\nexport { Field, Input, Label } from './components/field';\nexport type { PreviewFrameProps } from './components/preview-frame';\nexport { PreviewFrame } from './components/preview-frame';\nexport type { SectionHeaderProps, SectionProps } from './components/section';\nexport { Section, SectionHeader } from './components/section';\nexport type { SlotTextFieldProps } from './components/slot-text-field';\nexport { SlotTextField } from './components/slot-text-field';\nexport type {\n StepIndicatorProps,\n StepIndicatorStep,\n StepStatus,\n} from './components/step-indicator';\nexport { StepIndicator } from './components/step-indicator';\nexport type { SwitchProps } from './components/switch';\nexport { Switch } from './components/switch';\nexport type { VariablePickerProps } from './components/variable-picker';\nexport { VariablePicker } from './components/variable-picker';\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Merge class names, resolving conflicting Tailwind utilities (last wins).\n * Mirrors the helper used across the FloPay frontends so consumers can extend\n * any primitive's classes safely.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import type { HTMLAttributes } from 'react';\nimport { cn } from '../cn';\n\nexport type BadgeVariant = 'neutral' | 'success' | 'warning' | 'danger' | 'info';\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n /** Render a leading status dot. */\n dot?: boolean;\n /** Semantic color. `neutral` is the default outlined pill. */\n variant?: BadgeVariant;\n}\n\nconst variantClass: Record<BadgeVariant, string> = {\n neutral: '',\n success: 'badge-success',\n warning: 'badge-warning',\n danger: 'badge-danger',\n info: 'badge-info',\n};\n\n/** Pill badge — neutral by default, or a semantic variant, optionally with a dot. */\nexport function Badge({\n dot = false,\n variant = 'neutral',\n className,\n children,\n ...props\n}: BadgeProps) {\n return (\n <span className={cn('badge', variantClass[variant], className)} {...props}>\n {dot ? <span className=\"badge-dot\" /> : null}\n {children}\n </span>\n );\n}\n","import { type DragEvent, type ReactNode, useLayoutEffect, useRef } from 'react';\nimport { cn } from '../cn';\n\ntype MoveLabel = 'Move up' | 'Move down';\n\n/**\n * Where keyboard focus goes once the parent passes the `items` that follow a button press: back\n * to the moved row's button, or to a neighbour's Delete after the focused row was removed.\n */\ntype PendingFocus = { movedId: string; label: MoveLabel } | { deletedAt: number };\n\nexport interface BlockListItem {\n id: string;\n /** A locked item never moves, has no handle or controls, and nothing moves past it. */\n locked?: boolean;\n}\n\nexport interface BlockListProps<T extends BlockListItem = BlockListItem> {\n /** The rows, in the order shown. Ids must be unique: rows are keyed by them. */\n items: T[];\n renderItem: (item: T) => ReactNode;\n /** Called once per move or delete with a new array of the caller's own item objects. */\n onChange: (nextItems: T[]) => void;\n className?: string;\n}\n\n/**\n * True when the item at `from` may move to index `to`: a real move inside the list that neither\n * moves a locked item nor carries an unlocked one past (or onto the place of) a locked item.\n */\nfunction canMove(items: readonly BlockListItem[], from: number, to: number): boolean {\n if (from === to || to < 0 || to >= items.length) return false;\n const low = Math.min(from, to);\n const high = Math.max(from, to);\n for (let index = low; index <= high; index += 1) {\n if (items[index]?.locked) return false;\n }\n return true;\n}\n\n/** A copy of `items` with the item at `from` taken out and inserted at `to`. */\nfunction moved<T>(items: readonly T[], from: number, to: number): T[] {\n const next = items.slice();\n const [item] = next.splice(from, 1) as [T];\n next.splice(to, 0, item);\n return next;\n}\n\n/** True when focus went nowhere useful: to `<body>`, to nothing, or onto a now-disabled button. */\nfunction focusWasLost(): boolean {\n const active = document.activeElement;\n return (\n !active || active === document.body || (active instanceof HTMLButtonElement && active.disabled)\n );\n}\n\n/** Row `at`'s enabled button with this label. The list renders one `li` per item, in order. */\nfunction enabledButton(\n rows: HTMLCollection,\n at: number,\n label: MoveLabel | 'Delete',\n): HTMLButtonElement | null {\n return (\n rows[at]?.querySelector<HTMLButtonElement>(`button[aria-label=\"${label}\"]:enabled`) ?? null\n );\n}\n\n/** After a delete at `deletedAt`: the first unlocked row at or after it, else the nearest before. */\nfunction rowAfterDelete(items: readonly BlockListItem[], deletedAt: number): number {\n for (let at = deletedAt; at < items.length; at += 1) {\n if (!items[at]?.locked) return at;\n }\n for (let at = Math.min(deletedAt, items.length) - 1; at >= 0; at -= 1) {\n if (!items[at]?.locked) return at;\n }\n return -1;\n}\n\n/** The button that takes focus once the parent has passed the items that follow a button press. */\nfunction focusTarget(\n rows: HTMLCollection,\n items: readonly BlockListItem[],\n pending: PendingFocus,\n): HTMLButtonElement | null {\n if ('deletedAt' in pending) {\n const at = rowAfterDelete(items, pending.deletedAt);\n return at < 0 ? null : enabledButton(rows, at, 'Delete');\n }\n const at = items.findIndex((item) => item.id === pending.movedId);\n if (at < 0) return null;\n const other: MoveLabel = pending.label === 'Move up' ? 'Move down' : 'Move up';\n return (\n enabledButton(rows, at, pending.label) ??\n enabledButton(rows, at, other) ??\n enabledButton(rows, at, 'Delete')\n );\n}\n\n/** Decorative icons drawn in `currentColor`; each button's name comes from its `aria-label`. */\nconst icons = {\n grip: (\n <>\n <circle cx=\"6\" cy=\"4\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"4\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"12\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"12\" r=\"1.25\" />\n </>\n ),\n up: <path d=\"M8 12.5v-9M4 7.5l4-4 4 4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />,\n down: <path d=\"M8 3.5v9M4 8.5l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />,\n delete: (\n <path d=\"M4.5 4.5l7 7M11.5 4.5l-7 7\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n ),\n};\n\nfunction Icon({ name }: { name: keyof typeof icons }) {\n return (\n <svg\n className=\"block-list-icon\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n {icons[name]}\n </svg>\n );\n}\n\n/**\n * A reorderable list of blocks. Each unlocked row has a drag handle (native HTML5 drag and drop)\n * and native \"Move up\", \"Move down\" and \"Delete\" buttons, so Tab, Enter and Space work with no\n * extra wiring. The handle is not focusable and hidden from assistive technology: keyboard and\n * screen-reader users reorder with the buttons. Locked rows (a header or footer, say) show their\n * content only; they never move, and no item moves past them by button or by drop. A button that\n * would do so is `disabled`, and such a drop is ignored.\n *\n * Controlled: the list keeps no order of its own. Every action calls `onChange` once with the new\n * order, and the rows move when the parent passes the new `items`. Only the id being dragged is\n * held here, between `dragstart` and the drop. Rendering touches no browser API, so the list\n * renders to static markup on the server.\n *\n * Keyboard focus stays in the list. When the parent passes the new `items`, a moved row's button\n * takes focus back (its other Move button if that one is now disabled, else its Delete), and after\n * a delete the next unlocked row's Delete takes it (else the nearest one before). This happens only\n * when focus was lost to `<body>` or left on a disabled button, never when it went elsewhere.\n */\nexport function BlockList<T extends BlockListItem>({\n items,\n renderItem,\n onChange,\n className,\n}: BlockListProps<T>) {\n const draggedId = useRef<string | null>(null);\n const list = useRef<HTMLUListElement>(null);\n const pendingFocus = useRef<PendingFocus | null>(null);\n\n // Runs after the parent passed new items, before paint. Effects never run on the server.\n useLayoutEffect(() => {\n const pending = pendingFocus.current;\n pendingFocus.current = null;\n const rows = list.current?.children;\n if (pending && rows && focusWasLost()) focusTarget(rows, items, pending)?.focus();\n }, [items]);\n\n const moveByButton = (id: string, index: number, label: MoveLabel) => {\n pendingFocus.current = { movedId: id, label };\n onChange(moved(items, index, label === 'Move up' ? index - 1 : index + 1));\n };\n\n const deleteByButton = (index: number) => {\n pendingFocus.current = { deletedAt: index };\n onChange(items.filter((_, other) => other !== index));\n };\n\n /** Index of the item being dragged when it may be dropped on row `index`, else -1. */\n const dropSource = (index: number): number => {\n const from = items.findIndex((item) => item.id === draggedId.current);\n return from >= 0 && canMove(items, from, index) ? from : -1;\n };\n\n const startDrag = (event: DragEvent<HTMLElement>, id: string) => {\n draggedId.current = id;\n // A button press whose change the parent never applied must not move focus after a drop.\n pendingFocus.current = null;\n // jsdom (and some synthetic drags) send no dataTransfer: the id above is what the drop reads.\n const transfer: DataTransfer | null | undefined = event.dataTransfer;\n if (!transfer) return;\n transfer.effectAllowed = 'move';\n // Firefox only starts a drag that carries data.\n transfer.setData('text/plain', id);\n const row = event.currentTarget.closest('li');\n if (row) transfer.setDragImage(row, 0, 0);\n };\n\n const endDrag = () => {\n draggedId.current = null;\n };\n\n const dragOver = (event: DragEvent<HTMLLIElement>, index: number) => {\n if (dropSource(index) < 0) return;\n // Cancelling dragover marks the row as a drop target, so the browser fires drop on it.\n event.preventDefault();\n const transfer: DataTransfer | null | undefined = event.dataTransfer;\n if (transfer) transfer.dropEffect = 'move';\n };\n\n const drop = (event: DragEvent<HTMLLIElement>, index: number) => {\n const from = dropSource(index);\n draggedId.current = null;\n if (from < 0) return;\n event.preventDefault();\n onChange(moved(items, from, index));\n };\n\n return (\n <ul ref={list} className={cn('block-list', className)}>\n {items.map((item, index) => (\n // biome-ignore lint/a11y/noNoninteractiveElementInteractions: the row is only a pointer drop target for the handle's native drag; keyboard and screen-reader users reorder with the row's Move buttons, so it needs no role or focus of its own\n <li\n key={item.id}\n className={cn('block-list-row', item.locked && 'block-list-row-locked')}\n onDragOver={(event) => dragOver(event, index)}\n onDrop={(event) => drop(event, index)}\n >\n {item.locked ? null : (\n <span\n className=\"block-list-handle\"\n draggable\n aria-hidden=\"true\"\n onDragStart={(event) => startDrag(event, item.id)}\n onDragEnd={endDrag}\n >\n <Icon name=\"grip\" />\n </span>\n )}\n <div className=\"block-list-content\">{renderItem(item)}</div>\n {item.locked ? null : (\n <div className=\"block-list-controls\">\n <button\n type=\"button\"\n className=\"block-list-button\"\n aria-label=\"Move up\"\n disabled={!canMove(items, index, index - 1)}\n onClick={() => moveByButton(item.id, index, 'Move up')}\n >\n <Icon name=\"up\" />\n </button>\n <button\n type=\"button\"\n className=\"block-list-button\"\n aria-label=\"Move down\"\n disabled={!canMove(items, index, index + 1)}\n onClick={() => moveByButton(item.id, index, 'Move down')}\n >\n <Icon name=\"down\" />\n </button>\n <button\n type=\"button\"\n className=\"block-list-button block-list-button-delete\"\n aria-label=\"Delete\"\n onClick={() => deleteByButton(index)}\n >\n <Icon name=\"delete\" />\n </button>\n </div>\n )}\n </li>\n ))}\n </ul>\n );\n}\n","import type { ButtonHTMLAttributes } from 'react';\nimport { cn } from '../cn';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'outline';\nexport type ButtonSize = 'md' | 'sm';\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n}\n\nconst variantClass: Record<ButtonVariant, string> = {\n primary: 'btn-primary',\n secondary: 'btn-secondary',\n outline: 'btn-outline',\n};\n\nexport function Button({\n variant = 'primary',\n size = 'md',\n className,\n type = 'button',\n ...props\n}: ButtonProps) {\n return (\n <button\n type={type}\n className={cn(variantClass[variant], size === 'sm' && 'btn-sm', className)}\n {...props}\n />\n );\n}\n","import type { HTMLAttributes } from 'react';\nimport { cn } from '../cn';\n\nexport type CardPadding = 'none' | 'sm' | 'md' | 'lg';\n\nexport interface CardProps extends HTMLAttributes<HTMLDivElement> {\n /** Inner padding. Defaults to `md` (28px); use `none` to supply your own. */\n padding?: CardPadding;\n /** Add pointer cursor + hover elevation (for clickable cards). */\n interactive?: boolean;\n}\n\n/** Bordered surface card. Static by default; opt into hover with `interactive`. */\nexport function Card({ padding = 'md', interactive = false, className, ...props }: CardProps) {\n return (\n <div\n className={cn(\n 'card',\n padding !== 'none' && `card-pad-${padding}`,\n interactive && 'card-interactive',\n className,\n )}\n {...props}\n />\n );\n}\n","import { type ComponentType, type ElementType, type ReactNode, useId } from 'react';\nimport { cn } from '../cn';\nimport { Badge } from './badge';\nimport { CheckIcon } from './check-icon';\n\nexport interface ChecklistProps {\n /** The `ChecklistRow`s (or any list items) of the list. */\n children?: ReactNode;\n className?: string;\n}\n\nexport interface ChecklistRowProps {\n /** Text of the row. Always rendered. */\n label: ReactNode;\n /** Filled tick on the `success` token when true; an empty tick otherwise. */\n done?: boolean;\n /** Optional text on the right of the row. */\n status?: ReactNode;\n /** Shows an \"Optional\" tag next to the label. */\n optional?: boolean;\n /** Makes the whole row a single link. */\n href?: string;\n /** Component used for the link (default `a`), e.g. `next/link`. Receives `href`, `className` and the row content. */\n linkAs?: ComponentType<{ href: string; className?: string; children?: ReactNode }>;\n /** Overrides the visually hidden state wording (\"Done\", \"Not done\"). */\n statusLabels?: { done?: string; notDone?: string };\n className?: string;\n}\n\nexport interface ChecklistSkeletonProps {\n /** Number of placeholder rows. Defaults to 3. */\n rows?: number;\n className?: string;\n}\n\n/** A vertical tick list, e.g. a setup checklist. Its children are `ChecklistRow`s. */\nexport function Checklist({ children, className }: ChecklistProps) {\n return <ul className={cn('checklist', className)}>{children}</ul>;\n}\n\n/**\n * One row of a `Checklist`: a tick (filled on the `success` token when `done`, empty otherwise),\n * the label, an optional neutral \"Optional\" `Badge` and optional `status` text on the right. The\n * tick is decorative; the state is said in visually hidden text (\"Done\" / \"Not done\", or\n * `statusLabels`), so it is never conveyed by the graphic alone. With `href` the whole row is one\n * link, rendered as `<a>` or through `linkAs` (e.g. `next/link`) so the package never imports a\n * router.\n */\nexport function ChecklistRow({\n label,\n done = false,\n status,\n optional = false,\n href,\n linkAs,\n statusLabels,\n className,\n}: ChecklistRowProps) {\n const state = done ? (statusLabels?.done ?? 'Done') : (statusLabels?.notDone ?? 'Not done');\n const content = (\n <>\n <span className={cn('checklist-tick', done && 'checklist-tick-done')} aria-hidden=\"true\">\n {done ? <CheckIcon className=\"checklist-tick-icon\" /> : null}\n </span>\n <span className=\"checklist-row-label\">{label}</span>\n <span className=\"visually-hidden\">{state}</span>\n {optional ? <Badge>Optional</Badge> : null}\n {status ? <span className=\"checklist-row-status\">{status}</span> : null}\n </>\n );\n const Link: ElementType = linkAs ?? 'a';\n\n return (\n <li className={cn('checklist-row', className)}>\n {href ? (\n <Link href={href} className=\"checklist-row-body checklist-row-link\">\n {content}\n </Link>\n ) : (\n <div className=\"checklist-row-body\">{content}</div>\n )}\n </li>\n );\n}\n\n/**\n * Loading form of a `Checklist`: `rows` placeholder rows (3 by default) on the `bg-muted` token,\n * inside a `role=\"status\"` region named by visually hidden \"Loading\" text. The placeholders are\n * hidden from assistive tech.\n */\nexport function ChecklistSkeleton({ rows = 3, className }: ChecklistSkeletonProps) {\n const labelId = useId();\n\n return (\n <div className={cn('checklist-skeleton', className)} role=\"status\" aria-labelledby={labelId}>\n <span id={labelId} className=\"visually-hidden\">\n Loading\n </span>\n {Array.from({ length: rows }, (_, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: identical stateless placeholders with no identity of their own, so the position is the only key\n <div key={index} className=\"checklist-skeleton-row\" aria-hidden=\"true\">\n <span className=\"checklist-skeleton-tick\" />\n <span className=\"checklist-skeleton-line\" />\n </div>\n ))}\n </div>\n );\n}\n","/** Decorative check mark drawn in `currentColor`. Hidden from assistive tech: callers say the state in text. */\nexport function CheckIcon({ className }: { className?: string }) {\n return (\n <svg className={className} viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M3.5 8.5l3 3 6-7\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n","import { type ChangeEventHandler, type ReactNode, type Ref, useId } from 'react';\nimport { Field } from './field';\n\nexport interface CodeAreaProps {\n label: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n value?: string;\n defaultValue?: string;\n onChange?: ChangeEventHandler<HTMLTextAreaElement>;\n /** Ref to the underlying textarea (the target a `VariablePicker` attaches to). */\n ref?: Ref<HTMLTextAreaElement>;\n id?: string;\n name?: string;\n className?: string;\n}\n\n/**\n * Labelled monospace textarea for custom HTML / Liquid source. No editor dependency (CTO decision\n * 1): spellcheck, autocapitalize, autocomplete and soft wrapping are off, and Tab keeps its normal\n * job of moving focus, so the field never traps keyboard users.\n */\nexport function CodeArea({\n label,\n hint,\n error,\n value,\n defaultValue,\n onChange,\n ref,\n id,\n name,\n className,\n}: CodeAreaProps) {\n const generatedId = useId();\n const controlId = id ?? generatedId;\n\n return (\n <Field label={label} hint={hint} error={error} htmlFor={controlId} className={className}>\n <textarea\n ref={ref}\n id={controlId}\n name={name}\n className=\"field code-area\"\n rows={12}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n spellCheck={false}\n autoCapitalize=\"off\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n wrap=\"off\"\n aria-invalid={error ? true : undefined}\n />\n </Field>\n );\n}\n","import type { InputHTMLAttributes, LabelHTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../cn';\n\nexport type InputProps = InputHTMLAttributes<HTMLInputElement>;\n\n/** Token-aligned text input (the `.field` look: border, surface, brand focus ring). */\nexport function Input({ className, ...props }: InputProps) {\n return <input className={cn('field', className)} {...props} />;\n}\n\nexport type LabelProps = LabelHTMLAttributes<HTMLLabelElement>;\n\nexport function Label({ className, ...props }: LabelProps) {\n // biome-ignore lint/a11y/noLabelWithoutControl: primitive pass-through: the caller supplies the control association (htmlFor, or the input as a child) through the spread props, which the rule cannot see\n return <label className={cn('field-label', className)} {...props} />;\n}\n\nexport interface FieldProps {\n label?: ReactNode;\n /** Helper text shown below the control (hidden when `error` is set). */\n hint?: ReactNode;\n /** Error text shown below the control (takes precedence over `hint`). */\n error?: ReactNode;\n /** `htmlFor` for the label, matching the control's id. */\n htmlFor?: string;\n className?: string;\n children: ReactNode;\n}\n\n/** Labelled field wrapper: optional label above and hint/error below the control. */\nexport function Field({ label, hint, error, htmlFor, className, children }: FieldProps) {\n const message = error || hint;\n return (\n <div className={cn('field-group', className)}>\n {label ? <Label htmlFor={htmlFor}>{label}</Label> : null}\n {children}\n {message ? <span className={error ? 'field-error' : 'field-hint'}>{message}</span> : null}\n </div>\n );\n}\n","import { type MouseEvent, type ReactNode, useEffect, useId, useRef } from 'react';\nimport { Button } from './button';\n\nexport interface ConfirmDialogProps {\n open: boolean;\n title: ReactNode;\n description: ReactNode;\n confirmLabel: string;\n cancelLabel: string;\n onConfirm: () => void;\n onCancel: () => void;\n /** While true both buttons are disabled and the Escape / backdrop cancel paths are ignored. */\n confirming?: boolean;\n}\n\n/** What Tab and Shift+Tab may land on inside the panel; disabled controls and `tabindex=\"-1\"` are skipped. */\nconst FOCUSABLE = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ');\n\n/**\n * Where Tab (or Shift+Tab with `backwards`) moves focus: the next focusable element in the panel,\n * wrapping at either end, or the panel itself when nothing in it is focusable.\n */\nfunction nextFocusTarget(panel: HTMLElement, backwards: boolean): HTMLElement {\n const focusable = Array.from(panel.querySelectorAll<HTMLElement>(FOCUSABLE));\n const last = focusable.length - 1;\n if (last < 0) return panel;\n const index = focusable.indexOf(document.activeElement as HTMLElement);\n if (backwards) return focusable[index <= 0 ? last : index - 1] ?? panel;\n return focusable[index >= last ? 0 : index + 1] ?? panel;\n}\n\n/**\n * The open dialog. Mounted only while `open`, so recording the opener on mount and restoring it on\n * unmount covers every way the dialog closes: Cancel, Confirm, Escape, the backdrop, the parent\n * passing `open={false}`, and the parent unmounting it while open.\n */\nfunction OpenConfirmDialog({\n title,\n description,\n confirmLabel,\n cancelLabel,\n onConfirm,\n onCancel,\n confirming = false,\n}: Omit<ConfirmDialogProps, 'open'>) {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n const cancelId = `${id}-cancel`;\n const panelRef = useRef<HTMLDivElement>(null);\n\n // Declared first so it records the opener before the effect below moves focus into the dialog.\n useEffect(() => {\n const opener = document.activeElement;\n return () => {\n if (opener instanceof HTMLElement && opener.isConnected) opener.focus();\n };\n }, []);\n\n // On open, focus Cancel (the safe default). While confirming both buttons are disabled, so a focused\n // button would drop focus to the body: move it to the panel instead, and back to Cancel afterwards.\n useEffect(() => {\n const panel = panelRef.current;\n if (!panel) return;\n const active = document.activeElement;\n if (confirming) {\n if (!panel.contains(active) || active instanceof HTMLButtonElement) panel.focus();\n } else if (!panel.contains(active) || active === panel) {\n document.getElementById(cancelId)?.focus();\n }\n }, [confirming, cancelId]);\n\n // Escape works wherever focus is, and Tab / Shift+Tab wrap over the panel's focusable elements.\n // The listener exists only while the dialog is open.\n useEffect(() => {\n function onKeyDown(event: KeyboardEvent) {\n const panel = panelRef.current;\n if (!panel) return;\n if (event.key === 'Escape') {\n if (!confirming) onCancel();\n } else if (event.key === 'Tab') {\n event.preventDefault();\n nextFocusTarget(panel, event.shiftKey).focus();\n }\n }\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [confirming, onCancel]);\n\n // A click goes to the common ancestor of mousedown and mouseup, so a drag that starts in the panel\n // (selecting the title or description) and ends on the backdrop lands here too: cancel only when\n // the press also started on the backdrop.\n const pressStartedOnBackdrop = useRef(false);\n\n const onBackdropMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n pressStartedOnBackdrop.current = event.target === event.currentTarget;\n // Keep focus inside the dialog: a press on the backdrop must not move focus to the body.\n if (pressStartedOnBackdrop.current) event.preventDefault();\n };\n\n const onBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n const startedOnBackdrop = pressStartedOnBackdrop.current;\n pressStartedOnBackdrop.current = false;\n if (startedOnBackdrop && event.target === event.currentTarget && !confirming) onCancel();\n };\n\n return (\n // biome-ignore lint/a11y/noNoninteractiveElementInteractions: the backdrop click is only a pointer shortcut for Cancel; keyboard and screen-reader users have the Cancel button and Escape, so the backdrop needs no role or focus of its own\n // biome-ignore lint/a11y/noStaticElementInteractions: as above, the backdrop is a pointer-only shortcut for Cancel and must not be announced as a control\n // biome-ignore lint/a11y/useKeyWithClickEvents: the keyboard equivalent of a backdrop click is Escape, handled by the document listener while open\n <div\n className=\"confirm-dialog-backdrop\"\n onMouseDown={onBackdropMouseDown}\n onClick={onBackdropClick}\n >\n <div\n ref={panelRef}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n tabIndex={-1}\n className=\"confirm-dialog\"\n >\n <h2 id={titleId} className=\"confirm-dialog-title\">\n {title}\n </h2>\n <div id={descriptionId} className=\"confirm-dialog-description\">\n {description}\n </div>\n <div className=\"confirm-dialog-actions\">\n <Button id={cancelId} variant=\"outline\" disabled={confirming} onClick={onCancel}>\n {cancelLabel}\n </Button>\n <Button variant=\"primary\" disabled={confirming} onClick={onConfirm}>\n {confirmLabel}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * A confirm/cancel alert dialog (WAI-ARIA alertdialog pattern), rendered in place as a fixed backdrop\n * around a panel, so it server-renders without a portal. Nothing renders while `open` is false.\n *\n * Confirm calls `onConfirm`; Cancel, Escape and a click on the backdrop itself call `onCancel`, and\n * a click on the panel never does, nor does a drag that starts in the panel and ends on the\n * backdrop. On open, focus moves to Cancel, the safe default; Tab and\n * Shift+Tab stay inside the dialog; on close or unmount focus returns to the element that had it\n * when the dialog opened, if that element is still in the document. While `confirming`, both\n * buttons are disabled and Escape and the backdrop are ignored, so a request in flight cannot be\n * dismissed; focus moves to the panel rather than dropping to the page. The wording is the caller's:\n * `confirmLabel` and `cancelLabel` have no defaults.\n */\nexport function ConfirmDialog({ open, ...props }: ConfirmDialogProps) {\n if (!open) return null;\n return <OpenConfirmDialog {...props} />;\n}\n","import type { HTMLAttributes } from 'react';\nimport { cn } from '../cn';\n\nexport type ContainerProps = HTMLAttributes<HTMLDivElement>;\n\n/** Centered, max-width content wrapper (var(--max-w)) with horizontal padding. */\nexport function Container({ className, ...props }: ContainerProps) {\n return <div className={cn('container', className)} {...props} />;\n}\n","import type { HTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../cn';\n\nexport interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n /** Wrap in a centered, padded block (for loading states in a panel). */\n center?: boolean;\n}\n\n/** Brand-colored loading spinner. */\nexport function Spinner({ center = false, className, ...props }: SpinnerProps) {\n const spinner = (\n <span className={cn('spinner', className)} role=\"status\" aria-label=\"Loading\" {...props} />\n );\n return center ? <div className=\"spinner-center\">{spinner}</div> : spinner;\n}\n\nexport interface EmptyStateProps {\n title: ReactNode;\n description?: ReactNode;\n /** Optional icon rendered in the circular badge above the title. */\n icon?: ReactNode;\n className?: string;\n}\n\n/** Centered \"nothing here yet\" placeholder for empty lists/tables. */\nexport function EmptyState({ title, description, icon, className }: EmptyStateProps) {\n return (\n <div className={cn('empty-state', className)}>\n {icon ? <div className=\"empty-state-icon\">{icon}</div> : null}\n <h3 className=\"empty-state-title\">{title}</h3>\n {description ? <p className=\"empty-state-desc\">{description}</p> : null}\n </div>\n );\n}\n","import { cn } from '../cn';\n\nexport interface PreviewFrameProps {\n /** HTML shown inside the isolated frame. */\n html: string;\n /** Accessible title of the iframe. */\n title: string;\n className?: string;\n}\n\n/**\n * Container that previews client-authored email HTML in an iframe. The HTML goes in `srcdoc` and\n * the frame has the strictest sandbox (`sandbox=\"\"`, CTO decision 6): no scripts, forms, popups or\n * same-origin access, so a preview can never reach the dashboard session. Size it through\n * `className` on the container; the frame fills it.\n */\nexport function PreviewFrame({ html, title, className }: PreviewFrameProps) {\n return (\n <div className={cn('preview-frame', className)}>\n <iframe className=\"preview-frame-iframe\" title={title} srcDoc={html} sandbox=\"\" />\n </div>\n );\n}\n","import type { HTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../cn';\n\nexport type SectionProps = HTMLAttributes<HTMLElement>;\n\n/** Vertical page section with max-width and standard padding. */\nexport function Section({ className, ...props }: SectionProps) {\n return <section className={cn('section', className)} {...props} />;\n}\n\nexport interface SectionHeaderProps {\n /** Small eyebrow label above the title (brand colored). */\n label?: ReactNode;\n title: ReactNode;\n description?: ReactNode;\n className?: string;\n}\n\n/** Centered section heading: optional label, title, optional description. */\nexport function SectionHeader({ label, title, description, className }: SectionHeaderProps) {\n return (\n <div className={cn('section-center', className)}>\n {label ? <div className=\"section-label\">{label}</div> : null}\n <h2 className=\"section-title\">{title}</h2>\n {description ? <p className=\"section-desc\">{description}</p> : null}\n </div>\n );\n}\n","import {\n type ChangeEventHandler,\n type ReactNode,\n type Ref,\n useCallback,\n useId,\n useRef,\n} from 'react';\nimport { Field } from './field';\nimport {\n assignRef,\n editSelection,\n type TextControl,\n type TextEdit,\n watchFocus,\n} from './text-selection';\n\nexport interface SlotTextFieldProps {\n label: ReactNode;\n /** Helper text (hidden when `error` is set), as in `Field`. */\n hint?: ReactNode;\n /** Error text (takes precedence over `hint`), as in `Field`. */\n error?: ReactNode;\n /** Render a textarea instead of a single-line input. */\n multiline?: boolean;\n value?: string;\n defaultValue?: string;\n onChange?: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /** Ref to the underlying input / textarea (the target a `VariablePicker` attaches to). */\n ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;\n id?: string;\n name?: string;\n className?: string;\n}\n\nconst LINK_PLACEHOLDER = 'https://';\n\n/** Wrap the selection in a Markdown-lite marker, keeping the wrapped text selected. */\nfunction wrapWith(marker: string) {\n return (selected: string): TextEdit => ({\n text: `${marker}${selected}${marker}`,\n select: [marker.length, marker.length + selected.length],\n });\n}\n\n/** Turn the selection into `[label](https://)` and select the URL placeholder to type over. */\nfunction toLink(selected: string): TextEdit {\n const label = selected || 'link';\n const url = label.length + 3;\n return { text: `[${label}](${LINK_PLACEHOLDER})`, select: [url, url + LINK_PLACEHOLDER.length] };\n}\n\nconst FORMATS = [\n { name: 'Bold', edit: wrapWith('**') },\n { name: 'Italic', edit: wrapWith('_') },\n { name: 'Link', edit: toLink },\n] as const;\n\n/** The Markdown-lite subset (CTO decision 2) the toolbar writes, named in the default hint. */\nconst SYNTAX_HINT = 'Markdown-lite: **bold**, _italic_ and [link](https://…).';\nconst PARAGRAPH_HINT = ' A blank line starts a new paragraph.';\n\n/**\n * Labelled text field for an email slot, with a Bold / Italic / Link toolbar that writes only the\n * Markdown-lite subset. Single-line by default; `multiline` renders a textarea. Typed text reaches\n * `onChange` unchanged, and toolbar edits fire `onChange` too, so controlled parents stay in sync.\n */\nexport function SlotTextField({\n label,\n hint,\n error,\n multiline = false,\n value,\n defaultValue,\n onChange,\n ref,\n id,\n name,\n className,\n}: SlotTextFieldProps) {\n const generatedId = useId();\n const controlId = id ?? generatedId;\n const control = useRef<TextControl | null>(null);\n\n const setControl = useCallback(\n (node: TextControl | null) => {\n control.current = node;\n if (node) watchFocus(node);\n assignRef(ref, node);\n },\n [ref],\n );\n\n const shared = {\n id: controlId,\n name,\n value,\n defaultValue,\n onChange,\n className: multiline ? 'field field-multiline' : 'field',\n 'aria-invalid': error ? true : undefined,\n };\n\n return (\n <Field\n label={label}\n hint={hint ?? (multiline ? SYNTAX_HINT + PARAGRAPH_HINT : SYNTAX_HINT)}\n error={error}\n htmlFor={controlId}\n className={className}\n >\n <div className=\"slot-toolbar\">\n {FORMATS.map((format) => (\n <button\n key={format.name}\n type=\"button\"\n className=\"slot-toolbar-button\"\n onClick={() => {\n if (control.current) editSelection(control.current, format.edit);\n }}\n >\n {format.name}\n </button>\n ))}\n </div>\n {multiline ? (\n <textarea ref={setControl} rows={4} {...shared} />\n ) : (\n <input ref={setControl} type=\"text\" {...shared} />\n )}\n </Field>\n );\n}\n","import type { Ref } from 'react';\n\n/** The native controls the editor blocks edit: a `SlotTextField` input/textarea or a `CodeArea`. */\nexport type TextControl = HTMLInputElement | HTMLTextAreaElement;\n\n/** An edit at the selection: the text that replaces it, and the selection to leave inside that text. */\nexport interface TextEdit {\n text: string;\n /** Selection after the edit, as `[start, end]` offsets into `text`. */\n select: [number, number];\n}\n\nconst watched = new WeakSet<TextControl>();\nconst focused = new WeakSet<TextControl>();\n\n/**\n * Start remembering whether `control` has ever had focus. A control that never had focus has no\n * cursor the user chose, so `editSelection` appends to it instead of editing at offset 0.\n */\nexport function watchFocus(control: TextControl): void {\n if (watched.has(control)) return;\n watched.add(control);\n if (control.ownerDocument.activeElement === control) {\n focused.add(control);\n return;\n }\n control.addEventListener('focus', () => focused.add(control), { once: true });\n}\n\n/**\n * Set the value the way typing does, so React's change handler fires for a controlled control:\n * the prototype's setter bypasses React's value tracker, then an `input` event reports the change.\n */\nfunction setValueAsTyped(control: TextControl, value: string): void {\n const { set } = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(control), 'value') ?? {};\n set?.call(control, value);\n control.dispatchEvent(new Event('input', { bubbles: true }));\n}\n\n/**\n * Replace the control's selection with the edit `build` makes from the selected text (or append it,\n * when the control never had focus), fire its change handler, then return focus to it with the\n * selection the edit asks for. The Markdown-lite toolbar and the variable picker both edit through\n * this one helper, so they behave the same way.\n */\nexport function editSelection(control: TextControl, build: (selected: string) => TextEdit): void {\n const { value } = control;\n const hadFocus = focused.has(control);\n const start = hadFocus ? (control.selectionStart ?? value.length) : value.length;\n const end = hadFocus ? (control.selectionEnd ?? start) : value.length;\n const edit = build(value.slice(start, end));\n\n setValueAsTyped(control, value.slice(0, start) + edit.text + value.slice(end));\n control.focus();\n control.setSelectionRange(start + edit.select[0], start + edit.select[1]);\n}\n\n/** Point a caller's ref (callback or object) at `node`, for components that also keep their own. */\nexport function assignRef<T>(ref: Ref<T> | undefined, node: T | null): void {\n if (typeof ref === 'function') {\n ref(node);\n return;\n }\n if (ref) ref.current = node;\n}\n","import type { ReactNode } from 'react';\nimport { cn } from '../cn';\nimport { CheckIcon } from './check-icon';\n\nexport type StepStatus = 'done' | 'current' | 'upcoming';\n\nexport interface StepIndicatorStep {\n label: ReactNode;\n /** Passed by the caller; the component never works the state out itself. */\n status: StepStatus;\n}\n\nexport interface StepIndicatorProps {\n steps: StepIndicatorStep[];\n /** Overrides the visually hidden state wording (\"Done\", \"Current\", \"Upcoming\"). */\n statusLabels?: Partial<Record<StepStatus, string>>;\n className?: string;\n}\n\nconst defaultStatusLabels: Record<StepStatus, string> = {\n done: 'Done',\n current: 'Current',\n upcoming: 'Upcoming',\n};\n\nconst markerClass: Record<StepStatus, string> = {\n done: 'step-indicator-marker-done',\n current: 'step-indicator-marker-current',\n upcoming: '',\n};\n\n/**\n * Wizard progress as an ordered list, one item per step in the given order. Each step's `status`\n * comes from the caller, so steps can be completed out of order. The current step carries\n * `aria-current=\"step\"`, and every step says its state in visually hidden text (\"Done\",\n * \"Current\", \"Upcoming\", or `statusLabels`), so the state is never conveyed by colour alone.\n */\nexport function StepIndicator({ steps, statusLabels, className }: StepIndicatorProps) {\n return (\n <ol className={cn('step-indicator', className)}>\n {steps.map((step, index) => (\n <li\n // biome-ignore lint/suspicious/noArrayIndexKey: a step is its position in the wizard, `label` is a ReactNode with no uniqueness guarantee, and the items hold no state\n key={index}\n className=\"step-indicator-step\"\n aria-current={step.status === 'current' ? 'step' : undefined}\n >\n <span\n className={cn('step-indicator-marker', markerClass[step.status])}\n aria-hidden=\"true\"\n >\n {step.status === 'done' ? <CheckIcon className=\"step-indicator-icon\" /> : index + 1}\n </span>\n <span\n className={cn(\n 'step-indicator-label',\n step.status === 'current' && 'step-indicator-label-current',\n )}\n >\n {step.label}\n </span>\n <span className=\"visually-hidden\">\n {statusLabels?.[step.status] ?? defaultStatusLabels[step.status]}\n </span>\n </li>\n ))}\n </ol>\n );\n}\n","import { type MouseEvent, type ReactNode, useId, useState } from 'react';\nimport { cn } from '../cn';\nimport { Spinner } from './feedback';\n\nexport interface SwitchProps {\n /** Accessible name of the switch. Always rendered; `labelHidden` only hides it visually. */\n label: ReactNode;\n labelHidden?: boolean;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n disabled?: boolean;\n loading?: boolean;\n id?: string;\n name?: string;\n className?: string;\n}\n\n/** A busy switch ignores pointer presses entirely: no toggle, and no focus move on mouse down. */\nfunction ignorePress(event: MouseEvent<HTMLButtonElement>) {\n event.preventDefault();\n}\n\n/**\n * On/off switch: a native `<button role=\"switch\">` (WAI-ARIA switch pattern), so Tab, Space and\n * Enter work without extra wiring. Controlled with `checked` + `onCheckedChange`, or uncontrolled\n * with `defaultChecked`. While `loading` it stays reachable with Tab and keeps its state, announces\n * busy and ignores presses; the parent flips `checked` once the save resolves. `labelHidden` keeps\n * the accessible name but hides the label text (for table rows that are labelled by their column).\n * With `name`, a checked switch submits `name=on` in a form, as a checkbox does; like a disabled\n * checkbox, a disabled switch submits nothing.\n */\nexport function Switch({\n label,\n labelHidden = false,\n checked,\n defaultChecked = false,\n onCheckedChange,\n disabled = false,\n loading = false,\n id,\n name,\n className,\n}: SwitchProps) {\n const generatedId = useId();\n const controlId = id ?? generatedId;\n const labelId = `${controlId}-label`;\n const [ownChecked, setOwnChecked] = useState(defaultChecked);\n const isChecked = checked ?? ownChecked;\n\n const toggle = () => {\n if (loading) return;\n const next = !isChecked;\n if (checked === undefined) setOwnChecked(next);\n onCheckedChange?.(next);\n };\n\n return (\n <span className={cn('switch', className)}>\n <button\n type=\"button\"\n role=\"switch\"\n id={controlId}\n className=\"switch-control\"\n aria-checked={isChecked}\n aria-labelledby={labelId}\n aria-busy={loading || undefined}\n aria-disabled={loading || undefined}\n disabled={disabled}\n onMouseDown={loading ? ignorePress : undefined}\n onClick={toggle}\n >\n <span className=\"switch-thumb\" aria-hidden=\"true\" />\n </button>\n <label\n id={labelId}\n htmlFor={controlId}\n className={cn('switch-label', labelHidden && 'visually-hidden')}\n >\n {label}\n </label>\n {loading ? <Spinner className=\"switch-spinner\" /> : null}\n {name && isChecked && !disabled ? <input type=\"hidden\" name={name} value=\"on\" /> : null}\n </span>\n );\n}\n","import {\n type FocusEvent,\n type KeyboardEvent,\n type MouseEvent,\n type RefObject,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../cn';\nimport { editSelection, watchFocus } from './text-selection';\n\nexport interface VariablePickerProps {\n variables: ReadonlyArray<{ name: string; label: string }>;\n /** The `SlotTextField` / `CodeArea` control the chosen `{{ name }}` token is inserted into. */\n targetRef: RefObject<HTMLInputElement | HTMLTextAreaElement | null>;\n className?: string;\n}\n\n/** The Liquid output tag for a variable (CTO decision 3). */\nfunction liquidToken(name: string): string {\n return `{{ ${name} }}`;\n}\n\n/** Keep focus where it is on press, so the target keeps its selection and the menu stays open. */\nfunction keepFocus(event: MouseEvent) {\n event.preventDefault();\n}\n\n/**\n * \"Insert variable\" menu button (WAI-ARIA menu-button pattern) for a `SlotTextField` or `CodeArea`.\n * Choosing a variable replaces the target's selection with `{{ name }}` (or appends it, if the\n * target never had focus), fires the target's change handler and returns focus to the target with\n * the cursor after the token. The variable list is a prop; the picker fetches nothing.\n */\nexport function VariablePicker({ variables, targetRef, className }: VariablePickerProps) {\n const menuId = useId();\n const trigger = useRef<HTMLButtonElement>(null);\n const menu = useRef<HTMLDivElement>(null);\n const items = useRef<(HTMLButtonElement | null)[]>([]);\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState(0);\n const count = variables.length;\n\n // The target may only mount or change after the picker, so look for it after every render.\n useEffect(() => {\n if (targetRef.current) watchFocus(targetRef.current);\n });\n\n useEffect(() => {\n if (open) items.current[active]?.focus();\n }, [open, active]);\n\n const openAt = (index: number) => {\n setActive(index);\n setOpen(true);\n };\n\n const close = () => {\n setOpen(false);\n trigger.current?.focus();\n };\n\n const choose = (name: string) => {\n setOpen(false);\n const control = targetRef.current;\n if (!control) {\n trigger.current?.focus();\n return;\n }\n const token = liquidToken(name);\n editSelection(control, () => ({ text: token, select: [token.length, token.length] }));\n };\n\n const onTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n const first = new Map([\n ['ArrowDown', 0],\n ['ArrowUp', count - 1],\n ]).get(event.key);\n if (first === undefined) return;\n event.preventDefault();\n openAt(first);\n };\n\n const onItemKeyDown = (event: KeyboardEvent<HTMLButtonElement>, index: number) => {\n const next = new Map([\n ['ArrowDown', (index + 1) % count],\n ['ArrowUp', (index - 1 + count) % count],\n ['Home', 0],\n ['End', count - 1],\n ]).get(event.key);\n if (next !== undefined) {\n event.preventDefault();\n setActive(next);\n return;\n }\n if (event.key !== 'Escape') return;\n event.preventDefault();\n close();\n };\n\n // Close when focus leaves the list: Tab or Shift+Tab, or a click anywhere else.\n const onItemBlur = (event: FocusEvent<HTMLButtonElement>) => {\n if (!menu.current?.contains(event.relatedTarget)) setOpen(false);\n };\n\n return (\n <div className={cn('variable-picker', className)}>\n <button\n ref={trigger}\n type=\"button\"\n className=\"variable-picker-trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={open}\n aria-controls={open ? menuId : undefined}\n disabled={count === 0}\n onMouseDown={keepFocus}\n onClick={() => {\n if (open) close();\n else openAt(0);\n }}\n onKeyDown={onTriggerKeyDown}\n >\n Insert variable\n </button>\n {open ? (\n <div\n ref={menu}\n id={menuId}\n role=\"menu\"\n aria-label=\"Variables\"\n className=\"variable-picker-menu\"\n >\n {variables.map((variable, index) => (\n <button\n key={variable.name}\n ref={(node) => {\n items.current[index] = node;\n }}\n type=\"button\"\n role=\"menuitem\"\n tabIndex={-1}\n className=\"variable-picker-item\"\n onMouseDown={keepFocus}\n onClick={() => choose(variable.name)}\n onKeyDown={(event) => onItemKeyDown(event, index)}\n onBlur={onItemBlur}\n >\n <span className=\"variable-picker-item-label\">{variable.label}</span>\n <code className=\"variable-picker-item-token\">{liquidToken(variable.name)}</code>\n </button>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,4BAAwB;AAOjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACmBI;AAjBJ,IAAM,eAA6C;AAAA,EACjD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AACR;AAGO,SAAS,MAAM;AAAA,EACpB,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,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rB,UAAM;AAAA,EACR;AAGA,QAAM,aAAa,CAAC,UAAyC;AAC3D,QAAI,CAAC,KAAK,SAAS,SAAS,MAAM,aAAa,EAAG,SAAQ,KAAK;AAAA,EACjE;AAEA,SACE,+CAAC,SAAI,WAAW,GAAG,mBAAmB,SAAS,GAC7C;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,MAAK;AAAA,QACL,WAAU;AAAA,QACV,iBAAc;AAAA,QACd,iBAAe;AAAA,QACf,iBAAe,OAAO,SAAS;AAAA,QAC/B,UAAU,UAAU;AAAA,QACpB,aAAa;AAAA,QACb,SAAS,MAAM;AACb,cAAI,KAAM,OAAM;AAAA,cACX,QAAO,CAAC;AAAA,QACf;AAAA,QACA,WAAW;AAAA,QACZ;AAAA;AAAA,IAED;AAAA,IACC,OACC;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,IAAI;AAAA,QACJ,MAAK;AAAA,QACL,cAAW;AAAA,QACX,WAAU;AAAA,QAET,oBAAU,IAAI,CAAC,UAAU,UACxB;AAAA,UAAC;AAAA;AAAA,YAEC,KAAK,CAAC,SAAS;AACb,oBAAM,QAAQ,KAAK,IAAI;AAAA,YACzB;AAAA,YACA,MAAK;AAAA,YACL,MAAK;AAAA,YACL,UAAU;AAAA,YACV,WAAU;AAAA,YACV,aAAa;AAAA,YACb,SAAS,MAAM,OAAO,SAAS,IAAI;AAAA,YACnC,WAAW,CAAC,UAAU,cAAc,OAAO,KAAK;AAAA,YAChD,QAAQ;AAAA,YAER;AAAA,4DAAC,UAAK,WAAU,8BAA8B,mBAAS,OAAM;AAAA,cAC7D,8CAAC,UAAK,WAAU,8BAA8B,sBAAY,SAAS,IAAI,GAAE;AAAA;AAAA;AAAA,UAdpE,SAAS;AAAA,QAehB,CACD;AAAA;AAAA,IACH,IACE;AAAA,KACN;AAEJ;","names":["import_jsx_runtime","at","import_jsx_runtime","variantClass","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/cn.ts","../src/components/badge.tsx","../src/components/block-list.tsx","../src/components/button.tsx","../src/components/card.tsx","../src/components/checklist.tsx","../src/components/check-icon.tsx","../src/components/code-area.tsx","../src/components/field.tsx","../src/components/confirm-dialog.tsx","../src/components/container.tsx","../src/components/feedback.tsx","../src/components/preview-frame.tsx","../src/components/section.tsx","../src/components/select.tsx","../src/components/slot-text-field.tsx","../src/components/text-selection.ts","../src/components/step-indicator.tsx","../src/components/switch.tsx","../src/components/variable-picker.tsx"],"sourcesContent":["export { cn } from './cn';\n\nexport type { BadgeProps, BadgeVariant } from './components/badge';\nexport { Badge } from './components/badge';\nexport type { BlockListItem, BlockListProps } from './components/block-list';\nexport { BlockList } from './components/block-list';\nexport type { ButtonProps, ButtonSize, ButtonVariant } from './components/button';\nexport { Button } from './components/button';\nexport type { CardPadding, CardProps } from './components/card';\nexport { Card } from './components/card';\nexport type {\n ChecklistProps,\n ChecklistRowProps,\n ChecklistSkeletonProps,\n} from './components/checklist';\nexport { Checklist, ChecklistRow, ChecklistSkeleton } from './components/checklist';\nexport type { CodeAreaProps } from './components/code-area';\nexport { CodeArea } from './components/code-area';\nexport type { ConfirmDialogProps } from './components/confirm-dialog';\nexport { ConfirmDialog } from './components/confirm-dialog';\nexport type { ContainerProps } from './components/container';\nexport { Container } from './components/container';\nexport type { EmptyStateProps, SpinnerProps } from './components/feedback';\nexport { EmptyState, Spinner } from './components/feedback';\nexport type { FieldProps, InputProps, LabelProps } from './components/field';\nexport { Field, Input, Label } from './components/field';\nexport type { PreviewFrameProps } from './components/preview-frame';\nexport { PreviewFrame } from './components/preview-frame';\nexport type { SectionHeaderProps, SectionProps } from './components/section';\nexport { Section, SectionHeader } from './components/section';\nexport type { SelectOption, SelectProps } from './components/select';\nexport { Select } from './components/select';\nexport type { SlotTextFieldProps } from './components/slot-text-field';\nexport { SlotTextField } from './components/slot-text-field';\nexport type {\n StepIndicatorProps,\n StepIndicatorStep,\n StepStatus,\n} from './components/step-indicator';\nexport { StepIndicator } from './components/step-indicator';\nexport type { SwitchProps } from './components/switch';\nexport { Switch } from './components/switch';\nexport type { VariablePickerProps } from './components/variable-picker';\nexport { VariablePicker } from './components/variable-picker';\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Merge class names, resolving conflicting Tailwind utilities (last wins).\n * Mirrors the helper used across the FloPay frontends so consumers can extend\n * any primitive's classes safely.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import type { HTMLAttributes } from 'react';\nimport { cn } from '../cn';\n\nexport type BadgeVariant = 'neutral' | 'success' | 'warning' | 'danger' | 'info';\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n /** Render a leading status dot. */\n dot?: boolean;\n /** Semantic color. `neutral` is the default outlined pill. */\n variant?: BadgeVariant;\n}\n\nconst variantClass: Record<BadgeVariant, string> = {\n neutral: '',\n success: 'badge-success',\n warning: 'badge-warning',\n danger: 'badge-danger',\n info: 'badge-info',\n};\n\n/** Pill badge — neutral by default, or a semantic variant, optionally with a dot. */\nexport function Badge({\n dot = false,\n variant = 'neutral',\n className,\n children,\n ...props\n}: BadgeProps) {\n return (\n <span className={cn('badge', variantClass[variant], className)} {...props}>\n {dot ? <span className=\"badge-dot\" /> : null}\n {children}\n </span>\n );\n}\n","import { type DragEvent, type ReactNode, useLayoutEffect, useRef } from 'react';\nimport { cn } from '../cn';\n\ntype MoveLabel = 'Move up' | 'Move down';\n\n/**\n * Where keyboard focus goes once the parent passes the `items` that follow a button press: back\n * to the moved row's button, or to a neighbour's Delete after the focused row was removed.\n */\ntype PendingFocus = { movedId: string; label: MoveLabel } | { deletedAt: number };\n\nexport interface BlockListItem {\n id: string;\n /** A locked item never moves, has no handle or controls, and nothing moves past it. */\n locked?: boolean;\n}\n\nexport interface BlockListProps<T extends BlockListItem = BlockListItem> {\n /** The rows, in the order shown. Ids must be unique: rows are keyed by them. */\n items: T[];\n renderItem: (item: T) => ReactNode;\n /** Called once per move or delete with a new array of the caller's own item objects. */\n onChange: (nextItems: T[]) => void;\n className?: string;\n}\n\n/**\n * True when the item at `from` may move to index `to`: a real move inside the list that neither\n * moves a locked item nor carries an unlocked one past (or onto the place of) a locked item.\n */\nfunction canMove(items: readonly BlockListItem[], from: number, to: number): boolean {\n if (from === to || to < 0 || to >= items.length) return false;\n const low = Math.min(from, to);\n const high = Math.max(from, to);\n for (let index = low; index <= high; index += 1) {\n if (items[index]?.locked) return false;\n }\n return true;\n}\n\n/** A copy of `items` with the item at `from` taken out and inserted at `to`. */\nfunction moved<T>(items: readonly T[], from: number, to: number): T[] {\n const next = items.slice();\n const [item] = next.splice(from, 1) as [T];\n next.splice(to, 0, item);\n return next;\n}\n\n/** True when focus went nowhere useful: to `<body>`, to nothing, or onto a now-disabled button. */\nfunction focusWasLost(): boolean {\n const active = document.activeElement;\n return (\n !active || active === document.body || (active instanceof HTMLButtonElement && active.disabled)\n );\n}\n\n/** Row `at`'s enabled button with this label. The list renders one `li` per item, in order. */\nfunction enabledButton(\n rows: HTMLCollection,\n at: number,\n label: MoveLabel | 'Delete',\n): HTMLButtonElement | null {\n return (\n rows[at]?.querySelector<HTMLButtonElement>(`button[aria-label=\"${label}\"]:enabled`) ?? null\n );\n}\n\n/** After a delete at `deletedAt`: the first unlocked row at or after it, else the nearest before. */\nfunction rowAfterDelete(items: readonly BlockListItem[], deletedAt: number): number {\n for (let at = deletedAt; at < items.length; at += 1) {\n if (!items[at]?.locked) return at;\n }\n for (let at = Math.min(deletedAt, items.length) - 1; at >= 0; at -= 1) {\n if (!items[at]?.locked) return at;\n }\n return -1;\n}\n\n/** The button that takes focus once the parent has passed the items that follow a button press. */\nfunction focusTarget(\n rows: HTMLCollection,\n items: readonly BlockListItem[],\n pending: PendingFocus,\n): HTMLButtonElement | null {\n if ('deletedAt' in pending) {\n const at = rowAfterDelete(items, pending.deletedAt);\n return at < 0 ? null : enabledButton(rows, at, 'Delete');\n }\n const at = items.findIndex((item) => item.id === pending.movedId);\n if (at < 0) return null;\n const other: MoveLabel = pending.label === 'Move up' ? 'Move down' : 'Move up';\n return (\n enabledButton(rows, at, pending.label) ??\n enabledButton(rows, at, other) ??\n enabledButton(rows, at, 'Delete')\n );\n}\n\n/** Decorative icons drawn in `currentColor`; each button's name comes from its `aria-label`. */\nconst icons = {\n grip: (\n <>\n <circle cx=\"6\" cy=\"4\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"4\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"12\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"12\" r=\"1.25\" />\n </>\n ),\n up: <path d=\"M8 12.5v-9M4 7.5l4-4 4 4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />,\n down: <path d=\"M8 3.5v9M4 8.5l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />,\n delete: (\n <path d=\"M4.5 4.5l7 7M11.5 4.5l-7 7\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n ),\n};\n\nfunction Icon({ name }: { name: keyof typeof icons }) {\n return (\n <svg\n className=\"block-list-icon\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n {icons[name]}\n </svg>\n );\n}\n\n/**\n * A reorderable list of blocks. Each unlocked row has a drag handle (native HTML5 drag and drop)\n * and native \"Move up\", \"Move down\" and \"Delete\" buttons, so Tab, Enter and Space work with no\n * extra wiring. The handle is not focusable and hidden from assistive technology: keyboard and\n * screen-reader users reorder with the buttons. Locked rows (a header or footer, say) show their\n * content only; they never move, and no item moves past them by button or by drop. A button that\n * would do so is `disabled`, and such a drop is ignored.\n *\n * Controlled: the list keeps no order of its own. Every action calls `onChange` once with the new\n * order, and the rows move when the parent passes the new `items`. Only the id being dragged is\n * held here, between `dragstart` and the drop. Rendering touches no browser API, so the list\n * renders to static markup on the server.\n *\n * Keyboard focus stays in the list. When the parent passes the new `items`, a moved row's button\n * takes focus back (its other Move button if that one is now disabled, else its Delete), and after\n * a delete the next unlocked row's Delete takes it (else the nearest one before). This happens only\n * when focus was lost to `<body>` or left on a disabled button, never when it went elsewhere.\n */\nexport function BlockList<T extends BlockListItem>({\n items,\n renderItem,\n onChange,\n className,\n}: BlockListProps<T>) {\n const draggedId = useRef<string | null>(null);\n const list = useRef<HTMLUListElement>(null);\n const pendingFocus = useRef<PendingFocus | null>(null);\n\n // Runs after the parent passed new items, before paint. Effects never run on the server.\n useLayoutEffect(() => {\n const pending = pendingFocus.current;\n pendingFocus.current = null;\n const rows = list.current?.children;\n if (pending && rows && focusWasLost()) focusTarget(rows, items, pending)?.focus();\n }, [items]);\n\n const moveByButton = (id: string, index: number, label: MoveLabel) => {\n pendingFocus.current = { movedId: id, label };\n onChange(moved(items, index, label === 'Move up' ? index - 1 : index + 1));\n };\n\n const deleteByButton = (index: number) => {\n pendingFocus.current = { deletedAt: index };\n onChange(items.filter((_, other) => other !== index));\n };\n\n /** Index of the item being dragged when it may be dropped on row `index`, else -1. */\n const dropSource = (index: number): number => {\n const from = items.findIndex((item) => item.id === draggedId.current);\n return from >= 0 && canMove(items, from, index) ? from : -1;\n };\n\n const startDrag = (event: DragEvent<HTMLElement>, id: string) => {\n draggedId.current = id;\n // A button press whose change the parent never applied must not move focus after a drop.\n pendingFocus.current = null;\n // jsdom (and some synthetic drags) send no dataTransfer: the id above is what the drop reads.\n const transfer: DataTransfer | null | undefined = event.dataTransfer;\n if (!transfer) return;\n transfer.effectAllowed = 'move';\n // Firefox only starts a drag that carries data.\n transfer.setData('text/plain', id);\n const row = event.currentTarget.closest('li');\n if (row) transfer.setDragImage(row, 0, 0);\n };\n\n const endDrag = () => {\n draggedId.current = null;\n };\n\n const dragOver = (event: DragEvent<HTMLLIElement>, index: number) => {\n if (dropSource(index) < 0) return;\n // Cancelling dragover marks the row as a drop target, so the browser fires drop on it.\n event.preventDefault();\n const transfer: DataTransfer | null | undefined = event.dataTransfer;\n if (transfer) transfer.dropEffect = 'move';\n };\n\n const drop = (event: DragEvent<HTMLLIElement>, index: number) => {\n const from = dropSource(index);\n draggedId.current = null;\n if (from < 0) return;\n event.preventDefault();\n onChange(moved(items, from, index));\n };\n\n return (\n <ul ref={list} className={cn('block-list', className)}>\n {items.map((item, index) => (\n // biome-ignore lint/a11y/noNoninteractiveElementInteractions: the row is only a pointer drop target for the handle's native drag; keyboard and screen-reader users reorder with the row's Move buttons, so it needs no role or focus of its own\n <li\n key={item.id}\n className={cn('block-list-row', item.locked && 'block-list-row-locked')}\n onDragOver={(event) => dragOver(event, index)}\n onDrop={(event) => drop(event, index)}\n >\n {item.locked ? null : (\n <span\n className=\"block-list-handle\"\n draggable\n aria-hidden=\"true\"\n onDragStart={(event) => startDrag(event, item.id)}\n onDragEnd={endDrag}\n >\n <Icon name=\"grip\" />\n </span>\n )}\n <div className=\"block-list-content\">{renderItem(item)}</div>\n {item.locked ? null : (\n <div className=\"block-list-controls\">\n <button\n type=\"button\"\n className=\"block-list-button\"\n aria-label=\"Move up\"\n disabled={!canMove(items, index, index - 1)}\n onClick={() => moveByButton(item.id, index, 'Move up')}\n >\n <Icon name=\"up\" />\n </button>\n <button\n type=\"button\"\n className=\"block-list-button\"\n aria-label=\"Move down\"\n disabled={!canMove(items, index, index + 1)}\n onClick={() => moveByButton(item.id, index, 'Move down')}\n >\n <Icon name=\"down\" />\n </button>\n <button\n type=\"button\"\n className=\"block-list-button block-list-button-delete\"\n aria-label=\"Delete\"\n onClick={() => deleteByButton(index)}\n >\n <Icon name=\"delete\" />\n </button>\n </div>\n )}\n </li>\n ))}\n </ul>\n );\n}\n","import type { ButtonHTMLAttributes } from 'react';\nimport { cn } from '../cn';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'outline';\nexport type ButtonSize = 'md' | 'sm';\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n}\n\nconst variantClass: Record<ButtonVariant, string> = {\n primary: 'btn-primary',\n secondary: 'btn-secondary',\n outline: 'btn-outline',\n};\n\nexport function Button({\n variant = 'primary',\n size = 'md',\n className,\n type = 'button',\n ...props\n}: ButtonProps) {\n return (\n <button\n type={type}\n className={cn(variantClass[variant], size === 'sm' && 'btn-sm', className)}\n {...props}\n />\n );\n}\n","import type { HTMLAttributes } from 'react';\nimport { cn } from '../cn';\n\nexport type CardPadding = 'none' | 'sm' | 'md' | 'lg';\n\nexport interface CardProps extends HTMLAttributes<HTMLDivElement> {\n /** Inner padding. Defaults to `md` (28px); use `none` to supply your own. */\n padding?: CardPadding;\n /** Add pointer cursor + hover elevation (for clickable cards). */\n interactive?: boolean;\n}\n\n/** Bordered surface card. Static by default; opt into hover with `interactive`. */\nexport function Card({ padding = 'md', interactive = false, className, ...props }: CardProps) {\n return (\n <div\n className={cn(\n 'card',\n padding !== 'none' && `card-pad-${padding}`,\n interactive && 'card-interactive',\n className,\n )}\n {...props}\n />\n );\n}\n","import { type ComponentType, type ElementType, type ReactNode, useId } from 'react';\nimport { cn } from '../cn';\nimport { Badge } from './badge';\nimport { CheckIcon } from './check-icon';\n\nexport interface ChecklistProps {\n /** The `ChecklistRow`s (or any list items) of the list. */\n children?: ReactNode;\n className?: string;\n}\n\nexport interface ChecklistRowProps {\n /** Text of the row. Always rendered. */\n label: ReactNode;\n /** Filled tick on the `success` token when true; an empty tick otherwise. */\n done?: boolean;\n /** Optional text on the right of the row. */\n status?: ReactNode;\n /** Shows an \"Optional\" tag next to the label. */\n optional?: boolean;\n /** Makes the whole row a single link. */\n href?: string;\n /** Component used for the link (default `a`), e.g. `next/link`. Receives `href`, `className` and the row content. */\n linkAs?: ComponentType<{ href: string; className?: string; children?: ReactNode }>;\n /** Overrides the visually hidden state wording (\"Done\", \"Not done\"). */\n statusLabels?: { done?: string; notDone?: string };\n className?: string;\n}\n\nexport interface ChecklistSkeletonProps {\n /** Number of placeholder rows. Defaults to 3. */\n rows?: number;\n className?: string;\n}\n\n/** A vertical tick list, e.g. a setup checklist. Its children are `ChecklistRow`s. */\nexport function Checklist({ children, className }: ChecklistProps) {\n return <ul className={cn('checklist', className)}>{children}</ul>;\n}\n\n/**\n * One row of a `Checklist`: a tick (filled on the `success` token when `done`, empty otherwise),\n * the label, an optional neutral \"Optional\" `Badge` and optional `status` text on the right. The\n * tick is decorative; the state is said in visually hidden text (\"Done\" / \"Not done\", or\n * `statusLabels`), so it is never conveyed by the graphic alone. With `href` the whole row is one\n * link, rendered as `<a>` or through `linkAs` (e.g. `next/link`) so the package never imports a\n * router.\n */\nexport function ChecklistRow({\n label,\n done = false,\n status,\n optional = false,\n href,\n linkAs,\n statusLabels,\n className,\n}: ChecklistRowProps) {\n const state = done ? (statusLabels?.done ?? 'Done') : (statusLabels?.notDone ?? 'Not done');\n const content = (\n <>\n <span className={cn('checklist-tick', done && 'checklist-tick-done')} aria-hidden=\"true\">\n {done ? <CheckIcon className=\"checklist-tick-icon\" /> : null}\n </span>\n <span className=\"checklist-row-label\">{label}</span>\n <span className=\"visually-hidden\">{state}</span>\n {optional ? <Badge>Optional</Badge> : null}\n {status ? <span className=\"checklist-row-status\">{status}</span> : null}\n </>\n );\n const Link: ElementType = linkAs ?? 'a';\n\n return (\n <li className={cn('checklist-row', className)}>\n {href ? (\n <Link href={href} className=\"checklist-row-body checklist-row-link\">\n {content}\n </Link>\n ) : (\n <div className=\"checklist-row-body\">{content}</div>\n )}\n </li>\n );\n}\n\n/**\n * Loading form of a `Checklist`: `rows` placeholder rows (3 by default) on the `bg-muted` token,\n * inside a `role=\"status\"` region named by visually hidden \"Loading\" text. The placeholders are\n * hidden from assistive tech.\n */\nexport function ChecklistSkeleton({ rows = 3, className }: ChecklistSkeletonProps) {\n const labelId = useId();\n\n return (\n <div className={cn('checklist-skeleton', className)} role=\"status\" aria-labelledby={labelId}>\n <span id={labelId} className=\"visually-hidden\">\n Loading\n </span>\n {Array.from({ length: rows }, (_, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: identical stateless placeholders with no identity of their own, so the position is the only key\n <div key={index} className=\"checklist-skeleton-row\" aria-hidden=\"true\">\n <span className=\"checklist-skeleton-tick\" />\n <span className=\"checklist-skeleton-line\" />\n </div>\n ))}\n </div>\n );\n}\n","/** Decorative check mark drawn in `currentColor`. Hidden from assistive tech: callers say the state in text. */\nexport function CheckIcon({ className }: { className?: string }) {\n return (\n <svg className={className} viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M3.5 8.5l3 3 6-7\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n","import { type ChangeEventHandler, type ReactNode, type Ref, useId } from 'react';\nimport { Field } from './field';\n\nexport interface CodeAreaProps {\n label: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n value?: string;\n defaultValue?: string;\n onChange?: ChangeEventHandler<HTMLTextAreaElement>;\n /** Ref to the underlying textarea (the target a `VariablePicker` attaches to). */\n ref?: Ref<HTMLTextAreaElement>;\n id?: string;\n name?: string;\n className?: string;\n}\n\n/**\n * Labelled monospace textarea for custom HTML / Liquid source. No editor dependency (CTO decision\n * 1): spellcheck, autocapitalize, autocomplete and soft wrapping are off, and Tab keeps its normal\n * job of moving focus, so the field never traps keyboard users.\n */\nexport function CodeArea({\n label,\n hint,\n error,\n value,\n defaultValue,\n onChange,\n ref,\n id,\n name,\n className,\n}: CodeAreaProps) {\n const generatedId = useId();\n const controlId = id ?? generatedId;\n\n return (\n <Field label={label} hint={hint} error={error} htmlFor={controlId} className={className}>\n <textarea\n ref={ref}\n id={controlId}\n name={name}\n className=\"field code-area\"\n rows={12}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n spellCheck={false}\n autoCapitalize=\"off\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n wrap=\"off\"\n aria-invalid={error ? true : undefined}\n />\n </Field>\n );\n}\n","import type { InputHTMLAttributes, LabelHTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../cn';\n\nexport type InputProps = InputHTMLAttributes<HTMLInputElement>;\n\n/** Token-aligned text input (the `.field` look: border, surface, brand focus ring). */\nexport function Input({ className, ...props }: InputProps) {\n return <input className={cn('field', className)} {...props} />;\n}\n\nexport type LabelProps = LabelHTMLAttributes<HTMLLabelElement>;\n\nexport function Label({ className, ...props }: LabelProps) {\n // biome-ignore lint/a11y/noLabelWithoutControl: primitive pass-through: the caller supplies the control association (htmlFor, or the input as a child) through the spread props, which the rule cannot see\n return <label className={cn('field-label', className)} {...props} />;\n}\n\nexport interface FieldProps {\n label?: ReactNode;\n /** Helper text shown below the control (hidden when `error` is set). */\n hint?: ReactNode;\n /** Error text shown below the control (takes precedence over `hint`). */\n error?: ReactNode;\n /** `htmlFor` for the label, matching the control's id. */\n htmlFor?: string;\n className?: string;\n children: ReactNode;\n}\n\n/** Labelled field wrapper: optional label above and hint/error below the control. */\nexport function Field({ label, hint, error, htmlFor, className, children }: FieldProps) {\n const message = error || hint;\n return (\n <div className={cn('field-group', className)}>\n {label ? <Label htmlFor={htmlFor}>{label}</Label> : null}\n {children}\n {message ? <span className={error ? 'field-error' : 'field-hint'}>{message}</span> : null}\n </div>\n );\n}\n","import { type MouseEvent, type ReactNode, useEffect, useId, useRef } from 'react';\nimport { Button } from './button';\n\nexport interface ConfirmDialogProps {\n open: boolean;\n title: ReactNode;\n description: ReactNode;\n confirmLabel: string;\n cancelLabel: string;\n onConfirm: () => void;\n onCancel: () => void;\n /** While true both buttons are disabled and the Escape / backdrop cancel paths are ignored. */\n confirming?: boolean;\n}\n\n/** What Tab and Shift+Tab may land on inside the panel; disabled controls and `tabindex=\"-1\"` are skipped. */\nconst FOCUSABLE = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ');\n\n/**\n * Where Tab (or Shift+Tab with `backwards`) moves focus: the next focusable element in the panel,\n * wrapping at either end, or the panel itself when nothing in it is focusable.\n */\nfunction nextFocusTarget(panel: HTMLElement, backwards: boolean): HTMLElement {\n const focusable = Array.from(panel.querySelectorAll<HTMLElement>(FOCUSABLE));\n const last = focusable.length - 1;\n if (last < 0) return panel;\n const index = focusable.indexOf(document.activeElement as HTMLElement);\n if (backwards) return focusable[index <= 0 ? last : index - 1] ?? panel;\n return focusable[index >= last ? 0 : index + 1] ?? panel;\n}\n\n/**\n * The open dialog. Mounted only while `open`, so recording the opener on mount and restoring it on\n * unmount covers every way the dialog closes: Cancel, Confirm, Escape, the backdrop, the parent\n * passing `open={false}`, and the parent unmounting it while open.\n */\nfunction OpenConfirmDialog({\n title,\n description,\n confirmLabel,\n cancelLabel,\n onConfirm,\n onCancel,\n confirming = false,\n}: Omit<ConfirmDialogProps, 'open'>) {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n const cancelId = `${id}-cancel`;\n const panelRef = useRef<HTMLDivElement>(null);\n\n // Declared first so it records the opener before the effect below moves focus into the dialog.\n useEffect(() => {\n const opener = document.activeElement;\n return () => {\n if (opener instanceof HTMLElement && opener.isConnected) opener.focus();\n };\n }, []);\n\n // On open, focus Cancel (the safe default). While confirming both buttons are disabled, so a focused\n // button would drop focus to the body: move it to the panel instead, and back to Cancel afterwards.\n useEffect(() => {\n const panel = panelRef.current;\n if (!panel) return;\n const active = document.activeElement;\n if (confirming) {\n if (!panel.contains(active) || active instanceof HTMLButtonElement) panel.focus();\n } else if (!panel.contains(active) || active === panel) {\n document.getElementById(cancelId)?.focus();\n }\n }, [confirming, cancelId]);\n\n // Escape works wherever focus is, and Tab / Shift+Tab wrap over the panel's focusable elements.\n // The listener exists only while the dialog is open.\n useEffect(() => {\n function onKeyDown(event: KeyboardEvent) {\n const panel = panelRef.current;\n if (!panel) return;\n if (event.key === 'Escape') {\n if (!confirming) onCancel();\n } else if (event.key === 'Tab') {\n event.preventDefault();\n nextFocusTarget(panel, event.shiftKey).focus();\n }\n }\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [confirming, onCancel]);\n\n // A click goes to the common ancestor of mousedown and mouseup, so a drag that starts in the panel\n // (selecting the title or description) and ends on the backdrop lands here too: cancel only when\n // the press also started on the backdrop.\n const pressStartedOnBackdrop = useRef(false);\n\n const onBackdropMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n pressStartedOnBackdrop.current = event.target === event.currentTarget;\n // Keep focus inside the dialog: a press on the backdrop must not move focus to the body.\n if (pressStartedOnBackdrop.current) event.preventDefault();\n };\n\n const onBackdropClick = (event: MouseEvent<HTMLDivElement>) => {\n const startedOnBackdrop = pressStartedOnBackdrop.current;\n pressStartedOnBackdrop.current = false;\n if (startedOnBackdrop && event.target === event.currentTarget && !confirming) onCancel();\n };\n\n return (\n // biome-ignore lint/a11y/noNoninteractiveElementInteractions: the backdrop click is only a pointer shortcut for Cancel; keyboard and screen-reader users have the Cancel button and Escape, so the backdrop needs no role or focus of its own\n // biome-ignore lint/a11y/noStaticElementInteractions: as above, the backdrop is a pointer-only shortcut for Cancel and must not be announced as a control\n // biome-ignore lint/a11y/useKeyWithClickEvents: the keyboard equivalent of a backdrop click is Escape, handled by the document listener while open\n <div\n className=\"confirm-dialog-backdrop\"\n onMouseDown={onBackdropMouseDown}\n onClick={onBackdropClick}\n >\n <div\n ref={panelRef}\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n tabIndex={-1}\n className=\"confirm-dialog\"\n >\n <h2 id={titleId} className=\"confirm-dialog-title\">\n {title}\n </h2>\n <div id={descriptionId} className=\"confirm-dialog-description\">\n {description}\n </div>\n <div className=\"confirm-dialog-actions\">\n <Button id={cancelId} variant=\"outline\" disabled={confirming} onClick={onCancel}>\n {cancelLabel}\n </Button>\n <Button variant=\"primary\" disabled={confirming} onClick={onConfirm}>\n {confirmLabel}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * A confirm/cancel alert dialog (WAI-ARIA alertdialog pattern), rendered in place as a fixed backdrop\n * around a panel, so it server-renders without a portal. Nothing renders while `open` is false.\n *\n * Confirm calls `onConfirm`; Cancel, Escape and a click on the backdrop itself call `onCancel`, and\n * a click on the panel never does, nor does a drag that starts in the panel and ends on the\n * backdrop. On open, focus moves to Cancel, the safe default; Tab and\n * Shift+Tab stay inside the dialog; on close or unmount focus returns to the element that had it\n * when the dialog opened, if that element is still in the document. While `confirming`, both\n * buttons are disabled and Escape and the backdrop are ignored, so a request in flight cannot be\n * dismissed; focus moves to the panel rather than dropping to the page. The wording is the caller's:\n * `confirmLabel` and `cancelLabel` have no defaults.\n */\nexport function ConfirmDialog({ open, ...props }: ConfirmDialogProps) {\n if (!open) return null;\n return <OpenConfirmDialog {...props} />;\n}\n","import type { HTMLAttributes } from 'react';\nimport { cn } from '../cn';\n\nexport type ContainerProps = HTMLAttributes<HTMLDivElement>;\n\n/** Centered, max-width content wrapper (var(--max-w)) with horizontal padding. */\nexport function Container({ className, ...props }: ContainerProps) {\n return <div className={cn('container', className)} {...props} />;\n}\n","import type { HTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../cn';\n\nexport interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n /** Wrap in a centered, padded block (for loading states in a panel). */\n center?: boolean;\n}\n\n/** Brand-colored loading spinner. */\nexport function Spinner({ center = false, className, ...props }: SpinnerProps) {\n const spinner = (\n <span className={cn('spinner', className)} role=\"status\" aria-label=\"Loading\" {...props} />\n );\n return center ? <div className=\"spinner-center\">{spinner}</div> : spinner;\n}\n\nexport interface EmptyStateProps {\n title: ReactNode;\n description?: ReactNode;\n /** Optional icon rendered in the circular badge above the title. */\n icon?: ReactNode;\n className?: string;\n}\n\n/** Centered \"nothing here yet\" placeholder for empty lists/tables. */\nexport function EmptyState({ title, description, icon, className }: EmptyStateProps) {\n return (\n <div className={cn('empty-state', className)}>\n {icon ? <div className=\"empty-state-icon\">{icon}</div> : null}\n <h3 className=\"empty-state-title\">{title}</h3>\n {description ? <p className=\"empty-state-desc\">{description}</p> : null}\n </div>\n );\n}\n","import { cn } from '../cn';\n\nexport interface PreviewFrameProps {\n /** HTML shown inside the isolated frame. */\n html: string;\n /** Accessible title of the iframe. */\n title: string;\n className?: string;\n}\n\n/**\n * Container that previews client-authored email HTML in an iframe. The HTML goes in `srcdoc` and\n * the frame has the strictest sandbox (`sandbox=\"\"`, CTO decision 6): no scripts, forms, popups or\n * same-origin access, so a preview can never reach the dashboard session. Size it through\n * `className` on the container; the frame fills it.\n */\nexport function PreviewFrame({ html, title, className }: PreviewFrameProps) {\n return (\n <div className={cn('preview-frame', className)}>\n <iframe className=\"preview-frame-iframe\" title={title} srcDoc={html} sandbox=\"\" />\n </div>\n );\n}\n","import type { HTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../cn';\n\nexport type SectionProps = HTMLAttributes<HTMLElement>;\n\n/** Vertical page section with max-width and standard padding. */\nexport function Section({ className, ...props }: SectionProps) {\n return <section className={cn('section', className)} {...props} />;\n}\n\nexport interface SectionHeaderProps {\n /** Small eyebrow label above the title (brand colored). */\n label?: ReactNode;\n title: ReactNode;\n description?: ReactNode;\n className?: string;\n}\n\n/** Centered section heading: optional label, title, optional description. */\nexport function SectionHeader({ label, title, description, className }: SectionHeaderProps) {\n return (\n <div className={cn('section-center', className)}>\n {label ? <div className=\"section-label\">{label}</div> : null}\n <h2 className=\"section-title\">{title}</h2>\n {description ? <p className=\"section-desc\">{description}</p> : null}\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Field } from './field';\n\nexport interface SelectOption {\n value: string;\n label: string;\n}\n\nexport interface SelectProps {\n id: string;\n label: ReactNode;\n /** The selected option's value. Controlled: the component keeps no state of its own. */\n value: string;\n options: SelectOption[];\n /** Called with the chosen option's value (a string, not the change event). */\n onChange: (value: string) => void;\n disabled?: boolean;\n name?: string;\n}\n\n/**\n * Labelled native `<select>` in the `Field` pattern: a `field-group` wrapper, a `field-label`\n * linked through `htmlFor`, then the select with the `.field` look plus `.field-select`. It stays\n * a native control, so keyboard operation and the platform chevron come from the browser.\n */\nexport function Select({ id, label, value, options, onChange, disabled, name }: SelectProps) {\n return (\n <Field label={label} htmlFor={id}>\n <select\n id={id}\n name={name}\n className=\"field field-select\"\n value={value}\n disabled={disabled}\n onChange={(event) => onChange(event.target.value)}\n >\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n </Field>\n );\n}\n","import {\n type ChangeEventHandler,\n type ReactNode,\n type Ref,\n useCallback,\n useId,\n useRef,\n} from 'react';\nimport { Field } from './field';\nimport {\n assignRef,\n editSelection,\n type TextControl,\n type TextEdit,\n watchFocus,\n} from './text-selection';\n\nexport interface SlotTextFieldProps {\n label: ReactNode;\n /** Helper text (hidden when `error` is set), as in `Field`. */\n hint?: ReactNode;\n /** Error text (takes precedence over `hint`), as in `Field`. */\n error?: ReactNode;\n /** Render a textarea instead of a single-line input. */\n multiline?: boolean;\n value?: string;\n defaultValue?: string;\n onChange?: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /** Ref to the underlying input / textarea (the target a `VariablePicker` attaches to). */\n ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;\n id?: string;\n name?: string;\n className?: string;\n}\n\nconst LINK_PLACEHOLDER = 'https://';\n\n/** Wrap the selection in a Markdown-lite marker, keeping the wrapped text selected. */\nfunction wrapWith(marker: string) {\n return (selected: string): TextEdit => ({\n text: `${marker}${selected}${marker}`,\n select: [marker.length, marker.length + selected.length],\n });\n}\n\n/** Turn the selection into `[label](https://)` and select the URL placeholder to type over. */\nfunction toLink(selected: string): TextEdit {\n const label = selected || 'link';\n const url = label.length + 3;\n return { text: `[${label}](${LINK_PLACEHOLDER})`, select: [url, url + LINK_PLACEHOLDER.length] };\n}\n\nconst FORMATS = [\n { name: 'Bold', edit: wrapWith('**') },\n { name: 'Italic', edit: wrapWith('_') },\n { name: 'Link', edit: toLink },\n] as const;\n\n/** The Markdown-lite subset (CTO decision 2) the toolbar writes, named in the default hint. */\nconst SYNTAX_HINT = 'Markdown-lite: **bold**, _italic_ and [link](https://…).';\nconst PARAGRAPH_HINT = ' A blank line starts a new paragraph.';\n\n/**\n * Labelled text field for an email slot, with a Bold / Italic / Link toolbar that writes only the\n * Markdown-lite subset. Single-line by default; `multiline` renders a textarea. Typed text reaches\n * `onChange` unchanged, and toolbar edits fire `onChange` too, so controlled parents stay in sync.\n */\nexport function SlotTextField({\n label,\n hint,\n error,\n multiline = false,\n value,\n defaultValue,\n onChange,\n ref,\n id,\n name,\n className,\n}: SlotTextFieldProps) {\n const generatedId = useId();\n const controlId = id ?? generatedId;\n const control = useRef<TextControl | null>(null);\n\n const setControl = useCallback(\n (node: TextControl | null) => {\n control.current = node;\n if (node) watchFocus(node);\n assignRef(ref, node);\n },\n [ref],\n );\n\n const shared = {\n id: controlId,\n name,\n value,\n defaultValue,\n onChange,\n className: multiline ? 'field field-multiline' : 'field',\n 'aria-invalid': error ? true : undefined,\n };\n\n return (\n <Field\n label={label}\n hint={hint ?? (multiline ? SYNTAX_HINT + PARAGRAPH_HINT : SYNTAX_HINT)}\n error={error}\n htmlFor={controlId}\n className={className}\n >\n <div className=\"slot-toolbar\">\n {FORMATS.map((format) => (\n <button\n key={format.name}\n type=\"button\"\n className=\"slot-toolbar-button\"\n onClick={() => {\n if (control.current) editSelection(control.current, format.edit);\n }}\n >\n {format.name}\n </button>\n ))}\n </div>\n {multiline ? (\n <textarea ref={setControl} rows={4} {...shared} />\n ) : (\n <input ref={setControl} type=\"text\" {...shared} />\n )}\n </Field>\n );\n}\n","import type { Ref } from 'react';\n\n/** The native controls the editor blocks edit: a `SlotTextField` input/textarea or a `CodeArea`. */\nexport type TextControl = HTMLInputElement | HTMLTextAreaElement;\n\n/** An edit at the selection: the text that replaces it, and the selection to leave inside that text. */\nexport interface TextEdit {\n text: string;\n /** Selection after the edit, as `[start, end]` offsets into `text`. */\n select: [number, number];\n}\n\nconst watched = new WeakSet<TextControl>();\nconst focused = new WeakSet<TextControl>();\n\n/**\n * Start remembering whether `control` has ever had focus. A control that never had focus has no\n * cursor the user chose, so `editSelection` appends to it instead of editing at offset 0.\n */\nexport function watchFocus(control: TextControl): void {\n if (watched.has(control)) return;\n watched.add(control);\n if (control.ownerDocument.activeElement === control) {\n focused.add(control);\n return;\n }\n control.addEventListener('focus', () => focused.add(control), { once: true });\n}\n\n/**\n * Set the value the way typing does, so React's change handler fires for a controlled control:\n * the prototype's setter bypasses React's value tracker, then an `input` event reports the change.\n */\nfunction setValueAsTyped(control: TextControl, value: string): void {\n const { set } = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(control), 'value') ?? {};\n set?.call(control, value);\n control.dispatchEvent(new Event('input', { bubbles: true }));\n}\n\n/**\n * Replace the control's selection with the edit `build` makes from the selected text (or append it,\n * when the control never had focus), fire its change handler, then return focus to it with the\n * selection the edit asks for. The Markdown-lite toolbar and the variable picker both edit through\n * this one helper, so they behave the same way.\n */\nexport function editSelection(control: TextControl, build: (selected: string) => TextEdit): void {\n const { value } = control;\n const hadFocus = focused.has(control);\n const start = hadFocus ? (control.selectionStart ?? value.length) : value.length;\n const end = hadFocus ? (control.selectionEnd ?? start) : value.length;\n const edit = build(value.slice(start, end));\n\n setValueAsTyped(control, value.slice(0, start) + edit.text + value.slice(end));\n control.focus();\n control.setSelectionRange(start + edit.select[0], start + edit.select[1]);\n}\n\n/** Point a caller's ref (callback or object) at `node`, for components that also keep their own. */\nexport function assignRef<T>(ref: Ref<T> | undefined, node: T | null): void {\n if (typeof ref === 'function') {\n ref(node);\n return;\n }\n if (ref) ref.current = node;\n}\n","import type { ReactNode } from 'react';\nimport { cn } from '../cn';\nimport { CheckIcon } from './check-icon';\n\nexport type StepStatus = 'done' | 'current' | 'upcoming';\n\nexport interface StepIndicatorStep {\n label: ReactNode;\n /** Passed by the caller; the component never works the state out itself. */\n status: StepStatus;\n}\n\nexport interface StepIndicatorProps {\n steps: StepIndicatorStep[];\n /** Overrides the visually hidden state wording (\"Done\", \"Current\", \"Upcoming\"). */\n statusLabels?: Partial<Record<StepStatus, string>>;\n className?: string;\n}\n\nconst defaultStatusLabels: Record<StepStatus, string> = {\n done: 'Done',\n current: 'Current',\n upcoming: 'Upcoming',\n};\n\nconst markerClass: Record<StepStatus, string> = {\n done: 'step-indicator-marker-done',\n current: 'step-indicator-marker-current',\n upcoming: '',\n};\n\n/**\n * Wizard progress as an ordered list, one item per step in the given order. Each step's `status`\n * comes from the caller, so steps can be completed out of order. The current step carries\n * `aria-current=\"step\"`, and every step says its state in visually hidden text (\"Done\",\n * \"Current\", \"Upcoming\", or `statusLabels`), so the state is never conveyed by colour alone.\n */\nexport function StepIndicator({ steps, statusLabels, className }: StepIndicatorProps) {\n return (\n <ol className={cn('step-indicator', className)}>\n {steps.map((step, index) => (\n <li\n // biome-ignore lint/suspicious/noArrayIndexKey: a step is its position in the wizard, `label` is a ReactNode with no uniqueness guarantee, and the items hold no state\n key={index}\n className=\"step-indicator-step\"\n aria-current={step.status === 'current' ? 'step' : undefined}\n >\n <span\n className={cn('step-indicator-marker', markerClass[step.status])}\n aria-hidden=\"true\"\n >\n {step.status === 'done' ? <CheckIcon className=\"step-indicator-icon\" /> : index + 1}\n </span>\n <span\n className={cn(\n 'step-indicator-label',\n step.status === 'current' && 'step-indicator-label-current',\n )}\n >\n {step.label}\n </span>\n <span className=\"visually-hidden\">\n {statusLabels?.[step.status] ?? defaultStatusLabels[step.status]}\n </span>\n </li>\n ))}\n </ol>\n );\n}\n","import { type MouseEvent, type ReactNode, useId, useState } from 'react';\nimport { cn } from '../cn';\nimport { Spinner } from './feedback';\n\nexport interface SwitchProps {\n /** Accessible name of the switch. Always rendered; `labelHidden` only hides it visually. */\n label: ReactNode;\n labelHidden?: boolean;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n disabled?: boolean;\n loading?: boolean;\n id?: string;\n name?: string;\n className?: string;\n}\n\n/** A busy switch ignores pointer presses entirely: no toggle, and no focus move on mouse down. */\nfunction ignorePress(event: MouseEvent<HTMLButtonElement>) {\n event.preventDefault();\n}\n\n/**\n * On/off switch: a native `<button role=\"switch\">` (WAI-ARIA switch pattern), so Tab, Space and\n * Enter work without extra wiring. Controlled with `checked` + `onCheckedChange`, or uncontrolled\n * with `defaultChecked`. While `loading` it stays reachable with Tab and keeps its state, announces\n * busy and ignores presses; the parent flips `checked` once the save resolves. `labelHidden` keeps\n * the accessible name but hides the label text (for table rows that are labelled by their column).\n * With `name`, a checked switch submits `name=on` in a form, as a checkbox does; like a disabled\n * checkbox, a disabled switch submits nothing.\n */\nexport function Switch({\n label,\n labelHidden = false,\n checked,\n defaultChecked = false,\n onCheckedChange,\n disabled = false,\n loading = false,\n id,\n name,\n className,\n}: SwitchProps) {\n const generatedId = useId();\n const controlId = id ?? generatedId;\n const labelId = `${controlId}-label`;\n const [ownChecked, setOwnChecked] = useState(defaultChecked);\n const isChecked = checked ?? ownChecked;\n\n const toggle = () => {\n if (loading) return;\n const next = !isChecked;\n if (checked === undefined) setOwnChecked(next);\n onCheckedChange?.(next);\n };\n\n return (\n <span className={cn('switch', className)}>\n <button\n type=\"button\"\n role=\"switch\"\n id={controlId}\n className=\"switch-control\"\n aria-checked={isChecked}\n aria-labelledby={labelId}\n aria-busy={loading || undefined}\n aria-disabled={loading || undefined}\n disabled={disabled}\n onMouseDown={loading ? ignorePress : undefined}\n onClick={toggle}\n >\n <span className=\"switch-thumb\" aria-hidden=\"true\" />\n </button>\n <label\n id={labelId}\n htmlFor={controlId}\n className={cn('switch-label', labelHidden && 'visually-hidden')}\n >\n {label}\n </label>\n {loading ? <Spinner className=\"switch-spinner\" /> : null}\n {name && isChecked && !disabled ? <input type=\"hidden\" name={name} value=\"on\" /> : null}\n </span>\n );\n}\n","import {\n type FocusEvent,\n type KeyboardEvent,\n type MouseEvent,\n type RefObject,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { cn } from '../cn';\nimport { editSelection, watchFocus } from './text-selection';\n\nexport interface VariablePickerProps {\n variables: ReadonlyArray<{ name: string; label: string }>;\n /** The `SlotTextField` / `CodeArea` control the chosen `{{ name }}` token is inserted into. */\n targetRef: RefObject<HTMLInputElement | HTMLTextAreaElement | null>;\n className?: string;\n}\n\n/** The Liquid output tag for a variable (CTO decision 3). */\nfunction liquidToken(name: string): string {\n return `{{ ${name} }}`;\n}\n\n/** Keep focus where it is on press, so the target keeps its selection and the menu stays open. */\nfunction keepFocus(event: MouseEvent) {\n event.preventDefault();\n}\n\n/**\n * \"Insert variable\" menu button (WAI-ARIA menu-button pattern) for a `SlotTextField` or `CodeArea`.\n * Choosing a variable replaces the target's selection with `{{ name }}` (or appends it, if the\n * target never had focus), fires the target's change handler and returns focus to the target with\n * the cursor after the token. The variable list is a prop; the picker fetches nothing.\n */\nexport function VariablePicker({ variables, targetRef, className }: VariablePickerProps) {\n const menuId = useId();\n const trigger = useRef<HTMLButtonElement>(null);\n const menu = useRef<HTMLDivElement>(null);\n const items = useRef<(HTMLButtonElement | null)[]>([]);\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState(0);\n const count = variables.length;\n\n // The target may only mount or change after the picker, so look for it after every render.\n useEffect(() => {\n if (targetRef.current) watchFocus(targetRef.current);\n });\n\n useEffect(() => {\n if (open) items.current[active]?.focus();\n }, [open, active]);\n\n const openAt = (index: number) => {\n setActive(index);\n setOpen(true);\n };\n\n const close = () => {\n setOpen(false);\n trigger.current?.focus();\n };\n\n const choose = (name: string) => {\n setOpen(false);\n const control = targetRef.current;\n if (!control) {\n trigger.current?.focus();\n return;\n }\n const token = liquidToken(name);\n editSelection(control, () => ({ text: token, select: [token.length, token.length] }));\n };\n\n const onTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n const first = new Map([\n ['ArrowDown', 0],\n ['ArrowUp', count - 1],\n ]).get(event.key);\n if (first === undefined) return;\n event.preventDefault();\n openAt(first);\n };\n\n const onItemKeyDown = (event: KeyboardEvent<HTMLButtonElement>, index: number) => {\n const next = new Map([\n ['ArrowDown', (index + 1) % count],\n ['ArrowUp', (index - 1 + count) % count],\n ['Home', 0],\n ['End', count - 1],\n ]).get(event.key);\n if (next !== undefined) {\n event.preventDefault();\n setActive(next);\n return;\n }\n if (event.key !== 'Escape') return;\n event.preventDefault();\n close();\n };\n\n // Close when focus leaves the list: Tab or Shift+Tab, or a click anywhere else.\n const onItemBlur = (event: FocusEvent<HTMLButtonElement>) => {\n if (!menu.current?.contains(event.relatedTarget)) setOpen(false);\n };\n\n return (\n <div className={cn('variable-picker', className)}>\n <button\n ref={trigger}\n type=\"button\"\n className=\"variable-picker-trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={open}\n aria-controls={open ? menuId : undefined}\n disabled={count === 0}\n onMouseDown={keepFocus}\n onClick={() => {\n if (open) close();\n else openAt(0);\n }}\n onKeyDown={onTriggerKeyDown}\n >\n Insert variable\n </button>\n {open ? (\n <div\n ref={menu}\n id={menuId}\n role=\"menu\"\n aria-label=\"Variables\"\n className=\"variable-picker-menu\"\n >\n {variables.map((variable, index) => (\n <button\n key={variable.name}\n ref={(node) => {\n items.current[index] = node;\n }}\n type=\"button\"\n role=\"menuitem\"\n tabIndex={-1}\n className=\"variable-picker-item\"\n onMouseDown={keepFocus}\n onClick={() => choose(variable.name)}\n onKeyDown={(event) => onItemKeyDown(event, index)}\n onBlur={onItemBlur}\n >\n <span className=\"variable-picker-item-label\">{variable.label}</span>\n <code className=\"variable-picker-item-token\">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A,QACV,iBAAc;AAAA,QACd,iBAAe;AAAA,QACf,iBAAe,OAAO,SAAS;AAAA,QAC/B,UAAU,UAAU;AAAA,QACpB,aAAa;AAAA,QACb,SAAS,MAAM;AACb,cAAI,KAAM,OAAM;AAAA,cACX,QAAO,CAAC;AAAA,QACf;AAAA,QACA,WAAW;AAAA,QACZ;AAAA;AAAA,IAED;AAAA,IACC,OACC;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,IAAI;AAAA,QACJ,MAAK;AAAA,QACL,cAAW;AAAA,QACX,WAAU;AAAA,QAET,oBAAU,IAAI,CAAC,UAAU,UACxB;AAAA,UAAC;AAAA;AAAA,YAEC,KAAK,CAAC,SAAS;AACb,oBAAM,QAAQ,KAAK,IAAI;AAAA,YACzB;AAAA,YACA,MAAK;AAAA,YACL,MAAK;AAAA,YACL,UAAU;AAAA,YACV,WAAU;AAAA,YACV,aAAa;AAAA,YACb,SAAS,MAAM,OAAO,SAAS,IAAI;AAAA,YACnC,WAAW,CAAC,UAAU,cAAc,OAAO,KAAK;AAAA,YAChD,QAAQ;AAAA,YAER;AAAA,4DAAC,UAAK,WAAU,8BAA8B,mBAAS,OAAM;AAAA,cAC7D,8CAAC,UAAK,WAAU,8BAA8B,sBAAY,SAAS,IAAI,GAAE;AAAA;AAAA;AAAA,UAdpE,SAAS;AAAA,QAehB,CACD;AAAA;AAAA,IACH,IACE;AAAA,KACN;AAEJ;","names":["import_jsx_runtime","at","import_jsx_runtime","variantClass","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime"]}
|