@ciridae/ui 1.0.2 → 1.0.3

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.
Files changed (140) hide show
  1. package/dist/app/auth.d.ts +10 -0
  2. package/dist/app/auth.js +60 -0
  3. package/dist/app/error-boundary.d.ts +18 -0
  4. package/dist/app/error-boundary.js +45 -0
  5. package/dist/app/feedback.d.ts +12 -0
  6. package/dist/app/feedback.js +128 -0
  7. package/dist/app/index.d.ts +8 -0
  8. package/dist/app/index.js +8 -0
  9. package/dist/app/request-errors.d.ts +63 -0
  10. package/dist/app/request-errors.js +172 -0
  11. package/dist/app/sentry.d.ts +18 -0
  12. package/dist/app/sentry.js +52 -0
  13. package/dist/app/telemetry.d.ts +7 -0
  14. package/dist/app/telemetry.js +28 -0
  15. package/dist/app/trail.d.ts +9 -0
  16. package/dist/app/trail.js +18 -0
  17. package/dist/chat/chat-query-keys.d.ts +3 -3
  18. package/dist/chat/contract.d.ts +15 -15
  19. package/dist/chat/conversation-items-query-options.d.ts +114 -114
  20. package/dist/chat/conversation-source.d.ts +75 -0
  21. package/dist/chat/conversation-source.js +1 -0
  22. package/dist/chat/message-text.d.ts +1 -1
  23. package/dist/chat/message-text.js +114 -46
  24. package/dist/chat/use-conversation-list.d.ts +6 -6
  25. package/dist/components/activity-feed.d.ts +2 -2
  26. package/dist/components/agent-work.d.ts +3 -3
  27. package/dist/components/app-frame.d.ts +79 -0
  28. package/dist/components/app-frame.js +92 -0
  29. package/dist/components/app-navigation.d.ts +3 -3
  30. package/dist/components/badge.d.ts +1 -1
  31. package/dist/components/brand-icons.d.ts +3 -3
  32. package/dist/components/bulk-action-bar.d.ts +1 -1
  33. package/dist/components/button.d.ts +4 -4
  34. package/dist/components/calendar.d.ts +1 -1
  35. package/dist/components/centered-page.d.ts +1 -1
  36. package/dist/components/chart.d.ts +22 -2
  37. package/dist/components/chart.js +239 -44
  38. package/dist/components/chat-client-source.d.ts +16 -0
  39. package/dist/components/chat-client-source.js +256 -0
  40. package/dist/components/chat-page.d.ts +9 -8
  41. package/dist/components/chat-page.js +7 -11
  42. package/dist/components/chat-sheet-controller.d.ts +10 -14
  43. package/dist/components/chat-sheet-controller.js +2 -3
  44. package/dist/components/chat-sheet.d.ts +10 -11
  45. package/dist/components/chat-sheet.js +135 -273
  46. package/dist/components/chat.d.ts +22 -8
  47. package/dist/components/chat.js +128 -33
  48. package/dist/components/checkbox-item.d.ts +1 -1
  49. package/dist/components/checkbox-list.d.ts +1 -1
  50. package/dist/components/chip.d.ts +1 -1
  51. package/dist/components/collapsible.d.ts +1 -1
  52. package/dist/components/color-theme.d.ts +1 -1
  53. package/dist/components/column-settings.d.ts +1 -1
  54. package/dist/components/command-menu.d.ts +1 -1
  55. package/dist/components/command-palette.d.ts +3 -3
  56. package/dist/components/command-palette.js +1 -2
  57. package/dist/components/copyable-id.d.ts +22 -5
  58. package/dist/components/copyable-id.js +46 -6
  59. package/dist/components/data-display.d.ts +4 -4
  60. package/dist/components/data-grid.d.ts +10 -10
  61. package/dist/components/date-range-picker.d.ts +1 -1
  62. package/dist/components/date-time.d.ts +1 -1
  63. package/dist/components/dialog-height-context.d.ts +1 -1
  64. package/dist/components/document-viewer.d.ts +2 -2
  65. package/dist/components/drawer.d.ts +6 -6
  66. package/dist/components/dropzone.d.ts +4 -4
  67. package/dist/components/editable-field.d.ts +2 -2
  68. package/dist/components/email-input.d.ts +1 -1
  69. package/dist/components/environment-frame.d.ts +1 -1
  70. package/dist/components/expandable-text.d.ts +1 -1
  71. package/dist/components/feedback-screenshot.d.ts +1 -1
  72. package/dist/components/feedback-sheet.d.ts +18 -3
  73. package/dist/components/feedback-sheet.js +216 -55
  74. package/dist/components/field-context.d.ts +1 -1
  75. package/dist/components/filter-bar.d.ts +3 -3
  76. package/dist/components/filter-bar.js +4 -1
  77. package/dist/components/form-controls.d.ts +3 -3
  78. package/dist/components/form-layout.d.ts +7 -7
  79. package/dist/components/hotkeys.d.ts +2 -2
  80. package/dist/components/icon.d.ts +1 -1
  81. package/dist/components/input.d.ts +4 -4
  82. package/dist/components/input.js +3 -2
  83. package/dist/components/keyboard-shortcuts.d.ts +2 -2
  84. package/dist/components/keycap.d.ts +2 -2
  85. package/dist/components/layout.d.ts +13 -13
  86. package/dist/components/lightbox.d.ts +9 -3
  87. package/dist/components/lightbox.js +11 -8
  88. package/dist/components/link.d.ts +1 -1
  89. package/dist/components/locale.d.ts +32 -2
  90. package/dist/components/locale.js +25 -1
  91. package/dist/components/log-list.d.ts +3 -3
  92. package/dist/components/mention-input.d.ts +2 -2
  93. package/dist/components/menu.d.ts +2 -2
  94. package/dist/components/meter.d.ts +1 -1
  95. package/dist/components/navigation.d.ts +2 -2
  96. package/dist/components/notification-tray.d.ts +1 -1
  97. package/dist/components/overlays.d.ts +4 -4
  98. package/dist/components/page-frame.d.ts +4 -4
  99. package/dist/components/panel.d.ts +3 -3
  100. package/dist/components/profile-header.d.ts +1 -1
  101. package/dist/components/progress.d.ts +1 -1
  102. package/dist/components/project-avatar.d.ts +1 -1
  103. package/dist/components/radio-card.d.ts +2 -2
  104. package/dist/components/record.d.ts +4 -4
  105. package/dist/components/resolved-file-url.d.ts +19 -0
  106. package/dist/components/resolved-file-url.js +49 -0
  107. package/dist/components/scroll-area.d.ts +1 -1
  108. package/dist/components/secret-dialog.d.ts +1 -1
  109. package/dist/components/segmented-bar.d.ts +1 -1
  110. package/dist/components/select.d.ts +4 -4
  111. package/dist/components/settings.d.ts +4 -4
  112. package/dist/components/shell-skeleton.d.ts +1 -1
  113. package/dist/components/shell.d.ts +19 -19
  114. package/dist/components/shell.js +3 -1
  115. package/dist/components/side-panel.d.ts +3 -3
  116. package/dist/components/sidebar.d.ts +6 -6
  117. package/dist/components/site-banner.d.ts +1 -1
  118. package/dist/components/skeleton.d.ts +1 -1
  119. package/dist/components/skeletons.d.ts +5 -5
  120. package/dist/components/stages.d.ts +5 -5
  121. package/dist/components/stat-card.d.ts +3 -3
  122. package/dist/components/status-banner.d.ts +1 -1
  123. package/dist/components/status.d.ts +2 -2
  124. package/dist/components/steps.d.ts +1 -1
  125. package/dist/components/switch.d.ts +1 -1
  126. package/dist/components/tabs.d.ts +8 -8
  127. package/dist/components/theme-customizer.d.ts +2 -2
  128. package/dist/components/toast.d.ts +1 -1
  129. package/dist/components/use-new-version-available.d.ts +6 -0
  130. package/dist/components/use-new-version-available.js +29 -0
  131. package/dist/components/user-chip.d.ts +3 -3
  132. package/dist/components/wizard.d.ts +2 -2
  133. package/dist/feedback/contract.d.ts +136 -136
  134. package/dist/feedback/feedback-controller.d.ts +6 -6
  135. package/dist/feedback/generated/zod.gen.d.ts +28 -28
  136. package/dist/feedback/operator-contract.d.ts +11 -11
  137. package/dist/feedback/operator-controller.d.ts +32 -13
  138. package/dist/feedback/operator-controller.js +44 -11
  139. package/dist/styled-system/styles.css +203 -59
  140. package/package.json +32 -3
