@luxfi/ui 7.0.0 → 7.1.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 (60) hide show
  1. package/dist/alert.cjs +162 -285
  2. package/dist/alert.js +162 -285
  3. package/dist/badge.cjs +162 -321
  4. package/dist/badge.d.cts +3 -7
  5. package/dist/badge.d.ts +3 -7
  6. package/dist/badge.js +162 -320
  7. package/dist/button.cjs +373 -484
  8. package/dist/button.d.cts +10 -7
  9. package/dist/button.d.ts +10 -7
  10. package/dist/button.js +373 -484
  11. package/dist/close-button.cjs +37 -18
  12. package/dist/close-button.d.cts +1 -1
  13. package/dist/close-button.d.ts +1 -1
  14. package/dist/close-button.js +37 -18
  15. package/dist/collapsible.cjs +125 -272
  16. package/dist/collapsible.js +125 -272
  17. package/dist/dialog.cjs +60 -44
  18. package/dist/dialog.d.cts +7 -8
  19. package/dist/dialog.d.ts +7 -8
  20. package/dist/dialog.js +60 -43
  21. package/dist/drawer.cjs +37 -13
  22. package/dist/drawer.js +37 -13
  23. package/dist/heading.cjs +3 -8
  24. package/dist/heading.js +3 -8
  25. package/dist/icon-button.cjs +213 -337
  26. package/dist/icon-button.d.cts +4 -4
  27. package/dist/icon-button.d.ts +4 -4
  28. package/dist/icon-button.js +213 -338
  29. package/dist/image.cjs +125 -272
  30. package/dist/image.js +125 -272
  31. package/dist/index.cjs +604 -700
  32. package/dist/index.d.cts +0 -3
  33. package/dist/index.d.ts +0 -3
  34. package/dist/index.js +604 -698
  35. package/dist/link.cjs +125 -272
  36. package/dist/link.js +125 -272
  37. package/dist/popover.cjs +55 -40
  38. package/dist/popover.js +55 -39
  39. package/dist/select.cjs +125 -272
  40. package/dist/select.js +125 -272
  41. package/dist/skeleton.cjs +125 -272
  42. package/dist/skeleton.js +125 -272
  43. package/dist/table.cjs +127 -274
  44. package/dist/table.js +127 -274
  45. package/dist/tag.cjs +184 -306
  46. package/dist/tag.js +184 -305
  47. package/dist/tooltip.cjs +22 -21
  48. package/dist/tooltip.d.cts +2 -3
  49. package/dist/tooltip.d.ts +2 -3
  50. package/dist/tooltip.js +22 -20
  51. package/package.json +9 -7
  52. package/src/badge.tsx +20 -31
  53. package/src/button.tsx +304 -238
  54. package/src/close-button.tsx +48 -22
  55. package/src/dialog.tsx +37 -47
  56. package/src/heading.tsx +8 -19
  57. package/src/icon-button.tsx +129 -104
  58. package/src/popover.tsx +30 -44
  59. package/src/skeleton.tsx +96 -144
  60. package/src/tooltip.tsx +54 -47
package/dist/tag.cjs CHANGED
@@ -5,8 +5,9 @@ var classVarianceAuthority = require('class-variance-authority');
5
5
  var React3 = require('react');
6
6
  var clsx = require('clsx');
7
7
  var tailwindMerge = require('tailwind-merge');
8
+ var core = require('@hanzogui/core');
8
9
  var jsxRuntime = require('react/jsx-runtime');
9
- var RadixTooltip = require('@radix-ui/react-tooltip');
10
+ var tooltip = require('@hanzogui/tooltip');
10
11
  var usehooks = require('@uidotdev/usehooks');
11
12
 
