@rise-x/apps-sdk 0.6.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.
Files changed (185) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +553 -0
  3. package/build/_internal.d.ts +2 -0
  4. package/build/_internal.js +23 -0
  5. package/build/accessors.d.ts +8 -0
  6. package/build/accessors.js +40 -0
  7. package/build/cli/index.d.ts +13 -0
  8. package/build/cli/index.js +54 -0
  9. package/build/cli/init.d.ts +6 -0
  10. package/build/cli/init.js +179 -0
  11. package/build/cli/templating.d.ts +2 -0
  12. package/build/cli/templating.js +84 -0
  13. package/build/connectors/agents.d.ts +85 -0
  14. package/build/connectors/agents.js +404 -0
  15. package/build/connectors/assets.d.ts +76 -0
  16. package/build/connectors/assets.js +204 -0
  17. package/build/connectors/deps.d.ts +4 -0
  18. package/build/connectors/deps.js +2 -0
  19. package/build/connectors/errors.d.ts +11 -0
  20. package/build/connectors/errors.js +67 -0
  21. package/build/connectors/flows.d.ts +37 -0
  22. package/build/connectors/flows.js +191 -0
  23. package/build/connectors/index.d.ts +8 -0
  24. package/build/connectors/index.js +50 -0
  25. package/build/connectors/sse.d.ts +12 -0
  26. package/build/connectors/sse.js +157 -0
  27. package/build/connectors/types.d.ts +285 -0
  28. package/build/connectors/types.js +419 -0
  29. package/build/connectors/work.d.ts +84 -0
  30. package/build/connectors/work.js +224 -0
  31. package/build/hooks.d.ts +4 -0
  32. package/build/hooks.js +28 -0
  33. package/build/index.d.ts +6 -0
  34. package/build/index.js +34 -0
  35. package/build/lifecycle.d.ts +23 -0
  36. package/build/lifecycle.js +6 -0
  37. package/build/mockShell.d.ts +10 -0
  38. package/build/mockShell.js +55 -0
  39. package/build/query/agents.d.ts +80 -0
  40. package/build/query/agents.js +143 -0
  41. package/build/query/assets.d.ts +73 -0
  42. package/build/query/assets.js +152 -0
  43. package/build/query/client.d.ts +5 -0
  44. package/build/query/client.js +68 -0
  45. package/build/query/context.d.ts +2 -0
  46. package/build/query/context.js +34 -0
  47. package/build/query/flows.d.ts +54 -0
  48. package/build/query/flows.js +81 -0
  49. package/build/query/index.d.ts +10 -0
  50. package/build/query/index.js +85 -0
  51. package/build/query/keys.d.ts +51 -0
  52. package/build/query/keys.js +79 -0
  53. package/build/query/layer.d.ts +175 -0
  54. package/build/query/layer.js +35 -0
  55. package/build/query/shared.d.ts +43 -0
  56. package/build/query/shared.js +116 -0
  57. package/build/query/work.d.ts +75 -0
  58. package/build/query/work.js +172 -0
  59. package/build/shell/index.d.ts +1 -0
  60. package/build/shell/index.js +6 -0
  61. package/build/shell/installShellBridge.d.ts +11 -0
  62. package/build/shell/installShellBridge.js +104 -0
  63. package/build/shellBridge.d.ts +36 -0
  64. package/build/shellBridge.js +10 -0
  65. package/build/topBar.d.ts +25 -0
  66. package/build/topBar.js +17 -0
  67. package/build/ui/components/ai.d.ts +49 -0
  68. package/build/ui/components/alert-dialog.d.ts +27 -0
  69. package/build/ui/components/alert.d.ts +14 -0
  70. package/build/ui/components/avatar.d.ts +17 -0
  71. package/build/ui/components/badge.d.ts +19 -0
  72. package/build/ui/components/button.d.ts +13 -0
  73. package/build/ui/components/calendar.d.ts +21 -0
  74. package/build/ui/components/card.d.ts +16 -0
  75. package/build/ui/components/chart.d.ts +124 -0
  76. package/build/ui/components/checkbox.d.ts +4 -0
  77. package/build/ui/components/data-table.d.ts +70 -0
  78. package/build/ui/components/dialog.d.ts +17 -0
  79. package/build/ui/components/dropdown-menu.d.ts +29 -0
  80. package/build/ui/components/empty-state.d.ts +7 -0
  81. package/build/ui/components/file-upload.d.ts +17 -0
  82. package/build/ui/components/input.d.ts +8 -0
  83. package/build/ui/components/label.d.ts +4 -0
  84. package/build/ui/components/list.d.ts +24 -0
  85. package/build/ui/components/map.d.ts +26 -0
  86. package/build/ui/components/message.d.ts +24 -0
  87. package/build/ui/components/nav.d.ts +12 -0
  88. package/build/ui/components/page-header.d.ts +27 -0
  89. package/build/ui/components/popover.d.ts +10 -0
  90. package/build/ui/components/progress.d.ts +4 -0
  91. package/build/ui/components/radio.d.ts +6 -0
  92. package/build/ui/components/resizable.d.ts +7 -0
  93. package/build/ui/components/scroll-area.d.ts +5 -0
  94. package/build/ui/components/segmented.d.ts +6 -0
  95. package/build/ui/components/select.d.ts +15 -0
  96. package/build/ui/components/separator.d.ts +4 -0
  97. package/build/ui/components/sheet.d.ts +14 -0
  98. package/build/ui/components/skeleton.d.ts +3 -0
  99. package/build/ui/components/slider.d.ts +15 -0
  100. package/build/ui/components/snackbar.d.ts +3 -0
  101. package/build/ui/components/sonner.d.ts +4 -0
  102. package/build/ui/components/spinner.d.ts +5 -0
  103. package/build/ui/components/statistic.d.ts +19 -0
  104. package/build/ui/components/stepper.d.ts +12 -0
  105. package/build/ui/components/switch.d.ts +6 -0
  106. package/build/ui/components/table.d.ts +24 -0
  107. package/build/ui/components/textarea.d.ts +3 -0
  108. package/build/ui/components/timeline.d.ts +15 -0
  109. package/build/ui/components/toggle-group.d.ts +10 -0
  110. package/build/ui/components/toggle.d.ts +9 -0
  111. package/build/ui/components/tooltip.d.ts +7 -0
  112. package/build/ui/index.d.ts +46 -0
  113. package/build/ui/index.js +8 -0
  114. package/build/ui/lib/utils.d.ts +2 -0
  115. package/build/ui/reference/README.md +11 -0
  116. package/build/ui/reference/components/ai.tsx +291 -0
  117. package/build/ui/reference/components/alert-dialog.tsx +208 -0
  118. package/build/ui/reference/components/alert.tsx +112 -0
  119. package/build/ui/reference/components/avatar.tsx +158 -0
  120. package/build/ui/reference/components/badge.tsx +160 -0
  121. package/build/ui/reference/components/button.tsx +100 -0
  122. package/build/ui/reference/components/calendar.tsx +119 -0
  123. package/build/ui/reference/components/card.tsx +144 -0
  124. package/build/ui/reference/components/chart.tsx +1394 -0
  125. package/build/ui/reference/components/checkbox.tsx +44 -0
  126. package/build/ui/reference/components/data-table.tsx +480 -0
  127. package/build/ui/reference/components/dialog.tsx +172 -0
  128. package/build/ui/reference/components/dropdown-menu.tsx +245 -0
  129. package/build/ui/reference/components/empty-state.tsx +63 -0
  130. package/build/ui/reference/components/file-upload.tsx +116 -0
  131. package/build/ui/reference/components/input.tsx +114 -0
  132. package/build/ui/reference/components/label.tsx +19 -0
  133. package/build/ui/reference/components/list.tsx +191 -0
  134. package/build/ui/reference/components/map.css +251 -0
  135. package/build/ui/reference/components/map.tsx +294 -0
  136. package/build/ui/reference/components/message.tsx +171 -0
  137. package/build/ui/reference/components/nav.tsx +113 -0
  138. package/build/ui/reference/components/page-header.tsx +213 -0
  139. package/build/ui/reference/components/popover.tsx +76 -0
  140. package/build/ui/reference/components/progress.tsx +31 -0
  141. package/build/ui/reference/components/radio.tsx +65 -0
  142. package/build/ui/reference/components/resizable.tsx +40 -0
  143. package/build/ui/reference/components/scroll-area.tsx +55 -0
  144. package/build/ui/reference/components/segmented.tsx +45 -0
  145. package/build/ui/reference/components/select.tsx +185 -0
  146. package/build/ui/reference/components/separator.tsx +26 -0
  147. package/build/ui/reference/components/sheet.tsx +173 -0
  148. package/build/ui/reference/components/skeleton.tsx +15 -0
  149. package/build/ui/reference/components/slider.tsx +161 -0
  150. package/build/ui/reference/components/snackbar.tsx +27 -0
  151. package/build/ui/reference/components/sonner.tsx +43 -0
  152. package/build/ui/reference/components/spinner.tsx +27 -0
  153. package/build/ui/reference/components/statistic.tsx +122 -0
  154. package/build/ui/reference/components/stepper.tsx +138 -0
  155. package/build/ui/reference/components/switch.tsx +47 -0
  156. package/build/ui/reference/components/table.tsx +233 -0
  157. package/build/ui/reference/components/textarea.tsx +28 -0
  158. package/build/ui/reference/components/timeline.tsx +94 -0
  159. package/build/ui/reference/components/toggle-group.tsx +86 -0
  160. package/build/ui/reference/components/toggle.tsx +46 -0
  161. package/build/ui/reference/components/tooltip.tsx +53 -0
  162. package/build/ui/reference/index.ts +49 -0
  163. package/build/ui/reference/lib/utils.ts +34 -0
  164. package/build/ui/standalone-stub.js +5 -0
  165. package/build/ui/standalone.js +135 -0
  166. package/build/ui/styles.css +3 -0
  167. package/connectors/package.json +8 -0
  168. package/package.json +114 -0
  169. package/query/package.json +8 -0
  170. package/shell/package.json +8 -0
  171. package/template/AGENTS.md +70 -0
  172. package/template/CLAUDE.md +4 -0
  173. package/template/README.md +102 -0
  174. package/template/_gitignore +6 -0
  175. package/template/commitlint.config.js +12 -0
  176. package/template/package.json +31 -0
  177. package/template/public/index.html +13 -0
  178. package/template/src/App.tsx +171 -0
  179. package/template/src/bootstrap.tsx +13 -0
  180. package/template/src/index.tsx +1 -0
  181. package/template/src/lifecycle.ts +20 -0
  182. package/template/tsconfig.json +31 -0
  183. package/template/webpack.config.js +112 -0
  184. package/template/webpack.local.config.js +68 -0
  185. package/ui/package.json +8 -0
