@gridui/task 0.0.0-stage → 0.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/README.md +7 -2
- package/dist/approval-panel/approval-panel.d.ts +20 -0
- package/dist/approval-panel/style.d.ts +8 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +216 -0
- package/dist/index.js.map +7 -0
- package/dist/shared/style.d.ts +8 -0
- package/dist/styles.css +106 -0
- package/dist/task-timeline/style.d.ts +9 -0
- package/dist/task-timeline/task-timeline.d.ts +28 -0
- package/package.json +51 -3
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gridui/task
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Dashboard family. Public API: `ApprovalPanel`, `ApprovalPanelProps`, `TaskStep`, `TaskTimeline`, `TaskTimelineProps`.
|
|
4
|
+
|
|
5
|
+
Import components from `@gridui/task` and load `@gridui/task/styles.css` after Theme.
|
|
6
|
+
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
|
+
|
|
8
|
+
See [component ownership](../../docs/component-ownership.md) and [release history](.changeset/history/).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Task
|
|
4
|
+
* @namespace ApprovalPanel
|
|
5
|
+
* @description Approval Panel
|
|
6
|
+
*/
|
|
7
|
+
import { type ComponentPropsWithRef, type FC, type ReactNode } from "react";
|
|
8
|
+
export type ApprovalPanelProps = Omit<ComponentPropsWithRef<"section">, "title"> & {
|
|
9
|
+
readonly title: string;
|
|
10
|
+
readonly description?: ReactNode;
|
|
11
|
+
readonly status: "pending" | "submitting" | "approved" | "denied" | "failed" | "blocked";
|
|
12
|
+
readonly statusLabel: string;
|
|
13
|
+
readonly approveLabel: string;
|
|
14
|
+
readonly denyLabel: string;
|
|
15
|
+
readonly recordLabel: string;
|
|
16
|
+
readonly onDecision: (decision: "approve" | "deny") => void;
|
|
17
|
+
readonly disabled?: boolean;
|
|
18
|
+
readonly error?: ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export declare const ApprovalPanel: FC<ApprovalPanelProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Task
|
|
4
|
+
* @namespace ApprovalPanel
|
|
5
|
+
* @description Style
|
|
6
|
+
*/
|
|
7
|
+
export declare const taskActionsStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
+
export declare const approvalStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Task
|
|
4
|
+
* @namespace Root
|
|
5
|
+
* @description Index
|
|
6
|
+
*/
|
|
7
|
+
export type { ApprovalPanelProps } from "./approval-panel/approval-panel";
|
|
8
|
+
export { ApprovalPanel } from "./approval-panel/approval-panel";
|
|
9
|
+
export type { TaskStep } from "./task-timeline/task-timeline";
|
|
10
|
+
export type { TaskTimelineProps } from "./task-timeline/task-timeline";
|
|
11
|
+
export { TaskTimeline } from "./task-timeline/task-timeline";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
// src/shared/style.ts
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
var taskHeadingStyles = cva("flex min-w-0 flex-wrap items-baseline justify-between gap-gridui-8 wrap-anywhere");
|
|
4
|
+
var taskMetaStyles = cva("text-muted type-caption");
|
|
5
|
+
|
|
6
|
+
// src/approval-panel/style.ts
|
|
7
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
8
|
+
var taskActionsStyles = cva2("mt-gridui-16 flex flex-wrap justify-end gap-gridui-8");
|
|
9
|
+
var approvalStyles = cva2("min-w-0 border border-border bg-background p-gridui-16 text-foreground wrap-anywhere [&_summary]:min-h-11 [&_summary]:cursor-pointer [&_summary]:py-gridui-8");
|
|
10
|
+
|
|
11
|
+
// src/approval-panel/approval-panel.tsx
|
|
12
|
+
import { Button } from "@gridui/button";
|
|
13
|
+
import { cn } from "@gridui/style-utils";
|
|
14
|
+
import { useId, useLayoutEffect, useRef } from "react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var ApprovalPanel = (props) => {
|
|
17
|
+
const {
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
status,
|
|
21
|
+
statusLabel,
|
|
22
|
+
approveLabel,
|
|
23
|
+
denyLabel,
|
|
24
|
+
recordLabel,
|
|
25
|
+
onDecision,
|
|
26
|
+
disabled = false,
|
|
27
|
+
error,
|
|
28
|
+
children,
|
|
29
|
+
className,
|
|
30
|
+
...restProps
|
|
31
|
+
} = props;
|
|
32
|
+
const id = useId();
|
|
33
|
+
const record = useRef(null);
|
|
34
|
+
const requested = useRef(false);
|
|
35
|
+
const settled = status === "approved" || status === "denied" || status === "blocked";
|
|
36
|
+
useLayoutEffect(() => {
|
|
37
|
+
if (settled && requested.current) {
|
|
38
|
+
record.current?.focus();
|
|
39
|
+
requested.current = false;
|
|
40
|
+
}
|
|
41
|
+
}, [settled]);
|
|
42
|
+
const decide = (decision) => {
|
|
43
|
+
if (!disabled && (status === "pending" || status === "failed")) {
|
|
44
|
+
requested.current = true;
|
|
45
|
+
onDecision(decision);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
49
|
+
"section",
|
|
50
|
+
{
|
|
51
|
+
...restProps,
|
|
52
|
+
"aria-labelledby": id,
|
|
53
|
+
className: cn(approvalStyles(), className),
|
|
54
|
+
"data-state": status,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsxs(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: taskHeadingStyles(),
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
"strong",
|
|
63
|
+
{
|
|
64
|
+
id,
|
|
65
|
+
children: title
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
"span",
|
|
70
|
+
{
|
|
71
|
+
role: "status",
|
|
72
|
+
className: taskMetaStyles(),
|
|
73
|
+
children: statusLabel
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
settled ? /* @__PURE__ */ jsxs("details", { children: [
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"summary",
|
|
82
|
+
{
|
|
83
|
+
ref: record,
|
|
84
|
+
children: recordLabel
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
description,
|
|
88
|
+
children
|
|
89
|
+
] }) : /* @__PURE__ */ jsxs("div", { children: [
|
|
90
|
+
description,
|
|
91
|
+
children,
|
|
92
|
+
error && /* @__PURE__ */ jsx(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
role: "alert",
|
|
96
|
+
children: error
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsxs(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: taskActionsStyles(),
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
Button,
|
|
106
|
+
{
|
|
107
|
+
variant: "secondary",
|
|
108
|
+
disabled: disabled || status === "submitting",
|
|
109
|
+
onClick: () => {
|
|
110
|
+
decide("deny");
|
|
111
|
+
},
|
|
112
|
+
children: denyLabel
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
Button,
|
|
117
|
+
{
|
|
118
|
+
disabled: disabled || status === "submitting",
|
|
119
|
+
loading: status === "submitting",
|
|
120
|
+
onClick: () => {
|
|
121
|
+
decide("approve");
|
|
122
|
+
},
|
|
123
|
+
children: approveLabel
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// src/task-timeline/style.ts
|
|
136
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
137
|
+
var taskListStyles = cva3("m-0 list-decimal ps-gridui-32");
|
|
138
|
+
var taskItemStyles = cva3("min-w-0 border-b border-border py-gridui-16 pe-gridui-16 wrap-anywhere data-[state=failed]:border-danger-border");
|
|
139
|
+
var taskDetailsStyles = cva3("my-gridui-8 [&_summary]:cursor-pointer [&_summary]:py-gridui-8");
|
|
140
|
+
|
|
141
|
+
// src/task-timeline/task-timeline.tsx
|
|
142
|
+
import { Button as Button2 } from "@gridui/button";
|
|
143
|
+
import { cn as cn2 } from "@gridui/style-utils";
|
|
144
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
145
|
+
var TaskTimeline = (props) => {
|
|
146
|
+
const { steps, label, disabled = false, className, ...restProps } = props;
|
|
147
|
+
return /* @__PURE__ */ jsx2(
|
|
148
|
+
"ol",
|
|
149
|
+
{
|
|
150
|
+
...restProps,
|
|
151
|
+
"aria-label": label,
|
|
152
|
+
className: cn2(taskListStyles(), className),
|
|
153
|
+
children: steps.map((step) => {
|
|
154
|
+
return /* @__PURE__ */ jsxs2(
|
|
155
|
+
"li",
|
|
156
|
+
{
|
|
157
|
+
className: taskItemStyles(),
|
|
158
|
+
"data-state": step.status,
|
|
159
|
+
"aria-current": step.status === "running" || step.status === "waiting" ? "step" : void 0,
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ jsxs2(
|
|
162
|
+
"div",
|
|
163
|
+
{
|
|
164
|
+
className: taskHeadingStyles(),
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ jsx2("strong", { children: step.title }),
|
|
167
|
+
/* @__PURE__ */ jsx2(
|
|
168
|
+
"span",
|
|
169
|
+
{
|
|
170
|
+
className: taskMetaStyles(),
|
|
171
|
+
children: step.statusLabel
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
step.description,
|
|
178
|
+
step.durationLabel && /* @__PURE__ */ jsx2(
|
|
179
|
+
"span",
|
|
180
|
+
{
|
|
181
|
+
className: taskMetaStyles(),
|
|
182
|
+
children: step.durationLabel
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
step.details !== void 0 && /* @__PURE__ */ jsxs2(
|
|
186
|
+
"details",
|
|
187
|
+
{
|
|
188
|
+
className: taskDetailsStyles(),
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ jsx2("summary", { children: step.detailsLabel ?? step.title }),
|
|
191
|
+
step.details
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
step.action && /* @__PURE__ */ jsx2(
|
|
196
|
+
Button2,
|
|
197
|
+
{
|
|
198
|
+
variant: "secondary",
|
|
199
|
+
disabled: disabled || step.action.disabled || step.status === "running",
|
|
200
|
+
onClick: step.action.onAction,
|
|
201
|
+
children: step.action.label
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
step.id
|
|
207
|
+
);
|
|
208
|
+
})
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
};
|
|
212
|
+
export {
|
|
213
|
+
ApprovalPanel,
|
|
214
|
+
TaskTimeline
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/shared/style.ts", "../src/approval-panel/style.ts", "../src/approval-panel/approval-panel.tsx", "../src/task-timeline/style.ts", "../src/task-timeline/task-timeline.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Task\n * @namespace Shared\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const taskHeadingStyles = cva(\"flex min-w-0 flex-wrap items-baseline justify-between gap-gridui-8 wrap-anywhere\");\n\nexport const taskMetaStyles = cva(\"text-muted type-caption\");\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace ApprovalPanel\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const taskActionsStyles = cva(\"mt-gridui-16 flex flex-wrap justify-end gap-gridui-8\");\n\nexport const approvalStyles = cva(\"min-w-0 border border-border bg-background p-gridui-16 text-foreground wrap-anywhere [&_summary]:min-h-11 [&_summary]:cursor-pointer [&_summary]:py-gridui-8\");\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace ApprovalPanel\n * @description Approval Panel\n */\n\nimport { taskHeadingStyles, taskMetaStyles } from \"../shared/style\";\nimport { approvalStyles, taskActionsStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type ReactNode, useId, useLayoutEffect, useRef } from \"react\";\n\nexport type ApprovalPanelProps = Omit<ComponentPropsWithRef<\"section\">, \"title\"> & {\n readonly title: string;\n readonly description?: ReactNode;\n readonly status: \"pending\" | \"submitting\" | \"approved\" | \"denied\" | \"failed\" | \"blocked\";\n readonly statusLabel: string;\n readonly approveLabel: string;\n readonly denyLabel: string;\n readonly recordLabel: string;\n readonly onDecision: (decision: \"approve\" | \"deny\") => void;\n readonly disabled?: boolean;\n readonly error?: ReactNode;\n};\n\nexport const ApprovalPanel: FC<ApprovalPanelProps> = (props: ApprovalPanelProps) => {\n const {\n title,\n description,\n status,\n statusLabel,\n approveLabel,\n denyLabel,\n recordLabel,\n onDecision,\n disabled = false,\n error,\n children,\n className,\n ...restProps\n } = props;\n const id = useId();\n const record = useRef<HTMLElement>(null);\n const requested = useRef(false);\n const settled = status === \"approved\" || status === \"denied\" || status === \"blocked\";\n useLayoutEffect(() => {\n if (settled && requested.current) {\n record.current?.focus();\n requested.current = false;\n }\n }, [settled]);\n const decide = (decision: \"approve\" | \"deny\") => {\n if (!disabled && (status === \"pending\" || status === \"failed\")) {\n requested.current = true;\n onDecision(decision);\n }\n };\n return (<section\n {...restProps}\n aria-labelledby={id}\n className={cn(approvalStyles(), className)}\n data-state={status}\n >\n <div\n className={taskHeadingStyles()}\n >\n <strong\n id={id}\n >\n {title}\n </strong>\n <span\n role=\"status\"\n className={taskMetaStyles()}\n >\n {statusLabel}\n </span>\n </div>\n {settled ? (<details>\n <summary\n ref={record}\n >\n {recordLabel}\n </summary>\n {description}\n {children}\n </details>) : (<div>\n {description}\n {children}\n {error && (<div\n role=\"alert\"\n >\n {error}\n </div>)}\n <div\n className={taskActionsStyles()}\n >\n <Button\n variant=\"secondary\"\n disabled={disabled || status === \"submitting\"}\n onClick={() => {\n decide(\"deny\");\n }}\n >\n {denyLabel}\n </Button>\n <Button\n disabled={disabled || status === \"submitting\"}\n loading={status === \"submitting\"}\n onClick={() => {\n decide(\"approve\");\n }}\n >\n {approveLabel}\n </Button>\n </div>\n </div>)}\n </section>);\n};\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace TaskTimeline\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const taskListStyles = cva(\"m-0 list-decimal ps-gridui-32\");\n\nexport const taskItemStyles = cva(\"min-w-0 border-b border-border py-gridui-16 pe-gridui-16 wrap-anywhere data-[state=failed]:border-danger-border\");\n\nexport const taskDetailsStyles = cva(\"my-gridui-8 [&_summary]:cursor-pointer [&_summary]:py-gridui-8\");\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace TaskTimeline\n * @description Task Timeline\n */\n\nimport { taskHeadingStyles, taskMetaStyles } from \"../shared/style\";\nimport { taskDetailsStyles, taskItemStyles, taskListStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type TaskStep = {\n readonly id: string;\n readonly title: string;\n readonly status: \"pending\" | \"running\" | \"completed\" | \"failed\" | \"cancelled\" | \"waiting\";\n readonly statusLabel: string;\n readonly description?: ReactNode;\n readonly durationLabel?: string;\n readonly details?: ReactNode;\n readonly detailsLabel?: string;\n readonly action?: {\n readonly label: string;\n readonly onAction: () => void;\n readonly disabled?: boolean;\n };\n};\n\nexport type TaskTimelineProps = Omit<ComponentPropsWithRef<\"ol\">, \"children\"> & {\n readonly steps: readonly TaskStep[];\n readonly label: string;\n readonly disabled?: boolean;\n};\n\nexport const TaskTimeline: FC<TaskTimelineProps> = (props: TaskTimelineProps) => {\n const { steps, label, disabled = false, className, ...restProps } = props;\n return (<ol\n {...restProps}\n aria-label={label}\n className={cn(taskListStyles(), className)}\n >\n {steps.map(step => {\n return (<li\n key={step.id}\n className={taskItemStyles()}\n data-state={step.status}\n aria-current={step.status === \"running\" || step.status === \"waiting\" ? \"step\" : undefined}\n >\n <div\n className={taskHeadingStyles()}\n >\n <strong>\n {step.title}\n </strong>\n <span\n className={taskMetaStyles()}\n >\n {step.statusLabel}\n </span>\n </div>\n {step.description}\n {step.durationLabel && (<span\n className={taskMetaStyles()}\n >\n {step.durationLabel}\n </span>)}\n {step.details !== undefined && (<details\n className={taskDetailsStyles()}\n >\n <summary>\n {step.detailsLabel ?? step.title}\n </summary>\n {step.details}\n </details>)}\n {step.action && (<Button\n variant=\"secondary\"\n disabled={disabled || step.action.disabled || step.status === \"running\"}\n onClick={step.action.onAction}\n >\n {step.action.label}\n </Button>)}\n </li>);\n })}\n </ol>);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,oBAAoB,IAAI,kFAAkF;AAEhH,IAAM,iBAAiB,IAAI,yBAAyB;;;ACJ3D,SAAS,OAAAA,YAAW;AAEb,IAAM,oBAAoBA,KAAI,sDAAsD;AAEpF,IAAM,iBAAiBA,KAAI,8JAA8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Aa,KAAK,WAAW,YAAY,SAAS;AAAA,YAEhF;AAAA,8BAAAA;AAAA,gBAAC;AAAA;AAAA,kBACG,WAAW,kBAAkB;AAAA,kBAE7B;AAAA,oCAAAD,KAAC,YACI,eAAK,OACV;AAAA,oBACA,gBAAAA;AAAA,sBAAC;AAAA;AAAA,wBACG,WAAW,eAAe;AAAA,wBAEzB,eAAK;AAAA;AAAA,oBACV;AAAA;AAAA;AAAA,cACJ;AAAA,cACC,KAAK;AAAA,cACL,KAAK,iBAAkB,gBAAAA;AAAA,gBAAC;AAAA;AAAA,kBACrB,WAAW,eAAe;AAAA,kBAEzB,eAAK;AAAA;AAAA,cACV;AAAA,cACC,KAAK,YAAY,UAAc,gBAAAC;AAAA,gBAAC;AAAA;AAAA,kBAC7B,WAAW,kBAAkB;AAAA,kBAE7B;AAAA,oCAAAD,KAAC,aACI,eAAK,gBAAgB,KAAK,OAC/B;AAAA,oBACC,KAAK;AAAA;AAAA;AAAA,cACV;AAAA,cACC,KAAK,UAAW,gBAAAA;AAAA,gBAACF;AAAA,gBAAA;AAAA,kBACd,SAAQ;AAAA,kBACR,UAAU,YAAY,KAAK,OAAO,YAAY,KAAK,WAAW;AAAA,kBAC9D,SAAS,KAAK,OAAO;AAAA,kBAEpB,eAAK,OAAO;AAAA;AAAA,cACjB;AAAA;AAAA;AAAA,UArCK,KAAK;AAAA,QAsCd;AAAA,MACJ,CAAC;AAAA;AAAA,EACL;AACJ;",
|
|
6
|
+
"names": ["cva", "cva", "Button", "cn", "jsx", "jsxs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Task
|
|
4
|
+
* @namespace Shared
|
|
5
|
+
* @description Style
|
|
6
|
+
*/
|
|
7
|
+
export declare const taskHeadingStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
+
export declare const taskMetaStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer theme, base, components, utilities;
|
|
4
|
+
@layer theme {
|
|
5
|
+
:root, :host {
|
|
6
|
+
--spacing: 0.25rem;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@layer utilities {
|
|
10
|
+
.m-0 {
|
|
11
|
+
margin: 0px;
|
|
12
|
+
}
|
|
13
|
+
.my-gridui-8 {
|
|
14
|
+
margin-block: var(--gridui-space-8);
|
|
15
|
+
}
|
|
16
|
+
.mt-gridui-16 {
|
|
17
|
+
margin-top: var(--gridui-space-16);
|
|
18
|
+
}
|
|
19
|
+
.flex {
|
|
20
|
+
display: flex;
|
|
21
|
+
}
|
|
22
|
+
.min-w-0 {
|
|
23
|
+
min-width: 0px;
|
|
24
|
+
}
|
|
25
|
+
.list-decimal {
|
|
26
|
+
list-style-type: decimal;
|
|
27
|
+
}
|
|
28
|
+
.flex-wrap {
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
}
|
|
31
|
+
.items-baseline {
|
|
32
|
+
align-items: baseline;
|
|
33
|
+
}
|
|
34
|
+
.justify-between {
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
}
|
|
37
|
+
.justify-end {
|
|
38
|
+
justify-content: flex-end;
|
|
39
|
+
}
|
|
40
|
+
.gap-gridui-8 {
|
|
41
|
+
gap: var(--gridui-space-8);
|
|
42
|
+
}
|
|
43
|
+
.border {
|
|
44
|
+
border-style: var(--tw-border-style);
|
|
45
|
+
border-width: 1px;
|
|
46
|
+
}
|
|
47
|
+
.border-b {
|
|
48
|
+
border-bottom-style: var(--tw-border-style);
|
|
49
|
+
border-bottom-width: 1px;
|
|
50
|
+
}
|
|
51
|
+
.border-border {
|
|
52
|
+
border-color: var(--gridui-border);
|
|
53
|
+
}
|
|
54
|
+
.bg-background {
|
|
55
|
+
background-color: var(--gridui-background);
|
|
56
|
+
}
|
|
57
|
+
.p-gridui-16 {
|
|
58
|
+
padding: var(--gridui-space-16);
|
|
59
|
+
}
|
|
60
|
+
.py-gridui-16 {
|
|
61
|
+
padding-block: var(--gridui-space-16);
|
|
62
|
+
}
|
|
63
|
+
.ps-gridui-32 {
|
|
64
|
+
padding-inline-start: var(--gridui-space-32);
|
|
65
|
+
}
|
|
66
|
+
.pe-gridui-16 {
|
|
67
|
+
padding-inline-end: var(--gridui-space-16);
|
|
68
|
+
}
|
|
69
|
+
.type-caption {
|
|
70
|
+
font: var(--gridui-type-caption);
|
|
71
|
+
letter-spacing: normal;
|
|
72
|
+
}
|
|
73
|
+
.wrap-anywhere {
|
|
74
|
+
overflow-wrap: anywhere;
|
|
75
|
+
}
|
|
76
|
+
.text-foreground {
|
|
77
|
+
color: var(--gridui-foreground);
|
|
78
|
+
}
|
|
79
|
+
.text-muted {
|
|
80
|
+
color: var(--gridui-muted);
|
|
81
|
+
}
|
|
82
|
+
.data-\[state\=failed\]\:border-danger-border[data-state="failed"] {
|
|
83
|
+
border-color: var(--gridui-danger-border);
|
|
84
|
+
}
|
|
85
|
+
.\[\&_summary\]\:min-h-11 summary {
|
|
86
|
+
min-height: calc(var(--spacing) * 11);
|
|
87
|
+
}
|
|
88
|
+
.\[\&_summary\]\:cursor-pointer summary {
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
}
|
|
91
|
+
.\[\&_summary\]\:py-gridui-8 summary {
|
|
92
|
+
padding-block: var(--gridui-space-8);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
@property --tw-border-style {
|
|
96
|
+
syntax: "*";
|
|
97
|
+
inherits: false;
|
|
98
|
+
initial-value: solid;
|
|
99
|
+
}
|
|
100
|
+
@layer properties {
|
|
101
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
102
|
+
*, ::before, ::after, ::backdrop {
|
|
103
|
+
--tw-border-style: solid;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Task
|
|
4
|
+
* @namespace TaskTimeline
|
|
5
|
+
* @description Style
|
|
6
|
+
*/
|
|
7
|
+
export declare const taskListStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
+
export declare const taskItemStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
9
|
+
export declare const taskDetailsStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @package Task
|
|
4
|
+
* @namespace TaskTimeline
|
|
5
|
+
* @description Task Timeline
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentPropsWithRef, FC, ReactNode } from "react";
|
|
8
|
+
export type TaskStep = {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
readonly status: "pending" | "running" | "completed" | "failed" | "cancelled" | "waiting";
|
|
12
|
+
readonly statusLabel: string;
|
|
13
|
+
readonly description?: ReactNode;
|
|
14
|
+
readonly durationLabel?: string;
|
|
15
|
+
readonly details?: ReactNode;
|
|
16
|
+
readonly detailsLabel?: string;
|
|
17
|
+
readonly action?: {
|
|
18
|
+
readonly label: string;
|
|
19
|
+
readonly onAction: () => void;
|
|
20
|
+
readonly disabled?: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type TaskTimelineProps = Omit<ComponentPropsWithRef<"ol">, "children"> & {
|
|
24
|
+
readonly steps: readonly TaskStep[];
|
|
25
|
+
readonly label: string;
|
|
26
|
+
readonly disabled?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare const TaskTimeline: FC<TaskTimelineProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/task",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "GridUI React task",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./styles.css": "./dist/styles.css"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^19.2.0",
|
|
26
|
+
"react-dom": "^19.2.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@gridui/button": "^2.1.1",
|
|
30
|
+
"@gridui/style-utils": "^2.1.2",
|
|
31
|
+
"@gridui/theme": "^2.1.2",
|
|
32
|
+
"class-variance-authority": "0.7.1"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@gridui-internal/configuration": "0.0.0",
|
|
36
|
+
"@gridui/artifact-panel": "0.0.0",
|
|
37
|
+
"@gridui/composer": "0.0.0",
|
|
38
|
+
"@jest/globals": "30.5.2",
|
|
39
|
+
"@types/jest": "30.0.0",
|
|
40
|
+
"@types/node": "26.6.5",
|
|
41
|
+
"@types/react": "19.3.0",
|
|
42
|
+
"@types/react-dom": "19.3.0",
|
|
43
|
+
"jest": "30.5.2",
|
|
44
|
+
"react": "19.3.1",
|
|
45
|
+
"react-dom": "19.3.1",
|
|
46
|
+
"typescript": "6.0.3"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "node ../../scripts/compilation/package.ts",
|
|
50
|
+
"compile": "tsc --project tsconfig.json",
|
|
51
|
+
"test": "jest",
|
|
52
|
+
"coverage": "jest --coverage"
|
|
53
|
+
}
|
|
6
54
|
}
|