@luxfi/ui 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/accordion.cjs +213 -0
  2. package/dist/accordion.js +186 -0
  3. package/dist/alert.cjs +553 -0
  4. package/dist/alert.js +531 -0
  5. package/dist/avatar.cjs +149 -0
  6. package/dist/avatar.js +125 -0
  7. package/dist/badge.cjs +611 -0
  8. package/dist/badge.js +589 -0
  9. package/dist/button.cjs +689 -0
  10. package/dist/button.js +664 -0
  11. package/dist/checkbox.cjs +265 -0
  12. package/dist/checkbox.js +241 -0
  13. package/dist/close-button.cjs +73 -0
  14. package/dist/close-button.js +51 -0
  15. package/dist/collapsible.cjs +711 -0
  16. package/dist/collapsible.js +685 -0
  17. package/dist/color-mode.cjs +36 -0
  18. package/dist/color-mode.js +32 -0
  19. package/dist/dialog.cjs +279 -0
  20. package/dist/dialog.js +246 -0
  21. package/dist/drawer.cjs +207 -0
  22. package/dist/drawer.js +175 -0
  23. package/dist/empty-state.cjs +93 -0
  24. package/dist/empty-state.js +71 -0
  25. package/dist/field.cjs +183 -0
  26. package/dist/field.js +160 -0
  27. package/dist/heading.cjs +46 -0
  28. package/dist/heading.js +40 -0
  29. package/dist/icon-button.cjs +491 -0
  30. package/dist/icon-button.js +470 -0
  31. package/dist/image.cjs +572 -0
  32. package/dist/image.js +551 -0
  33. package/dist/index.cjs +5749 -0
  34. package/dist/index.js +5586 -0
  35. package/dist/input-group.cjs +155 -0
  36. package/dist/input-group.js +133 -0
  37. package/dist/input.cjs +65 -0
  38. package/dist/input.js +59 -0
  39. package/dist/link.cjs +639 -0
  40. package/dist/link.js +612 -0
  41. package/dist/menu.cjs +305 -0
  42. package/dist/menu.js +269 -0
  43. package/dist/pin-input.cjs +182 -0
  44. package/dist/pin-input.js +160 -0
  45. package/dist/popover.cjs +327 -0
  46. package/dist/popover.js +294 -0
  47. package/dist/progress-circle.cjs +152 -0
  48. package/dist/progress-circle.js +128 -0
  49. package/dist/progress.cjs +117 -0
  50. package/dist/progress.js +94 -0
  51. package/dist/provider.cjs +22 -0
  52. package/dist/provider.js +20 -0
  53. package/dist/radio.cjs +177 -0
  54. package/dist/radio.js +153 -0
  55. package/dist/rating.cjs +80 -0
  56. package/dist/rating.js +58 -0
  57. package/dist/select.cjs +791 -0
  58. package/dist/select.js +757 -0
  59. package/dist/separator.cjs +57 -0
  60. package/dist/separator.js +51 -0
  61. package/dist/skeleton.cjs +370 -0
  62. package/dist/skeleton.js +346 -0
  63. package/dist/slider.cjs +138 -0
  64. package/dist/slider.js +115 -0
  65. package/dist/switch.cjs +163 -0
  66. package/dist/switch.js +140 -0
  67. package/dist/table.cjs +1053 -0
  68. package/dist/table.js +1019 -0
  69. package/dist/tabs.cjs +240 -0
  70. package/dist/tabs.js +213 -0
  71. package/dist/tag.cjs +651 -0
  72. package/dist/tag.js +628 -0
  73. package/dist/textarea.cjs +65 -0
  74. package/dist/textarea.js +59 -0
  75. package/dist/toaster.cjs +99 -0
  76. package/dist/toaster.js +96 -0
  77. package/dist/tooltip.cjs +171 -0
  78. package/dist/tooltip.js +148 -0
  79. package/dist/utils.cjs +11 -0
  80. package/dist/utils.js +9 -0
  81. package/package.json +296 -0
  82. package/src/accordion.tsx +285 -0
  83. package/src/alert.tsx +221 -0
  84. package/src/avatar.tsx +174 -0
  85. package/src/badge.tsx +158 -0
  86. package/src/button.tsx +411 -0
  87. package/src/checkbox.tsx +307 -0
  88. package/src/close-button.tsx +51 -0
  89. package/src/collapsible.tsx +126 -0
  90. package/src/color-mode.tsx +37 -0
  91. package/src/dialog.tsx +356 -0
  92. package/src/drawer.tsx +186 -0
  93. package/src/empty-state.tsx +97 -0
  94. package/src/field.tsx +202 -0
  95. package/src/heading.tsx +55 -0
  96. package/src/icon-button.tsx +192 -0
  97. package/src/image.tsx +280 -0
  98. package/src/index.ts +192 -0
  99. package/src/input-group.tsx +159 -0
  100. package/src/input.tsx +60 -0
  101. package/src/link.tsx +333 -0
  102. package/src/menu.tsx +471 -0
  103. package/src/pin-input.tsx +187 -0
  104. package/src/popover.tsx +400 -0
  105. package/src/progress-circle.tsx +180 -0
  106. package/src/progress.tsx +109 -0
  107. package/src/provider.tsx +12 -0
  108. package/src/radio.tsx +175 -0
  109. package/src/rating.tsx +79 -0
  110. package/src/select.tsx +696 -0
  111. package/src/separator.tsx +59 -0
  112. package/src/skeleton.tsx +302 -0
  113. package/src/slider.tsx +152 -0
  114. package/src/switch.tsx +158 -0
  115. package/src/table.tsx +621 -0
  116. package/src/tabs.tsx +354 -0
  117. package/src/tag.tsx +159 -0
  118. package/src/textarea.tsx +60 -0
  119. package/src/toaster.tsx +117 -0
  120. package/src/tokens.css +438 -0
  121. package/src/tooltip.tsx +184 -0
  122. package/src/utils/cn.ts +7 -0
  123. package/src/utils.ts +6 -0
  124. package/tokens.css +438 -0
