@ttt-productions/ui-core 0.11.33 → 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 +2 -2
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +1 -2
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/reload-recovery-watch.d.ts +2 -6
- package/dist/browser/reload-recovery-watch.d.ts.map +1 -1
- package/dist/browser/reload-recovery-watch.js +5 -10
- package/dist/browser/reload-recovery-watch.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- 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 +2 -8
- 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 +14 -24
- 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 +2 -2
- package/dist/react/components/accordion.d.ts.map +1 -1
- package/dist/react/components/accordion.js +8 -8
- package/dist/react/components/accordion.js.map +1 -1
- package/dist/react/components/action-row.d.ts +2 -9
- package/dist/react/components/action-row.d.ts.map +1 -1
- package/dist/react/components/action-row.js +7 -11
- package/dist/react/components/action-row.js.map +1 -1
- package/dist/react/components/alert-dialog.d.ts +2 -2
- package/dist/react/components/alert-dialog.d.ts.map +1 -1
- package/dist/react/components/alert-dialog.js +15 -15
- package/dist/react/components/alert-dialog.js.map +1 -1
- package/dist/react/components/alert.d.ts +2 -2
- package/dist/react/components/alert.d.ts.map +1 -1
- package/dist/react/components/alert.js +12 -12
- package/dist/react/components/alert.js.map +1 -1
- package/dist/react/components/avatar.d.ts +2 -2
- package/dist/react/components/avatar.d.ts.map +1 -1
- package/dist/react/components/avatar.js +7 -7
- package/dist/react/components/avatar.js.map +1 -1
- package/dist/react/components/badge.d.ts +2 -2
- package/dist/react/components/badge.d.ts.map +1 -1
- package/dist/react/components/badge.js +9 -9
- package/dist/react/components/badge.js.map +1 -1
- package/dist/react/components/button.d.ts +2 -12
- package/dist/react/components/button.d.ts.map +1 -1
- package/dist/react/components/button.js +30 -35
- package/dist/react/components/button.js.map +1 -1
- package/dist/react/components/card.d.ts +1 -1
- package/dist/react/components/card.d.ts.map +1 -1
- package/dist/react/components/card.js +15 -15
- package/dist/react/components/card.js.map +1 -1
- package/dist/react/components/checkbox.d.ts +2 -2
- package/dist/react/components/checkbox.d.ts.map +1 -1
- package/dist/react/components/checkbox.js +6 -6
- package/dist/react/components/checkbox.js.map +1 -1
- package/dist/react/components/collapsible.d.ts +1 -1
- package/dist/react/components/collapsible.d.ts.map +1 -1
- package/dist/react/components/collapsible.js +2 -2
- package/dist/react/components/collapsible.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 +7 -23
- package/dist/react/components/consequence-dialog.js.map +1 -1
- package/dist/react/components/date-picker.d.ts +1 -18
- package/dist/react/components/date-picker.d.ts.map +1 -1
- package/dist/react/components/date-picker.js +102 -98
- package/dist/react/components/date-picker.js.map +1 -1
- package/dist/react/components/date-time-picker.d.ts +1 -24
- package/dist/react/components/date-time-picker.d.ts.map +1 -1
- package/dist/react/components/date-time-picker.js +20 -37
- package/dist/react/components/date-time-picker.js.map +1 -1
- package/dist/react/components/dialog.d.ts +2 -2
- package/dist/react/components/dialog.d.ts.map +1 -1
- package/dist/react/components/dialog.js +14 -14
- package/dist/react/components/dialog.js.map +1 -1
- package/dist/react/components/dropdown-menu.d.ts +2 -10
- package/dist/react/components/dropdown-menu.d.ts.map +1 -1
- package/dist/react/components/dropdown-menu.js +24 -20
- package/dist/react/components/dropdown-menu.js.map +1 -1
- package/dist/react/components/end-of-list-indicator.d.ts +1 -1
- package/dist/react/components/end-of-list-indicator.js +3 -3
- package/dist/react/components/end-of-list-indicator.js.map +1 -1
- package/dist/react/components/form.d.ts +3 -3
- package/dist/react/components/form.d.ts.map +1 -1
- package/dist/react/components/form.js +17 -17
- package/dist/react/components/form.js.map +1 -1
- package/dist/react/components/format-control.d.ts +7 -20
- package/dist/react/components/format-control.d.ts.map +1 -1
- package/dist/react/components/format-control.js +18 -22
- package/dist/react/components/format-control.js.map +1 -1
- package/dist/react/components/input.d.ts +10 -27
- package/dist/react/components/input.d.ts.map +1 -1
- package/dist/react/components/input.js +11 -9
- package/dist/react/components/input.js.map +1 -1
- package/dist/react/components/label.d.ts +3 -3
- package/dist/react/components/label.d.ts.map +1 -1
- package/dist/react/components/label.js +6 -6
- package/dist/react/components/label.js.map +1 -1
- package/dist/react/components/layout/screen-adaptive-view.d.ts +2 -9
- package/dist/react/components/layout/screen-adaptive-view.d.ts.map +1 -1
- package/dist/react/components/layout/screen-adaptive-view.js +40 -37
- package/dist/react/components/layout/screen-adaptive-view.js.map +1 -1
- package/dist/react/components/list-pagination.d.ts +1 -31
- package/dist/react/components/list-pagination.d.ts.map +1 -1
- package/dist/react/components/list-pagination.js +10 -37
- package/dist/react/components/list-pagination.js.map +1 -1
- package/dist/react/components/menubar.d.ts +2 -2
- package/dist/react/components/menubar.d.ts.map +1 -1
- package/dist/react/components/menubar.js +17 -17
- package/dist/react/components/menubar.js.map +1 -1
- package/dist/react/components/opener-focus.d.ts +2 -8
- package/dist/react/components/opener-focus.d.ts.map +1 -1
- package/dist/react/components/opener-focus.js +4 -10
- package/dist/react/components/opener-focus.js.map +1 -1
- package/dist/react/components/pending-guard.d.ts +1 -7
- package/dist/react/components/pending-guard.d.ts.map +1 -1
- package/dist/react/components/pending-guard.js +1 -7
- package/dist/react/components/pending-guard.js.map +1 -1
- package/dist/react/components/popover.d.ts +2 -2
- package/dist/react/components/popover.d.ts.map +1 -1
- package/dist/react/components/popover.js +5 -5
- package/dist/react/components/popover.js.map +1 -1
- package/dist/react/components/progress.d.ts +2 -2
- package/dist/react/components/progress.d.ts.map +1 -1
- package/dist/react/components/progress.js +5 -5
- package/dist/react/components/progress.js.map +1 -1
- package/dist/react/components/radio-group.d.ts +2 -2
- package/dist/react/components/radio-group.d.ts.map +1 -1
- package/dist/react/components/radio-group.js +7 -7
- package/dist/react/components/radio-group.js.map +1 -1
- package/dist/react/components/relative-time.d.ts +1 -9
- package/dist/react/components/relative-time.d.ts.map +1 -1
- package/dist/react/components/relative-time.js +8 -11
- package/dist/react/components/relative-time.js.map +1 -1
- package/dist/react/components/reload-recovery-notice.d.ts +3 -17
- package/dist/react/components/reload-recovery-notice.d.ts.map +1 -1
- package/dist/react/components/reload-recovery-notice.js +7 -12
- package/dist/react/components/reload-recovery-notice.js.map +1 -1
- package/dist/react/components/scroll-area.d.ts +2 -2
- package/dist/react/components/scroll-area.d.ts.map +1 -1
- package/dist/react/components/scroll-area.js +6 -8
- package/dist/react/components/scroll-area.js.map +1 -1
- package/dist/react/components/scroll-to-top-button.d.ts +6 -30
- package/dist/react/components/scroll-to-top-button.d.ts.map +1 -1
- package/dist/react/components/scroll-to-top-button.js +9 -9
- 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 +10 -39
- package/dist/react/components/search-dropdown.js.map +1 -1
- package/dist/react/components/select.d.ts +2 -9
- package/dist/react/components/select.d.ts.map +1 -1
- package/dist/react/components/select.js +19 -21
- package/dist/react/components/select.js.map +1 -1
- package/dist/react/components/separator.d.ts +2 -2
- package/dist/react/components/separator.d.ts.map +1 -1
- package/dist/react/components/separator.js +5 -5
- package/dist/react/components/separator.js.map +1 -1
- package/dist/react/components/sheet.d.ts +3 -3
- package/dist/react/components/sheet.d.ts.map +1 -1
- package/dist/react/components/sheet.js +21 -21
- package/dist/react/components/sheet.js.map +1 -1
- package/dist/react/components/show-more-toggle.d.ts +2 -18
- package/dist/react/components/show-more-toggle.d.ts.map +1 -1
- package/dist/react/components/show-more-toggle.js +6 -11
- package/dist/react/components/show-more-toggle.js.map +1 -1
- package/dist/react/components/skeleton.d.ts +1 -1
- package/dist/react/components/skeleton.d.ts.map +1 -1
- package/dist/react/components/skeleton.js +3 -3
- package/dist/react/components/skeleton.js.map +1 -1
- package/dist/react/components/slider.d.ts +2 -2
- package/dist/react/components/slider.d.ts.map +1 -1
- package/dist/react/components/slider.js +5 -5
- package/dist/react/components/slider.js.map +1 -1
- package/dist/react/components/spinner.d.ts +1 -15
- package/dist/react/components/spinner.d.ts.map +1 -1
- package/dist/react/components/spinner.js +10 -18
- package/dist/react/components/spinner.js.map +1 -1
- package/dist/react/components/switch.d.ts +2 -9
- package/dist/react/components/switch.d.ts.map +1 -1
- package/dist/react/components/switch.js +13 -10
- package/dist/react/components/switch.js.map +1 -1
- package/dist/react/components/table.d.ts +2 -12
- package/dist/react/components/table.d.ts.map +1 -1
- package/dist/react/components/table.js +24 -30
- package/dist/react/components/table.js.map +1 -1
- package/dist/react/components/tabs.d.ts +2 -2
- package/dist/react/components/tabs.d.ts.map +1 -1
- package/dist/react/components/tabs.js +7 -7
- package/dist/react/components/tabs.js.map +1 -1
- package/dist/react/components/textarea.d.ts +5 -16
- package/dist/react/components/textarea.d.ts.map +1 -1
- package/dist/react/components/textarea.js +11 -9
- package/dist/react/components/textarea.js.map +1 -1
- package/dist/react/components/toast.d.ts +4 -8
- package/dist/react/components/toast.d.ts.map +1 -1
- package/dist/react/components/toast.js +26 -47
- 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 +5 -5
- package/dist/react/components/toaster.js.map +1 -1
- package/dist/react/components/tooltip.d.ts +2 -2
- package/dist/react/components/tooltip.d.ts.map +1 -1
- package/dist/react/components/tooltip.js +5 -5
- package/dist/react/components/tooltip.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 +3 -11
- package/dist/react/hooks/use-async-action.js.map +1 -1
- package/dist/react/hooks/use-cursor-page.d.ts +1 -63
- package/dist/react/hooks/use-cursor-page.d.ts.map +1 -1
- package/dist/react/hooks/use-cursor-page.js +3 -39
- package/dist/react/hooks/use-cursor-page.js.map +1 -1
- package/dist/react/hooks/use-media-query.js +5 -5
- package/dist/react/hooks/use-media-query.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 +2 -17
- package/dist/react/hooks/use-paged-list.js.map +1 -1
- package/dist/react/hooks/use-return-scroll.d.ts +1 -10
- package/dist/react/hooks/use-return-scroll.d.ts.map +1 -1
- package/dist/react/hooks/use-return-scroll.js +13 -45
- package/dist/react/hooks/use-return-scroll.js.map +1 -1
- package/dist/react/hooks/use-toast.d.ts +3 -11
- package/dist/react/hooks/use-toast.d.ts.map +1 -1
- package/dist/react/hooks/use-toast.js +18 -21
- package/dist/react/hooks/use-toast.js.map +1 -1
- package/dist/react/index.d.ts +74 -74
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +51 -57
- package/dist/react/index.js.map +1 -1
- package/package.json +8 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-adaptive-view.js","sourceRoot":"","sources":["../../../../src/react/components/layout/screen-adaptive-view.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"screen-adaptive-view.js","sourceRoot":"","sources":["../../../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SAAS,IAAI,SAAS,KAAK,IAAI;YACrD,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,QAAQ,CAAC;IAEjB,MAAM,SAAS,GAAG,IAAI;QACpB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;QACxB,CAAC,CAAC,IAAI;YACJ,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;YACxB,CAAC,CAAC,mBAAmB,CAAC;IAE1B,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,YACnD,cAAK,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,EAAE,cAAc,CAAC,YAAG,aAAa,GAAO,GACzF,CACP,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../../lib/utils.js';\nimport { useMediaQuery } from '../../hooks/use-media-query.js';\n\nexport type MaxWidthOption =\n 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | 'full';\n\nexport interface ScreenAdaptiveViewProps {\n children: React.ReactNode;\n\n lgContent?: React.ReactNode;\n\n xlContent?: React.ReactNode;\n\n lgMaxWidth?: MaxWidthOption;\n\n xlMaxWidth?: MaxWidthOption;\n\n className?: string;\n\n innerClassName?: string;\n}\n\nfunction widthClass(opt: MaxWidthOption | undefined) {\n switch (opt) {\n case 'none':\n return 'screen-max-w-none';\n case 'sm':\n return 'screen-max-w-sm';\n case 'md':\n return 'screen-max-w-md';\n case 'lg':\n return 'screen-max-w-lg';\n case 'xl':\n return 'screen-max-w-xl';\n case '2xl':\n return 'screen-max-w-2xl';\n case '3xl':\n return 'screen-max-w-3xl';\n case '4xl':\n return 'screen-max-w-4xl';\n case '5xl':\n return 'screen-max-w-5xl';\n case '6xl':\n return 'screen-max-w-6xl';\n case '7xl':\n return 'screen-max-w-7xl';\n case 'full':\n return 'screen-max-w-full';\n default:\n return 'screen-max-w-6xl';\n }\n}\n\nexport function ScreenAdaptiveView({\n children,\n lgContent,\n xlContent,\n lgMaxWidth = '4xl',\n xlMaxWidth = '6xl',\n className,\n innerClassName,\n}: ScreenAdaptiveViewProps) {\n const isLg = useMediaQuery('(min-width: 1024px)');\n const isXl = useMediaQuery('(min-width: 1280px)');\n\n // SSR-safe: base children render until hydration, then lg/xl content swaps in.\n const contentToShow =\n isXl && xlContent !== undefined && xlContent !== null\n ? xlContent\n : isLg && lgContent !== undefined && lgContent !== null\n ? lgContent\n : children;\n\n const sizeClass = isXl\n ? widthClass(xlMaxWidth)\n : isLg\n ? widthClass(lgMaxWidth)\n : 'screen-max-w-full';\n\n return (\n <div className={cn('screen-adaptive-root', className)}>\n <div className={cn('screen-adaptive-inner', sizeClass, innerClassName)}>{contentToShow}</div>\n </div>\n );\n}\n"]}
|
|
@@ -1,38 +1,8 @@
|
|
|
1
|
-
import type { ListPaginationState } from
|
|
1
|
+
import type { ListPaginationState } from '../hooks/use-paged-list.js';
|
|
2
2
|
export interface ListPaginationProps {
|
|
3
|
-
/**
|
|
4
|
-
* Page state from `usePagedList` (known total),
|
|
5
|
-
* `useCursorPage().paginationFor(hasMore)` (unknown total), or any
|
|
6
|
-
* caller-owned state of the same shape.
|
|
7
|
-
*/
|
|
8
3
|
pagination: ListPaginationState;
|
|
9
|
-
/**
|
|
10
|
-
* Makes BOTH controls unavailable while the next page is in flight, without hiding
|
|
11
|
-
* the row. Server-paged surfaces pass their query's `isFetching`; a slice-paged
|
|
12
|
-
* list has nothing to wait for and omits it.
|
|
13
|
-
*/
|
|
14
4
|
busy?: boolean;
|
|
15
|
-
/** Optional extra classes. Merged with the component's own classes. */
|
|
16
5
|
className?: string;
|
|
17
6
|
}
|
|
18
|
-
/**
|
|
19
|
-
* The ONE Previous / counter / Next control for paginated lists, in both
|
|
20
|
-
* flavors. Pair it with the hook that owns the page state (`usePagedList` for a
|
|
21
|
-
* client-side slice, `useCursorPage` — or the caller's own query state — for a
|
|
22
|
-
* cursor feed; a cursor feed passes `pager.paginationFor(hasMore)`, which binds
|
|
23
|
-
* the query's answer to these controls); this component owns only the controls,
|
|
24
|
-
* so every paginated list reads and behaves the same (ENG-002, FRONTEND-001).
|
|
25
|
-
*
|
|
26
|
-
* The counter follows the flavor: a known `totalPages` reads "2 of 5", an
|
|
27
|
-
* omitted one reads "Page 2". Everything else is identical in both flavors —
|
|
28
|
-
* which is exactly why there is one component and not two.
|
|
29
|
-
*
|
|
30
|
-
* It renders NOTHING when neither direction is available, so no call site
|
|
31
|
-
* repeats a `totalPages > 1` / `page > 1 || hasMore` guard. An unavailable control
|
|
32
|
-
* — an edge, or either control while a page loads — is `aria-disabled` and ignores
|
|
33
|
-
* activation (announced, and inert), but is never natively disabled: the control the
|
|
34
|
-
* user just pressed keeps focus when it becomes unavailable (FRONTEND-203). The
|
|
35
|
-
* counter is a `status` live region so a page change is announced to screen readers.
|
|
36
|
-
*/
|
|
37
7
|
export declare function ListPagination({ pagination, busy, className }: ListPaginationProps): import("react").JSX.Element | null;
|
|
38
8
|
//# sourceMappingURL=list-pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-pagination.d.ts","sourceRoot":"","sources":["../../../src/react/components/list-pagination.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IAClC
|
|
1
|
+
{"version":3,"file":"list-pagination.d.ts","sourceRoot":"","sources":["../../../src/react/components/list-pagination.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,mBAAmB,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,IAAY,EAAE,SAAS,EAAE,EAAE,mBAAmB,sCAwD1F"}
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from
|
|
4
|
-
import { ChevronLeft, ChevronRight } from
|
|
5
|
-
import { Button } from
|
|
6
|
-
import { cn } from
|
|
7
|
-
/**
|
|
8
|
-
* The ONE Previous / counter / Next control for paginated lists, in both
|
|
9
|
-
* flavors. Pair it with the hook that owns the page state (`usePagedList` for a
|
|
10
|
-
* client-side slice, `useCursorPage` — or the caller's own query state — for a
|
|
11
|
-
* cursor feed; a cursor feed passes `pager.paginationFor(hasMore)`, which binds
|
|
12
|
-
* the query's answer to these controls); this component owns only the controls,
|
|
13
|
-
* so every paginated list reads and behaves the same (ENG-002, FRONTEND-001).
|
|
14
|
-
*
|
|
15
|
-
* The counter follows the flavor: a known `totalPages` reads "2 of 5", an
|
|
16
|
-
* omitted one reads "Page 2". Everything else is identical in both flavors —
|
|
17
|
-
* which is exactly why there is one component and not two.
|
|
18
|
-
*
|
|
19
|
-
* It renders NOTHING when neither direction is available, so no call site
|
|
20
|
-
* repeats a `totalPages > 1` / `page > 1 || hasMore` guard. An unavailable control
|
|
21
|
-
* — an edge, or either control while a page loads — is `aria-disabled` and ignores
|
|
22
|
-
* activation (announced, and inert), but is never natively disabled: the control the
|
|
23
|
-
* user just pressed keeps focus when it becomes unavailable (FRONTEND-203). The
|
|
24
|
-
* counter is a `status` live region so a page change is announced to screen readers.
|
|
25
|
-
*/
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
import { cn } from '../../lib/utils.js';
|
|
26
7
|
export function ListPagination({ pagination, busy = false, className }) {
|
|
27
8
|
const { currentPage, totalPages, canPreviousPage, canNextPage, goToPreviousPage, goToNextPage } = pagination;
|
|
28
|
-
// The control that started the in-flight page shows the spinner. Cleared when `busy`
|
|
29
|
-
// ends — a render-phase adjustment, so there is no effect and no stale frame.
|
|
30
9
|
const [clicked, setClicked] = useState(null);
|
|
31
10
|
const [wasBusy, setWasBusy] = useState(busy);
|
|
32
11
|
if (busy !== wasBusy) {
|
|
@@ -34,27 +13,21 @@ export function ListPagination({ pagination, busy = false, className }) {
|
|
|
34
13
|
if (!busy)
|
|
35
14
|
setClicked(null);
|
|
36
15
|
}
|
|
37
|
-
const previousPending = busy && clicked ===
|
|
38
|
-
const nextPending = busy && clicked ===
|
|
16
|
+
const previousPending = busy && clicked === 'previous';
|
|
17
|
+
const nextPending = busy && clicked === 'next';
|
|
39
18
|
const previousUnavailable = busy || !canPreviousPage;
|
|
40
19
|
const nextUnavailable = busy || !canNextPage;
|
|
41
|
-
// One visibility rule for both flavors. For a known total this is exactly
|
|
42
|
-
// `totalPages > 1`: page state is clamped into `1..totalPages`, so a
|
|
43
|
-
// single-page list has no reachable neighbour in either direction, and a
|
|
44
|
-
// multi-page list always has one. For a cursor feed it is the hand-rolled
|
|
45
|
-
// `page > 1 || hasMore`. `busy` deliberately does not hide the row — the
|
|
46
|
-
// controls grey out in place instead of vanishing mid-fetch.
|
|
47
20
|
if (!canPreviousPage && !canNextPage)
|
|
48
21
|
return null;
|
|
49
|
-
return (_jsxs("div", { className: cn(
|
|
22
|
+
return (_jsxs("div", { className: cn('flex w-full items-center justify-between gap-4 mt-4', className), children: [_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
|
|
50
23
|
if (previousUnavailable)
|
|
51
24
|
return;
|
|
52
|
-
setClicked(
|
|
25
|
+
setClicked('previous');
|
|
53
26
|
goToPreviousPage();
|
|
54
27
|
}, "aria-disabled": previousUnavailable || undefined, pending: previousPending, icon: _jsx(ChevronLeft, { className: "icon-xs" }), className: "h-11 min-w-11", children: "Previous" }), _jsx("span", { className: "text-counter", role: "status", children: totalPages === undefined ? `Page ${currentPage}` : `${currentPage} of ${totalPages}` }), _jsxs(Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
|
|
55
28
|
if (nextUnavailable)
|
|
56
29
|
return;
|
|
57
|
-
setClicked(
|
|
30
|
+
setClicked('next');
|
|
58
31
|
goToNextPage();
|
|
59
32
|
}, "aria-disabled": nextUnavailable || undefined, pending: nextPending, className: "h-11 min-w-11", children: ["Next", nextPending ? null : _jsx(ChevronRight, { className: "icon-xs" })] })] }));
|
|
60
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-pagination.js","sourceRoot":"","sources":["../../../src/react/components/list-pagination.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"list-pagination.js","sourceRoot":"","sources":["../../../src/react/components/list-pagination.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AASxC,MAAM,UAAU,cAAc,CAAC,EAAE,UAAU,EAAE,IAAI,GAAG,KAAK,EAAE,SAAS,EAAuB;IACzF,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAC7F,UAAU,CAAC;IAEb,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAA6B,IAAI,CAAC,CAAC;IACzE,MAAM,CAAC,OAAO,EAAE,UAAU,CA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,IAAI,eAAe;wBAAE,OAAO;oBAC5B,UAAU,CAAC,MAAM,CAAC,CAAC;oBACnB,YAAY,EAAE,CAAC;gBACjB,CAAC,mBACc,eAAe,IAAI,SAAS,EAC3C,OAAO,EAAE,WAAW,EACpB,SAAS,EAAC,eAAe,qBAGxB,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,YAAY,IAAC,SAAS,EAAC,SAAS,GAAG,IACnD,IACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport { useState } from 'react';\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { Button } from './button.js';\nimport { cn } from '../../lib/utils.js';\nimport type { ListPaginationState } from '../hooks/use-paged-list.js';\n\nexport interface ListPaginationProps {\n pagination: ListPaginationState;\n busy?: boolean;\n className?: string;\n}\n\nexport function ListPagination({ pagination, busy = false, className }: ListPaginationProps) {\n const { currentPage, totalPages, canPreviousPage, canNextPage, goToPreviousPage, goToNextPage } =\n pagination;\n\n const [clicked, setClicked] = useState<'previous' | 'next' | null>(null);\n const [wasBusy, setWasBusy] = useState(busy);\n if (busy !== wasBusy) {\n setWasBusy(busy);\n if (!busy) setClicked(null);\n }\n const previousPending = busy && clicked === 'previous';\n const nextPending = busy && clicked === 'next';\n const previousUnavailable = busy || !canPreviousPage;\n const nextUnavailable = busy || !canNextPage;\n\n if (!canPreviousPage && !canNextPage) return null;\n\n return (\n <div className={cn('flex w-full items-center justify-between gap-4 mt-4', className)}>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => {\n if (previousUnavailable) return;\n setClicked('previous');\n goToPreviousPage();\n }}\n aria-disabled={previousUnavailable || undefined}\n pending={previousPending}\n icon={<ChevronLeft className=\"icon-xs\" />}\n className=\"h-11 min-w-11\"\n >\n Previous\n </Button>\n <span className=\"text-counter\" role=\"status\">\n {totalPages === undefined ? `Page ${currentPage}` : `${currentPage} of ${totalPages}`}\n </span>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => {\n if (nextUnavailable) return;\n setClicked('next');\n goToNextPage();\n }}\n aria-disabled={nextUnavailable || undefined}\n pending={nextPending}\n className=\"h-11 min-w-11\"\n >\n Next\n {nextPending ? null : <ChevronRight className=\"icon-xs\" />}\n </Button>\n </div>\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as MenubarPrimitive from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
3
3
|
declare function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>): React.JSX.Element;
|
|
4
4
|
declare function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>): React.JSX.Element;
|
|
5
5
|
declare function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../../../src/react/components/menubar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../../../src/react/components/menubar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAK5D,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAEpF;AAED,iBAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAEtF;AAED,iBAAS,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,qBAExF;AAED,iBAAS,iBAAiB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,UAAU,CAAC,qBAEhG;AAED,iBAAS,UAAU,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,GAAG,CAAC,qBAElF;AAED,QAAA,MAAM,OAAO,yJAYX,CAAC;AAGH,QAAA,MAAM,cAAc,sKAYlB,CAAC;AAGH,QAAA,MAAM,iBAAiB;YAE0D,OAAO;wCActF,CAAC;AAGH,QAAA,MAAM,iBAAiB,mKAYrB,CAAC;AAGH,QAAA,MAAM,cAAc,gKAiBlB,CAAC;AAGH,QAAA,MAAM,WAAW;YAE0D,OAAO;wCAWhF,CAAC;AAGH,QAAA,MAAM,mBAAmB,qKAoBvB,CAAC;AAGH,QAAA,MAAM,gBAAgB,kKAmBpB,CAAC;AAGH,QAAA,MAAM,YAAY;YAE0D,OAAO;wCAOjF,CAAC;AAGH,QAAA,MAAM,gBAAgB,kKASpB,CAAC;AAGH,QAAA,MAAM,eAAe;8BAA6B,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAKtF,CAAC;AAGF,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,eAAe,GAChB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from
|
|
4
|
-
import * as MenubarPrimitive from
|
|
5
|
-
import { Check, ChevronRight, Circle } from
|
|
6
|
-
import { cn } from
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
5
|
+
import { Check, ChevronRight, Circle } from 'lucide-react';
|
|
6
|
+
import { cn } from '../../lib/utils.js';
|
|
7
7
|
function MenubarMenu({ ...props }) {
|
|
8
8
|
return _jsx(MenubarPrimitive.Menu, { ...props });
|
|
9
9
|
}
|
|
@@ -19,27 +19,27 @@ function MenubarRadioGroup({ ...props }) {
|
|
|
19
19
|
function MenubarSub({ ...props }) {
|
|
20
20
|
return _jsx(MenubarPrimitive.Sub, { "data-slot": "menubar-sub", ...props });
|
|
21
21
|
}
|
|
22
|
-
const Menubar = React.forwardRef(({ className, ...props }, ref) => (_jsx(MenubarPrimitive.Root, { ref: ref, className: cn(
|
|
22
|
+
const Menubar = React.forwardRef(({ className, ...props }, ref) => (_jsx(MenubarPrimitive.Root, { ref: ref, className: cn('flex h-10 items-center space-x-1 rounded-md border bg-background p-1', className), ...props })));
|
|
23
23
|
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
24
|
-
const MenubarTrigger = React.forwardRef(({ className, ...props }, ref) => (_jsx(MenubarPrimitive.Trigger, { ref: ref, className: cn(
|
|
24
|
+
const MenubarTrigger = React.forwardRef(({ className, ...props }, ref) => (_jsx(MenubarPrimitive.Trigger, { ref: ref, className: cn('flex cursor-default select-none items-center rounded-xs px-3 py-1.5 text-sm font-medium outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', className), ...props })));
|
|
25
25
|
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
26
|
-
const MenubarSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(MenubarPrimitive.SubTrigger, { ref: ref, className: cn(
|
|
26
|
+
const MenubarSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(MenubarPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground', inset && 'pl-8', className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] })));
|
|
27
27
|
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
28
|
-
const MenubarSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(MenubarPrimitive.SubContent, { ref: ref, className: cn(
|
|
28
|
+
const MenubarSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(MenubarPrimitive.SubContent, { ref: ref, className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props })));
|
|
29
29
|
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
30
|
-
const MenubarContent = React.forwardRef(({ className, align =
|
|
30
|
+
const MenubarContent = React.forwardRef(({ className, align = 'start', alignOffset = -4, sideOffset = 8, ...props }, ref) => (_jsx(MenubarPrimitive.Portal, { children: _jsx(MenubarPrimitive.Content, { ref: ref, align: align, alignOffset: alignOffset, sideOffset: sideOffset, className: cn('z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground elevation-popover duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props }) })));
|
|
31
31
|
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
32
|
-
const MenubarItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(MenubarPrimitive.Item, { ref: ref, className: cn(
|
|
32
|
+
const MenubarItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(MenubarPrimitive.Item, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', inset && 'pl-8', className), ...props })));
|
|
33
33
|
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
34
|
-
const MenubarCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(MenubarPrimitive.CheckboxItem, { ref: ref, className: cn(
|
|
34
|
+
const MenubarCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(MenubarPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(MenubarPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
|
|
35
35
|
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
36
|
-
const MenubarRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(MenubarPrimitive.RadioItem, { ref: ref, className: cn(
|
|
36
|
+
const MenubarRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(MenubarPrimitive.RadioItem, { ref: ref, className: cn('relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(MenubarPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
|
|
37
37
|
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
38
|
-
const MenubarLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(MenubarPrimitive.Label, { ref: ref, className: cn(
|
|
38
|
+
const MenubarLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(MenubarPrimitive.Label, { ref: ref, className: cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className), ...props })));
|
|
39
39
|
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
40
|
-
const MenubarSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(MenubarPrimitive.Separator, { ref: ref, className: cn(
|
|
40
|
+
const MenubarSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(MenubarPrimitive.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-muted', className), ...props })));
|
|
41
41
|
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
42
|
-
const MenubarShortcut = ({ className, ...props }) => (_jsx("span", { className: cn(
|
|
43
|
-
MenubarShortcut.displayname =
|
|
42
|
+
const MenubarShortcut = ({ className, ...props }) => (_jsx("span", { className: cn('ml-auto text-xs tracking-widest text-muted-foreground', className), ...props }));
|
|
43
|
+
MenubarShortcut.displayname = 'MenubarShortcut';
|
|
44
44
|
export { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut, };
|
|
45
45
|
//# sourceMappingURL=menubar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menubar.js","sourceRoot":"","sources":["../../../src/react/components/menubar.tsx"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AAG,gBAAgB,CAAC,SAAS,CAAC,WAAW,CAAA;AAErE,MAAM,eAAe,GAAG,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EAC8B,EAAE,EAAE,CAAC,CAC3C,eAAM,SAAS,EAAE,EAAE,CAAC,uDAAuD,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACvG,CAAA;AACD,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAA;AAE/C,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,eAAe,GAChB,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as MenubarPrimitive from \"@radix-ui/react-menubar\"\nimport { Check, ChevronRight, Circle } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nfunction MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {\n return <MenubarPrimitive.Menu {...props} />\n}\n\nfunction MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>) {\n return <MenubarPrimitive.Group {...props} />\n}\n\nfunction MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {\n return <MenubarPrimitive.Portal {...props} />\n}\n\nfunction MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {\n return <MenubarPrimitive.RadioGroup {...props} />\n}\n\nfunction MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {\n return <MenubarPrimitive.Sub data-slot=\"menubar-sub\" {...props} />\n}\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\"flex h-10 items-center space-x-1 rounded-md border bg-background p-1\", className)}\n {...props}\n />\n))\nMenubar.displayName = MenubarPrimitive.Root.displayName\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-xs px-3 py-1.5 text-sm font-medium outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n className\n )}\n {...props}\n />\n))\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & { inset?: boolean }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </MenubarPrimitive.SubTrigger>\n))\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n))\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(({ className, align = \"start\", alignOffset = -4, sideOffset = 8, ...props }, ref) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground elevation-popover duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n))\nMenubarContent.displayName = MenubarPrimitive.Content.displayName\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nMenubarItem.displayName = MenubarPrimitive.Item.displayName\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n))\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n))\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n))\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName\n\nconst MenubarShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)} {...props} />\n)\nMenubarShortcut.displayname = \"MenubarShortcut\"\n\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}\n"]}
|
|
1
|
+
{"version":3,"file":"menubar.js","sourceRoot":"","sources":["../../../src/react/components/menubar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,SAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAsD;IACnF,OAAO,KAAC,gBAAgB,CAAC,IAAI,OAAK,KAAK,GAAI,CAAC;AAC9C,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAAuD;IACrF,OAAO,KAAC,gBAAgB,CAAC,KAAK,OAAK,KAAK,GAAI,CAAC;AAC/C,CAAC;AAED,SAAS,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port * as MenubarPrimitive from '@radix-ui/react-menubar';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\n\nimport { cn } from '../../lib/utils.js';\n\nfunction MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {\n return <MenubarPrimitive.Menu {...props} />;\n}\n\nfunction MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>) {\n return <MenubarPrimitive.Group {...props} />;\n}\n\nfunction MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {\n return <MenubarPrimitive.Portal {...props} />;\n}\n\nfunction MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {\n return <MenubarPrimitive.RadioGroup {...props} />;\n}\n\nfunction MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {\n return <MenubarPrimitive.Sub data-slot=\"menubar-sub\" {...props} />;\n}\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n 'flex h-10 items-center space-x-1 rounded-md border bg-background p-1',\n className,\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center rounded-xs px-3 py-1.5 text-sm font-medium outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',\n className,\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & { inset?: boolean }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(({ className, align = 'start', alignOffset = -4, sideOffset = 8, ...props }, ref) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground elevation-popover duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n));\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}\n {...props}\n />\n);\nMenubarShortcut.displayname = 'MenubarShortcut';\n\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};\n"]}
|
|
@@ -2,13 +2,7 @@ interface OpenerFocusHandlers {
|
|
|
2
2
|
onOpenAutoFocus?: (event: Event) => void;
|
|
3
3
|
onCloseAutoFocus?: (event: Event) => void;
|
|
4
4
|
}
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
* modal content hands close focus to its trigger only, so an overlay opened from state — no trigger —
|
|
8
|
-
* would leave focus on the page. The opener is recorded as Radix starts its open focus, before focus
|
|
9
|
-
* moves inside. The caller's own `onCloseAutoFocus` runs first; when it calls `event.preventDefault()`
|
|
10
|
-
* it has chosen the destination, and when the opener has left the page Radix's own return runs.
|
|
11
|
-
*/
|
|
12
|
-
export declare function useOpenerFocus({ onOpenAutoFocus, onCloseAutoFocus }: OpenerFocusHandlers): Required<OpenerFocusHandlers>;
|
|
5
|
+
/** Radix's modal content returns close focus only to its trigger, so an overlay opened from state records its opener. */
|
|
6
|
+
export declare function useOpenerFocus({ onOpenAutoFocus, onCloseAutoFocus, }: OpenerFocusHandlers): Required<OpenerFocusHandlers>;
|
|
13
7
|
export {};
|
|
14
8
|
//# sourceMappingURL=opener-focus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opener-focus.d.ts","sourceRoot":"","sources":["../../../src/react/components/opener-focus.ts"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IAC3B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"opener-focus.d.ts","sourceRoot":"","sources":["../../../src/react/components/opener-focus.ts"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IAC3B,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC3C;AAED,yHAAyH;AACzH,wBAAgB,cAAc,CAAC,EAC7B,eAAe,EACf,gBAAgB,GACjB,EAAE,mBAAmB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAiBrD"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
* modal content hands close focus to its trigger only, so an overlay opened from state — no trigger —
|
|
6
|
-
* would leave focus on the page. The opener is recorded as Radix starts its open focus, before focus
|
|
7
|
-
* moves inside. The caller's own `onCloseAutoFocus` runs first; when it calls `event.preventDefault()`
|
|
8
|
-
* it has chosen the destination, and when the opener has left the page Radix's own return runs.
|
|
9
|
-
*/
|
|
10
|
-
export function useOpenerFocus({ onOpenAutoFocus, onCloseAutoFocus }) {
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/** Radix's modal content returns close focus only to its trigger, so an overlay opened from state records its opener. */
|
|
4
|
+
export function useOpenerFocus({ onOpenAutoFocus, onCloseAutoFocus, }) {
|
|
11
5
|
const opener = React.useRef(null);
|
|
12
6
|
return {
|
|
13
7
|
onOpenAutoFocus: (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opener-focus.js","sourceRoot":"","sources":["../../../src/react/components/opener-focus.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"opener-focus.js","sourceRoot":"","sources":["../../../src/react/components/opener-focus.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,yHAAyH;AACzH,MAAM,UAAU,cAAc,CAAC,EAC7B,eAAe,EACf,gBAAgB,GACI;IACpB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAqB,IAAI,CAAC,CAAC;IACtD,OAAO;QACL,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE;YACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC;YACtC,MAAM,CAAC,OAAO,GAAG,MAAM,YAAY,WAAW,IAAI,MAAM,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;YAC3F,eAAe,EAAE,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QACD,gBAAgB,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1B,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC;YAC1B,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;YAC9B,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;YACtB,IAAI,KAAK,CAAC,gBAAgB,IAAI,CAAC,MAAM,EAAE,WAAW;gBAAE,OAAO;YAC3D,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\n\ninterface OpenerFocusHandlers {\n onOpenAutoFocus?: (event: Event) => void;\n onCloseAutoFocus?: (event: Event) => void;\n}\n\n/** Radix's modal content returns close focus only to its trigger, so an overlay opened from state records its opener. */\nexport function useOpenerFocus({\n onOpenAutoFocus,\n onCloseAutoFocus,\n}: OpenerFocusHandlers): Required<OpenerFocusHandlers> {\n const opener = React.useRef<HTMLElement | null>(null);\n return {\n onOpenAutoFocus: (event) => {\n const active = document.activeElement;\n opener.current = active instanceof HTMLElement && active !== document.body ? active : null;\n onOpenAutoFocus?.(event);\n },\n onCloseAutoFocus: (event) => {\n onCloseAutoFocus?.(event);\n const target = opener.current;\n opener.current = null;\n if (event.defaultPrevented || !target?.isConnected) return;\n event.preventDefault();\n target.focus();\n },\n };\n}\n"]}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import type * as React from
|
|
2
|
-
/** Cancels an event and stops it in the capture phase, before any handler on the control runs. */
|
|
1
|
+
import type * as React from 'react';
|
|
3
2
|
export declare function blockEvent(event: React.SyntheticEvent): void;
|
|
4
|
-
/**
|
|
5
|
-
* Stops the keys that act on a pending control — Space, Enter, ArrowUp, ArrowDown (which open a
|
|
6
|
-
* trigger) and a single printable character (a trigger's typeahead) — and lets every other key
|
|
7
|
-
* through, so Tab, Escape, function keys, and shortcuts behave as usual.
|
|
8
|
-
*/
|
|
9
3
|
export declare function blockActivationKey(event: React.KeyboardEvent): void;
|
|
10
4
|
//# sourceMappingURL=pending-guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-guard.d.ts","sourceRoot":"","sources":["../../../src/react/components/pending-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"pending-guard.d.ts","sourceRoot":"","sources":["../../../src/react/components/pending-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,QAGrD;AAID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,QAG5D"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
/** Cancels an event and stops it in the capture phase, before any handler on the control runs. */
|
|
2
1
|
export function blockEvent(event) {
|
|
3
2
|
event.preventDefault();
|
|
4
3
|
event.stopPropagation();
|
|
5
4
|
}
|
|
6
|
-
const ACTIVATION_KEYS = new Set([
|
|
7
|
-
/**
|
|
8
|
-
* Stops the keys that act on a pending control — Space, Enter, ArrowUp, ArrowDown (which open a
|
|
9
|
-
* trigger) and a single printable character (a trigger's typeahead) — and lets every other key
|
|
10
|
-
* through, so Tab, Escape, function keys, and shortcuts behave as usual.
|
|
11
|
-
*/
|
|
5
|
+
const ACTIVATION_KEYS = new Set([' ', 'Enter', 'ArrowUp', 'ArrowDown']);
|
|
12
6
|
export function blockActivationKey(event) {
|
|
13
7
|
if (event.ctrlKey || event.metaKey || event.altKey)
|
|
14
8
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-guard.js","sourceRoot":"","sources":["../../../src/react/components/pending-guard.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"pending-guard.js","sourceRoot":"","sources":["../../../src/react/components/pending-guard.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,UAAU,CAAC,KAA2B;IACpD,KAAK,CAAC,cAAc,EAAE,CAAC;IACvB,KAAK,CAAC,eAAe,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;AAExE,MAAM,UAAU,kBAAkB,CAAC,KAA0B;IAC3D,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM;QAAE,OAAO;IAC3D,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,UAAU,CAAC,KAAK,CAAC,CAAC;AAClF,CAAC","sourcesContent":["import type * as React from 'react';\n\nexport function blockEvent(event: React.SyntheticEvent) {\n event.preventDefault();\n event.stopPropagation();\n}\n\nconst ACTIVATION_KEYS = new Set([' ', 'Enter', 'ArrowUp', 'ArrowDown']);\n\nexport function blockActivationKey(event: React.KeyboardEvent) {\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n if (ACTIVATION_KEYS.has(event.key) || event.key.length === 1) blockEvent(event);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as PopoverPrimitive from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
3
|
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
4
|
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/react/components/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/react/components/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAI5D,QAAA,MAAM,OAAO,yCAAwB,CAAC;AACtC,QAAA,MAAM,cAAc,gHAA2B,CAAC;AAChD,QAAA,MAAM,aAAa,4GAA0B,CAAC;AAE9C,QAAA,MAAM,cAAc,gKAgBlB,CAAC;AAGH,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from
|
|
4
|
-
import * as PopoverPrimitive from
|
|
5
|
-
import { cn } from
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
5
|
+
import { cn } from '../../lib/utils.js';
|
|
6
6
|
const Popover = PopoverPrimitive.Root;
|
|
7
7
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
8
8
|
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
9
|
-
const PopoverContent = React.forwardRef(({ className, align =
|
|
9
|
+
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn('z-50 w-72 rounded-md border !bg-card p-4 text-popover-foreground elevation-popover outline-hidden duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className), ...props }) })));
|
|
10
10
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
11
11
|
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
12
12
|
//# sourceMappingURL=popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../../src/react/components/popover.tsx"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../../src/react/components/popover.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,CAAC;AACtC,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC;AAChD,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC;AAE9C,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAGrC,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,QAAQ,EAAE,UAAU,GAAG,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACpE,KAAC,gBAAgB,CAAC,MAAM,cACtB,KAAC,gBAAgB,CAAC,OAAO,IACvB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,EAAE,CACX,4eAA4e,EAC5e,SAAS,CACV,KACG,KAAK,GACT,GACsB,CAC3B,CAAC,CAAC;AACH,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '../../lib/utils.js';\n\nconst Popover = PopoverPrimitive.Root;\nconst PopoverTrigger = PopoverPrimitive.Trigger;\nconst PopoverAnchor = PopoverPrimitive.Anchor;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 w-72 rounded-md border !bg-card p-4 text-popover-foreground elevation-popover outline-hidden duration-[var(--motion-fast)] ease-[var(--motion-ease)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as ProgressPrimitive from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
3
3
|
interface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {
|
|
4
4
|
indicatorClassName?: string;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/react/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/react/components/progress.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAG9D,UAAU,aAAc,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC;IAC3F,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,QAAA,MAAM,QAAQ,sFAgBb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from
|
|
4
|
-
import * as ProgressPrimitive from
|
|
5
|
-
import { cn } from
|
|
6
|
-
const Progress = React.forwardRef(({ className, value, indicatorClassName, ...props }, ref) => (_jsx(ProgressPrimitive.Root, { ref: ref, className: cn(
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
5
|
+
import { cn } from '../../lib/utils.js';
|
|
6
|
+
const Progress = React.forwardRef(({ className, value, indicatorClassName, ...props }, ref) => (_jsx(ProgressPrimitive.Root, { ref: ref, className: cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className), ...props, children: _jsx(ProgressPrimitive.Indicator, { className: cn('h-full w-full flex-1 bg-primary transition-transform duration-[var(--motion-base)] ease-[var(--motion-ease)]', indicatorClassName), style: { transform: `translateX(-${100 - (value || 0)}%)` } }) })));
|
|
7
7
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
8
8
|
export { Progress };
|
|
9
9
|
//# sourceMappingURL=progress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/react/components/progress.tsx"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../../src/react/components/progress.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAMxC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC3D,KAAC,iBAAiB,CAAC,IAAI,IACrB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,+DAA+D,EAAE,SAAS,CAAC,KACrF,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,IAC1B,SAAS,EAAE,EAAE,CACX,8GAA8G,EAC9G,kBAAkB,CACnB,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,GAAG,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,EAAE,GAC3D,GACqB,CAC1B,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as ProgressPrimitive from '@radix-ui/react-progress';\nimport { cn } from '../../lib/utils.js';\n\ninterface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {\n indicatorClassName?: string;\n}\n\nconst Progress = React.forwardRef<React.ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(\n ({ className, value, indicatorClassName, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className={cn(\n 'h-full w-full flex-1 bg-primary transition-transform duration-[var(--motion-base)] ease-[var(--motion-ease)]',\n indicatorClassName,\n )}\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n ),\n);\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as RadioGroupPrimitive from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
3
|
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../src/react/components/radio-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../src/react/components/radio-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAKnE,QAAA,MAAM,UAAU,+JAKd,CAAC;AAGH,QAAA,MAAM,cAAc,yKAgBlB,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC"}
|