@ttt-productions/ui-core 0.11.12 → 0.11.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/react/components/badge.d.ts +2 -2
  2. package/dist/react/components/button.d.ts +11 -2
  3. package/dist/react/components/button.d.ts.map +1 -1
  4. package/dist/react/components/button.js +18 -5
  5. package/dist/react/components/button.js.map +1 -1
  6. package/dist/react/components/chunk-error-recovery.js +2 -2
  7. package/dist/react/components/chunk-error-recovery.js.map +1 -1
  8. package/dist/react/components/consequence-dialog.d.ts +1 -1
  9. package/dist/react/components/consequence-dialog.d.ts.map +1 -1
  10. package/dist/react/components/consequence-dialog.js +2 -3
  11. package/dist/react/components/consequence-dialog.js.map +1 -1
  12. package/dist/react/components/dropdown-menu.d.ts +8 -0
  13. package/dist/react/components/dropdown-menu.d.ts.map +1 -1
  14. package/dist/react/components/dropdown-menu.js +2 -1
  15. package/dist/react/components/dropdown-menu.js.map +1 -1
  16. package/dist/react/components/list-pagination.d.ts.map +1 -1
  17. package/dist/react/components/list-pagination.js +19 -1
  18. package/dist/react/components/list-pagination.js.map +1 -1
  19. package/dist/react/components/search-dropdown.d.ts.map +1 -1
  20. package/dist/react/components/search-dropdown.js +3 -2
  21. package/dist/react/components/search-dropdown.js.map +1 -1
  22. package/dist/react/components/select.d.ts +8 -1
  23. package/dist/react/components/select.d.ts.map +1 -1
  24. package/dist/react/components/select.js +2 -1
  25. package/dist/react/components/select.js.map +1 -1
  26. package/dist/react/components/spinner.d.ts +23 -0
  27. package/dist/react/components/spinner.d.ts.map +1 -0
  28. package/dist/react/components/spinner.js +27 -0
  29. package/dist/react/components/spinner.js.map +1 -0
  30. package/dist/react/components/switch.d.ts +8 -1
  31. package/dist/react/components/switch.d.ts.map +1 -1
  32. package/dist/react/components/switch.js +2 -1
  33. package/dist/react/components/switch.js.map +1 -1
  34. package/dist/react/hooks/use-async-action.d.ts +30 -0
  35. package/dist/react/hooks/use-async-action.d.ts.map +1 -0
  36. package/dist/react/hooks/use-async-action.js +39 -0
  37. package/dist/react/hooks/use-async-action.js.map +1 -0
  38. package/dist/react/hooks/use-return-scroll.d.ts +26 -0
  39. package/dist/react/hooks/use-return-scroll.d.ts.map +1 -0
  40. package/dist/react/hooks/use-return-scroll.js +123 -0
  41. package/dist/react/hooks/use-return-scroll.js.map +1 -0
  42. package/dist/react/index.d.ts +6 -0
  43. package/dist/react/index.d.ts.map +1 -1
  44. package/dist/react/index.js +6 -0
  45. package/dist/react/index.js.map +1 -1
  46. package/package.json +3 -3
  47. package/src/react/components/button.tsx +46 -10
  48. package/src/react/components/chunk-error-recovery.tsx +2 -2
  49. package/src/react/components/consequence-dialog.tsx +4 -6
  50. package/src/react/components/dropdown-menu.tsx +16 -2
  51. package/src/react/components/list-pagination.tsx +24 -4
  52. package/src/react/components/search-dropdown.tsx +4 -3
  53. package/src/react/components/select.tsx +19 -5
  54. package/src/react/components/spinner.tsx +49 -0
  55. package/src/react/components/switch.tsx +16 -4
  56. package/src/react/hooks/use-async-action.ts +63 -0
  57. package/src/react/hooks/use-return-scroll.ts +149 -0
  58. package/src/react/index.ts +11 -0
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/react/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,QAAA,MAAM,MAAM,uCAAuB,CAAA;AACnC,QAAA,MAAM,WAAW,yGAAwB,CAAA;AACzC,QAAA,MAAM,WAAW,0GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,oKAiBjB,CAAA;AAGF,QAAA,MAAM,oBAAoB,qKAWxB,CAAA;AAGF,QAAA,MAAM,sBAAsB,uKAW1B,CAAA;AAGF,QAAA,MAAM,aAAa,8JA6BjB,CAAA;AAGF,QAAA,MAAM,WAAW,4JASf,CAAA;AAGF,QAAA,MAAM,UAAU,2JAoBd,CAAA;AAGF,QAAA,MAAM,eAAe,gKASnB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/react/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAMzD,QAAA,MAAM,MAAM,uCAAuB,CAAA;AACnC,QAAA,MAAM,WAAW,yGAAwB,CAAA;AACzC,QAAA,MAAM,WAAW,0GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa;IAGf;;;;OAIG;cACO,OAAO;2CAsBnB,CAAA;AAGF,QAAA,MAAM,oBAAoB,qKAWxB,CAAA;AAGF,QAAA,MAAM,sBAAsB,uKAW1B,CAAA;AAGF,QAAA,MAAM,aAAa,8JA6BjB,CAAA;AAGF,QAAA,MAAM,WAAW,4JASf,CAAA;AAGF,QAAA,MAAM,UAAU,2JAoBd,CAAA;AAGF,QAAA,MAAM,eAAe,gKASnB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA"}
@@ -4,10 +4,11 @@ import * as React from "react";
4
4
  import * as SelectPrimitive from "@radix-ui/react-select";
