@lssm/lib.presentation-runtime-react 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WorkflowStepRenderer.d.ts +31 -0
- package/dist/WorkflowStepRenderer.d.ts.map +1 -0
- package/dist/WorkflowStepRenderer.js +104 -0
- package/dist/WorkflowStepRenderer.js.map +1 -0
- package/dist/WorkflowStepper.d.ts +18 -0
- package/dist/WorkflowStepper.d.ts.map +1 -0
- package/dist/WorkflowStepper.js +39 -0
- package/dist/WorkflowStepper.js.map +1 -0
- package/dist/_virtual/rolldown_runtime.js +22 -0
- package/dist/design-system/src/components/atoms/EmptyState.js +15 -0
- package/dist/design-system/src/components/atoms/EmptyState.js.map +1 -0
- package/dist/design-system/src/components/atoms/LoaderCircular.js +45 -0
- package/dist/design-system/src/components/atoms/LoaderCircular.js.map +1 -0
- package/dist/design-system/src/components/atoms/Stepper.js +15 -0
- package/dist/design-system/src/components/atoms/Stepper.js.map +1 -0
- package/dist/design-system/src/components/molecules/LoaderBlock.js +26 -0
- package/dist/design-system/src/components/molecules/LoaderBlock.js.map +1 -0
- package/dist/index.d.ts +114 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +130 -0
- package/dist/index.js.map +1 -0
- package/dist/nativewind-env.d.ts +1 -0
- package/dist/ui-kit-web/dist/ui/empty-state.js +44 -0
- package/dist/ui-kit-web/dist/ui/empty-state.js.map +1 -0
- package/dist/ui-kit-web/dist/ui/form.js +17 -0
- package/dist/ui-kit-web/dist/ui/form.js.map +1 -0
- package/dist/ui-kit-web/dist/ui/stack.js +159 -0
- package/dist/ui-kit-web/dist/ui/stack.js.map +1 -0
- package/dist/ui-kit-web/dist/ui/stepper.js +38 -0
- package/dist/ui-kit-web/dist/ui/stepper.js.map +1 -0
- package/dist/ui-kit-web/dist/ui/utils.js +14 -0
- package/dist/ui-kit-web/dist/ui/utils.js.map +1 -0
- package/dist/useWorkflow.d.ts +25 -0
- package/dist/useWorkflow.d.ts.map +1 -0
- package/dist/useWorkflow.js +79 -0
- package/dist/useWorkflow.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/WorkflowStepRenderer.d.ts
|
|
5
|
+
interface WorkflowStepRendererProps {
|
|
6
|
+
spec: WorkflowSpec;
|
|
7
|
+
state: WorkflowState | null;
|
|
8
|
+
className?: string;
|
|
9
|
+
renderHumanStep?: (form: FormRef, step: Step) => React.ReactNode;
|
|
10
|
+
renderAutomationStep?: (step: Step) => React.ReactNode;
|
|
11
|
+
renderDecisionStep?: (step: Step) => React.ReactNode;
|
|
12
|
+
loadingFallback?: React.ReactNode;
|
|
13
|
+
completedFallback?: React.ReactNode;
|
|
14
|
+
cancelledFallback?: React.ReactNode;
|
|
15
|
+
failedFallback?: (state: WorkflowState, last: StepExecution | undefined) => React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare function WorkflowStepRenderer({
|
|
18
|
+
spec,
|
|
19
|
+
state,
|
|
20
|
+
className,
|
|
21
|
+
renderHumanStep,
|
|
22
|
+
renderAutomationStep,
|
|
23
|
+
renderDecisionStep,
|
|
24
|
+
loadingFallback,
|
|
25
|
+
completedFallback,
|
|
26
|
+
cancelledFallback,
|
|
27
|
+
failedFallback
|
|
28
|
+
}: WorkflowStepRendererProps): react_jsx_runtime0.JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { WorkflowStepRenderer, WorkflowStepRendererProps };
|
|
31
|
+
//# sourceMappingURL=WorkflowStepRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowStepRenderer.d.ts","names":[],"sources":["../src/WorkflowStepRenderer.tsx"],"sourcesContent":[],"mappings":";;;;UAUiB,yBAAA;QACT;EADS,KAAA,EAER,aAFQ,GAAA,IAAA;EACT,SAAA,CAAA,EAAA,MAAA;EACC,eAAA,CAAA,EAAA,CAAA,IAAA,EAEkB,OAFlB,EAAA,IAAA,EAEiC,IAFjC,EAAA,GAE0C,KAAA,CAAM,SAFhD;EAEkB,oBAAA,CAAA,EAAA,CAAA,IAAA,EACK,IADL,EAAA,GACc,KAAA,CAAM,SADpB;EAAe,kBAAA,CAAA,EAAA,CAAA,IAAA,EAEZ,IAFY,EAAA,GAEH,KAAA,CAAM,SAFH;EAAS,eAAM,CAAA,EAGrC,KAAA,CAAM,SAH+B;EACzB,iBAAA,CAAA,EAGV,KAAA,CAAM,SAHI;EAAS,iBAAM,CAAA,EAIzB,KAAA,CAAM,SAJmB;EACjB,cAAA,CAAA,EAAA,CAAA,KAAA,EAKnB,aALmB,EAAA,IAAA,EAMpB,aANoB,GAAA,SAAA,EAAA,GAOvB,KAAA,CAAM,SAPiB;;AACJ,iBASV,oBAAA,CATU;EAAA,IAAA;EAAA,KAAA;EAAA,SAAA;EAAA,eAAA;EAAA,oBAAA;EAAA,kBAAA;EAAA,eAAA;EAAA,iBAAA;EAAA,iBAAA;EAAA;AAAA,CAAA,EAoBvB,yBApBuB,CAAA,EAoBE,kBAAA,CAAA,GAAA,CAAA,OApBF"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { EmptyState } from "./design-system/src/components/atoms/EmptyState.js";
|
|
2
|
+
import { LoaderBlock } from "./design-system/src/components/molecules/LoaderBlock.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/WorkflowStepRenderer.tsx
|
|
7
|
+
function WorkflowStepRenderer({ spec, state, className, renderHumanStep, renderAutomationStep, renderDecisionStep, loadingFallback, completedFallback, cancelledFallback, failedFallback }) {
|
|
8
|
+
const steps = spec.definition.steps;
|
|
9
|
+
if (!steps.length) return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className,
|
|
11
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
12
|
+
title: "No steps defined",
|
|
13
|
+
description: "Add at least one step to this workflow to render it."
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
if (!state) return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
className,
|
|
18
|
+
children: loadingFallback ?? /* @__PURE__ */ jsx(LoaderBlock, {
|
|
19
|
+
label: "Loading workflow",
|
|
20
|
+
description: "Fetching workflow state..."
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
const lastExecution = state.history.at(-1);
|
|
24
|
+
if (state.status === "failed") return /* @__PURE__ */ jsx("div", {
|
|
25
|
+
className,
|
|
26
|
+
children: failedFallback?.(state, lastExecution) ?? /* @__PURE__ */ jsx(EmptyState, {
|
|
27
|
+
title: "Workflow failed",
|
|
28
|
+
description: lastExecution?.error ?? "Fix the underlying issue and retry the step."
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
if (state.status === "cancelled") return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
className,
|
|
33
|
+
children: cancelledFallback ?? /* @__PURE__ */ jsx(EmptyState, {
|
|
34
|
+
title: "Workflow cancelled",
|
|
35
|
+
description: "This workflow has been cancelled. Restart it to resume."
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
if (state.status === "completed") return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
className,
|
|
40
|
+
children: completedFallback ?? /* @__PURE__ */ jsx(EmptyState, {
|
|
41
|
+
title: "Workflow complete",
|
|
42
|
+
description: "All steps have been executed successfully."
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
const activeStep = steps.find((step) => step.id === state.currentStep) ?? steps[0];
|
|
46
|
+
if (!activeStep) return /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className,
|
|
48
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
49
|
+
title: "No active step",
|
|
50
|
+
description: "This workflow has no active step."
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
switch (activeStep.type) {
|
|
54
|
+
case "human": {
|
|
55
|
+
const form = activeStep.action?.form;
|
|
56
|
+
if (form && renderHumanStep) return /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className,
|
|
58
|
+
children: renderHumanStep(form, activeStep)
|
|
59
|
+
});
|
|
60
|
+
return /* @__PURE__ */ jsx("div", {
|
|
61
|
+
className,
|
|
62
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
63
|
+
title: "Form renderer missing",
|
|
64
|
+
description: "Provide renderHumanStep to render this human step's form."
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
case "automation":
|
|
69
|
+
if (renderAutomationStep) return /* @__PURE__ */ jsx("div", {
|
|
70
|
+
className,
|
|
71
|
+
children: renderAutomationStep(activeStep)
|
|
72
|
+
});
|
|
73
|
+
return /* @__PURE__ */ jsx("div", {
|
|
74
|
+
className,
|
|
75
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
76
|
+
title: "Automation step in progress",
|
|
77
|
+
description: `Waiting for automation "${activeStep.label}" to finish.`
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
case "decision":
|
|
81
|
+
if (renderDecisionStep) return /* @__PURE__ */ jsx("div", {
|
|
82
|
+
className,
|
|
83
|
+
children: renderDecisionStep(activeStep)
|
|
84
|
+
});
|
|
85
|
+
return /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className,
|
|
87
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
88
|
+
title: "Decision step awaiting input",
|
|
89
|
+
description: "Provide a custom decision renderer via renderDecisionStep."
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
default: return /* @__PURE__ */ jsx("div", {
|
|
93
|
+
className,
|
|
94
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
95
|
+
title: "Unknown step type",
|
|
96
|
+
description: `Step "${activeStep.id}" has an unsupported type.`
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
export { WorkflowStepRenderer };
|
|
104
|
+
//# sourceMappingURL=WorkflowStepRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowStepRenderer.js","names":[],"sources":["../src/WorkflowStepRenderer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { EmptyState, LoaderBlock } from '@lssm/lib.design-system';\nimport type {\n FormRef,\n Step,\n WorkflowSpec,\n WorkflowState,\n StepExecution,\n} from '@lssm/lib.contracts/workflow';\n\nexport interface WorkflowStepRendererProps {\n spec: WorkflowSpec;\n state: WorkflowState | null;\n className?: string;\n renderHumanStep?: (form: FormRef, step: Step) => React.ReactNode;\n renderAutomationStep?: (step: Step) => React.ReactNode;\n renderDecisionStep?: (step: Step) => React.ReactNode;\n loadingFallback?: React.ReactNode;\n completedFallback?: React.ReactNode;\n cancelledFallback?: React.ReactNode;\n failedFallback?: (\n state: WorkflowState,\n last: StepExecution | undefined\n ) => React.ReactNode;\n}\n\nexport function WorkflowStepRenderer({\n spec,\n state,\n className,\n renderHumanStep,\n renderAutomationStep,\n renderDecisionStep,\n loadingFallback,\n completedFallback,\n cancelledFallback,\n failedFallback,\n}: WorkflowStepRendererProps) {\n const steps = spec.definition.steps;\n if (!steps.length) {\n return (\n <div className={className}>\n <EmptyState\n title=\"No steps defined\"\n description=\"Add at least one step to this workflow to render it.\"\n />\n </div>\n );\n }\n\n if (!state) {\n return (\n <div className={className}>\n {loadingFallback ?? (\n <LoaderBlock\n label=\"Loading workflow\"\n description=\"Fetching workflow state...\"\n />\n )}\n </div>\n );\n }\n\n const lastExecution = state.history.at(-1);\n\n if (state.status === 'failed') {\n return (\n <div className={className}>\n {failedFallback?.(state, lastExecution) ?? (\n <EmptyState\n title=\"Workflow failed\"\n description={\n lastExecution?.error ??\n 'Fix the underlying issue and retry the step.'\n }\n />\n )}\n </div>\n );\n }\n\n if (state.status === 'cancelled') {\n return (\n <div className={className}>\n {cancelledFallback ?? (\n <EmptyState\n title=\"Workflow cancelled\"\n description=\"This workflow has been cancelled. Restart it to resume.\"\n />\n )}\n </div>\n );\n }\n\n if (state.status === 'completed') {\n return (\n <div className={className}>\n {completedFallback ?? (\n <EmptyState\n title=\"Workflow complete\"\n description=\"All steps have been executed successfully.\"\n />\n )}\n </div>\n );\n }\n\n const activeStep =\n steps.find((step) => step.id === state.currentStep) ?? steps[0];\n\n if (!activeStep) {\n return (\n <div className={className}>\n <EmptyState\n title=\"No active step\"\n description=\"This workflow has no active step.\"\n />\n </div>\n );\n }\n\n switch (activeStep.type) {\n case 'human': {\n const form = activeStep.action?.form;\n if (form && renderHumanStep) {\n return (\n <div className={className}>{renderHumanStep(form, activeStep)}</div>\n );\n }\n return (\n <div className={className}>\n <EmptyState\n title=\"Form renderer missing\"\n description=\"Provide renderHumanStep to render this human step's form.\"\n />\n </div>\n );\n }\n case 'automation': {\n if (renderAutomationStep) {\n return (\n <div className={className}>{renderAutomationStep(activeStep)}</div>\n );\n }\n return (\n <div className={className}>\n <EmptyState\n title=\"Automation step in progress\"\n description={`Waiting for automation \"${activeStep.label}\" to finish.`}\n />\n </div>\n );\n }\n case 'decision': {\n if (renderDecisionStep) {\n return (\n <div className={className}>{renderDecisionStep(activeStep)}</div>\n );\n }\n return (\n <div className={className}>\n <EmptyState\n title=\"Decision step awaiting input\"\n description=\"Provide a custom decision renderer via renderDecisionStep.\"\n />\n </div>\n );\n }\n default:\n return (\n <div className={className}>\n <EmptyState\n title=\"Unknown step type\"\n description={`Step \"${activeStep.id}\" has an unsupported type.`}\n />\n </div>\n );\n }\n}\n"],"mappings":";;;;;;AA0BA,SAAgB,qBAAqB,EACnC,MACA,OACA,WACA,iBACA,sBACA,oBACA,iBACA,mBACA,mBACA,kBAC4B;CAC5B,MAAM,QAAQ,KAAK,WAAW;AAC9B,KAAI,CAAC,MAAM,OACT,QACE,oBAAC;EAAe;YACd,oBAAC;GACC,OAAM;GACN,aAAY;IACZ;GACE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GAAG;KACpC;IACE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/WorkflowStepper.d.ts
|
|
4
|
+
interface WorkflowStepperProps {
|
|
5
|
+
spec: WorkflowSpec;
|
|
6
|
+
state: WorkflowState | null;
|
|
7
|
+
className?: string;
|
|
8
|
+
showLabels?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function WorkflowStepper({
|
|
11
|
+
spec,
|
|
12
|
+
state,
|
|
13
|
+
className,
|
|
14
|
+
showLabels
|
|
15
|
+
}: WorkflowStepperProps): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { WorkflowStepper, WorkflowStepperProps };
|
|
18
|
+
//# sourceMappingURL=WorkflowStepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowStepper.d.ts","names":[],"sources":["../src/WorkflowStepper.tsx"],"sourcesContent":[],"mappings":";;;UAIiB,oBAAA;QACT;EADS,KAAA,EAER,aAFQ,GAAoB,IAAA;EAOrB,SAAA,CAAA,EAAA,MAAe;EAC7B,UAAA,CAAA,EAAA,OAAA;;AAEA,iBAHc,eAAA,CAGd;EAAA,IAAA;EAAA,KAAA;EAAA,SAAA;EAAA;AAAA,CAAA,EAEC,oBAFD,CAAA,EAEqB,kBAAA,CAAA,GAAA,CAAA,OAFrB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Stepper } from "./design-system/src/components/atoms/Stepper.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/WorkflowStepper.tsx
|
|
6
|
+
function WorkflowStepper({ spec, state, className, showLabels = false }) {
|
|
7
|
+
const steps = spec.definition.steps;
|
|
8
|
+
const total = steps.length;
|
|
9
|
+
const current = computeCurrent(steps, state);
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: ["flex flex-col gap-2", className].filter(Boolean).join(" "),
|
|
12
|
+
children: [/* @__PURE__ */ jsx(Stepper, {
|
|
13
|
+
current,
|
|
14
|
+
total
|
|
15
|
+
}), showLabels && total > 0 && /* @__PURE__ */ jsx("ol", {
|
|
16
|
+
className: "text-muted-foreground flex flex-wrap gap-2 text-sm",
|
|
17
|
+
children: steps.map((step, index) => {
|
|
18
|
+
return /* @__PURE__ */ jsx("li", {
|
|
19
|
+
className: ["rounded border px-2 py-1", (state?.status === "completed" ? index === total - 1 : step.id === state?.currentStep) ? "border-primary text-primary" : "border-border"].join(" "),
|
|
20
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
21
|
+
className: "font-medium",
|
|
22
|
+
children: step.label
|
|
23
|
+
})
|
|
24
|
+
}, step.id);
|
|
25
|
+
})
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function computeCurrent(steps, state) {
|
|
30
|
+
if (!steps.length) return 0;
|
|
31
|
+
if (!state) return 1;
|
|
32
|
+
if (state.status === "completed") return steps.length;
|
|
33
|
+
const idx = steps.findIndex((step) => step.id === state.currentStep);
|
|
34
|
+
return idx === -1 ? 1 : idx + 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { WorkflowStepper };
|
|
39
|
+
//# sourceMappingURL=WorkflowStepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowStepper.js","names":[],"sources":["../src/WorkflowStepper.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { WorkflowSpec, WorkflowState } from '@lssm/lib.contracts/workflow';\nimport { Stepper } from '@lssm/lib.design-system';\n\nexport interface WorkflowStepperProps {\n spec: WorkflowSpec;\n state: WorkflowState | null;\n className?: string;\n showLabels?: boolean;\n}\n\nexport function WorkflowStepper({\n spec,\n state,\n className,\n showLabels = false,\n}: WorkflowStepperProps) {\n const steps = spec.definition.steps;\n const total = steps.length;\n const current = computeCurrent(steps, state);\n\n return (\n <div\n className={['flex flex-col gap-2', className].filter(Boolean).join(' ')}\n >\n <Stepper current={current} total={total} />\n {showLabels && total > 0 && (\n <ol className=\"text-muted-foreground flex flex-wrap gap-2 text-sm\">\n {steps.map((step, index) => {\n const isActive =\n state?.status === 'completed'\n ? index === total - 1\n : step.id === state?.currentStep;\n return (\n <li\n key={step.id}\n className={[\n 'rounded border px-2 py-1',\n isActive ? 'border-primary text-primary' : 'border-border',\n ].join(' ')}\n >\n <span className=\"font-medium\">{step.label}</span>\n </li>\n );\n })}\n </ol>\n )}\n </div>\n );\n}\n\nfunction computeCurrent(\n steps: WorkflowSpec['definition']['steps'],\n state: WorkflowState | null\n) {\n if (!steps.length) return 0;\n if (!state) return 1;\n\n if (state.status === 'completed') return steps.length;\n\n const idx = steps.findIndex((step) => step.id === state.currentStep);\n return idx === -1 ? 1 : idx + 1;\n}\n"],"mappings":";;;;;AAWA,SAAgB,gBAAgB,EAC9B,MACA,OACA,WACA,aAAa,SACU;CACvB,MAAM,QAAQ,KAAK,WAAW;CAC9B,MAAM,QAAQ,MAAM;CACpB,MAAM,UAAU,eAAe,OAAO,MAAM;AAE5C,QACE,qBAAC;EACC,WAAW,CAAC,uBAAuB,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;aAEvE,oBAAC;GAAiB;GAAgB;IAAS,EAC1C,cAAc,QAAQ,KACrB,oBAAC;GAAG,WAAU;aACX,MAAM,KAAK,MAAM,UAAU;AAK1B,WACE,oBAAC;KAEC,WAAW,CACT,6BAPJ,OAAO,WAAW,cACd,UAAU,QAAQ,IAClB,KAAK,OAAO,OAAO,eAMR,gCAAgC,gBAC5C,CAAC,KAAK,IAAI;eAEX,oBAAC;MAAK,WAAU;gBAAe,KAAK;OAAa;OAN5C,KAAK,GAOP;KAEP;IACC;GAEH;;AAIV,SAAS,eACP,OACA,OACA;AACA,KAAI,CAAC,MAAM,OAAQ,QAAO;AAC1B,KAAI,CAAC,MAAO,QAAO;AAEnB,KAAI,MAAM,WAAW,YAAa,QAAO,MAAM;CAE/C,MAAM,MAAM,MAAM,WAAW,SAAS,KAAK,OAAO,MAAM,YAAY;AACpE,QAAO,QAAQ,KAAK,IAAI,MAAM"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __esm = (fn, res) => function() {
|
|
7
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { __esm };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { EmptyState } from "../../../../ui-kit-web/dist/ui/empty-state.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region ../design-system/src/components/atoms/EmptyState.tsx
|
|
9
|
+
function EmptyState$1(props) {
|
|
10
|
+
return /* @__PURE__ */ jsx(EmptyState, { ...props });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { EmptyState$1 as EmptyState };
|
|
15
|
+
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":["EmptyState","WebEmptyState"],"sources":["../../../../../../design-system/src/components/atoms/EmptyState.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n EmptyState as WebEmptyState,\n type EmptyStateProps,\n} from '@lssm/lib.ui-kit-web/ui/empty-state';\n\nexport function EmptyState(props: EmptyStateProps) {\n return <WebEmptyState {...props} />;\n}\n"],"mappings":";;;;;;;;AAQA,SAAgBA,aAAW,OAAwB;AACjD,QAAO,oBAACC,cAAc,GAAI,QAAS"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cn, init_utils } 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/src/components/atoms/LoaderCircular.tsx
|
|
8
|
+
init_utils();
|
|
9
|
+
const spinnerVariants = cva("animate-spin", {
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
sm: "h-4 w-4",
|
|
13
|
+
md: "h-5 w-5",
|
|
14
|
+
lg: "h-6 w-6"
|
|
15
|
+
},
|
|
16
|
+
tone: {
|
|
17
|
+
default: "text-foreground",
|
|
18
|
+
muted: "text-muted-foreground"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
size: "md",
|
|
23
|
+
tone: "muted"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
function LoaderCircular({ size, tone, label, className,...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: cn("inline-flex items-center gap-2", className),
|
|
29
|
+
role: "status",
|
|
30
|
+
"aria-live": "polite",
|
|
31
|
+
"aria-busy": true,
|
|
32
|
+
...props,
|
|
33
|
+
children: [/* @__PURE__ */ jsx(Loader2, { className: cn(spinnerVariants({
|
|
34
|
+
size,
|
|
35
|
+
tone
|
|
36
|
+
})) }), label ? /* @__PURE__ */ jsx("span", {
|
|
37
|
+
className: "text-muted-foreground text-base",
|
|
38
|
+
children: label
|
|
39
|
+
}) : null]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { LoaderCircular };
|
|
45
|
+
//# sourceMappingURL=LoaderCircular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderCircular.js","names":[],"sources":["../../../../../../design-system/src/components/atoms/LoaderCircular.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@lssm/lib.ui-kit-web/ui/utils';\n\nconst spinnerVariants = cva('animate-spin', {\n variants: {\n size: {\n sm: 'h-4 w-4',\n md: 'h-5 w-5',\n lg: 'h-6 w-6',\n },\n tone: {\n default: 'text-foreground',\n muted: 'text-muted-foreground',\n },\n },\n defaultVariants: { size: 'md', tone: 'muted' },\n});\n\nexport type LoaderCircularProps = React.HTMLAttributes<HTMLDivElement> &\n VariantProps<typeof spinnerVariants> & {\n label?: React.ReactNode;\n };\n\nexport function LoaderCircular({\n size,\n tone,\n label,\n className,\n ...props\n}: LoaderCircularProps) {\n return (\n <div\n className={cn('inline-flex items-center gap-2', className)}\n role=\"status\"\n aria-live=\"polite\"\n aria-busy\n {...props}\n >\n <Loader2 className={cn(spinnerVariants({ size, tone }))} />\n {label ? (\n <span className=\"text-muted-foreground text-base\">{label}</span>\n ) : null}\n </div>\n );\n}\n\nexport default LoaderCircular;\n"],"mappings":";;;;;;;YAGmD;AAEnD,MAAM,kBAAkB,IAAI,gBAAgB;CAC1C,UAAU;EACR,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,MAAM;GACJ,SAAS;GACT,OAAO;GACR;EACF;CACD,iBAAiB;EAAE,MAAM;EAAM,MAAM;EAAS;CAC/C,CAAC;AAOF,SAAgB,eAAe,EAC7B,MACA,MACA,OACA,UACA,GAAG,SACmB;AACtB,QACE,qBAAC;EACC,WAAW,GAAG,kCAAkC,UAAU;EAC1D,MAAK;EACL,aAAU;EACV;EACA,GAAI;aAEJ,oBAAC,WAAQ,WAAW,GAAG,gBAAgB;GAAE;GAAM;GAAM,CAAC,CAAC,GAAI,EAC1D,QACC,oBAAC;GAAK,WAAU;aAAmC;IAAa,GAC9D;GACA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { Stepper } from "../../../../ui-kit-web/dist/ui/stepper.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region ../design-system/src/components/atoms/Stepper.tsx
|
|
9
|
+
function Stepper$1(props) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Stepper, { ...props });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Stepper$1 as Stepper };
|
|
15
|
+
//# sourceMappingURL=Stepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.js","names":["Stepper","WebStepper"],"sources":["../../../../../../design-system/src/components/atoms/Stepper.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n Stepper as WebStepper,\n type StepperProps,\n} from '@lssm/lib.ui-kit-web/ui/stepper';\n\nexport function Stepper(props: StepperProps) {\n return <WebStepper {...props} />;\n}\n"],"mappings":";;;;;;;;AAQA,SAAgBA,UAAQ,OAAqB;AAC3C,QAAO,oBAACC,WAAW,GAAI,QAAS"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn, init_utils } 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/src/components/molecules/LoaderBlock.tsx
|
|
7
|
+
init_utils();
|
|
8
|
+
function LoaderBlock({ label, description, className, size = "md" }) {
|
|
9
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className: cn("flex items-center justify-center p-6", className),
|
|
11
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
className: "inline-flex items-center gap-3",
|
|
13
|
+
children: [/* @__PURE__ */ jsx(LoaderCircular, {
|
|
14
|
+
size,
|
|
15
|
+
label
|
|
16
|
+
}), description ? /* @__PURE__ */ jsx("span", {
|
|
17
|
+
className: "text-muted-foreground text-base",
|
|
18
|
+
children: description
|
|
19
|
+
}) : null]
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { LoaderBlock };
|
|
26
|
+
//# sourceMappingURL=LoaderBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderBlock.js","names":[],"sources":["../../../../../../design-system/src/components/molecules/LoaderBlock.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@lssm/lib.ui-kit-web/ui/utils';\nimport { LoaderCircular } from '../atoms/LoaderCircular';\n\nexport interface LoaderBlockProps {\n label?: React.ReactNode;\n description?: React.ReactNode;\n className?: string;\n size?: 'sm' | 'md' | 'lg';\n}\n\nexport function LoaderBlock({\n label,\n description,\n className,\n size = 'md',\n}: LoaderBlockProps) {\n return (\n <div className={cn('flex items-center justify-center p-6', className)}>\n <div className=\"inline-flex items-center gap-3\">\n <LoaderCircular size={size} label={label} />\n {description ? (\n <span className=\"text-muted-foreground text-base\">{description}</span>\n ) : null}\n </div>\n </div>\n );\n}\n\nexport default LoaderBlock;\n"],"mappings":";;;;;;YACmD;AAUnD,SAAgB,YAAY,EAC1B,OACA,aACA,WACA,OAAO,QACY;AACnB,QACE,oBAAC;EAAI,WAAW,GAAG,wCAAwC,UAAU;YACnE,qBAAC;GAAI,WAAU;cACb,oBAAC;IAAqB;IAAa;KAAS,EAC3C,cACC,oBAAC;IAAK,WAAU;cAAmC;KAAmB,GACpE;IACA;GACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
interface UsePresentationControllerOpts<TFilters extends Record<string, unknown>, TVars, TItem> {
|
|
9
|
+
defaults: ListState<TFilters>;
|
|
10
|
+
form: {
|
|
11
|
+
defaultValues: DefaultValues<TFilters> | TFilters;
|
|
12
|
+
resolver?: Resolver<TFilters>;
|
|
13
|
+
};
|
|
14
|
+
toVariables: (input: ListState<TFilters>) => TVars;
|
|
15
|
+
fetcher: ListFetcher<TVars, TItem>;
|
|
16
|
+
toChips?: (filters: TFilters, setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void) => {
|
|
17
|
+
key: string;
|
|
18
|
+
label: React.ReactNode;
|
|
19
|
+
onRemove?: () => void;
|
|
20
|
+
}[];
|
|
21
|
+
useUrlState: (args: {
|
|
22
|
+
defaults: ListState<TFilters>;
|
|
23
|
+
replace?: boolean;
|
|
24
|
+
}) => {
|
|
25
|
+
state: ListState<TFilters>;
|
|
26
|
+
setState: (next: Partial<ListState<TFilters>>) => void;
|
|
27
|
+
setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void;
|
|
28
|
+
clearFilters: () => void;
|
|
29
|
+
};
|
|
30
|
+
replace?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare function usePresentationController<TFilters extends Record<string, unknown>, TVars, TItem>({
|
|
33
|
+
defaults,
|
|
34
|
+
form: formOpts,
|
|
35
|
+
toVariables,
|
|
36
|
+
fetcher,
|
|
37
|
+
toChips,
|
|
38
|
+
useUrlState,
|
|
39
|
+
replace
|
|
40
|
+
}: UsePresentationControllerOpts<TFilters, TVars, TItem>): {
|
|
41
|
+
readonly form: UseFormReturn<TFilters>;
|
|
42
|
+
readonly url: {
|
|
43
|
+
state: ListState<TFilters>;
|
|
44
|
+
setState: (next: Partial<ListState<TFilters>>) => void;
|
|
45
|
+
setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void;
|
|
46
|
+
clearFilters: () => void;
|
|
47
|
+
};
|
|
48
|
+
readonly variables: TVars;
|
|
49
|
+
readonly data: TItem[];
|
|
50
|
+
readonly loading: boolean;
|
|
51
|
+
readonly error: unknown;
|
|
52
|
+
readonly totalItems: number | undefined;
|
|
53
|
+
readonly totalPages: number | undefined;
|
|
54
|
+
readonly refetch: () => Promise<void>;
|
|
55
|
+
readonly chips: {
|
|
56
|
+
key: string;
|
|
57
|
+
label: React.ReactNode;
|
|
58
|
+
onRemove?: () => void;
|
|
59
|
+
}[];
|
|
60
|
+
readonly setSearch: (q: string) => void;
|
|
61
|
+
readonly submitFilters: (e?: React.BaseSyntheticEvent) => Promise<void>;
|
|
62
|
+
readonly clearAll: () => void;
|
|
63
|
+
};
|
|
64
|
+
interface UseListCoordinatorOpts<TFilters extends Record<string, unknown>, TVars> {
|
|
65
|
+
defaults: ListState<TFilters>;
|
|
66
|
+
form: {
|
|
67
|
+
defaultValues: DefaultValues<TFilters>;
|
|
68
|
+
resolver?: Resolver<TFilters>;
|
|
69
|
+
};
|
|
70
|
+
toVariables: (input: ListState<TFilters>) => TVars;
|
|
71
|
+
toChips?: (filters: TFilters, setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void) => {
|
|
72
|
+
key: string;
|
|
73
|
+
label: React.ReactNode;
|
|
74
|
+
onRemove?: () => void;
|
|
75
|
+
}[];
|
|
76
|
+
useUrlState: (args: {
|
|
77
|
+
defaults: ListState<TFilters>;
|
|
78
|
+
replace?: boolean;
|
|
79
|
+
}) => {
|
|
80
|
+
state: ListState<TFilters>;
|
|
81
|
+
setState: (next: Partial<ListState<TFilters>>) => void;
|
|
82
|
+
setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void;
|
|
83
|
+
clearFilters: () => void;
|
|
84
|
+
};
|
|
85
|
+
replace?: boolean;
|
|
86
|
+
}
|
|
87
|
+
declare function useListCoordinator<TFilters extends Record<string, unknown>, TVars>({
|
|
88
|
+
defaults,
|
|
89
|
+
form: formOpts,
|
|
90
|
+
toVariables,
|
|
91
|
+
toChips,
|
|
92
|
+
useUrlState,
|
|
93
|
+
replace
|
|
94
|
+
}: UseListCoordinatorOpts<TFilters, TVars>): {
|
|
95
|
+
readonly form: UseFormReturn<TFilters>;
|
|
96
|
+
readonly url: {
|
|
97
|
+
state: ListState<TFilters>;
|
|
98
|
+
setState: (next: Partial<ListState<TFilters>>) => void;
|
|
99
|
+
setFilter: (key: keyof TFilters, value: TFilters[keyof TFilters] | null) => void;
|
|
100
|
+
clearFilters: () => void;
|
|
101
|
+
};
|
|
102
|
+
readonly variables: TVars;
|
|
103
|
+
readonly chips: {
|
|
104
|
+
key: string;
|
|
105
|
+
label: React.ReactNode;
|
|
106
|
+
onRemove?: () => void;
|
|
107
|
+
}[];
|
|
108
|
+
readonly setSearch: (q: string) => void;
|
|
109
|
+
readonly submitFilters: (e?: React.BaseSyntheticEvent) => Promise<void>;
|
|
110
|
+
readonly clearAll: () => void;
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
export { UseListCoordinatorOpts, UsePresentationControllerOpts, type UseWorkflowOptions, type UseWorkflowResult, WorkflowStepRenderer, WorkflowStepper, useListCoordinator, usePresentationController, useWorkflow };
|
|
114
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;UAQiB,+CACE;YAIP,UAAU;;mBAEH,cAAc,YAAY;IAP5B,QAAA,CAAA,EAQF,QARE,CAQO,QARsB,CAAA;EAC3B,CAAA;EAIG,WAAA,EAAA,CAAA,KAAA,EAKC,SALD,CAKW,QALX,CAAA,EAAA,GAKyB,KALzB;EAAV,OAAA,EAMD,WANC,CAMW,KANX,EAMkB,KANlB,CAAA;EAEqB,OAAA,CAAA,EAAA,CAAA,OAAA,EAMpB,QANoB,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,MAQhB,QARgB,EAAA,KAAA,EASpB,QAToB,CAAA,MASL,QATK,CAAA,GAAA,IAAA,EAAA,GAAA,IAAA,EAAA,GAAA;IAAd,GAAA,EAAA,MAAA;IAA0B,KAAA,EAWhB,KAAA,CAAM,SAXU;IACrB,QAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EAAT,CAAA,EAAA;EAEkB,WAAA,EAAA,CAAA,IAAA,EAAA;IAAV,QAAA,EASW,SATX,CASqB,QATrB,CAAA;IAAwB,OAAA,CAAA,EAAA,OAAA;EACxB,CAAA,EAAA,GAAA;IAAO,KAAA,EASnB,SATmB,CAST,QATS,CAAA;IAAnB,QAAA,EAAA,CAAA,IAAA,EAUU,OAVV,CAUkB,SAVlB,CAU4B,QAV5B,CAAA,CAAA,EAAA,GAAA,IAAA;IAEE,SAAA,EAAA,CAAA,GAAA,EAAA,MAUI,QAVJ,EAAA,KAAA,EAWA,QAXA,CAAA,MAWe,QAXf,CAAA,GAAA,IAAA,EAAA,GAAA,IAAA;IAEI,YAAA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AAA,EAAA,GAAA,IAAA;IAEI,YAAA,EAAA,GAAA,GAAA,IAAA;EACJ,CAAA;EAAe,SAAA,SAAA,OAAA;EAEC,SAAM,KAAA,EAAA;IACS,GAAA,EAAA,MAAA;IAAV,KAAA,EADL,KAAA,CAAM,SACD;IACb,QAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EAAV,CAAA,EAAA;EAC4B,SAAA,SAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,GAAA,IAAA;EAAV,SAAA,aAAA,EAAA,CAAA,CAAA,CAAA,0BAAA,EAAA,UAAA,CAAA,IAAA,CAAA;EAAR,SAAA,QAAA,EAAA,GAAA,GAAA,IAAA;CAEJ"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useForm } from "./ui-kit-web/dist/ui/form.js";
|
|
2
|
+
import { WorkflowStepRenderer } from "./WorkflowStepRenderer.js";
|
|
3
|
+
import { WorkflowStepper } from "./WorkflowStepper.js";
|
|
4
|
+
import { useWorkflow } from "./useWorkflow.js";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/index.ts
|
|
8
|
+
function usePresentationController({ defaults, form: formOpts, toVariables, fetcher, toChips, useUrlState, replace }) {
|
|
9
|
+
const url = useUrlState({
|
|
10
|
+
defaults,
|
|
11
|
+
replace
|
|
12
|
+
});
|
|
13
|
+
const form = useForm({
|
|
14
|
+
defaultValues: formOpts.defaultValues,
|
|
15
|
+
resolver: formOpts.resolver
|
|
16
|
+
});
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
form.reset({
|
|
19
|
+
...form.getValues(),
|
|
20
|
+
...url.state.filters
|
|
21
|
+
});
|
|
22
|
+
}, [url.state.filters]);
|
|
23
|
+
const submitFilters = form.handleSubmit((values) => {
|
|
24
|
+
url.setState({
|
|
25
|
+
filters: values,
|
|
26
|
+
page: 1
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const setSearch = React.useCallback((q) => url.setState({
|
|
30
|
+
q,
|
|
31
|
+
page: 1
|
|
32
|
+
}), [url]);
|
|
33
|
+
const variables = React.useMemo(() => toVariables(url.state), [url.state, toVariables]);
|
|
34
|
+
const [data, setData] = React.useState([]);
|
|
35
|
+
const [loading, setLoading] = React.useState(false);
|
|
36
|
+
const [error, setError] = React.useState(null);
|
|
37
|
+
const [totalItems, setTotalItems] = React.useState(void 0);
|
|
38
|
+
const [totalPages, setTotalPages] = React.useState(void 0);
|
|
39
|
+
const refetch = React.useCallback(async () => {
|
|
40
|
+
setLoading(true);
|
|
41
|
+
setError(null);
|
|
42
|
+
try {
|
|
43
|
+
const out = await fetcher(variables);
|
|
44
|
+
setData(out.items);
|
|
45
|
+
setTotalItems(out.totalItems);
|
|
46
|
+
setTotalPages(out.totalPages);
|
|
47
|
+
} catch (e) {
|
|
48
|
+
setError(e);
|
|
49
|
+
} finally {
|
|
50
|
+
setLoading(false);
|
|
51
|
+
}
|
|
52
|
+
}, [variables, fetcher]);
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
refetch();
|
|
55
|
+
}, [refetch]);
|
|
56
|
+
return {
|
|
57
|
+
form,
|
|
58
|
+
url,
|
|
59
|
+
variables,
|
|
60
|
+
data,
|
|
61
|
+
loading,
|
|
62
|
+
error,
|
|
63
|
+
totalItems,
|
|
64
|
+
totalPages,
|
|
65
|
+
refetch,
|
|
66
|
+
chips: React.useMemo(() => toChips ? toChips(url.state.filters || {}, url.setFilter) : [], [url.state.filters, toChips]),
|
|
67
|
+
setSearch,
|
|
68
|
+
submitFilters,
|
|
69
|
+
clearAll: React.useCallback(() => {
|
|
70
|
+
form.reset(formOpts.defaultValues);
|
|
71
|
+
url.setState({
|
|
72
|
+
filters: {},
|
|
73
|
+
page: 1
|
|
74
|
+
});
|
|
75
|
+
}, [
|
|
76
|
+
form,
|
|
77
|
+
formOpts.defaultValues,
|
|
78
|
+
url
|
|
79
|
+
])
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function useListCoordinator({ defaults, form: formOpts, toVariables, toChips, useUrlState, replace }) {
|
|
83
|
+
const url = useUrlState({
|
|
84
|
+
defaults,
|
|
85
|
+
replace
|
|
86
|
+
});
|
|
87
|
+
const form = useForm({
|
|
88
|
+
defaultValues: formOpts.defaultValues,
|
|
89
|
+
resolver: formOpts.resolver
|
|
90
|
+
});
|
|
91
|
+
React.useEffect(() => {
|
|
92
|
+
form.reset({
|
|
93
|
+
...form.getValues(),
|
|
94
|
+
...url.state.filters
|
|
95
|
+
});
|
|
96
|
+
}, [url.state.filters]);
|
|
97
|
+
const submitFilters = form.handleSubmit((values) => {
|
|
98
|
+
url.setState({
|
|
99
|
+
filters: values,
|
|
100
|
+
page: 1
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
const setSearch = React.useCallback((q) => url.setState({
|
|
104
|
+
q,
|
|
105
|
+
page: 1
|
|
106
|
+
}), [url]);
|
|
107
|
+
return {
|
|
108
|
+
form,
|
|
109
|
+
url,
|
|
110
|
+
variables: React.useMemo(() => toVariables(url.state), [url.state, toVariables]),
|
|
111
|
+
chips: React.useMemo(() => toChips ? toChips(url.state.filters || {}, url.setFilter) : [], [url.state.filters, toChips]),
|
|
112
|
+
setSearch,
|
|
113
|
+
submitFilters,
|
|
114
|
+
clearAll: React.useCallback(() => {
|
|
115
|
+
form.reset(formOpts.defaultValues);
|
|
116
|
+
url.setState({
|
|
117
|
+
filters: {},
|
|
118
|
+
page: 1
|
|
119
|
+
});
|
|
120
|
+
}, [
|
|
121
|
+
form,
|
|
122
|
+
formOpts.defaultValues,
|
|
123
|
+
url
|
|
124
|
+
])
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
//#endregion
|
|
129
|
+
export { WorkflowStepRenderer, WorkflowStepper, useListCoordinator, usePresentationController, useWorkflow };
|
|
130
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import * as React from 'react';\nimport type { DefaultValues, Resolver, UseFormReturn } from 'react-hook-form';\nimport { useForm } from '@lssm/lib.ui-kit-web/ui/form';\nimport type {\n ListFetcher,\n ListState,\n} from '@lssm/lib.presentation-runtime-core';\n\nexport interface UsePresentationControllerOpts<\n TFilters extends Record<string, unknown>,\n TVars,\n TItem,\n> {\n defaults: ListState<TFilters>;\n form: {\n defaultValues: DefaultValues<TFilters> | TFilters;\n resolver?: Resolver<TFilters>;\n };\n toVariables: (input: ListState<TFilters>) => TVars;\n fetcher: ListFetcher<TVars, TItem>;\n toChips?: (\n filters: TFilters,\n setFilter: (\n key: keyof TFilters,\n value: TFilters[keyof TFilters] | null\n ) => void\n ) => { key: string; label: React.ReactNode; onRemove?: () => void }[];\n useUrlState: (args: { defaults: ListState<TFilters>; replace?: boolean }) => {\n state: ListState<TFilters>;\n setState: (next: Partial<ListState<TFilters>>) => void;\n setFilter: (\n key: keyof TFilters,\n value: TFilters[keyof TFilters] | null\n ) => void;\n clearFilters: () => void;\n };\n replace?: boolean;\n}\n\nexport function usePresentationController<\n TFilters extends Record<string, unknown>,\n TVars,\n TItem,\n>({\n defaults,\n form: formOpts,\n toVariables,\n fetcher,\n toChips,\n useUrlState,\n replace,\n}: UsePresentationControllerOpts<TFilters, TVars, TItem>) {\n const url = useUrlState({ defaults, replace });\n const form = useForm<TFilters>({\n defaultValues: formOpts.defaultValues,\n resolver: formOpts.resolver as any,\n } as any);\n\n React.useEffect(() => {\n form.reset({ ...(form.getValues() as any), ...(url.state.filters as any) });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [url.state.filters]);\n\n const submitFilters = form.handleSubmit((values) => {\n url.setState({ filters: values as TFilters, page: 1 });\n });\n\n const setSearch = React.useCallback(\n (q: string) => url.setState({ q, page: 1 }),\n [url]\n );\n const variables = React.useMemo(\n () => toVariables(url.state),\n [url.state, toVariables]\n );\n\n const [data, setData] = React.useState<TItem[]>([]);\n const [loading, setLoading] = React.useState(false);\n const [error, setError] = React.useState<unknown>(null);\n const [totalItems, setTotalItems] = React.useState<number | undefined>(\n undefined\n );\n const [totalPages, setTotalPages] = React.useState<number | undefined>(\n undefined\n );\n\n const refetch = React.useCallback(async () => {\n setLoading(true);\n setError(null);\n try {\n const out = await fetcher(variables);\n setData(out.items);\n setTotalItems(out.totalItems);\n setTotalPages(out.totalPages);\n } catch (e) {\n setError(e);\n } finally {\n setLoading(false);\n }\n }, [variables, fetcher]);\n\n React.useEffect(() => {\n void refetch();\n }, [refetch]);\n\n const chips = React.useMemo(\n () =>\n toChips\n ? toChips(\n (url.state.filters as TFilters) || ({} as any),\n url.setFilter as any\n )\n : [],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [url.state.filters, toChips]\n );\n\n const clearAll = React.useCallback(() => {\n form.reset(formOpts.defaultValues as any);\n url.setState({ filters: {} as TFilters, page: 1 });\n }, [form, formOpts.defaultValues, url]);\n\n return {\n form: form as UseFormReturn<TFilters>,\n url,\n variables,\n data,\n loading,\n error,\n totalItems,\n totalPages,\n refetch,\n chips,\n setSearch,\n submitFilters,\n clearAll,\n } as const;\n}\n\nexport interface UseListCoordinatorOpts<\n TFilters extends Record<string, unknown>,\n TVars,\n> {\n defaults: ListState<TFilters>;\n form: {\n defaultValues: DefaultValues<TFilters>;\n resolver?: Resolver<TFilters>;\n };\n toVariables: (input: ListState<TFilters>) => TVars;\n toChips?: (\n filters: TFilters,\n setFilter: (\n key: keyof TFilters,\n value: TFilters[keyof TFilters] | null\n ) => void\n ) => { key: string; label: React.ReactNode; onRemove?: () => void }[];\n useUrlState: (args: { defaults: ListState<TFilters>; replace?: boolean }) => {\n state: ListState<TFilters>;\n setState: (next: Partial<ListState<TFilters>>) => void;\n setFilter: (\n key: keyof TFilters,\n value: TFilters[keyof TFilters] | null\n ) => void;\n clearFilters: () => void;\n };\n replace?: boolean;\n}\n\nexport function useListCoordinator<\n TFilters extends Record<string, unknown>,\n TVars,\n>({\n defaults,\n form: formOpts,\n toVariables,\n toChips,\n useUrlState,\n replace,\n}: UseListCoordinatorOpts<TFilters, TVars>) {\n const url = useUrlState({ defaults, replace });\n const form = useForm<TFilters>({\n defaultValues: formOpts.defaultValues,\n resolver: formOpts.resolver,\n } as any);\n\n React.useEffect(() => {\n form.reset({ ...(form.getValues() as any), ...(url.state.filters as any) });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [url.state.filters]);\n\n const submitFilters = form.handleSubmit((values) => {\n url.setState({ filters: values as TFilters, page: 1 });\n });\n\n const setSearch = React.useCallback(\n (q: string) => url.setState({ q, page: 1 }),\n [url]\n );\n const variables = React.useMemo(\n () => toVariables(url.state),\n [url.state, toVariables]\n );\n\n const chips = React.useMemo(\n () =>\n toChips\n ? toChips(\n (url.state.filters as TFilters) || ({} as any),\n url.setFilter as any\n )\n : [],\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [url.state.filters, toChips]\n );\n\n const clearAll = React.useCallback(() => {\n form.reset(formOpts.defaultValues as any);\n url.setState({ filters: {} as TFilters, page: 1 });\n }, [form, formOpts.defaultValues, url]);\n\n return {\n form: form as UseFormReturn<TFilters>,\n url,\n variables,\n chips,\n setSearch,\n submitFilters,\n clearAll,\n } as const;\n}\n\nexport { useWorkflow } from './useWorkflow';\nexport type {\n UseWorkflowOptions,\n UseWorkflowResult,\n} from './useWorkflow';\nexport { WorkflowStepper } from './WorkflowStepper';\nexport { WorkflowStepRenderer } from './WorkflowStepRenderer';\n"],"mappings":";;;;;;;AAuCA,SAAgB,0BAId,EACA,UACA,MAAM,UACN,aACA,SACA,SACA,aACA,WACwD;CACxD,MAAM,MAAM,YAAY;EAAE;EAAU;EAAS,CAAC;CAC9C,MAAM,OAAO,QAAkB;EAC7B,eAAe,SAAS;EACxB,UAAU,SAAS;EACpB,CAAQ;AAET,OAAM,gBAAgB;AACpB,OAAK,MAAM;GAAE,GAAI,KAAK,WAAW;GAAU,GAAI,IAAI,MAAM;GAAiB,CAAC;IAE1E,CAAC,IA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AAM,SAAS;GAAe;GAAI,CAAC;EAgBtC;;AAgCH,SAAgB,mBAGd,EACA,UACA,MAAM,UACN,aACA,SACA,aACA,WAC0C;CAC1C,MAAM,MAAM,YAAY;EAAE;EAAU;EAAS,CAAC;CAC9C,MAAM,OAAO,QAAkB;EAC7B,eAAe,SAAS;EACxB,UAAU,SAAS;EACpB,CAAQ;AAET,OAAM,gBAAgB;AACpB,OAAK,MAAM;GAAE,GAAI,KAAK,WAAW;GAAU,GAAI,IAAI,MAAM;GAAiB,CAAC;IAE1E,CAAC,IAAI,MAAM,QAAQ,CAAC;CAEvB,MAAM,gBAAgB,KAAK,cAAc,WAAW;AAClD,MAAI,SAAS;GAAE,SAAS;GAAoB,MAAM;GAAG,CAAC;GACtD;CAEF,MAAM,YAAY,MAAM,aACrB,MAAc,IAAI,SAAS;EAAE;EAAG,MAAM;EAAG,CAAC,EAC3C,CAAC,IAAI,CACN;AAuBD,QAAO;EACC;EACN;EACA,WAzBgB,MAAM,cAChB,YAAY,IAAI,MAAM,EAC5B,CAAC,IAAI,OAAO,YAAY,CACzB;EAuBC,OArBY,MAAM,cAEhB,UACI,QACG,IAAI,MAAM,WAAyB,EAAE,EACtC,IAAI,UACL,GACD,EAAE,EAER,CAAC,IAAI,MAAM,SAAS,QAAQ,CAC7B;EAYC;EACA;EACA,UAZe,MAAM,kBAAkB;AACvC,QAAK,MAAM,SAAS,cAAqB;AACzC,OAAI,SAAS;IAAE,SAAS,EAAE;IAAc,MAAM;IAAG,CAAC;KACjD;GAAC;GAAM,SAAS;GAAe;GAAI,CAAC;EAUtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { cn, init_utils } from "./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 ../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 };
|
|
44
|
+
//# sourceMappingURL=empty-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-state.js","names":[],"sources":["../../../../../ui-kit-web/dist/ui/empty-state.js"],"sourcesContent":["import { cn } from \"./utils.js\";\nimport { VStack } from \"./stack.js\";\nimport \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { cva } from \"class-variance-authority\";\n\n//#region ui/empty-state.tsx\nconst containerVariants = cva(\"items-center text-center\", {\n\tvariants: { density: {\n\t\tcompact: \"gap-3 p-6\",\n\t\tdefault: \"gap-4 p-8\"\n\t} },\n\tdefaultVariants: { density: \"default\" }\n});\nfunction EmptyState({ icon, title, description, primaryAction, secondaryAction, className, density }) {\n\treturn /* @__PURE__ */ jsxs(VStack, {\n\t\tclassName: cn(containerVariants({ density }), className),\n\t\tchildren: [\n\t\t\ticon ? /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\tclassName: \"bg-muted flex h-12 w-12 items-center justify-center rounded-full\",\n\t\t\t\tchildren: /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\tclassName: \"text-muted-foreground flex items-center justify-center\",\n\t\t\t\t\tchildren: icon\n\t\t\t\t})\n\t\t\t}) : null,\n\t\t\t/* @__PURE__ */ jsxs(\"div\", { children: [/* @__PURE__ */ jsx(\"h3\", {\n\t\t\t\tclassName: \"font-medium\",\n\t\t\t\tchildren: title\n\t\t\t}), description ? /* @__PURE__ */ jsx(\"p\", {\n\t\t\t\tclassName: \"text-muted-foreground text-base\",\n\t\t\t\tchildren: description\n\t\t\t}) : null] }),\n\t\t\t(primaryAction || secondaryAction) && /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tclassName: \"flex items-center justify-center gap-2\",\n\t\t\t\tchildren: [primaryAction, secondaryAction]\n\t\t\t})\n\t\t]\n\t});\n}\n\n//#endregion\nexport { EmptyState };\n//# sourceMappingURL=empty-state.js.map"],"mappings":";;;;;;;YAAgC;AAOhC,MAAM,oBAAoB,IAAI,4BAA4B;CACzD,UAAU,EAAE,SAAS;EACpB,SAAS;EACT,SAAS;EACT,EAAE;CACH,iBAAiB,EAAE,SAAS,WAAW;CACvC,CAAC;AACF,SAAS,WAAW,EAAE,MAAM,OAAO,aAAa,eAAe,iBAAiB,WAAW,WAAW;AACrG,QAAuB,qBAAK,QAAQ;EACnC,WAAW,GAAG,kBAAkB,EAAE,SAAS,CAAC,EAAE,UAAU;EACxD,UAAU;GACT,OAAuB,oBAAI,OAAO;IACjC,WAAW;IACX,UAA0B,oBAAI,OAAO;KACpC,WAAW;KACX,UAAU;KACV,CAAC;IACF,CAAC,GAAG;GACW,qBAAK,OAAO,EAAE,UAAU,CAAiB,oBAAI,MAAM;IAClE,WAAW;IACX,UAAU;IACV,CAAC,EAAE,cAA8B,oBAAI,KAAK;IAC1C,WAAW;IACX,UAAU;IACV,CAAC,GAAG,KAAK,EAAE,CAAC;IACZ,iBAAiB,oBAAoC,qBAAK,OAAO;IACjE,WAAW;IACX,UAAU,CAAC,eAAe,gBAAgB;IAC1C,CAAC;GACF;EACD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { useForm } from "react-hook-form";
|
|
6
|
+
import "@hookform/resolvers/zod";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import "@radix-ui/react-label";
|
|
9
|
+
import "@radix-ui/react-slot";
|
|
10
|
+
|
|
11
|
+
//#region ../ui-kit-web/dist/ui/form.js
|
|
12
|
+
const FormFieldContext = React$1.createContext({});
|
|
13
|
+
const FormItemContext = React$1.createContext({});
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { useForm };
|
|
17
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.js","names":[],"sources":["../../../../../ui-kit-web/dist/ui/form.js"],"sourcesContent":["'use client';\n\n\nimport { cn } from \"./utils.js\";\nimport { Label } from \"./label.js\";\nimport * as React$1 from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport \"@radix-ui/react-label\";\nimport { Controller, FormProvider, useFieldArray, useForm, useFormContext, useFormState } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\n\n//#region ui/form.tsx\nconst Form = FormProvider;\nconst FormFieldContext = React$1.createContext({});\nconst FormField = ({ ...props }) => {\n\treturn /* @__PURE__ */ jsx(FormFieldContext.Provider, {\n\t\tvalue: { name: props.name },\n\t\tchildren: /* @__PURE__ */ jsx(Controller, { ...props })\n\t});\n};\nconst useFormField = () => {\n\tconst fieldContext = React$1.useContext(FormFieldContext);\n\tconst itemContext = React$1.useContext(FormItemContext);\n\tconst { getFieldState } = useFormContext();\n\tconst formState = useFormState({ name: fieldContext.name });\n\tconst fieldState = getFieldState(fieldContext.name, formState);\n\tif (!fieldContext) throw new Error(\"useFormField should be used within <FormField>\");\n\tconst { id } = itemContext;\n\treturn {\n\t\tid,\n\t\tname: fieldContext.name,\n\t\tformItemId: `${id}-form-item`,\n\t\tformDescriptionId: `${id}-form-item-description`,\n\t\tformMessageId: `${id}-form-item-message`,\n\t\t...fieldState\n\t};\n};\nconst FormItemContext = React$1.createContext({});\nfunction FormItem({ className,...props }) {\n\tconst id = React$1.useId();\n\treturn /* @__PURE__ */ jsx(FormItemContext.Provider, {\n\t\tvalue: { id },\n\t\tchildren: /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\"data-slot\": \"form-item\",\n\t\t\tclassName: cn(\"grid gap-2\", className),\n\t\t\t...props\n\t\t})\n\t});\n}\nfunction FormLabel({ className,...props }) {\n\tconst { error, formItemId } = useFormField();\n\treturn /* @__PURE__ */ jsx(Label, {\n\t\t\"data-slot\": \"form-label\",\n\t\t\"data-error\": !!error,\n\t\tclassName: cn(\"data-[error=true]:text-destructive\", className),\n\t\thtmlFor: formItemId,\n\t\t...props\n\t});\n}\nfunction FormControl({ ...props }) {\n\tconst { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\treturn /* @__PURE__ */ jsx(Slot, {\n\t\t\"data-slot\": \"form-control\",\n\t\tid: formItemId,\n\t\t\"aria-describedby\": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,\n\t\t\"aria-invalid\": !!error,\n\t\t...props\n\t});\n}\nfunction FormDescription({ className,...props }) {\n\tconst { formDescriptionId } = useFormField();\n\treturn /* @__PURE__ */ jsx(\"p\", {\n\t\t\"data-slot\": \"form-description\",\n\t\tid: formDescriptionId,\n\t\tclassName: cn(\"text-muted-foreground text-sm\", className),\n\t\t...props\n\t});\n}\nfunction FormMessage({ className,...props }) {\n\tconst { error, formMessageId } = useFormField();\n\tconst body = error ? String(error?.message ?? \"\") : props.children;\n\tif (!body) return null;\n\treturn /* @__PURE__ */ jsx(\"p\", {\n\t\t\"data-slot\": \"form-message\",\n\t\tid: formMessageId,\n\t\tclassName: cn(\"text-destructive text-sm\", className),\n\t\t...props,\n\t\tchildren: body\n\t});\n}\n\n//#endregion\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFieldArray, useForm, useFormField, zodResolver };\n//# sourceMappingURL=form.js.map"],"mappings":";;;;;;;;;;;AAcA,MAAM,mBAAmB,QAAQ,cAAc,EAAE,CAAC;AAwBlD,MAAM,kBAAkB,QAAQ,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { cn, init_utils } from "./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 ../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 };
|
|
159
|
+
//# sourceMappingURL=stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.js","names":[],"sources":["../../../../../ui-kit-web/dist/ui/stack.js"],"sourcesContent":["import { cn } from \"./utils.js\";\nimport * as React$1 from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { cva } from \"class-variance-authority\";\n\n//#region ui/stack.tsx\nconst vStackVariants = cva(\"flex flex-col\", {\n\tvariants: {\n\t\tgap: {\n\t\t\tnone: \"gap-0\",\n\t\t\txs: \"gap-1\",\n\t\t\tsm: \"gap-2\",\n\t\t\tmd: \"gap-3\",\n\t\t\tlg: \"gap-4\",\n\t\t\txl: \"gap-6\",\n\t\t\t\"2xl\": \"gap-8\"\n\t\t},\n\t\talign: {\n\t\t\tstart: \"items-start\",\n\t\t\tcenter: \"items-center\",\n\t\t\tend: \"items-end\",\n\t\t\tstretch: \"items-stretch\"\n\t\t},\n\t\tjustify: {\n\t\t\tstart: \"justify-start\",\n\t\t\tcenter: \"justify-center\",\n\t\t\tend: \"justify-end\",\n\t\t\tbetween: \"justify-between\",\n\t\t\taround: \"justify-around\",\n\t\t\tevenly: \"justify-evenly\"\n\t\t}\n\t},\n\tdefaultVariants: {\n\t\tgap: \"md\",\n\t\talign: \"stretch\",\n\t\tjustify: \"start\"\n\t}\n});\nconst VStack = React$1.forwardRef(({ className, gap, align, justify, as = \"div\",...props }, ref) => {\n\treturn /* @__PURE__ */ jsx(as, {\n\t\tref,\n\t\tclassName: cn(vStackVariants({\n\t\t\tgap,\n\t\t\talign,\n\t\t\tjustify\n\t\t}), className),\n\t\t...props\n\t});\n});\nVStack.displayName = \"VStack\";\nconst hStackVariants = cva(\"flex flex-row\", {\n\tvariants: {\n\t\tgap: {\n\t\t\tnone: \"gap-0\",\n\t\t\txs: \"gap-1\",\n\t\t\tsm: \"gap-2\",\n\t\t\tmd: \"gap-3\",\n\t\t\tlg: \"gap-4\",\n\t\t\txl: \"gap-6\",\n\t\t\t\"2xl\": \"gap-8\"\n\t\t},\n\t\talign: {\n\t\t\tstart: \"items-start\",\n\t\t\tcenter: \"items-center\",\n\t\t\tend: \"items-end\",\n\t\t\tstretch: \"items-stretch\",\n\t\t\tbaseline: \"items-baseline\"\n\t\t},\n\t\tjustify: {\n\t\t\tstart: \"justify-start\",\n\t\t\tcenter: \"justify-center\",\n\t\t\tend: \"justify-end\",\n\t\t\tbetween: \"justify-between\",\n\t\t\taround: \"justify-around\",\n\t\t\tevenly: \"justify-evenly\"\n\t\t},\n\t\twrap: {\n\t\t\tnowrap: \"flex-nowrap\",\n\t\t\twrap: \"flex-wrap\",\n\t\t\twrapReverse: \"flex-wrap-reverse\"\n\t\t}\n\t},\n\tdefaultVariants: {\n\t\tgap: \"md\",\n\t\talign: \"center\",\n\t\tjustify: \"start\",\n\t\twrap: \"wrap\"\n\t}\n});\nconst HStack = React$1.forwardRef(({ className, gap, align, justify, wrap, as = \"div\",...props }, ref) => {\n\treturn /* @__PURE__ */ jsx(as, {\n\t\tref,\n\t\tclassName: cn(hStackVariants({\n\t\t\tgap,\n\t\t\talign,\n\t\t\tjustify,\n\t\t\twrap\n\t\t}), className),\n\t\t...props\n\t});\n});\nHStack.displayName = \"HStack\";\nconst boxVariants = cva(\"flex flex-row\", {\n\tvariants: {\n\t\tgap: {\n\t\t\tnone: \"gap-0\",\n\t\t\txs: \"gap-1\",\n\t\t\tsm: \"gap-2\",\n\t\t\tmd: \"gap-3\",\n\t\t\tlg: \"gap-4\",\n\t\t\txl: \"gap-6\",\n\t\t\t\"2xl\": \"gap-8\"\n\t\t},\n\t\talign: {\n\t\t\tstart: \"items-start\",\n\t\t\tcenter: \"items-center\",\n\t\t\tend: \"items-end\",\n\t\t\tstretch: \"items-stretch\",\n\t\t\tbaseline: \"items-baseline\"\n\t\t},\n\t\tjustify: {\n\t\t\tstart: \"justify-start\",\n\t\t\tcenter: \"justify-center\",\n\t\t\tend: \"justify-end\",\n\t\t\tbetween: \"justify-between\",\n\t\t\taround: \"justify-around\",\n\t\t\tevenly: \"justify-evenly\"\n\t\t},\n\t\twrap: {\n\t\t\tnowrap: \"flex-nowrap\",\n\t\t\twrap: \"flex-wrap\",\n\t\t\twrapReverse: \"flex-wrap-reverse\"\n\t\t}\n\t},\n\tdefaultVariants: {\n\t\tgap: \"md\",\n\t\talign: \"center\",\n\t\tjustify: \"center\",\n\t\twrap: \"nowrap\"\n\t}\n});\nconst Box = React$1.forwardRef(({ className, gap, align, justify, wrap, as = \"div\",...props }, ref) => {\n\treturn /* @__PURE__ */ jsx(as, {\n\t\tref,\n\t\tclassName: cn(boxVariants({\n\t\t\tgap,\n\t\t\talign,\n\t\t\tjustify,\n\t\t\twrap\n\t\t}), className),\n\t\t...props\n\t});\n});\nBox.displayName = \"Box\";\n\n//#endregion\nexport { Box, HStack, VStack, boxVariants, hStackVariants, vStackVariants };\n//# sourceMappingURL=stack.js.map"],"mappings":";;;;;;YAAgC;AAMhC,MAAM,iBAAiB,IAAI,iBAAiB;CAC3C,UAAU;EACT,KAAK;GACJ,MAA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AAU;EACT,KAAK;GACJ,MAAM;GACN,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,OAAO;GACP;EACD,OAAO;GACN,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,UAAU;GACV;EACD,SAAS;GACR,OAAO;GACP,QAAQ;GACR,KAAK;GACL,SAAS;GACT,QAAQ;GACR,QAAQ;GACR;EACD,MAAM;GACL,QAAQ;GACR,MAAM;GACN,aAAa;GACb;EACD;CACD,iBAAiB;EAChB,KAAK;EACL,OAAO;EACP,SAAS;EACT,MAAM;EACN;CACD,CAAC;AACF,MAAM,MAAM,QAAQ,YAAY,EAAE,WAAW,KAAK,OAAO,SAAS,MAAM,KAAK,MAAM,GAAG,SAAS,QAAQ;AACtG,QAAuB,oBAAI,IAAI;EAC9B;EACA,WAAW,GAAG,YAAY;GACzB;GACA;GACA;GACA;GACA,CAAC,EAAE,UAAU;EACd,GAAG;EACH,CAAC;EACD;AACF,IAAI,cAAc"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cn, init_utils } from "./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 ../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 };
|
|
38
|
+
//# sourceMappingURL=stepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.js","names":[],"sources":["../../../../../ui-kit-web/dist/ui/stepper.js"],"sourcesContent":["import { cn } from \"./utils.js\";\nimport { HStack } from \"./stack.js\";\nimport \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { cva } from \"class-variance-authority\";\n\n//#region ui/stepper.tsx\nconst dotVariants = cva(\"h-2 w-2 rounded-full\", {\n\tvariants: {\n\t\tstate: {\n\t\t\tactive: \"bg-primary\",\n\t\t\tinactive: \"bg-muted-foreground/20\"\n\t\t},\n\t\tsize: {\n\t\t\tsm: \"\",\n\t\t\tmd: \"h-2.5 w-2.5\"\n\t\t}\n\t},\n\tdefaultVariants: {\n\t\tstate: \"inactive\",\n\t\tsize: \"md\"\n\t}\n});\nfunction Stepper({ current, total, size, className }) {\n\tconst items = Array.from({ length: Math.max(0, total) });\n\treturn /* @__PURE__ */ jsx(HStack, {\n\t\tclassName: cn(\"items-center gap-2\", className),\n\t\tchildren: items.map((_, idx) => /* @__PURE__ */ jsx(\"span\", { className: cn(dotVariants({\n\t\t\tstate: idx + 1 === current ? \"active\" : \"inactive\",\n\t\t\tsize\n\t\t})) }, idx))\n\t});\n}\n\n//#endregion\nexport { Stepper };\n//# sourceMappingURL=stepper.js.map"],"mappings":";;;;;;;YAAgC;AAOhC,MAAM,cAAc,IAAI,wBAAwB;CAC/C,UAAU;EACT,OAAO;GACN,QAAQ;GACR,UAAU;GACV;EACD,MAAM;GACL,IAAI;GACJ,IAAI;GACJ;EACD;CACD,iBAAiB;EAChB,OAAO;EACP,MAAM;EACN;CACD,CAAC;AACF,SAAS,QAAQ,EAAE,SAAS,OAAO,MAAM,aAAa;CACrD,MAAM,QAAQ,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,MAAM,EAAE,CAAC;AACxD,QAAuB,oBAAI,QAAQ;EAClC,WAAW,GAAG,sBAAsB,UAAU;EAC9C,UAAU,MAAM,KAAK,GAAG,QAAwB,oBAAI,QAAQ,EAAE,WAAW,GAAG,YAAY;GACvF,OAAO,MAAM,MAAM,UAAU,WAAW;GACxC;GACA,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC;EACZ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __esm } from "../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
|
|
5
|
+
//#region ../ui-kit-web/dist/ui/utils.js
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
var init_utils = __esm({ "../ui-kit-web/dist/ui/utils.js": (() => {}) });
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
init_utils();
|
|
13
|
+
export { cn, init_utils };
|
|
14
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../../../ui-kit-web/dist/ui/utils.js"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n//#region ui/utils.ts\nfunction cn(...inputs) {\n\treturn twMerge(clsx(inputs));\n}\n\n//#endregion\nexport { cn };\n//# sourceMappingURL=utils.js.map"],"mappings":";;;;;AAIA,SAAS,GAAG,GAAG,QAAQ;AACtB,QAAO,QAAQ,KAAK,OAAO,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/useWorkflow.d.ts
|
|
2
|
+
interface UseWorkflowOptions {
|
|
3
|
+
workflowId: string;
|
|
4
|
+
runner: WorkflowRunner;
|
|
5
|
+
autoRefresh?: boolean;
|
|
6
|
+
refreshIntervalMs?: number;
|
|
7
|
+
}
|
|
8
|
+
interface UseWorkflowResult {
|
|
9
|
+
state: WorkflowState | null;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
error: Error | null;
|
|
12
|
+
isExecuting: boolean;
|
|
13
|
+
refresh: () => Promise<void>;
|
|
14
|
+
executeStep: (input?: unknown) => Promise<void>;
|
|
15
|
+
cancel: () => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
declare function useWorkflow({
|
|
18
|
+
workflowId,
|
|
19
|
+
runner,
|
|
20
|
+
autoRefresh,
|
|
21
|
+
refreshIntervalMs
|
|
22
|
+
}: UseWorkflowOptions): UseWorkflowResult;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { UseWorkflowOptions, UseWorkflowResult, useWorkflow };
|
|
25
|
+
//# sourceMappingURL=useWorkflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkflow.d.ts","names":[],"sources":["../src/useWorkflow.ts"],"sourcesContent":[],"mappings":";AAMiB,UAAA,kBAAA,CAEP;EAKO,UAAA,EAAA,MAAA;EACR,MAAA,EANC,cAMD;EAEA,WAAA,CAAA,EAAA,OAAA;EAEQ,iBAAA,CAAA,EAAA,MAAA;;AAED,UAPC,iBAAA,CAOD;EAAO,KAAA,EANd,aAMc,GAAA,IAAA;EAGP,SAAA,EAAA,OAAW;EACzB,KAAA,EARO,KAQP,GAAA,IAAA;EACA,WAAA,EAAA,OAAA;EACA,OAAA,EAAA,GAAA,GARe,OAQf,CAAA,IAAA,CAAA;EACA,WAAA,EAAA,CAAA,KAAA,CAAA,EAAA,OAAA,EAAA,GARkC,OAQlC,CAAA,IAAA,CAAA;EACC,MAAA,EAAA,GAAA,GARa,OAQb,CAAA,IAAA,CAAA;;AAAsC,iBALzB,WAAA,CAKyB;EAAA,UAAA;EAAA,MAAA;EAAA,WAAA;EAAA;AAAA,CAAA,EAAtC,kBAAsC,CAAA,EAAjB,iBAAiB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/useWorkflow.ts
|
|
4
|
+
function useWorkflow({ workflowId, runner, autoRefresh = true, refreshIntervalMs = 2e3 }) {
|
|
5
|
+
const isMounted = React.useRef(true);
|
|
6
|
+
const [state, setState] = React.useState(null);
|
|
7
|
+
const [isLoading, setIsLoading] = React.useState(true);
|
|
8
|
+
const [error, setError] = React.useState(null);
|
|
9
|
+
const [isExecuting, setIsExecuting] = React.useState(false);
|
|
10
|
+
const refresh = React.useCallback(async () => {
|
|
11
|
+
try {
|
|
12
|
+
setIsLoading(true);
|
|
13
|
+
const next = await runner.getState(workflowId);
|
|
14
|
+
if (!isMounted.current) return;
|
|
15
|
+
setState(next);
|
|
16
|
+
setError(null);
|
|
17
|
+
} catch (err) {
|
|
18
|
+
if (!isMounted.current) return;
|
|
19
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
20
|
+
} finally {
|
|
21
|
+
if (isMounted.current) setIsLoading(false);
|
|
22
|
+
}
|
|
23
|
+
}, [runner, workflowId]);
|
|
24
|
+
const executeStep = React.useCallback(async (input) => {
|
|
25
|
+
setIsExecuting(true);
|
|
26
|
+
try {
|
|
27
|
+
await runner.executeStep(workflowId, input);
|
|
28
|
+
await refresh();
|
|
29
|
+
} catch (err) {
|
|
30
|
+
if (isMounted.current) setError(err instanceof Error ? err : new Error(String(err)));
|
|
31
|
+
throw err;
|
|
32
|
+
} finally {
|
|
33
|
+
if (isMounted.current) setIsExecuting(false);
|
|
34
|
+
}
|
|
35
|
+
}, [
|
|
36
|
+
runner,
|
|
37
|
+
workflowId,
|
|
38
|
+
refresh
|
|
39
|
+
]);
|
|
40
|
+
const cancel = React.useCallback(async () => {
|
|
41
|
+
await runner.cancel(workflowId);
|
|
42
|
+
await refresh();
|
|
43
|
+
}, [
|
|
44
|
+
runner,
|
|
45
|
+
workflowId,
|
|
46
|
+
refresh
|
|
47
|
+
]);
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
isMounted.current = true;
|
|
50
|
+
refresh();
|
|
51
|
+
if (!autoRefresh) return () => {
|
|
52
|
+
isMounted.current = false;
|
|
53
|
+
};
|
|
54
|
+
const interval = setInterval(() => {
|
|
55
|
+
refresh();
|
|
56
|
+
}, refreshIntervalMs);
|
|
57
|
+
return () => {
|
|
58
|
+
isMounted.current = false;
|
|
59
|
+
clearInterval(interval);
|
|
60
|
+
};
|
|
61
|
+
}, [
|
|
62
|
+
refresh,
|
|
63
|
+
autoRefresh,
|
|
64
|
+
refreshIntervalMs
|
|
65
|
+
]);
|
|
66
|
+
return {
|
|
67
|
+
state,
|
|
68
|
+
isLoading,
|
|
69
|
+
error,
|
|
70
|
+
isExecuting,
|
|
71
|
+
refresh,
|
|
72
|
+
executeStep,
|
|
73
|
+
cancel
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { useWorkflow };
|
|
79
|
+
//# sourceMappingURL=useWorkflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkflow.js","names":[],"sources":["../src/useWorkflow.ts"],"sourcesContent":["import * as React from 'react';\nimport type {\n WorkflowRunner,\n WorkflowState,\n} from '@lssm/lib.contracts/workflow';\n\nexport interface UseWorkflowOptions {\n workflowId: string;\n runner: WorkflowRunner;\n autoRefresh?: boolean;\n refreshIntervalMs?: number;\n}\n\nexport interface UseWorkflowResult {\n state: WorkflowState | null;\n isLoading: boolean;\n error: Error | null;\n isExecuting: boolean;\n refresh: () => Promise<void>;\n executeStep: (input?: unknown) => Promise<void>;\n cancel: () => Promise<void>;\n}\n\nexport function useWorkflow({\n workflowId,\n runner,\n autoRefresh = true,\n refreshIntervalMs = 2000,\n}: UseWorkflowOptions): UseWorkflowResult {\n const isMounted = React.useRef(true);\n const [state, setState] = React.useState<WorkflowState | null>(null);\n const [isLoading, setIsLoading] = React.useState(true);\n const [error, setError] = React.useState<Error | null>(null);\n const [isExecuting, setIsExecuting] = React.useState(false);\n\n const refresh = React.useCallback(async () => {\n try {\n setIsLoading(true);\n const next = await runner.getState(workflowId);\n if (!isMounted.current) return;\n setState(next);\n setError(null);\n } catch (err) {\n if (!isMounted.current) return;\n setError(err instanceof Error ? err : new Error(String(err)));\n } finally {\n if (isMounted.current) setIsLoading(false);\n }\n }, [runner, workflowId]);\n\n const executeStep = React.useCallback(\n async (input?: unknown) => {\n setIsExecuting(true);\n try {\n await runner.executeStep(workflowId, input);\n await refresh();\n } catch (err) {\n if (isMounted.current) {\n setError(err instanceof Error ? err : new Error(String(err)));\n }\n throw err;\n } finally {\n if (isMounted.current) setIsExecuting(false);\n }\n },\n [runner, workflowId, refresh]\n );\n\n const cancel = React.useCallback(async () => {\n await runner.cancel(workflowId);\n await refresh();\n }, [runner, workflowId, refresh]);\n\n React.useEffect(() => {\n isMounted.current = true;\n void refresh();\n if (!autoRefresh) {\n return () => {\n isMounted.current = false;\n };\n }\n const interval = setInterval(() => {\n void refresh();\n }, refreshIntervalMs);\n return () => {\n isMounted.current = false;\n clearInterval(interval);\n };\n }, [refresh, autoRefresh, refreshIntervalMs]);\n\n return {\n state,\n isLoading,\n error,\n isExecuting,\n refresh,\n executeStep,\n cancel,\n };\n}\n\n"],"mappings":";;;AAuBA,SAAgB,YAAY,EAC1B,YACA,QACA,cAAc,MACd,oBAAoB,OACoB;CACxC,MAAM,YAAY,MAAM,OAAO,KAAK;CACpC,MAAM,CAAC,OAAO,YAAY,MAAM,SAA+B,KAAK;CACpE,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAS,KAAK;CACt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+1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lssm/lib.presentation-runtime-react",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "bun build:bundle && bun build:types",
|
|
11
|
+
"build:bundle": "tsdown",
|
|
12
|
+
"build:types": "tsc --noEmit -p tsconfig.json",
|
|
13
|
+
"dev": "bun run build:bundle --watch",
|
|
14
|
+
"lint": "bun run lint:fix",
|
|
15
|
+
"lint:fix": "eslint src --fix",
|
|
16
|
+
"lint:check": "eslint src"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"react": "^19.1.0",
|
|
20
|
+
"react-hook-form": "7.66.0",
|
|
21
|
+
"zod": "^4.1.5",
|
|
22
|
+
"@lssm/lib.presentation-runtime-core": "^1.2.0"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@lssm/lib.presentation-runtime-core": "workspace:^1.2.0",
|
|
26
|
+
"@lssm/lib.contracts": "workspace:^1.2.0",
|
|
27
|
+
"@lssm/lib.design-system": "workspace:^1.2.0"
|
|
28
|
+
},
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./src/index.ts",
|
|
31
|
+
"./useWorkflow": "./src/useWorkflow.ts",
|
|
32
|
+
"./WorkflowStepper": "./src/WorkflowStepper.tsx",
|
|
33
|
+
"./WorkflowStepRenderer": "./src/WorkflowStepRenderer.tsx",
|
|
34
|
+
"./*": "./*"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"exports": {
|
|
38
|
+
".": "./dist/index.js",
|
|
39
|
+
"./useWorkflow": "./dist/useWorkflow.js",
|
|
40
|
+
"./WorkflowStepper": "./dist/WorkflowStepper.js",
|
|
41
|
+
"./WorkflowStepRenderer": "./dist/WorkflowStepRenderer.js",
|
|
42
|
+
"./*": "./*"
|
|
43
|
+
},
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md"
|
|
49
|
+
]
|
|
50
|
+
}
|