@xenide-io/the-old-ui-theme 0.7.0 → 0.9.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 (109) hide show
  1. package/README.md +9 -10
  2. package/dist/{Chip-Cq3AiAji.d.mts → Chip-BzuNgJIa.d.mts} +81 -23
  3. package/dist/{Chip-Cq3AiAji.d.ts → Chip-BzuNgJIa.d.ts} +81 -23
  4. package/dist/{ai-message-blocknote-WABTHFY7.mjs → ai-message-blocknote-D4Z6DUCJ.mjs} +9 -3
  5. package/dist/chunk-2EO5VCXP.mjs +3912 -0
  6. package/dist/chunk-APKRZQRO.mjs +251 -0
  7. package/dist/chunk-BS7BZI5W.mjs +19 -0
  8. package/dist/chunk-IULORI3A.mjs +8 -0
  9. package/dist/index.d.mts +3 -3
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +997 -576
  12. package/dist/index.mjs +49 -45
  13. package/dist/suite.d.mts +157 -55
  14. package/dist/suite.d.ts +157 -55
  15. package/dist/suite.js +4249 -801
  16. package/dist/suite.mjs +2578 -594
  17. package/dist/theme-boot-P-oqKVZF.d.mts +74 -0
  18. package/dist/theme-boot-P-oqKVZF.d.ts +74 -0
  19. package/dist/theme-boot.d.mts +2 -0
  20. package/dist/theme-boot.d.ts +2 -0
  21. package/dist/theme-boot.js +44 -0
  22. package/dist/theme-boot.mjs +8 -0
  23. package/dist/ui.d.mts +5 -29
  24. package/dist/ui.d.ts +5 -29
  25. package/dist/ui.js +647 -352
  26. package/dist/ui.mjs +10 -12
  27. package/docs/README.md +34 -0
  28. package/docs/ai-quick-reference.md +56 -0
  29. package/docs/component-library-improvement-plan.md +751 -0
  30. package/docs/component-reference.md +81 -0
  31. package/docs/components.md +48 -0
  32. package/docs/demos.md +19 -0
  33. package/docs/installation.md +117 -0
  34. package/docs/suite-audit.md +34 -0
  35. package/docs/theme-token-reference.md +67 -0
  36. package/docs/themes.md +164 -0
  37. package/package.json +22 -21
  38. package/public/fonts/OpenRunde-Bold.woff2 +0 -0
  39. package/public/fonts/OpenRunde-Medium.woff2 +0 -0
  40. package/public/fonts/OpenRunde-Regular.woff2 +0 -0
  41. package/public/fonts/OpenRunde-Semibold.woff2 +0 -0
  42. package/scripts/package-smoke.mjs +43 -0
  43. package/src/app/globals.css +2 -1
  44. package/src/components/ui/Accordion.tsx +20 -6
  45. package/src/components/ui/Avatar.tsx +5 -3
  46. package/src/components/ui/Calendar.tsx +187 -63
  47. package/src/components/ui/Card.test.tsx +38 -0
  48. package/src/components/ui/Card.tsx +77 -14
  49. package/src/components/ui/CollapsibleSection.tsx +12 -4
  50. package/src/components/ui/CommandPalette.test.tsx +91 -4
  51. package/src/components/ui/CommandPalette.tsx +138 -128
  52. package/src/components/ui/EmptyState.tsx +2 -2
  53. package/src/components/ui/FormField.tsx +1 -1
  54. package/src/components/ui/Input.tsx +42 -18
  55. package/src/components/ui/Kbd.tsx +18 -3
  56. package/src/components/ui/Modal.tsx +3 -1
  57. package/src/components/ui/Progress.tsx +14 -5
  58. package/src/components/ui/SegmentedControl.tsx +2 -2
  59. package/src/components/ui/SettingsLayout.tsx +1 -1
  60. package/src/components/ui/Stat.tsx +3 -2
  61. package/src/components/ui/Table.tsx +8 -3
  62. package/src/components/ui/Tooltip.test.tsx +70 -1
  63. package/src/components/ui/Tooltip.tsx +53 -29
  64. package/src/components/ui/Typography.tsx +103 -49
  65. package/src/components/ui/avatar-stat.test.tsx +23 -0
  66. package/src/components/ui/calendar.test.tsx +88 -0
  67. package/src/components/ui/disclosure.test.tsx +39 -0
  68. package/src/components/ui/index.ts +44 -6
  69. package/src/components/ui/progress.test.tsx +15 -0
  70. package/src/components/ui/typography.test.tsx +26 -1
  71. package/src/styles/suite-skin.css +8 -2
  72. package/src/styles/themes.css +184 -68
  73. package/src/suite/components/ai-message-blocknote.tsx +13 -2
  74. package/src/suite/components/ai-panel.tsx +41 -10
  75. package/src/suite/components/app-switcher.test.tsx +21 -6
  76. package/src/suite/components/app-switcher.tsx +7 -11
  77. package/src/suite/components/suite-app-layout.tsx +12 -3
  78. package/src/suite/components/suite-bottom-nav.tsx +0 -1
  79. package/src/suite/components/suite-clients-projects-directory.test.tsx +71 -0
  80. package/src/suite/components/suite-clients-projects-directory.tsx +943 -0
  81. package/src/suite/components/suite-integration-picker.test.tsx +224 -0
  82. package/src/suite/components/suite-integration-picker.tsx +939 -0
  83. package/src/suite/components/suite-integration-rules.test.tsx +157 -0
  84. package/src/suite/components/suite-integration-rules.tsx +471 -0
  85. package/src/suite/components/suite-mobile-drawer.test.tsx +18 -2
  86. package/src/suite/components/suite-mobile-drawer.tsx +65 -98
  87. package/src/suite/components/suite-notification-bell.tsx +29 -4
  88. package/src/suite/components/suite-sidebar.tsx +25 -25
  89. package/src/suite/components/suite-skeleton.tsx +2 -2
  90. package/src/suite/components/suite-user-menu.tsx +9 -8
  91. package/src/suite/components/theme-provider.test.tsx +87 -3
  92. package/src/suite/components/theme-provider.tsx +144 -23
  93. package/src/suite/components/today-ui.tsx +79 -68
  94. package/src/suite/components/workspace-switcher.test.tsx +56 -0
  95. package/src/suite/components/workspace-switcher.tsx +3 -3
  96. package/src/suite/icons/app-accents.ts +12 -12
  97. package/src/suite/icons/glyphs.ts +6 -12
  98. package/src/suite/index.ts +27 -0
  99. package/src/suite/lib/apps.test.ts +9 -1
  100. package/src/suite/lib/apps.ts +14 -8
  101. package/src/suite/lib/cookies.ts +53 -0
  102. package/src/suite/lib/theme-boot.ts +32 -0
  103. package/src/suite/lib/theme-cookie.ts +7 -0
  104. package/src/suite/lib/use-sidebar-width.ts +5 -51
  105. package/dist/chunk-KDR6HI6F.mjs +0 -1075
  106. package/dist/chunk-NOI42JNZ.mjs +0 -151
  107. package/dist/chunk-VXISSXTB.mjs +0 -2564
  108. package/src/suite/lib/use-lock-mobile-page-zoom.test.tsx +0 -65
  109. package/src/suite/lib/use-lock-mobile-page-zoom.ts +0 -51
