@seekalfred/primitives 0.5.0 → 0.5.1

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 (92) hide show
  1. package/dist/accordion/accordion.d.ts +5 -5
  2. package/dist/accordion/accordion.js +13 -8
  3. package/dist/accordion/accordion.js.map +1 -1
  4. package/dist/alert/alert.d.ts +1 -1
  5. package/dist/alert/alert.js +4 -2
  6. package/dist/alert/alert.js.map +1 -1
  7. package/dist/alert-dialog/alert-dialog.d.ts +1 -1
  8. package/dist/alert-dialog/alert-dialog.js +4 -2
  9. package/dist/alert-dialog/alert-dialog.js.map +1 -1
  10. package/dist/avatar/avatar.d.ts +1 -1
  11. package/dist/avatar/avatar.js +6 -4
  12. package/dist/avatar/avatar.js.map +1 -1
  13. package/dist/badge/badge.d.ts +3 -3
  14. package/dist/badge/badge.js +4 -2
  15. package/dist/badge/badge.js.map +1 -1
  16. package/dist/breadcrumb/breadcrumb.d.ts +3 -3
  17. package/dist/breadcrumb/breadcrumb.js +7 -4
  18. package/dist/breadcrumb/breadcrumb.js.map +1 -1
  19. package/dist/button/button.d.ts +3 -3
  20. package/dist/button/button.js +4 -2
  21. package/dist/button/button.js.map +1 -1
  22. package/dist/calendar/calendar.d.ts +2 -2
  23. package/dist/calendar/calendar.js +7 -5
  24. package/dist/calendar/calendar.js.map +1 -1
  25. package/dist/card/card.d.ts +6 -6
  26. package/dist/card/card.js +19 -12
  27. package/dist/card/card.js.map +1 -1
  28. package/dist/checkbox/checkbox.d.ts +2 -2
  29. package/dist/checkbox/checkbox.js +4 -2
  30. package/dist/checkbox/checkbox.js.map +1 -1
  31. package/dist/dialog/dialog.d.ts +3 -3
  32. package/dist/dialog/dialog.js +7 -4
  33. package/dist/dialog/dialog.js.map +1 -1
  34. package/dist/input/input.d.ts +1 -1
  35. package/dist/input/input.js +1 -1
  36. package/dist/label/label.d.ts +1 -1
  37. package/dist/label/label.js +4 -2
  38. package/dist/label/label.js.map +1 -1
  39. package/dist/lib/merge-refs.js +22 -0
  40. package/dist/lib/merge-refs.js.map +1 -0
  41. package/dist/menu/menu.d.ts +5 -5
  42. package/dist/menu/menu.js +10 -6
  43. package/dist/menu/menu.js.map +1 -1
  44. package/dist/popover/popover.d.ts +2 -2
  45. package/dist/popover/popover.js +4 -2
  46. package/dist/popover/popover.js.map +1 -1
  47. package/dist/progress/progress.d.ts +2 -2
  48. package/dist/progress/progress.js +4 -2
  49. package/dist/progress/progress.js.map +1 -1
  50. package/dist/radio-group/radio-group.d.ts +3 -3
  51. package/dist/radio-group/radio-group.js +7 -4
  52. package/dist/radio-group/radio-group.js.map +1 -1
  53. package/dist/scroll-area/scroll-area.d.ts +7 -6
  54. package/dist/scroll-area/scroll-area.js +6 -4
  55. package/dist/scroll-area/scroll-area.js.map +1 -1
  56. package/dist/select/select.d.ts +3 -3
  57. package/dist/select/select.js +7 -4
  58. package/dist/select/select.js.map +1 -1
  59. package/dist/separator/separator.d.ts +1 -1
  60. package/dist/separator/separator.js +4 -2
  61. package/dist/separator/separator.js.map +1 -1
  62. package/dist/sheet/sheet.d.ts +1 -1
  63. package/dist/sheet/sheet.js +4 -2
  64. package/dist/sheet/sheet.js.map +1 -1
  65. package/dist/skeleton/skeleton.d.ts +1 -1
  66. package/dist/skeleton/skeleton.js +4 -2
  67. package/dist/skeleton/skeleton.js.map +1 -1
  68. package/dist/slider/slider.d.ts +2 -2
  69. package/dist/slider/slider.js +4 -2
  70. package/dist/slider/slider.js.map +1 -1
  71. package/dist/spinner/spinner.d.ts +1 -1
  72. package/dist/spinner/spinner.js +4 -2
  73. package/dist/spinner/spinner.js.map +1 -1
  74. package/dist/switch/switch.d.ts +2 -2
  75. package/dist/switch/switch.js +4 -2
  76. package/dist/switch/switch.js.map +1 -1
  77. package/dist/table/table.d.ts +4 -4
  78. package/dist/table/table.js +4 -3
  79. package/dist/table/table.js.map +1 -1
  80. package/dist/tabs/tabs.d.ts +4 -4
  81. package/dist/tabs/tabs.js +13 -8
  82. package/dist/tabs/tabs.js.map +1 -1
  83. package/dist/textarea/textarea.d.ts +1 -1
  84. package/dist/textarea/textarea.js +4 -2
  85. package/dist/textarea/textarea.js.map +1 -1
  86. package/dist/toast/toast.d.ts +2 -2
  87. package/dist/toast/toast.js +4 -2
  88. package/dist/toast/toast.js.map +1 -1
  89. package/dist/tooltip/tooltip.d.ts +2 -2
  90. package/dist/tooltip/tooltip.js +4 -2
  91. package/dist/tooltip/tooltip.js.map +1 -1
  92. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.js","names":["AriaTextArea"],"sources":["../../src/textarea/textarea.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport {\n TextArea as AriaTextArea,\n type TextAreaProps as AriaTextAreaProps,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { fieldSurfaceVariants } from \"../lib/field-surface.js\";\n\n/**\n * Textarea, ported from the legacy component onto React Aria's TextArea.\n *\n * Census: 3 files, 3 uses -- `value`, `onChange`, `placeholder`, `id`,\n * `ref`. All native props, all still native here.\n *\n * The surface comes from `fieldSurfaceVariants`, shared with Input. The two\n * legacy files styled it separately and had already drifted -- different\n * background, different focus ring, invalid styling on one and not the\n * other -- and none of those differences was a decision anyone made.\n */\nexport const textareaVariants = cva([\n fieldSurfaceVariants(),\n\n // min-h-20 is 80px, the legacy min-h-[80px] -- but as a spacing-scale step\n // rather than a bracket value, which check:hardcoding rejects.\n \"min-h-20\",\n \"px-(--density-control-pad-md) py-(--density-control-pad-sm)\",\n \"text-base\",\n\n // A textarea is resizable by the user agent, and horizontal resize breaks\n // any layout it sits in. Vertical only.\n \"resize-y\",\n // Height is content, not a control slot, so the line-height has to be set\n // explicitly -- unset it computes to `normal`, which varies with the\n // font's own metrics.\n \"leading-(--leading-normal)\",\n]);\n\n/**\n * A multi-line text field.\n *\n * @example\n * <Textarea placeholder=\"Tell us more\" value={v} onChange={e => set(e.target.value)} />\n */\nexport interface TextareaProps extends Omit<AriaTextAreaProps, \"className\" | \"style\"> {\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n}\n\nexport function Textarea({ className, ...props }: TextareaProps) {\n return (\n <AriaTextArea {...props} data-slot=\"textarea\" className={cn(textareaVariants(), className)} />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAa,mBAAmB,IAAI;CAClC,qBAAqB;CAIrB;CACA;CACA;CAIA;CAIA;AACF,CAAC;AAaD,SAAgB,SAAS,EAAE,WAAW,GAAG,SAAwB;CAC/D,OACE,oBAACA,UAAD;EAAc,GAAI;EAAO,aAAU;EAAW,WAAW,GAAG,iBAAiB,GAAG,SAAS;CAAI,CAAA;AAEjG"}
