@lssm/lib.presentation-runtime-react 0.0.0-canary-20251217083314 → 1.41.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/dist/WorkflowStepRenderer.js +10 -11
- package/dist/WorkflowStepper.js +2 -2
- package/dist/index.js +1 -1
- package/dist/nativewind-env.d.js +0 -0
- package/package.json +10 -10
- package/dist/WorkflowStepRenderer.d.ts +0 -31
- package/dist/WorkflowStepper.d.ts +0 -18
- package/dist/design-system/dist/_virtual/rolldown_runtime.js +0 -5
- package/dist/design-system/dist/components/atoms/EmptyState.js +0 -13
- package/dist/design-system/dist/components/atoms/LoaderCircular.js +0 -43
- package/dist/design-system/dist/components/atoms/Stepper.js +0 -13
- package/dist/design-system/dist/components/molecules/LoaderBlock.js +0 -24
- package/dist/design-system/dist/ui-kit-web/dist/ui/empty-state.js +0 -43
- package/dist/design-system/dist/ui-kit-web/dist/ui/stack.js +0 -158
- package/dist/design-system/dist/ui-kit-web/dist/ui/stepper.js +0 -37
- package/dist/design-system/dist/ui-kit-web/dist/ui/utils.js +0 -10
- package/dist/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +0 -13
- package/dist/index.d.ts +0 -114
- package/dist/nativewind-env.d.ts +0 -1
- package/dist/ui-kit-web/dist/ui/form.js +0 -15
- package/dist/useWorkflow.d.ts +0 -26
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { EmptyState$1 } from "./design-system/dist/components/atoms/EmptyState.js";
|
|
2
|
-
import { LoaderBlock } from "./design-system/dist/components/molecules/LoaderBlock.js";
|
|
3
1
|
import "react";
|
|
2
|
+
import { EmptyState, LoaderBlock } from "@lssm/lib.design-system";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
|
|
6
5
|
//#region src/WorkflowStepRenderer.tsx
|
|
@@ -8,7 +7,7 @@ function WorkflowStepRenderer({ spec, state, className, renderHumanStep, renderA
|
|
|
8
7
|
const steps = spec.definition.steps;
|
|
9
8
|
if (!steps.length) return /* @__PURE__ */ jsx("div", {
|
|
10
9
|
className,
|
|
11
|
-
children: /* @__PURE__ */ jsx(EmptyState
|
|
10
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
12
11
|
title: "No steps defined",
|
|
13
12
|
description: "Add at least one step to this workflow to render it."
|
|
14
13
|
})
|
|
@@ -23,21 +22,21 @@ function WorkflowStepRenderer({ spec, state, className, renderHumanStep, renderA
|
|
|
23
22
|
const lastExecution = state.history.at(-1);
|
|
24
23
|
if (state.status === "failed") return /* @__PURE__ */ jsx("div", {
|
|
25
24
|
className,
|
|
26
|
-
children: failedFallback?.(state, lastExecution) ?? /* @__PURE__ */ jsx(EmptyState
|
|
25
|
+
children: failedFallback?.(state, lastExecution) ?? /* @__PURE__ */ jsx(EmptyState, {
|
|
27
26
|
title: "Workflow failed",
|
|
28
27
|
description: lastExecution?.error ?? "Fix the underlying issue and retry the step."
|
|
29
28
|
})
|
|
30
29
|
});
|
|
31
30
|
if (state.status === "cancelled") return /* @__PURE__ */ jsx("div", {
|
|
32
31
|
className,
|
|
33
|
-
children: cancelledFallback ?? /* @__PURE__ */ jsx(EmptyState
|
|
32
|
+
children: cancelledFallback ?? /* @__PURE__ */ jsx(EmptyState, {
|
|
34
33
|
title: "Workflow cancelled",
|
|
35
34
|
description: "This workflow has been cancelled. Restart it to resume."
|
|
36
35
|
})
|
|
37
36
|
});
|
|
38
37
|
if (state.status === "completed") return /* @__PURE__ */ jsx("div", {
|
|
39
38
|
className,
|
|
40
|
-
children: completedFallback ?? /* @__PURE__ */ jsx(EmptyState
|
|
39
|
+
children: completedFallback ?? /* @__PURE__ */ jsx(EmptyState, {
|
|
41
40
|
title: "Workflow complete",
|
|
42
41
|
description: "All steps have been executed successfully."
|
|
43
42
|
})
|
|
@@ -45,7 +44,7 @@ function WorkflowStepRenderer({ spec, state, className, renderHumanStep, renderA
|
|
|
45
44
|
const activeStep = steps.find((step) => step.id === state.currentStep) ?? steps[0];
|
|
46
45
|
if (!activeStep) return /* @__PURE__ */ jsx("div", {
|
|
47
46
|
className,
|
|
48
|
-
children: /* @__PURE__ */ jsx(EmptyState
|
|
47
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
49
48
|
title: "No active step",
|
|
50
49
|
description: "This workflow has no active step."
|
|
51
50
|
})
|
|
@@ -59,7 +58,7 @@ function WorkflowStepRenderer({ spec, state, className, renderHumanStep, renderA
|
|
|
59
58
|
});
|
|
60
59
|
return /* @__PURE__ */ jsx("div", {
|
|
61
60
|
className,
|
|
62
|
-
children: /* @__PURE__ */ jsx(EmptyState
|
|
61
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
63
62
|
title: "Form renderer missing",
|
|
64
63
|
description: "Provide renderHumanStep to render this human step's form."
|
|
65
64
|
})
|
|
@@ -72,7 +71,7 @@ function WorkflowStepRenderer({ spec, state, className, renderHumanStep, renderA
|
|
|
72
71
|
});
|
|
73
72
|
return /* @__PURE__ */ jsx("div", {
|
|
74
73
|
className,
|
|
75
|
-
children: /* @__PURE__ */ jsx(EmptyState
|
|
74
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
76
75
|
title: "Automation step in progress",
|
|
77
76
|
description: `Waiting for automation "${activeStep.label}" to finish.`
|
|
78
77
|
})
|
|
@@ -84,14 +83,14 @@ function WorkflowStepRenderer({ spec, state, className, renderHumanStep, renderA
|
|
|
84
83
|
});
|
|
85
84
|
return /* @__PURE__ */ jsx("div", {
|
|
86
85
|
className,
|
|
87
|
-
children: /* @__PURE__ */ jsx(EmptyState
|
|
86
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
88
87
|
title: "Decision step awaiting input",
|
|
89
88
|
description: "Provide a custom decision renderer via renderDecisionStep."
|
|
90
89
|
})
|
|
91
90
|
});
|
|
92
91
|
default: return /* @__PURE__ */ jsx("div", {
|
|
93
92
|
className,
|
|
94
|
-
children: /* @__PURE__ */ jsx(EmptyState
|
|
93
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
95
94
|
title: "Unknown step type",
|
|
96
95
|
description: `Step "${activeStep.id}" has an unsupported type.`
|
|
97
96
|
})
|
package/dist/WorkflowStepper.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Stepper$1 } from "./design-system/dist/components/atoms/Stepper.js";
|
|
2
1
|
import "react";
|
|
2
|
+
import { Stepper } from "@lssm/lib.design-system";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/WorkflowStepper.tsx
|
|
@@ -9,7 +9,7 @@ function WorkflowStepper({ spec, state, className, showLabels = false }) {
|
|
|
9
9
|
const current = computeCurrent(steps, state);
|
|
10
10
|
return /* @__PURE__ */ jsxs("div", {
|
|
11
11
|
className: ["flex flex-col gap-2", className].filter(Boolean).join(" "),
|
|
12
|
-
children: [/* @__PURE__ */ jsx(Stepper
|
|
12
|
+
children: [/* @__PURE__ */ jsx(Stepper, {
|
|
13
13
|
current,
|
|
14
14
|
total
|
|
15
15
|
}), showLabels && total > 0 && /* @__PURE__ */ jsx("ol", {
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WorkflowStepRenderer } from "./WorkflowStepRenderer.js";
|
|
2
2
|
import { WorkflowStepper } from "./WorkflowStepper.js";
|
|
3
|
-
import { useForm } from "./ui-kit-web/dist/ui/form.js";
|
|
4
3
|
import { useWorkflow } from "./useWorkflow.js";
|
|
5
4
|
import * as React from "react";
|
|
5
|
+
import { useForm } from "@lssm/lib.ui-kit-web/ui/form";
|
|
6
6
|
|
|
7
7
|
//#region src/index.ts
|
|
8
8
|
function usePresentationController({ defaults, form: formOpts, toVariables, fetcher, toChips, useUrlState, replace }) {
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/lib.presentation-runtime-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.41.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
"react": "^19.2.3",
|
|
22
22
|
"react-hook-form": "^7.68.0",
|
|
23
23
|
"zod": "^4.1.13",
|
|
24
|
-
"@lssm/lib.presentation-runtime-core": "
|
|
24
|
+
"@lssm/lib.presentation-runtime-core": "1.41.1"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@lssm/lib.presentation-runtime-core": "
|
|
28
|
-
"@lssm/lib.contracts": "
|
|
29
|
-
"@lssm/lib.design-system": "
|
|
30
|
-
"@lssm/lib.ui-kit-web": "
|
|
27
|
+
"@lssm/lib.presentation-runtime-core": "1.41.1",
|
|
28
|
+
"@lssm/lib.contracts": "1.41.1",
|
|
29
|
+
"@lssm/lib.design-system": "1.41.1",
|
|
30
|
+
"@lssm/lib.ui-kit-web": "1.41.1"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist",
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
36
|
"exports": {
|
|
37
|
-
".": "./
|
|
38
|
-
"./useWorkflow": "./
|
|
39
|
-
"./WorkflowStepper": "./
|
|
40
|
-
"./WorkflowStepRenderer": "./
|
|
37
|
+
".": "./src/index.ts",
|
|
38
|
+
"./useWorkflow": "./src/useWorkflow.ts",
|
|
39
|
+
"./WorkflowStepper": "./src/WorkflowStepper.tsx",
|
|
40
|
+
"./WorkflowStepRenderer": "./src/WorkflowStepRenderer.tsx",
|
|
41
41
|
"./*": "./*"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
import { FormRef, Step, StepExecution, WorkflowSpec, WorkflowState } from "@lssm/lib.contracts/workflow";
|
|
4
|
-
|
|
5
|
-
//#region src/WorkflowStepRenderer.d.ts
|
|
6
|
-
interface WorkflowStepRendererProps {
|
|
7
|
-
spec: WorkflowSpec;
|
|
8
|
-
state: WorkflowState | null;
|
|
9
|
-
className?: string;
|
|
10
|
-
renderHumanStep?: (form: FormRef, step: Step) => React.ReactNode;
|
|
11
|
-
renderAutomationStep?: (step: Step) => React.ReactNode;
|
|
12
|
-
renderDecisionStep?: (step: Step) => React.ReactNode;
|
|
13
|
-
loadingFallback?: React.ReactNode;
|
|
14
|
-
completedFallback?: React.ReactNode;
|
|
15
|
-
cancelledFallback?: React.ReactNode;
|
|
16
|
-
failedFallback?: (state: WorkflowState, last: StepExecution | undefined) => React.ReactNode;
|
|
17
|
-
}
|
|
18
|
-
declare function WorkflowStepRenderer({
|
|
19
|
-
spec,
|
|
20
|
-
state,
|
|
21
|
-
className,
|
|
22
|
-
renderHumanStep,
|
|
23
|
-
renderAutomationStep,
|
|
24
|
-
renderDecisionStep,
|
|
25
|
-
loadingFallback,
|
|
26
|
-
completedFallback,
|
|
27
|
-
cancelledFallback,
|
|
28
|
-
failedFallback
|
|
29
|
-
}: WorkflowStepRendererProps): react_jsx_runtime0.JSX.Element;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { WorkflowStepRenderer, WorkflowStepRendererProps };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
-
import { WorkflowSpec, WorkflowState } from "@lssm/lib.contracts/workflow";
|
|
3
|
-
|
|
4
|
-
//#region src/WorkflowStepper.d.ts
|
|
5
|
-
interface WorkflowStepperProps {
|
|
6
|
-
spec: WorkflowSpec;
|
|
7
|
-
state: WorkflowState | null;
|
|
8
|
-
className?: string;
|
|
9
|
-
showLabels?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare function WorkflowStepper({
|
|
12
|
-
spec,
|
|
13
|
-
state,
|
|
14
|
-
className,
|
|
15
|
-
showLabels
|
|
16
|
-
}: WorkflowStepperProps): react_jsx_runtime0.JSX.Element;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { WorkflowStepper, WorkflowStepperProps };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { EmptyState } from "../../ui-kit-web/dist/ui/empty-state.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region ../design-system/dist/components/atoms/EmptyState.js
|
|
8
|
-
function EmptyState$1(props) {
|
|
9
|
-
return /* @__PURE__ */ jsx(EmptyState, { ...props });
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { EmptyState$1 };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../ui-kit-web/dist/ui/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
|
-
import { Loader2 } from "lucide-react";
|
|
6
|
-
|
|
7
|
-
//#region ../design-system/dist/components/atoms/LoaderCircular.js
|
|
8
|
-
const spinnerVariants = cva("animate-spin", {
|
|
9
|
-
variants: {
|
|
10
|
-
size: {
|
|
11
|
-
sm: "h-4 w-4",
|
|
12
|
-
md: "h-5 w-5",
|
|
13
|
-
lg: "h-6 w-6"
|
|
14
|
-
},
|
|
15
|
-
tone: {
|
|
16
|
-
default: "text-foreground",
|
|
17
|
-
muted: "text-muted-foreground"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
defaultVariants: {
|
|
21
|
-
size: "md",
|
|
22
|
-
tone: "muted"
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
function LoaderCircular({ size, tone, label, className, ...props }) {
|
|
26
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
27
|
-
className: cn("inline-flex items-center gap-2", className),
|
|
28
|
-
role: "status",
|
|
29
|
-
"aria-live": "polite",
|
|
30
|
-
"aria-busy": true,
|
|
31
|
-
...props,
|
|
32
|
-
children: [/* @__PURE__ */ jsx(Loader2, { className: cn(spinnerVariants({
|
|
33
|
-
size,
|
|
34
|
-
tone
|
|
35
|
-
})) }), label ? /* @__PURE__ */ jsx("span", {
|
|
36
|
-
className: "text-muted-foreground text-base",
|
|
37
|
-
children: label
|
|
38
|
-
}) : null]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
export { LoaderCircular };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Stepper } from "../../ui-kit-web/dist/ui/stepper.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region ../design-system/dist/components/atoms/Stepper.js
|
|
8
|
-
function Stepper$1(props) {
|
|
9
|
-
return /* @__PURE__ */ jsx(Stepper, { ...props });
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { Stepper$1 };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../ui-kit-web/dist/ui/utils.js";
|
|
2
|
-
import { LoaderCircular } from "../atoms/LoaderCircular.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
//#region ../design-system/dist/components/molecules/LoaderBlock.js
|
|
7
|
-
function LoaderBlock({ label, description, className, size = "md" }) {
|
|
8
|
-
return /* @__PURE__ */ jsx("div", {
|
|
9
|
-
className: cn("flex items-center justify-center p-6", className),
|
|
10
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
11
|
-
className: "inline-flex items-center gap-3",
|
|
12
|
-
children: [/* @__PURE__ */ jsx(LoaderCircular, {
|
|
13
|
-
size,
|
|
14
|
-
label
|
|
15
|
-
}), description ? /* @__PURE__ */ jsx("span", {
|
|
16
|
-
className: "text-muted-foreground text-base",
|
|
17
|
-
children: description
|
|
18
|
-
}) : null]
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
export { LoaderBlock };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
2
|
-
import { VStack } from "./stack.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { cva } from "class-variance-authority";
|
|
6
|
-
|
|
7
|
-
//#region ../design-system/dist/ui-kit-web/dist/ui/empty-state.js
|
|
8
|
-
init_utils();
|
|
9
|
-
const containerVariants = cva("items-center text-center", {
|
|
10
|
-
variants: { density: {
|
|
11
|
-
compact: "gap-3 p-6",
|
|
12
|
-
default: "gap-4 p-8"
|
|
13
|
-
} },
|
|
14
|
-
defaultVariants: { density: "default" }
|
|
15
|
-
});
|
|
16
|
-
function EmptyState({ icon, title, description, primaryAction, secondaryAction, className, density }) {
|
|
17
|
-
return /* @__PURE__ */ jsxs(VStack, {
|
|
18
|
-
className: cn(containerVariants({ density }), className),
|
|
19
|
-
children: [
|
|
20
|
-
icon ? /* @__PURE__ */ jsx("div", {
|
|
21
|
-
className: "bg-muted flex h-12 w-12 items-center justify-center rounded-full",
|
|
22
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
23
|
-
className: "text-muted-foreground flex items-center justify-center",
|
|
24
|
-
children: icon
|
|
25
|
-
})
|
|
26
|
-
}) : null,
|
|
27
|
-
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
28
|
-
className: "font-medium",
|
|
29
|
-
children: title
|
|
30
|
-
}), description ? /* @__PURE__ */ jsx("p", {
|
|
31
|
-
className: "text-muted-foreground text-base",
|
|
32
|
-
children: description
|
|
33
|
-
}) : null] }),
|
|
34
|
-
(primaryAction || secondaryAction) && /* @__PURE__ */ jsxs("div", {
|
|
35
|
-
className: "flex items-center justify-center gap-2",
|
|
36
|
-
children: [primaryAction, secondaryAction]
|
|
37
|
-
})
|
|
38
|
-
]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
export { EmptyState };
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
2
|
-
import * as React$1 from "react";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
|
-
|
|
6
|
-
//#region ../design-system/dist/ui-kit-web/dist/ui/stack.js
|
|
7
|
-
init_utils();
|
|
8
|
-
const vStackVariants = cva("flex flex-col", {
|
|
9
|
-
variants: {
|
|
10
|
-
gap: {
|
|
11
|
-
none: "gap-0",
|
|
12
|
-
xs: "gap-1",
|
|
13
|
-
sm: "gap-2",
|
|
14
|
-
md: "gap-3",
|
|
15
|
-
lg: "gap-4",
|
|
16
|
-
xl: "gap-6",
|
|
17
|
-
"2xl": "gap-8"
|
|
18
|
-
},
|
|
19
|
-
align: {
|
|
20
|
-
start: "items-start",
|
|
21
|
-
center: "items-center",
|
|
22
|
-
end: "items-end",
|
|
23
|
-
stretch: "items-stretch"
|
|
24
|
-
},
|
|
25
|
-
justify: {
|
|
26
|
-
start: "justify-start",
|
|
27
|
-
center: "justify-center",
|
|
28
|
-
end: "justify-end",
|
|
29
|
-
between: "justify-between",
|
|
30
|
-
around: "justify-around",
|
|
31
|
-
evenly: "justify-evenly"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
defaultVariants: {
|
|
35
|
-
gap: "md",
|
|
36
|
-
align: "stretch",
|
|
37
|
-
justify: "start"
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const VStack = React$1.forwardRef(({ className, gap, align, justify, as = "div", ...props }, ref) => {
|
|
41
|
-
return /* @__PURE__ */ jsx(as, {
|
|
42
|
-
ref,
|
|
43
|
-
className: cn(vStackVariants({
|
|
44
|
-
gap,
|
|
45
|
-
align,
|
|
46
|
-
justify
|
|
47
|
-
}), className),
|
|
48
|
-
...props
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
VStack.displayName = "VStack";
|
|
52
|
-
const hStackVariants = cva("flex flex-row", {
|
|
53
|
-
variants: {
|
|
54
|
-
gap: {
|
|
55
|
-
none: "gap-0",
|
|
56
|
-
xs: "gap-1",
|
|
57
|
-
sm: "gap-2",
|
|
58
|
-
md: "gap-3",
|
|
59
|
-
lg: "gap-4",
|
|
60
|
-
xl: "gap-6",
|
|
61
|
-
"2xl": "gap-8"
|
|
62
|
-
},
|
|
63
|
-
align: {
|
|
64
|
-
start: "items-start",
|
|
65
|
-
center: "items-center",
|
|
66
|
-
end: "items-end",
|
|
67
|
-
stretch: "items-stretch",
|
|
68
|
-
baseline: "items-baseline"
|
|
69
|
-
},
|
|
70
|
-
justify: {
|
|
71
|
-
start: "justify-start",
|
|
72
|
-
center: "justify-center",
|
|
73
|
-
end: "justify-end",
|
|
74
|
-
between: "justify-between",
|
|
75
|
-
around: "justify-around",
|
|
76
|
-
evenly: "justify-evenly"
|
|
77
|
-
},
|
|
78
|
-
wrap: {
|
|
79
|
-
nowrap: "flex-nowrap",
|
|
80
|
-
wrap: "flex-wrap",
|
|
81
|
-
wrapReverse: "flex-wrap-reverse"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
defaultVariants: {
|
|
85
|
-
gap: "md",
|
|
86
|
-
align: "center",
|
|
87
|
-
justify: "start",
|
|
88
|
-
wrap: "wrap"
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
const HStack = React$1.forwardRef(({ className, gap, align, justify, wrap, as = "div", ...props }, ref) => {
|
|
92
|
-
return /* @__PURE__ */ jsx(as, {
|
|
93
|
-
ref,
|
|
94
|
-
className: cn(hStackVariants({
|
|
95
|
-
gap,
|
|
96
|
-
align,
|
|
97
|
-
justify,
|
|
98
|
-
wrap
|
|
99
|
-
}), className),
|
|
100
|
-
...props
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
HStack.displayName = "HStack";
|
|
104
|
-
const boxVariants = cva("flex flex-row", {
|
|
105
|
-
variants: {
|
|
106
|
-
gap: {
|
|
107
|
-
none: "gap-0",
|
|
108
|
-
xs: "gap-1",
|
|
109
|
-
sm: "gap-2",
|
|
110
|
-
md: "gap-3",
|
|
111
|
-
lg: "gap-4",
|
|
112
|
-
xl: "gap-6",
|
|
113
|
-
"2xl": "gap-8"
|
|
114
|
-
},
|
|
115
|
-
align: {
|
|
116
|
-
start: "items-start",
|
|
117
|
-
center: "items-center",
|
|
118
|
-
end: "items-end",
|
|
119
|
-
stretch: "items-stretch",
|
|
120
|
-
baseline: "items-baseline"
|
|
121
|
-
},
|
|
122
|
-
justify: {
|
|
123
|
-
start: "justify-start",
|
|
124
|
-
center: "justify-center",
|
|
125
|
-
end: "justify-end",
|
|
126
|
-
between: "justify-between",
|
|
127
|
-
around: "justify-around",
|
|
128
|
-
evenly: "justify-evenly"
|
|
129
|
-
},
|
|
130
|
-
wrap: {
|
|
131
|
-
nowrap: "flex-nowrap",
|
|
132
|
-
wrap: "flex-wrap",
|
|
133
|
-
wrapReverse: "flex-wrap-reverse"
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
defaultVariants: {
|
|
137
|
-
gap: "md",
|
|
138
|
-
align: "center",
|
|
139
|
-
justify: "center",
|
|
140
|
-
wrap: "nowrap"
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
const Box = React$1.forwardRef(({ className, gap, align, justify, wrap, as = "div", ...props }, ref) => {
|
|
144
|
-
return /* @__PURE__ */ jsx(as, {
|
|
145
|
-
ref,
|
|
146
|
-
className: cn(boxVariants({
|
|
147
|
-
gap,
|
|
148
|
-
align,
|
|
149
|
-
justify,
|
|
150
|
-
wrap
|
|
151
|
-
}), className),
|
|
152
|
-
...props
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
Box.displayName = "Box";
|
|
156
|
-
|
|
157
|
-
//#endregion
|
|
158
|
-
export { HStack, VStack };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
2
|
-
import { HStack } from "./stack.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { cva } from "class-variance-authority";
|
|
6
|
-
|
|
7
|
-
//#region ../design-system/dist/ui-kit-web/dist/ui/stepper.js
|
|
8
|
-
init_utils();
|
|
9
|
-
const dotVariants = cva("h-2 w-2 rounded-full", {
|
|
10
|
-
variants: {
|
|
11
|
-
state: {
|
|
12
|
-
active: "bg-primary",
|
|
13
|
-
inactive: "bg-muted-foreground/20"
|
|
14
|
-
},
|
|
15
|
-
size: {
|
|
16
|
-
sm: "",
|
|
17
|
-
md: "h-2.5 w-2.5"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
defaultVariants: {
|
|
21
|
-
state: "inactive",
|
|
22
|
-
size: "md"
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
function Stepper({ current, total, size, className }) {
|
|
26
|
-
const items = Array.from({ length: Math.max(0, total) });
|
|
27
|
-
return /* @__PURE__ */ jsx(HStack, {
|
|
28
|
-
className: cn("items-center gap-2", className),
|
|
29
|
-
children: items.map((_, idx) => /* @__PURE__ */ jsx("span", { className: cn(dotVariants({
|
|
30
|
-
state: idx + 1 === current ? "active" : "inactive",
|
|
31
|
-
size
|
|
32
|
-
})) }, idx))
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
export { Stepper };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { __esmMin } from "../../../../_virtual/rolldown_runtime.js";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { twMerge } from "tailwind-merge";
|
|
4
|
-
|
|
5
|
-
//#region ../design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js
|
|
6
|
-
function cn(...inputs) {
|
|
7
|
-
return twMerge(clsx(inputs));
|
|
8
|
-
}
|
|
9
|
-
var init_utils = __esmMin((() => {}));
|
|
10
|
-
init_utils();
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { cn, init_utils };
|
package/dist/index.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { WorkflowStepRenderer } from "./WorkflowStepRenderer.js";
|
|
2
|
-
import { WorkflowStepper } from "./WorkflowStepper.js";
|
|
3
|
-
import { UseWorkflowOptions, UseWorkflowResult, useWorkflow } from "./useWorkflow.js";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { DefaultValues, Resolver, UseFormReturn } from "react-hook-form";
|
|
6
|
-
import { ListFetcher, ListState } from "@lssm/lib.presentation-runtime-core";
|
|
7
|
-
|
|
8
|
-
//#region src/index.d.ts
|
|
9
|
-
interface UsePresentationControllerOpts<TFilters extends Record<string, unknown>, TVars, TItem> {
|
|
10
|
-
defaults: ListState<TFilters>;
|
|
11
|
-
form: {
|
|
12
|
-
defaultValues: DefaultValues<TFilters> | TFilters;
|
|
13
|
-
resolver?: Resolver<TFilters>;
|
|
14
|
-
};
|
|
15
|
-
toVariables: (input: ListState<TFilters>) => TVars;
|
|
16
|
-
fetcher: ListFetcher<TVars, TItem>;
|
|
17
|
-
toChips?: (filters: TFilters, setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void) => {
|
|
18
|
-
key: string;
|
|
19
|
-
label: React.ReactNode;
|
|
20
|
-
onRemove?: () => void;
|
|
21
|
-
}[];
|
|
22
|
-
useUrlState: (args: {
|
|
23
|
-
defaults: ListState<TFilters>;
|
|
24
|
-
replace?: boolean;
|
|
25
|
-
}) => {
|
|
26
|
-
state: ListState<TFilters>;
|
|
27
|
-
setState: (next: Partial<ListState<TFilters>>) => void;
|
|
28
|
-
setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void;
|
|
29
|
-
clearFilters: () => void;
|
|
30
|
-
};
|
|
31
|
-
replace?: boolean;
|
|
32
|
-
}
|
|
33
|
-
declare function usePresentationController<TFilters extends Record<string, unknown>, TVars, TItem>({
|
|
34
|
-
defaults,
|
|
35
|
-
form: formOpts,
|
|
36
|
-
toVariables,
|
|
37
|
-
fetcher,
|
|
38
|
-
toChips,
|
|
39
|
-
useUrlState,
|
|
40
|
-
replace
|
|
41
|
-
}: UsePresentationControllerOpts<TFilters, TVars, TItem>): {
|
|
42
|
-
readonly form: UseFormReturn<TFilters>;
|
|
43
|
-
readonly url: {
|
|
44
|
-
state: ListState<TFilters>;
|
|
45
|
-
setState: (next: Partial<ListState<TFilters>>) => void;
|
|
46
|
-
setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void;
|
|
47
|
-
clearFilters: () => void;
|
|
48
|
-
};
|
|
49
|
-
readonly variables: TVars;
|
|
50
|
-
readonly data: TItem[];
|
|
51
|
-
readonly loading: boolean;
|
|
52
|
-
readonly error: unknown;
|
|
53
|
-
readonly totalItems: number | undefined;
|
|
54
|
-
readonly totalPages: number | undefined;
|
|
55
|
-
readonly refetch: () => Promise<void>;
|
|
56
|
-
readonly chips: {
|
|
57
|
-
key: string;
|
|
58
|
-
label: React.ReactNode;
|
|
59
|
-
onRemove?: () => void;
|
|
60
|
-
}[];
|
|
61
|
-
readonly setSearch: (q: string) => void;
|
|
62
|
-
readonly submitFilters: (e?: React.BaseSyntheticEvent) => Promise<void>;
|
|
63
|
-
readonly clearAll: () => void;
|
|
64
|
-
};
|
|
65
|
-
interface UseListCoordinatorOpts<TFilters extends Record<string, unknown>, TVars> {
|
|
66
|
-
defaults: ListState<TFilters>;
|
|
67
|
-
form: {
|
|
68
|
-
defaultValues: DefaultValues<TFilters>;
|
|
69
|
-
resolver?: Resolver<TFilters>;
|
|
70
|
-
};
|
|
71
|
-
toVariables: (input: ListState<TFilters>) => TVars;
|
|
72
|
-
toChips?: (filters: TFilters, setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void) => {
|
|
73
|
-
key: string;
|
|
74
|
-
label: React.ReactNode;
|
|
75
|
-
onRemove?: () => void;
|
|
76
|
-
}[];
|
|
77
|
-
useUrlState: (args: {
|
|
78
|
-
defaults: ListState<TFilters>;
|
|
79
|
-
replace?: boolean;
|
|
80
|
-
}) => {
|
|
81
|
-
state: ListState<TFilters>;
|
|
82
|
-
setState: (next: Partial<ListState<TFilters>>) => void;
|
|
83
|
-
setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void;
|
|
84
|
-
clearFilters: () => void;
|
|
85
|
-
};
|
|
86
|
-
replace?: boolean;
|
|
87
|
-
}
|
|
88
|
-
declare function useListCoordinator<TFilters extends Record<string, unknown>, TVars>({
|
|
89
|
-
defaults,
|
|
90
|
-
form: formOpts,
|
|
91
|
-
toVariables,
|
|
92
|
-
toChips,
|
|
93
|
-
useUrlState,
|
|
94
|
-
replace
|
|
95
|
-
}: UseListCoordinatorOpts<TFilters, TVars>): {
|
|
96
|
-
readonly form: UseFormReturn<TFilters>;
|
|
97
|
-
readonly url: {
|
|
98
|
-
state: ListState<TFilters>;
|
|
99
|
-
setState: (next: Partial<ListState<TFilters>>) => void;
|
|
100
|
-
setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void;
|
|
101
|
-
clearFilters: () => void;
|
|
102
|
-
};
|
|
103
|
-
readonly variables: TVars;
|
|
104
|
-
readonly chips: {
|
|
105
|
-
key: string;
|
|
106
|
-
label: React.ReactNode;
|
|
107
|
-
onRemove?: () => void;
|
|
108
|
-
}[];
|
|
109
|
-
readonly setSearch: (q: string) => void;
|
|
110
|
-
readonly submitFilters: (e?: React.BaseSyntheticEvent) => Promise<void>;
|
|
111
|
-
readonly clearAll: () => void;
|
|
112
|
-
};
|
|
113
|
-
//#endregion
|
|
114
|
-
export { UseListCoordinatorOpts, UsePresentationControllerOpts, type UseWorkflowOptions, type UseWorkflowResult, WorkflowStepRenderer, WorkflowStepper, useListCoordinator, usePresentationController, useWorkflow };
|
package/dist/nativewind-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React$1 from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import "@radix-ui/react-slot";
|
|
6
|
-
import { useForm } from "react-hook-form";
|
|
7
|
-
import "@hookform/resolvers/zod";
|
|
8
|
-
import "@radix-ui/react-label";
|
|
9
|
-
|
|
10
|
-
//#region ../ui-kit-web/dist/ui/form.js
|
|
11
|
-
const FormFieldContext = React$1.createContext({});
|
|
12
|
-
const FormItemContext = React$1.createContext({});
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
export { useForm };
|
package/dist/useWorkflow.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { WorkflowRunner, WorkflowState } from "@lssm/lib.contracts/workflow";
|
|
2
|
-
|
|
3
|
-
//#region src/useWorkflow.d.ts
|
|
4
|
-
interface UseWorkflowOptions {
|
|
5
|
-
workflowId: string;
|
|
6
|
-
runner: WorkflowRunner;
|
|
7
|
-
autoRefresh?: boolean;
|
|
8
|
-
refreshIntervalMs?: number;
|
|
9
|
-
}
|
|
10
|
-
interface UseWorkflowResult {
|
|
11
|
-
state: WorkflowState | null;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
error: Error | null;
|
|
14
|
-
isExecuting: boolean;
|
|
15
|
-
refresh: () => Promise<void>;
|
|
16
|
-
executeStep: (input?: unknown) => Promise<void>;
|
|
17
|
-
cancel: () => Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
declare function useWorkflow({
|
|
20
|
-
workflowId,
|
|
21
|
-
runner,
|
|
22
|
-
autoRefresh,
|
|
23
|
-
refreshIntervalMs
|
|
24
|
-
}: UseWorkflowOptions): UseWorkflowResult;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { UseWorkflowOptions, UseWorkflowResult, useWorkflow };
|