@radui/ui 0.5.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +2 -0
  2. package/dist/components/Accordion.d.ts +20 -34
  3. package/dist/components/Accordion.js +1 -1
  4. package/dist/components/AlertDialog.d.ts +46 -1
  5. package/dist/components/AlertDialog.js +1 -1
  6. package/dist/components/AspectRatio.d.ts +2 -2
  7. package/dist/components/AspectRatio.js +1 -1
  8. package/dist/components/Avatar.d.ts +4 -1
  9. package/dist/components/Avatar.js +1 -1
  10. package/dist/components/AvatarGroup.d.ts +9 -1
  11. package/dist/components/AvatarGroup.js +1 -1
  12. package/dist/components/AvatarPrimitiveFallback-C1siRii4.js +1 -0
  13. package/dist/components/Badge.d.ts +3 -3
  14. package/dist/components/Badge.js +1 -1
  15. package/dist/components/BlockQuote.js +1 -1
  16. package/dist/components/Breadcrumb.d.ts +70 -0
  17. package/dist/components/Breadcrumb.js +1 -0
  18. package/dist/components/Button.js +1 -1
  19. package/dist/components/Callout.d.ts +4 -1
  20. package/dist/components/Callout.js +1 -1
  21. package/dist/components/Card.d.ts +1 -1
  22. package/dist/components/Card.js +1 -1
  23. package/dist/components/Checkbox.d.ts +29 -3
  24. package/dist/components/Checkbox.js +8 -1
  25. package/dist/components/CheckboxCards.d.ts +31 -4
  26. package/dist/components/CheckboxCards.js +1 -1
  27. package/dist/components/CheckboxGroup.d.ts +29 -2
  28. package/dist/components/CheckboxGroup.js +1 -1
  29. package/dist/components/CheckboxGroupPrimitive-DfHQYkep.js +1 -0
  30. package/dist/components/Code.js +1 -1
  31. package/dist/components/Collapsible.d.ts +10 -1
  32. package/dist/components/Collapsible.js +1 -1
  33. package/dist/components/Combobox.d.ts +1 -1
  34. package/dist/components/Combobox.js +1 -1
  35. package/dist/components/ComboboxPrimitive-DQcJ8pzQ.js +1 -0
  36. package/dist/components/Command.d.ts +7 -1
  37. package/dist/components/Command.js +1 -1
  38. package/dist/components/ContextMenu.d.ts +23 -23
  39. package/dist/components/ContextMenu.js +1 -1
  40. package/dist/components/DataList.d.ts +10 -4
  41. package/dist/components/DataList.js +1 -1
  42. package/dist/components/Dialog.d.ts +7 -1
  43. package/dist/components/Dialog.js +1 -1
  44. package/dist/components/Disclosure.d.ts +17 -7
  45. package/dist/components/Disclosure.js +1 -1
  46. package/dist/components/Drawer.d.ts +95 -17
  47. package/dist/components/Drawer.js +1 -1
  48. package/dist/components/DropdownMenu.d.ts +23 -23
  49. package/dist/components/DropdownMenu.js +1 -1
  50. package/dist/components/Em.js +1 -1
  51. package/dist/components/Fieldset.d.ts +43 -0
  52. package/dist/components/Fieldset.js +1 -0
  53. package/dist/components/Heading.js +1 -1
  54. package/dist/components/HoverCard.d.ts +3 -1
  55. package/dist/components/HoverCard.js +1 -1
  56. package/dist/components/Kbd.js +1 -1
  57. package/dist/components/Link.js +1 -1
  58. package/dist/components/LiveRegion.d.ts +73 -0
  59. package/dist/components/LiveRegion.js +1 -0
  60. package/dist/components/MenuPrimitive-D9VMz2TZ.js +1 -0
  61. package/dist/components/Menubar.d.ts +119 -29
  62. package/dist/components/Menubar.js +1 -1
  63. package/dist/components/Minimap.d.ts +16 -12
  64. package/dist/components/Minimap.js +1 -1
  65. package/dist/components/NavigationMenu.d.ts +11 -3
  66. package/dist/components/NavigationMenu.js +1 -1
  67. package/dist/components/NumberField.d.ts +23 -2
  68. package/dist/components/NumberField.js +1 -1
  69. package/dist/components/Popover.d.ts +83 -0
  70. package/dist/components/Popover.js +1 -0
  71. package/dist/components/Progress.d.ts +5 -4
  72. package/dist/components/Progress.js +1 -1
  73. package/dist/components/Quote.js +1 -1
  74. package/dist/components/Radio.js +1 -1
  75. package/dist/components/RadioCards.d.ts +1 -1
  76. package/dist/components/RadioCards.js +1 -1
  77. package/dist/components/RadioGroup.d.ts +1 -1
  78. package/dist/components/RadioGroup.js +1 -1
  79. package/dist/components/RadioGroupPrimitive-D1PP4y2M.js +1 -0
  80. package/dist/components/ScrollArea.d.ts +8 -4
  81. package/dist/components/ScrollArea.js +1 -1
  82. package/dist/components/Select.d.ts +1 -1
  83. package/dist/components/Select.js +1 -1
  84. package/dist/components/Separator.js +1 -1
  85. package/dist/components/Skeleton.d.ts +12 -6
  86. package/dist/components/Skeleton.js +1 -1
  87. package/dist/components/Slider.d.ts +2 -2
  88. package/dist/components/Slider.js +1 -1
  89. package/dist/components/Spinner.js +1 -1
  90. package/dist/components/Splitter.d.ts +7 -1
  91. package/dist/components/Splitter.js +1 -1
  92. package/dist/components/Steps.d.ts +25 -10
  93. package/dist/components/Steps.js +1 -1
  94. package/dist/components/Strong.js +1 -1
  95. package/dist/components/Switch.d.ts +23 -1
  96. package/dist/components/Switch.js +1 -1
  97. package/dist/components/TabNav.d.ts +34 -9
  98. package/dist/components/TabNav.js +1 -1
  99. package/dist/components/Table.d.ts +66 -19
  100. package/dist/components/Table.js +1 -1
  101. package/dist/components/Tabs.d.ts +3 -1
  102. package/dist/components/Tabs.js +1 -1
  103. package/dist/components/Text.d.ts +2 -2
  104. package/dist/components/Text.js +1 -1
  105. package/dist/components/TextArea.d.ts +4 -4
  106. package/dist/components/TextArea.js +1 -1
  107. package/dist/components/TextField.d.ts +1 -1
  108. package/dist/components/TextField.js +1 -1
  109. package/dist/components/Toast.d.ts +325 -0
  110. package/dist/components/Toast.js +1 -0
  111. package/dist/components/Toggle.d.ts +1 -1
  112. package/dist/components/Toggle.js +1 -1
  113. package/dist/components/ToggleGroup.d.ts +1 -1
  114. package/dist/components/ToggleGroup.js +1 -1
  115. package/dist/components/Toolbar.d.ts +1 -1
  116. package/dist/components/Toolbar.js +1 -1
  117. package/dist/components/Tooltip.d.ts +12 -1
  118. package/dist/components/Tooltip.js +1 -1
  119. package/dist/components/Tree.d.ts +2 -1
  120. package/dist/components/Tree.js +1 -1
  121. package/dist/components/VisuallyHidden.js +1 -1
  122. package/dist/components/{check-DujVUWP-.js → check-ctUdF4Q3.js} +4 -4
  123. package/dist/components/documentOverlayOpen-coyGmcyL.js +1 -0
  124. package/dist/components/{floating-ui.react-Byzse64h.js → floating-ui.react-2kiGB4sW.js} +1 -1
  125. package/dist/components/index-C7dBo_Ry.js +1 -0
  126. package/dist/components/index-CBcSLg6O.js +1 -0
  127. package/dist/components/index-CbNq68zs.js +1 -0
  128. package/dist/components/index-D8I-rMwz.js +1 -0
  129. package/dist/components/index-DMX7gpdp.js +1 -0
  130. package/dist/components/index-FITGoHty.js +1 -0
  131. package/dist/components/index-XF8itt-H.js +1 -0
  132. package/dist/components/index-nYRBURkR.js +1 -0
  133. package/dist/components/index-xlB--dex.js +1 -0
  134. package/dist/components/keyboard-BKF7hXqL.js +1 -0
  135. package/dist/components/mergeProps-0RucjqeH.js +1 -0
  136. package/dist/components/useComponentClass-C0isGl1z.js +1 -0
  137. package/dist/themes/baremetal.css +1 -0
  138. package/dist/themes/default.css +1 -0
  139. package/dist/themes/tailwind-presets/default.css +396 -0
  140. package/package.json +65 -23
  141. package/dist/components/AvatarPrimitiveFallback-BOYawMc9.js +0 -1
  142. package/dist/components/CheckboxGroupPrimitive-Cd8ra39e.js +0 -1
  143. package/dist/components/ComboboxPrimitive-BhHSrtiY.js +0 -1
  144. package/dist/components/MenuPrimitive-wJbEC-gM.js +0 -1
  145. package/dist/components/RadioGroupPrimitive-CcvI-_wm.js +0 -1
  146. package/dist/components/clsx-BaVHROc5.js +0 -1
  147. package/dist/components/index-BbEsAodL.js +0 -1
  148. package/dist/components/index-DOVR6Rd5.js +0 -1
  149. package/dist/components/index-DU_6Msfu.js +0 -1
  150. package/dist/components/index-Db-tduwt.js +0 -1
  151. package/dist/components/index-Ir5FYyWW.js +0 -1
  152. package/dist/components/index-gM8bbyw1.js +0 -1
  153. package/dist/components/index-m6qHOeQ9.js +0 -1
  154. package/dist/components/mergeProps-B9ocQsG4.js +0 -1
  155. package/dist/components/useComponentClass-QwNivz0h.js +0 -1
  156. package/dist/themes/tailwind-presets/default.js +0 -1