1
+ {"version":3,"file":"textarea.js","names":["AriaTextArea"],"sources":["../../src/textarea/textarea.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef } from \"react\";\nimport {\n TextArea as AriaTextArea,\n type TextAreaProps as AriaTextAreaProps,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { fieldSurfaceVariants } from \"../lib/field-surface.js\";\n\n/**\n * Textarea, ported from the legacy component onto React Aria's TextArea.\n *\n * Census: 3 files, 3 uses -- `value`, `onChange`, `placeholder`, `id`,\n * `ref`. All native props, all still native here.\n *\n * The surface comes from `fieldSurfaceVariants`, shared with Input. The two\n * legacy files styled it separately and had already drifted -- different\n * background, different focus ring, invalid styling on one and not the\n * other -- and none of those differences was a decision anyone made.\n */\nexport const textareaVariants = cva([\n fieldSurfaceVariants(),\n\n // min-h-20 is 80px, the legacy min-h-[80px] -- but as a spacing-scale step\n // rather than a bracket value, which check:hardcoding rejects.\n \"min-h-20\",\n \"px-(--density-control-pad-md) py-(--density-control-pad-sm)\",\n \"text-base\",\n\n // A textarea is resizable by the user agent, and horizontal resize breaks\n // any layout it sits in. Vertical only.\n \"resize-y\",\n // Height is content, not a control slot, so the line-height has to be set\n // explicitly -- unset it computes to `normal`, which varies with the\n // font's own metrics.\n \"leading-(--leading-normal)\",\n]);\n\n/**\n * A multi-line text field.\n *\n * @example\n * <Textarea placeholder=\"Tell us more\" value={v} onChange={e => set(e.target.value)} />\n */\nexport interface TextareaProps extends Omit<AriaTextAreaProps, \"className\" | \"style\"> {\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, ...props },\n ref,\n) {\n return (\n <AriaTextArea\n ref={ref}\n {...props}\n data-slot=\"textarea\"\n className={cn(textareaVariants(), className)}\n />\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,MAAa,mBAAmB,IAAI;CAClC,qBAAqB;CAIrB;CACA;CACA;CAIA;CAIA;AACF,CAAC;AAaD,MAAa,WAAW,WAA+C,SAAS,SAC9E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,UAAD;EACO;EACL,GAAI;EACJ,aAAU;EACV,WAAW,GAAG,iBAAiB,GAAG,SAAS;CAC5C,CAAA;AAEL,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { VariantProps } from "class-variance-authority";
2
- import { UNSTABLE_ToastQueue } from "react-aria-components";
3
2
  import { ReactNode } from "react";
3
+ import { UNSTABLE_ToastQueue } from "react-aria-components";
4
4
  //#region src/toast/toast.d.ts
5
5
  /**
6
6
  * Toast: a transient message, announced without stealing focus.
@@ -88,6 +88,6 @@ export interface ToastRegionProps {
88
88
  * React Aria only renders the landmark while something is queued, so this
89
89
  * costs nothing on a quiet screen.
90
90
  */
91
- export declare function ToastRegion({ label, closeLabel, className }: ToastRegionProps): import("react").JSX.Element;
91
+ export declare const ToastRegion: import("react").ForwardRefExoticComponent<ToastRegionProps & import("react").RefAttributes<HTMLDivElement>>;
92
92
  //#endregion
93
93
  //# sourceMappingURL=toast.d.ts.map
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/cn.js";
3
3
  import { cva } from "class-variance-authority";
4
+ import { forwardRef } from "react";
4
5
  import { Button, Text, UNSTABLE_Toast, UNSTABLE_ToastContent, UNSTABLE_ToastQueue, UNSTABLE_ToastRegion } from "react-aria-components";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  //#region src/toast/toast.tsx
@@ -95,8 +96,9 @@ function toast(content, timeout = 5e3) {
95
96
  * React Aria only renders the landmark while something is queued, so this
96
97
  * costs nothing on a quiet screen.
97
98
  */
98
- function ToastRegion({ label, closeLabel = "Dismiss", className }) {
99
+ const ToastRegion = forwardRef(function ToastRegion({ label, closeLabel = "Dismiss", className }, ref) {
99
100
  return /* @__PURE__ */ jsx(UNSTABLE_ToastRegion, {
101
+ ref,
100
102
  queue: toastQueue,
101
103
  "aria-label": label,
102
104
  "data-slot": "toast-region",
@@ -138,7 +140,7 @@ function ToastRegion({ label, closeLabel = "Dismiss", className }) {
138
140
  })]
139
141
  })
140
142
  });
141
- }
143
+ });
142
144
  //#endregion
