@tuturuuu/ui 0.6.1 → 0.7.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/CHANGELOG.md +25 -0
- package/README.md +3 -3
- package/biome.json +1 -1
- package/package.json +8 -8
- package/src/components/ui/calendar-app/components/calendar-connections.tsx +17 -13
- package/src/components/ui/calendar-app/components/connected-accounts-dialog.tsx +2 -5
- package/src/components/ui/calendar-app/components/use-calendar-connections-manager.ts +2 -5
- package/src/components/ui/calendar.test.tsx +24 -0
- package/src/components/ui/calendar.tsx +1 -0
- package/src/components/ui/date-time-picker.tsx +352 -234
- package/src/components/ui/finance/categories-tags-tabs.tsx +23 -1
- package/src/components/ui/finance/command/finance-command-actions.test.tsx +48 -0
- package/src/components/ui/finance/command/finance-command-actions.tsx +200 -0
- package/src/components/ui/finance/command/finance-command-provider.test.tsx +151 -0
- package/src/components/ui/finance/command/finance-command-provider.tsx +250 -0
- package/src/components/ui/finance/command/finance-command-results.tsx +262 -0
- package/src/components/ui/finance/invoices/pending-invoices-table.tsx +22 -9
- package/src/components/ui/finance/shared/quick-actions.tsx +39 -90
- package/src/components/ui/finance/tags/tag-manager.tsx +24 -5
- package/src/components/ui/finance/transactions/form-basic-tab.tsx +33 -49
- package/src/components/ui/finance/transactions/form-types.ts +3 -0
- package/src/components/ui/finance/transactions/form.test.tsx +105 -22
- package/src/components/ui/finance/transactions/form.tsx +116 -20
- package/src/components/ui/finance/transactions/infinite-transactions-list.tsx +13 -6
- package/src/components/ui/finance/transactions/transaction-edit-dialog.test.tsx +25 -1
- package/src/components/ui/finance/transactions/transaction-edit-dialog.tsx +16 -3
- package/src/components/ui/finance/transactions/transactionId/transaction-details-client-page.tsx +3 -0
- package/src/components/ui/finance/transactions/transactionId/transaction-details-page.tsx +3 -0
- package/src/components/ui/finance/transactions/transactions-create-summary.tsx +6 -0
- package/src/components/ui/finance/transactions/transactions-infinite-page.tsx +20 -2
- package/src/components/ui/finance/transactions/transactions-page.tsx +4 -0
- package/src/components/ui/finance/wallets/checkpoints/wallet-checkpoint-history-dialog.tsx +7 -2
- package/src/components/ui/finance/wallets/checkpoints/wallet-total-check-dialog.tsx +7 -2
- package/src/components/ui/finance/wallets/walletId/wallet-details-actions.test.tsx +38 -1
- package/src/components/ui/finance/wallets/walletId/wallet-details-actions.tsx +5 -0
- package/src/components/ui/finance/wallets/walletId/wallet-details-page.test.tsx +18 -2
- package/src/components/ui/finance/wallets/walletId/wallet-details-page.tsx +3 -0
- package/src/components/ui/finance/wallets/wallets-page.tsx +3 -0
- package/src/components/ui/legacy/calendar/settings/google-calendar-settings.tsx +2 -9
- package/src/components/ui/optional-time-picker.tsx +95 -0
- package/src/components/ui/quick-command-center.test.tsx +90 -0
- package/src/components/ui/quick-command-center.tsx +190 -0
- package/src/components/ui/storefront/cart-summary.tsx +18 -27
- package/src/components/ui/storefront/hero-panel.tsx +22 -13
- package/src/components/ui/storefront/storefront-surface.test.tsx +8 -4
- package/src/components/ui/storefront/storefront-surface.tsx +84 -41
- package/src/components/ui/storefront/types.ts +2 -0
- package/src/components/ui/storefront/utils.ts +21 -0
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/task-api.test.ts +171 -0
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/task-api.ts +200 -36
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-save.ts +21 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.0](https://github.com/tutur3u/platform/compare/ui-v0.6.2...ui-v0.7.0) (2026-06-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **finance:** add command center shortcuts ([d0197f7](https://github.com/tutur3u/platform/commit/d0197f705227cdf8171704b40119b66b1140be80))
|
|
9
|
+
* **inventory:** field tooltips, tabbed dialogs, row-click edit, storefront polish ([e27d7bb](https://github.com/tutur3u/platform/commit/e27d7bbd75a76b8e6d9395faaa48ad6b465dca4b))
|
|
10
|
+
* **inventory:** upgrade storefront commerce ([ac43942](https://github.com/tutur3u/platform/commit/ac439426ec6d7abc25efbf7ef88468e32be3a46e))
|
|
11
|
+
* **ui:** add optional time picker ([d4cf439](https://github.com/tutur3u/platform/commit/d4cf4398c8efd8ca5267b770e07f1015a59d43fd))
|
|
12
|
+
* **ui:** redesign optional time picker ([cadbf12](https://github.com/tutur3u/platform/commit/cadbf124a9048d85164082eec2b857feb78b1070))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **calendar:** preserve Google OAuth refresh tokens ([4358623](https://github.com/tutur3u/platform/commit/4358623a2dbde76fd84af59bb18e540994a5d091))
|
|
18
|
+
* **finance:** stop pending invoices from intermittently failing to load ([c4a51b8](https://github.com/tutur3u/platform/commit/c4a51b89e3cad8130b8016864cf25f4da6db6fc1))
|
|
19
|
+
* **tasks:** persist large task descriptions in chunks ([457744a](https://github.com/tutur3u/platform/commit/457744aa051d06baccc5df5aa4d4cb509534ea8b))
|
|
20
|
+
|
|
21
|
+
## [0.6.2](https://github.com/tutur3u/platform/compare/ui-v0.6.1...ui-v0.6.2) (2026-06-13)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **ci:** make platform package gate non-blocking ([895cee0](https://github.com/tutur3u/platform/commit/895cee009fac0e5464fdb4f9c5c4c9ef0481c854))
|
|
27
|
+
|
|
3
28
|
## [0.6.1](https://github.com/tutur3u/platform/compare/ui-v0.6.0...ui-v0.6.1) (2026-06-13)
|
|
4
29
|
|
|
5
30
|
|
package/README.md
CHANGED
|
@@ -13,9 +13,9 @@ bun add @tuturuuu/ui
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
The public package depends on other published Tuturuuu packages, including
|
|
16
|
-
`@tuturuuu/ai`. Release those dependencies first, then
|
|
17
|
-
production commit so standalone apps can install
|
|
18
|
-
workspace links or package-manager overrides.
|
|
16
|
+
`@tuturuuu/apis` and `@tuturuuu/ai`. Release those dependencies first, then
|
|
17
|
+
publish UI from the same production commit so standalone apps can install
|
|
18
|
+
`@tuturuuu/ui` without local workspace links or package-manager overrides.
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
package/biome.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuturuuu/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -83,12 +83,12 @@
|
|
|
83
83
|
"@tiptap/react": "3.26.1",
|
|
84
84
|
"@tiptap/starter-kit": "3.26.1",
|
|
85
85
|
"@tuturuuu/ai": "0.2.2",
|
|
86
|
-
"@tuturuuu/apis": "0.4.
|
|
86
|
+
"@tuturuuu/apis": "0.4.2",
|
|
87
87
|
"@tuturuuu/hooks": "0.0.2",
|
|
88
88
|
"@tuturuuu/icons": "0.0.6",
|
|
89
|
-
"@tuturuuu/internal-api": "0.
|
|
89
|
+
"@tuturuuu/internal-api": "0.8.0",
|
|
90
90
|
"@tuturuuu/supabase": "0.3.3",
|
|
91
|
-
"@tuturuuu/utils": "0.
|
|
91
|
+
"@tuturuuu/utils": "0.7.0",
|
|
92
92
|
"@types/debug": "^4.1.13",
|
|
93
93
|
"browser-image-compression": "^2.0.2",
|
|
94
94
|
"class-variance-authority": "^0.7.1",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"react-day-picker": "^10.0.1",
|
|
120
120
|
"react-dom": "^19.2.7",
|
|
121
121
|
"react-dropzone": "^15.0.0",
|
|
122
|
-
"react-hook-form": "^7.
|
|
122
|
+
"react-hook-form": "^7.79.0",
|
|
123
123
|
"react-markdown": "^10.1.0",
|
|
124
124
|
"react-papaparse": "^4.4.0",
|
|
125
125
|
"react-pdf": "^10.4.1",
|
|
@@ -141,13 +141,13 @@
|
|
|
141
141
|
"zod": "^4.4.3"
|
|
142
142
|
},
|
|
143
143
|
"devDependencies": {
|
|
144
|
-
"@tailwindcss/postcss": "^4.3.
|
|
144
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
145
145
|
"@tailwindcss/typography": "^0.5.20",
|
|
146
146
|
"@tanstack/react-query": "^5.101.0",
|
|
147
147
|
"@tanstack/react-table": "^8.21.3",
|
|
148
148
|
"@testing-library/jest-dom": "^6.9.1",
|
|
149
149
|
"@testing-library/react": "^16.3.2",
|
|
150
|
-
"@tuturuuu/types": "0.
|
|
150
|
+
"@tuturuuu/types": "0.9.0",
|
|
151
151
|
"@tuturuuu/typescript-config": "0.1.1",
|
|
152
152
|
"@types/html2canvas": "^1.0.0",
|
|
153
153
|
"@types/lodash": "^4.17.24",
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"jsdom": "^29.1.1",
|
|
163
163
|
"postcss": "^8.5.14",
|
|
164
164
|
"postcss-load-config": "^6.0.1",
|
|
165
|
-
"tailwindcss": "^4.3.
|
|
165
|
+
"tailwindcss": "^4.3.1",
|
|
166
166
|
"typescript": "^6.0.3",
|
|
167
167
|
"uuid": "^14.0.0",
|
|
168
168
|
"vitest": "^4.1.8"
|
|
@@ -15,6 +15,10 @@ import {
|
|
|
15
15
|
Trash2,
|
|
16
16
|
Upload,
|
|
17
17
|
} from '@tuturuuu/icons';
|
|
18
|
+
import {
|
|
19
|
+
getGoogleCalendarAuthUrl,
|
|
20
|
+
InternalApiError,
|
|
21
|
+
} from '@tuturuuu/internal-api';
|
|
18
22
|
import { useTranslations } from 'next-intl';
|
|
19
23
|
import { useMemo, useState } from 'react';
|
|
20
24
|
import { useCalendarSync } from '../../../../hooks/use-calendar-sync';
|
|
@@ -292,21 +296,21 @@ export default function CalendarConnections({
|
|
|
292
296
|
const googleAuthMutation = useMutation<AuthResponse, Error, void>({
|
|
293
297
|
mutationKey: ['calendar', 'google-auth', wsId],
|
|
294
298
|
mutationFn: async () => {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
})
|
|
299
|
+
try {
|
|
300
|
+
return await getGoogleCalendarAuthUrl(wsId);
|
|
301
|
+
} catch (error) {
|
|
302
|
+
if (error instanceof InternalApiError) {
|
|
303
|
+
throw new Error(
|
|
304
|
+
error.status === 401
|
|
305
|
+
? 'unauthorized'
|
|
306
|
+
: error.status === 403
|
|
307
|
+
? 'forbidden'
|
|
308
|
+
: 'unknown_error'
|
|
309
|
+
);
|
|
310
|
+
}
|
|
298
311
|
|
|
299
|
-
|
|
300
|
-
throw new Error(
|
|
301
|
-
response.status === 401
|
|
302
|
-
? 'unauthorized'
|
|
303
|
-
: response.status === 403
|
|
304
|
-
? 'forbidden'
|
|
305
|
-
: 'unknown_error'
|
|
306
|
-
);
|
|
312
|
+
throw error;
|
|
307
313
|
}
|
|
308
|
-
|
|
309
|
-
return (await response.json()) as AuthResponse;
|
|
310
314
|
},
|
|
311
315
|
onSuccess: (data) => {
|
|
312
316
|
const { authUrl } = data;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
4
4
|
import { AlertCircle, Loader2, Plus, Trash2, User } from '@tuturuuu/icons';
|
|
5
|
+
import { getGoogleCalendarAuthUrl } from '@tuturuuu/internal-api';
|
|
5
6
|
import Image from 'next/image';
|
|
6
7
|
import { useTranslations } from 'next-intl';
|
|
7
8
|
import React, { useState } from 'react';
|
|
@@ -137,11 +138,7 @@ export function ConnectedAccountsDialog({
|
|
|
137
138
|
// Google auth mutation
|
|
138
139
|
const googleAuthMutation = useMutation<AuthResponse, Error, void>({
|
|
139
140
|
mutationKey: ['calendar', 'google-auth', wsId],
|
|
140
|
-
mutationFn:
|
|
141
|
-
const response = await fetch(`/api/v1/calendar/auth?wsId=${wsId}`);
|
|
142
|
-
if (!response.ok) throw new Error('Failed to get auth URL');
|
|
143
|
-
return response.json();
|
|
144
|
-
},
|
|
141
|
+
mutationFn: () => getGoogleCalendarAuthUrl(wsId),
|
|
145
142
|
onSuccess: (data) => {
|
|
146
143
|
if (data.authUrl) {
|
|
147
144
|
window.location.href = data.authUrl;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
2
2
|
import {
|
|
3
3
|
type CalendarSourceOption,
|
|
4
|
+
getGoogleCalendarAuthUrl,
|
|
4
5
|
getWorkspaceCalendarDefaultSource,
|
|
5
6
|
updateWorkspaceCalendarDefaultSource,
|
|
6
7
|
} from '@tuturuuu/internal-api';
|
|
@@ -392,11 +393,7 @@ export function useCalendarConnectionsManager(wsId: string) {
|
|
|
392
393
|
// Google auth mutation
|
|
393
394
|
const googleAuthMutation = useMutation<AuthResponse, Error, void>({
|
|
394
395
|
mutationKey: ['calendar', 'google-auth', wsId],
|
|
395
|
-
mutationFn:
|
|
396
|
-
const response = await fetch(`/api/v1/calendar/auth?wsId=${wsId}`);
|
|
397
|
-
if (!response.ok) throw new Error('Failed to get auth URL');
|
|
398
|
-
return response.json();
|
|
399
|
-
},
|
|
396
|
+
mutationFn: () => getGoogleCalendarAuthUrl(wsId),
|
|
400
397
|
onSuccess: (data) => {
|
|
401
398
|
if (data.authUrl) window.location.href = data.authUrl;
|
|
402
399
|
else toast.error(t('auth_url_invalid'));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import { Calendar } from './calendar';
|
|
4
|
+
|
|
5
|
+
vi.mock('react-day-picker', () => ({
|
|
6
|
+
DayPicker: ({ fixedWeeks }: { fixedWeeks?: boolean }) => (
|
|
7
|
+
<div data-fixed-weeks={String(fixedWeeks)} data-testid="day-picker" />
|
|
8
|
+
),
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
vi.mock('../../hooks/use-calendar-preferences', () => ({
|
|
12
|
+
useCalendarPreferences: () => ({ weekStartsOn: 1 }),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe('Calendar', () => {
|
|
16
|
+
it('renders DayPicker with fixed weeks to avoid layout shift', () => {
|
|
17
|
+
render(<Calendar mode="single" />);
|
|
18
|
+
|
|
19
|
+
expect(screen.getByTestId('day-picker')).toHaveAttribute(
|
|
20
|
+
'data-fixed-weeks',
|
|
21
|
+
'true'
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -311,6 +311,7 @@ function Calendar({
|
|
|
311
311
|
onMonthChange={setMonth}
|
|
312
312
|
defaultMonth={initialMonth}
|
|
313
313
|
showOutsideDays={true}
|
|
314
|
+
fixedWeeks={true}
|
|
314
315
|
weekStartsOn={props.weekStartsOn ?? preferences.weekStartsOn}
|
|
315
316
|
className={cn('', className)}
|
|
316
317
|
classNames={normalizeClassNames({
|