@@ -1 +1 @@
1
- 'use client';import{jsx as e,jsxs as t}from"react/jsx-runtime";import s from"react";import{c as a}from"./clsx-BaVHROc5.js";import{u as l}from"./useComponentClass-QwNivz0h.js";import{c as n}from"./mergeProps-B9ocQsG4.js";import"./ThemeContext-Sm-iNANd.js";const r=s.createContext({rootClass:"",inputRef:{current:null},clearInput:()=>{},hasValue:!1,setHasValue:()=>!1}),o="TextField",u=s.forwardRef((({className:t="",customRootClass:n="",children:u,...c},i)=>{const d=l(n,o),p=s.useRef(null),[f,m]=s.useState(!1),h=s.useCallback((()=>{const e=p.current;if(!e)return;const t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;t?.call(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})),m(!1),e.focus()}),[]);return e(r.Provider,{value:{rootClass:d,inputRef:p,clearInput:h,hasValue:f,setHasValue:m},children:e("div",{ref:i,className:a(d,t),...c,children:u})})}));u.displayName=o;const c=s.forwardRef((({className:t="",type:l="text",onChange:o,onInput:u,value:c,defaultValue:i,...d},p)=>{const{rootClass:f,inputRef:m,setHasValue:h}=s.useContext(r);s.useEffect((()=>{void 0===c?void 0!==i&&h(String(i).length>0):h(String(c).length>0)}),[i,h,c]);return e("input",{ref:n(p,m),type:l,className:a(f&&`${f}-input`,t),value:c,defaultValue:i,onInput:e=>{h(e.currentTarget.value.length>0),u?.(e)},onChange:e=>{h(e.currentTarget.value.length>0),o?.(e)},...d})}));c.displayName="TextFieldInput";const i=s.forwardRef((({children:t,className:l="",side:n,...o},u)=>{const{rootClass:c,inputRef:i}=s.useContext(r);return e("div",{ref:u,role:"presentation",className:a(c&&`${c}-slot`,l),"data-text-field-slot":n,...o,onMouseDown:e=>{o.onMouseDown?.(e),e.defaultPrevented||(e.preventDefault(),i.current?.focus())},children:t})}));i.displayName="TextFieldSlot";const d=s.forwardRef((({className:t="",type:l="button",onClick:n,children:o,...u},c)=>{const{rootClass:i,clearInput:d,inputRef:p,hasValue:f}=s.useContext(r);return f?e("button",{ref:c,type:l,className:a(i&&`${i}-reset`,t),onClick:e=>{n?.(e),e.defaultPrevented||p.current?.disabled||p.current?.readOnly||d()},...u,children:o}):null}));d.displayName="TextFieldReset";const p=s.forwardRef((({className:s="",customRootClass:l="",inputClassName:n="",startSlot:r,endSlot:o,type:d="text",...p},f)=>t(u,{customRootClass:l,className:a(s),children:[r?e(i,{side:"start",children:r}):null,e(c,{ref:f,type:d,className:a(n),...p}),o?e(i,{side:"end",children:o}):null]})));p.displayName="TextField",p.Root=u,p.Input=c,p.Slot=i,p.Reset=d;export{p as default};
1
+ 'use client';import{jsx as e,jsxs as t}from"react/jsx-runtime";import s from"react";import{u as a,c as l}from"./useComponentClass-C0isGl1z.js";import{c as o}from"./mergeProps-0RucjqeH.js";import"./ThemeContext-Sm-iNANd.js";const n=s.createContext({rootClass:"",inputRef:{current:null},clearInput:()=>{},hasValue:!1,setHasValue:()=>!1,isLocked:!1,setIsLocked:()=>!1}),r="TextField",u=s.forwardRef((({className:t="",customRootClass:o="",children:u,...c},d)=>{const i=a(o,r),p=s.useRef(null),[f,m]=s.useState(!1),[h,C]=s.useState(!1),x=s.useCallback((()=>{const e=p.current;if(!e)return;const t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;t?.call(e,""),e.dispatchEvent(new Event("input",{bubbles:!0})),m(!1),e.focus()}),[]);return e(n.Provider,{value:{rootClass:i,inputRef:p,clearInput:x,hasValue:f,setHasValue:m,isLocked:h,setIsLocked:C},children:e("div",{ref:d,className:l(i,t),"data-slot":"text-field-root",...c,children:u})})}));u.displayName=r;const c=s.forwardRef((({className:t="",type:a="text",onChange:r,onInput:u,value:c,defaultValue:d,...i},p)=>{const{rootClass:f,inputRef:m,setHasValue:h,setIsLocked:C}=s.useContext(n),x=Boolean(i.disabled||i.readOnly);s.useEffect((()=>{C(x)}),[x,C]),s.useEffect((()=>{void 0===c?void 0!==d&&h(String(d).length>0):h(String(c).length>0)}),[d,h,c]);return e("input",{ref:o(p,m),type:a,className:l(f&&`${f}-input`,t),"data-slot":"text-field-input",value:c,defaultValue:d,onInput:e=>{h(e.currentTarget.value.length>0),u?.(e)},onChange:e=>{h(e.currentTarget.value.length>0),r?.(e)},...i})}));c.displayName="TextFieldInput";const d=s.forwardRef((({children:t,className:a="",side:o,...r},u)=>{const{rootClass:c,inputRef:d}=s.useContext(n);return e("div",{ref:u,role:"presentation",className:l(c&&`${c}-slot`,a),"data-slot":"text-field-slot","data-text-field-slot":o,...r,onMouseDown:e=>{r.onMouseDown?.(e),e.defaultPrevented||(e.preventDefault(),d.current?.focus())},children:t})}));d.displayName="TextFieldSlot";const i=s.forwardRef((({className:t="",type:a="button",onClick:o,children:r,...u},c)=>{const{rootClass:d,clearInput:i,inputRef:p,hasValue:f,isLocked:m}=s.useContext(n);return!f||m?null:e("button",{ref:c,type:a,className:l(d&&`${d}-reset`,t),"data-slot":"text-field-reset",onClick:e=>{o?.(e),e.defaultPrevented||p.current?.disabled||p.current?.readOnly||i()},...u,children:r})}));i.displayName="TextFieldReset";const p=s.forwardRef((({className:s="",customRootClass:a="",inputClassName:o="",startSlot:n,endSlot:r,type:i="text",...p},f)=>t(u,{customRootClass:a,className:l(s),children:[n?e(d,{side:"start",children:n}):null,e(c,{ref:f,type:i,className:l(o),...p}),r?e(d,{side:"end",children:r}):null]})));p.displayName="TextField",p.Root=u,p.Input=c,p.Slot=d,p.Reset=i;export{c as Input,i as Reset,u as Root,d as Slot,p as default};
@@ -0,0 +1,325 @@
1
+ import React$1 from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+
4
+ /**
5
+ * Viewport corner — headless string for `data-position` (theme defines valid values).
6
+ * Common: `bottom-right`, `bottom-left`, `bottom-center`, `top-right`, `top-left`, `top-center`.
7
+ */
8
+ type ToastPosition = string;
9
+ interface ToastData {
10
+ id: string;
11
+ title?: React.ReactNode;
12
+ description?: React.ReactNode;
13
+ /** Headless semantic / styling hook — forwarded as `data-variant` when set. */
14
+ variant?: string;
15
+ /** Headless — forwarded as `data-type` when set (e.g. `loading`). */
16
+ type?: string;
17
+ /** Auto-dismiss delay (ms). Base UI name: prefer `timeout`; we normalize both. */
18
+ duration?: number;
19
+ timeout?: number;
20
+ persistent?: boolean;
21
+ /**
22
+ * Live-region urgency — headless string; we treat `high` as `aria-live="assertive"`, otherwise `polite`.
23
+ */
24
+ priority?: string;
25
+ onDismiss?: () => void;
26
+ /** Base UI name — called when the toast begins closing. */
27
+ onClose?: () => void;
28
+ /** Base UI — after removal from the list (post-exit). */
29
+ onRemove?: () => void;
30
+ /**
31
+ * Incremented when `add({ id })` upserts an existing toast (pulse / replay).
32
+ */
33
+ updateKey?: number;
34
+ /** Base UI — toast was dropped because the stack limit was exceeded. */
35
+ limited?: boolean;
36
+ /** Base UI — props spread onto the action button (`Toast.Action`). */
37
+ actionProps?: React.ButtonHTMLAttributes<HTMLButtonElement> & {
38
+ children?: React.ReactNode;
39
+ };
40
+ /** Base UI — custom payload for render logic. */
41
+ data?: unknown;
42
+ /** Headless custom render function (Sonner-like). Receives render props. */
43
+ render?: (props: {
44
+ id: string;
45
+ toast: ToastData;
46
+ onDismiss: () => void;
47
+ }) => React.ReactNode;
48
+ /** Optional icon node. */
49
+ icon?: React.ReactNode;
50
+ /** Optional className for the toast item/content (headless). */
51
+ className?: string;
52
+ /** Optional inline styles. */
53
+ style?: React.CSSProperties;
54
+ /** Unstyled mode hint (headless - styling left to consumer). */
55
+ unstyled?: boolean;
56
+ }
57
+ /** Options for `toast()` / `manager.add()` — optional stable `id` for upsert. */
58
+ type CreateToastInput = Omit<ToastData, 'id' | 'updateKey' | 'limited'> & {
59
+ id?: string;
60
+ };
61
+ /** Base UI `update()` / per-state `promise` payloads. */
62
+ type ToastManagerUpdateOptions<TData = unknown> = Omit<ToastData, 'id' | 'updateKey' | 'limited'> & {
63
+ data?: TData;
64
+ };
65
+ /** Imperative API — `ToastState` singleton or `createToastManager()`. */
66
+ interface IToastManager {
67
+ defaultTimeout: number;
68
+ subscribe: (fn: (toast: ToastData) => void) => () => void;
69
+ subscribeDismiss: (fn: (id: string) => void) => () => void;
70
+ subscribeUpdate: (fn: (id: string, partial: Partial<ToastData>) => void) => () => void;
71
+ create: (data: CreateToastInput) => string;
72
+ update: (id: string, partial: ToastManagerUpdateOptions) => void;
73
+ dismiss: (id: string) => void;
74
+ dismissAll: () => void;
75
+ close: (id?: string) => void;
76
+ }
77
+
78
+ /**
79
+ * Toast manager — Base UI–aligned imperative API (`add`, `close`, `update`, `promise`).
80
+ * Use `ToastState` singleton or `createToastManager()` per `<Toast.Provider toastManager={…}>`.
81
+ */
82
+
83
+ type Subscriber = (toast: ToastData) => void;
84
+ type DismissSubscriber = (id: string) => void;
85
+ type UpdateSubscriber = (id: string, partial: Partial<ToastData>) => void;
86
+ declare class ToastManager implements IToastManager {
87
+ defaultTimeout: number;
88
+ private subscribers;
89
+ private dismissSubscribers;
90
+ private updateSubscribers;
91
+ subscribe(fn: Subscriber): () => void;
92
+ subscribeDismiss(fn: DismissSubscriber): () => void;
93
+ subscribeUpdate(fn: UpdateSubscriber): () => void;
94
+ /** `id` optional — omit for auto id; reuse `id` to upsert (provider bumps `updateKey`). */
95
+ create(data: CreateToastInput): string;
96
+ update(id: string, partial: ToastManagerUpdateOptions): void;
97
+ dismiss(id: string): void;
98
+ dismissAll(): void;
99
+ /** Base UI — `close(id?)` dismisses one or all. */
100
+ close(id?: string): void;
101
+ }
102
+ declare const ToastState: ToastManager;
103
+ declare function createToastManager(options?: {
104
+ timeout?: number;
105
+ }): ToastManager;
106
+ type ToastOptions$1 = Omit<ToastData, 'id' | 'variant' | 'updateKey' | 'limited'>;
107
+ /** Per-state options for `promise()` (string shortcut or full toast fields). */
108
+ type ToastPromiseState = string | Omit<CreateToastInput, 'id' | 'updateKey'>;
109
+ type ToastPromiseMessages<T> = {
110
+ loading: ToastPromiseState;
111
+ success: ToastPromiseState | ((data: T) => ToastPromiseState);
112
+ error: ToastPromiseState | ((err: unknown) => ToastPromiseState);
113
+ /** Optional Sonner-style description fields */
114
+ description?: ToastPromiseState | ((data: T) => ToastPromiseState);
115
+ };
116
+ /**
117
+ * Track a promise with a persistent loading toast, then success or error.
118
+ * Pass `manager` to target a non-default provider instance.
119
+ */
120
+ declare function promiseToast<T>(promiseLike: Promise<T>, messages: ToastPromiseMessages<T>, options?: ToastOptions$1, manager?: IToastManager): Promise<T>;
121
+ declare function createToast(options: CreateToastInput): string;
122
+ declare function createToast(title: string, options?: CreateToastInput): string;
123
+ declare const toast: typeof createToast & {
124
+ success: (titleOrOptions: string | CreateToastInput, options?: CreateToastInput) => string;
125
+ error: (titleOrOptions: string | CreateToastInput, options?: CreateToastInput) => string;
126
+ warning: (titleOrOptions: string | CreateToastInput, options?: CreateToastInput) => string;
127
+ info: (titleOrOptions: string | CreateToastInput, options?: CreateToastInput) => string;
128
+ loading: (titleOrOptions: string | CreateToastInput, options?: CreateToastInput) => string;
129
+ dismiss: (id?: string) => void;
130
+ dismissAll: () => void;
131
+ close: (id?: string) => void;
132
+ promise: typeof promiseToast;
133
+ message: typeof createToast;
134
+ custom: (renderFn: (id: string) => React.ReactNode, options?: Omit<CreateToastInput, "render">) => string;
135
+ };
136
+
137
+ type ToastProviderProps = {
138
+ children: React$1.ReactNode;
139
+ customRootClass?: string;
140
+ position?: ToastPosition;
141
+ expand?: boolean;
142
+ gap?: number;
143
+ /** @deprecated Prefer Base UI name `limit`. */
144
+ maxToasts?: number;
145
+ /** Base UI — max visible stack size (default `3`). */
146
+ limit?: number;
147
+ /** Base UI — default auto-dismiss ms (default `5000`). */
148
+ timeout?: number;
149
+ /** Sonner alias */
150
+ duration?: number;
151
+ /** Base UI — isolate queue / use outside React tree (pair with `createToastManager()`). */
152
+ toastManager?: ToastManager;
153
+ /** Optional className passthrough for viewport region if needed (headless) */
154
+ className?: string;
155
+ /** Optional inline styles for the default viewport. */
156
+ style?: React$1.CSSProperties;
157
+ /** Sonner-like props (headless passthroughs where applicable) */
158
+ richColors?: boolean;
159
+ closeButton?: boolean;
160
+ offset?: number | string;
161
+ mobileOffset?: number | string | {
162
+ top?: number | string;
163
+ bottom?: number | string;
164
+ left?: number | string;
165
+ right?: number | string;
166
+ };
167
+ theme?: 'light' | 'dark' | 'system';
168
+ dir?: 'ltr' | 'rtl' | 'auto';
169
+ swipeDirections?: string[];
170
+ visibleToasts?: number;
171
+ toastOptions?: Record<string, any>;
172
+ /** Sonner prop aliases/completeness */
173
+ invert?: boolean;
174
+ pauseWhenPageIsHidden?: boolean;
175
+ icons?: Record<string, React$1.ReactNode>;
176
+ loadingIcon?: React$1.ReactNode;
177
+ rtl?: boolean;
178
+ hotkey?: string[];
179
+ containerAriaLabel?: string;
180
+ dragThreshold?: number;
181
+ };
182
+ declare const ToastProvider: React$1.FC<ToastProviderProps>;
183
+
184
+ type ToastPortalProps = {
185
+ children: React$1.ReactNode;
186
+ /** Override the portal container. Defaults to the Theme portal root, then document.body. */
187
+ container?: HTMLElement | null;
188
+ };
189
+ declare const ToastPortal: React$1.FC<ToastPortalProps>;
190
+
191
+ type ToastViewportProps = {
192
+ children: React$1.ReactNode;
193
+ className?: string;
194
+ style?: React$1.CSSProperties;
195
+ };
196
+ declare const ToastViewport: React$1.FC<ToastViewportProps>;
197
+
198
+ type ToastRootProps = {
199
+ toast: ToastData;
200
+ className?: string;
201
+ children: React$1.ReactNode;
202
+ };
203
+ declare const ToastRoot: React$1.FC<ToastRootProps>;
204
+
205
+ type ToastContentProps = React$1.HTMLAttributes<HTMLDivElement>;
206
+ declare const ToastContent: React$1.ForwardRefExoticComponent<ToastContentProps & React$1.RefAttributes<HTMLDivElement>>;
207
+
208
+ type ToastTitleProps = React$1.HTMLAttributes<HTMLElement>;
209
+ /**
210
+ * Rendered as a plain element, not a heading: toasts are transient live-region
211
+ * announcements, and headings inside them pollute the page outline.
212
+ */
213
+ declare const ToastTitle: React$1.ForwardRefExoticComponent<ToastTitleProps & React$1.RefAttributes<HTMLElement>>;
214
+
215
+ type ToastDescriptionProps = React$1.HTMLAttributes<HTMLParagraphElement>;
216
+ declare const ToastDescription: React$1.ForwardRefExoticComponent<ToastDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>>;
217
+
218
+ type ToastCloseProps = React$1.ButtonHTMLAttributes<HTMLButtonElement>;
219
+ declare const ToastClose: React$1.ForwardRefExoticComponent<ToastCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
220
+
221
+ type ToastActionProps = React$1.ButtonHTMLAttributes<HTMLButtonElement>;
222
+ /**
223
+ * Base UI–style action button — merges `toast.actionProps` then your props.
224
+ */
225
+ declare const ToastAction: React$1.ForwardRefExoticComponent<ToastActionProps & React$1.RefAttributes<HTMLButtonElement>>;
226
+
227
+ type ToastOptions = Omit<ToastData, 'id' | 'variant' | 'updateKey' | 'limited'>;
228
+ /** Mirrors [Base UI `useToastManager`](https://base-ui.com/react/components/toast#useToastManager). */
229
+ interface ToastManagerReturn {
230
+ toasts: ToastData[];
231
+ add: (data: CreateToastInput) => string;
232
+ /** Base UI */
233
+ close: (toastId?: string) => void;
234
+ /** Base UI */
235
+ update: <TData = unknown>(toastId: string, options: ToastManagerUpdateOptions<TData>) => void;
236
+ promise: <T>(p: Promise<T>, messages: ToastPromiseMessages<T>, options?: ToastOptions) => Promise<T>;
237
+ /** @deprecated Use `close(id)`. */
238
+ dismiss: (id?: string) => void;
239
+ /** @deprecated Use `close()` with no args. */
240
+ dismissAll: () => void;
241
+ /** Sonner-like helpers */
242
+ success?: (data: CreateToastInput | string, options?: CreateToastInput) => string;
243
+ error?: (data: CreateToastInput | string, options?: CreateToastInput) => string;
244
+ warning?: (data: CreateToastInput | string, options?: CreateToastInput) => string;
245
+ info?: (data: CreateToastInput | string, options?: CreateToastInput) => string;
246
+ loading?: (data: CreateToastInput | string, options?: CreateToastInput) => string;
247
+ }
248
+ /**
249
+ * Must be called inside a `<Toast.Provider>`.
250
+ * Returns the live toast list and the same imperative API as Base UI’s manager.
251
+ */
252
+ declare function useToastManager(): ToastManagerReturn;
253
+
254
+ type ToasterProps = Omit<ToastProviderProps, 'children'> & {
255
+ children?: React$1.ReactNode;
256
+ className?: string;
257
+ style?: React$1.CSSProperties;
258
+ containerClassName?: string;
259
+ containerStyle?: React$1.CSSProperties;
260
+ };
261
+ /**
262
+ * Sonner-compatible Toaster wrapper.
263
+ * Renders a default viewport and portal. Can be used as a drop-in replacement.
264
+ */
265
+ declare function Toaster({ children, className, style, containerClassName, containerStyle, ...providerProps }: ToasterProps): react_jsx_runtime.JSX.Element;
266
+ declare namespace Toaster {
267
+ var displayName: string;
268
+ }
269
+
270
+ /**
271
+ * Toast — headless, composable notification system.
272
+ *
273
+ * ## Anatomy
274
+ * ```tsx
275
+ * <Toast.Provider> // wrap your app — owns state & stacking engine
276
+ * <Toast.Portal> // portals into the theme root
277
+ * <Toast.Viewport> // the <ol>, handles hover expand
278
+ * {toasts.map(t => (
279
+ * <Toast.Root key={t.id} toast={t}> // <li>, owns timer & swipe
280
+ * <Toast.Content> // card wrapper, clips height
281
+ * <Toast.Title>{t.title}</Toast.Title>
282
+ * <Toast.Description>{t.description}</Toast.Description>
283
+ * // optional — merges toast.actionProps
284
+ * <Toast.Action />
285
+ * <Toast.Close />
286
+ * </Toast.Content>
287
+ * </Toast.Root>
288
+ * ))}
289
+ * </Toast.Viewport>
290
+ * </Toast.Portal>
291
+ * </Toast.Provider>
292
+ * ```
293
+ *
294
+ * ## Adding toasts (Base UI–aligned)
295
+ * ```tsx
296
+ * const manager = Toast.useToastManager();
297
+ * manager.add({ title: 'Saved!', variant: 'success', timeout: 4000 });
298
+ * manager.close(id); // one toast
299
+ * manager.close(); // all
300
+ * manager.update(id, { title: 'Updated' });
301
+ * manager.promise(fetch('/api'), { loading: '…', success: (d) => 'Done', error: (e) => 'Failed' });
302
+ * manager.add({ id: 'save-status', title: 'Draft saved' }); // same id → upsert + `updateKey` / pulse
303
+ * ```
304
+ *
305
+ * Optional isolated queue: `const tm = createToastManager({ timeout: 5000 });` then
306
+ * `<Toast.Provider toastManager={tm} limit={3}>`.
307
+ */
308
+
309
+ interface ToastNamespace {
310
+ Provider: typeof ToastProvider;
311
+ Portal: typeof ToastPortal;
312
+ Viewport: typeof ToastViewport;
313
+ Root: typeof ToastRoot;
314
+ Content: typeof ToastContent;
315
+ Title: typeof ToastTitle;
316
+ Description: typeof ToastDescription;
317
+ Action: typeof ToastAction;
318
+ Close: typeof ToastClose;
319
+ useToastManager: typeof useToastManager;
320
+ Toaster: typeof Toaster;
321
+ }
322
+ declare const Toast: ToastNamespace;
323
+
324
+ export { ToastAction as Action, ToastClose as Close, ToastContent as Content, ToastDescription as Description, ToastPortal as Portal, ToastProvider as Provider, ToastRoot as Root, ToastTitle as Title, ToastManager, ToastState, Toaster, ToastViewport as Viewport, createToastManager, Toast as default, promiseToast, toast, useToastManager };
325
+ export type { CreateToastInput, IToastManager, ToastActionProps, ToastCloseProps, ToastContentProps, ToastData, ToastDescriptionProps, ToastManagerReturn, ToastManagerUpdateOptions, ToastPortalProps, ToastPosition, ToastPromiseMessages, ToastPromiseState, ToastProviderProps, ToastRootProps, ToastTitleProps, ToastViewportProps };
@@ -0,0 +1 @@
1
+ 'use client';import{jsx as e,Fragment as t,jsxs as s}from"react/jsx-runtime";import i,{createContext as o,useMemo as r,useEffect as n,useState as a,useCallback as d,useContext as c,useRef as l}from"react";import{u,c as m}from"./useComponentClass-C0isGl1z.js";import{createPortal as p}from"react-dom";import{T as f}from"./ThemeContext-Sm-iNANd.js";const h=o({rootClass:"",position:"bottom-right",expand:!1,gap:14,maxToasts:3,defaultToastTimeout:4e3,toastManager:void 0,isHovered:!1,setIsHovered:()=>{},heights:new Map,updateHeight:()=>{},unlinkStackHeight:()=>{},removeToast:()=>{},toasts:[],visibleToasts:[],viewportClassName:void 0,viewportStyle:void 0,containerAriaLabel:"Notifications",offset:void 0,mobileOffset:void 0,theme:void 0,dir:void 0,richColors:!1,invert:!1,pauseWhenPageIsHidden:!0,closeButton:!1,icons:void 0,loadingIcon:void 0,swipeDirections:void 0,dragThreshold:void 0}),v=o(null);let b=0;class g{constructor(){this.defaultTimeout=4e3,this.subscribers=new Set,this.dismissSubscribers=new Set,this.updateSubscribers=new Set}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}subscribeDismiss(e){return this.dismissSubscribers.add(e),()=>this.dismissSubscribers.delete(e)}subscribeUpdate(e){return this.updateSubscribers.add(e),()=>this.updateSubscribers.delete(e)}create(e){const{id:t,timeout:s,duration:i,...o}=e,r=t??`toast-${++b}-${Math.random().toString(36).slice(2,7)}`,n={...o,id:r,duration:i??s??this.defaultTimeout};return this.subscribers.forEach((e=>e(n))),r}update(e,t){const s=function(e){const{timeout:t,...s}=e;return void 0!==t?{...s,duration:t,timeout:t}:s}(t);this.updateSubscribers.forEach((t=>t(e,s)))}dismiss(e){this.dismissSubscribers.forEach((t=>t(e)))}dismissAll(){this.dismissSubscribers.forEach((e=>e("__all__")))}close(e){void 0===e?this.dismissAll():this.dismiss(e)}}const y=new g;function w(e){const t=new g;return void 0!==e?.timeout&&(t.defaultTimeout=e.timeout),t}function T(e){return"string"==typeof e?{title:e}:e}function x(e,t,s,i=y){const o=T(t.loading),r=i.create({persistent:!0,variant:"default",...s,...o});return e.then((e=>{i.dismiss(r);const o=function(e,t){return T("function"==typeof e?e(t):e)}(t.success,e);i.create({variant:"success",...s,...o})})).catch((e=>{i.dismiss(r);const o=function(e,t){return T("function"==typeof e?e(t):e)}(t.error,e);i.create({variant:"error",...s,...o})})),e}function C(e,t){return"string"==typeof e?y.create({title:e,...t}):y.create(e)}function N(e){return(t,s)=>"string"==typeof t?y.create({title:t,variant:e,...s}):y.create({variant:e,...t})}const A=Object.assign(C,{success:N("success"),error:N("error"),warning:N("warning"),info:N("info"),loading:N("loading"),dismiss:e=>void 0===e?y.dismissAll():y.dismiss(e),dismissAll:()=>y.dismissAll(),close:e=>y.close(e),promise:x,message:C,custom:(e,t)=>y.create({...t,render:({id:t})=>e(t)})}),M=({children:t,customRootClass:s="",position:i="bottom-right",expand:o=!1,gap:c=14,maxToasts:l,limit:m,timeout:p,duration:f,toastManager:v,className:b,style:g,richColors:w,closeButton:T,offset:x,mobileOffset:C,theme:N,dir:A,swipeDirections:M,visibleToasts:P,toastOptions:S,invert:D,pauseWhenPageIsHidden:H=!0,icons:$,loadingIcon:I,rtl:R,hotkey:k,containerAriaLabel:_,dragThreshold:j})=>{const E=m??l??P??3,K=r((()=>v??y),[v]),B=p??f??4e3;n((()=>{K.defaultTimeout=B}),[K,B]);const L=u(s,"Toast"),[O,F]=a([]),[W,U]=a(!1),[V,q]=a(new Map);n((()=>{const e=K.subscribe((e=>{F((t=>{const s={...S,...e},i=t.findIndex((t=>t.id===e.id));if(-1!==i){const e=t[i],o=[...t];return o[i]={...s,updateKey:(e.updateKey??0)+1},o}return[{...s,updateKey:0},...t].slice(0,2*E)}))})),t=K.subscribeDismiss((e=>{"__all__"===e&&F([])})),s=K.subscribeUpdate(((e,t)=>{F((s=>s.map((s=>s.id===e?{...s,...t}:s))))}));return()=>{e(),t(),s()}}),[K,E,S]);const z=d((e=>{F((t=>{const s=t.find((t=>t.id===e));return s?.onRemove?.(),t.filter((t=>t.id!==e))})),q((t=>{const s=new Map(t);return s.delete(e),s}))}),[]),Y=d(((e,t)=>{q((s=>{if(s.get(e)===t)return s;const i=new Map(s);return i.set(e,t),i}))}),[]),G=d((e=>{q((t=>{if(!t.has(e))return t;const s=new Map(t);return s.delete(e),s}))}),[]),J=O.slice(0,E);return e(h.Provider,{value:{rootClass:L,position:i,expand:o,gap:c,maxToasts:E,defaultToastTimeout:B,toastManager:K,isHovered:W,setIsHovered:U,heights:V,updateHeight:Y,unlinkStackHeight:G,removeToast:z,toasts:O,visibleToasts:J,viewportClassName:b,viewportStyle:g,containerAriaLabel:_??"Notifications",offset:x,mobileOffset:C,theme:N,dir:R?"rtl":A,richColors:w??!1,invert:D??!1,pauseWhenPageIsHidden:H,closeButton:T??!1,icons:$,loadingIcon:I,swipeDirections:M,dragThreshold:j},children:t})};M.displayName="ToastProvider";const P=({children:e,container:t})=>{const s=c(f),[i,o]=a(!1);if(n((()=>{o(!0)}),[]),!i)return null;const r=t??s?.portalRootRef.current??document.body;return p(e,r)};function S(e){if(void 0!==e)return"number"==typeof e?`${e}px`:e}P.displayName="ToastPortal";const D=({children:t,className:s,style:i})=>{const{rootClass:o,position:r,expand:n,isHovered:a,setIsHovered:d,heights:u,gap:p,visibleToasts:f,viewportClassName:v,viewportStyle:b,containerAriaLabel:g,offset:y,mobileOffset:w,theme:T,dir:x,richColors:C,invert:N}=c(h),A=l(null),M=n||a,P=u.get(f[0]?.id)??0,D=f[1]?u.get(f[1].id)??0:0,H=P>0?P:D,$=M?f.reduce(((e,t)=>e+(u.get(t.id)??0)),0)+Math.max(0,f.length-1)*p:H+p*Math.max(0,f.length-1);return e("section",{ref:A,role:"region","aria-label":g,tabIndex:-1,"data-position":r,"data-expanded":M?"":void 0,"data-theme":T,"data-rich-colors":C?"":void 0,"data-invert":N?"":void 0,dir:x,className:m(o&&`${o}-viewport`,v,s),style:{...b,"--viewport-height":`${$}px`,"--toast-frontmost-height":`${H}px`,"--toast-offset":S(y),"--toast-mobile-offset":S("object"==typeof w?void 0:w),"--toast-mobile-offset-top":S("object"==typeof w?w.top:void 0),"--toast-mobile-offset-bottom":S("object"==typeof w?w.bottom:void 0),"--toast-mobile-offset-left":S("object"==typeof w?w.left:void 0),"--toast-mobile-offset-right":S("object"==typeof w?w.right:void 0),...i},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onFocusCapture:()=>d(!0),onBlurCapture:e=>{A.current?.contains(e.relatedTarget)||d(!1)},children:t})};D.displayName="ToastViewport";const H=({toast:t,className:s,children:i})=>{const{rootClass:o,position:r,expand:u,isHovered:p,heights:f,gap:b,toasts:g,visibleToasts:y,updateHeight:w,unlinkStackHeight:T,removeToast:x,defaultToastTimeout:C,toastManager:N,pauseWhenPageIsHidden:A,swipeDirections:M,dragThreshold:P}=c(h),S=l(null),D=l(null),H=t.duration??t.timeout??C,$=l(H),I=l(null),[R,k]=a(!1),[_,j]=a(!0),[E,K]=a(!1),[B,L]=a(!1),O=l(-1),F=l(-1),W=l(!1),U=l({y:0,time:0}),V=l(0),q=r.startsWith("top"),z=u||p,Y=y.findIndex((e=>e.id===t.id)),G=0===Y,J=!G&&!z,Q=g.length>0&&t.id===g[g.length-1]?.id,X=f.get(t.id)??0,Z=f.get(y[0]?.id)??0,ee=y[1]?f.get(y[1].id)??0:0,te=Z>0?Z:ee>0?ee:X;let se=0;for(let e=0;e<Y;e++)se+=(f.get(y[e]?.id)??0)+b;n((()=>{if(E)return;if(!S.current)return;const e=S.current,s=()=>{const s=e.offsetHeight;s>0&&w(t.id,s)};s();const i=new ResizeObserver(s);return i.observe(e),()=>i.disconnect()}),[t.id,w,E]),n((()=>{const e=requestAnimationFrame((()=>{k(!0);const e=setTimeout((()=>j(!1)),420);return()=>clearTimeout(e)}));return()=>cancelAnimationFrame(e)}),[]),n((()=>{const e=O.current,t=F.current,s=y.length,i=-1!==e&&Y>e&&-1!==Y&&!E,o=t>s&&-1!==Y&&!E&&Y===e,r=t>s&&-1!==Y&&!E&&-1!==e&&e>Y;if(O.current=Y,F.current=s,i||o||r){L(!0);const e=requestAnimationFrame((()=>L(!1)));return()=>cancelAnimationFrame(e)}}),[Y,E,y.length]);const[ie,oe]=a((()=>"undefined"!=typeof document&&document.hidden));n((()=>{const e=()=>oe(document.hidden);return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)}),[]);const re=d((()=>{if(!E){if(-1===Y)return t.onClose?.(),t.onDismiss?.(),T(t.id),void x(t.id);T(t.id),K(!0),t.onClose?.(),t.onDismiss?.()}}),[Y,E,t,T,x]),ne=l(re);n((()=>{ne.current=re}),[re]),n((()=>{if(!N)return;return N.subscribeDismiss((e=>{"__all__"!==e&&e===t.id&&ne.current()}))}),[t.id,N]);const ae=d((()=>{D.current&&(clearTimeout(D.current),D.current=null),null!==I.current&&($.current-=Date.now()-I.current,I.current=null)}),[]),de=d((()=>{t.persistent||$.current<=0||(I.current=Date.now(),D.current=setTimeout((()=>ne.current()),$.current))}),[t.persistent]);n((()=>{$.current=t.duration??t.timeout??C,ae()}),[t.updateKey,t.duration,t.timeout,C,ae]),n((()=>((!A||!ie)&&(Q||z)&&!E?de():ae(),ae)),[z,ie,Q,E,A,de,ae,t.updateKey]),n((()=>{if(!E)return;const e=window.setTimeout((()=>x(t.id)),200);return()=>clearTimeout(e)}),[E,x,t.id]);const ce=d((e=>{W.current=!0,U.current={y:e.clientY,time:Date.now()},S.current?.setPointerCapture(e.pointerId),ae()}),[ae]),le=d((e=>{if(!W.current||!S.current)return;const t=e.clientY-U.current.y,s=t*(q?-1:1)<0?.2*t:t;V.current=s,S.current.style.setProperty("--swipe-y",`${s}px`),S.current.setAttribute("data-swiping","")}),[q]),ue=d((e=>{if(!W.current||!S.current)return;W.current=!1,S.current.removeAttribute("data-swiping");const t=V.current,s=Date.now()-U.current.time,i=Math.abs(t)/s,o=q?-1:1,r=q?"up":"down",n=!M?.length||M.includes(r),a=P??40;n&&t*o>0&&(Math.abs(t)>=a||i>.11)?re():(V.current=0,S.current.style.setProperty("--swipe-y","0px"),de())}),[P,q,re,de,M]);if(-1===Y&&!E)return null;const me=t.updateKey&&t.updateKey>0?t.updateKey%2==0?"even":"odd":void 0,pe=z?1:Math.max(.82,1-.05*Y);let fe;if(E)fe=0;else if(z)fe=q?se:-se;else{fe=(q?1:-1)*(14*Y+(1-pe)*(te>0?te:X))}const he={"--swipe-y":"0px","--toast-swipe-movement-x":"0px","--toast-swipe-movement-y":"var(--swipe-y, 0px)","--toast-height":`${X}px`,"--scale":pe,"--y":`${fe}px`,"--toast-lift":q?1:-1,"--front-height":`${Z>0?Z:ee>0?ee:X}px`,"--toast-index":Y,"--toast-offset-y":`${q?se:-se}px`,zIndex:10-Y};return e(v.Provider,{value:{toast:t,index:Y,isExpanded:z,isFront:G,isBehind:J,dismiss:re},children:e("div",{ref:S,role:"status","aria-live":"high"===t.priority?"assertive":"polite","aria-atomic":"true","data-variant":t.variant??void 0,"data-type":t.type??void 0,"data-limited":t.limited?"":void 0,"data-mounted":R?"":void 0,"data-entering":_&&G?"":void 0,"data-restack-skip":B?"":void 0,"data-leaving":E?"":void 0,"data-expanded":z?"":void 0,"data-front":G?"":void 0,"data-behind":J?"":void 0,"data-pulse":me,"data-update-key":t.updateKey??0,"data-toast-id":t.id,className:m(o&&`${o}-item`,t.className,s),style:{...he,...t.style},onPointerDown:ce,onPointerMove:le,onPointerUp:ue,children:t.render?t.render({id:t.id,toast:t,onDismiss:re}):i})})};H.displayName="ToastRoot";const $=i.forwardRef((({className:t,children:s,...i},o)=>{const{rootClass:r}=c(h),n=c(v);return e("div",{ref:o,className:m(r&&`${r}-content`,t),"data-behind":n?.isBehind?"":void 0,"data-expanded":n?.isExpanded?"":void 0,...i,children:s})}));$.displayName="ToastContent";const I=i.forwardRef((({className:t,children:s,...i},o)=>{const{rootClass:r}=c(h);return e("div",{ref:o,className:m(r&&`${r}-title`,t),...i,children:s})}));I.displayName="ToastTitle";const R=i.forwardRef((({className:t,children:s,...i},o)=>{const{rootClass:r}=c(h);return e("p",{ref:o,className:m(r&&`${r}-description`,t),...i,children:s})}));R.displayName="ToastDescription";const k=i.forwardRef((({className:t,children:s,onClick:i,...o},r)=>{const{rootClass:n}=c(h),a=c(v);return e("button",{ref:r,type:"button","aria-label":"Close notification",className:m(n&&`${n}-close`,t),onClick:e=>{i?.(e),a?.dismiss()},...o,children:s??"×"})}));k.displayName="ToastClose";const _=i.forwardRef((({className:t,children:s,type:i="button",...o},r)=>{const{rootClass:n}=c(h),a=c(v),d=a?.toast.actionProps;return e("button",{ref:r,type:i,className:m(n&&`${n}-action`,t),...d,...o,children:s??d?.children})}));function j(){const e=c(h),t=e.toastManager??y,s=e=>(s,i)=>"string"==typeof s?t.create({title:s,variant:e,...i}):t.create({variant:e,...s});return{toasts:[...e.toasts].reverse(),add:(e,s)=>"string"==typeof e?t.create({title:e,...s}):t.create(e),close:e=>t.close(e),update:(e,s)=>t.update(e,s),promise:(e,s,i)=>x(e,s,i,t),dismiss:e=>void 0===e?t.dismissAll():t.dismiss(e),dismissAll:()=>t.dismissAll(),success:s("success"),error:s("error"),warning:s("warning"),info:s("info"),loading:s("loading")}}function E(){const{toasts:o}=j(),{closeButton:r,icons:n,loadingIcon:a}=i.useContext(h);return e(t,{children:o.map((t=>e(H,{toast:t,children:s($,{children:[t.icon??("loading"===t.type?a:void 0)??n?.[t.variant??t.type??""],e(I,{children:t.title}),t.description&&e(R,{children:t.description}),t.actionProps&&e(_,{}),r&&e(k,{})]})},t.id)))})}function K({children:t,className:s,style:i,containerClassName:o,containerStyle:r,...n}){return e(M,{...n,children:e(P,{children:e("div",{className:o,style:r,children:e(D,{className:s,style:i,children:t??e(E,{})})})})})}_.displayName="ToastAction",K.displayName="Toaster";const B={Provider:M,Portal:P,Viewport:D,Root:H,Content:$,Title:I,Description:R,Action:_,Close:k,useToastManager:j,Toaster:K};export{_ as Action,k as Close,$ as Content,R as Description,P as Portal,M as Provider,H as Root,I as Title,g as ToastManager,y as ToastState,K as Toaster,D as Viewport,w as createToastManager,B as default,x as promiseToast,A as toast,j as useToastManager};
@@ -11,7 +11,7 @@ interface ToggleProps extends Omit<React.ComponentPropsWithoutRef<typeof ToggleP
11
11
  /** Accent color for the toggle */