143
145
  export { ToastRegion, toast, toastCloseVariants, toastQueue, toastRegionVariants, toastVariants };
144
146
 
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","names":["AriaToastQueue","AriaToastRegion","AriaToast","AriaToastContent","AriaText","AriaButton"],"sources":["../../src/toast/toast.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { ReactNode } from \"react\";\nimport {\n Button as AriaButton,\n Text as AriaText,\n UNSTABLE_Toast as AriaToast,\n UNSTABLE_ToastContent as AriaToastContent,\n UNSTABLE_ToastQueue as AriaToastQueue,\n UNSTABLE_ToastRegion as AriaToastRegion,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\n\n/**\n * Toast: a transient message, announced without stealing focus.\n *\n * Maturity: **experimental**, and the reason is upstream rather than here.\n * React Aria ships this API as `UNSTABLE_Toast*` in 1.21.1, so a RAC minor\n * bump can rename or reshape it. The alternative was hand-rolling the live\n * region, the queue, the timers and the focus behaviour, which is how every\n * toast implementation acquires its accessibility bugs -- so this takes the\n * upstream one and labels the risk instead of hiding it.\n *\n * THE PRODUCT HAS 30 FILES CALLING `useToast` AND 67 `toast(...)` CALLS, and\n * its implementation is the shadcn reducer with both of its known defects\n * still in place:\n *\n * TOAST_LIMIT = 1 -- a second toast REPLACES the first, so a\n * burst of results shows only the last one.\n * TOAST_REMOVE_DELAY = 1e6 -- sixteen minutes. Nothing auto-dismisses;\n * every toast waits to be closed by hand.\n *\n * Neither is ported. `maxVisibleToasts` defaults to 3 and `timeout` to 5s,\n * which is the WCAG 2.2.1 floor React Aria enforces -- it REFUSES a timeout\n * under 5000ms, because a message that vanishes faster cannot be read by\n * someone using a screen magnifier.\n *\n * The queue is a module singleton on purpose. The product's `toast()` is\n * importable from anywhere and called from API error handlers and effects\n * that have no component to hang a hook off, and a context-based queue would\n * have made those 67 call sites into 67 refactors.\n */\n\n/** Where the region sits. Fixed, above everything, out of the way of content. */\nexport const toastRegionVariants = cva([\n \"fixed z-50 flex flex-col gap-2 box-border\",\n // Logical insets so the stack follows the writing direction.\n \"bottom-(--density-bar-pad-y) end-(--density-bar-pad-x)\",\n \"w-[min(24rem,calc(100vw-2rem))]\",\n \"outline-none\",\n]);\n\nexport const toastVariants = cva(\n [\n \"flex items-start gap-3 box-border w-full\",\n \"rounded-md border-(length:--border-width) p-(--density-bar-pad-x)\",\n \"font-sans shadow-surface\",\n \"motion-safe:transition-opacity motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n // Not colour alone: an exiting toast fades AND the region reflows.\n \"data-[animation=exiting]:opacity-0\",\n ],\n {\n variants: {\n /*\n * The same vocabulary as Badge, deliberately. The product's toast had\n * `default` and `destructive` only, so 38 of its 67 calls pass a variant\n * that cannot say \"this worked\" -- and a save confirmation styled\n * identically to a failure is the most common thing a toast gets wrong.\n */\n tone: {\n neutral: \"bg-background border-separator text-foreground\",\n success: \"bg-success-subtle border-success-strong text-success-foreground\",\n warning: \"bg-warning-subtle border-warning-strong text-warning-foreground\",\n danger:\n \"bg-destructive-subtle border-destructive-strong text-destructive-subtle-foreground\",\n info: \"bg-info-subtle border-info-strong text-info-foreground\",\n },\n },\n defaultVariants: { tone: \"neutral\" },\n },\n);\n\nexport const toastCloseVariants = cva([\n \"ms-auto shrink-0 rounded-sm cursor-pointer\",\n \"text-current opacity-70 data-[hovered]:opacity-100\",\n \"outline-none\",\n \"data-[focus-visible]:outline-solid\",\n \"data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset)\",\n \"data-[focus-visible]:outline-(--color-ring)\",\n]);\n\n/** What a toast carries. `title` is required: an unnamed toast announces nothing. */\nexport interface ToastContent extends VariantProps<typeof toastVariants> {\n /** The message. Required -- a toast with only a description announces as loose text. */\n title: ReactNode;\n /** Secondary detail, beneath the title. */\n description?: ReactNode;\n}\n\n/**\n * The queue every `toast()` call feeds.\n *\n * Exported so a consumer can read `visibleToasts` in a test, or dismiss them\n * on a route change -- there is no `clear()` upstream, so that is\n * `[...toastQueue.visibleToasts].forEach((t) => toastQueue.close(t.key))`.\n * Not something to touch in normal use.\n */\nexport const toastQueue = new AriaToastQueue<ToastContent>({\n /*\n * Three, against the product's one. Its TOAST_LIMIT of 1 means a second\n * toast REPLACES the first -- so a page that reports three failed uploads\n * shows one and silently drops the rest.\n */\n maxVisibleToasts: 3,\n});\n\n/**\n * Show a toast.\n *\n * @example\n * toast({ title: \"Report saved\" });\n * toast({ title: \"Upload failed\", description: err.message, tone: \"danger\" });\n *\n * @param timeout - ms before it dismisses itself. React Aria REFUSES anything\n * under 5000 and anything at all while the region is focused, because a\n * message that disappears before it can be read fails WCAG 2.2.1. Pass 0 to\n * require a manual dismiss, which is right for an error a user must act on.\n */\nexport function toast(content: ToastContent, timeout = 5000) {\n return toastQueue.add(content, timeout === 0 ? undefined : { timeout });\n}\n\nexport interface ToastRegionProps {\n /**\n * Names the region for assistive tech.\n *\n * **Required.** React Aria renders the region as a labelled landmark, and\n * an unnamed one is announced as \"region\" with no indication of what just\n * arrived. It is a prop rather than a default string because\n * ARCHITECTURE section 7 rule 9 routes user-visible copy through the\n * consumer until `useMessages()` exists.\n */\n label: string;\n /** Accessible name for each toast's dismiss control. */\n closeLabel?: string;\n /** Extra classes for the region. Merged last. */\n className?: string;\n}\n\n/**\n * Renders the queue. Mount ONCE, near the root.\n *\n * React Aria only renders the landmark while something is queued, so this\n * costs nothing on a quiet screen.\n */\nexport function ToastRegion({ label, closeLabel = \"Dismiss\", className }: ToastRegionProps) {\n return (\n <AriaToastRegion\n queue={toastQueue}\n aria-label={label}\n data-slot=\"toast-region\"\n className={cn(toastRegionVariants(), className)}\n >\n {({ toast: queued }) => (\n <AriaToast\n toast={queued}\n data-slot=\"toast\"\n data-tone={queued.content.tone ?? \"neutral\"}\n className={toastVariants({ tone: queued.content.tone })}\n >\n <AriaToastContent data-slot=\"toast-content\" className=\"flex min-w-0 flex-col gap-1\">\n {/*\n slot=\"title\" is what React Aria announces. A plain div here\n renders identically and leaves the toast unnamed.\n */}\n <AriaText\n slot=\"title\"\n data-slot=\"toast-title\"\n className=\"text-sm leading-(--leading-snug) font-medium\"\n >\n {queued.content.title}\n </AriaText>\n {queued.content.description == null ? null : (\n <AriaText\n slot=\"description\"\n data-slot=\"toast-description\"\n className=\"text-sm leading-(--leading-normal) opacity-90\"\n >\n {queued.content.description}\n </AriaText>\n )}\n </AriaToastContent>\n <AriaButton\n slot=\"close\"\n aria-label={closeLabel}\n data-slot=\"toast-close\"\n className={toastCloseVariants()}\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n className=\"size-(--icon-sm)\"\n >\n <path d=\"m4 4 8 8M12 4l-8 8\" />\n </svg>\n </AriaButton>\n </AriaToast>\n )}\n </AriaToastRegion>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,sBAAsB,IAAI;CACrC;CAEA;CACA;CACA;AACF,CAAC;AAED,MAAa,gBAAgB,IAC3B;CACE;CACA;CACA;CACA;CAEA;AACF,GACA;CACE,UAAU,EAOR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,QACE;EACF,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CACF;AAEA,MAAa,qBAAqB,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;;AAkBD,MAAa,aAAa,IAAIA,oBAA6B,EAMzD,kBAAkB,EACpB,CAAC;;;;;;;;;;;;;AAcD,SAAgB,MAAM,SAAuB,UAAU,KAAM;CAC3D,OAAO,WAAW,IAAI,SAAS,YAAY,IAAI,KAAA,IAAY,EAAE,QAAQ,CAAC;AACxE;;;;;;;AAyBA,SAAgB,YAAY,EAAE,OAAO,aAAa,WAAW,aAA+B;CAC1F,OACE,oBAACC,sBAAD;EACE,OAAO;EACP,cAAY;EACZ,aAAU;EACV,WAAW,GAAG,oBAAoB,GAAG,SAAS;EAE5C,WAAA,EAAE,OAAO,aACT,qBAACC,gBAAD;GACE,OAAO;GACP,aAAU;GACV,aAAW,OAAO,QAAQ,QAAQ;GAClC,WAAW,cAAc,EAAE,MAAM,OAAO,QAAQ,KAAK,CAAC;GAJxD,UAAA,CAME,qBAACC,uBAAD;IAAkB,aAAU;IAAgB,WAAU;IAAtD,UAAA,CAKE,oBAACC,MAAD;KACE,MAAK;KACL,aAAU;KACV,WAAU;KAET,UAAA,OAAO,QAAQ;IACR,CAAA,GACT,OAAO,QAAQ,eAAe,OAAO,OACpC,oBAACA,MAAD;KACE,MAAK;KACL,aAAU;KACV,WAAU;KAET,UAAA,OAAO,QAAQ;IACR,CAAA,CAEI;GAClB,CAAA,GAAA,oBAACC,QAAD;IACE,MAAK;IACL,cAAY;IACZ,aAAU;IACV,WAAW,mBAAmB;IAE9B,UAAA,oBAAC,OAAD;KACE,eAAY;KACZ,SAAQ;KACR,MAAK;KACL,QAAO;KACP,aAAY;KACZ,eAAc;KACd,WAAU;KAEV,UAAA,oBAAC,QAAD,EAAM,GAAE,qBAAsB,CAAA;IAC3B,CAAA;GACK,CAAA,CACH;;CAEE,CAAA;AAErB"}
1
+ {"version":3,"file":"toast.js","names":["AriaToastQueue","AriaToastRegion","AriaToast","AriaToastContent","AriaText","AriaButton"],"sources":["../../src/toast/toast.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport {\n Button as AriaButton,\n Text as AriaText,\n UNSTABLE_Toast as AriaToast,\n UNSTABLE_ToastContent as AriaToastContent,\n UNSTABLE_ToastQueue as AriaToastQueue,\n UNSTABLE_ToastRegion as AriaToastRegion,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\n\n/**\n * Toast: a transient message, announced without stealing focus.\n *\n * Maturity: **experimental**, and the reason is upstream rather than here.\n * React Aria ships this API as `UNSTABLE_Toast*` in 1.21.1, so a RAC minor\n * bump can rename or reshape it. The alternative was hand-rolling the live\n * region, the queue, the timers and the focus behaviour, which is how every\n * toast implementation acquires its accessibility bugs -- so this takes the\n * upstream one and labels the risk instead of hiding it.\n *\n * THE PRODUCT HAS 30 FILES CALLING `useToast` AND 67 `toast(...)` CALLS, and\n * its implementation is the shadcn reducer with both of its known defects\n * still in place:\n *\n * TOAST_LIMIT = 1 -- a second toast REPLACES the first, so a\n * burst of results shows only the last one.\n * TOAST_REMOVE_DELAY = 1e6 -- sixteen minutes. Nothing auto-dismisses;\n * every toast waits to be closed by hand.\n *\n * Neither is ported. `maxVisibleToasts` defaults to 3 and `timeout` to 5s,\n * which is the WCAG 2.2.1 floor React Aria enforces -- it REFUSES a timeout\n * under 5000ms, because a message that vanishes faster cannot be read by\n * someone using a screen magnifier.\n *\n * The queue is a module singleton on purpose. The product's `toast()` is\n * importable from anywhere and called from API error handlers and effects\n * that have no component to hang a hook off, and a context-based queue would\n * have made those 67 call sites into 67 refactors.\n */\n\n/** Where the region sits. Fixed, above everything, out of the way of content. */\nexport const toastRegionVariants = cva([\n \"fixed z-50 flex flex-col gap-2 box-border\",\n // Logical insets so the stack follows the writing direction.\n \"bottom-(--density-bar-pad-y) end-(--density-bar-pad-x)\",\n \"w-[min(24rem,calc(100vw-2rem))]\",\n \"outline-none\",\n]);\n\nexport const toastVariants = cva(\n [\n \"flex items-start gap-3 box-border w-full\",\n \"rounded-md border-(length:--border-width) p-(--density-bar-pad-x)\",\n \"font-sans shadow-surface\",\n \"motion-safe:transition-opacity motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n // Not colour alone: an exiting toast fades AND the region reflows.\n \"data-[animation=exiting]:opacity-0\",\n ],\n {\n variants: {\n /*\n * The same vocabulary as Badge, deliberately. The product's toast had\n * `default` and `destructive` only, so 38 of its 67 calls pass a variant\n * that cannot say \"this worked\" -- and a save confirmation styled\n * identically to a failure is the most common thing a toast gets wrong.\n */\n tone: {\n neutral: \"bg-background border-separator text-foreground\",\n success: \"bg-success-subtle border-success-strong text-success-foreground\",\n warning: \"bg-warning-subtle border-warning-strong text-warning-foreground\",\n danger:\n \"bg-destructive-subtle border-destructive-strong text-destructive-subtle-foreground\",\n info: \"bg-info-subtle border-info-strong text-info-foreground\",\n },\n },\n defaultVariants: { tone: \"neutral\" },\n },\n);\n\nexport const toastCloseVariants = cva([\n \"ms-auto shrink-0 rounded-sm cursor-pointer\",\n \"text-current opacity-70 data-[hovered]:opacity-100\",\n \"outline-none\",\n \"data-[focus-visible]:outline-solid\",\n \"data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset)\",\n \"data-[focus-visible]:outline-(--color-ring)\",\n]);\n\n/** What a toast carries. `title` is required: an unnamed toast announces nothing. */\nexport interface ToastContent extends VariantProps<typeof toastVariants> {\n /** The message. Required -- a toast with only a description announces as loose text. */\n title: ReactNode;\n /** Secondary detail, beneath the title. */\n description?: ReactNode;\n}\n\n/**\n * The queue every `toast()` call feeds.\n *\n * Exported so a consumer can read `visibleToasts` in a test, or dismiss them\n * on a route change -- there is no `clear()` upstream, so that is\n * `[...toastQueue.visibleToasts].forEach((t) => toastQueue.close(t.key))`.\n * Not something to touch in normal use.\n */\nexport const toastQueue = new AriaToastQueue<ToastContent>({\n /*\n * Three, against the product's one. Its TOAST_LIMIT of 1 means a second\n * toast REPLACES the first -- so a page that reports three failed uploads\n * shows one and silently drops the rest.\n */\n maxVisibleToasts: 3,\n});\n\n/**\n * Show a toast.\n *\n * @example\n * toast({ title: \"Report saved\" });\n * toast({ title: \"Upload failed\", description: err.message, tone: \"danger\" });\n *\n * @param timeout - ms before it dismisses itself. React Aria REFUSES anything\n * under 5000 and anything at all while the region is focused, because a\n * message that disappears before it can be read fails WCAG 2.2.1. Pass 0 to\n * require a manual dismiss, which is right for an error a user must act on.\n */\nexport function toast(content: ToastContent, timeout = 5000) {\n return toastQueue.add(content, timeout === 0 ? undefined : { timeout });\n}\n\nexport interface ToastRegionProps {\n /**\n * Names the region for assistive tech.\n *\n * **Required.** React Aria renders the region as a labelled landmark, and\n * an unnamed one is announced as \"region\" with no indication of what just\n * arrived. It is a prop rather than a default string because\n * ARCHITECTURE section 7 rule 9 routes user-visible copy through the\n * consumer until `useMessages()` exists.\n */\n label: string;\n /** Accessible name for each toast's dismiss control. */\n closeLabel?: string;\n /** Extra classes for the region. Merged last. */\n className?: string;\n}\n\n/**\n * Renders the queue. Mount ONCE, near the root.\n *\n * React Aria only renders the landmark while something is queued, so this\n * costs nothing on a quiet screen.\n */\nexport const ToastRegion = forwardRef<HTMLDivElement, ToastRegionProps>(function ToastRegion(\n { label, closeLabel = \"Dismiss\", className },\n ref,\n) {\n return (\n <AriaToastRegion\n ref={ref}\n queue={toastQueue}\n aria-label={label}\n data-slot=\"toast-region\"\n className={cn(toastRegionVariants(), className)}\n >\n {({ toast: queued }) => (\n <AriaToast\n toast={queued}\n data-slot=\"toast\"\n data-tone={queued.content.tone ?? \"neutral\"}\n className={toastVariants({ tone: queued.content.tone })}\n >\n <AriaToastContent data-slot=\"toast-content\" className=\"flex min-w-0 flex-col gap-1\">\n {/*\n slot=\"title\" is what React Aria announces. A plain div here\n renders identically and leaves the toast unnamed.\n */}\n <AriaText\n slot=\"title\"\n data-slot=\"toast-title\"\n className=\"text-sm leading-(--leading-snug) font-medium\"\n >\n {queued.content.title}\n </AriaText>\n {queued.content.description == null ? null : (\n <AriaText\n slot=\"description\"\n data-slot=\"toast-description\"\n className=\"text-sm leading-(--leading-normal) opacity-90\"\n >\n {queued.content.description}\n </AriaText>\n )}\n </AriaToastContent>\n <AriaButton\n slot=\"close\"\n aria-label={closeLabel}\n data-slot=\"toast-close\"\n className={toastCloseVariants()}\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n className=\"size-(--icon-sm)\"\n >\n <path d=\"m4 4 8 8M12 4l-8 8\" />\n </svg>\n </AriaButton>\n </AriaToast>\n )}\n </AriaToastRegion>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,sBAAsB,IAAI;CACrC;CAEA;CACA;CACA;AACF,CAAC;AAED,MAAa,gBAAgB,IAC3B;CACE;CACA;CACA;CACA;CAEA;AACF,GACA;CACE,UAAU,EAOR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,SAAS;EACT,QACE;EACF,MAAM;CACR,EACF;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CACF;AAEA,MAAa,qBAAqB,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;;AAkBD,MAAa,aAAa,IAAIA,oBAA6B,EAMzD,kBAAkB,EACpB,CAAC;;;;;;;;;;;;;AAcD,SAAgB,MAAM,SAAuB,UAAU,KAAM;CAC3D,OAAO,WAAW,IAAI,SAAS,YAAY,IAAI,KAAA,IAAY,EAAE,QAAQ,CAAC;AACxE;;;;;;;AAyBA,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,OAAO,aAAa,WAAW,aACjC,KACA;CACA,OACE,oBAACC,sBAAD;EACO;EACL,OAAO;EACP,cAAY;EACZ,aAAU;EACV,WAAW,GAAG,oBAAoB,GAAG,SAAS;EAE5C,WAAA,EAAE,OAAO,aACT,qBAACC,gBAAD;GACE,OAAO;GACP,aAAU;GACV,aAAW,OAAO,QAAQ,QAAQ;GAClC,WAAW,cAAc,EAAE,MAAM,OAAO,QAAQ,KAAK,CAAC;GAJxD,UAAA,CAME,qBAACC,uBAAD;IAAkB,aAAU;IAAgB,WAAU;IAAtD,UAAA,CAKE,oBAACC,MAAD;KACE,MAAK;KACL,aAAU;KACV,WAAU;KAET,UAAA,OAAO,QAAQ;IACR,CAAA,GACT,OAAO,QAAQ,eAAe,OAAO,OACpC,oBAACA,MAAD;KACE,MAAK;KACL,aAAU;KACV,WAAU;KAET,UAAA,OAAO,QAAQ;IACR,CAAA,CAEI;GAClB,CAAA,GAAA,oBAACC,QAAD;IACE,MAAK;IACL,cAAY;IACZ,aAAU;IACV,WAAW,mBAAmB;IAE9B,UAAA,oBAAC,OAAD;KACE,eAAY;KACZ,SAAQ;KACR,MAAK;KACL,QAAO;KACP,aAAY;KACZ,eAAc;KACd,WAAU;KAEV,UAAA,oBAAC,QAAD,EAAM,GAAE,qBAAsB,CAAA;IAC3B,CAAA;GACK,CAAA,CACH;;CAEE,CAAA;AAErB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { TooltipProps, TooltipTriggerComponentProps } from "react-aria-components";
2
1
  import { ReactNode } from "react";
2
+ import { TooltipProps, TooltipTriggerComponentProps } from "react-aria-components";
3
3
  //#region src/tooltip/tooltip.d.ts
4
4
  /**
5
5
  * Tooltip, ported from the legacy shadcn/Radix component.
@@ -46,7 +46,7 @@ interface TooltipProps$1 extends Omit<TooltipProps, "className" | "style" | "chi
46
46
  */
47
47
  placement?: TooltipProps["placement"];
48
48
  }
49
- declare function Tooltip$1({ children, className, placement, ...props }: TooltipProps$1): import("react").JSX.Element;
49
+ declare const Tooltip$1: import("react").ForwardRefExoticComponent<TooltipProps$1 & import("react").RefAttributes<HTMLDivElement>>;
50
50
  /**
51
51
  * Pairs a trigger with a tooltip.
52
52
  *
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/cn.js";
3
3
  import { cva } from "class-variance-authority";
4
+ import { forwardRef } from "react";
4
5
  import { OverlayArrow, Tooltip, TooltipTrigger } from "react-aria-components";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  //#region src/tooltip/tooltip.tsx
@@ -33,8 +34,9 @@ const tooltipVariants = cva([
33
34
  "box-border font-sans text-xs leading-(--leading-snug) text-balance",
34
35
  "outline-none"
35
36
  ]);
36
- function Tooltip$1({ children, className, placement = "top", ...props }) {
37
+ const Tooltip$1 = forwardRef(function Tooltip$2({ children, className, placement = "top", ...props }, ref) {
37
38
  return /* @__PURE__ */ jsxs(Tooltip, {
39
+ ref,
38
40
  ...props,
39
41
  placement,
40
42
  offset: 8,
@@ -51,7 +53,7 @@ function Tooltip$1({ children, className, placement = "top", ...props }) {
51
53
  })
52
54
  }), children]