@@ -1,17 +1,17 @@
1
1
  import { z } from "zod";
2
2
  declare const feedbackTriageStatusSchema: z.ZodEnum<{
3
- in_progress: "in_progress";
4
- completed: "completed";
5
3
  received: "received";
4
+ in_progress: "in_progress";
6
5
  discussion_required: "discussion_required";
6
+ completed: "completed";
7
7
  no_action: "no_action";
8
8
  }>;
9
9
  declare const operatorFeedbackSummarySchema: z.ZodObject<{
10
10
  status: z.ZodEnum<{
11
- in_progress: "in_progress";
12
- completed: "completed";
13
11
  received: "received";
12
+ in_progress: "in_progress";
14
13
  discussion_required: "discussion_required";
14
+ completed: "completed";
15
15
  no_action: "no_action";
16
16
  withdrawn: "withdrawn";
17
17
  }>;
@@ -22,21 +22,21 @@ declare const operatorFeedbackSummarySchema: z.ZodObject<{
22
22
  }>;
23
23
  description: z.ZodString;
24
24
  id: z.ZodUUID;
25
- createdAt: z.ZodISODateTime;
26
25
  subject: z.ZodString;
27
26
  urgency: z.ZodEnum<{
28
27
  normal: "normal";
29
28
  emergency: "emergency";
30
29
  }>;
30
+ createdAt: z.ZodISODateTime;
31
31
  updatedAt: z.ZodISODateTime;
32
32
  reporterEmail: z.ZodNullable<z.ZodString>;
33
33
  }, z.core.$strip>;