12
12
  color?: string;
13
13
  /** Callback fired when toggle state changes */
14
- onPressedChange: (isPressed: boolean) => void;
14
+ onPressedChange?: (isPressed: boolean) => void;
15
15
  }
16
16
  /**
17
17
  * Toggle component that can be used in either controlled or uncontrolled mode.
@@ -1 +1 @@
1
- 'use client';import{jsx as s}from"react/jsx-runtime";import{forwardRef as e}from"react";import{c as o}from"./clsx-BaVHROc5.js";import{u as r}from"./useComponentClass-QwNivz0h.js";import{u as a}from"./index-wRElCyvx.js";import{T as t}from"./index-DU_6Msfu.js";import"./ThemeContext-Sm-iNANd.js";import"./index-gM8bbyw1.js";import"./index-m6qHOeQ9.js";import"./mergeProps-B9ocQsG4.js";import"./index-CXzybYmm.js";const m="Toggle",d=e((({defaultPressed:e=!1,customRootClass:d="",children:i,className:n="",color:l="",pressed:p,onPressedChange:c,asChild:f=!1,...j},x)=>{const[u,C]=a(p,e,c),h=r(d,m),g={};return l&&(g["data-color"]=l),s(t,{ref:x,className:o(h,n),pressed:u,onPressedChange:C,"data-state":u?"on":"off","data-disabled":j.disabled?"":void 0,asChild:f,...j,...g,children:i})}));d.displayName=m;export{d as default};
1
+ 'use client';import{jsx as s}from"react/jsx-runtime";import{forwardRef as e}from"react";import{u as o,c as r}from"./useComponentClass-C0isGl1z.js";import{u as a}from"./index-wRElCyvx.js";import{T as t}from"./index-nYRBURkR.js";import"./ThemeContext-Sm-iNANd.js";import"./index-FITGoHty.js";import"./index-XF8itt-H.js";import"./mergeProps-0RucjqeH.js";import"./index-CXzybYmm.js";import"./keyboard-BKF7hXqL.js";const d="Toggle",i=e((({defaultPressed:e=!1,customRootClass:i="",children:m,className:n="",color:p="",pressed:l,onPressedChange:c,asChild:j=!1,...f},u)=>{const[x,C]=a(l,e,c),h=o(i,d),g={};return p&&(g["data-color"]=p),s(t,{ref:u,className:r(h,n),pressed:x,onPressedChange:C,"data-state":x?"on":"off","data-disabled":f.disabled?"":void 0,asChild:j,...f,...g,children:m})}));i.displayName=d;export{i as default};
@@ -92,5 +92,5 @@ type ToggleGroupComponent = React.ForwardRefExoticComponent<ToggleGroupProps & R
92
92
  };
93
93
  declare const ToggleGroup: ToggleGroupComponent;
94
94
 
95
- export { ToggleGroup as default };
95
+ export { ToggleItem as Item, ToggleGroupRoot as Root, ToggleGroup as default };
96
96
  export type { ToggleGroupRootProps, ToggleItemProps };
@@ -1 +1 @@
1
- 'use client';import e,{createContext as o,useContext as s}from"react";import{jsx as t}from"react/jsx-runtime";import{c as a}from"./clsx-BaVHROc5.js";import{u as i}from"./useComponentClass-QwNivz0h.js";import{u as r}from"./index-wRElCyvx.js";import{R as l}from"./index-DOVR6Rd5.js";import{T as d}from"./index-DU_6Msfu.js";import"./ThemeContext-Sm-iNANd.js";import"./index-m6qHOeQ9.js";import"./mergeProps-B9ocQsG4.js";import"./index-gM8bbyw1.js";import"./mergeRefs-B8eZ_q-T.js";import"./index-CXzybYmm.js";const n=o({type:"single",activeToggles:[],setActiveToggles:()=>{},rootClass:"",disabled:!1,orientation:"horizontal"}),c="ToggleGroup",m=e.forwardRef((({type:e="single",className:o="",loop:s=!0,orientation:d="horizontal",customRootClass:m="",value:p,defaultValue:g=[],onValueChange:u,color:f="",disabled:h=!1,dir:v="ltr",rovingFocus:T=!0,asChild:j=!1,children:C,...x},y)=>{const R=i(m,c),[b,N]=r(p,g,u),G={activeToggles:b,setActiveToggles:N,type:e,rootClass:R,disabled:h,orientation:d},w={};return f&&(w["data-color"]=f),h&&(w["data-disabled"]=""),w["data-orientation"]=d,t(n.Provider,T?{value:G,children:t(l.Root,{loop:s,orientation:d,dir:v,children:t(l.Group,{...w,...x,children:t("div",{ref:y,className:a(R,o),children:C})})})}:{value:G,children:t("div",{ref:y,className:a(R,o),...w,dir:v,...x,children:C})})}));m.displayName=c;const p=e.forwardRef((({children:e,className:o="",value:i=null,disabled:r=!1,asChild:c=!1,iconOnly:m=!1,...p},g)=>{const{type:u,activeToggles:f,setActiveToggles:h,rootClass:v,disabled:T}=s(n),j=f?.includes(i),C=r||T,x={},y={};return j?(x["aria-pressed"]="true",y["data-state"]="on"):(x["aria-pressed"]="false",y["data-state"]="off"),C&&(y["data-disabled"]=""),t(l.Item,{children:t(d,{ref:g,onClick:()=>{if(C)return;let e=f||[];if("single"===u)return j?void h([]):void h([i]);"multiple"===u&&(e=j?e.filter((e=>e!==i)):[...e,i]),h(e)},className:a(v&&`${v}-item`,o),disabled:C,asChild:c,...m?{"data-icon-only":""}:{},...x,...y,...p,children:e})})}));p.displayName="ToggleItem";const g=e.forwardRef(((e,o)=>(console.warn("Direct usage of ToggleGroup is not supported. Please use ToggleGroup.Root, ToggleGroup.Item, etc. instead."),null)));g.displayName="ToggleGroup",g.Root=m,g.Item=p;export{g as default};
1
+ 'use client';import e,{createContext as o,useContext as a}from"react";import{jsx as s}from"react/jsx-runtime";import{u as r,c as i}from"./useComponentClass-C0isGl1z.js";import{u as t}from"./index-wRElCyvx.js";import{R as l}from"./index-C7dBo_Ry.js";import{P as d}from"./index-XF8itt-H.js";import{T as n}from"./index-nYRBURkR.js";import{c}from"./index-CXzybYmm.js";import"./ThemeContext-Sm-iNANd.js";import"./index-FITGoHty.js";import"./keyboard-BKF7hXqL.js";import"./mergeRefs-B8eZ_q-T.js";import"./mergeProps-0RucjqeH.js";const m=o({type:"single",activeToggles:[],setActiveToggles:()=>{},rootClass:"",disabled:!1,orientation:"horizontal"}),p="ToggleGroup",u=e.forwardRef((({type:e="single",className:o="",loop:a=!0,orientation:n="horizontal",customRootClass:c="",value:u,defaultValue:g=[],onValueChange:f,color:h="",disabled:v=!1,dir:C="ltr",rovingFocus:T=!0,asChild:j=!1,children:y,...b},R)=>{const x=r(c,p),[N,G]=t(u,g,f),A={activeToggles:N,setActiveToggles:G,type:e,rootClass:x,disabled:v,orientation:n},I={};return h&&(I["data-color"]=h),v&&(I["data-disabled"]=""),I["data-orientation"]=n,s(m.Provider,T?{value:A,children:s(l.Root,{loop:a,orientation:n,dir:C,children:s(l.Group,{...I,...b,children:s(d.div,{ref:R,className:i(x,o),asChild:j,children:y})})})}:{value:A,children:s(d.div,{ref:R,className:i(x,o),...I,dir:C,asChild:j,...b,children:y})})}));u.displayName=p;const g=e.forwardRef((({children:e,className:o="",value:r=null,disabled:t=!1,asChild:d=!1,iconOnly:p=!1,onClick:u,...g},f)=>{const{type:h,activeToggles:v,setActiveToggles:C,rootClass:T,disabled:j}=a(m),y=Array.isArray(v)?v:null==v||""===v?[]:[v],b=y.includes(r),R=t||j,x={},N={};return b?(x["aria-pressed"]="true",N["data-state"]="on"):(x["aria-pressed"]="false",N["data-state"]="off"),R&&(N["data-disabled"]=""),s(l.Item,{children:s(n,{ref:f,onClick:c(u,(()=>{if(R)return;let e=y;if("single"===h)return b?void C([]):void C([r]);"multiple"===h&&(e=b?e.filter((e=>e!==r)):[...e,r]),C(e)})),"aria-selected":void 0,className:i(T&&`${T}-item`,o),disabled:R,asChild:d,...p?{"data-icon-only":""}:{},...x,...N,...g,children:e})})}));g.displayName="ToggleItem";const f=e.forwardRef(((e,o)=>(console.warn("Direct usage of ToggleGroup is not supported. Please use ToggleGroup.Root, ToggleGroup.Item, etc. instead."),null)));f.displayName="ToggleGroup",f.Root=u,f.Item=g;export{g as Item,u as Root,f as default};
@@ -79,5 +79,5 @@ type ToolbarComponent = React.ForwardRefExoticComponent<ToolbarProps & React.Ref
79
79
  };
80
80
  declare const Toolbar: ToolbarComponent;
81
81
 
82
- export { Toolbar as default };
82
+ export { ToolbarButton as Button, ToolbarLink as Link, ToolbarRoot as Root, ToolbarSeparator as Separator, ToolbarToggleGroup as ToggleGroup, ToolbarToggleItem as ToggleItem, Toolbar as default };
83
83
  export type { ToolbarButtonProps, ToolbarLinkProps, ToolbarRootProps, ToolbarSeparatorProps, ToolbarToggleGroupProps, ToolbarToggleItemProps };
@@ -1 +1 @@
1
- 'use client';import o,{createContext as e}from"react";import{jsx as r}from"react/jsx-runtime";import{c as t}from"./clsx-BaVHROc5.js";import{u as a}from"./useComponentClass-QwNivz0h.js";import{P as s}from"./index-m6qHOeQ9.js";import{R as l}from"./index-DOVR6Rd5.js";import{B as i}from"./index-gM8bbyw1.js";import n from"./Separator.js";import d from"./Link.js";import{u as m}from"./index-wRElCyvx.js";import{T as u}from"./index-DU_6Msfu.js";import"./ThemeContext-Sm-iNANd.js";import"./mergeProps-B9ocQsG4.js";import"./mergeRefs-B8eZ_q-T.js";import"./index-eAZUMNef.js";import"./index-CXzybYmm.js";const c=e(null),p="Toolbar",f=o.forwardRef((({orientation:e="horizontal",loop:i=!1,dir:n="ltr",className:d="",customRootClass:m="",asChild:u=!1,children:f,...h},b)=>{const T=a(m,p),C=o.useMemo((()=>({rootClass:T,orientation:e,dir:n})),[T,e,n]),g={"data-orientation":e};return r(c.Provider,{value:C,children:r(l.Root,{orientation:e,loop:i,dir:n,children:r(l.Group,{children:r(s.div,{asChild:u,ref:b,role:"toolbar","aria-orientation":"vertical"===e?"vertical":void 0,dir:n,className:t(T,d),...g,...h,children:f})})})})}));f.displayName=p;const h=o.forwardRef((({className:e="",asChild:a=!1,type:s="button",...n},d)=>{const m=o.useContext(c);if(!m)throw new Error("Toolbar.Button must be used within Toolbar.Root");const{rootClass:u}=m;return r(l.Item,{children:r(i,{ref:d,className:t(u&&`${u}-button`,e),asChild:a,type:a?void 0:s,...n})})}));h.displayName="ToolbarButton";const b=o.forwardRef((({className:e="",orientation:a,...s},l)=>{const i=o.useContext(c);if(!i)throw new Error("Toolbar.Separator must be used within Toolbar.Root");const{rootClass:d,orientation:m}=i;return r(n,{ref:l,...s,decorative:!0,orientation:a??("horizontal"===m?"vertical":"horizontal"),className:t(d&&`${d}-separator`,e)})}));b.displayName="ToolbarSeparator";const T=o.forwardRef((({className:e="",asChild:a=!1,href:s="#",...i},n)=>{const m=o.useContext(c);if(!m)throw new Error("Toolbar.Link must be used within Toolbar.Root");const{rootClass:u}=m;return r(l.Item,{role:"link",children:r(d,{ref:n,asChild:a,href:s,className:t(u&&`${u}-link`,e),...i})})}));T.displayName="ToolbarLink";const C=e(null),g=o.forwardRef((({type:e="single",value:a,defaultValue:s=[],onValueChange:l,disabled:i=!1,className:n="",children:d,...u},p)=>{const f=o.useContext(c);if(!f)throw new Error("Toolbar.ToggleGroup must be used within Toolbar.Root");const[h,b]=m(a,s,l),T=o.useMemo((()=>Array.isArray(h)?h:h?[h]:[]),[h]),g=o.useMemo((()=>({type:e,value:T,setValue:b,rootClass:f.rootClass,disabled:i})),[e,T,b,f.rootClass,i]);return r(C.Provider,{value:g,children:r("div",{ref:p,...u,role:"group",className:t(f.rootClass&&`${f.rootClass}-toggle-group`,n),children:d})})}));g.displayName="ToolbarToggleGroup";const w=o.forwardRef((({value:e,disabled:a=!1,className:s="",...i},n)=>{const d=o.useContext(C);if(!d)throw new Error("Toolbar.ToggleItem must be used within Toolbar.ToggleGroup");const m=d.value.includes(e),c=a||d.disabled;return r(l.Item,{children:r(u,{ref:n,pressed:m,disabled:c,onPressedChange:o=>{c||("single"!==d.type?o?d.setValue([...d.value,e]):d.setValue(d.value.filter((o=>o!==e))):d.setValue(o?[e]:[]))},className:t(d.rootClass&&`${d.rootClass}-toggle-item`,s),...i})})}));w.displayName="ToolbarToggleItem";const N=o.forwardRef(((o,e)=>("production"!==process.env.NODE_ENV&&console.warn("Direct usage of Toolbar is not supported. Please use Toolbar.Root, Toolbar.Button, etc. instead."),null)));N.displayName="Toolbar",N.Root=f,N.Button=h,N.Separator=b,N.Link=T,N.ToggleGroup=g,N.ToggleItem=w;export{N as default};
1
+ 'use client';import o,{createContext as e}from"react";import{jsx as r}from"react/jsx-runtime";import{u as a,c as t}from"./useComponentClass-C0isGl1z.js";import{P as s}from"./index-XF8itt-H.js";import{R as l}from"./index-C7dBo_Ry.js";import{B as i}from"./index-FITGoHty.js";import n from"./Separator.js";import d from"./Link.js";import{u}from"./index-wRElCyvx.js";import{T as m}from"./index-nYRBURkR.js";import"./ThemeContext-Sm-iNANd.js";import"./mergeProps-0RucjqeH.js";import"./keyboard-BKF7hXqL.js";import"./mergeRefs-B8eZ_q-T.js";import"./index-eAZUMNef.js";import"./index-CXzybYmm.js";const c=e(null),p="Toolbar",f=o.forwardRef((({orientation:e="horizontal",loop:i=!1,dir:n="ltr",className:d="",customRootClass:u="",asChild:m=!1,children:f,...h},b)=>{const g=a(u,p),T=o.useMemo((()=>({rootClass:g,orientation:e,dir:n})),[g,e,n]),C={"data-orientation":e};return r(c.Provider,{value:T,children:r(l.Root,{orientation:e,loop:i,dir:n,children:r(l.Group,{children:r(s.div,{asChild:m,ref:b,role:"toolbar","aria-orientation":"vertical"===e?"vertical":void 0,dir:n,className:t(g,d),...C,...h,children:f})})})})}));f.displayName=p;const h=o.forwardRef((({className:e="",asChild:a=!1,type:s="button",...n},d)=>{const u=o.useContext(c);if(!u)throw new Error("Toolbar.Button must be used within Toolbar.Root");const{rootClass:m}=u;return r(l.Item,{children:r(i,{ref:d,className:t(m&&`${m}-button`,e),asChild:a,type:a?void 0:s,...n})})}));h.displayName="ToolbarButton";const b=o.forwardRef((({className:e="",orientation:a,...s},l)=>{const i=o.useContext(c);if(!i)throw new Error("Toolbar.Separator must be used within Toolbar.Root");const{rootClass:d,orientation:u}=i;return r(n,{ref:l,...s,decorative:!0,orientation:a??("horizontal"===u?"vertical":"horizontal"),className:t(d&&`${d}-separator`,e)})}));b.displayName="ToolbarSeparator";const g=o.forwardRef((({className:e="",asChild:a=!1,href:s="#",...i},n)=>{const u=o.useContext(c);if(!u)throw new Error("Toolbar.Link must be used within Toolbar.Root");const{rootClass:m}=u;return r(l.Item,{role:"link",children:r(d,{ref:n,asChild:a,href:s,className:t(m&&`${m}-link`,e),...i})})}));g.displayName="ToolbarLink";const T=e(null),C=o.forwardRef((({type:e="single",value:a,defaultValue:s=[],onValueChange:l,disabled:i=!1,className:n="",children:d,...m},p)=>{const f=o.useContext(c);if(!f)throw new Error("Toolbar.ToggleGroup must be used within Toolbar.Root");const[h,b]=u(a,s,l),g=o.useMemo((()=>Array.isArray(h)?h:h?[h]:[]),[h]),C=o.useMemo((()=>({type:e,value:g,setValue:b,rootClass:f.rootClass,disabled:i})),[e,g,b,f.rootClass,i]);return r(T.Provider,{value:C,children:r("div",{ref:p,...m,role:"single"===e?"radiogroup":"group",className:t(f.rootClass&&`${f.rootClass}-toggle-group`,n),children:d})})}));C.displayName="ToolbarToggleGroup";const w=o.forwardRef((({value:e,disabled:a=!1,className:s="",...i},n)=>{const d=o.useContext(T);if(!d)throw new Error("Toolbar.ToggleItem must be used within Toolbar.ToggleGroup");const u=d.value.includes(e),c=a||d.disabled,p="single"===d.type?{role:"radio","aria-checked":u,"aria-pressed":void 0}:{};return r(l.Item,{children:r(m,{ref:n,pressed:u,disabled:c,onPressedChange:o=>{c||("single"!==d.type?o?d.setValue([...d.value,e]):d.setValue(d.value.filter((o=>o!==e))):d.setValue(o?[e]:[]))},className:t(d.rootClass&&`${d.rootClass}-toggle-item`,s),...p,...i})})}));w.displayName="ToolbarToggleItem";const N=o.forwardRef(((o,e)=>("production"!==process.env.NODE_ENV&&console.warn("Direct usage of Toolbar is not supported. Please use Toolbar.Root, Toolbar.Button, etc. instead."),null)));N.displayName="Toolbar",N.Root=f,N.Button=h,N.Separator=b,N.Link=g,N.ToggleGroup=C,N.ToggleItem=w;export{h as Button,g as Link,f as Root,b as Separator,C as ToggleGroup,w as ToggleItem,N as default};
@@ -8,6 +8,17 @@ interface TooltipRootProps extends React.ComponentPropsWithoutRef<'div'> {
8
8
  placement?: Placement;
9
9
  collisionBoundary?: Element | null | Array<Element | null>;
10
10
  collisionPadding?: number;
11
+ /** Controlled open state. */
12
+ open?: boolean;
13
+ /** Initial open state when uncontrolled. */
14
+ defaultOpen?: boolean;
15
+ /** Called with the next open state whenever it changes. */
16
+ onOpenChange?: (open: boolean) => void;
17
+ /** Delay in ms before the tooltip opens on hover. Focus opens immediately. */
18
+ openDelay?: number;
19
+ /** Delay in ms before the tooltip closes after the pointer leaves. */
20
+ closeDelay?: number;
21
+ customRootClass?: string;
11
22
  }
