@ttt-productions/ui-core 0.11.34 → 0.11.35
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/README.md +1 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +0 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/reload-recovery-watch.d.ts +0 -4
- package/dist/browser/reload-recovery-watch.d.ts.map +1 -1
- package/dist/browser/reload-recovery-watch.js +0 -5
- package/dist/browser/reload-recovery-watch.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/format-numbers.d.ts +0 -6
- package/dist/lib/format-numbers.d.ts.map +1 -1
- package/dist/lib/format-numbers.js +0 -6
- package/dist/lib/format-numbers.js.map +1 -1
- package/dist/lib/reload-recovery.d.ts +1 -9
- package/dist/lib/reload-recovery.d.ts.map +1 -1
- package/dist/lib/reload-recovery.js +1 -11
- package/dist/lib/reload-recovery.js.map +1 -1
- package/dist/lib/utils.d.ts +0 -3
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +0 -3
- package/dist/lib/utils.js.map +1 -1
- package/dist/react/components/accordion.d.ts.map +1 -1
- package/dist/react/components/accordion.js.map +1 -1
- package/dist/react/components/action-row.d.ts +0 -7
- package/dist/react/components/action-row.d.ts.map +1 -1
- package/dist/react/components/action-row.js +1 -5
- package/dist/react/components/action-row.js.map +1 -1
- package/dist/react/components/button.d.ts +0 -10
- package/dist/react/components/button.d.ts.map +1 -1
- package/dist/react/components/button.js +2 -7
- package/dist/react/components/button.js.map +1 -1
- package/dist/react/components/consequence-dialog.d.ts +1 -48
- package/dist/react/components/consequence-dialog.d.ts.map +1 -1
- package/dist/react/components/consequence-dialog.js +3 -21
- package/dist/react/components/consequence-dialog.js.map +1 -1
- package/dist/react/components/date-picker.d.ts +0 -17
- package/dist/react/components/date-picker.d.ts.map +1 -1
- package/dist/react/components/date-picker.js +0 -32
- package/dist/react/components/date-picker.js.map +1 -1
- package/dist/react/components/date-time-picker.d.ts +0 -23
- package/dist/react/components/date-time-picker.d.ts.map +1 -1
- package/dist/react/components/date-time-picker.js +0 -19
- package/dist/react/components/date-time-picker.js.map +1 -1
- package/dist/react/components/dropdown-menu.d.ts +0 -8
- package/dist/react/components/dropdown-menu.d.ts.map +1 -1
- package/dist/react/components/dropdown-menu.js +1 -2
- package/dist/react/components/dropdown-menu.js.map +1 -1
- package/dist/react/components/format-control.d.ts +1 -21
- package/dist/react/components/format-control.d.ts.map +1 -1
- package/dist/react/components/format-control.js +1 -21
- package/dist/react/components/format-control.js.map +1 -1
- package/dist/react/components/input.d.ts +0 -17
- package/dist/react/components/input.d.ts.map +1 -1
- package/dist/react/components/input.js +1 -3
- package/dist/react/components/input.js.map +1 -1
- package/dist/react/components/layout/screen-adaptive-view.d.ts +0 -7
- package/dist/react/components/layout/screen-adaptive-view.d.ts.map +1 -1
- package/dist/react/components/layout/screen-adaptive-view.js +1 -2
- package/dist/react/components/layout/screen-adaptive-view.js.map +1 -1
- package/dist/react/components/list-pagination.d.ts +0 -30
- package/dist/react/components/list-pagination.d.ts.map +1 -1
- package/dist/react/components/list-pagination.js +0 -27
- package/dist/react/components/list-pagination.js.map +1 -1
- package/dist/react/components/opener-focus.d.ts +1 -7
- package/dist/react/components/opener-focus.d.ts.map +1 -1
- package/dist/react/components/opener-focus.js +1 -7
- package/dist/react/components/opener-focus.js.map +1 -1
- package/dist/react/components/pending-guard.d.ts +0 -6
- package/dist/react/components/pending-guard.d.ts.map +1 -1
- package/dist/react/components/pending-guard.js +0 -6
- package/dist/react/components/pending-guard.js.map +1 -1
- package/dist/react/components/relative-time.d.ts +0 -8
- package/dist/react/components/relative-time.d.ts.map +1 -1
- package/dist/react/components/relative-time.js +0 -4
- package/dist/react/components/relative-time.js.map +1 -1
- package/dist/react/components/reload-recovery-notice.d.ts +0 -14
- package/dist/react/components/reload-recovery-notice.d.ts.map +1 -1
- package/dist/react/components/reload-recovery-notice.js +0 -5
- package/dist/react/components/reload-recovery-notice.js.map +1 -1
- package/dist/react/components/scroll-to-top-button.d.ts +1 -25
- package/dist/react/components/scroll-to-top-button.d.ts.map +1 -1
- package/dist/react/components/scroll-to-top-button.js.map +1 -1
- package/dist/react/components/search-dropdown.d.ts +0 -53
- package/dist/react/components/search-dropdown.d.ts.map +1 -1
- package/dist/react/components/search-dropdown.js +2 -36
- package/dist/react/components/search-dropdown.js.map +1 -1
- package/dist/react/components/select.d.ts +0 -7
- package/dist/react/components/select.d.ts.map +1 -1
- package/dist/react/components/select.js +0 -2
- package/dist/react/components/select.js.map +1 -1
- package/dist/react/components/show-more-toggle.d.ts +0 -16
- package/dist/react/components/show-more-toggle.d.ts.map +1 -1
- package/dist/react/components/show-more-toggle.js +0 -5
- package/dist/react/components/show-more-toggle.js.map +1 -1
- package/dist/react/components/spinner.d.ts +0 -14
- package/dist/react/components/spinner.d.ts.map +1 -1
- package/dist/react/components/spinner.js +0 -8
- package/dist/react/components/spinner.js.map +1 -1
- package/dist/react/components/switch.d.ts +0 -7
- package/dist/react/components/switch.d.ts.map +1 -1
- package/dist/react/components/switch.js +0 -2
- package/dist/react/components/switch.js.map +1 -1
- package/dist/react/components/table.d.ts +0 -10
- package/dist/react/components/table.d.ts.map +1 -1
- package/dist/react/components/table.js +0 -6
- package/dist/react/components/table.js.map +1 -1
- package/dist/react/components/textarea.d.ts +0 -11
- package/dist/react/components/textarea.d.ts.map +1 -1
- package/dist/react/components/textarea.js +1 -3
- package/dist/react/components/textarea.js.map +1 -1
- package/dist/react/components/toast.d.ts +0 -4
- package/dist/react/components/toast.d.ts.map +1 -1
- package/dist/react/components/toast.js +3 -24
- package/dist/react/components/toast.js.map +1 -1
- package/dist/react/components/toaster.d.ts.map +1 -1
- package/dist/react/components/toaster.js.map +1 -1
- package/dist/react/hooks/use-async-action.d.ts +1 -21
- package/dist/react/hooks/use-async-action.d.ts.map +1 -1
- package/dist/react/hooks/use-async-action.js +1 -9
- package/dist/react/hooks/use-async-action.js.map +1 -1
- package/dist/react/hooks/use-cursor-page.d.ts +0 -62
- package/dist/react/hooks/use-cursor-page.d.ts.map +1 -1
- package/dist/react/hooks/use-cursor-page.js +1 -37
- package/dist/react/hooks/use-cursor-page.js.map +1 -1
- package/dist/react/hooks/use-paged-list.d.ts +0 -43
- package/dist/react/hooks/use-paged-list.d.ts.map +1 -1
- package/dist/react/hooks/use-paged-list.js +0 -15
- package/dist/react/hooks/use-paged-list.js.map +1 -1
- package/dist/react/hooks/use-return-scroll.d.ts +0 -9
- package/dist/react/hooks/use-return-scroll.d.ts.map +1 -1
- package/dist/react/hooks/use-return-scroll.js +2 -34
- package/dist/react/hooks/use-return-scroll.js.map +1 -1
- package/dist/react/hooks/use-toast.d.ts +0 -8
- package/dist/react/hooks/use-toast.d.ts.map +1 -1
- package/dist/react/hooks/use-toast.js +1 -4
- package/dist/react/hooks/use-toast.js.map +1 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +0 -6
- package/dist/react/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,47 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCallback, useState } from 'react';
|
|
3
|
-
/**
|
|
4
|
-
* Page state for a server-paged (cursor / `hasMore`) list: the 1-based page
|
|
5
|
-
* number, the guarded step controls, and the reset — the pieces each
|
|
6
|
-
* server-paged surface was otherwise re-declaring as a local `useState(1)` plus
|
|
7
|
-
* its own clamped increment/decrement and its own "reset when the filter
|
|
8
|
-
* changed" adjustment (ENG-002, ENG-003).
|
|
9
|
-
*
|
|
10
|
-
* The data stays the caller's, and the two halves bind at different moments:
|
|
11
|
-
*
|
|
12
|
-
* ```tsx
|
|
13
|
-
* const pager = useCursorPage({ resetKey: tag });
|
|
14
|
-
* const { data, isFetching } = useThingsByTag(tag, pager.currentPage);
|
|
15
|
-
* …
|
|
16
|
-
* <ListPagination pagination={pager.paginationFor(data?.hasMore ?? false)} busy={isFetching} />
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* The guards live in here, not at the call site: a step that cannot move the
|
|
20
|
-
* page changes nothing and does not fire `onPageChange`.
|
|
21
|
-
*
|
|
22
|
-
* A surface whose data hook ALREADY owns its page state (it returns
|
|
23
|
-
* `page`/`hasNextPage`/`nextPage`/`prevPage` itself) does not need this hook —
|
|
24
|
-
* it maps those fields onto {@link ListPaginationState} directly. The hook
|
|
25
|
-
* exists for the surfaces that would otherwise hand-roll the state.
|
|
26
|
-
*/
|
|
27
3
|
export function useCursorPage(options = {}) {
|
|
28
4
|
const { onPageChange, resetKey } = options;
|
|
29
|
-
// The stored page is only meaningful for the inputs it was reached under, so
|
|
30
|
-
// the key it belongs to is stored WITH it.
|
|
31
5
|
const [pageState, setPageState] = useState({ page: 1, key: resetKey });
|
|
32
|
-
// `Object.is`,
|
|
33
|
-
// must compare equal to itself, or the adjustment below would re-fire forever.
|
|
6
|
+
// `Object.is`, as React compares: a `NaN` key must equal itself, or the adjustment below re-fires forever.
|
|
34
7
|
const keyMatches = Object.is(pageState.key, resetKey);
|
|
35
|
-
// React's "adjusting state when a prop changes": a new key retires the stored
|
|
36
|
-
// page, because page 4 of the old result set is not page 4 of the new one.
|
|
37
|
-
// Retiring it (rather than only ignoring it) is what makes going BACK to
|
|
38
|
-
// earlier inputs start at page 1 too, instead of reviving a dead page.
|
|
39
8
|
if (!keyMatches) {
|
|
40
9
|
setPageState({ page: 1, key: resetKey });
|
|
41
10
|
}
|
|
42
|
-
// Derived as well as adjusted, so even the render that triggers the adjustment
|
|
43
|
-
// already reports page 1 — the caller's query is never asked for a page of the
|
|
44
|
-
// new inputs that the user never navigated to.
|
|
45
11
|
const currentPage = keyMatches ? pageState.page : 1;
|
|
46
12
|
const goToPreviousPage = useCallback(() => {
|
|
47
13
|
if (currentPage <= 1)
|
|
@@ -55,8 +21,6 @@ export function useCursorPage(options = {}) {
|
|
|
55
21
|
setPageState({ page: 1, key: resetKey });
|
|
56
22
|
onPageChange?.();
|
|
57
23
|
}, [currentPage, resetKey, onPageChange]);
|
|
58
|
-
// Memoized on the page state itself, so a consumer may hold it in a dep array
|
|
59
|
-
// and it changes only when the page (or the callback/inputs) actually change.
|
|
60
24
|
const paginationFor = useCallback((hasMore) => ({
|
|
61
25
|
currentPage,
|
|
62
26
|
canPreviousPage: currentPage > 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cursor-page.js","sourceRoot":"","sources":["../../../src/react/hooks/use-cursor-page.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-cursor-page.js","sourceRoot":"","sources":["../../../src/react/hooks/use-cursor-page.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAkB9C,MAAM,UAAU,aAAa,CAAC,UAAgC,EAAE;IAC9D,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAE3C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAGvC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE/B,2GAA2G;IAC3G,MAAM,UAAU,GAAG,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAEtD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAG,EAAE;QACxC,IAAI,WAAW,IAAI,CAAC;YAAE,OAAO;QAC7B,YAAY,CAAC,EAAE,IAAI,EAAE,WAAW,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;QACvD,YAAY,EAAE,EAAE,CAAC;IACnB,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAE1C,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,IAAI,WAAW,KAAK,CAAC;YAAE,OAAO;QAC9B,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;QACzC,YAAY,EAAE,EAAE,CAAC;IACnB,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAE1C,MAAM,aAAa,GAAG,WAAW,CAC/B,CAAC,OAAgB,EAAc,EAAE,CAAC,CAAC;QACjC,WAAW;QACX,eAAe,EAAE,WAAW,GAAG,CAAC;QAChC,WAAW,EAAE,OAAO;QACpB,gBAAgB;QAChB,YAAY,EAAE,GAAG,EAAE;YACjB,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,YAAY,CAAC,EAAE,IAAI,EAAE,WAAW,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;YACvD,YAAY,EAAE,EAAE,CAAC;QACnB,CAAC;KACF,CAAC,EACF,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,CAAC,CACxD,CAAC;IAEF,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAC/C,CAAC","sourcesContent":["'use client';\n\nimport { useCallback, useState } from 'react';\nimport type { ListPaginationState } from './use-paged-list.js';\n\nexport interface CursorPage extends ListPaginationState {\n totalPages?: undefined;\n}\n\nexport interface UseCursorPageOptions {\n onPageChange?: () => void;\n resetKey?: string | number | boolean | null;\n}\n\nexport interface CursorPager {\n currentPage: number;\n reset: () => void;\n paginationFor: (hasMore: boolean) => CursorPage;\n}\n\nexport function useCursorPage(options: UseCursorPageOptions = {}): CursorPager {\n const { onPageChange, resetKey } = options;\n\n const [pageState, setPageState] = useState<{\n page: number;\n key: UseCursorPageOptions['resetKey'];\n }>({ page: 1, key: resetKey });\n\n // `Object.is`, as React compares: a `NaN` key must equal itself, or the adjustment below re-fires forever.\n const keyMatches = Object.is(pageState.key, resetKey);\n\n if (!keyMatches) {\n setPageState({ page: 1, key: resetKey });\n }\n const currentPage = keyMatches ? pageState.page : 1;\n\n const goToPreviousPage = useCallback(() => {\n if (currentPage <= 1) return;\n setPageState({ page: currentPage - 1, key: resetKey });\n onPageChange?.();\n }, [currentPage, resetKey, onPageChange]);\n\n const reset = useCallback(() => {\n if (currentPage === 1) return;\n setPageState({ page: 1, key: resetKey });\n onPageChange?.();\n }, [currentPage, resetKey, onPageChange]);\n\n const paginationFor = useCallback(\n (hasMore: boolean): CursorPage => ({\n currentPage,\n canPreviousPage: currentPage > 1,\n canNextPage: hasMore,\n goToPreviousPage,\n goToNextPage: () => {\n if (!hasMore) return;\n setPageState({ page: currentPage + 1, key: resetKey });\n onPageChange?.();\n },\n }),\n [currentPage, resetKey, onPageChange, goToPreviousPage],\n );\n\n return { currentPage, reset, paginationFor };\n}\n"]}
|
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The control state a paginated list exposes to its paginator UI, rendered by
|
|
3
|
-
* the ONE `ListPagination` component. Nothing else builds
|
|
4
|
-
* Previous / counter / Next controls.
|
|
5
|
-
*
|
|
6
|
-
* `totalPages` is the flavor discriminant, and the ONLY difference between the
|
|
7
|
-
* two flavors:
|
|
8
|
-
*
|
|
9
|
-
* - **Known total** (client-side slice pagination — {@link usePagedList}):
|
|
10
|
-
* `totalPages` is a number and the counter reads `"2 of 5"`.
|
|
11
|
-
* - **Unknown total** (server/cursor pagination — `useCursorPage().paginationFor(hasMore)`,
|
|
12
|
-
* or a caller's own query hook): `totalPages` is omitted and the counter reads
|
|
13
|
-
* `"Page 2"`.
|
|
14
|
-
*
|
|
15
|
-
* Both flavors share one visibility rule, one disabled-edge rule, one live
|
|
16
|
-
* region, and one set of classes because they share one component (ENG-002,
|
|
17
|
-
* FRONTEND-001).
|
|
18
|
-
*/
|
|
19
1
|
export interface ListPaginationState {
|
|
20
|
-
/** 1-based page currently on screen. */
|
|
21
2
|
currentPage: number;
|
|
22
|
-
/**
|
|
23
|
-
* Total page count when it is knowable — at least 1, even for an empty list
|
|
24
|
-
* (an empty list is one empty page). Omitted for cursor/`hasMore` pagination,
|
|
25
|
-
* where the total is unknown until the last page is reached.
|
|
26
|
-
*/
|
|
27
3
|
totalPages?: number;
|
|
28
4
|
canPreviousPage: boolean;
|
|
29
5
|
canNextPage: boolean;
|
|
@@ -31,30 +7,11 @@ export interface ListPaginationState {
|
|
|
31
7
|
goToNextPage: () => void;
|
|
32
8
|
}
|
|
33
9
|
export interface PagedList<T> extends ListPaginationState {
|
|
34
|
-
/** Always known for a slice-paginated list. */
|
|
35
10
|
totalPages: number;
|
|
36
|
-
/** The slice of `items` belonging to `currentPage`. */
|
|
37
11
|
pageItems: T[];
|
|
38
12
|
}
|
|
39
13
|
export interface UsePagedListOptions {
|
|
40
|
-
/**
|
|
41
|
-
* Called after the page actually changed. Surfaces that keep a per-page
|
|
42
|
-
* selection (an open detail row) clear it here — the old selection is not on
|
|
43
|
-
* the new page.
|
|
44
|
-
*/
|
|
45
14
|
onPageChange?: () => void;
|
|
46
15
|
}
|
|
47
|
-
/**
|
|
48
|
-
* The single owner of client-side slice pagination: local page state, the page
|
|
49
|
-
* math, and the current slice over an ALREADY-FETCHED list.
|
|
50
|
-
*
|
|
51
|
-
* Page size is the caller's — every surface passes its own page-size constant
|
|
52
|
-
* (ENG-005), never a literal. Ordering and filtering stay with the caller: pass
|
|
53
|
-
* the list already sorted and filtered.
|
|
54
|
-
*
|
|
55
|
-
* Not for server-paged lists — a cursor/`hasMore` feed pages through the
|
|
56
|
-
* caller's data layer, not through a slice; use `useCursorPage` (or the query
|
|
57
|
-
* hook's own page state) with the same `ListPagination` control.
|
|
58
|
-
*/
|
|
59
16
|
export declare function usePagedList<T>(items: readonly T[], pageSize: number, options?: UsePagedListOptions): PagedList<T>;
|
|
60
17
|
//# sourceMappingURL=use-paged-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-paged-list.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-paged-list.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"use-paged-list.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-paged-list.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,CAAE,SAAQ,mBAAmB;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,CAAC,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,mBAAwB,GAChC,SAAS,CAAC,CAAC,CAAC,CAiCd"}
|
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
-
/**
|
|
4
|
-
* The single owner of client-side slice pagination: local page state, the page
|
|
5
|
-
* math, and the current slice over an ALREADY-FETCHED list.
|
|
6
|
-
*
|
|
7
|
-
* Page size is the caller's — every surface passes its own page-size constant
|
|
8
|
-
* (ENG-005), never a literal. Ordering and filtering stay with the caller: pass
|
|
9
|
-
* the list already sorted and filtered.
|
|
10
|
-
*
|
|
11
|
-
* Not for server-paged lists — a cursor/`hasMore` feed pages through the
|
|
12
|
-
* caller's data layer, not through a slice; use `useCursorPage` (or the query
|
|
13
|
-
* hook's own page state) with the same `ListPagination` control.
|
|
14
|
-
*/
|
|
15
3
|
export function usePagedList(items, pageSize, options = {}) {
|
|
16
4
|
const { onPageChange } = options;
|
|
17
5
|
const [requestedPage, setRequestedPage] = useState(1);
|
|
18
6
|
const totalPages = Math.max(1, Math.ceil(items.length / pageSize));
|
|
19
|
-
// The list can shrink under a page that is already open (an item is deleted,
|
|
20
|
-
// a filter narrows). Clamping keeps the paginator on a real page instead of
|
|
21
|
-
// rendering an empty slice under an out-of-range "4 of 2".
|
|
22
7
|
const currentPage = Math.min(Math.max(1, requestedPage), totalPages);
|
|
23
8
|
const pageItems = useMemo(() => {
|
|
24
9
|
const startIndex = (currentPage - 1) * pageSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-paged-list.js","sourceRoot":"","sources":["../../../src/react/hooks/use-paged-list.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-paged-list.js","sourceRoot":"","sources":["../../../src/react/hooks/use-paged-list.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAoBvD,MAAM,UAAU,YAAY,CAC1B,KAAmB,EACnB,QAAgB,EAChB,UAA+B,EAAE;IAEjC,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IACjC,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAA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n\nimport { useCallback, useMemo, useState } from 'react';\n\nexport interface ListPaginationState {\n currentPage: number;\n totalPages?: number;\n canPreviousPage: boolean;\n canNextPage: boolean;\n goToPreviousPage: () => void;\n goToNextPage: () => void;\n}\n\nexport interface PagedList<T> extends ListPaginationState {\n totalPages: number;\n pageItems: T[];\n}\n\nexport interface UsePagedListOptions {\n onPageChange?: () => void;\n}\n\nexport function usePagedList<T>(\n items: readonly T[],\n pageSize: number,\n options: UsePagedListOptions = {},\n): PagedList<T> {\n const { onPageChange } = options;\n const [requestedPage, setRequestedPage] = useState(1);\n\n const totalPages = Math.max(1, Math.ceil(items.length / pageSize));\n const currentPage = Math.min(Math.max(1, requestedPage), totalPages);\n\n const pageItems = useMemo(() => {\n const startIndex = (currentPage - 1) * pageSize;\n return items.slice(startIndex, startIndex + pageSize);\n }, [items, currentPage, pageSize]);\n\n const goToPreviousPage = useCallback(() => {\n if (currentPage <= 1) return;\n setRequestedPage(currentPage - 1);\n onPageChange?.();\n }, [currentPage, onPageChange]);\n\n const goToNextPage = useCallback(() => {\n if (currentPage >= totalPages) return;\n setRequestedPage(currentPage + 1);\n onPageChange?.();\n }, [currentPage, totalPages, onPageChange]);\n\n return {\n currentPage,\n totalPages,\n pageItems,\n canPreviousPage: currentPage > 1,\n canNextPage: currentPage < totalPages,\n goToPreviousPage,\n goToNextPage,\n };\n}\n"]}
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
export interface ReturnScrollEntry {
|
|
2
|
-
/** The saved `window.scrollY`. */
|
|
3
2
|
y: number;
|
|
4
|
-
/** Epoch ms at save time (diagnostic; the caller decides eligibility, not the hook). */
|
|
5
3
|
savedAt: number;
|
|
6
4
|
}
|
|
7
5
|
export interface UseReturnScrollOptions {
|
|
8
|
-
/** The caller's CANONICAL list URL — equivalent list states must give the same key. */
|
|
9
6
|
key: string;
|
|
10
|
-
/** Decided by the caller ONCE at mount (e.g. "the list's data was already cached on first render"). */
|
|
11
7
|
eligible: boolean;
|
|
12
|
-
/** The list is displayed at its real height: data present, no error surface in its place. */
|
|
13
8
|
ready: boolean;
|
|
14
9
|
}
|
|
15
10
|
export interface UseReturnScrollResult {
|
|
16
|
-
/** Record the current window offset for `key`. Call right before navigating away. */
|
|
17
11
|
save: () => void;
|
|
18
12
|
}
|
|
19
|
-
/** The stored entry for `key`, or null when absent, unreadable, or malformed. */
|
|
20
13
|
export declare function readReturnScroll(key: string): ReturnScrollEntry | null;
|
|
21
|
-
/** Record `y` (default: the current `window.scrollY`) for `key`. No-op without storage. */
|
|
22
14
|
export declare function saveReturnScroll(key: string, y?: number): void;
|
|
23
|
-
/** Drop the entry for `key` (e.g. the list changed underneath the saved offset). */
|
|
24
15
|
export declare function clearReturnScroll(key: string): void;
|
|
25
16
|
export declare function useReturnScroll({ key, eligible, ready, }: UseReturnScrollOptions): UseReturnScrollResult;
|
|
26
17
|
//# sourceMappingURL=use-return-scroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-return-scroll.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-return-scroll.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-return-scroll.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-return-scroll.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAeD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CActE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAQ9D;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAMnD;AAQD,wBAAgB,eAAe,CAAC,EAC9B,GAAG,EACH,QAAQ,EACR,KAAK,GACN,EAAE,sBAAsB,GAAG,qBAAqB,CAkChD"}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
// Return-scroll: bring a list back to where the user left it after a REAL route change.
|
|
3
|
-
//
|
|
4
|
-
// A same-page view swap keeps its component mounted and can restore from a ref; a list
|
|
5
|
-
// whose detail pages have their own URLs unmounts, so the offset has to survive in
|
|
6
|
-
// per-tab storage and the restore has to wait until the list is displayed at its real
|
|
7
|
-
// height again. This hook is the ONE owner of that mechanism. It knows nothing about
|
|
8
|
-
// what the list is — the caller supplies a canonical key, decides eligibility once at
|
|
9
|
-
// mount, and reports readiness.
|
|
10
|
-
//
|
|
11
|
-
// Contract (every rule below is tested):
|
|
12
|
-
// - `save()` writes { y, savedAt } for `key` — call it immediately before navigating
|
|
13
|
-
// away (inside any guarded-navigation callback, so a cancelled leave writes nothing).
|
|
14
|
-
// - `eligible` is latched per key the first time the hook sees that key. Not eligible
|
|
15
|
-
// ⇒ the entry is deleted immediately and permanently for that key; a later flip
|
|
16
|
-
// of `eligible` or `ready` never re-arms the restore.
|
|
17
|
-
// - `ready` ⇒ the restore fires ONCE, in a requestAnimationFrame, `behavior: "instant"`,
|
|
18
|
-
// then consumes the entry. The scheduled frame is cancelled on unmount or key change.
|
|
19
|
-
// React Strict Mode's mount/unmount/mount cancels and reschedules, so exactly one
|
|
20
|
-
// scroll happens and the entry is consumed exactly once.
|
|
21
|
-
// - Blocked, unavailable, or malformed storage is a silent no-op.
|
|
22
2
|
import * as React from 'react';
|
|
23
3
|
const STORAGE_PREFIX = 'return-scroll:';
|
|
24
4
|
function storageKey(key) {
|
|
@@ -34,7 +14,6 @@ function sessionStorageOrNull() {
|
|
|
34
14
|
return null;
|
|
35
15
|
}
|
|
36
16
|
}
|
|
37
|
-
/** The stored entry for `key`, or null when absent, unreadable, or malformed. */
|
|
38
17
|
export function readReturnScroll(key) {
|
|
39
18
|
const storage = sessionStorageOrNull();
|
|
40
19
|
if (!storage)
|
|
@@ -55,7 +34,6 @@ export function readReturnScroll(key) {
|
|
|
55
34
|
return null;
|
|
56
35
|
}
|
|
57
36
|
}
|
|
58
|
-
/** Record `y` (default: the current `window.scrollY`) for `key`. No-op without storage. */
|
|
59
37
|
export function saveReturnScroll(key, y) {
|
|
60
38
|
const storage = sessionStorageOrNull();
|
|
61
39
|
if (!storage)
|
|
@@ -65,11 +43,8 @@ export function saveReturnScroll(key, y) {
|
|
|
65
43
|
const entry = { y: offset, savedAt: Date.now() };
|
|
66
44
|
storage.setItem(storageKey(key), JSON.stringify(entry));
|
|
67
45
|
}
|
|
68
|
-
catch {
|
|
69
|
-
/* storage blocked or full — nothing to restore later, which is the honest outcome */
|
|
70
|
-
}
|
|
46
|
+
catch { }
|
|
71
47
|
}
|
|
72
|
-
/** Drop the entry for `key` (e.g. the list changed underneath the saved offset). */
|
|
73
48
|
export function clearReturnScroll(key) {
|
|
74
49
|
const storage = sessionStorageOrNull();
|
|
75
50
|
if (!storage)
|
|
@@ -77,14 +52,10 @@ export function clearReturnScroll(key) {
|
|
|
77
52
|
try {
|
|
78
53
|
storage.removeItem(storageKey(key));
|
|
79
54
|
}
|
|
80
|
-
catch {
|
|
81
|
-
/* nothing to clear */
|
|
82
|
-
}
|
|
55
|
+
catch { }
|
|
83
56
|
}
|
|
84
57
|
export function useReturnScroll({ key, eligible, ready, }) {
|
|
85
58
|
const decisionRef = React.useRef(null);
|
|
86
|
-
// Decide ONCE per key, the first time the hook sees it. Effects may read and write refs;
|
|
87
|
-
// the decision is latched, so a later `eligible` flip finds it already made and returns.
|
|
88
59
|
React.useEffect(() => {
|
|
89
60
|
if (decisionRef.current?.key === key)
|
|
90
61
|
return;
|
|
@@ -94,15 +65,12 @@ export function useReturnScroll({ key, eligible, ready, }) {
|
|
|
94
65
|
return;
|
|
95
66
|
}
|
|
96
67
|
if (!eligible) {
|
|
97
|
-
// A cold return: nothing cached to restore against. Discard permanently for this visit.
|
|
98
68
|
clearReturnScroll(key);
|
|
99
69
|
decisionRef.current = { key, y: null, done: true };
|
|
100
70
|
return;
|
|
101
71
|
}
|
|
102
72
|
decisionRef.current = { key, y: entry.y, done: false };
|
|
103
73
|
}, [key, eligible]);
|
|
104
|
-
// Restore once the list is displayed at its real height. The frame is cancelled on unmount
|
|
105
|
-
// or key change; Strict Mode's re-run reschedules it, so exactly one scroll happens.
|
|
106
74
|
React.useEffect(() => {
|
|
107
75
|
const decision = decisionRef.current;
|
|
108
76
|
if (!decision || decision.key !== key || decision.y === null || decision.done || !ready)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-return-scroll.js","sourceRoot":"","sources":["../../../src/react/hooks/use-return-scroll.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,
|
|
1
|
+
{"version":3,"file":"use-return-scroll.js","sourceRoot":"","sources":["../../../src/react/hooks/use-return-scroll.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAiBxC,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,cAAc,GAAG,GAAG,EAAE,CAAC;AACnC,CAAC;AAED,SAAS,oBAAoB;IAC3B,IAAI,CAAC;QACH,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC;QAC/C,OAAO,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,OAAO,GAAG,oBAAoB,EAAE,CAAC;IACvC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,C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CAAC,GAAG,KAAK,GAAG,IAAI,QAAQ,CAAC,CAAC,KAAK,IAAI,IAAI,QAAQ,CAAC,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO;QAChG,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO;QAC1C,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;QACrB,MAAM,KAAK,GAAG,MAAM,CAAC,qBAAqB,CAAC,GAAG,EAAE;YAC9C,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,SAA2B,EAAE,CAAC,CAAC;YAC5E,iBAAiB,CAAC,GAAG,CAAC,CAAC;YACvB,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAEjB,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEnE,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nconst STORAGE_PREFIX = 'return-scroll:';\n\nexport interface ReturnScrollEntry {\n y: number;\n savedAt: number;\n}\n\nexport interface UseReturnScrollOptions {\n key: string;\n eligible: boolean;\n ready: boolean;\n}\n\nexport interface UseReturnScrollResult {\n save: () => void;\n}\n\nfunction storageKey(key: string): string {\n return `${STORAGE_PREFIX}${key}`;\n}\n\nfunction sessionStorageOrNull(): Storage | null {\n try {\n if (typeof window === 'undefined') return null;\n return window.sessionStorage ?? null;\n } catch {\n return null;\n }\n}\n\nexport function readReturnScroll(key: string): ReturnScrollEntry | null {\n const storage = sessionStorageOrNull();\n if (!storage) return null;\n try {\n const raw = storage.getItem(storageKey(key));\n if (!raw) return null;\n const parsed: unknown = JSON.parse(raw);\n if (typeof parsed !== 'object' || parsed === null) return null;\n const { y, savedAt } = parsed as { y?: unknown; savedAt?: unknown };\n if (typeof y !== 'number' || !Number.isFinite(y) || y < 0) return null;\n return { y, savedAt: typeof savedAt === 'number' ? savedAt : 0 };\n } catch {\n return null;\n }\n}\n\nexport function saveReturnScroll(key: string, y?: number): void {\n const storage = sessionStorageOrNull();\n if (!storage) return;\n try {\n const offset = typeof y === 'number' ? y : window.scrollY;\n const entry: ReturnScrollEntry = { y: offset, savedAt: Date.now() };\n storage.setItem(storageKey(key), JSON.stringify(entry));\n } catch {}\n}\n\nexport function clearReturnScroll(key: string): void {\n const storage = sessionStorageOrNull();\n if (!storage) return;\n try {\n storage.removeItem(storageKey(key));\n } catch {}\n}\n\ninterface Decision {\n key: string;\n y: number | null;\n done: boolean;\n}\n\nexport function useReturnScroll({\n key,\n eligible,\n ready,\n}: UseReturnScrollOptions): UseReturnScrollResult {\n const decisionRef = React.useRef<Decision | null>(null);\n\n React.useEffect(() => {\n if (decisionRef.current?.key === key) return;\n const entry = readReturnScroll(key);\n if (!entry) {\n decisionRef.current = { key, y: null, done: true };\n return;\n }\n if (!eligible) {\n clearReturnScroll(key);\n decisionRef.current = { key, y: null, done: true };\n return;\n }\n decisionRef.current = { key, y: entry.y, done: false };\n }, [key, eligible]);\n\n React.useEffect(() => {\n const decision = decisionRef.current;\n if (!decision || decision.key !== key || decision.y === null || decision.done || !ready) return;\n if (typeof window === 'undefined') return;\n const y = decision.y;\n const frame = window.requestAnimationFrame(() => {\n window.scrollTo({ top: y, left: 0, behavior: 'instant' as ScrollBehavior });\n clearReturnScroll(key);\n decision.done = true;\n });\n return () => window.cancelAnimationFrame(frame);\n }, [key, ready]);\n\n const save = React.useCallback(() => saveReturnScroll(key), [key]);\n\n return { save };\n}\n"]}
|
|
@@ -6,18 +6,10 @@ export type ToasterToast = {
|
|
|
6
6
|
description?: React.ReactNode;
|
|
7
7
|
action?: React.ReactNode;
|
|
8
8
|
variant?: ToastVariant;
|
|
9
|
-
/** Radix controlled open state */
|
|
10
9
|
open?: boolean;
|
|
11
10
|
onOpenChange?: (open: boolean) => void;
|
|
12
|
-
/** ms */
|
|
13
11
|
duration?: number;
|
|
14
|
-
/** show X button */
|
|
15
12
|
dismissible?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* When `true`, the toast does not auto-dismiss and renders no countdown bar.
|
|
18
|
-
* `duration` is ignored. The user must click the X (or programmatic `dismiss`)
|
|
19
|
-
* to remove it.
|
|
20
|
-
*/
|
|
21
13
|
persistent?: boolean;
|
|
22
14
|
};
|
|
23
15
|
type ToastProps = ToasterToast;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-toast.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,UAAU,GAAG,YAAY,CAAC;AAuF/B,wBAAgB,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC;;;oBAQ1B,OAAO,CAAC,UAAU,CAAC;EAwB3C;AAED,wBAAgB,QAAQ;;wBAcA,MAAM;YA9HpB,UAAU,EAAE;EAmIrB"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
const TOAST_LIMIT = 3;
|
|
3
|
-
//
|
|
4
|
-
// Just long enough for the close animation to finish. Larger values produce a
|
|
5
|
-
// visible dead-air gap after the countdown bar reaches empty.
|
|
3
|
+
// Long enough for the close animation; longer leaves dead air after the countdown bar empties.
|
|
6
4
|
const TOAST_REMOVE_DELAY = 150;
|
|
7
5
|
const toastTimeouts = new Map();
|
|
8
6
|
const listeners = [];
|
|
@@ -74,7 +72,6 @@ export function toast(input) {
|
|
|
74
72
|
};
|
|
75
73
|
const update = (props) => dispatch({ type: 'UPDATE_TOAST', toast: { ...props, id } });
|
|
76
74
|
const variant = input.variant ?? 'default';
|
|
77
|
-
// Persistent toasts disable auto-dismiss entirely; Radix accepts `Infinity`.
|
|
78
75
|
const duration = input.persistent
|
|
79
76
|
? Infinity
|
|
80
77
|
: (input.duration ?? defaultDurationForVariant(variant));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast.js","sourceRoot":"","sources":["../../../src/react/hooks/use-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB
|
|
1
|
+
{"version":3,"file":"use-toast.js","sourceRoot":"","sources":["../../../src/react/hooks/use-toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,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EAAE,IAAI;YACjB,GAAG,KAAK;YACR,OAAO;YACP,QAAQ;SACT;KACF,CAAC,CAAC;IAEH,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAQ,WAAW,CAAC,CAAC;IAE7D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzB,OAAO,GAAG,EAAE;YACV,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAC1C,IAAI,KAAK,GAAG,CAAC,CAAC;gBAAE,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,GAAG,KAAK;QACR,KAAK;QACL,OAAO,EAAE,CAAC,OAAgB,EAAE,EAAE;YAC5B,QAAQ,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7C,IAAI,OAAO;gBAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\n\nconst TOAST_LIMIT = 3;\n// Long enough for the close animation; longer leaves dead air after the countdown bar empties.\nconst TOAST_REMOVE_DELAY = 150;\n\nexport type ToastVariant = 'default' | 'destructive' | 'success' | 'warning' | 'error';\n\nexport type ToasterToast = {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: React.ReactNode;\n variant?: ToastVariant;\n\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n\n duration?: number;\n\n dismissible?: boolean;\n\n persistent?: boolean;\n};\n\ntype ToastProps = ToasterToast;\n\ntype Action =\n | { type: 'ADD_TOAST'; toast: ToastProps }\n | { type: 'UPDATE_TOAST'; toast: Partial<ToastProps> & { id: string } }\n | { type: 'DISMISS_TOAST'; toastId?: string }\n | { type: 'REMOVE_TOAST'; toastId?: string };\n\ninterface State {\n toasts: ToastProps[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nconst reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case 'ADD_TOAST':\n return { ...state, toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT) };\n\n case 'UPDATE_TOAST':\n return {\n ...state,\n toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),\n };\n\n case 'DISMISS_TOAST': {\n const { toastId } = action;\n\n if (toastId) {\n return {\n ...state,\n toasts: state.toasts.map((t) => (t.id === toastId ? { ...t, open: false } : t)),\n };\n }\n\n return { ...state, toasts: state.toasts.map((t) => ({ ...t, open: false })) };\n }\n\n case 'REMOVE_TOAST': {\n const { toastId } = action;\n if (!toastId) return { ...state, toasts: [] };\n return { ...state, toasts: state.toasts.filter((t) => t.id !== toastId) };\n }\n\n default:\n return state;\n }\n};\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => listener(memoryState));\n}\n\nfunction genId() {\n return Math.random().toString(36).slice(2, 10);\n}\n\nfunction addToRemoveQueue(toastId: string) {\n if (toastTimeouts.has(toastId)) return;\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({ type: 'REMOVE_TOAST', toastId });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n}\n\nfunction defaultDurationForVariant(variant: ToastVariant | undefined): number {\n switch (variant) {\n case 'success':\n return 3000;\n case 'destructive':\n case 'error':\n return 6000;\n case 'warning':\n return 5000;\n case 'default':\n default:\n return 4000;\n }\n}\n\nexport function toast(input: Omit<ToastProps, 'id'>) {\n const id = genId();\n\n const dismiss = () => {\n dispatch({ type: 'DISMISS_TOAST', toastId: id });\n addToRemoveQueue(id);\n };\n\n const update = (props: Partial<ToastProps>) =>\n dispatch({ type: 'UPDATE_TOAST', toast: { ...props, id } });\n\n const variant = input.variant ?? 'default';\n const duration = input.persistent\n ? Infinity\n : (input.duration ?? defaultDurationForVariant(variant));\n\n dispatch({\n type: 'ADD_TOAST',\n toast: {\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n dismissible: true,\n ...input,\n variant,\n duration,\n },\n });\n\n return { id, dismiss, update };\n}\n\nexport function useToast() {\n const [state, setState] = React.useState<State>(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) listeners.splice(index, 1);\n };\n }, []);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => {\n dispatch({ type: 'DISMISS_TOAST', toastId });\n if (toastId) addToRemoveQueue(toastId);\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,YAAY,EACV,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BA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AAM,sCAAsC,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,YAAY,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAExF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EACV,mBAAmB,EACnB,SAAS,EACT,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEhG,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,8BAA8B,CAAC"}
|
package/dist/react/index.js
CHANGED
|
@@ -39,20 +39,14 @@ export { ConsequenceDialog } from './components/consequence-dialog.js';
|
|
|
39
39
|
export { ScreenAdaptiveView } from './components/layout/screen-adaptive-view.js';
|
|
40
40
|
export { useMediaQuery } from './hooks/use-media-query.js';
|
|
41
41
|
export { useAsyncAction } from './hooks/use-async-action.js';
|
|
42
|
-
// Shared building blocks
|
|
43
42
|
export { RelativeTime } from './components/relative-time.js';
|
|
44
43
|
export { EndOfListIndicator } from './components/end-of-list-indicator.js';
|
|
45
44
|
export { ScrollToTopButton } from './components/scroll-to-top-button.js';
|
|
46
45
|
export { ActionRow } from './components/action-row.js';
|
|
47
46
|
export { ShowMoreToggle } from './components/show-more-toggle.js';
|
|
48
47
|
export { ReloadRecoveryNotice } from './components/reload-recovery-notice.js';
|
|
49
|
-
// List pagination — the one Previous / counter / Next control plus the page-state
|
|
50
|
-
// hooks for its two flavors (known total, and cursor/`hasMore`).
|
|
51
48
|
export { ListPagination } from './components/list-pagination.js';
|
|
52
49
|
export { usePagedList } from './hooks/use-paged-list.js';
|
|
53
50
|
export { useCursorPage } from './hooks/use-cursor-page.js';
|
|
54
|
-
// Return-scroll: restore a list's window offset when the user comes back to it after a
|
|
55
|
-
// route change (save on leave, restore once on an eligible + ready return, keyed by the
|
|
56
|
-
// caller's canonical list URL).
|
|
57
51
|
export { useReturnScroll, saveReturnScroll, clearReturnScroll, readReturnScroll, } from './hooks/use-return-scroll.js';
|
|
58
52
|
//# sourceMappingURL=index.js.map
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAO9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WA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';\n\nexport type { ButtonProps } from './components/button.js';\nexport { Button, buttonVariants } from './components/button.js';\nexport type { SpinnerProps, SpinnerSize } from './components/spinner.js';\nexport { Spinner } from './components/spinner.js';\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardDescription,\n CardContent,\n} from './components/card.js';\nexport { Label } from './components/label.js';\nexport type {\n TextareaProps,\n FreeTextTextareaProps,\n NonFreeTextTextareaProps,\n NonFreeTextareaEntry,\n} from './components/textarea.js';\nexport { Textarea } from './components/textarea.js';\nexport { Skeleton } from './components/skeleton.js';\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './components/dialog.js';\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from './components/popover.js';\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './components/dropdown-menu.js';\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n} from './components/menubar.js';\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n} from './components/alert-dialog.js';\nexport { Alert, AlertTitle, AlertDescription } from './components/alert.js';\nexport type { ToastProps, ToastActionElement } from './components/toast.js';\nexport {\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n} from './components/toast.js';\nexport { Toaster } from './components/toaster.js';\nexport type { ToastVariant, ToasterToast } from './hooks/use-toast.js';\nexport { toast, useToast } from './hooks/use-toast.js';\nexport type {\n InputProps,\n FreeTextInputProps,\n NonFreeTextInputProps,\n NonFreeTextEntry,\n BuiltInFormatInputProps,\n BuiltInFormatInputType,\n} from './components/input.js';\nexport { Input } from './components/input.js';\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n} from './components/select.js';\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './components/tabs.js';\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/tooltip.js';\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n} from './components/form.js';\nexport { Checkbox } from './components/checkbox.js';\nexport { Switch } from './components/switch.js';\nexport type { BadgeProps } from './components/badge.js';\nexport { Badge, badgeVariants } from './components/badge.js';\nexport { Avatar, AvatarImage, AvatarFallback } from './components/avatar.js';\nexport { Separator } from './components/separator.js';\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from './components/accordion.js';\nexport { RadioGroup, RadioGroupItem } from './components/radio-group.js';\nexport { Progress } from './components/progress.js';\nexport { Slider } from './components/slider.js';\nexport type { DatePickerProps } from './components/date-picker.js';\nexport { DatePicker } from './components/date-picker.js';\nexport type { DateTimePickerProps, DateTimePickerTime } from './components/date-time-picker.js';\nexport { DateTimePicker } from './components/date-time-picker.js';\nexport { ScrollArea, ScrollBar } from './components/scroll-area.js';\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n SortableTableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from './components/table.js';\nexport type { SortableTableHeadProps, SortDirection } from './components/table.js';\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from './components/sheet.js';\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent } from './components/collapsible.js';\nexport type { SearchDropdownProps } from './components/search-dropdown.js';\nexport { SearchDropdown } from './components/search-dropdown.js';\n\nexport type {\n ConsequenceDialogProps,\n ConsequenceDialogReason,\n ConsequenceDialogTypedConfirmation,\n} from './components/consequence-dialog.js';\nexport { ConsequenceDialog } from './components/consequence-dialog.js';\n\nexport type {\n MaxWidthOption,\n ScreenAdaptiveViewProps,\n} from './components/layout/screen-adaptive-view.js';\nexport { ScreenAdaptiveView } from './components/layout/screen-adaptive-view.js';\n\nexport { useMediaQuery } from './hooks/use-media-query.js';\n\nexport { useAsyncAction } from './hooks/use-async-action.js';\nexport type { AsyncAction, UseAsyncActionOptions } from './hooks/use-async-action.js';\n\n// Shared building blocks\nexport { RelativeTime } from './components/relative-time.js';\nexport type { RelativeTimeProps } from './components/relative-time.js';\n\nexport { EndOfListIndicator } from './components/end-of-list-indicator.js';\nexport type { EndOfListIndicatorProps } from './components/end-of-list-indicator.js';\n\nexport { ScrollToTopButton } from './components/scroll-to-top-button.js';\nexport type { ScrollToTopButtonProps } from './components/scroll-to-top-button.js';\n\nexport { ActionRow } from './components/action-row.js';\nexport type {\n ActionRowProps,\n ActionRowButtonProps,\n ActionRowLinkProps,\n ActionRowLinkTargetProps,\n} from './components/action-row.js';\n\nexport { ShowMoreToggle } from './components/show-more-toggle.js';\nexport type { ShowMoreToggleProps } from './components/show-more-toggle.js';\n\nexport { ReloadRecoveryNotice } from './components/reload-recovery-notice.js';\nexport type { ReloadRecoveryNoticeProps } from './components/reload-recovery-notice.js';\n\n// List pagination — the one Previous / counter / Next control plus the page-state\n// hooks for its two flavors (known total, and cursor/`hasMore`).\nexport { ListPagination } from './components/list-pagination.js';\nexport type { ListPaginationProps } from './components/list-pagination.js';\n\nexport { usePagedList } from './hooks/use-paged-list.js';\nexport type {\n ListPaginationState,\n PagedList,\n UsePagedListOptions,\n} from './hooks/use-paged-list.js';\n\nexport { useCursorPage } from './hooks/use-cursor-page.js';\nexport type { CursorPage, CursorPager, UseCursorPageOptions } from './hooks/use-cursor-page.js';\n\n// Return-scroll: restore a list's window offset when the user comes back to it after a\n// route change (save on leave, restore once on an eligible + ready return, keyed by the\n// caller's canonical list URL).\nexport {\n useReturnScroll,\n saveReturnScroll,\n clearReturnScroll,\n readReturnScroll,\n} from './hooks/use-return-scroll.js';\nexport type {\n ReturnScrollEntry,\n UseReturnScrollOptions,\n UseReturnScrollResult,\n} from './hooks/use-return-scroll.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAO9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACj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BAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAElG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAOjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAMvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAG3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAGzE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAQvD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGlE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAG9E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAOzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,8BAA8B,CAAC","sourcesContent":["'use client';\n\nexport type { ButtonProps } from './components/button.js';\nexport { Button, buttonVariants } from './components/button.js';\nexport type { SpinnerProps, SpinnerSize } from './components/spinner.js';\nexport { Spinner } from './components/spinner.js';\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardDescription,\n CardContent,\n} from './components/card.js';\nexport { Label } from './components/label.js';\nexport type {\n TextareaProps,\n FreeTextTextareaProps,\n NonFreeTextTextareaProps,\n NonFreeTextareaEntry,\n} from './components/textarea.js';\nexport { Textarea } from './components/textarea.js';\nexport { Skeleton } from './components/skeleton.js';\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './components/dialog.js';\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from './components/popover.js';\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './components/dropdown-menu.js';\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n} from './components/menubar.js';\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n} from './components/alert-dialog.js';\nexport { Alert, AlertTitle, AlertDescription } from './components/alert.js';\nexport type { ToastProps, ToastActionElement } from './components/toast.js';\nexport {\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n} from './components/toast.js';\nexport { Toaster } from './components/toaster.js';\nexport type { ToastVariant, ToasterToast } from './hooks/use-toast.js';\nexport { toast, useToast } from './hooks/use-toast.js';\nexport type {\n InputProps,\n FreeTextInputProps,\n NonFreeTextInputProps,\n NonFreeTextEntry,\n BuiltInFormatInputProps,\n BuiltInFormatInputType,\n} from './components/input.js';\nexport { Input } from './components/input.js';\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n} from './components/select.js';\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './components/tabs.js';\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/tooltip.js';\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n} from './components/form.js';\nexport { Checkbox } from './components/checkbox.js';\nexport { Switch } from './components/switch.js';\nexport type { BadgeProps } from './components/badge.js';\nexport { Badge, badgeVariants } from './components/badge.js';\nexport { Avatar, AvatarImage, AvatarFallback } from './components/avatar.js';\nexport { Separator } from './components/separator.js';\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from './components/accordion.js';\nexport { RadioGroup, RadioGroupItem } from './components/radio-group.js';\nexport { Progress } from './components/progress.js';\nexport { Slider } from './components/slider.js';\nexport type { DatePickerProps } from './components/date-picker.js';\nexport { DatePicker } from './components/date-picker.js';\nexport type { DateTimePickerProps, DateTimePickerTime } from './components/date-time-picker.js';\nexport { DateTimePicker } from './components/date-time-picker.js';\nexport { ScrollArea, ScrollBar } from './components/scroll-area.js';\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n SortableTableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from './components/table.js';\nexport type { SortableTableHeadProps, SortDirection } from './components/table.js';\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from './components/sheet.js';\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent } from './components/collapsible.js';\nexport type { SearchDropdownProps } from './components/search-dropdown.js';\nexport { SearchDropdown } from './components/search-dropdown.js';\n\nexport type {\n ConsequenceDialogProps,\n ConsequenceDialogReason,\n ConsequenceDialogTypedConfirmation,\n} from './components/consequence-dialog.js';\nexport { ConsequenceDialog } from './components/consequence-dialog.js';\n\nexport type {\n MaxWidthOption,\n ScreenAdaptiveViewProps,\n} from './components/layout/screen-adaptive-view.js';\nexport { ScreenAdaptiveView } from './components/layout/screen-adaptive-view.js';\n\nexport { useMediaQuery } from './hooks/use-media-query.js';\n\nexport { useAsyncAction } from './hooks/use-async-action.js';\nexport type { AsyncAction, UseAsyncActionOptions } from './hooks/use-async-action.js';\n\nexport { RelativeTime } from './components/relative-time.js';\nexport type { RelativeTimeProps } from './components/relative-time.js';\n\nexport { EndOfListIndicator } from './components/end-of-list-indicator.js';\nexport type { EndOfListIndicatorProps } from './components/end-of-list-indicator.js';\n\nexport { ScrollToTopButton } from './components/scroll-to-top-button.js';\nexport type { ScrollToTopButtonProps } from './components/scroll-to-top-button.js';\n\nexport { ActionRow } from './components/action-row.js';\nexport type {\n ActionRowProps,\n ActionRowButtonProps,\n ActionRowLinkProps,\n ActionRowLinkTargetProps,\n} from './components/action-row.js';\n\nexport { ShowMoreToggle } from './components/show-more-toggle.js';\nexport type { ShowMoreToggleProps } from './components/show-more-toggle.js';\n\nexport { ReloadRecoveryNotice } from './components/reload-recovery-notice.js';\nexport type { ReloadRecoveryNoticeProps } from './components/reload-recovery-notice.js';\n\nexport { ListPagination } from './components/list-pagination.js';\nexport type { ListPaginationProps } from './components/list-pagination.js';\n\nexport { usePagedList } from './hooks/use-paged-list.js';\nexport type {\n ListPaginationState,\n PagedList,\n UsePagedListOptions,\n} from './hooks/use-paged-list.js';\n\nexport { useCursorPage } from './hooks/use-cursor-page.js';\nexport type { CursorPage, CursorPager, UseCursorPageOptions } from './hooks/use-cursor-page.js';\n\nexport {\n useReturnScroll,\n saveReturnScroll,\n clearReturnScroll,\n readReturnScroll,\n} from './hooks/use-return-scroll.js';\nexport type {\n ReturnScrollEntry,\n UseReturnScrollOptions,\n UseReturnScrollResult,\n} from './hooks/use-return-scroll.js';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttt-productions/ui-core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.35",
|
|
4
4
|
"description": "Shared UI components for TTT Productions projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"react-dom": ">=19.0.0",
|
|
54
54
|
"react-hook-form": ">=7.0.0",
|
|
55
55
|
"@hookform/resolvers": ">=3.0.0",
|
|
56
|
-
"@ttt-productions/firebase-helpers": "^0.12.
|
|
56
|
+
"@ttt-productions/firebase-helpers": "^0.12.15",
|
|
57
57
|
"lucide-react": "^1.30.0",
|
|
58
58
|
"date-fns": ">=3.0.0"
|
|
59
59
|
},
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
96
96
|
"@radix-ui/react-toast": "^1.2.15",
|
|
97
97
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
98
|
-
"@ttt-productions/input-format-core": "^0.1.
|
|
98
|
+
"@ttt-productions/input-format-core": "^0.1.3",
|
|
99
99
|
"class-variance-authority": "^0.7.0",
|
|
100
100
|
"clsx": "^2.1.1",
|
|
101
101
|
"tailwind-merge": "^3.6.0"
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"react-dom": "^19.2.0",
|
|
108
108
|
"react-hook-form": "^7.69.0",
|
|
109
109
|
"@hookform/resolvers": "^5.2.2",
|
|
110
|
-
"@ttt-productions/firebase-helpers": "^0.12.
|
|
110
|
+
"@ttt-productions/firebase-helpers": "^0.12.15",
|
|
111
111
|
"lucide-react": "^1.30.0",
|
|
112
112
|
"date-fns": "^4.1.0"
|
|
113
113
|
},
|