53
55
  });
54
- }
56
+ });
55
57
  function TooltipTrigger$1({ delay = 0, closeDelay = 0, ...props }) {
56
58
  return /* @__PURE__ */ jsx(TooltipTrigger, {
57
59
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","names":["Tooltip","AriaTooltip","AriaOverlayArrow","TooltipTrigger","AriaTooltipTrigger"],"sources":["../../src/tooltip/tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport type { ReactNode } from \"react\";\nimport {\n OverlayArrow as AriaOverlayArrow,\n Tooltip as AriaTooltip,\n TooltipTrigger as AriaTooltipTrigger,\n type TooltipProps as AriaTooltipProps,\n type TooltipTriggerComponentProps as AriaTooltipTriggerProps,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\n\n/**\n * Tooltip, ported from the legacy shadcn/Radix component.\n *\n * Census: ten files import it but only SEVEN render anything -- three\n * import the parts and use none. Across those seven: `Tooltip` 34,\n * `TooltipTrigger` 34, `TooltipContent` 34, `TooltipProvider` 23. `side`\n * is passed 12 times: `\"top\"` 11, `\"bottom\"` once.\n *\n * `TooltipProvider` IS NOT PORTED, and that removes 23 call sites rather\n * than renaming them. The legacy `Tooltip` already wraps itself in a\n * provider, so every explicit `<TooltipProvider>` in app code nested a\n * second one inside the first -- harmless, but it also meant the\n * `skipDelayDuration` grouping the provider exists for never spanned two\n * tooltips. React Aria has no provider at all; that grouping is\n * module-global.\n *\n * THE DELAY IS THE ONE THING THAT WOULD HAVE CHANGED SILENTLY. The legacy\n * provider hardcodes `delayDuration = 0`, so all 34 tooltips appear\n * instantly on hover. React Aria's default is 1500ms. Porting without\n * noticing would have put a 1.5-second warm-up on every tooltip in the\n * app, and neither the type system nor the test suite would have said a\n * word -- so `delay` defaults to 0 here, and a story pins the default.\n */\nexport const tooltipVariants = cva([\n \"w-fit rounded-md px-3 py-1.5\",\n // The legacy palette, kept: primary-foreground on primary is 8.35:1 and\n // is already in the contrast contract. An inverse-surface tooltip is the\n // more common choice, but changing it would be a design decision with no\n // defect behind it.\n \"bg-primary text-primary-foreground\",\n \"box-border font-sans text-xs leading-(--leading-snug) text-balance\",\n \"outline-none\",\n]);\n\n/**\n * A hover and focus hint.\n *\n * @example\n * <TooltipTrigger>\n * <Button aria-label=\"Mute\"><MicOff /></Button>\n * <Tooltip>Mute</Tooltip>\n * </TooltipTrigger>\n */\nexport interface TooltipProps\n extends Omit<AriaTooltipProps, \"className\" | \"style\" | \"children\"> {\n children?: ReactNode;\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n /**\n * Where it opens. The legacy `side` prop: `\"top\"` 11 times, `\"bottom\"`\n * once, and the default for the other 22.\n *\n * @default \"top\"\n */\n placement?: AriaTooltipProps[\"placement\"];\n}\n\nexport function Tooltip({ children, className, placement = \"top\", ...props }: TooltipProps) {\n return (\n <AriaTooltip\n {...props}\n placement={placement}\n offset={8}\n data-slot=\"tooltip\"\n className={cn(tooltipVariants(), className)}\n >\n {/*\n An SVG arrow, not the legacy rotated square. That used\n `translate-y-[calc(-50%_-_2px)]` and `rounded-[2px]` -- two bracket\n values check:hardcoding rejects -- and a rotated box has to be\n re-placed for every side. React Aria rotates the whole OverlayArrow\n per placement, so one upward triangle serves all four.\n */}\n <AriaOverlayArrow data-slot=\"tooltip-arrow\">\n <svg width=\"10\" height=\"5\" viewBox=\"0 0 10 5\" className=\"fill-primary\">\n <path d=\"M0 5 5 0l5 5z\" />\n </svg>\n </AriaOverlayArrow>\n {children}\n </AriaTooltip>\n );\n}\n\n/**\n * Pairs a trigger with a tooltip.\n *\n * React Aria's `TooltipTrigger`, EXCEPT that `delay` and `closeDelay`\n * default to 0 to match the legacy provider. React Aria ships 1500ms and\n * 500ms; taking those defaults would have changed all 34 call sites\n * without a word.\n *\n * Focus opens it immediately whatever `delay` says -- React Aria passes\n * `immediate` on focus -- which is the behaviour a keyboard user needs.\n */\nexport interface TooltipTriggerProps extends AriaTooltipTriggerProps {\n /** Hover warm-up in ms. @default 0 */\n delay?: number;\n /** Hover cool-down in ms. @default 0 */\n closeDelay?: number;\n}\n\nexport function TooltipTrigger({ delay = 0, closeDelay = 0, ...props }: TooltipTriggerProps) {\n return <AriaTooltipTrigger {...props} delay={delay} closeDelay={closeDelay} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAa,kBAAkB,IAAI;CACjC;CAKA;CACA;CACA;AACF,CAAC;AAyBD,SAAgBA,UAAQ,EAAE,UAAU,WAAW,YAAY,OAAO,GAAG,SAAuB;CAC1F,OACE,qBAACC,SAAD;EACE,GAAI;EACO;EACX,QAAQ;EACR,aAAU;EACV,WAAW,GAAG,gBAAgB,GAAG,SAAS;EAL5C,UAAA,CAcE,oBAACC,cAAD;GAAkB,aAAU;GAC1B,UAAA,oBAAC,OAAD;IAAK,OAAM;IAAK,QAAO;IAAI,SAAQ;IAAW,WAAU;IACtD,UAAA,oBAAC,QAAD,EAAM,GAAE,gBAAiB,CAAA;GACtB,CAAA;EACW,CAAA,GACjB,QACU;;AAEjB;AAoBA,SAAgBC,iBAAe,EAAE,QAAQ,GAAG,aAAa,GAAG,GAAG,SAA8B;CAC3F,OAAO,oBAACC,gBAAD;EAAoB,GAAI;EAAc;EAAmB;CAAa,CAAA;AAC/E"}
1
+ {"version":3,"file":"tooltip.js","names":["Tooltip","AriaTooltip","AriaOverlayArrow","TooltipTrigger","AriaTooltipTrigger"],"sources":["../../src/tooltip/tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport {\n OverlayArrow as AriaOverlayArrow,\n Tooltip as AriaTooltip,\n TooltipTrigger as AriaTooltipTrigger,\n type TooltipProps as AriaTooltipProps,\n type TooltipTriggerComponentProps as AriaTooltipTriggerProps,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\n\n/**\n * Tooltip, ported from the legacy shadcn/Radix component.\n *\n * Census: ten files import it but only SEVEN render anything -- three\n * import the parts and use none. Across those seven: `Tooltip` 34,\n * `TooltipTrigger` 34, `TooltipContent` 34, `TooltipProvider` 23. `side`\n * is passed 12 times: `\"top\"` 11, `\"bottom\"` once.\n *\n * `TooltipProvider` IS NOT PORTED, and that removes 23 call sites rather\n * than renaming them. The legacy `Tooltip` already wraps itself in a\n * provider, so every explicit `<TooltipProvider>` in app code nested a\n * second one inside the first -- harmless, but it also meant the\n * `skipDelayDuration` grouping the provider exists for never spanned two\n * tooltips. React Aria has no provider at all; that grouping is\n * module-global.\n *\n * THE DELAY IS THE ONE THING THAT WOULD HAVE CHANGED SILENTLY. The legacy\n * provider hardcodes `delayDuration = 0`, so all 34 tooltips appear\n * instantly on hover. React Aria's default is 1500ms. Porting without\n * noticing would have put a 1.5-second warm-up on every tooltip in the\n * app, and neither the type system nor the test suite would have said a\n * word -- so `delay` defaults to 0 here, and a story pins the default.\n */\nexport const tooltipVariants = cva([\n \"w-fit rounded-md px-3 py-1.5\",\n // The legacy palette, kept: primary-foreground on primary is 8.35:1 and\n // is already in the contrast contract. An inverse-surface tooltip is the\n // more common choice, but changing it would be a design decision with no\n // defect behind it.\n \"bg-primary text-primary-foreground\",\n \"box-border font-sans text-xs leading-(--leading-snug) text-balance\",\n \"outline-none\",\n]);\n\n/**\n * A hover and focus hint.\n *\n * @example\n * <TooltipTrigger>\n * <Button aria-label=\"Mute\"><MicOff /></Button>\n * <Tooltip>Mute</Tooltip>\n * </TooltipTrigger>\n */\nexport interface TooltipProps\n extends Omit<AriaTooltipProps, \"className\" | \"style\" | \"children\"> {\n children?: ReactNode;\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n /**\n * Where it opens. The legacy `side` prop: `\"top\"` 11 times, `\"bottom\"`\n * once, and the default for the other 22.\n *\n * @default \"top\"\n */\n placement?: AriaTooltipProps[\"placement\"];\n}\n\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(function Tooltip(\n { children, className, placement = \"top\", ...props },\n ref,\n) {\n return (\n <AriaTooltip\n // The ref goes on the tooltip itself, not the OverlayArrow child below\n // -- the arrow is a decorative sub-element, not the tooltip's own DOM\n // node.\n ref={ref}\n {...props}\n placement={placement}\n offset={8}\n data-slot=\"tooltip\"\n className={cn(tooltipVariants(), className)}\n >\n {/*\n An SVG arrow, not the legacy rotated square. That used\n `translate-y-[calc(-50%_-_2px)]` and `rounded-[2px]` -- two bracket\n values check:hardcoding rejects -- and a rotated box has to be\n re-placed for every side. React Aria rotates the whole OverlayArrow\n per placement, so one upward triangle serves all four.\n */}\n <AriaOverlayArrow data-slot=\"tooltip-arrow\">\n <svg width=\"10\" height=\"5\" viewBox=\"0 0 10 5\" className=\"fill-primary\">\n <path d=\"M0 5 5 0l5 5z\" />\n </svg>\n </AriaOverlayArrow>\n {children}\n </AriaTooltip>\n );\n});\n\n/**\n * Pairs a trigger with a tooltip.\n *\n * React Aria's `TooltipTrigger`, EXCEPT that `delay` and `closeDelay`\n * default to 0 to match the legacy provider. React Aria ships 1500ms and\n * 500ms; taking those defaults would have changed all 34 call sites\n * without a word.\n *\n * Focus opens it immediately whatever `delay` says -- React Aria passes\n * `immediate` on focus -- which is the behaviour a keyboard user needs.\n */\nexport interface TooltipTriggerProps extends AriaTooltipTriggerProps {\n /** Hover warm-up in ms. @default 0 */\n delay?: number;\n /** Hover cool-down in ms. @default 0 */\n closeDelay?: number;\n}\n\nexport function TooltipTrigger({ delay = 0, closeDelay = 0, ...props }: TooltipTriggerProps) {\n return <AriaTooltipTrigger {...props} delay={delay} closeDelay={closeDelay} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAa,kBAAkB,IAAI;CACjC;CAKA;CACA;CACA;AACF,CAAC;AAyBD,MAAaA,YAAU,WAAyC,SAASA,UACvE,EAAE,UAAU,WAAW,YAAY,OAAO,GAAG,SAC7C,KACA;CACA,OACE,qBAACC,SAAD;EAIO;EACL,GAAI;EACO;EACX,QAAQ;EACR,aAAU;EACV,WAAW,GAAG,gBAAgB,GAAG,SAAS;EAT5C,UAAA,CAkBE,oBAACC,cAAD;GAAkB,aAAU;GAC1B,UAAA,oBAAC,OAAD;IAAK,OAAM;IAAK,QAAO;IAAI,SAAQ;IAAW,WAAU;IACtD,UAAA,oBAAC,QAAD,EAAM,GAAE,gBAAiB,CAAA;GACtB,CAAA;EACW,CAAA,GACjB,QACU;;AAEjB,CAAC;AAoBD,SAAgBC,iBAAe,EAAE,QAAQ,GAAG,aAAa,GAAG,GAAG,SAA8B;CAC3F,OAAO,oBAACC,gBAAD;EAAoB,GAAI;EAAc;EAAmB;CAAa,CAAA;AAC/E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seekalfred/primitives",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Accessible, styled primitives built on React Aria Components.",
@@ -154,7 +154,7 @@
154
154
  "react-dom": "^18.0.0 || ^19.0.0"
155
155
  },
156
156
  "dependencies": {
157
- "@seekalfred/tokens": "^0.5.0",
157
+ "@seekalfred/tokens": "^0.5.1",
158
158
  "class-variance-authority": "0.7.1",
159
159
  "clsx": "2.1.1",
160
160
  "tailwind-merge": "3.6.0"
@@ -162,7 +162,7 @@
162
162
  "devDependencies": {
163
163
  "@arethetypeswrong/cli": "0.18.5",
164
164
  "@internationalized/date": "3.12.4",
165
- "@seekalfred/styles": "^0.5.0",
165
+ "@seekalfred/styles": "^0.5.1",
166
166
  "@seekalfred/tsconfig": "0.0.0",
167
167
  "@size-limit/preset-small-lib": "13.0.3",
168
168
  "@storybook/react-vite": "10.6.0",