12
23
  declare const TooltipRoot: React.ForwardRefExoticComponent<TooltipRootProps & React.RefAttributes<HTMLDivElement>>;
13
24
 
@@ -40,5 +51,5 @@ interface TooltipComponent extends React.ForwardRefExoticComponent<React.Compone
40
51
  }
41
52
  declare const Tooltip: TooltipComponent;
42
53
 
43
- export { Tooltip as default };
54
+ export { TooltipContent as Content, TooltipRoot as Root, TooltipTrigger as Trigger, Tooltip as default };
44
55
  export type { TooltipContentProps, TooltipRootProps, TooltipTriggerProps };
@@ -1 +1 @@
1
- 'use client';import e,{createContext as o,useRef as t,useState as r,useContext as n}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";import{D as s,B as l,n as c,o as d,f as p,e as m,g as f,k as u,i as g,m as h,j as w,u as T,H as R,v as x}from"./floating-ui.react-Byzse64h.js";import{B as y}from"./index-gM8bbyw1.js";import{c as j}from"./clsx-BaVHROc5.js";import{P as v}from"./index-m6qHOeQ9.js";import{T as C}from"./ThemeContext-Sm-iNANd.js";import"react-dom";import"./mergeProps-B9ocQsG4.js";const N=o(null),P=e.forwardRef((({children:e,placement:o="top",collisionBoundary:n=null,collisionPadding:i=5,...T},R)=>{const x=t(null),[y,j]=r(!1),v=(Array.isArray(n)?n:[n]).filter((e=>null!=e)),C={padding:i,boundary:v,altBoundary:v.length>0},P=s({placement:o,strategy:"fixed",onOpenChange:j,middleware:[c({element:x,padding:4}),d(5),p({crossAxis:!0,fallbackAxisSideDirection:"start",...C}),m(C)],whileElementsMounted:l}),A=P.context,O=f(A,{move:!1}),b=u(A,{}),B=g(A),S=h(A,{role:"tooltip"}),D=w([O,b,B,S]);return a(N.Provider,{value:{isOpen:y,setIsOpen:j,data:P,interactions:D,context:A,arrowRef:x},children:a("div",{ref:R,...T,children:e})})}));P.displayName="Tooltip";const A=e.forwardRef((({children:e,asChild:o,...t},r)=>{const i=n(N);if(!i)throw new Error("TooltipTrigger must be used within a TooltipRoot component");const{isOpen:s,interactions:l,context:c}=i,{getReferenceProps:d}=l,p=e.ref,m=T([c.refs.setReference,r,p]);return a(y,{asChild:o,ref:m,"data-state":s?"open":"closed",...d(t),children:e})}));A.displayName="TooltipTrigger";const O=e.forwardRef((({children:e,showArrow:o=!0,container:t,...r},s)=>{const l=n(N),c=n(C);if(!l)throw new Error("TooltipContent must be used within a TooltipRoot component");const{isOpen:d,data:p,interactions:m,context:f}=l,u=l.arrowRef,g=T([f.refs.setFloating,s]);if(!d)return null;const{getFloatingProps:h}=m,w=t||c?.portalRootRef.current||document.querySelector("[data-rad-ui-portal-root]")||c?.containerRef.current||document.querySelector("#rad-ui-theme-container")||void 0;return a(R,{root:w,children:a(v.div,{className:"rad-ui-tooltip-floating-element",ref:g,"data-state":d?"open":"closed",style:{...p.floatingStyles},...h(r),children:i("div",{className:"rad-ui-tooltip-content-inner",children:[o&&a(x,{className:j("rad-ui-arrow"),ref:u,context:f}),e]})})})}));O.displayName="TooltipContent";const b=e.forwardRef(((e,o)=>(console.warn("Direct usage of Tooltip is not supported. Please use Tooltip.Root, Tooltip.Trigger, etc. instead."),null)));b.displayName="Tooltip",b.Root=P,b.Trigger=A,b.Content=O;export{b as default};
1
+ 'use client';import o,{createContext as e,useRef as t,useContext as r}from"react";import{jsx as a,jsxs as n}from"react/jsx-runtime";import{E as s,D as i,p as l,o as d,f as c,e as p,i as m,v as f,m as u,j as g,n as h,k as w,u as T,I as R,w as y}from"./floating-ui.react-2kiGB4sW.js";import{u as C}from"./index-wRElCyvx.js";import{u as x,c as j}from"./useComponentClass-C0isGl1z.js";import{B as v}from"./index-FITGoHty.js";import{g as N}from"./mergeProps-0RucjqeH.js";import{P as O}from"./index-XF8itt-H.js";import{T as P}from"./ThemeContext-Sm-iNANd.js";import"react-dom";const A=e(null),D="Tooltip",b=o.forwardRef((({children:o,placement:e="top",collisionBoundary:r=null,collisionPadding:n=5,open:T,defaultOpen:R=!1,onOpenChange:y,openDelay:j=0,closeDelay:v=0,customRootClass:N="",...O},P)=>{const b=t(null),E=x(N,D),[B,S]=C(T,R,y),$=(Array.isArray(r)?r:[r]).filter((o=>null!=o)),k={padding:n,boundary:$,altBoundary:$.length>0},F=s({open:B,placement:e,strategy:"fixed",onOpenChange:S,middleware:[l({element:b,padding:4}),d(5),c({crossAxis:!0,fallbackAxisSideDirection:"start",...k}),p(k)],whileElementsMounted:i}),I=F.context,M=m(I,{move:!1,delay:{open:j,close:v},handleClose:f()}),q=u(I),z=g(I),G=h(I,{role:"tooltip"}),H=w([M,q,z,G]);return a(A.Provider,{value:{isOpen:B,setIsOpen:S,data:F,interactions:H,context:I,arrowRef:b,rootClass:E},children:a("div",{ref:P,"data-slot":"tooltip-root",...O,children:o})})}));b.displayName=D;const E=o.forwardRef((({children:o,asChild:e,...t},n)=>{const s=r(A);if(!s)throw new Error("TooltipTrigger must be used within a TooltipRoot component");const{isOpen:i,interactions:l,context:d}=s,{getReferenceProps:c}=l,p=N(o),m=T([d.refs.setReference,n,p]);return a(v,{asChild:e,ref:m,"data-slot":"tooltip-trigger","data-state":i?"open":"closed",...c(t),children:o})}));E.displayName="TooltipTrigger";const B=o.forwardRef((({children:o,showArrow:e=!0,container:t,className:s,style:i,...l},d)=>{const c=r(A),p=r(P);if(!c)throw new Error("TooltipContent must be used within a TooltipRoot component");const{isOpen:m,data:f,interactions:u,context:g,rootClass:h}=c,w=c.arrowRef,C=T([g.refs.setFloating,d]);if(!m)return null;const{getFloatingProps:x}=u,v=t??p?.portalRootRef.current??p?.containerRef.current??void 0;return a(R,{root:v,children:a(O.div,{ref:C,"data-slot":"tooltip-content","data-state":m?"open":"closed","data-side":String(f.placement??"").split("-")[0]||void 0,...x(l),className:j(h&&`${h}-floating-element`,s),style:{...i,...f.floatingStyles},children:n("div",{className:j(h&&`${h}-content-inner`),children:[e&&a(y,{className:j(h&&`${h}-arrow`),ref:w,context:g,"data-slot":"tooltip-arrow"}),o]})})})}));B.displayName="TooltipContent";const S=o.forwardRef(((o,e)=>(console.warn("Direct usage of Tooltip is not supported. Please use Tooltip.Root, Tooltip.Trigger, etc. instead."),null)));S.displayName="Tooltip",S.Root=b,S.Trigger=E,S.Content=B;export{B as Content,b as Root,E as Trigger,S as default};
@@ -6,6 +6,7 @@ type TreeRootProps = {
6
6
  customRootClass?: string;
7
7
  'aria-label'?: string;
8
8
  'aria-labelledby'?: string;
9
+ loop?: boolean;
9
10
  } & ComponentPropsWithoutRef<typeof Primitive.div>;