@@ -0,0 +1,224 @@
1
+ import { useState } from "react";
2
+ import {
3
+ cleanup,
4
+ render,
5
+ screen,
6
+ waitFor,
7
+ within,
8
+ } from "@testing-library/react";
9
+ import userEvent from "@testing-library/user-event";
10
+ import { afterEach, describe, expect, it, vi } from "vitest";
11
+ import { SuiteIntegrationPicker } from "@/suite/components/suite-integration-picker";
12
+
13
+ describe("SuiteIntegrationPicker", () => {
14
+ afterEach(cleanup);
15
+
16
+ it("matches search text against provider titles only", async () => {
17
+ const user = userEvent.setup();
18
+
19
+ render(
20
+ <SuiteIntegrationPicker
21
+ open
22
+ items={[
23
+ {
24
+ id: "google-calendar",
25
+ label: "Google Calendar",
26
+ description: "Events and scheduling",
27
+ authSchemes: ["OAUTH2"],
28
+ },
29
+ {
30
+ id: "linear",
31
+ label: "Linear",
32
+ description: "Calendar planning and issue tracking",
33
+ },
34
+ ]}
35
+ onClose={vi.fn()}
36
+ onConnect={vi.fn()}
37
+ />,
38
+ );
39
+
40
+ await user.type(
41
+ screen.getByRole("textbox", { name: "Search apps" }),
42
+ "calendar",
43
+ );
44
+
45
+ expect(screen.getByText("Google Calendar")).toBeInTheDocument();
46
+ expect(screen.queryByText("Linear")).not.toBeInTheDocument();
47
+ });
48
+
49
+ it("shows auth tags and passes the selected method to the connector", async () => {
50
+ const user = userEvent.setup();
51
+ const onConnect = vi.fn();
52
+
53
+ render(
54
+ <SuiteIntegrationPicker
55
+ open
56
+ items={[
57
+ {
58
+ id: "mixed-provider",
59
+ label: "Mixed provider",
60
+ description: "Supports multiple connection methods",
61
+ categories: ["calendar", "email"],
62
+ authSchemes: ["OAUTH2", "API_KEY"],
63
+ },
64
+ ]}
65
+ onClose={vi.fn()}
66
+ onConnect={onConnect}
67
+ />,
68
+ );
69
+
70
+ expect(screen.getByText("OAuth 2.0")).toBeInTheDocument();
71
+ expect(screen.getByText("API key")).toBeInTheDocument();
72
+ expect(screen.getByLabelText("Works with TurtleTime")).toBeInTheDocument();
73
+ expect(screen.getByLabelText("Works with Tides")).toBeInTheDocument();
74
+
75
+ await user.click(screen.getByRole("button", { name: "Connect" }));
76
+ await user.click(screen.getByRole("button", { name: /API key Select/ }));
77
+
78
+ expect(onConnect).toHaveBeenCalledWith(
79
+ expect.objectContaining({ id: "mixed-provider" }),
80
+ { auth_scheme: "API_KEY" },
81
+ );
82
+ });
83
+
84
+ it("loads and submits fields for a custom connection method", async () => {
85
+ const user = userEvent.setup();
86
+ const onConnect = vi.fn().mockResolvedValue(undefined);
87
+ const onFetchAuthFields = vi.fn().mockResolvedValue({
88
+ fields: [{ name: "api_key", label: "API key", type: "password" }],
89
+ auth_scheme: "API_KEY",
90
+ managed: false,
91
+ });
92
+
93
+ render(
94
+ <SuiteIntegrationPicker
95
+ open
96
+ items={[
97
+ {
98
+ id: "mixed-provider",
99
+ label: "Mixed provider",
100
+ description: "Supports multiple connection methods",
101
+ authSchemes: ["OAUTH2", "API_KEY"],
102
+ },
103
+ ]}
104
+ onClose={vi.fn()}
105
+ onConnect={onConnect}
106
+ onFetchAuthFields={onFetchAuthFields}
107
+ />,
108
+ );
109
+
110
+ await user.click(screen.getByRole("button", { name: "Connect" }));
111
+ await user.click(screen.getByRole("button", { name: /API key Select/ }));
112
+ await waitFor(() => expect(onFetchAuthFields).toHaveBeenCalled());
113
+ const apiKey = await screen.findByLabelText(/API key/);
114
+ await user.type(apiKey, "secret");
115
+ await user.click(screen.getByRole("button", { name: "Connect" }));
116
+
117
+ await waitFor(() =>
118
+ expect(onConnect).toHaveBeenCalledWith(
119
+ expect.objectContaining({ id: "mixed-provider" }),
120
+ { auth_scheme: "API_KEY", auth_fields: { api_key: "secret" } },
121
+ ),
122
+ );
123
+ expect(onFetchAuthFields).toHaveBeenCalledWith(
124
+ expect.objectContaining({ id: "mixed-provider" }),
125
+ "API_KEY",
126
+ );
127
+ });
128
+
129
+ it("supports keyboard category selection and restores focus to the control", async () => {
130
+ const user = userEvent.setup();
131
+
132
+ function Fixture() {
133
+ const [category, setCategory] = useState("all");
134
+ return (
135
+ <SuiteIntegrationPicker
136
+ open
137
+ category={category}
138
+ categories={["calendar", "email"]}
139
+ items={[]}
140
+ onCategoryChange={setCategory}
141
+ onClose={vi.fn()}
142
+ onConnect={vi.fn()}
143
+ />
144
+ );
145
+ }
146
+
147
+ render(<Fixture />);
148
+ const trigger = screen.getByRole("button", { name: "Filter by category" });
149
+ trigger.focus();
150
+ await user.keyboard("{ArrowDown}{ArrowDown}{Enter}");
151
+
152
+ expect(trigger).toHaveTextContent("Calendar");
153
+ expect(trigger).toHaveFocus();
154
+ expect(
155
+ screen.queryByRole("listbox", { name: "Integration categories" }),
156
+ ).not.toBeInTheDocument();
157
+
158
+ await user.keyboard("{Enter}");
159
+ expect(
160
+ screen.getByRole("textbox", { name: "Search categories" }),
161
+ ).toHaveFocus();
162
+ await user.keyboard("{Escape}");
163
+ expect(trigger).toHaveFocus();
164
+ });
165
+
166
+ it("announces connection errors for integrations without authentication", async () => {
167
+ const user = userEvent.setup();
168
+
169
+ render(
170
+ <SuiteIntegrationPicker
171
+ open
172
+ items={[
173
+ {
174
+ id: "broken-provider",
175
+ label: "Broken provider",
176
+ description: "Cannot currently connect",
177
+ },
178
+ ]}
179
+ onClose={vi.fn()}
180
+ onConnect={vi.fn().mockRejectedValue(new Error("Connection failed"))}
181
+ />,
182
+ );
183
+
184
+ await user.click(screen.getByRole("button", { name: "Connect" }));
185
+ expect(await screen.findByRole("alert")).toHaveTextContent(
186
+ "Connection failed",
187
+ );
188
+ });
189
+
190
+ it("confirms before disconnecting a connected app", async () => {
191
+ const user = userEvent.setup();
192
+ const onDisconnect = vi.fn();
193
+
194
+ render(
195
+ <SuiteIntegrationPicker
196
+ open
197
+ items={[]}
198
+ connectedItems={[
199
+ {
200
+ id: "google-calendar",
201
+ label: "Google Calendar",
202
+ description: "Events and scheduling",
203
+ },
204
+ ]}
205
+ onClose={vi.fn()}
206
+ onConnect={vi.fn()}
207
+ onDisconnect={onDisconnect}
208
+ />,
209
+ );
210
+
211
+ await user.click(screen.getByRole("button", { name: "Disconnect" }));
212
+ expect(onDisconnect).not.toHaveBeenCalled();
213
+
214
+ const confirmation = screen.getByRole("dialog", { name: "Disconnect app" });
215
+ expect(confirmation).toHaveTextContent("Disconnect Google Calendar?");
216
+ await user.click(
217
+ within(confirmation).getByRole("button", { name: "Disconnect app" }),
218
+ );
219
+
220
+ expect(onDisconnect).toHaveBeenCalledWith(
221
+ expect.objectContaining({ id: "google-calendar" }),
222
+ );
223
+ });
224
+ });