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