@dxos/react-ui-task 0.10.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/LICENSE ADDED
@@ -0,0 +1,105 @@
1
+ # Functional Source License, Version 1.1, ALv2 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-Apache-2.0
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 DXOS
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
@@ -0,0 +1,154 @@
1
+ import React, { useCallback, useMemo, useState } from "react";
2
+ import { useObject } from "@dxos/echo-react";
3
+ import { Icon, IconButton, Input, Tag } from "@dxos/react-ui";
4
+ import { Listbox } from "@dxos/react-ui-list";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/TaskList/TaskList.tsx
7
+ /** Linear-style status groups, most active first. */
8
+ var STATUS_ORDER = [
9
+ "in-progress",
10
+ "todo",
11
+ "done",
12
+ "failed",
13
+ "cancelled"
14
+ ];
15
+ var DEFAULT_STATUS_LABELS = {
16
+ "in-progress": "In progress",
17
+ "todo": "Todo",
18
+ "done": "Done",
19
+ "failed": "Failed",
20
+ "cancelled": "Cancelled"
21
+ };
22
+ /**
23
+ * List of durable {@link Task} objects with optional CRUD affordances — every mutation is
24
+ * delegated to a callback (typically a `TaskOperation` invocation), never performed here.
25
+ */
26
+ var TaskList = ({ classNames, tasks, groupByStatus = true, statusLabel = (status) => DEFAULT_STATUS_LABELS[status], onTaskCreate, onTaskUpdate, onTaskDelete, onTaskSelect, createPlaceholder = "Add task" }) => {
27
+ const groups = useMemo(() => {
28
+ if (!groupByStatus) return tasks.length > 0 ? [{
29
+ status: void 0,
30
+ tasks
31
+ }] : [];
32
+ return STATUS_ORDER.map((status) => ({
33
+ status,
34
+ tasks: tasks.filter((task) => (task.status ?? "todo") === status)
35
+ })).filter((group) => group.tasks.length > 0);
36
+ }, [tasks, groupByStatus]);
37
+ return /* @__PURE__ */ jsxs("div", {
38
+ className: "flex flex-col min-w-0",
39
+ children: [/* @__PURE__ */ jsx(Listbox.Root, { children: /* @__PURE__ */ jsx(Listbox.Viewport, {
40
+ classNames: ["dx-container", classNames],
41
+ children: /* @__PURE__ */ jsx(Listbox.Content, {
42
+ "aria-label": "Tasks",
43
+ children: groups.map(({ status, tasks }) => /* @__PURE__ */ jsxs(React.Fragment, { children: [status && /* @__PURE__ */ jsx("div", {
44
+ className: "px-2 pt-3 pb-1 text-xs text-subdued uppercase",
45
+ children: statusLabel(status)
46
+ }), tasks.map((task) => /* @__PURE__ */ jsx(TaskRow, {
47
+ task,
48
+ onUpdate: onTaskUpdate,
49
+ onDelete: onTaskDelete,
50
+ onSelect: onTaskSelect
51
+ }, task.id))] }, status ?? "all"))
52
+ })
53
+ }) }), onTaskCreate && /* @__PURE__ */ jsx(TaskCreateRow, {
54
+ placeholder: createPlaceholder,
55
+ onCreate: onTaskCreate
56
+ })]
57
+ });
58
+ };
59
+ var TaskRow = ({ task, onUpdate, onDelete, onSelect }) => {
60
+ const done = task.status === "done";
61
+ const handleToggle = useCallback(() => onUpdate?.(task, { status: done ? "todo" : "done" }), [
62
+ onUpdate,
63
+ task,
64
+ done
65
+ ]);
66
+ return /* @__PURE__ */ jsx(Listbox.Item, {
67
+ id: task.id,
68
+ classNames: "py-0 group",
69
+ children: /* @__PURE__ */ jsxs("div", {
70
+ className: "flex items-center gap-2 min-w-0",
71
+ children: [
72
+ onUpdate ? /* @__PURE__ */ jsx(IconButton, {
73
+ variant: "ghost",
74
+ density: "xs",
75
+ icon: done ? "ph--check--regular" : "ph--circle--regular",
76
+ iconOnly: true,
77
+ label: done ? "Mark todo" : "Mark done",
78
+ classNames: done ? "text-success-text" : void 0,
79
+ onClick: handleToggle
80
+ }) : /* @__PURE__ */ jsx(Icon, {
81
+ icon: done ? "ph--check--regular" : "ph--circle--regular",
82
+ classNames: done ? "text-success-text" : void 0,
83
+ size: 4
84
+ }),
85
+ /* @__PURE__ */ jsx("span", {
86
+ className: onSelect ? "truncate flex-1 cursor-pointer" : "truncate flex-1",
87
+ onClick: onSelect ? () => onSelect(task) : void 0,
88
+ children: task.title
89
+ }),
90
+ task.priority && task.priority !== "none" && /* @__PURE__ */ jsx(Tag, {
91
+ hue: "neutral",
92
+ children: task.priority
93
+ }),
94
+ task.assignee && /* @__PURE__ */ jsx(AssigneeChip, { assignee: task.assignee }),
95
+ onDelete && /* @__PURE__ */ jsx(IconButton, {
96
+ variant: "ghost",
97
+ density: "xs",
98
+ icon: "ph--x--regular",
99
+ iconOnly: true,
100
+ label: "Delete task",
101
+ classNames: "invisible group-hover:visible",
102
+ onClick: () => onDelete(task)
103
+ })
104
+ ]
105
+ })
106
+ });
107
+ };
108
+ var TaskCreateRow = ({ placeholder, onCreate }) => {
109
+ const [title, setTitle] = useState("");
110
+ const handleKeyDown = useCallback((event) => {
111
+ const trimmed = title.trim();
112
+ if (event.key === "Enter" && trimmed.length > 0) {
113
+ onCreate(trimmed);
114
+ setTitle("");
115
+ }
116
+ }, [title, onCreate]);
117
+ return /* @__PURE__ */ jsxs("div", {
118
+ className: "flex items-center gap-2 px-2 py-1",
119
+ children: [/* @__PURE__ */ jsx(Icon, {
120
+ icon: "ph--plus--regular",
121
+ size: 4,
122
+ classNames: "text-subdued"
123
+ }), /* @__PURE__ */ jsx(Input.Root, { children: /* @__PURE__ */ jsx(Input.TextInput, {
124
+ variant: "subdued",
125
+ placeholder,
126
+ value: title,
127
+ onChange: (event) => setTitle(event.target.value),
128
+ onKeyDown: handleKeyDown
129
+ }) })]
130
+ });
131
+ };
132
+ /**
133
+ * Actor-aware assignee chip: a Person ref resolves to the contact's name; otherwise fall back to
134
+ * name, email, or a shortened DID; agents (`role: 'assistant'`) are marked with a sparkle.
135
+ */
136
+ var AssigneeChip = ({ assignee }) => {
137
+ const [contact] = useObject(assignee.contact);
138
+ const label = contact?.fullName ?? assignee.name ?? assignee.email ?? (assignee.identityDid ? shortDid(assignee.identityDid) : void 0);
139
+ const agent = assignee.role === "assistant";
140
+ if (!label && !agent) return null;
141
+ return /* @__PURE__ */ jsxs(Tag, {
142
+ hue: agent ? "purple" : "indigo",
143
+ children: [agent && /* @__PURE__ */ jsx(Icon, {
144
+ icon: "ph--sparkle--regular",
145
+ size: 3,
146
+ classNames: "inline-block me-1"
147
+ }), label ?? "agent"]
148
+ });
149
+ };
150
+ var shortDid = (did) => `${did.slice(0, 12)}…`;
151
+ //#endregion
152
+ export { AssigneeChip, STATUS_ORDER, TaskList };
153
+
154
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/components/TaskList/TaskList.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { type KeyboardEvent, useCallback, useMemo, useState } from 'react';\n\nimport { useObject } from '@dxos/echo-react';\nimport { Icon, IconButton, Input, Tag, type ThemedClassName } from '@dxos/react-ui';\nimport { Listbox } from '@dxos/react-ui-list';\nimport { type Actor, type Task } from '@dxos/types';\n\nexport type TaskStatus = NonNullable<Task.Task['status']>;\n\n/** Linear-style status groups, most active first. */\nexport const STATUS_ORDER: TaskStatus[] = ['in-progress', 'todo', 'done', 'failed', 'cancelled'];\n\nconst DEFAULT_STATUS_LABELS: Record<TaskStatus, string> = {\n 'in-progress': 'In progress',\n 'todo': 'Todo',\n 'done': 'Done',\n 'failed': 'Failed',\n 'cancelled': 'Cancelled',\n};\n\nexport type TaskPatch = Partial<Pick<Task.Task, 'title' | 'status' | 'priority' | 'estimate' | 'assignee'>>;\n\nexport type TaskListProps = ThemedClassName<{\n tasks: readonly Task.Task[];\n /** Group rows into status sections (Linear order); flat list otherwise. */\n groupByStatus?: boolean;\n /** i18n hook for group headings; defaults to English labels. */\n statusLabel?: (status: TaskStatus) => string;\n /** Renders an add row; called with the trimmed title on Enter. */\n onTaskCreate?: (title: string) => void;\n /** Enables the done toggle (status patch) and any future field affordances. */\n onTaskUpdate?: (task: Task.Task, patch: TaskPatch) => void;\n /** Renders a per-row delete affordance. */\n onTaskDelete?: (task: Task.Task) => void;\n /** Row click. */\n onTaskSelect?: (task: Task.Task) => void;\n createPlaceholder?: string;\n}>;\n\n/**\n * List of durable {@link Task} objects with optional CRUD affordances — every mutation is\n * delegated to a callback (typically a `TaskOperation` invocation), never performed here.\n */\nexport const TaskList = ({\n classNames,\n tasks,\n groupByStatus = true,\n statusLabel = (status) => DEFAULT_STATUS_LABELS[status],\n onTaskCreate,\n onTaskUpdate,\n onTaskDelete,\n onTaskSelect,\n createPlaceholder = 'Add task',\n}: TaskListProps) => {\n const groups = useMemo(() => {\n if (!groupByStatus) {\n return tasks.length > 0 ? [{ status: undefined, tasks }] : [];\n }\n return STATUS_ORDER.map((status) => ({\n status,\n tasks: tasks.filter((task) => (task.status ?? 'todo') === status),\n })).filter((group) => group.tasks.length > 0);\n }, [tasks, groupByStatus]);\n\n return (\n <div className='flex flex-col min-w-0'>\n <Listbox.Root>\n <Listbox.Viewport classNames={['dx-container', classNames]}>\n <Listbox.Content aria-label='Tasks'>\n {groups.map(({ status, tasks }) => (\n <React.Fragment key={status ?? 'all'}>\n {status && <div className='px-2 pt-3 pb-1 text-xs text-subdued uppercase'>{statusLabel(status)}</div>}\n {tasks.map((task) => (\n <TaskRow\n key={task.id}\n task={task}\n onUpdate={onTaskUpdate}\n onDelete={onTaskDelete}\n onSelect={onTaskSelect}\n />\n ))}\n </React.Fragment>\n ))}\n </Listbox.Content>\n </Listbox.Viewport>\n </Listbox.Root>\n {onTaskCreate && <TaskCreateRow placeholder={createPlaceholder} onCreate={onTaskCreate} />}\n </div>\n );\n};\n\ntype TaskRowProps = {\n task: Task.Task;\n onUpdate?: TaskListProps['onTaskUpdate'];\n onDelete?: TaskListProps['onTaskDelete'];\n onSelect?: TaskListProps['onTaskSelect'];\n};\n\nconst TaskRow = ({ task, onUpdate, onDelete, onSelect }: TaskRowProps) => {\n const done = task.status === 'done';\n const handleToggle = useCallback(() => onUpdate?.(task, { status: done ? 'todo' : 'done' }), [onUpdate, task, done]);\n\n return (\n <Listbox.Item id={task.id} classNames='py-0 group'>\n <div className='flex items-center gap-2 min-w-0'>\n {onUpdate ? (\n <IconButton\n variant='ghost'\n density='xs'\n icon={done ? 'ph--check--regular' : 'ph--circle--regular'}\n iconOnly\n label={done ? 'Mark todo' : 'Mark done'}\n classNames={done ? 'text-success-text' : undefined}\n onClick={handleToggle}\n />\n ) : (\n <Icon\n icon={done ? 'ph--check--regular' : 'ph--circle--regular'}\n classNames={done ? 'text-success-text' : undefined}\n size={4}\n />\n )}\n <span\n className={onSelect ? 'truncate flex-1 cursor-pointer' : 'truncate flex-1'}\n onClick={onSelect ? () => onSelect(task) : undefined}\n >\n {task.title}\n </span>\n {task.priority && task.priority !== 'none' && <Tag hue='neutral'>{task.priority}</Tag>}\n {task.assignee && <AssigneeChip assignee={task.assignee} />}\n {onDelete && (\n <IconButton\n variant='ghost'\n density='xs'\n icon='ph--x--regular'\n iconOnly\n label='Delete task'\n classNames='invisible group-hover:visible'\n onClick={() => onDelete(task)}\n />\n )}\n </div>\n </Listbox.Item>\n );\n};\n\ntype TaskCreateRowProps = {\n placeholder: string;\n onCreate: (title: string) => void;\n};\n\nconst TaskCreateRow = ({ placeholder, onCreate }: TaskCreateRowProps) => {\n const [title, setTitle] = useState('');\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n const trimmed = title.trim();\n if (event.key === 'Enter' && trimmed.length > 0) {\n onCreate(trimmed);\n setTitle('');\n }\n },\n [title, onCreate],\n );\n\n return (\n <div className='flex items-center gap-2 px-2 py-1'>\n <Icon icon='ph--plus--regular' size={4} classNames='text-subdued' />\n <Input.Root>\n <Input.TextInput\n variant='subdued'\n placeholder={placeholder}\n value={title}\n onChange={(event) => setTitle(event.target.value)}\n onKeyDown={handleKeyDown}\n />\n </Input.Root>\n </div>\n );\n};\n\n/**\n * Actor-aware assignee chip: a Person ref resolves to the contact's name; otherwise fall back to\n * name, email, or a shortened DID; agents (`role: 'assistant'`) are marked with a sparkle.\n */\nexport const AssigneeChip = ({ assignee }: { assignee: Actor.Actor }) => {\n const [contact] = useObject(assignee.contact);\n const label =\n contact?.fullName ??\n assignee.name ??\n assignee.email ??\n (assignee.identityDid ? shortDid(assignee.identityDid) : undefined);\n const agent = assignee.role === 'assistant';\n if (!label && !agent) {\n return null;\n }\n\n return (\n <Tag hue={agent ? 'purple' : 'indigo'}>\n {agent && <Icon icon='ph--sparkle--regular' size={3} classNames='inline-block me-1' />}\n {label ?? 'agent'}\n </Tag>\n );\n};\n\nconst shortDid = (did: string): string => `${did.slice(0, 12)}…`;\n"],"mappings":";;;;;;;AAcA,IAAa,eAA6B;CAAC;CAAe;CAAQ;CAAQ;CAAU;AAAW;AAE/F,IAAM,wBAAoD;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;GACK;GACb,OAAO;GACP,WAAW,UAAU,SAAS,MAAM,OAAO,KAAK;GAChD,WAAW;EACZ,CAAA,EACS,CAAA,CACT;;AAET;;;;;AAMA,IAAa,gBAAgB,EAAE,eAA0C;CACvE,MAAM,CAAC,WAAW,UAAU,SAAS,OAAO;CAC5C,MAAM,QACJ,SAAS,YACT,SAAS,QACT,SAAS,UACR,SAAS,cAAc,SAAS,SAAS,WAAW,IAAI,KAAA;CAC3D,MAAM,QAAQ,SAAS,SAAS;CAChC,IAAI,CAAC,SAAS,CAAC,OACb,OAAO;CAGT,OACE,qBAAC,KAAD;EAAK,KAAK,QAAQ,WAAW;YAA7B,CACG,SAAS,oBAAC,MAAD;GAAM,MAAK;GAAuB,MAAM;GAAG,YAAW;EAAqB,CAAA,GACpF,SAAS,OACP;;AAET;AAEA,IAAM,YAAY,QAAwB,GAAG,IAAI,MAAM,GAAG,EAAE,EAAE"}
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { type ThemedClassName } from '@dxos/react-ui';
3
+ import { type Actor, type Task } from '@dxos/types';
4
+ export type TaskStatus = NonNullable<Task.Task['status']>;
5
+ /** Linear-style status groups, most active first. */
6
+ export declare const STATUS_ORDER: TaskStatus[];
7
+ export type TaskPatch = Partial<Pick<Task.Task, 'title' | 'status' | 'priority' | 'estimate' | 'assignee'>>;
8
+ export type TaskListProps = ThemedClassName<{
9
+ tasks: readonly Task.Task[];
10
+ /** Group rows into status sections (Linear order); flat list otherwise. */
11
+ groupByStatus?: boolean;
12
+ /** i18n hook for group headings; defaults to English labels. */
13
+ statusLabel?: (status: TaskStatus) => string;
14
+ /** Renders an add row; called with the trimmed title on Enter. */
15
+ onTaskCreate?: (title: string) => void;
16
+ /** Enables the done toggle (status patch) and any future field affordances. */
17
+ onTaskUpdate?: (task: Task.Task, patch: TaskPatch) => void;
18
+ /** Renders a per-row delete affordance. */
19
+ onTaskDelete?: (task: Task.Task) => void;
20
+ /** Row click. */
21
+ onTaskSelect?: (task: Task.Task) => void;
22
+ createPlaceholder?: string;
23
+ }>;
24
+ /**
25
+ * List of durable {@link Task} objects with optional CRUD affordances — every mutation is
26
+ * delegated to a callback (typically a `TaskOperation` invocation), never performed here.
27
+ */
28
+ export declare const TaskList: ({ classNames, tasks, groupByStatus, statusLabel, onTaskCreate, onTaskUpdate, onTaskDelete, onTaskSelect, createPlaceholder, }: TaskListProps) => React.JSX.Element;
29
+ /**
30
+ * Actor-aware assignee chip: a Person ref resolves to the contact's name; otherwise fall back to
31
+ * name, email, or a shortened DID; agents (`role: 'assistant'`) are marked with a sparkle.
32
+ */
33
+ export declare const AssigneeChip: ({ assignee }: {
34
+ assignee: Actor.Actor;
35
+ }) => React.JSX.Element | null;
36
+ //# sourceMappingURL=TaskList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskList.d.ts","sourceRoot":"","sources":["../../../../../src/components/TaskList/TaskList.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAGlF,OAAO,EAAgC,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEpF,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AAE1D,qDAAqD;AACrD,eAAO,MAAM,YAAY,EAAE,UAAU,EAA2D,CAAC;AAUjG,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC;AAE5G,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC;IAC1C,KAAK,EAAE,SAAS,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gEAAgE;IAChE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,MAAM,CAAC;IAC7C,kEAAkE;IAClE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC3D,2CAA2C;IAC3C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;IACzC,iBAAiB;IACjB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,kIAUlB,aAAa,sBAoCf,CAAC;AA2FF;;;GAGG;AACH,eAAO,MAAM,YAAY,iBAAkB;IAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAA;CAAE,6BAkBnE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ declare const meta: {
4
+ title: string;
5
+ render: (args: {
6
+ readonly?: boolean;
7
+ }) => React.JSX.Element;
8
+ decorators: import("@storybook/react").Decorator[];
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Default: Story;
13
+ export declare const Readonly: Story;
14
+ //# sourceMappingURL=TaskList.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TaskList.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TaskList/TaskList.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAgC,MAAM,OAAO,CAAC;AA8CrD,QAAA,MAAM,IAAI;;;mBA9BuC,OAAO;;;CAkCnB,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './TaskList';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TaskList/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './components/TaskList';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom/vitest';
2
+ //# sourceMappingURL=vitest-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest-setup.d.ts","sourceRoot":"","sources":["../../../src/vitest-setup.ts"],"names":[],"mappings":"AAKA,OAAO,kCAAkC,CAAC"}