34
34
  declare const operatorFeedbackItemSchema: z.ZodObject<{
35
35
  status: z.ZodEnum<{
36
- in_progress: "in_progress";
37
- completed: "completed";
38
36
  received: "received";
37
+ in_progress: "in_progress";
39
38
  discussion_required: "discussion_required";
39
+ completed: "completed";
40
40
  no_action: "no_action";
41
41
  withdrawn: "withdrawn";
42
42
  }>;
@@ -47,12 +47,12 @@ declare const operatorFeedbackItemSchema: z.ZodObject<{
47
47
  }>;
48
48
  description: z.ZodString;
49
49
  id: z.ZodUUID;
50
- createdAt: z.ZodISODateTime;
51
50
  subject: z.ZodString;
52
51
  urgency: z.ZodEnum<{
53
52
  normal: "normal";
54
53
  emergency: "emergency";
55
54
  }>;
55
+ createdAt: z.ZodISODateTime;
56
56
  updatedAt: z.ZodISODateTime;
57
57
  reporterEmail: z.ZodNullable<z.ZodString>;
58
58
  canReply: z.ZodBoolean;
@@ -81,10 +81,10 @@ declare const operatorFeedbackItemSchema: z.ZodObject<{
81
81
  declare const operatorFeedbackListResponseSchema: z.ZodObject<{
82
82
  items: z.ZodArray<z.ZodObject<{
83
83
  status: z.ZodEnum<{
84
- in_progress: "in_progress";
85
- completed: "completed";
86
84
  received: "received";
85
+ in_progress: "in_progress";
87
86
  discussion_required: "discussion_required";
87
+ completed: "completed";
88
88
  no_action: "no_action";
89
89
  withdrawn: "withdrawn";
90
90
  }>;
@@ -95,12 +95,12 @@ declare const operatorFeedbackListResponseSchema: z.ZodObject<{
95
95
  }>;
96
96
  description: z.ZodString;
97
97
  id: z.ZodUUID;
98
- createdAt: z.ZodISODateTime;
99
98
  subject: z.ZodString;
100
99
  urgency: z.ZodEnum<{
101
100
  normal: "normal";
102
101
  emergency: "emergency";
103
102
  }>;
103
+ createdAt: z.ZodISODateTime;
104
104
  updatedAt: z.ZodISODateTime;
105
105
  reporterEmail: z.ZodNullable<z.ZodString>;
106
106
  }, z.core.$strip>>;
@@ -1,17 +1,25 @@
1
+ import { type UseQueryResult } from "@tanstack/react-query";
1
2
  import { type FeedbackOperatorClientConfig } from "./operator-client.js";
3
+ import type { FeedbackTriageStatus } from "./operator-contract.js";
4
+ import type { FeedbackOperatorProps } from "../components/feedback-sheet.js";
2
5
  type FeedbackOperatorControllerConfig = FeedbackOperatorClientConfig & {
6
+ /** Keeps one operator's cached feedback apart from another's, such as their user id. */
3
7
  cacheScope: string;
4
8
  };
5
- declare function useFeedbackOperatorController(config: FeedbackOperatorControllerConfig, selectedFeedbackId: string | undefined): {
9
+ /**
10
+ * The operator's feedback queries: every reporter's items while `active`, the open one with its
11
+ * conversation, and the status change and reply, each resolving once both are refetched.
12
+ */
13
+ declare function useFeedbackOperatorController(config: FeedbackOperatorControllerConfig, openFeedbackId: string | undefined, active?: boolean): {
6
14
  getAttachmentUrl: (feedbackId: string, attachmentId: string) => Promise<string>;
7
- itemQuery: import("@tanstack/react-query/build/legacy").UseQueryResult<NoInfer<{
8
- status: "in_progress" | "completed" | "received" | "discussion_required" | "no_action" | "withdrawn";
15
+ itemQuery: UseQueryResult<NoInfer<{
16
+ status: "received" | "in_progress" | "discussion_required" | "completed" | "no_action" | "withdrawn";
9
17
  type: "general" | "bug" | "feature";
10
18
  description: string;
11
19
  id: string;
12
- createdAt: string;
13
20
  subject: string;
14
21
  urgency: "normal" | "emergency";
22
+ createdAt: string;
15
23
  updatedAt: string;
16
24
  reporterEmail: string | null;
17
25
  canReply: boolean;
@@ -34,26 +42,29 @@ declare function useFeedbackOperatorController(config: FeedbackOperatorControlle
34
42
  editedAt_epoch_milliseconds: number | null;
35
43
  }[];
36
44
  }>, Error>;
37
- itemsQuery: import("@tanstack/react-query/build/legacy").UseQueryResult<NoInfer<{
38
- status: "in_progress" | "completed" | "received" | "discussion_required" | "no_action" | "withdrawn";
45
+ itemsQuery: UseQueryResult<NoInfer<{
46
+ status: "received" | "in_progress" | "discussion_required" | "completed" | "no_action" | "withdrawn";
39
47
  type: "general" | "bug" | "feature";
40
48
  description: string;
41
49
  id: string;
42
- createdAt: string;
43
50
  subject: string;
44
51
  urgency: "normal" | "emergency";
52
+ createdAt: string;
45
53
  updatedAt: string;
46
54
  reporterEmail: string | null;
47
55
  }[]>, Error>;
48
- messageMutation: import("@tanstack/react-query/build/legacy").UseMutationResult<import("./contract.js").FeedbackMessage, Error, string, unknown>;
49
- statusMutation: import("@tanstack/react-query/build/legacy").UseMutationResult<{
50
- status: "in_progress" | "completed" | "received" | "discussion_required" | "no_action" | "withdrawn";
56
+ messageMutation: import("@tanstack/react-query").UseMutationResult<import("./contract.js").FeedbackMessage, Error, {
57
+ feedbackId: string;
58
+ body: string;
59
+ }, unknown>;
60
+ statusMutation: import("@tanstack/react-query").UseMutationResult<{
61
+ status: "received" | "in_progress" | "discussion_required" | "completed" | "no_action" | "withdrawn";
51
62
  type: "general" | "bug" | "feature";
52
63
  description: string;
53
64
  id: string;
54
- createdAt: string;
55
65
  subject: string;
56
66
  urgency: "normal" | "emergency";
67
+ createdAt: string;
57
68
  updatedAt: string;
58
69
  reporterEmail: string | null;
59
70
  canReply: boolean;
@@ -75,6 +86,14 @@ declare function useFeedbackOperatorController(config: FeedbackOperatorControlle
75
86
  createdAt_epoch_milliseconds: number;
76
87
  editedAt_epoch_milliseconds: number | null;
77
88
  }[];
78
- }, Error, "in_progress" | "completed" | "received" | "discussion_required" | "no_action", unknown>;
89
+ }, Error, {
90
+ feedbackId: string;
91
+ status: FeedbackTriageStatus;
92
+ }, unknown>;
79
93
  };
80
- export { type FeedbackOperatorControllerConfig, useFeedbackOperatorController };
94
+ /**
95
+ * The feedback sheet's `operator` tab, run against the API: pass it while the viewer answers
96
+ * feedback, with `active` while the sheet is open.
97
+ */
98
+ declare function useFeedbackOperatorSheet(config: FeedbackOperatorControllerConfig, active: boolean): FeedbackOperatorProps;
99
+ export { type FeedbackOperatorControllerConfig, useFeedbackOperatorController, useFeedbackOperatorSheet, };
@@ -2,7 +2,11 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
2
2
  import * as React from "react";
3
3
  import { createFeedbackOperatorClient } from "./operator-client.js";
4
4
  import { requireConfig } from "./require-config.js";
5
- function useFeedbackOperatorController(config, selectedFeedbackId) {
5
+ /**
6
+ * The operator's feedback queries: every reporter's items while `active`, the open one with its
7
+ * conversation, and the status change and reply, each resolving once both are refetched.
8
+ */
9
+ function useFeedbackOperatorController(config, openFeedbackId, active = true) {
6
10
  const { baseUrl, cacheScope: configuredCacheScope, getBearerToken } = config;
7
11
  const client = React.useMemo(() => createFeedbackOperatorClient({ baseUrl, getBearerToken }), [baseUrl, getBearerToken]);
8
12
  const cacheScope = requireConfig(configuredCacheScope, "cacheScope");
@@ -11,21 +15,23 @@ function useFeedbackOperatorController(config, selectedFeedbackId) {
11
15
  const itemsQuery = useQuery({
12
16
  queryKey: [...queryRoot, "items"],
13
17
  queryFn: ({ signal }) => client.list({ signal }),
18
+ enabled: active,
14
19
  retry: false,
15
20
  });
16
21
  const itemQuery = useQuery({
17
- queryKey: [...queryRoot, "item", selectedFeedbackId],
18
- queryFn: ({ signal }) => client.get(requireSelectedFeedbackId(selectedFeedbackId), { signal }),
19
- enabled: selectedFeedbackId !== undefined,
22
+ queryKey: [...queryRoot, "item", openFeedbackId],
23
+ queryFn: ({ signal }) => client.get(requireOpenFeedbackId(openFeedbackId), { signal }),
24
+ enabled: active && openFeedbackId !== undefined,
20
25
  retry: false,
21
26
  });
27
+ const refresh = () => queryClient.invalidateQueries({ queryKey: queryRoot });
22
28
  const statusMutation = useMutation({
23
- mutationFn: (status) => client.updateStatus(requireSelectedFeedbackId(selectedFeedbackId), status),
24
- onSuccess: async () => queryClient.invalidateQueries({ queryKey: queryRoot }),
29
+ mutationFn: ({ feedbackId, status }) => client.updateStatus(feedbackId, status),
30
+ onSuccess: refresh,
25
31
  });
26
32
  const messageMutation = useMutation({
27
- mutationFn: (body) => client.createMessage(requireSelectedFeedbackId(selectedFeedbackId), body),
28
- onSuccess: async () => queryClient.invalidateQueries({ queryKey: queryRoot }),
33
+ mutationFn: ({ feedbackId, body }) => client.createMessage(feedbackId, body),
34
+ onSuccess: refresh,
29
35
  });
30
36
  return {
31
37
  getAttachmentUrl: (feedbackId, attachmentId) => client.getAttachmentUrl(feedbackId, attachmentId),
@@ -35,9 +41,36 @@ function useFeedbackOperatorController(config, selectedFeedbackId) {
35
41
  statusMutation,
36
42
  };
37
43
  }
38
- function requireSelectedFeedbackId(feedbackId) {
44
+ /**
45
+ * The feedback sheet's `operator` tab, run against the API: pass it while the viewer answers
46
+ * feedback, with `active` while the sheet is open.
47
+ */
48
+ function useFeedbackOperatorSheet(config, active) {
49
+ const [openFeedbackId, setOpenFeedbackId] = React.useState();
50
+ const { itemsQuery, itemQuery, messageMutation, statusMutation } = useFeedbackOperatorController(config, openFeedbackId, active);
51
+ return {
52
+ items: toLoadState(itemsQuery),
53
+ onOpenItem: setOpenFeedbackId,
54
+ item: openFeedbackId === undefined ? undefined : toLoadState(itemQuery),
55
+ onReply: async (feedbackId, body) => {
56
+ await messageMutation.mutateAsync({ feedbackId, body });
57
+ },
58
+ onStatusChange: async (feedbackId, status) => {
59
+ await statusMutation.mutateAsync({ feedbackId, status });
60
+ },
61
+ };
62
+ }
63
+ /** A query as the sheet reads it: loading until its first answer, then its data or failure. */
64
+ function toLoadState(query) {
65
+ if (query.isPending)
66
+ return { status: "loading" };
67
+ if (query.isError)
68
+ return { status: "error", error: query.error, retry: () => void query.refetch() };
69
+ return { status: "loaded", data: query.data };
70
+ }
71
+ function requireOpenFeedbackId(feedbackId) {
39
72
  if (feedbackId === undefined)
40
- throw new Error("Select feedback before changing it.");
73
+ throw new Error("Open feedback before loading it.");
41
74
  return feedbackId;
42
75
  }
43
- export { useFeedbackOperatorController };
76
+ export { useFeedbackOperatorController, useFeedbackOperatorSheet, };