10
11
  declare const TreeRoot: React.ForwardRefExoticComponent<TreeRootProps & React.RefAttributes<HTMLElement>>;
11
12
 
@@ -44,5 +45,5 @@ type TreeComponent = React.ForwardRefExoticComponent<TreeProps & React.RefAttrib
44
45
  };
45
46
  declare const Tree: TreeComponent;
46
47
 
47
- export { Tree as default };
48
+ export { TreeItem as Item, TreeRoot as Root, Tree as default };
48
49
  export type { TreeElement, TreeItemProps, TreeProps, TreeRootProps };
@@ -1 +1 @@
1
- 'use client';import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{createContext as n,forwardRef as o,useRef as a,useImperativeHandle as l,useCallback as s,useId as i,useState as d,useContext as c,useEffect as m}from"react";import{R as u}from"./index-DOVR6Rd5.js";import{P as p}from"./index-m6qHOeQ9.js";import{u as f}from"./useComponentClass-QwNivz0h.js";import{c as h}from"./clsx-BaVHROc5.js";import{B as g}from"./index-gM8bbyw1.js";import"./mergeRefs-B8eZ_q-T.js";import"./mergeProps-B9ocQsG4.js";import"./ThemeContext-Sm-iNANd.js";const R=n({rootClass:"",treeRef:{current:null},itemRefs:new Map,registerItemRef:()=>{},unregisterItemRef:()=>{}}),v="Tree",I=o((({children:r,className:t="",customRootClass:n="","aria-label":o,"aria-labelledby":i,...d},c)=>{const m=a(null);l(c,(()=>m.current));const g=f(n,v),I=a(new Map),b=s(((e,r)=>{I.current.set(e,r)}),[]),w=s((e=>{I.current.delete(e)}),[]),y={rootClass:g,treeRef:m,itemRefs:I.current,registerItemRef:b,unregisterItemRef:w};return e(R.Provider,{value:y,children:e(u.Root,{orientation:"vertical",mode:"tree",children:e(u.Group,{children:e(p.div,{className:h(g,t),ref:m,role:"tree","aria-label":o,"aria-labelledby":i,...d,children:r})})})})}));I.displayName=v;const b=o((({children:n,item:o,level:s=0,className:p="",parentId:f=null,isSelected:v=!1,onToggleSelect:I,getIsSelected:w,onChildRefReady:y,...C},x)=>{const j=i(),N=a(null);l(x,(()=>N.current));const T=Boolean(o?.items?.length),[k,S]=d((()=>Boolean(o?.expanded))),{rootClass:D,itemRefs:L,registerItemRef:P,unregisterItemRef:B}=c(R),$=a(null);m((()=>(P(j,N),()=>{B(j)})),[j,P,B]),m((()=>{y&&N.current&&y(N)}),[y]);const K=e=>{$.current=e.current};return r(t,{children:[e(u.Item,{handleRightKeyDown:()=>{T&&(k?$.current?.focus():S(!0))},handleLeftKeyDown:()=>{if(k)return void S(!1);if(!f)return;const e=L.get(f);e?.current&&e.current.focus(),S(!1)},role:"treeitem",children:r(g,{ref:N,className:h(D&&`${D}-item`,p),onClick:()=>{I&&I(j,o),T&&S((e=>!e))},onKeyDownCapture:e=>{"Enter"===e.key&&(I&&I(j,o),e.preventDefault(),e.stopPropagation())},type:"button","data-selected":v,"aria-selected":v,"aria-expanded":T?k:void 0,"data-toggled":k,"data-has-children":T,"data-id":j,"data-parent-id":f,"data-level":s,...C,children:[e("span",{className:D?`${D}-item-chevron`:void 0,"aria-hidden":!0,children:T?e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:"false",children:e("path",{d:"M4.5 2.5L7.5 6L4.5 9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):null}),e("span",{className:D?`${D}-item-label`:void 0,children:n})]})}),k&&o.items&&e("div",{className:D?`${D}-branch`:void 0,role:"group",children:o.items.map(((r,t)=>{const n=s+1,o=!!w&&w(r);return e(b,{parentId:j,level:n,item:r,isSelected:o,onToggleSelect:I,getIsSelected:w,onChildRefReady:0===t?K:void 0,children:r.label},r.label)}))})]})}));b.displayName="TreeItem";const w=o((({children:r,...t},n)=>(console.warn("Direct usage of Tree is not supported. Please use Tree.Root and Tree.Item instead."),e("div",{ref:n,...t,children:r}))));w.displayName="Tree",w.Root=I,w.Item=b;export{w as default};
1
+ 'use client';import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{createContext as o,forwardRef as a,useRef as n,useImperativeHandle as l,useCallback as i,useId as s,useState as d,useContext as c,useEffect as m}from"react";import{R as u}from"./index-C7dBo_Ry.js";import{P as f}from"./index-XF8itt-H.js";import{u as p,c as h}from"./useComponentClass-C0isGl1z.js";import{B as g}from"./index-FITGoHty.js";import{K as v}from"./keyboard-BKF7hXqL.js";import"./mergeRefs-B8eZ_q-T.js";import"./mergeProps-0RucjqeH.js";import"./ThemeContext-Sm-iNANd.js";const R=o({rootClass:"",treeRef:{current:null},itemRefs:new Map,registerItemRef:()=>{},unregisterItemRef:()=>{}}),y="Tree",I=a((({children:t,className:r="",customRootClass:o="","aria-label":a,"aria-labelledby":s,loop:d=!0,onKeyDown:c,...m},g)=>{const v=n(null);l(g,(()=>v.current));const I=p(o,y),C=n(new Map),w=i(((e,t)=>{C.current.set(e,t)}),[]),b=i((e=>{C.current.delete(e)}),[]),N={rootClass:I,treeRef:v,itemRefs:C.current,registerItemRef:w,unregisterItemRef:b};return e(R.Provider,{value:N,children:e(u.Root,{orientation:"vertical",mode:"tree",loop:d,asChild:!0,children:e(u.Group,{children:e(f.div,{className:h(I,r),ref:v,role:"tree","aria-orientation":"vertical","aria-label":a,"aria-labelledby":s,onKeyDown:e=>{if(c?.(e),e.defaultPrevented||!(e=>1===e.key.length&&" "!==e.key&&!e.ctrlKey&&!e.metaKey&&!e.altKey)(e))return;const t=Array.from(C.current.values()).map((e=>e.current)).filter((e=>Boolean(e&&e.isConnected&&!e.disabled))).sort(((e,t)=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1));if(0===t.length)return;const r=e.key.toLowerCase(),o=t.findIndex((t=>t===e.target)),a=[...t.slice(o+1),...t.slice(0,o+1)].find((e=>(e.textContent??"").trim().toLowerCase().startsWith(r)));a&&a!==e.target&&(e.preventDefault(),a.focus())},...m,children:t})})})})}));I.displayName=y;const C=a((({children:o,item:a,level:i=0,className:f="",parentId:p=null,isSelected:y=!1,onToggleSelect:I,getIsSelected:w,onChildRefReady:b,...N},x)=>{const T=s(),j=n(null);l(x,(()=>j.current));const k=Boolean(a?.items?.length),[D,K]=d((()=>Boolean(a?.expanded))),{rootClass:L,itemRefs:P,registerItemRef:S,unregisterItemRef:$}=c(R),B=n(null);m((()=>(S(T,j),()=>{$(T)})),[T,S,$]),m((()=>{b&&j.current&&b(j)}),[b]);const O=e=>{B.current=e.current};return t(r,{children:[e(u.Item,{handleRightKeyDown:()=>{k&&(D?B.current?.focus():K(!0))},handleLeftKeyDown:()=>{if(D)return void K(!1);if(!p)return;const e=P.get(p);e?.current&&e.current.focus(),K(!1)},role:"treeitem",children:t(g,{ref:j,className:h(L&&`${L}-item`,f),onClick:()=>{I&&I(T,a),k&&K((e=>!e))},onKeyDownCapture:e=>{e.key===v.ENTER&&(I&&I(T,a),e.preventDefault(),e.stopPropagation())},type:"button","data-selected":y,"aria-selected":y,"aria-expanded":k?D:void 0,"data-toggled":D,"data-has-children":k,"data-id":T,"data-parent-id":p,"data-level":i,"aria-level":i+1,...N,children:[e("span",{className:L?`${L}-item-chevron`:void 0,"aria-hidden":!0,children:k?e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:"false",children:e("path",{d:"M4.5 2.5L7.5 6L4.5 9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):null}),e("span",{className:L?`${L}-item-label`:void 0,children:o})]})}),D&&k&&e("div",{className:L?`${L}-branch`:void 0,role:"group",children:a.items.map(((t,r)=>{const o=i+1,n=!!w&&w(t);return e(C,{parentId:T,level:o,item:t,isSelected:n,onToggleSelect:I,getIsSelected:w,onChildRefReady:0===r?O:void 0,"aria-posinset":r+1,"aria-setsize":a.items.length,children:t.label},t?.id??t?.value??`${r}-${t?.label}`)}))})]})}));C.displayName="TreeItem";const w=a((({children:t,...r},o)=>(console.warn("Direct usage of Tree is not supported. Please use Tree.Root and Tree.Item instead."),e("div",{ref:o,...r,children:t}))));w.displayName="Tree",w.Root=I,w.Item=C;export{C as Item,I as Root,w as default};
@@ -1 +1 @@
1
- 'use client';import{jsx as e}from"react/jsx-runtime";import{forwardRef as s}from"react";import{P as t}from"./index-m6qHOeQ9.js";import{u as o}from"./useComponentClass-QwNivz0h.js";import{c as r}from"./clsx-BaVHROc5.js";import"./mergeProps-B9ocQsG4.js";import"./ThemeContext-Sm-iNANd.js";const i="VisuallyHidden",a={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",pointerEvents:"none",userSelect:"none"},n=s((({children:s,customRootClass:n,className:m,style:p={},...l},c)=>{const d=o(n,i);return e(t.div,{ref:c,className:r(d,m),style:{...a,...p},...l,children:s})}));n.displayName=i;export{n as default};
1
+ 'use client';import{jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{P as s}from"./index-XF8itt-H.js";import{u as o,c as r}from"./useComponentClass-C0isGl1z.js";import"./mergeProps-0RucjqeH.js";import"./ThemeContext-Sm-iNANd.js";const i="VisuallyHidden",a={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",pointerEvents:"none",userSelect:"none"},n=t((({children:t,customRootClass:n,className:p,style:m={},...l},c)=>{const d=o(n,i);return e(s.div,{ref:c,className:r(d,p),style:{...a,...m},...l,children:t})}));n.displayName=i;export{n as default};
@@ -23,22 +23,22 @@
23
23
  * This source code is licensed under the ISC license.
24
24
  * See the LICENSE file in the root directory of this source tree.
25
25
  */
26
- var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
26
+ var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
27
27
  /**
28
28
  * @license lucide-react v0.575.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
- */const s=e=>{for(const r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0;return!1},a=e((({color:e="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:c="",children:l,iconNode:d,...h},u)=>r("svg",{ref:u,...i,width:o,height:o,stroke:e,strokeWidth:n?24*Number(a)/Number(o):a,className:t("lucide",c),...!l&&!s(h)&&{"aria-hidden":"true"},...h},[...d.map((([e,t])=>r(e,t))),...Array.isArray(l)?l:[l]]))),n=((i,s)=>{const n=e((({className:e,...n},c)=>{return r(a,{ref:c,iconNode:s,className:t(`lucide-${l=o(i),l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${i}`,e),...n});var l;
32
+ */const i=e=>{for(const r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0;return!1},a=e((({color:e="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:n="",children:l,iconNode:d,...h},u)=>r("svg",{ref:u,...s,width:o,height:o,stroke:e,strokeWidth:c?24*Number(a)/Number(o):a,className:t("lucide",n),...!l&&!i(h)&&{"aria-hidden":"true"},...h},[...d.map((([e,t])=>r(e,t))),...Array.isArray(l)?l:[l]]))),c=(s,i)=>{const c=e((({className:e,...c},n)=>{return r(a,{ref:n,iconNode:i,className:t(`lucide-${l=o(s),l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${s}`,e),...c});var l;
33
33
  /**
34
34
  * @license lucide-react v0.575.0 - ISC
35
35
  *
36
36
  * This source code is licensed under the ISC license.
37
37
  * See the LICENSE file in the root directory of this source tree.
38
- */}));return n.displayName=o(i),n})("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);
38
+ */}));return c.displayName=o(s),c},n=c("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);
39
39
  /**
40
40
  * @license lucide-react v0.575.0 - ISC
41
41
  *
42
42
  * This source code is licensed under the ISC license.
43
43
  * See the LICENSE file in the root directory of this source tree.
44
- */export{n as C};
44
+ */export{n as C,c};
@@ -0,0 +1 @@
1
+ 'use client';const e="data-rad-ui-overlay-open";let t=0;const n=new Set;function o(){n.forEach((e=>e()))}function u(){if("undefined"==typeof document)return;const n=document.documentElement;t>0?n.setAttribute(e,""):n.removeAttribute(e)}function d(){return"undefined"!=typeof document&&(t>0||document.documentElement.hasAttribute(e)||"undefined"!=typeof document&&"hidden"===document.body.style.overflow)}function r(){t+=1,u(),o();let e=!1;return()=>{e||(e=!0,t=Math.max(0,t-1),u(),o())}}function c(e){return n.add(e),()=>{n.delete(e)}}export{e as D,d as i,r,c as s};