@@ -0,0 +1,75 @@
1
+ import { type InfiniteData, type UseInfiniteQueryResult, type UseQueryResult } from "@tanstack/react-query";
2
+ import { type ListRelatedWorkArgs, type ListWorkRowsArgs, type StartWorkArgs, type SubmitWorkArgs, type WorkConnector, type WorkDataPatch, type WorkRowPage } from "../connectors/work";
3
+ import type { ConnectorError } from "../connectors/errors";
4
+ import type { WorkAuditEvent, WorkDetail, WorkRow } from "../connectors/types";
5
+ import { type QueryEnvId } from "./keys";
6
+ import { type SdkMutationOptions, type SdkQueryOptions } from "./shared";
7
+ export type ListWorkRowsQueryArgs = Omit<ListWorkRowsArgs, "skip" | "signal">;
8
+ export type ListRelatedWorkQueryArgs = Omit<ListRelatedWorkArgs, "signal">;
9
+ export declare function dedupeRows<T extends {
10
+ id: string;
11
+ }>(data: InfiniteData<{
12
+ items: T[];
13
+ }> | undefined): T[];
14
+ export declare function createWorkQueries(connector: WorkConnector, getEnvId: () => QueryEnvId): {
15
+ detail: (workId: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<WorkDetail, Error, WorkDetail, readonly ["rise-apps-sdk", QueryEnvId, "work", "detail", string]>, "queryFn"> & {
16
+ queryFn?: import("@tanstack/react-query").QueryFunction<WorkDetail, readonly ["rise-apps-sdk", QueryEnvId, "work", "detail", string], never> | undefined;
17
+ } & {
18
+ queryKey: import("@tanstack/react-query").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "work", "detail", string], WorkDetail>;
19
+ };
20
+ data: (workId: string, opts?: {
21
+ path?: string;
22
+ }) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<unknown, Error, unknown, readonly ["rise-apps-sdk", QueryEnvId, "work", "data", string, string | null]>, "queryFn"> & {
23
+ queryFn?: import("@tanstack/react-query").QueryFunction<unknown, readonly ["rise-apps-sdk", QueryEnvId, "work", "data", string, string | null], never> | undefined;
24
+ } & {
25
+ queryKey: import("@tanstack/react-query").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "work", "data", string, string | null], unknown>;
26
+ };
27
+ rows: (args: ListWorkRowsQueryArgs) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseInfiniteQueryOptions<WorkRowPage, Error, InfiniteData<WorkRowPage, unknown>, WorkRowPage, readonly ["rise-apps-sdk", QueryEnvId, "work", "rows", {
28
+ [x: string]: unknown;
29
+ }], number>, "queryFn"> & {
30
+ queryFn?: import("@tanstack/react-query").QueryFunction<WorkRowPage, readonly ["rise-apps-sdk", QueryEnvId, "work", "rows", {
31
+ [x: string]: unknown;
32
+ }], number> | undefined;
33
+ } & {
34
+ queryKey: import("@tanstack/react-query").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "work", "rows", {
35
+ [x: string]: unknown;
36
+ }], InfiniteData<WorkRowPage, unknown>>;
37
+ };
38
+ related: (args: ListRelatedWorkQueryArgs) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<WorkRow[], Error, WorkRow[], readonly ["rise-apps-sdk", QueryEnvId, "work", "related", {
39
+ [x: string]: unknown;
40
+ }]>, "queryFn"> & {
41
+ queryFn?: import("@tanstack/react-query").QueryFunction<WorkRow[], readonly ["rise-apps-sdk", QueryEnvId, "work", "related", {
42
+ [x: string]: unknown;
43
+ }], never> | undefined;
44
+ } & {
45
+ queryKey: import("@tanstack/react-query").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "work", "related", {
46
+ [x: string]: unknown;
47
+ }], WorkRow[]>;
48
+ };
49
+ audit: (workId: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<WorkAuditEvent[], Error, WorkAuditEvent[], readonly ["rise-apps-sdk", QueryEnvId, "work", "audit", string]>, "queryFn"> & {
50
+ queryFn?: import("@tanstack/react-query").QueryFunction<WorkAuditEvent[], readonly ["rise-apps-sdk", QueryEnvId, "work", "audit", string], never> | undefined;
51
+ } & {
52
+ queryKey: import("@tanstack/react-query").DataTag<readonly ["rise-apps-sdk", QueryEnvId, "work", "audit", string], WorkAuditEvent[]>;
53
+ };
54
+ };
55
+ export type WorkQueries = ReturnType<typeof createWorkQueries>;
56
+ export declare const workQueries: WorkQueries;
57
+ export declare function useWork(workId: string, options?: SdkQueryOptions): UseQueryResult<WorkDetail, ConnectorError>;
58
+ export declare function useWorkData(workId: string, opts?: {
59
+ path?: string;
60
+ }, options?: SdkQueryOptions): UseQueryResult<unknown, ConnectorError>;
61
+ export declare function useWorkRows(args: ListWorkRowsQueryArgs, options?: SdkQueryOptions): UseInfiniteQueryResult<InfiniteData<WorkRowPage>, ConnectorError>;
62
+ export declare function useRelatedWork(args: ListRelatedWorkQueryArgs, options?: SdkQueryOptions): UseQueryResult<WorkRow[], ConnectorError>;
63
+ export declare function useWorkAudit(workId: string, options?: SdkQueryOptions): UseQueryResult<WorkAuditEvent[], ConnectorError>;
64
+ export type StartWorkVariables = Omit<StartWorkArgs, "signal">;
65
+ export declare function useStartWork(options?: SdkMutationOptions<WorkDetail, StartWorkVariables>): import("@tanstack/react-query").UseMutationResult<WorkDetail, ConnectorError, StartWorkVariables, unknown>;
66
+ export type PatchWorkDataVariables = {
67
+ workId: string;
68
+ } & Omit<WorkDataPatch, "signal">;
69
+ export declare function usePatchWorkData(options?: SdkMutationOptions<unknown, PatchWorkDataVariables>): import("@tanstack/react-query").UseMutationResult<unknown, ConnectorError, PatchWorkDataVariables, unknown>;
70
+ export type SubmitWorkVariables = Omit<SubmitWorkArgs, "signal">;
71
+ export declare function useSubmitWork(options?: SdkMutationOptions<WorkDetail, SubmitWorkVariables>): import("@tanstack/react-query").UseMutationResult<WorkDetail, ConnectorError, SubmitWorkVariables, unknown>;
72
+ export interface DeleteWorkVariables {
73
+ workId: string;
74
+ }
75
+ export declare function useDeleteWork(options?: SdkMutationOptions<void, DeleteWorkVariables>): import("@tanstack/react-query").UseMutationResult<void, ConnectorError, DeleteWorkVariables, unknown>;
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.workQueries = void 0;
4
+ exports.dedupeRows = dedupeRows;
5
+ exports.createWorkQueries = createWorkQueries;
6
+ exports.useWork = useWork;
7
+ exports.useWorkData = useWorkData;
8
+ exports.useWorkRows = useWorkRows;
9
+ exports.useRelatedWork = useRelatedWork;
10
+ exports.useWorkAudit = useWorkAudit;
11
+ exports.useStartWork = useStartWork;
12
+ exports.usePatchWorkData = usePatchWorkData;
13
+ exports.useSubmitWork = useSubmitWork;
14
+ exports.useDeleteWork = useDeleteWork;
15
+ // Work domain: queryOptions factories, hooks, and the work mutations with
16
+ // their cache-consistency rules. Built-in invalidation runs before the
17
+ // caller's onSuccess — composed, never replaced.
18
+ const react_query_1 = require("@tanstack/react-query");
19
+ const work_1 = require("../connectors/work");
20
+ const keys_1 = require("./keys");
21
+ const shared_1 = require("./shared");
22
+ // Flatten an infinite rows result, dropping cross-page duplicates: sort-shifted
23
+ // pages can repeat rows (same reason work.iterate dedupes on id).
24
+ function dedupeRows(data) {
25
+ if (!data)
26
+ return [];
27
+ const seen = new Set();
28
+ const out = [];
29
+ for (const page of data.pages) {
30
+ for (const row of page.items) {
31
+ if (seen.has(row.id))
32
+ continue;
33
+ seen.add(row.id);
34
+ out.push(row);
35
+ }
36
+ }
37
+ return out;
38
+ }
39
+ function createWorkQueries(connector, getEnvId) {
40
+ return {
41
+ detail: (workId) => {
42
+ const envId = getEnvId();
43
+ return (0, react_query_1.queryOptions)({
44
+ queryKey: keys_1.queryKeys.work.detail(envId, workId),
45
+ queryFn: ({ signal }) => connector.get(workId, { signal }),
46
+ enabled: envId != null && !!workId,
47
+ });
48
+ },
49
+ data: (workId, opts = {}) => {
50
+ const envId = getEnvId();
51
+ return (0, react_query_1.queryOptions)({
52
+ queryKey: keys_1.queryKeys.work.data(envId, workId, opts.path),
53
+ queryFn: ({ signal }) => connector.getData(workId, { path: opts.path, signal }),
54
+ enabled: envId != null && !!workId,
55
+ });
56
+ },
57
+ // Infinite skip-paged listing — see shared.ts's getNextRowsPageParam for
58
+ // the shift-safe advance rule (mirrors work.iterate). Render with
59
+ // dedupeRows(data).
60
+ rows: (args) => {
61
+ const envId = getEnvId();
62
+ return (0, react_query_1.infiniteQueryOptions)({
63
+ queryKey: keys_1.queryKeys.work.rows(envId, (0, keys_1.normalizeArgs)({ ...args, flow: (0, work_1.resolveFlowRef)(args.flow) })),
64
+ queryFn: ({ pageParam, signal }) => connector.list({ ...args, skip: pageParam, signal }),
65
+ initialPageParam: 0,
66
+ getNextPageParam: shared_1.getNextRowsPageParam,
67
+ enabled: envId != null && args.flow != null,
68
+ });
69
+ },
70
+ related: (args) => {
71
+ const envId = getEnvId();
72
+ return (0, react_query_1.queryOptions)({
73
+ queryKey: keys_1.queryKeys.work.related(envId, (0, keys_1.normalizeArgs)(args)),
74
+ queryFn: ({ signal }) => connector.listRelated({ ...args, signal }),
75
+ enabled: envId != null && !!args.workId,
76
+ });
77
+ },
78
+ audit: (workId) => {
79
+ const envId = getEnvId();
80
+ return (0, react_query_1.queryOptions)({
81
+ queryKey: keys_1.queryKeys.work.audit(envId, workId),
82
+ queryFn: ({ signal }) => connector.getAudit(workId, { signal }),
83
+ enabled: envId != null && !!workId,
84
+ });
85
+ },
86
+ };
87
+ }
88
+ // Ready-made singleton bound to the live shell bridge — same construction
89
+ // createQueryLayer() uses, just against the live connector singleton.
90
+ exports.workQueries = createWorkQueries(work_1.work, shared_1.getLiveEnvId);
91
+ // ---- hooks ----
92
+ function useWork(workId, options) {
93
+ return (0, shared_1.useSdkQuery)(exports.workQueries.detail(workId), options);
94
+ }
95
+ function useWorkData(workId, opts, options) {
96
+ return (0, shared_1.useSdkQuery)(exports.workQueries.data(workId, opts), options);
97
+ }
98
+ // Infinite skip-paged listing; flatten pages with dedupeRows(data).
99
+ function useWorkRows(args, options) {
100
+ return (0, shared_1.useSdkInfiniteQuery)(exports.workQueries.rows(args), options);
101
+ }
102
+ function useRelatedWork(args, options) {
103
+ return (0, shared_1.useSdkQuery)(exports.workQueries.related(args), options);
104
+ }
105
+ function useWorkAudit(workId, options) {
106
+ return (0, shared_1.useSdkQuery)(exports.workQueries.audit(workId), options);
107
+ }
108
+ function useStartWork(options) {
109
+ return (0, shared_1.useSdkMutation)((vars) => work_1.work.start(vars), (client) => {
110
+ const envId = (0, shared_1.getLiveEnvId)();
111
+ void client.invalidateQueries({
112
+ queryKey: keys_1.queryKeys.work.allRows(envId),
113
+ });
114
+ }, options);
115
+ }
116
+ function usePatchWorkData(options) {
117
+ return (0, shared_1.useSdkMutation)(({ workId, ...patch }) => work_1.work.patchData(workId, patch), (client, _data, vars) => {
118
+ const envId = (0, shared_1.getLiveEnvId)();
119
+ void client.invalidateQueries({
120
+ queryKey: keys_1.queryKeys.work.dataAll(envId, vars.workId),
121
+ });
122
+ void client.invalidateQueries({
123
+ queryKey: keys_1.queryKeys.work.detail(envId, vars.workId),
124
+ });
125
+ // Row listings project data paths, so a data write can stale them.
126
+ void client.invalidateQueries({
127
+ queryKey: keys_1.queryKeys.work.allRows(envId),
128
+ });
129
+ }, options);
130
+ }
131
+ function useSubmitWork(options) {
132
+ return (0, shared_1.useSdkMutation)((vars) => work_1.work.submit(vars), (client, data, vars) => {
133
+ const envId = (0, shared_1.getLiveEnvId)();
134
+ client.setQueryData(keys_1.queryKeys.work.detail(envId, vars.workId), data);
135
+ void client.invalidateQueries({
136
+ queryKey: keys_1.queryKeys.work.dataAll(envId, vars.workId),
137
+ });
138
+ void client.invalidateQueries({
139
+ queryKey: keys_1.queryKeys.work.audit(envId, vars.workId),
140
+ });
141
+ void client.invalidateQueries({
142
+ queryKey: keys_1.queryKeys.work.relatedAll(envId),
143
+ });
144
+ void client.invalidateQueries({
145
+ queryKey: keys_1.queryKeys.work.allRows(envId),
146
+ });
147
+ // CROSS-DOMAIN: asset create/edit drafts materialize via work.submit —
148
+ // the whole assets scope goes stale. Over-broad but correct; only
149
+ // active asset queries actually refetch.
150
+ void client.invalidateQueries({ queryKey: keys_1.queryKeys.assets.all(envId) });
151
+ }, options);
152
+ }
153
+ function useDeleteWork(options) {
154
+ return (0, shared_1.useSdkMutation)((vars) => work_1.work.delete(vars.workId), (client, _data, vars) => {
155
+ const envId = (0, shared_1.getLiveEnvId)();
156
+ client.removeQueries({
157
+ queryKey: keys_1.queryKeys.work.detail(envId, vars.workId),
158
+ });
159
+ client.removeQueries({
160
+ queryKey: keys_1.queryKeys.work.dataAll(envId, vars.workId),
161
+ });
162
+ client.removeQueries({
163
+ queryKey: keys_1.queryKeys.work.audit(envId, vars.workId),
164
+ });
165
+ void client.invalidateQueries({
166
+ queryKey: keys_1.queryKeys.work.allRows(envId),
167
+ });
168
+ void client.invalidateQueries({
169
+ queryKey: keys_1.queryKeys.work.relatedAll(envId),
170
+ });
171
+ }, options);
172
+ }
@@ -0,0 +1 @@
1
+ export { installShellBridge, getMutableShell, type InstallShellBridgeOptions, type MutableShell, } from './installShellBridge';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMutableShell = exports.installShellBridge = void 0;
4
+ var installShellBridge_1 = require("./installShellBridge");
5
+ Object.defineProperty(exports, "installShellBridge", { enumerable: true, get: function () { return installShellBridge_1.installShellBridge; } });
6
+ Object.defineProperty(exports, "getMutableShell", { enumerable: true, get: function () { return installShellBridge_1.getMutableShell; } });
@@ -0,0 +1,11 @@
1
+ import type { DianaShell, ShellEnvironment, ShellNavigate, ShellUser } from "../shellBridge";
2
+ export interface MutableShell extends DianaShell {
3
+ _setUser(user: ShellUser | null): void;
4
+ _setEnvironment(env: ShellEnvironment | null): void;
5
+ _setNavigate(fn: ShellNavigate): void;
6
+ }
7
+ export type InstallShellBridgeOptions = Pick<DianaShell, "getApi" | "getApiV4"> & {
8
+ getAi?: DianaShell["getAi"];
9
+ };
10
+ export declare function installShellBridge(options: InstallShellBridgeOptions): void;
11
+ export declare function getMutableShell(): MutableShell | null;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.installShellBridge = installShellBridge;
4
+ exports.getMutableShell = getMutableShell;
5
+ const react_router_dom_1 = require("react-router-dom");
6
+ const shellBridge_1 = require("../shellBridge");
7
+ function createSubscribers() {
8
+ const listeners = new Set();
9
+ return {
10
+ add(l) {
11
+ listeners.add(l);
12
+ return () => listeners.delete(l);
13
+ },
14
+ emit(value) {
15
+ listeners.forEach((l) => l(value));
16
+ },
17
+ };
18
+ }
19
+ // Single cast point for every ShellNavigate we construct. The impl signature
20
+ // collapses NavigateFunction's two overloads (To + options, or delta); this
21
+ // helper documents that intentional widening.
22
+ function toShellNavigate(impl) {
23
+ return impl;
24
+ }
25
+ // Fallback when no router is installed (e.g. standalone dev). Only `replace`
26
+ // is honored — other NavigateOptions (state, preventScrollReset, etc.) can't
27
+ // be delivered without a router and are silently dropped.
28
+ const defaultNavigate = toShellNavigate((to, options) => {
29
+ if (typeof to === "number") {
30
+ window.history.go(to);
31
+ return;
32
+ }
33
+ const href = typeof to === "string" ? to : (0, react_router_dom_1.createPath)(to);
34
+ if (options?.replace)
35
+ window.location.replace(href);
36
+ else
37
+ window.location.assign(href);
38
+ });
39
+ // Equality guards on _setUser/_setEnvironment below — Zustand selectors in the
40
+ // shell keeper can emit new object refs with unchanged fields, which would
41
+ // otherwise cascade a re-render through every app subscribed to the bridge.
42
+ function isEqualUser(a, b) {
43
+ if (a === b)
44
+ return true;
45
+ if (!a || !b)
46
+ return false;
47
+ return a.id === b.id && a.name === b.name && a.email === b.email;
48
+ }
49
+ function isEqualEnvironment(a, b) {
50
+ if (a === b)
51
+ return true;
52
+ if (!a || !b)
53
+ return false;
54
+ return a.id === b.id && a.slug === b.slug && a.name === b.name;
55
+ }
56
+ function installShellBridge(options) {
57
+ if (window.__DIANA_SHELL__)
58
+ return;
59
+ const { getApi, getApiV4, getAi = () => null } = options;
60
+ let currentUser = null;
61
+ let currentEnvironment = null;
62
+ let navigate = defaultNavigate;
63
+ const userSubs = createSubscribers();
64
+ const envSubs = createSubscribers();
65
+ // Stable shim so apps can hold onto shell.navigate across re-renders —
66
+ // internally delegates to whichever NavigateFunction the router currently owns.
67
+ // Branch on typeof to pick the right overload instead of casting.
68
+ const navigateShim = toShellNavigate((to, opts) => {
69
+ if (typeof to === "number")
70
+ navigate(to);
71
+ else
72
+ navigate(to, opts);
73
+ });
74
+ const shell = {
75
+ version: shellBridge_1.SHELL_BRIDGE_VERSION,
76
+ getUser: () => currentUser,
77
+ getEnvironment: () => currentEnvironment,
78
+ subscribeUser: userSubs.add,
79
+ subscribeEnvironment: envSubs.add,
80
+ getApi,
81
+ getApiV4,
82
+ getAi,
83
+ navigate: navigateShim,
84
+ _setUser(user) {
85
+ if (isEqualUser(currentUser, user))
86
+ return;
87
+ currentUser = user;
88
+ userSubs.emit(user);
89
+ },
90
+ _setEnvironment(environment) {
91
+ if (isEqualEnvironment(currentEnvironment, environment))
92
+ return;
93
+ currentEnvironment = environment;
94
+ envSubs.emit(environment);
95
+ },
96
+ _setNavigate(fn) {
97
+ navigate = fn;
98
+ },
99
+ };
100
+ window.__DIANA_SHELL__ = shell;
101
+ }
102
+ function getMutableShell() {
103
+ return window.__DIANA_SHELL__ ?? null;
104
+ }
@@ -0,0 +1,36 @@
1
+ import type { AxiosInstance } from "axios";
2
+ import type { NavigateFunction } from "react-router-dom";
3
+ export interface ShellUser {
4
+ id: string;
5
+ name: string;
6
+ email?: string;
7
+ }
8
+ export interface ShellEnvironment {
9
+ id: string;
10
+ name: string;
11
+ slug: string;
12
+ }
13
+ export type ShellEventUnsubscribe = () => void;
14
+ export type ShellNavigate = NavigateFunction;
15
+ export type V4ApiKey = "apps" | "work" | "config" | "attachment";
16
+ export interface ShellAiApi {
17
+ baseUrl: string;
18
+ getHeaders(): Record<string, string>;
19
+ }
20
+ export interface DianaShell {
21
+ version: number;
22
+ getUser(): ShellUser | null;
23
+ getEnvironment(): ShellEnvironment | null;
24
+ subscribeUser(listener: (user: ShellUser | null) => void): ShellEventUnsubscribe;
25
+ subscribeEnvironment(listener: (environment: ShellEnvironment | null) => void): ShellEventUnsubscribe;
26
+ getApi(): AxiosInstance;
27
+ getApiV4(name: V4ApiKey): AxiosInstance;
28
+ getAi(): ShellAiApi | null;
29
+ navigate: ShellNavigate;
30
+ }
31
+ declare global {
32
+ interface Window {
33
+ __DIANA_SHELL__?: DianaShell;
34
+ }
35
+ }
36
+ export declare const SHELL_BRIDGE_VERSION = 3;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SHELL_BRIDGE_VERSION = void 0;
4
+ // Bumped to 3: adds getAi() exposing the rise-x-ai gateway. Additive — every v2
5
+ // member is unchanged, so v2-built apps keep working on a v3 host. Code must
6
+ // feature-detect (typeof shell.getAi === 'function') rather than compare
7
+ // versions; a v3 app on a v2 host then fails soft only when it touches AI.
8
+ // (v2 added the V4ApiKey arg to getApiV4.) requireShell() compares the host's
9
+ // shell.version against this constant and warns once on mismatch.
10
+ exports.SHELL_BRIDGE_VERSION = 3;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A top-bar action an app can inject into the shell's single top-bar zone.
3
+ *
4
+ * Bridge-safe: plain data plus an `onClick` callback, no ReactNode — so it
5
+ * survives the module-federation boundary between the shell and a remote app.
6
+ * `icon` is a data URL / http(s) URL (rendered as an <img>) or a short
7
+ * emoji/text prefix; the shell renders it best-effort.
8
+ */
9
+ export interface TopBarAction {
10
+ id: string;
11
+ label?: string;
12
+ icon?: string;
13
+ badge?: string | number;
14
+ disabled?: boolean;
15
+ onClick: () => void;
16
+ }
17
+ /**
18
+ * Register a batch of actions in the shell's top-bar zone; returns an
19
+ * unregister function — call it on unmount.
20
+ *
21
+ * Safe to call unconditionally: outside a shell that supports the zone
22
+ * (standalone dev, or an older host) it no-ops and returns a no-op unregister,
23
+ * so app code needs no feature-detection of its own.
24
+ */
25
+ export declare function registerTopBarActions(actions: TopBarAction[]): () => void;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerTopBarActions = registerTopBarActions;
4
+ const accessors_1 = require("./accessors");
5
+ /**
6
+ * Register a batch of actions in the shell's top-bar zone; returns an
7
+ * unregister function — call it on unmount.
8
+ *
9
+ * Safe to call unconditionally: outside a shell that supports the zone
10
+ * (standalone dev, or an older host) it no-ops and returns a no-op unregister,
11
+ * so app code needs no feature-detection of its own.
12
+ */
13
+ function registerTopBarActions(actions) {
14
+ const shell = (0, accessors_1.getShell)();
15
+ const register = shell?.registerTopBarActions;
16
+ return typeof register === "function" ? register(actions) : () => { };
17
+ }
@@ -0,0 +1,49 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare function AiMark({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
4
+ /** Secondary label, e.g. "AI matched". Sits beside the data, never on it. */
5
+ declare function AiNote({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
6
+ /**
7
+ * Wash for a row or card Diana touched. 2.5% — enough to group the row once the
8
+ * glyph and label are present, and deliberately not enough to compete with the
9
+ * data. No edge stripe: an edge reads as something stuck on the row.
10
+ */
11
+ declare function AiRow({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
12
+ /** Diana is working. The gradient is the signal; it stops when the work does. */
13
+ declare function AiWorking({ className, children, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
14
+ /**
15
+ * A value being computed. Replaces the text entirely — a half-rendered number
16
+ * is worse than no number — and stops the moment there is a value.
17
+ * `prefers-reduced-motion` freezes the sweep rather than looping it.
18
+ */
19
+ declare function AiShimmer({ className, children, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
20
+ declare const confidenceVariants: (props?: ({
21
+ level?: "high" | "medium" | "low" | null | undefined;
22
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
23
+ /**
24
+ * A THREE-SEGMENT METER plus the number, in a tinted pill — signal-bars, not a
25
+ * continuous progress bar. Two reasons: the segments are legible at a glance
26
+ * from across a table where a 52px bar is not, and a continuous bar invites
27
+ * comparison of 73% against 71% when the underlying score does not support that
28
+ * precision.
29
+ *
30
+ * Whenever there IS a figure the word ships with it, because "Medium" alone
31
+ * tells a reviewer nothing actionable. But a run may report only a level — no
32
+ * percentage is invented to fill the gap: omit `value` and the label reads
33
+ * "Medium confidence", segments unchanged.
34
+ */
35
+ declare function AiConfidence({ className, level, value, showLabel, ...props }: React.ComponentProps<'span'> & VariantProps<typeof confidenceVariants> & {
36
+ value?: number;
37
+ showLabel?: boolean;
38
+ }): React.JSX.Element;
39
+ declare const validationVariants: (props?: ({
40
+ result?: "passed" | "warning" | "failed" | null | undefined;
41
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
42
+ declare function AiValidation({ className, result, ...props }: React.ComponentProps<'span'> & VariantProps<typeof validationVariants>): React.JSX.Element;
43
+ declare function AiSuggestion({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
44
+ /** Reasoning stays collapsed by default: an explanation nobody asked for is
45
+ * noise, and one nobody can find is a black box. */
46
+ declare function AiExplain({ className, ...props }: React.ComponentProps<'details'>): React.JSX.Element;
47
+ declare function AiExplainSummary({ className, children, ...props }: React.ComponentProps<'summary'>): React.JSX.Element;
48
+ declare function AiExplainBody({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
49
+ export { AiMark, AiNote, AiRow, AiWorking, AiShimmer, AiConfidence, AiValidation, AiSuggestion, AiExplain, AiExplainSummary, AiExplainBody, confidenceVariants, validationVariants, };
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import { AlertDialog as AlertDialogPrimitive } from 'radix-ui';
3
+ declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
4
+ declare const AlertDialogTrigger: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
5
+ declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
6
+ declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
8
+ size?: "default" | "sm";
9
+ } & React.RefAttributes<HTMLDivElement>>;
10
+ declare const AlertDialogHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const AlertDialogFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const AlertDialogMedia: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
14
+ declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
15
+ declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & Pick<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & import("class-variance-authority").VariantProps<(props?: ({
16
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | "pill" | null | undefined;
17
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
18
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
19
+ asChild?: boolean;
20
+ }, "ref"> & React.RefAttributes<HTMLButtonElement>, "size" | "variant"> & React.RefAttributes<HTMLButtonElement>>;
21
+ declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & Pick<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & import("class-variance-authority").VariantProps<(props?: ({
22
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | "pill" | null | undefined;
23
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
24
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
25
+ asChild?: boolean;
26
+ }, "ref"> & React.RefAttributes<HTMLButtonElement>, "size" | "variant"> & React.RefAttributes<HTMLButtonElement>>;
27
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const alertVariants: (props?: ({
4
+ tone?: "warning" | "neutral" | "success" | "error" | "info" | "ai" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Alert({ className, tone, ...props }: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>): React.JSX.Element;
7
+ declare function AlertTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
8
+ declare function AlertDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
9
+ declare function Banner({ className, tone, ...props }: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>): React.JSX.Element;
10
+ declare const inlineVariants: (props?: ({
11
+ tone?: "warning" | "neutral" | "success" | "error" | "info" | "ai" | null | undefined;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
+ declare function InlineMessage({ className, tone, ...props }: React.ComponentProps<'span'> & VariantProps<typeof inlineVariants>): React.JSX.Element;
14
+ export { Alert, AlertTitle, AlertDescription, Banner, InlineMessage, alertVariants };
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { Avatar as AvatarPrimitive } from 'radix-ui';
3
+ declare const AVATAR_TONES: readonly ["neutral", "blue", "tango", "amber", "red", "slate", "ai"];
4
+ type AvatarTone = (typeof AVATAR_TONES)[number];
5
+ declare function Avatar({ className, size, tone, shape, style, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
6
+ size?: 'default' | 'sm' | 'lg';
7
+ /** Only tint when the avatar is the sole identifier — see the note above. */
8
+ tone?: AvatarTone;
9
+ /** `org` renders a rounded square. People are circles. */
10
+ shape?: 'circle' | 'org';
11
+ }): React.JSX.Element;
12
+ declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): React.JSX.Element;
13
+ declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): React.JSX.Element;
14
+ declare function AvatarBadge({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
15
+ declare function AvatarGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
16
+ declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
17
+ export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, AVATAR_TONES, type AvatarTone, };
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "link" | "warning" | "neutral" | "success" | "error" | "info" | "ai" | "default" | "outline" | "secondary" | "ghost" | "destructive" | "solid" | "count" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
7
+ asChild?: boolean;
8
+ }): React.JSX.Element;
9
+ declare function Tag({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
10
+ declare function Chip({ className, children, onRemove, removeLabel, ...props }: React.ComponentProps<'span'> & {
11
+ onRemove?: () => void;
12
+ removeLabel?: string;
13
+ }): React.JSX.Element;
14
+ declare const dotVariants: (props?: ({
15
+ tone?: "warning" | "neutral" | "success" | "error" | "info" | "ai" | null | undefined;
16
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
17
+ declare function StatusDot({ className, tone, ...props }: React.ComponentProps<'span'> & VariantProps<typeof dotVariants>): React.JSX.Element;
18
+ declare function StatusIndicator({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
19
+ export { Badge, badgeVariants, Tag, Chip, StatusDot, StatusIndicator };
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | "pill" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
8
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "tint" | "tint-brand" | "destructive" | "destructive-solid" | "brand" | "dashed" | "pill" | null | undefined;
9
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
11
+ asChild?: boolean;
12
+ }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
13
+ export { Button, buttonVariants };
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ export interface CalendarDay {
3
+ label: number;
4
+ /** Outside the displayed month. */
5
+ outside?: boolean;
6
+ today?: boolean;
7
+ /** Position within a selected range. */
8
+ range?: 'start' | 'in' | 'end';
9
+ }
10
+ declare function Calendar({ className, title, days, onPrev, onNext, onSelectDay, footer, ...props }: Omit<React.ComponentProps<'div'>, 'children'> & {
11
+ title: React.ReactNode;
12
+ days: CalendarDay[];
13
+ onPrev?: () => void;
14
+ onNext?: () => void;
15
+ /** Picks a day. Without it the grid is a read-only display and the days stop
16
+ * pretending to be pressable — an interactive-looking control that does
17
+ * nothing is worse than a static one. */
18
+ onSelectDay?: (day: CalendarDay, index: number) => void;
19
+ footer?: React.ReactNode;
20
+ }): React.JSX.Element;
21
+ export { Calendar };