@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.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var classVarianceAuthority = require('class-variance-authority');
5
4
  var React3 = require('react');
6
5
  var clsx = require('clsx');
7
6
  var tailwindMerge = require('tailwind-merge');
7
+ var core = require('@hanzogui/core');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
- var RadixTooltip = require('@radix-ui/react-tooltip');
9
+ var tooltip = require('@hanzogui/tooltip');
10
10
  var usehooks = require('@uidotdev/usehooks');
11
11
 
12
12
  function _interopNamespace(e) {
@@ -28,31 +28,53 @@ function _interopNamespace(e) {
28
28
  }
29
29
 
30
30
  var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
31
- var RadixTooltip__namespace = /*#__PURE__*/_interopNamespace(RadixTooltip);
32
31
 
33
32
  // src/tag.tsx
34
33
  function cn(...inputs) {
35
34
  return tailwindMerge.twMerge(clsx.clsx(inputs));
36
35
  }
37
36
  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";
37
+ var CloseButtonFrame = core.styled(core.View, {
38
+ name: "LuxCloseButton",
39
+ render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
40
+ role: "button",
41
+ cursor: "pointer",
42
+ display: "inline-flex",
43
+ alignItems: "center",
44
+ justifyContent: "center",
45
+ width: 20,
46
+ height: 20,
47
+ minWidth: 0,
48
+ flexShrink: 1,
49
+ padding: 0,
50
+ borderRadius: 4,
51
+ borderWidth: 0,
52
+ overflow: "hidden",
53
+ backgroundColor: "transparent",
54
+ hoverStyle: {
55
+ backgroundColor: "transparent"
56
+ },
57
+ variants: {
58
+ disabled: {
59
+ true: {
60
+ opacity: 0.4,
61
+ pointerEvents: "none"
62
+ }
63
+ }
64
+ }
65
+ });
66
+ var CLOSE_BUTTON_CLASSES = [
67
+ "text-[var(--closeButton-fg,currentColor)]",
68
+ "hover:text-[var(--hover-color,currentColor)]",
69
+ "disabled:opacity-40"
70
+ ].join(" ");
38
71
  var CloseButton = React3__namespace.forwardRef(function CloseButton2(props, ref) {
39
72
  const { variant: _variant, size: _size, className, children, ...rest } = props;
40
73
  return /* @__PURE__ */ jsxRuntime.jsx(
41
- "button",
74
+ CloseButtonFrame,
42
75
  {
43
- type: "button",
44
- "aria-label": "Close",
45
76
  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
- ),
77
+ className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
56
78
  ...rest,
57
79
  children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
58
80
  "svg",
@@ -73,272 +95,137 @@ var CloseButton = React3__namespace.forwardRef(function CloseButton2(props, ref)
73
95
  }
74
96
  );
75
97
  });
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`;
98
+ var SHIM_PROPS = [
99
+ "w",
100
+ "h",
101
+ "minW",
102
+ "maxW",
103
+ "display",
104
+ "flexGrow",
105
+ "flexShrink",
106
+ "flexBasis",
107
+ "fontWeight",
108
+ "textStyle",
109
+ "borderRadius",
110
+ "alignSelf",
111
+ "alignItems",
112
+ "justifyContent",
113
+ "color",
114
+ "mt",
115
+ "mb",
116
+ "ml",
117
+ "mr",
118
+ "height",
119
+ "overflow",
120
+ "whiteSpace",
121
+ "textOverflow",
122
+ "textTransform",
123
+ "gap",
124
+ "gridTemplateColumns",
125
+ "minWidth",
126
+ "boxSize",
127
+ "py",
128
+ "px",
129
+ "p",
130
+ "hideBelow",
131
+ "fontSize",
132
+ "flexWrap",
133
+ "wordBreak",
134
+ "lineHeight",
135
+ "marginRight",
136
+ "position",
137
+ "background"
138
+ ];
139
+ var S = 4;
140
+ function dim(v) {
141
+ if (v == null) return void 0;
142
+ if (typeof v === "number") return `${v * S}px`;
143
+ if (typeof v === "string") return v;
144
+ if (typeof v === "object") {
145
+ const o = v;
146
+ return o.base ?? o.lg ?? o.xl ?? Object.values(o)[0];
147
+ }
148
+ return void 0;
81
149
  }
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;
150
+ function sp(v) {
151
+ if (v === void 0) return void 0;
152
+ return typeof v === "number" ? `${v * S}px` : v;
153
+ }
154
+ function shimToStyle(props) {
155
+ const s = {};
156
+ if (props.w !== void 0) s.width = dim(props.w);
157
+ if (props.h !== void 0) s.height = dim(props.h);
158
+ if (props.minW !== void 0) s.minWidth = dim(props.minW);
159
+ if (props.maxW !== void 0) s.maxWidth = dim(props.maxW);
160
+ if (props.display !== void 0) s.display = props.display;
161
+ if (props.flexGrow !== void 0) s.flexGrow = props.flexGrow;
162
+ if (props.flexShrink !== void 0) s.flexShrink = props.flexShrink;
163
+ if (props.flexBasis !== void 0) s.flexBasis = props.flexBasis;
164
+ if (props.fontWeight !== void 0) s.fontWeight = props.fontWeight;
165
+ if (props.borderRadius !== void 0) s.borderRadius = props.borderRadius;
166
+ if (props.alignSelf !== void 0) s.alignSelf = props.alignSelf;
167
+ if (props.alignItems !== void 0) s.alignItems = props.alignItems;
168
+ if (props.justifyContent !== void 0) s.justifyContent = props.justifyContent;
169
+ if (props.color !== void 0) s.color = props.color;
170
+ if (props.mt !== void 0) s.marginTop = sp(props.mt);
171
+ if (props.mb !== void 0) s.marginBottom = sp(props.mb);
172
+ if (props.ml !== void 0) s.marginLeft = sp(props.ml);
173
+ if (props.mr !== void 0) s.marginRight = sp(props.mr);
174
+ if (props.height !== void 0) s.height = props.height;
175
+ if (props.overflow !== void 0) s.overflow = props.overflow;
176
+ if (props.whiteSpace !== void 0) s.whiteSpace = props.whiteSpace;
177
+ if (props.textOverflow !== void 0) s.textOverflow = props.textOverflow;
178
+ if (props.textTransform !== void 0) s.textTransform = props.textTransform;
179
+ if (props.gap !== void 0) s.gap = sp(props.gap);
180
+ if (props.gridTemplateColumns !== void 0) s.gridTemplateColumns = props.gridTemplateColumns;
181
+ if (props.minWidth !== void 0) s.minWidth = props.minWidth;
182
+ if (props.boxSize !== void 0) {
183
+ const v = typeof props.boxSize === "number" ? `${props.boxSize * S}px` : props.boxSize;
184
+ s.width = v;
185
+ s.height = v;
94
186
  }
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
- }
187
+ if (props.py !== void 0) {
188
+ const v = sp(props.py);
189
+ s.paddingTop = v;
190
+ s.paddingBottom = v;
238
191
  }
239
- return { style, rest };
192
+ if (props.px !== void 0) {
193
+ const v = sp(props.px);
194
+ s.paddingLeft = v;
195
+ s.paddingRight = v;
196
+ }
197
+ if (props.p !== void 0) s.padding = sp(props.p);
198
+ if (props.fontSize !== void 0) s.fontSize = props.fontSize;
199
+ if (props.flexWrap !== void 0) s.flexWrap = props.flexWrap;
200
+ if (props.wordBreak !== void 0) s.wordBreak = props.wordBreak;
201
+ if (props.lineHeight !== void 0) s.lineHeight = props.lineHeight;
202
+ if (props.marginRight !== void 0) s.marginRight = props.marginRight;
203
+ if (props.position !== void 0) s.position = props.position;
204
+ if (props.background !== void 0) s.background = props.background;
205
+ return s;
206
+ }
207
+ function stripShims(props) {
208
+ const out = { ...props };
209
+ for (const k of SHIM_PROPS) delete out[k];
210
+ return out;
240
211
  }
212
+ var SKELETON_CLASSES = [
213
+ "animate-skeleton-shimmer rounded-sm",
214
+ "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
215
+ "bg-[length:200%_100%]"
216
+ ].join(" ");
217
+ var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
241
218
  var Skeleton = React3__namespace.forwardRef(
242
219
  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
- });
220
+ const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
221
+ const shimStyle = shimToStyle(props);
333
222
  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;
223
+ const hideBelowClass = props.hideBelow ? HIDE_BELOW_MAP[props.hideBelow] : void 0;
224
+ const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
225
+ const htmlRest = stripShims(allRest);
337
226
  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 });
227
+ if (asChild && React3__namespace.isValidElement(children)) return children;
228
+ return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
342
229
  }
343
230
  if (asChild && React3__namespace.isValidElement(children)) {
344
231
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -346,13 +233,7 @@ var Skeleton = React3__namespace.forwardRef(
346
233
  {
347
234
  ref,
348
235
  "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
- ),
236
+ className: cn(SKELETON_CLASSES, "text-transparent [&_*]:invisible", cls),
356
237
  style: mergedStyle,
357
238
  ...htmlRest,
358
239
  children
@@ -364,13 +245,7 @@ var Skeleton = React3__namespace.forwardRef(
364
245
  {
365
246
  ref,
366
247
  "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
- ),
248
+ className: cn(SKELETON_CLASSES, children ? "text-transparent [&_*]:invisible" : "min-h-5", cls),
374
249
  style: mergedStyle,
375
250
  ...htmlRest,
376
251
  children
@@ -422,6 +297,10 @@ function useIsMobile() {
422
297
  }, []);
423
298
  return isMobile;
424
299
  }
300
+ function mapPlacement(p) {
301
+ if (!p) return void 0;
302
+ return p;
303
+ }
425
304
  var Tooltip = React3__namespace.forwardRef(
426
305
  function Tooltip2(props, ref) {
427
306
  const {
@@ -432,10 +311,8 @@ var Tooltip = React3__namespace.forwardRef(
432
311
  children,
433
312
  disabled,
434
313
  disableOnMobile,
435
- portalled = true,
436
314
  content,
437
315
  contentProps,
438
- portalRef,
439
316
  defaultOpen = false,
440
317
  triggerProps,
441
318
  closeDelay = 100,
@@ -483,36 +360,34 @@ var Tooltip = React3__namespace.forwardRef(
483
360
  if (disabled || disableOnMobile && isMobile) return children;
484
361
  const defaultShowArrow = variant === "popover" ? false : true;
485
362
  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
363
  const isPopover = variant === "popover";
491
- return /* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Provider, { delayDuration: openDelay, skipDelayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
492
- RadixTooltip__namespace.Root,
364
+ const placement = mapPlacement(positioning?.placement) ?? "top";
365
+ const offset = positioning?.offset?.mainAxis ?? 4;
366
+ return /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipGroup, { delay: openDelay, children: /* @__PURE__ */ jsxRuntime.jsxs(
367
+ tooltip.Tooltip,
493
368
  {
494
369
  open,
495
370
  onOpenChange: handleOpenChange,
496
- delayDuration: openDelay,
371
+ delay: { open: openDelay, close: closeDelay },
372
+ placement,
373
+ offset,
374
+ unstyled: true,
497
375
  children: [
498
376
  /* @__PURE__ */ jsxRuntime.jsx(
499
- RadixTooltip__namespace.Trigger,
377
+ tooltip.Tooltip.Trigger,
500
378
  {
501
379
  ref: open ? triggerRef : void 0,
502
380
  asChild: true,
503
- onClick: isMobile ? handleTriggerClick : void 0,
381
+ ...isMobile ? { onPress: handleTriggerClick } : {},
504
382
  ...triggerProps,
505
383
  children
506
384
  }
507
385
  ),
508
- /* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Portal, { container: portalled ? portalRef?.current ?? void 0 : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
509
- RadixTooltip__namespace.Content,
386
+ /* @__PURE__ */ jsxRuntime.jsxs(
387
+ tooltip.Tooltip.Content,
510
388
  {
511
389
  ref,
512
- side,
513
- align,
514
- sideOffset,
515
- onClick: interactive ? handleContentClick : void 0,
390
+ unstyled: true,
516
391
  className: cn(
517
392
  "z-[9999] overflow-hidden rounded-lg px-3 py-2 text-sm",
518
393
  "animate-in fade-in-0 zoom-in-95",
@@ -521,12 +396,14 @@ var Tooltip = React3__namespace.forwardRef(
521
396
  !isPopover && "bg-[var(--color-tooltip-bg)] text-[var(--color-tooltip-fg)] max-w-xs",
522
397
  contentProps?.className
523
398
  ),
399
+ onClick: interactive ? handleContentClick : void 0,
524
400
  ...selected ? { "data-selected": true } : {},
525
401
  ...contentProps,
526
402
  children: [
527
403
  showArrow && /* @__PURE__ */ jsxRuntime.jsx(
528
- RadixTooltip__namespace.Arrow,
404
+ tooltip.Tooltip.Arrow,
529
405
  {
406
+ unstyled: true,
530
407
  className: cn(
531
408
  isPopover ? "fill-[var(--color-popover-bg)]" : "fill-[var(--color-tooltip-bg)]"
532
409
  )
@@ -535,7 +412,7 @@ var Tooltip = React3__namespace.forwardRef(
535
412
  content
536
413
  ]
537
414
  }
538
- ) })
415
+ )
539
416
  ]
540
417
  }
541
418
  ) });
@@ -545,39 +422,18 @@ var nbsp = String.fromCharCode(160);
545
422
  function TruncatedTextTooltip({ label, children }) {
546
423
  return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
547
424
  }
548
- var tagVariants = classVarianceAuthority.cva(
549
- [
550
- "inline-flex items-center align-top max-w-full select-text rounded-sm",
551
- "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-500"
552
- ].join(" "),
553
- {
554
- variants: {
555
- variant: {
556
- subtle: "bg-[var(--color-tag-subtle-bg)] text-[var(--color-tag-subtle-fg)]",
557
- clickable: [
558
- "cursor-pointer",
559
- "bg-[var(--color-tag-clickable-bg)] text-[var(--color-tag-clickable-fg)]",
560
- "hover:opacity-76"
561
- ].join(" "),
562
- filter: "bg-[var(--color-tag-filter-bg)]",
563
- select: [
564
- "cursor-pointer",
565
- "bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)]",
566
- "hover:text-[var(--color-hover)] hover:opacity-76"
567
- ].join(" ")
568
- },
569
- size: {
570
- sm: "px-1 py-0.5 min-h-5 gap-1 text-xs",
571
- md: "px-1 py-0.5 min-h-6 gap-1 text-sm",
572
- lg: "px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm"
573
- }
574
- },
575
- defaultVariants: {
576
- variant: "subtle",
577
- size: "md"
578
- }
579
- }
580
- );
425
+ 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";
426
+ var TAG_VARIANT_CLASSES = {
427
+ subtle: "bg-[var(--color-tag-subtle-bg)] text-[var(--color-tag-subtle-fg)]",
428
+ clickable: "cursor-pointer bg-[var(--color-tag-clickable-bg)] text-[var(--color-tag-clickable-fg)] hover:opacity-76",
429
+ filter: "bg-[var(--color-tag-filter-bg)]",
430
+ select: "cursor-pointer bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)] hover:text-[var(--color-hover)] hover:opacity-76"
431
+ };
432
+ var TAG_SIZE_CLASSES = {
433
+ sm: "px-1 py-0.5 min-h-5 gap-1 text-xs",
434
+ md: "px-1 py-0.5 min-h-6 gap-1 text-sm",
435
+ lg: "px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm"
436
+ };
581
437
  var TAG_SELECTED_CLASSES = [
582
438
  "bg-[var(--color-tag-select-selected-bg)]",
583
439
  "text-[var(--color-tag-select-selected-fg)]",
@@ -619,7 +475,9 @@ var Tag = React3__namespace.forwardRef(
619
475
  {
620
476
  ref,
621
477
  className: cn(
622
- tagVariants({ variant, size }),
478
+ TAG_BASE,
479
+ TAG_VARIANT_CLASSES[variant ?? "subtle"],
480
+ TAG_SIZE_CLASSES[size ?? "md"],
623
481
  selected && !loading && TAG_SELECTED_CLASSES,
624
482
  disabled && TAG_DISABLED_CLASSES,
625
483
  className