package/dist/link.cjs ADDED
@@ -0,0 +1,639 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var NextLink = require('next/link');
5
+ var React = require('react');
6
+ var clsx = require('clsx');
7
+ var tailwindMerge = require('tailwind-merge');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ function _interopNamespace(e) {
13
+ if (e && e.__esModule) return e;
14
+ var n = Object.create(null);
15
+ if (e) {
16
+ Object.keys(e).forEach(function (k) {
17
+ if (k !== 'default') {
18
+ var d = Object.getOwnPropertyDescriptor(e, k);
19
+ Object.defineProperty(n, k, d.get ? d : {
20
+ enumerable: true,
21
+ get: function () { return e[k]; }
22
+ });
23
+ }
24
+ });
25
+ }
26
+ n.default = e;
27
+ return Object.freeze(n);
28
+ }
29
+
30
+ var NextLink__default = /*#__PURE__*/_interopDefault(NextLink);
31
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
32
+
33
+ // src/link.tsx
34
+ function cn(...inputs) {
35
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
36
+ }
37
+ var SPACING_SCALE = 4;
38
+ function toStylePx(value) {
39
+ if (value === void 0) return void 0;
40
+ if (typeof value === "string") return value;
41
+ return `${value * SPACING_SCALE}px`;
42
+ }
43
+ function extractSkeletonStyleProps(props) {
44
+ const style = {};
45
+ const rest = {};
46
+ function resolveDimension(value) {
47
+ if (value === void 0 || value === null) return void 0;
48
+ if (typeof value === "number") return `${value * SPACING_SCALE}px`;
49
+ if (typeof value === "string") return value;
50
+ if (typeof value === "object") {
51
+ const obj = value;
52
+ return obj.base ?? obj.lg ?? obj.xl ?? Object.values(obj)[0];
53
+ }
54
+ return void 0;
55
+ }
56
+ for (const [key, value] of Object.entries(props)) {
57
+ if (value === void 0) continue;
58
+ switch (key) {
59
+ case "w": {
60
+ const v = resolveDimension(value);
61
+ if (v) style.width = v;
62
+ break;
63
+ }
64
+ case "h": {
65
+ const v = resolveDimension(value);
66
+ if (v) style.height = v;
67
+ break;
68
+ }
69
+ case "minW": {
70
+ const v = resolveDimension(value);
71
+ if (v) style.minWidth = v;
72
+ break;
73
+ }
74
+ case "maxW": {
75
+ const v = resolveDimension(value);
76
+ if (v) style.maxWidth = v;
77
+ break;
78
+ }
79
+ case "height":
80
+ style.height = value;
81
+ break;
82
+ case "display":
83
+ style.display = value;
84
+ break;
85
+ case "flexGrow":
86
+ style.flexGrow = value;
87
+ break;
88
+ case "flexShrink":
89
+ style.flexShrink = value;
90
+ break;
91
+ case "flexBasis":
92
+ style.flexBasis = value;
93
+ break;
94
+ case "fontWeight":
95
+ style.fontWeight = value;
96
+ break;
97
+ case "borderRadius":
98
+ style.borderRadius = value;
99
+ break;
100
+ case "alignSelf":
101
+ style.alignSelf = value;
102
+ break;
103
+ case "alignItems":
104
+ style.alignItems = value;
105
+ break;
106
+ case "justifyContent":
107
+ style.justifyContent = value;
108
+ break;
109
+ case "color":
110
+ style.color = value;
111
+ break;
112
+ case "mt":
113
+ style.marginTop = toStylePx(value);
114
+ break;
115
+ case "mb":
116
+ style.marginBottom = toStylePx(value);
117
+ break;
118
+ case "ml":
119
+ style.marginLeft = toStylePx(value);
120
+ break;
121
+ case "mr":
122
+ style.marginRight = toStylePx(value);
123
+ break;
124
+ case "overflow":
125
+ style.overflow = value;
126
+ break;
127
+ case "whiteSpace":
128
+ style.whiteSpace = value;
129
+ break;
130
+ case "textOverflow":
131
+ style.textOverflow = value;
132
+ break;
133
+ case "textTransform":
134
+ style.textTransform = value;
135
+ break;
136
+ case "gap":
137
+ style.gap = typeof value === "number" ? `${value * SPACING_SCALE}px` : value;
138
+ break;
139
+ case "gridTemplateColumns":
140
+ style.gridTemplateColumns = value;
141
+ break;
142
+ case "minWidth":
143
+ style.minWidth = value;
144
+ break;
145
+ case "boxSize": {
146
+ const s = typeof value === "number" ? `${value * SPACING_SCALE}px` : value;
147
+ style.width = s;
148
+ style.height = s;
149
+ break;
150
+ }
151
+ case "py": {
152
+ const v = toStylePx(value);
153
+ style.paddingTop = v;
154
+ style.paddingBottom = v;
155
+ break;
156
+ }
157
+ case "px": {
158
+ const v = toStylePx(value);
159
+ style.paddingLeft = v;
160
+ style.paddingRight = v;
161
+ break;
162
+ }
163
+ case "p": {
164
+ const v = toStylePx(value);
165
+ style.padding = v;
166
+ break;
167
+ }
168
+ case "hideBelow":
169
+ break;
170
+ // handled via className
171
+ case "textStyle":
172
+ break;
173
+ // drop textStyle, not directly applicable
174
+ case "fontSize":
175
+ style.fontSize = value;
176
+ break;
177
+ case "flexWrap":
178
+ style.flexWrap = value;
179
+ break;
180
+ case "wordBreak":
181
+ style.wordBreak = value;
182
+ break;
183
+ case "lineHeight":
184
+ style.lineHeight = value;
185
+ break;
186
+ case "marginRight":
187
+ style.marginRight = value;
188
+ break;
189
+ case "position":
190
+ style.position = value;
191
+ break;
192
+ case "background":
193
+ style.background = value;
194
+ break;
195
+ default:
196
+ rest[key] = value;
197
+ break;
198
+ }
199
+ }
200
+ return { style, rest };
201
+ }
202
+ var Skeleton = React__namespace.forwardRef(
203
+ function Skeleton2(props, ref) {
204
+ const {
205
+ loading = false,
206
+ asChild,
207
+ className,
208
+ children,
209
+ style: styleProp,
210
+ // Destructure style-prop shims so they don't leak into DOM
211
+ w: _w,
212
+ h: _h,
213
+ minW: _minW,
214
+ maxW: _maxW,
215
+ display: _display,
216
+ flexGrow: _flexGrow,
217
+ flexShrink: _flexShrink,
218
+ flexBasis: _flexBasis,
219
+ fontWeight: _fontWeight,
220
+ textStyle: _textStyle,
221
+ borderRadius: _borderRadius,
222
+ alignSelf: _alignSelf,
223
+ alignItems: _alignItems,
224
+ justifyContent: _justifyContent,
225
+ color: _color,
226
+ mt: _mt,
227
+ mb: _mb,
228
+ ml: _ml,
229
+ mr: _mr,
230
+ height: _height,
231
+ overflow: _overflow,
232
+ whiteSpace: _whiteSpace,
233
+ textOverflow: _textOverflow,
234
+ textTransform: _textTransform,
235
+ gap: _gap,
236
+ gridTemplateColumns: _gridTemplateColumns,
237
+ minWidth: _minWidth,
238
+ boxSize: _boxSize,
239
+ py: _py,
240
+ px: _px,
241
+ p: _p,
242
+ hideBelow: _hideBelow,
243
+ fontSize: _fontSize,
244
+ flexWrap: _flexWrap,
245
+ wordBreak: _wordBreak,
246
+ lineHeight: _lineHeight,
247
+ marginRight: _marginRight,
248
+ position: _position,
249
+ background: _background,
250
+ as: Component = "div",
251
+ ...htmlRest
252
+ } = props;
253
+ const { style: shimStyle } = extractSkeletonStyleProps({
254
+ w: _w,
255
+ h: _h,
256
+ minW: _minW,
257
+ maxW: _maxW,
258
+ display: _display,
259
+ flexGrow: _flexGrow,
260
+ flexShrink: _flexShrink,
261
+ flexBasis: _flexBasis,
262
+ fontWeight: _fontWeight,
263
+ textStyle: _textStyle,
264
+ borderRadius: _borderRadius,
265
+ alignSelf: _alignSelf,
266
+ alignItems: _alignItems,
267
+ justifyContent: _justifyContent,
268
+ color: _color,
269
+ mt: _mt,
270
+ mb: _mb,
271
+ ml: _ml,
272
+ mr: _mr,
273
+ height: _height,
274
+ overflow: _overflow,
275
+ whiteSpace: _whiteSpace,
276
+ textOverflow: _textOverflow,
277
+ textTransform: _textTransform,
278
+ gap: _gap,
279
+ gridTemplateColumns: _gridTemplateColumns,
280
+ minWidth: _minWidth,
281
+ boxSize: _boxSize,
282
+ py: _py,
283
+ px: _px,
284
+ p: _p,
285
+ hideBelow: _hideBelow,
286
+ fontSize: _fontSize,
287
+ flexWrap: _flexWrap,
288
+ wordBreak: _wordBreak,
289
+ lineHeight: _lineHeight,
290
+ marginRight: _marginRight,
291
+ position: _position,
292
+ background: _background
293
+ });
294
+ const mergedStyle = Object.keys(shimStyle).length > 0 || styleProp ? { ...shimStyle, ...styleProp } : void 0;
295
+ const HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
296
+ const hideBelowClass = _hideBelow ? HIDE_BELOW_MAP[_hideBelow] : void 0;
297
+ const finalClassName = hideBelowClass ? cn(className, hideBelowClass) : className;
298
+ if (!loading) {
299
+ if (asChild && React__namespace.isValidElement(children)) {
300
+ return children;
301
+ }
302
+ return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: finalClassName, style: mergedStyle, ...htmlRest, children });
303
+ }
304
+ if (asChild && React__namespace.isValidElement(children)) {
305
+ return /* @__PURE__ */ jsxRuntime.jsx(
306
+ Component,
307
+ {
308
+ ref,
309
+ "data-loading": true,
310
+ className: cn(
311
+ "animate-skeleton-shimmer rounded-sm",
312
+ "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
313
+ "bg-[length:200%_100%]",
314
+ "text-transparent [&_*]:invisible",
315
+ finalClassName
316
+ ),
317
+ style: mergedStyle,
318
+ ...htmlRest,
319
+ children
320
+ }
321
+ );
322
+ }
323
+ return /* @__PURE__ */ jsxRuntime.jsx(
324
+ Component,
325
+ {
326
+ ref,
327
+ "data-loading": true,
328
+ className: cn(
329
+ "animate-skeleton-shimmer rounded-sm",
330
+ "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
331
+ "bg-[length:200%_100%]",
332
+ children ? "text-transparent [&_*]:invisible" : "min-h-5",
333
+ finalClassName
334
+ ),
335
+ style: mergedStyle,
336
+ ...htmlRest,
337
+ children
338
+ }
339
+ );
340
+ }
341
+ );
342
+ React__namespace.forwardRef(
343
+ function SkeletonCircle2(props, ref) {
344
+ const { size = 40, loading = true, className, ...rest } = props;
345
+ const dimension = typeof size === "number" ? `${size}px` : size;
346
+ return /* @__PURE__ */ jsxRuntime.jsx(
347
+ Skeleton,
348
+ {
349
+ ref,
350
+ loading,
351
+ className: cn("rounded-full shrink-0", className),
352
+ style: { width: dimension, height: dimension, ...rest.style },
353
+ ...rest
354
+ }
355
+ );
356
+ }
357
+ );
358
+ React__namespace.forwardRef(
359
+ function SkeletonText2(props, ref) {
360
+ const { noOfLines = 3, loading = true, className, ...rest } = props;
361
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
362
+ Skeleton,
363
+ {
364
+ loading,
365
+ className: cn("h-4", index === noOfLines - 1 && "max-w-[80%]")
366
+ },
367
+ index
368
+ )) });
369
+ }
370
+ );
371
+ var ArrowIcon = ({ className, style }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, style, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11 3h6v6M17 3L7 13M14 11v6H3V6h6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
372
+ function stripUtmParams(url) {
373
+ try {
374
+ const urlObj = new URL(url);
375
+ for (const param of ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"]) {
376
+ urlObj.searchParams.delete(param);
377
+ }
378
+ return urlObj.toString();
379
+ } catch {
380
+ return url;
381
+ }
382
+ }
383
+ var VARIANT_CLASSES = {
384
+ primary: cn(
385
+ "text-[var(--color-link-primary)]",
386
+ "hover:no-underline hover:text-[var(--color-link-primary-hover)]",
387
+ "data-[hover]:no-underline data-[hover]:text-[var(--color-link-primary-hover)]"
388
+ ),
389
+ secondary: cn(
390
+ "text-[var(--color-link-secondary)]",
391
+ "hover:no-underline hover:text-[var(--color-hover)]",
392
+ "data-[hover]:no-underline data-[hover]:text-[var(--color-hover)]"
393
+ ),
394
+ subtle: cn(
395
+ "text-[var(--color-link-subtle)]",
396
+ "hover:text-[var(--color-link-subtle-hover)] hover:underline hover:decoration-[var(--color-link-subtle-hover)]",
397
+ "data-[hover]:text-[var(--color-link-subtle-hover)] data-[hover]:underline data-[hover]:decoration-[var(--color-link-subtle-hover)]"
398
+ ),
399
+ underlaid: cn(
400
+ "text-[var(--color-link-primary)] bg-[var(--color-link-underlaid-bg)]",
401
+ "px-2 py-1.5 rounded-md text-sm",
402
+ "hover:text-[var(--color-link-primary-hover)] hover:no-underline",
403
+ "data-[hover]:text-[var(--color-link-primary-hover)] data-[hover]:no-underline"
404
+ ),
405
+ menu: cn(
406
+ "text-[var(--color-link-menu)]",
407
+ "hover:text-[var(--color-hover)] hover:no-underline",
408
+ "data-[hover]:text-[var(--color-hover)] data-[hover]:no-underline"
409
+ ),
410
+ navigation: cn(
411
+ "text-[var(--color-link-nav-fg)] bg-transparent",
412
+ "hover:text-[var(--color-link-nav-fg-hover)] hover:no-underline",
413
+ "data-[hover]:text-[var(--color-link-nav-fg-hover)] data-[hover]:no-underline",
414
+ "data-[selected]:text-[var(--color-link-nav-fg-selected)] data-[selected]:bg-[var(--color-link-nav-bg-selected)]",
415
+ "data-[active]:text-[var(--color-link-nav-fg-active)]"
416
+ ),
417
+ plain: cn(
418
+ "text-inherit",
419
+ "hover:no-underline",
420
+ "data-[hover]:no-underline"
421
+ )
422
+ };
423
+ var BASE_CLASSES = "inline-flex items-center gap-0 cursor-pointer data-[disabled]:cursor-not-allowed";
424
+ var LinkExternalIcon = ({ color }) => /* @__PURE__ */ jsxRuntime.jsx(
425
+ ArrowIcon,
426
+ {
427
+ className: cn(
428
+ "size-3 align-middle shrink-0",
429
+ "group-hover:text-inherit"
430
+ ),
431
+ style: color ? { color } : { color: "var(--color-icon-secondary)" },
432
+ "aria-hidden": "true"
433
+ }
434
+ );
435
+ var splitProps = (props) => {
436
+ const { scroll = true, shallow = false, prefetch = false, ...rest } = props;
437
+ return {
438
+ own: rest,
439
+ next: {
440
+ href: rest.href ?? "",
441
+ scroll,
442
+ shallow,
443
+ prefetch
444
+ }
445
+ };
446
+ };
447
+ var SPACING = 4;
448
+ function resolveSpacing(v) {
449
+ if (v === void 0) return void 0;
450
+ if (typeof v === "number") return `${v * SPACING}px`;
451
+ if (typeof v === "string") return v;
452
+ if (typeof v === "object" && v !== null) {
453
+ const base = v.base;
454
+ if (base !== void 0) return typeof base === "number" ? `${base * SPACING}px` : base;
455
+ const lg = v.lg;
456
+ if (lg !== void 0) return typeof lg === "number" ? `${lg * SPACING}px` : lg;
457
+ }
458
+ return void 0;
459
+ }
460
+ var Link = React__namespace.default.forwardRef(
461
+ function Link2(props, ref) {
462
+ const { own, next } = splitProps(props);
463
+ const {
464
+ external,
465
+ loading,
466
+ href,
467
+ children,
468
+ disabled,
469
+ noIcon,
470
+ iconColor,
471
+ variant = "primary",
472
+ className,
473
+ asChild: _asChild,
474
+ // Strip Chakra style props
475
+ fontWeight: _fontWeight,
476
+ whiteSpace: _whiteSpace,
477
+ wordBreak: _wordBreak,
478
+ textStyle: _textStyle,
479
+ ml: _ml,
480
+ mr: _mr,
481
+ display: _display,
482
+ alignItems: _alignItems,
483
+ flexShrink: _flexShrink,
484
+ minW: _minW,
485
+ justifyContent: _justifyContent,
486
+ position: _position,
487
+ ...rest
488
+ } = own;
489
+ const shimStyle = {};
490
+ if (_fontWeight !== void 0) shimStyle.fontWeight = _fontWeight;
491
+ if (_whiteSpace) shimStyle.whiteSpace = _whiteSpace;
492
+ if (_wordBreak) shimStyle.wordBreak = _wordBreak;
493
+ if (_ml !== void 0) shimStyle.marginLeft = resolveSpacing(_ml);
494
+ if (_mr !== void 0) shimStyle.marginRight = resolveSpacing(_mr);
495
+ if (_display) shimStyle.display = _display;
496
+ if (_alignItems) shimStyle.alignItems = _alignItems;
497
+ if (_flexShrink !== void 0) shimStyle.flexShrink = _flexShrink;
498
+ if (_minW !== void 0) shimStyle.minWidth = typeof _minW === "number" ? `${_minW * SPACING}px` : _minW;
499
+ if (_justifyContent) shimStyle.justifyContent = _justifyContent;
500
+ if (_position) shimStyle.position = _position;
501
+ const linkClasses = cn(BASE_CLASSES, VARIANT_CLASSES[variant], className);
502
+ const linkStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
503
+ if (external) {
504
+ const processedHref = typeof href === "string" ? stripUtmParams(href) : href;
505
+ return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, ref, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
506
+ "a",
507
+ {
508
+ href: processedHref,
509
+ className: cn("group", linkClasses),
510
+ style: linkStyle,
511
+ target: "_blank",
512
+ rel: "noopener noreferrer",
513
+ ...disabled ? { "data-disabled": true } : {},
514
+ ...rest,
515
+ children: [
516
+ children,
517
+ !noIcon && /* @__PURE__ */ jsxRuntime.jsx(LinkExternalIcon, { color: iconColor })
518
+ ]
519
+ }
520
+ ) });
521
+ }
522
+ return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, ref, asChild: true, children: next.href ? /* @__PURE__ */ jsxRuntime.jsx(
523
+ NextLink__default.default,
524
+ {
525
+ ...next,
526
+ className: linkClasses,
527
+ style: linkStyle,
528
+ ...disabled ? { "data-disabled": true } : {},
529
+ ...rest,
530
+ children
531
+ }
532
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
533
+ "span",
534
+ {
535
+ className: linkClasses,
536
+ ...disabled ? { "data-disabled": true } : {},
537
+ ...rest,
538
+ children
539
+ }
540
+ ) });
541
+ }
542
+ );
543
+ var LinkBox = React__namespace.default.forwardRef(
544
+ function LinkBox2(props, ref) {
545
+ const { className, ...rest } = props;
546
+ return /* @__PURE__ */ jsxRuntime.jsx(
547
+ "div",
548
+ {
549
+ ref,
550
+ className: cn("relative", className),
551
+ ...rest
552
+ }
553
+ );
554
+ }
555
+ );
556
+ var LinkOverlay = React__namespace.default.forwardRef(
557
+ function LinkOverlay2(props, ref) {
558
+ const { own, next } = splitProps(props);
559
+ const {
560
+ children,
561
+ external,
562
+ loading,
563
+ href,
564
+ noIcon,
565
+ iconColor,
566
+ variant = "primary",
567
+ className,
568
+ disabled,
569
+ asChild: _asChild2,
570
+ fontWeight: _fw2,
571
+ whiteSpace: _ws2,
572
+ wordBreak: _wb2,
573
+ textStyle: _ts2,
574
+ ml: _ml2,
575
+ mr: _mr2,
576
+ display: _d2,
577
+ alignItems: _ai2,
578
+ flexShrink: _fs2,
579
+ minW: _mw2,
580
+ justifyContent: _jc2,
581
+ position: _p2,
582
+ ...rest
583
+ } = own;
584
+ const overlayClasses = cn(
585
+ BASE_CLASSES,
586
+ VARIANT_CLASSES[variant],
587
+ // Static positioning with a ::before pseudo-element that covers the LinkBox
588
+ "static",
589
+ 'before:absolute before:inset-0 before:z-0 before:content-[""]',
590
+ className
591
+ );
592
+ if (external) {
593
+ const processedHref = typeof href === "string" ? stripUtmParams(href) : href;
594
+ return /* @__PURE__ */ jsxRuntime.jsx(
595
+ "a",
596
+ {
597
+ ref,
598
+ href: loading ? void 0 : processedHref,
599
+ className: overlayClasses,
600
+ target: "_blank",
601
+ rel: "noopener noreferrer",
602
+ ...rest,
603
+ children: (children || !noIcon && href) && /* @__PURE__ */ jsxRuntime.jsxs(Skeleton, { display: "inline-flex", alignItems: "center", loading, maxW: "100%", h: "100%", children: [
604
+ children,
605
+ !noIcon && href && /* @__PURE__ */ jsxRuntime.jsx(LinkExternalIcon, { color: iconColor })
606
+ ] })
607
+ }
608
+ );
609
+ }
610
+ const content = children ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { display: "inline-flex", alignItems: "center", loading, maxW: "100%", h: "100%", children }) : null;
611
+ if (next.href) {
612
+ const anchorRest = rest;
613
+ return /* @__PURE__ */ jsxRuntime.jsx(
614
+ NextLink__default.default,
615
+ {
616
+ ref,
617
+ ...next,
618
+ className: overlayClasses,
619
+ ...anchorRest,
620
+ children: content
621
+ }
622
+ );
623
+ }
624
+ return /* @__PURE__ */ jsxRuntime.jsx(
625
+ "span",
626
+ {
627
+ ref,
628
+ className: overlayClasses,
629
+ ...rest,
630
+ children: content
631
+ }
632
+ );
633
+ }
634
+ );
635
+
636
+ exports.Link = Link;
637
+ exports.LinkBox = LinkBox;
638
+ exports.LinkExternalIcon = LinkExternalIcon;
639
+ exports.LinkOverlay = LinkOverlay;