5
5
  import { Check, ChevronDown, ChevronUp } from "lucide-react";
6
6
  import { cn } from "../../lib/utils.js";
7
+ import { Spinner } from "./spinner.js";
7
8
  const Select = SelectPrimitive.Root;
8
9
  const SelectGroup = SelectPrimitive.Group;
9
10
  const SelectValue = SelectPrimitive.Value;
10
- const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn("flex h-10 w-full items-center justify-between rounded-md border-2 border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) })] })));
11
+ const SelectTrigger = React.forwardRef(({ className, children, pending = false, disabled, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn("flex h-10 w-full items-center justify-between rounded-md border-2 border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className), ...props, ...(pending ? { "aria-busy": true, "data-pending": "" } : {}), disabled: disabled || pending || undefined, children: [children, pending ? (_jsx(Spinner, { size: "xs" })) : (_jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "h-4 w-4 opacity-50" }) }))] })));
11
12
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
12
13
  const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronUp, { className: "h-4 w-4" }) })));
13
14
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/react/components/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE5D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CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5C,MAAC,eAAe,CAAC,IAAI,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,6NAA6N,EAC7N,SAAS,CACV,KACG,KAAK,aAET,eAAM,SAAS,EAAC,8DAA8D,YAC5E,KAAC,eAAe,CAAC,aAAa,cAC5B,KAAC,KAAK,IAAC,SAAS,EAAC,SAAS,GAAG,GACC,GAC3B,EAEP,KAAC,eAAe,CAAC,QAAQ,cAAE,QAAQ,GAA4B,IAC1C,CACxB,CAAC,CAAA;AACF,UAAU,CAAC,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,WAAW,CAAA;AAEzD,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAGtC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,SAAS,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAC,CAAA;AACF,eAAe,CAAC,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,WAAW,CAAA;AAEnE,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nconst Select = SelectPrimitive.Root\nconst SelectGroup = SelectPrimitive.Group\nconst SelectValue = SelectPrimitive.Value\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between rounded-md border-2 border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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 position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full 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 <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n}\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/react/components/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE5D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAA;AACnC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAA;AACzC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAA;AAEzC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAUpC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACvE,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,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5C,MAAC,eAAe,CAAC,IAAI,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,6NAA6N,EAC7N,SAAS,CACV,KACG,KAAK,aAET,eAAM,SAAS,EAAC,8DAA8D,YAC5E,KAAC,eAAe,CAAC,aAAa,cAC5B,KAAC,KAAK,IAAC,SAAS,EAAC,SAAS,GAAG,GACC,GAC3B,EAEP,KAAC,eAAe,CAAC,QAAQ,cAAE,QAAQ,GAA4B,IAC1C,CACxB,CAAC,CAAA;AACF,UAAU,CAAC,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,WAAW,CAAA;AAEzD,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAGtC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,eAAe,CAAC,SAAS,IACxB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAC,CAAA;AACF,eAAe,CAAC,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,WAAW,CAAA;AAEnE,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { Spinner } from \"./spinner.js\"\n\nconst Select = SelectPrimitive.Root\nconst SelectGroup = SelectPrimitive.Group\nconst SelectValue = SelectPrimitive.Value\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> & {\n /**\n * The change this select started is in flight: the trigger disables itself, sets\n * `aria-busy`, and shows the spinner in place of its chevron. It keeps showing the\n * COMMITTED value — the caller changes `value` only once the write lands.\n */\n pending?: boolean\n }\n>(({ className, children, pending = false, disabled, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between rounded-md border-2 border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n className\n )}\n {...props}\n {...(pending ? { \"aria-busy\": true, \"data-pending\": \"\" } : {})}\n disabled={disabled || pending || undefined}\n >\n {children}\n {pending ? (\n <Spinner size=\"xs\" />\n ) : (\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\"flex cursor-default items-center justify-center py-1\", className)}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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 position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full 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 <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n}\n"]}
@@ -0,0 +1,23 @@
1
+ export type SpinnerSize = "xs" | "sm" | "md" | "lg" | "xl";
2
+ export interface SpinnerProps {
3
+ /** Maps onto the theme-core `spinner-*` classes. Defaults to `xs` (the in-control size). */
4
+ size?: SpinnerSize;
5
+ /**
6
+ * Screen-reader text. When set, the spinner becomes a `status` live region that
7
+ * announces it. Omit it for a spinner inside a control that already carries its
8
+ * own busy state (`aria-busy`) — the control speaks for it.
9
+ */
10
+ label?: string;
11
+ className?: string;
12
+ }
13
+ /**
14
+ * The ONE loading spinner. Every in-progress indicator renders through this
15
+ * component (or through a control's `pending` prop, which renders it), so the
16
+ * spinner's look, size scale, and color rule have one change point. The
17
+ * theme-core `spinner-*` classes own size, animation, and color — including the
18
+ * `button .spinner-*` rule that makes an in-button spinner inherit the button's
19
+ * text color so it is never primary-on-primary.
20
+ */
21
+ declare function Spinner({ size, label, className }: SpinnerProps): import("react").JSX.Element;
22
+ export { Spinner };
23
+ //# sourceMappingURL=spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/react/components/spinner.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE1D,MAAM,WAAW,YAAY;IAC3B,4FAA4F;IAC5F,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAUD;;;;;;;GAOG;AACH,iBAAS,OAAO,CAAC,EAAE,IAAW,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,YAAY,+BAU/D;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Loader2 } from "lucide-react";
4
+ import { cn } from "../../lib/utils.js";
5
+ const SIZE_CLASS = {
6
+ xs: "spinner-xs",
7
+ sm: "spinner-sm",
8
+ md: "spinner-md",
9
+ lg: "spinner-lg",
10
+ xl: "spinner-xl",
11
+ };
12
+ /**
13
+ * The ONE loading spinner. Every in-progress indicator renders through this
14
+ * component (or through a control's `pending` prop, which renders it), so the
15
+ * spinner's look, size scale, and color rule have one change point. The
16
+ * theme-core `spinner-*` classes own size, animation, and color — including the
17
+ * `button .spinner-*` rule that makes an in-button spinner inherit the button's
18
+ * text color so it is never primary-on-primary.
19
+ */
20
+ function Spinner({ size = "xs", label, className }) {
21
+ if (!label) {
22
+ return _jsx(Loader2, { className: cn(SIZE_CLASS[size], className), "aria-hidden": "true" });
23
+ }
24
+ return (_jsxs("span", { role: "status", className: cn("inline-flex items-center justify-center", className), children: [_jsx(Loader2, { className: SIZE_CLASS[size], "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: label })] }));
25
+ }
26
+ export { Spinner };
27
+ //# sourceMappingURL=spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../src/react/components/spinner.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAgBvC,MAAM,UAAU,GAAgC;IAC9C,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,YAAY;CACjB,CAAA;AAED;;;;;;;GAOG;AACH,SAAS,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,EAAgB;IAC9D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAC,OAAO,IAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,iBAAc,MAAM,GAAG,CAAA;IACnF,CAAC;IACD,OAAO,CACL,gBAAM,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,EAAE,CAAC,yCAAyC,EAAE,SAAS,CAAC,aACrF,KAAC,OAAO,IAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,iBAAc,MAAM,GAAG,EAC3D,eAAM,SAAS,EAAC,SAAS,YAAE,KAAK,GAAQ,IACnC,CACR,CAAA;AACH,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport { Loader2 } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nexport type SpinnerSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"\n\nexport interface SpinnerProps {\n /** Maps onto the theme-core `spinner-*` classes. Defaults to `xs` (the in-control size). */\n size?: SpinnerSize\n /**\n * Screen-reader text. When set, the spinner becomes a `status` live region that\n * announces it. Omit it for a spinner inside a control that already carries its\n * own busy state (`aria-busy`) — the control speaks for it.\n */\n label?: string\n className?: string\n}\n\nconst SIZE_CLASS: Record<SpinnerSize, string> = {\n xs: \"spinner-xs\",\n sm: \"spinner-sm\",\n md: \"spinner-md\",\n lg: \"spinner-lg\",\n xl: \"spinner-xl\",\n}\n\n/**\n * The ONE loading spinner. Every in-progress indicator renders through this\n * component (or through a control's `pending` prop, which renders it), so the\n * spinner's look, size scale, and color rule have one change point. The\n * theme-core `spinner-*` classes own size, animation, and color — including the\n * `button .spinner-*` rule that makes an in-button spinner inherit the button's\n * text color so it is never primary-on-primary.\n */\nfunction Spinner({ size = \"xs\", label, className }: SpinnerProps) {\n if (!label) {\n return <Loader2 className={cn(SIZE_CLASS[size], className)} aria-hidden=\"true\" />\n }\n return (\n <span role=\"status\" className={cn(\"inline-flex items-center justify-center\", className)}>\n <Loader2 className={SIZE_CLASS[size]} aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </span>\n )\n}\n\nexport { Spinner }\n"]}
@@ -1,5 +1,12 @@
1
1
  import * as React from "react";
2
2
  import * as SwitchPrimitives from "@radix-ui/react-switch";
3
- declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
3
+ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
4
+ /**
5
+ * The change this switch started is in flight: the switch disables itself, sets
6
+ * `aria-busy`, and spins inside its thumb. It keeps showing the COMMITTED state —
7
+ * the caller flips `checked` only once the write lands.
8
+ */
9
+ pending?: boolean;
10
+ } & React.RefAttributes<HTMLButtonElement>>;
4
11
  export { Switch };
5
12
  //# sourceMappingURL=switch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/react/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAI1D,QAAA,MAAM,MAAM,8JAkBV,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/react/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAK1D,QAAA,MAAM,MAAM;IAGR;;;;OAIG;cACO,OAAO;2CAqBnB,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -3,7 +3,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import * as SwitchPrimitives from "@radix-ui/react-switch";
5
5
  import { cn } from "../../lib/utils.js";
6
- const Switch = React.forwardRef(({ className, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0") }) })));
6
+ import { Spinner } from "./spinner.js";
7
+ const Switch = React.forwardRef(({ className, pending = false, disabled, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ...(pending ? { "aria-busy": true, "data-pending": "" } : {}), disabled: disabled || pending || undefined, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none flex h-5 w-5 items-center justify-center rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"), children: pending ? _jsx(Spinner, { size: "xs" }) : null }) })));
7
8
  Switch.displayName = SwitchPrimitives.Root.displayName;
8
9
  export { Switch };
9
10
  //# sourceMappingURL=switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/react/components/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAE1D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAG7B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,KAAC,gBAAgB,CAAC,IAAI,IACpB,SAAS,EAAE,EAAE,CACX,sXAAsX,EACtX,SAAS,CACV,KACG,KAAK,EACT,GAAG,EAAE,GAAG,YAER,KAAC,gBAAgB,CAAC,KAAK,IACrB,SAAS,EAAE,EAAE,CACX,4KAA4K,CAC7K,GACD,GACoB,CACzB,CAAC,CAAA;AACF,MAAM,CAAC,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAA;AAEtD,OAAO,EAAE,MAAM,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\n\nimport { cn } from \"../../lib/utils.js\"\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\"\n )}\n />\n </SwitchPrimitives.Root>\n))\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch }\n"]}
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/react/components/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAE1D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAU7B,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC7D,KAAC,gBAAgB,CAAC,IAAI,IACpB,SAAS,EAAE,EAAE,CACX,sXAAsX,EACtX,SAAS,CACV,KACG,KAAK,KACL,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC9D,QAAQ,EAAE,QAAQ,IAAI,OAAO,IAAI,SAAS,EAC1C,GAAG,EAAE,GAAG,YAER,KAAC,gBAAgB,CAAC,KAAK,IACrB,SAAS,EAAE,EAAE,CACX,uMAAuM,CACxM,YAEA,OAAO,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,GAChB,GACH,CACzB,CAAC,CAAA;AACF,MAAM,CAAC,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAA;AAEtD,OAAO,EAAE,MAAM,EAAE,CAAA","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\n\nimport { cn } from \"../../lib/utils.js\"\nimport { Spinner } from \"./spinner.js\"\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & {\n /**\n * The change this switch started is in flight: the switch disables itself, sets\n * `aria-busy`, and spins inside its thumb. It keeps showing the COMMITTED state —\n * the caller flips `checked` only once the write lands.\n */\n pending?: boolean\n }\n>(({ className, pending = false, disabled, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className\n )}\n {...props}\n {...(pending ? { \"aria-busy\": true, \"data-pending\": \"\" } : {})}\n disabled={disabled || pending || undefined}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none flex h-5 w-5 items-center justify-center rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\"\n )}\n >\n {pending ? <Spinner size=\"xs\" /> : null}\n </SwitchPrimitives.Thumb>\n </SwitchPrimitives.Root>\n))\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch }\n"]}
@@ -0,0 +1,30 @@
1
+ export interface UseAsyncActionOptions {
2
+ /**
3
+ * Receives anything the action throws. REQUIRED, so every call site decides what a
4
+ * failure means (surface it, capture it, or accept that another layer already did):
5
+ * `run` itself never rejects, so a fire-and-forget `onClick={() => void run()}` can
6
+ * never become an unhandled rejection.
7
+ */
8
+ onError: (error: unknown) => void;
9
+ }
10
+ export interface AsyncAction<TArgs extends unknown[]> {
11
+ /**
12
+ * Starts the action unless one is already in flight — a repeat call while pending is
13
+ * ignored. Resolves once the action settles: `true` when it completed, `false` when it
14
+ * was ignored or threw. Never rejects.
15
+ */
16
+ run: (...args: TArgs) => Promise<boolean>;
17
+ /** True from the moment `run` starts the action until it settles. */
18
+ pending: boolean;
19
+ }
20
+ /**
21
+ * Pending state + repeat guard for async work that is NOT a React Query mutation
22
+ * (a local media step, a sign-out, an awaited navigation). Feed `pending` to the
23
+ * control's own `pending` prop. Server writes stay mutations — this hook does not
24
+ * replace the data layer's one mutation path.
25
+ *
26
+ * The guard is a ref, not the state, so two clicks inside one frame cannot both start
27
+ * the action.
28
+ */
29
+ export declare function useAsyncAction<TArgs extends unknown[]>(action: (...args: TArgs) => Promise<unknown>, options: UseAsyncActionOptions): AsyncAction<TArgs>;
30
+ //# sourceMappingURL=use-async-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-async-action.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-async-action.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,WAAW,CAAC,KAAK,SAAS,OAAO,EAAE;IAClD;;;;OAIG;IACH,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,qEAAqE;IACrE,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,SAAS,OAAO,EAAE,EACpD,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,EAC5C,OAAO,EAAE,qBAAqB,GAC7B,WAAW,CAAC,KAAK,CAAC,CAyBpB"}
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { useCallback, useRef, useState } from "react";
3
+ /**
4
+ * Pending state + repeat guard for async work that is NOT a React Query mutation
5
+ * (a local media step, a sign-out, an awaited navigation). Feed `pending` to the
6
+ * control's own `pending` prop. Server writes stay mutations — this hook does not
7
+ * replace the data layer's one mutation path.
8
+ *
9
+ * The guard is a ref, not the state, so two clicks inside one frame cannot both start
10
+ * the action.
11
+ */
12
+ export function useAsyncAction(action, options) {
13
+ const [pending, setPending] = useState(false);
14
+ const inFlightRef = useRef(false);
15
+ const actionRef = useRef(action);
16
+ const onErrorRef = useRef(options.onError);
17
+ actionRef.current = action;
18
+ onErrorRef.current = options.onError;
19
+ const run = useCallback(async (...args) => {
20
+ if (inFlightRef.current)
21
+ return false;
22
+ inFlightRef.current = true;
23
+ setPending(true);
24
+ try {
25
+ await actionRef.current(...args);
26
+ return true;
27
+ }
28
+ catch (error) {
29
+ onErrorRef.current(error);
30
+ return false;
31
+ }
32
+ finally {
33
+ inFlightRef.current = false;
34
+ setPending(false);
35
+ }
36
+ }, []);
37
+ return { run, pending };
38
+ }
39
+ //# sourceMappingURL=use-async-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-async-action.js","sourceRoot":"","sources":["../../../src/react/hooks/use-async-action.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAuBtD;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,MAA4C,EAC5C,OAA8B;IAE9B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;IAC3B,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAErC,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,EAAE,GAAG,IAAW,EAAoB,EAAE;QACjE,IAAI,WAAW,CAAC,OAAO;YAAE,OAAO,KAAK,CAAC;QACtC,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC1B,OAAO,KAAK,CAAC;QACf,CAAC;gBAAS,CAAC;YACT,WAAW,CAAC,OAAO,GAAG,KAAK,CAAC;YAC5B,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC","sourcesContent":["\"use client\";\n\nimport { useCallback, useRef, useState } from \"react\";\n\nexport interface UseAsyncActionOptions {\n /**\n * Receives anything the action throws. REQUIRED, so every call site decides what a\n * failure means (surface it, capture it, or accept that another layer already did):\n * `run` itself never rejects, so a fire-and-forget `onClick={() => void run()}` can\n * never become an unhandled rejection.\n */\n onError: (error: unknown) => void;\n}\n\nexport interface AsyncAction<TArgs extends unknown[]> {\n /**\n * Starts the action unless one is already in flight — a repeat call while pending is\n * ignored. Resolves once the action settles: `true` when it completed, `false` when it\n * was ignored or threw. Never rejects.\n */\n run: (...args: TArgs) => Promise<boolean>;\n /** True from the moment `run` starts the action until it settles. */\n pending: boolean;\n}\n\n/**\n * Pending state + repeat guard for async work that is NOT a React Query mutation\n * (a local media step, a sign-out, an awaited navigation). Feed `pending` to the\n * control's own `pending` prop. Server writes stay mutations — this hook does not\n * replace the data layer's one mutation path.\n *\n * The guard is a ref, not the state, so two clicks inside one frame cannot both start\n * the action.\n */\nexport function useAsyncAction<TArgs extends unknown[]>(\n action: (...args: TArgs) => Promise<unknown>,\n options: UseAsyncActionOptions,\n): AsyncAction<TArgs> {\n const [pending, setPending] = useState(false);\n const inFlightRef = useRef(false);\n const actionRef = useRef(action);\n const onErrorRef = useRef(options.onError);\n actionRef.current = action;\n onErrorRef.current = options.onError;\n\n const run = useCallback(async (...args: TArgs): Promise<boolean> => {\n if (inFlightRef.current) return false;\n inFlightRef.current = true;\n setPending(true);\n try {\n await actionRef.current(...args);\n return true;\n } catch (error) {\n onErrorRef.current(error);\n return false;\n } finally {\n inFlightRef.current = false;\n setPending(false);\n }\n }, []);\n\n return { run, pending };\n}\n"]}
@@ -0,0 +1,26 @@
1
+ export interface ReturnScrollEntry {
2
+ /** The saved `window.scrollY`. */
3
+ y: number;
4
+ /** Epoch ms at save time (diagnostic; the caller decides eligibility, not the hook). */
5
+ savedAt: number;
6
+ }
7
+ export interface UseReturnScrollOptions {
8
+ /** The caller's CANONICAL list URL — equivalent list states must give the same key. */
9
+ key: string;
10
+ /** Decided by the caller ONCE at mount (e.g. "the list's data was already cached on first render"). */
11
+ eligible: boolean;
12
+ /** The list is displayed at its real height: data present, no error surface in its place. */
13
+ ready: boolean;
14
+ }
15
+ export interface UseReturnScrollResult {
16
+ /** Record the current window offset for `key`. Call right before navigating away. */
17
+ save: () => void;
18
+ }
19
+ /** The stored entry for `key`, or null when absent, unreadable, or malformed. */
20
+ export declare function readReturnScroll(key: string): ReturnScrollEntry | null;
21
+ /** Record `y` (default: the current `window.scrollY`) for `key`. No-op without storage. */
22
+ 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
+ export declare function clearReturnScroll(key: string): void;
25
+ export declare function useReturnScroll({ key, eligible, ready }: UseReturnScrollOptions): UseReturnScrollResult;
26
+ //# sourceMappingURL=use-return-scroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-return-scroll.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-return-scroll.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,wFAAwF;IACxF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC;IACZ,uGAAuG;IACvG,QAAQ,EAAE,OAAO,CAAC;IAClB,6FAA6F;IAC7F,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,qFAAqF;IACrF,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAeD,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CActE;AAED,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAU9D;AAED,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAQnD;AASD,wBAAgB,eAAe,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,sBAAsB,GAAG,qBAAqB,CAuCvG"}
@@ -0,0 +1,123 @@
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
+ import * as React from "react";
23
+ const STORAGE_PREFIX = "return-scroll:";
24
+ function storageKey(key) {
25
+ return `${STORAGE_PREFIX}${key}`;
26
+ }
27
+ function sessionStorageOrNull() {
28
+ try {
29
+ if (typeof window === "undefined")
30
+ return null;
31
+ return window.sessionStorage ?? null;
32
+ }
33
+ catch {
34
+ return null;
35
+ }
36
+ }
37
+ /** The stored entry for `key`, or null when absent, unreadable, or malformed. */
38
+ export function readReturnScroll(key) {
39
+ const storage = sessionStorageOrNull();
40
+ if (!storage)
41
+ return null;
42
+ try {
43
+ const raw = storage.getItem(storageKey(key));
44
+ if (!raw)
45
+ return null;
46
+ const parsed = JSON.parse(raw);
47
+ if (typeof parsed !== "object" || parsed === null)
48
+ return null;
49
+ const { y, savedAt } = parsed;
50
+ if (typeof y !== "number" || !Number.isFinite(y) || y < 0)
51
+ return null;
52
+ return { y, savedAt: typeof savedAt === "number" ? savedAt : 0 };
53
+ }
54
+ catch {
55
+ return null;
56
+ }
57
+ }
58
+ /** Record `y` (default: the current `window.scrollY`) for `key`. No-op without storage. */
59
+ export function saveReturnScroll(key, y) {
60
+ const storage = sessionStorageOrNull();
61
+ if (!storage)
62
+ return;
63
+ try {
64
+ const offset = typeof y === "number" ? y : window.scrollY;
65
+ const entry = { y: offset, savedAt: Date.now() };
66
+ storage.setItem(storageKey(key), JSON.stringify(entry));
67
+ }
68
+ catch {
69
+ /* storage blocked or full — nothing to restore later, which is the honest outcome */
70
+ }
71
+ }
72
+ /** Drop the entry for `key` (e.g. the list changed underneath the saved offset). */
73
+ export function clearReturnScroll(key) {
74
+ const storage = sessionStorageOrNull();
75
+ if (!storage)
76
+ return;
77
+ try {
78
+ storage.removeItem(storageKey(key));
79
+ }
80
+ catch {
81
+ /* nothing to clear */
82
+ }
83
+ }
84
+ export function useReturnScroll({ key, eligible, ready }) {
85
+ 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
+ React.useEffect(() => {
89
+ if (decisionRef.current?.key === key)
90
+ return;
91
+ const entry = readReturnScroll(key);
92
+ if (!entry) {
93
+ decisionRef.current = { key, y: null, done: true };
94
+ return;
95
+ }
96
+ if (!eligible) {
97
+ // A cold return: nothing cached to restore against. Discard permanently for this visit.
98
+ clearReturnScroll(key);
99
+ decisionRef.current = { key, y: null, done: true };
100
+ return;
101
+ }
102
+ decisionRef.current = { key, y: entry.y, done: false };
103
+ }, [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
+ React.useEffect(() => {
107
+ const decision = decisionRef.current;
108
+ if (!decision || decision.key !== key || decision.y === null || decision.done || !ready)
109
+ return;
110
+ if (typeof window === "undefined")
111
+ return;
112
+ const y = decision.y;
113
+ const frame = window.requestAnimationFrame(() => {
114
+ window.scrollTo({ top: y, left: 0, behavior: "instant" });
115
+ clearReturnScroll(key);
116
+ decision.done = true;
117
+ });
118
+ return () => window.cancelAnimationFrame(frame);
119
+ }, [key, ready]);
120
+ const save = React.useCallback(() => saveReturnScroll(key), [key]);
121
+ return { save };
122
+ }
123
+ //# sourceMappingURL=use-return-scroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-return-scroll.js","sourceRoot":"","sources":["../../../src/react/hooks/use-return-scroll.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,wFAAwF;AACxF,EAAE;AACF,uFAAuF;AACvF,mFAAmF;AACnF,sFAAsF;AACtF,qFAAqF;AACrF,sFAAsF;AACtF,gCAAgC;AAChC,EAAE;AACF,yCAAyC;AACzC,uFAAuF;AACvF,0FAA0F;AAC1F,wFAAwF;AACxF,oFAAoF;AACpF,0DAA0D;AAC1D,2FAA2F;AAC3F,0FAA0F;AAC1F,sFAAsF;AACtF,6DAA6D;AAC7D,oEAAoE;AAEpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAuBxC,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,iFAAiF;AACjF,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,OAAO,GAAG,oBAAoB,EAAE,C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AAC,CAAC,CAAC;IAEpB,2FAA2F;IAC3F,qFAAqF;IACrF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC;QACrC,IAAI,CAAC,QAAQ,IAAI,QAAQ,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\n// Return-scroll: bring a list back to where the user left it after a REAL route change.\n//\n// A same-page view swap keeps its component mounted and can restore from a ref; a list\n// whose detail pages have their own URLs unmounts, so the offset has to survive in\n// per-tab storage and the restore has to wait until the list is displayed at its real\n// height again. This hook is the ONE owner of that mechanism. It knows nothing about\n// what the list is — the caller supplies a canonical key, decides eligibility once at\n// mount, and reports readiness.\n//\n// Contract (every rule below is tested):\n// - `save()` writes { y, savedAt } for `key` — call it immediately before navigating\n// away (inside any guarded-navigation callback, so a cancelled leave writes nothing).\n// - `eligible` is latched per key the first time the hook sees that key. Not eligible\n// ⇒ the entry is deleted immediately and permanently for that key; a later flip\n// of `eligible` or `ready` never re-arms the restore.\n// - `ready` ⇒ the restore fires ONCE, in a requestAnimationFrame, `behavior: \"instant\"`,\n// then consumes the entry. The scheduled frame is cancelled on unmount or key change.\n// React Strict Mode's mount/unmount/mount cancels and reschedules, so exactly one\n// scroll happens and the entry is consumed exactly once.\n// - Blocked, unavailable, or malformed storage is a silent no-op.\n\nimport * as React from \"react\";\n\nconst STORAGE_PREFIX = \"return-scroll:\";\n\nexport interface ReturnScrollEntry {\n /** The saved `window.scrollY`. */\n y: number;\n /** Epoch ms at save time (diagnostic; the caller decides eligibility, not the hook). */\n savedAt: number;\n}\n\nexport interface UseReturnScrollOptions {\n /** The caller's CANONICAL list URL — equivalent list states must give the same key. */\n key: string;\n /** Decided by the caller ONCE at mount (e.g. \"the list's data was already cached on first render\"). */\n eligible: boolean;\n /** The list is displayed at its real height: data present, no error surface in its place. */\n ready: boolean;\n}\n\nexport interface UseReturnScrollResult {\n /** Record the current window offset for `key`. Call right before navigating away. */\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\n/** The stored entry for `key`, or null when absent, unreadable, or malformed. */\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\n/** Record `y` (default: the current `window.scrollY`) for `key`. No-op without storage. */\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 /* storage blocked or full — nothing to restore later, which is the honest outcome */\n }\n}\n\n/** Drop the entry for `key` (e.g. the list changed underneath the saved offset). */\nexport function clearReturnScroll(key: string): void {\n const storage = sessionStorageOrNull();\n if (!storage) return;\n try {\n storage.removeItem(storageKey(key));\n } catch {\n /* nothing to clear */\n }\n}\n\ninterface Decision {\n key: string;\n /** The offset to restore, or null when this key's return is not restorable. */\n y: number | null;\n done: boolean;\n}\n\nexport function useReturnScroll({ key, eligible, ready }: UseReturnScrollOptions): UseReturnScrollResult {\n const decisionRef = React.useRef<Decision | null>(null);\n\n // Decide ONCE per key, the first time the hook sees it. Effects may read and write refs;\n // the decision is latched, so a later `eligible` flip finds it already made and returns.\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 // A cold return: nothing cached to restore against. Discard permanently for this visit.\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 // Restore once the list is displayed at its real height. The frame is cancelled on unmount\n // or key change; Strict Mode's re-run reschedules it, so exactly one scroll happens.\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"]}
@@ -1,5 +1,7 @@
1
1
  export type { ButtonProps } from "./components/button.js";
2
2
  export { Button, buttonVariants } from "./components/button.js";
3
+ export type { SpinnerProps, SpinnerSize } from "./components/spinner.js";
4
+ export { Spinner } from "./components/spinner.js";
3
5
  export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from "./components/card.js";
4
6
  export { Label } from "./components/label.js";
5
7
  export { Textarea } from "./components/textarea.js";
@@ -43,6 +45,8 @@ export { ConsequenceDialog } from "./components/consequence-dialog.js";
43
45
  export type { MaxWidthOption, ScreenAdaptiveViewProps } from "./components/layout/screen-adaptive-view.js";
44
46
  export { ScreenAdaptiveView } from "./components/layout/screen-adaptive-view.js";
45
47
  export { useMediaQuery } from "./hooks/use-media-query.js";
48
+ export { useAsyncAction } from "./hooks/use-async-action.js";
49
+ export type { AsyncAction, UseAsyncActionOptions } from "./hooks/use-async-action.js";
46
50
  export { RelativeTime } from "./components/relative-time.js";
47
51
  export type { RelativeTimeProps } from "./components/relative-time.js";
48
52
  export { EndOfListIndicator } from "./components/end-of-list-indicator.js";
@@ -57,4 +61,6 @@ export { usePagedList } from "./hooks/use-paged-list.js";
57
61
  export type { ListPaginationState, PagedList, UsePagedListOptions } from "./hooks/use-paged-list.js";
58
62
  export { useCursorPage } from "./hooks/use-cursor-page.js";
59
63
  export type { CursorPage, CursorPager, UseCursorPageOptions } from "./hooks/use-cursor-page.js";
64
+ export { useReturnScroll, saveReturnScroll, clearReturnScroll, readReturnScroll } from "./hooks/use-return-scroll.js";
65
+ export type { ReturnScrollEntry, UseReturnScrollOptions, UseReturnScrollResult } from "./hooks/use-return-scroll.js";
60
66
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../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export { Spinner } from "./components/spinner.js";
3
4
  export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from "./components/card.js";
4
5
  export { Label } from "./components/label.js";
5
6
  export { Textarea } from "./components/textarea.js";
@@ -36,6 +37,7 @@ export { SearchDropdown } from "./components/search-dropdown.js";
36
37
  export { ConsequenceDialog } from "./components/consequence-dialog.js";
37
38
  export { ScreenAdaptiveView } from "./components/layout/screen-adaptive-view.js";
38
39
  export { useMediaQuery } from "./hooks/use-media-query.js";
40
+ export { useAsyncAction } from "./hooks/use-async-action.js";
39
41
  // Shared building blocks
40
42
  export { RelativeTime } from "./components/relative-time.js";
41
43
  export { EndOfListIndicator } from "./components/end-of-list-indicator.js";
@@ -46,4 +48,8 @@ export { ChunkErrorRecovery } from "./components/chunk-error-recovery.js";
46
48
  export { ListPagination } from "./components/list-pagination.js";
47
49
  export { usePagedList } from "./hooks/use-paged-list.js";
48
50
  export { useCursorPage } from "./hooks/use-cursor-page.js";
51
+ // Return-scroll: restore a list's window offset when the user comes back to it after a
52
+ // route change (save on leave, restore once on an eligible + ready return, keyed by the
53
+ // caller's canonical list URL).
54
+ export { useReturnScroll, saveReturnScroll, clearReturnScroll, readReturnScroll } from "./hooks/use-return-scroll.js";
49
55
  //# sourceMappingURL=index.js.map
@@ -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;AAChE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,E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,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACjI,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzK,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAElG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,yBAAyB;AACzB,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,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,kFAAkF;AAClF,iEAAiE;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["\"use client\";\n\nexport type { ButtonProps } from \"./components/button.js\";\nexport { Button, buttonVariants } from \"./components/button.js\";\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from \"./components/card.js\";\nexport { Label } from \"./components/label.js\";\nexport { Textarea } from \"./components/textarea.js\";\nexport { Skeleton } from \"./components/skeleton.js\";\nexport { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription } from \"./components/dialog.js\";\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from \"./components/popover.js\";\nexport { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup } from \"./components/dropdown-menu.js\";\nexport { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut } from \"./components/menubar.js\";\nexport { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel } from \"./components/alert-dialog.js\";\nexport { Alert, AlertTitle, AlertDescription } from \"./components/alert.js\";\nexport type { ToastProps, ToastActionElement } from \"./components/toast.js\";\nexport { ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction } 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 { Input } from \"./components/input.js\";\nexport { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton } from \"./components/select.js\";\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from \"./components/tabs.js\";\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from \"./components/tooltip.js\";\nexport { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField } 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 { Accordion, AccordionItem, AccordionTrigger, AccordionContent } 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 { ScrollArea, ScrollBar } from \"./components/scroll-area.js\";\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption } from \"./components/table.js\";\nexport { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription } 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 { ConsequenceDialogProps, ConsequenceDialogReason, ConsequenceDialogTypedConfirmation } from \"./components/consequence-dialog.js\";\nexport { ConsequenceDialog } from \"./components/consequence-dialog.js\";\n\nexport type { MaxWidthOption, ScreenAdaptiveViewProps } 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\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 { ChunkErrorRecovery } from \"./components/chunk-error-recovery.js\";\nexport type { ChunkErrorRecoveryProps } from \"./components/chunk-error-recovery.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 { ListPaginationState, PagedList, UsePagedListOptions } 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"]}
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,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACpL,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,YAAY,E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B,CAAC;AACzK,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAElG,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,yBAAyB;AACzB,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,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,kFAAkF;AAClF,iEAAiE;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,uFAAuF;AACvF,wFAAwF;AACxF,gCAAgC;AAChC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,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 { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from \"./components/card.js\";\nexport { Label } from \"./components/label.js\";\nexport { Textarea } from \"./components/textarea.js\";\nexport { Skeleton } from \"./components/skeleton.js\";\nexport { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription } from \"./components/dialog.js\";\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from \"./components/popover.js\";\nexport { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup } from \"./components/dropdown-menu.js\";\nexport { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarItem, MenubarSeparator, MenubarLabel, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarPortal, MenubarSubContent, MenubarSubTrigger, MenubarGroup, MenubarSub, MenubarShortcut } from \"./components/menubar.js\";\nexport { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel } from \"./components/alert-dialog.js\";\nexport { Alert, AlertTitle, AlertDescription } from \"./components/alert.js\";\nexport type { ToastProps, ToastActionElement } from \"./components/toast.js\";\nexport { ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction } 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 { Input } from \"./components/input.js\";\nexport { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton } from \"./components/select.js\";\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from \"./components/tabs.js\";\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from \"./components/tooltip.js\";\nexport { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField } 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 { Accordion, AccordionItem, AccordionTrigger, AccordionContent } 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 { ScrollArea, ScrollBar } from \"./components/scroll-area.js\";\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption } from \"./components/table.js\";\nexport { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription } 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 { ConsequenceDialogProps, ConsequenceDialogReason, ConsequenceDialogTypedConfirmation } from \"./components/consequence-dialog.js\";\nexport { ConsequenceDialog } from \"./components/consequence-dialog.js\";\n\nexport type { MaxWidthOption, ScreenAdaptiveViewProps } 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 { ChunkErrorRecovery } from \"./components/chunk-error-recovery.js\";\nexport type { ChunkErrorRecoveryProps } from \"./components/chunk-error-recovery.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 { ListPaginationState, PagedList, UsePagedListOptions } 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 { useReturnScroll, saveReturnScroll, clearReturnScroll, readReturnScroll } from \"./hooks/use-return-scroll.js\";\nexport type { ReturnScrollEntry, UseReturnScrollOptions, UseReturnScrollResult } 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.12",
3
+ "version": "0.11.15",
4
4
  "description": "Shared UI components for TTT Productions projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,7 +49,7 @@
49
49
  "react-dom": ">=19.0.0",
50
50
  "react-hook-form": ">=7.0.0",
51
51
  "@hookform/resolvers": ">=3.0.0",
52
- "@ttt-productions/firebase-helpers": "^0.12.4"
52
+ "@ttt-productions/firebase-helpers": "^0.12.9"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "react": {
@@ -99,7 +99,7 @@
99
99
  "typescript": "^5.8.3",
100
100
  "react-hook-form": "^7.69.0",
101
101
  "@hookform/resolvers": "^5.2.2",
102
- "@ttt-productions/firebase-helpers": "^0.12.4"
102
+ "@ttt-productions/firebase-helpers": "^0.12.9"
103
103
  },
104
104
  "author": "DJ (TTT Productions)",
105
105
  "license": "MIT"