12
13
  function _interopNamespace(e) {
@@ -28,31 +29,53 @@ function _interopNamespace(e) {
28
29
  }
29
30
 
30
31
  var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
31
- var RadixTooltip__namespace = /*#__PURE__*/_interopNamespace(RadixTooltip);
32
32
 
33
33
  // src/tag.tsx
34
34
  function cn(...inputs) {
35
35
  return tailwindMerge.twMerge(clsx.clsx(inputs));
36
36
  }
37
37
  var CLOSE_ICON_PATH = "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z";
38
+ var CloseButtonFrame = core.styled(core.View, {
39
+ name: "LuxCloseButton",
40
+ render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
41
+ role: "button",
42
+ cursor: "pointer",
43
+ display: "inline-flex",
44
+ alignItems: "center",
45
+ justifyContent: "center",
46
+ width: 20,
47
+ height: 20,
48
+ minWidth: 0,
49
+ flexShrink: 1,
50
+ padding: 0,
51
+ borderRadius: 4,
52
+ borderWidth: 0,
53
+ overflow: "hidden",
54
+ backgroundColor: "transparent",
55
+ hoverStyle: {
56
+ backgroundColor: "transparent"
57
+ },
58
+ variants: {
59
+ disabled: {
60
+ true: {
61
+ opacity: 0.4,
62
+ pointerEvents: "none"
63
+ }
64
+ }
65
+ }
66
+ });
67
+ var CLOSE_BUTTON_CLASSES = [
68
+ "text-[var(--closeButton-fg,currentColor)]",
69
+ "hover:text-[var(--hover-color,currentColor)]",
70
+ "disabled:opacity-40"
71
+ ].join(" ");
38
72
  var CloseButton = React3__namespace.forwardRef(function CloseButton2(props, ref) {
39
73
  const { variant: _variant, size: _size, className, children, ...rest } = props;
40
74
  return /* @__PURE__ */ jsxRuntime.jsx(
41
- "button",
75
+ CloseButtonFrame,
42
76
  {
43
- type: "button",
44
- "aria-label": "Close",
45
77
  ref,
46
- className: cn(
47
- "inline-flex items-center justify-center",
48
- "size-5 min-w-0 shrink-0 p-0",
49
- "rounded-sm border-0 overflow-hidden",
50
- "bg-transparent text-[var(--closeButton-fg,currentColor)]",
51
- "hover:bg-transparent hover:text-[var(--hover-color,currentColor)]",
52
- "disabled:opacity-40",
53
- "cursor-pointer",
54
- className
55
- ),
78
+ className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
56
79
  ...rest,
57
80
  children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
58
81
  "svg",
@@ -73,272 +96,137 @@ var CloseButton = React3__namespace.forwardRef(function CloseButton2(props, ref)
73
96
  }
74
97
  );
75
98
  });
76
- var SPACING_SCALE = 4;
77
- function toStylePx(value) {
78
- if (value === void 0) return void 0;
79
- if (typeof value === "string") return value;
80
- return `${value * SPACING_SCALE}px`;
99
+ var SHIM_PROPS = [
100
+ "w",
101
+ "h",
102
+ "minW",
103
+ "maxW",
104
+ "display",
105
+ "flexGrow",
106
+ "flexShrink",
107
+ "flexBasis",
108
+ "fontWeight",
109
+ "textStyle",
110
+ "borderRadius",
111
+ "alignSelf",
112
+ "alignItems",
113
+ "justifyContent",
114
+ "color",
115
+ "mt",
116
+ "mb",
117
+ "ml",
118
+ "mr",
119
+ "height",
120
+ "overflow",
121
+ "whiteSpace",
122
+ "textOverflow",
123
+ "textTransform",
124
+ "gap",
125
+ "gridTemplateColumns",
126
+ "minWidth",
127
+ "boxSize",
128
+ "py",
129
+ "px",
130
+ "p",
131
+ "hideBelow",
132
+ "fontSize",
133
+ "flexWrap",
134
+ "wordBreak",
135
+ "lineHeight",
136
+ "marginRight",
137
+ "position",
138
+ "background"
139
+ ];
140
+ var S = 4;
141
+ function dim(v) {
142
+ if (v == null) return void 0;
143
+ if (typeof v === "number") return `${v * S}px`;
144
+ if (typeof v === "string") return v;
145
+ if (typeof v === "object") {
146
+ const o = v;
147
+ return o.base ?? o.lg ?? o.xl ?? Object.values(o)[0];
148
+ }
149
+ return void 0;
81
150
  }
82
- function extractSkeletonStyleProps(props) {
83
- const style = {};
84
- const rest = {};
85
- function resolveDimension(value) {
86
- if (value === void 0 || value === null) return void 0;
87
- if (typeof value === "number") return `${value * SPACING_SCALE}px`;
88
- if (typeof value === "string") return value;
89
- if (typeof value === "object") {
90
- const obj = value;
91
- return obj.base ?? obj.lg ?? obj.xl ?? Object.values(obj)[0];
92
- }
93
- return void 0;
151
+ function sp(v) {
152
+ if (v === void 0) return void 0;
153
+ return typeof v === "number" ? `${v * S}px` : v;
154
+ }
155
+ function shimToStyle(props) {
156
+ const s = {};
157
+ if (props.w !== void 0) s.width = dim(props.w);
158
+ if (props.h !== void 0) s.height = dim(props.h);
159
+ if (props.minW !== void 0) s.minWidth = dim(props.minW);
160
+ if (props.maxW !== void 0) s.maxWidth = dim(props.maxW);
161
+ if (props.display !== void 0) s.display = props.display;
162
+ if (props.flexGrow !== void 0) s.flexGrow = props.flexGrow;
163
+ if (props.flexShrink !== void 0) s.flexShrink = props.flexShrink;
164
+ if (props.flexBasis !== void 0) s.flexBasis = props.flexBasis;
165
+ if (props.fontWeight !== void 0) s.fontWeight = props.fontWeight;
166
+ if (props.borderRadius !== void 0) s.borderRadius = props.borderRadius;
167
+ if (props.alignSelf !== void 0) s.alignSelf = props.alignSelf;
168
+ if (props.alignItems !== void 0) s.alignItems = props.alignItems;
169
+ if (props.justifyContent !== void 0) s.justifyContent = props.justifyContent;
170
+ if (props.color !== void 0) s.color = props.color;
171
+ if (props.mt !== void 0) s.marginTop = sp(props.mt);
172
+ if (props.mb !== void 0) s.marginBottom = sp(props.mb);
173
+ if (props.ml !== void 0) s.marginLeft = sp(props.ml);
174
+ if (props.mr !== void 0) s.marginRight = sp(props.mr);
175
+ if (props.height !== void 0) s.height = props.height;
176
+ if (props.overflow !== void 0) s.overflow = props.overflow;
177
+ if (props.whiteSpace !== void 0) s.whiteSpace = props.whiteSpace;
178
+ if (props.textOverflow !== void 0) s.textOverflow = props.textOverflow;
179
+ if (props.textTransform !== void 0) s.textTransform = props.textTransform;
180
+ if (props.gap !== void 0) s.gap = sp(props.gap);
181
+ if (props.gridTemplateColumns !== void 0) s.gridTemplateColumns = props.gridTemplateColumns;
182
+ if (props.minWidth !== void 0) s.minWidth = props.minWidth;
183
+ if (props.boxSize !== void 0) {
184
+ const v = typeof props.boxSize === "number" ? `${props.boxSize * S}px` : props.boxSize;
185
+ s.width = v;
186
+ s.height = v;
94
187
  }
95
- for (const [key, value] of Object.entries(props)) {
96
- if (value === void 0) continue;
97
- switch (key) {
98
- case "w": {
99
- const v = resolveDimension(value);
100
- if (v) style.width = v;
101
- break;
102
- }
103
- case "h": {
104
- const v = resolveDimension(value);
105
- if (v) style.height = v;
106
- break;
107
- }
108
- case "minW": {
109
- const v = resolveDimension(value);
110
- if (v) style.minWidth = v;
111
- break;
112
- }
113
- case "maxW": {
114
- const v = resolveDimension(value);
115
- if (v) style.maxWidth = v;
116
- break;
117
- }
118
- case "height":
119
- style.height = value;
120
- break;
121
- case "display":
122
- style.display = value;
123
- break;
124
- case "flexGrow":
125
- style.flexGrow = value;
126
- break;
127
- case "flexShrink":
128
- style.flexShrink = value;
129
- break;
130
- case "flexBasis":
131
- style.flexBasis = value;
132
- break;
133
- case "fontWeight":
134
- style.fontWeight = value;
135
- break;
136
- case "borderRadius":
137
- style.borderRadius = value;
138
- break;
139
- case "alignSelf":
140
- style.alignSelf = value;
141
- break;
142
- case "alignItems":
143
- style.alignItems = value;
144
- break;
145
- case "justifyContent":
146
- style.justifyContent = value;
147
- break;
148
- case "color":
149
- style.color = value;
150
- break;
151
- case "mt":
152
- style.marginTop = toStylePx(value);
153
- break;
154
- case "mb":
155
- style.marginBottom = toStylePx(value);
156
- break;
157
- case "ml":
158
- style.marginLeft = toStylePx(value);
159
- break;
160
- case "mr":
161
- style.marginRight = toStylePx(value);
162
- break;
163
- case "overflow":
164
- style.overflow = value;
165
- break;
166
- case "whiteSpace":
167
- style.whiteSpace = value;
168
- break;
169
- case "textOverflow":
170
- style.textOverflow = value;
171
- break;
172
- case "textTransform":
173
- style.textTransform = value;
174
- break;
175
- case "gap":
176
- style.gap = typeof value === "number" ? `${value * SPACING_SCALE}px` : value;
177
- break;
178
- case "gridTemplateColumns":
179
- style.gridTemplateColumns = value;
180
- break;
181
- case "minWidth":
182
- style.minWidth = value;
183
- break;
184
- case "boxSize": {
185
- const s = typeof value === "number" ? `${value * SPACING_SCALE}px` : value;
186
- style.width = s;
187
- style.height = s;
188
- break;
189
- }
190
- case "py": {
191
- const v = toStylePx(value);
192
- style.paddingTop = v;
193
- style.paddingBottom = v;
194
- break;
195
- }
196
- case "px": {
197
- const v = toStylePx(value);
198
- style.paddingLeft = v;
199
- style.paddingRight = v;
200
- break;
201
- }
202
- case "p": {
203
- const v = toStylePx(value);
204
- style.padding = v;
205
- break;
206
- }
207
- case "hideBelow":
208
- break;
209
- // handled via className
210
- case "textStyle":
211
- break;
212
- // drop textStyle, not directly applicable
213
- case "fontSize":
214
- style.fontSize = value;
215
- break;
216
- case "flexWrap":
217
- style.flexWrap = value;
218
- break;
219
- case "wordBreak":
220
- style.wordBreak = value;
221
- break;
222
- case "lineHeight":
223
- style.lineHeight = value;
224
- break;
225
- case "marginRight":
226
- style.marginRight = value;
227
- break;
228
- case "position":
229
- style.position = value;
230
- break;
231
- case "background":
232
- style.background = value;
233
- break;
234
- default:
235
- rest[key] = value;
236
- break;
237
- }
188
+ if (props.py !== void 0) {
189
+ const v = sp(props.py);
190
+ s.paddingTop = v;
191
+ s.paddingBottom = v;
238
192
  }
239
- return { style, rest };
193
+ if (props.px !== void 0) {
194
+ const v = sp(props.px);
195
+ s.paddingLeft = v;
196
+ s.paddingRight = v;
197
+ }
198
+ if (props.p !== void 0) s.padding = sp(props.p);
199
+ if (props.fontSize !== void 0) s.fontSize = props.fontSize;
200
+ if (props.flexWrap !== void 0) s.flexWrap = props.flexWrap;
201
+ if (props.wordBreak !== void 0) s.wordBreak = props.wordBreak;
202
+ if (props.lineHeight !== void 0) s.lineHeight = props.lineHeight;
203
+ if (props.marginRight !== void 0) s.marginRight = props.marginRight;
204
+ if (props.position !== void 0) s.position = props.position;
205
+ if (props.background !== void 0) s.background = props.background;
206
+ return s;
207
+ }
208
+ function stripShims(props) {
209
+ const out = { ...props };
210
+ for (const k of SHIM_PROPS) delete out[k];
211
+ return out;
240
212
  }
213
+ var SKELETON_CLASSES = [
214
+ "animate-skeleton-shimmer rounded-sm",
215
+ "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
216
+ "bg-[length:200%_100%]"
217
+ ].join(" ");
218
+ var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
241
219
  var Skeleton = React3__namespace.forwardRef(
242
220
  function Skeleton2(props, ref) {
243
- const {
244
- loading = false,
245
- asChild,
246
- className,
247
- children,
248
- style: styleProp,
249
- // Destructure style-prop shims so they don't leak into DOM
250
- w: _w,
251
- h: _h,
252
- minW: _minW,
253
- maxW: _maxW,
254
- display: _display,
255
- flexGrow: _flexGrow,
256
- flexShrink: _flexShrink,
257
- flexBasis: _flexBasis,
258
- fontWeight: _fontWeight,
259
- textStyle: _textStyle,
260
- borderRadius: _borderRadius,
261
- alignSelf: _alignSelf,
262
- alignItems: _alignItems,
263
- justifyContent: _justifyContent,
264
- color: _color,
265
- mt: _mt,
266
- mb: _mb,
267
- ml: _ml,
268
- mr: _mr,
269
- height: _height,
270
- overflow: _overflow,
271
- whiteSpace: _whiteSpace,
272
- textOverflow: _textOverflow,
273
- textTransform: _textTransform,
274
- gap: _gap,
275
- gridTemplateColumns: _gridTemplateColumns,
276
- minWidth: _minWidth,
277
- boxSize: _boxSize,
278
- py: _py,
279
- px: _px,
280
- p: _p,
281
- hideBelow: _hideBelow,
282
- fontSize: _fontSize,
283
- flexWrap: _flexWrap,
284
- wordBreak: _wordBreak,
285
- lineHeight: _lineHeight,
286
- marginRight: _marginRight,
287
- position: _position,
288
- background: _background,
289
- as: Component = "div",
290
- ...htmlRest
291
- } = props;
292
- const { style: shimStyle } = extractSkeletonStyleProps({
293
- w: _w,
294
- h: _h,
295
- minW: _minW,
296
- maxW: _maxW,
297
- display: _display,
298
- flexGrow: _flexGrow,
299
- flexShrink: _flexShrink,
300
- flexBasis: _flexBasis,
301
- fontWeight: _fontWeight,
302
- textStyle: _textStyle,
303
- borderRadius: _borderRadius,
304
- alignSelf: _alignSelf,
305
- alignItems: _alignItems,
306
- justifyContent: _justifyContent,
307
- color: _color,
308
- mt: _mt,
309
- mb: _mb,
310
- ml: _ml,
311
- mr: _mr,
312
- height: _height,
313
- overflow: _overflow,
314
- whiteSpace: _whiteSpace,
315
- textOverflow: _textOverflow,
316
- textTransform: _textTransform,
317
- gap: _gap,
318
- gridTemplateColumns: _gridTemplateColumns,
319
- minWidth: _minWidth,
320
- boxSize: _boxSize,
321
- py: _py,
322
- px: _px,
323
- p: _p,
324
- hideBelow: _hideBelow,
325
- fontSize: _fontSize,
326
- flexWrap: _flexWrap,
327
- wordBreak: _wordBreak,
328
- lineHeight: _lineHeight,
329
- marginRight: _marginRight,
330
- position: _position,
331
- background: _background
332
- });
221
+ const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
222
+ const shimStyle = shimToStyle(props);
333
223
  const mergedStyle = Object.keys(shimStyle).length > 0 || styleProp ? { ...shimStyle, ...styleProp } : void 0;
334
- const HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
335
- const hideBelowClass = _hideBelow ? HIDE_BELOW_MAP[_hideBelow] : void 0;
336
- const finalClassName = hideBelowClass ? cn(className, hideBelowClass) : className;
224
+ const hideBelowClass = props.hideBelow ? HIDE_BELOW_MAP[props.hideBelow] : void 0;
225
+ const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
226
+ const htmlRest = stripShims(allRest);
337
227
  if (!loading) {
338
- if (asChild && React3__namespace.isValidElement(children)) {
339
- return children;
340
- }
341
- return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: finalClassName, style: mergedStyle, ...htmlRest, children });
228
+ if (asChild && React3__namespace.isValidElement(children)) return children;
229
+ return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
342
230
  }
343
231
  if (asChild && React3__namespace.isValidElement(children)) {
344
232
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -346,13 +234,7 @@ var Skeleton = React3__namespace.forwardRef(
346
234
  {
347
235
  ref,
348
236
  "data-loading": true,
349
- className: cn(
350
- "animate-skeleton-shimmer rounded-sm",
351
- "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
352
- "bg-[length:200%_100%]",
353
- "text-transparent [&_*]:invisible",
354
- finalClassName
355
- ),
237
+ className: cn(SKELETON_CLASSES, "text-transparent [&_*]:invisible", cls),
356
238
  style: mergedStyle,
357
239
  ...htmlRest,
358
240
  children
@@ -364,13 +246,7 @@ var Skeleton = React3__namespace.forwardRef(
364
246
  {
365
247
  ref,
366
248
  "data-loading": true,
367
- className: cn(
368
- "animate-skeleton-shimmer rounded-sm",
369
- "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
370
- "bg-[length:200%_100%]",
371
- children ? "text-transparent [&_*]:invisible" : "min-h-5",
372
- finalClassName
373
- ),
249
+ className: cn(SKELETON_CLASSES, children ? "text-transparent [&_*]:invisible" : "min-h-5", cls),
374
250
  style: mergedStyle,
375
251
  ...htmlRest,
376
252
  children
@@ -422,6 +298,10 @@ function useIsMobile() {
422
298
  }, []);
423
299
  return isMobile;
424
300
  }
301
+ function mapPlacement(p) {
302
+ if (!p) return void 0;
303
+ return p;
304
+ }
425
305
  var Tooltip = React3__namespace.forwardRef(
426
306
  function Tooltip2(props, ref) {
427
307
  const {
@@ -432,10 +312,8 @@ var Tooltip = React3__namespace.forwardRef(
432
312
  children,
433
313
  disabled,
434
314
  disableOnMobile,
435
- portalled = true,
436
315
  content,
437
316
  contentProps,
438
- portalRef,
439
317
  defaultOpen = false,
440
318
  triggerProps,
441
319
  closeDelay = 100,
@@ -483,36 +361,34 @@ var Tooltip = React3__namespace.forwardRef(
483
361
  if (disabled || disableOnMobile && isMobile) return children;
484
362
  const defaultShowArrow = variant === "popover" ? false : true;
485
363
  const showArrow = showArrowProp !== void 0 ? showArrowProp : defaultShowArrow;
486
- const placement = positioning?.placement ?? "top";
487
- const side = placement.split("-")[0];
488
- const align = placement.includes("-") ? placement.split("-")[1] : void 0;
489
- const sideOffset = positioning?.offset?.mainAxis ?? 4;
490
364
  const isPopover = variant === "popover";
491
- return /* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Provider, { delayDuration: openDelay, skipDelayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
492
- RadixTooltip__namespace.Root,
365
+ const placement = mapPlacement(positioning?.placement) ?? "top";
366
+ const offset = positioning?.offset?.mainAxis ?? 4;
367
+ return /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipGroup, { delay: openDelay, children: /* @__PURE__ */ jsxRuntime.jsxs(
368
+ tooltip.Tooltip,
493
369
  {
494
370
  open,
495
371
  onOpenChange: handleOpenChange,
496
- delayDuration: openDelay,
372
+ delay: { open: openDelay, close: closeDelay },
373
+ placement,
374
+ offset,
375
+ unstyled: true,
497
376
  children: [
498
377
  /* @__PURE__ */ jsxRuntime.jsx(
499
- RadixTooltip__namespace.Trigger,
378
+ tooltip.Tooltip.Trigger,
500
379
  {
501
380
  ref: open ? triggerRef : void 0,
502
381
  asChild: true,
503
- onClick: isMobile ? handleTriggerClick : void 0,
382
+ ...isMobile ? { onPress: handleTriggerClick } : {},
504
383
  ...triggerProps,
505
384
  children
506
385
  }
507
386
  ),
508
- /* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Portal, { container: portalled ? portalRef?.current ?? void 0 : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
509
- RadixTooltip__namespace.Content,
387
+ /* @__PURE__ */ jsxRuntime.jsxs(
388
+ tooltip.Tooltip.Content,
510
389
  {
511
390
  ref,
512
- side,
513
- align,
514
- sideOffset,
515
- onClick: interactive ? handleContentClick : void 0,
391
+ unstyled: true,
516
392
  className: cn(
517
393
  "z-[9999] overflow-hidden rounded-lg px-3 py-2 text-sm",
518
394
  "animate-in fade-in-0 zoom-in-95",
@@ -521,12 +397,14 @@ var Tooltip = React3__namespace.forwardRef(
521
397
  !isPopover && "bg-[var(--color-tooltip-bg)] text-[var(--color-tooltip-fg)] max-w-xs",
522
398
  contentProps?.className
523
399
  ),
400
+ onClick: interactive ? handleContentClick : void 0,
524
401
  ...selected ? { "data-selected": true } : {},
525
402
  ...contentProps,
526
403
  children: [
527
404
  showArrow && /* @__PURE__ */ jsxRuntime.jsx(
528
- RadixTooltip__namespace.Arrow,
405
+ tooltip.Tooltip.Arrow,
529
406
  {
407
+ unstyled: true,
530
408
  className: cn(
531
409
  isPopover ? "fill-[var(--color-popover-bg)]" : "fill-[var(--color-tooltip-bg)]"
532
410
  )
@@ -535,7 +413,7 @@ var Tooltip = React3__namespace.forwardRef(
535
413
  content
536
414
  ]
537
415
  }
538
- ) })
416
+ )
539
417
  ]
540
418
  }
541
419
  ) });