@luxfi/ui 5.5.3 → 5.6.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 (244) 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 +702 -0
  16. package/dist/collapsible.js +679 -0
  17. package/dist/color-mode.cjs +96 -0
  18. package/dist/color-mode.js +72 -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 +5779 -0
  34. package/dist/index.js +5619 -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 +630 -0
  40. package/dist/link.js +606 -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 +62 -0
  52. package/dist/provider.js +40 -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 +1044 -0
  68. package/dist/table.js +1013 -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 +270 -65
  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 +125 -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 +326 -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
  125. package/commerce/ui/conf.ts +0 -13
  126. package/commerce/ui/context.tsx +0 -123
  127. package/commerce/ui/store.ts +0 -295
  128. package/components/access-code-input.tsx +0 -71
  129. package/components/analytics.tsx +0 -23
  130. package/components/auth/auth-listener.tsx +0 -29
  131. package/components/auth/auth-token/clear-auth-token.tsx +0 -12
  132. package/components/auth/auth-token/set-auth-token.tsx +0 -16
  133. package/components/auth/common-auth-domains.ts +0 -17
  134. package/components/auth/login-panel.tsx +0 -111
  135. package/components/auth/mobile-login-button.tsx +0 -107
  136. package/components/auth/signup-panel.tsx +0 -113
  137. package/components/back-button.tsx +0 -49
  138. package/components/chat-widget.tsx +0 -85
  139. package/components/commerce/bag-button.tsx +0 -98
  140. package/components/commerce/buy-button.tsx +0 -34
  141. package/components/commerce/checkout-button.tsx +0 -129
  142. package/components/commerce/checkout-panel/cart-accordian.tsx +0 -66
  143. package/components/commerce/checkout-panel/checkout-panel-props.ts +0 -10
  144. package/components/commerce/checkout-panel/desktop-bag-carousel.tsx +0 -36
  145. package/components/commerce/checkout-panel/desktop-cp.tsx +0 -83
  146. package/components/commerce/checkout-panel/index.tsx +0 -126
  147. package/components/commerce/checkout-panel/mobile-cp.tsx +0 -67
  148. package/components/commerce/checkout-panel/policy-links.tsx +0 -29
  149. package/components/commerce/checkout-panel/steps-indicator.tsx +0 -39
  150. package/components/commerce/checkout-panel/thank-you.tsx +0 -18
  151. package/components/commerce/desktop-bag-popup.tsx +0 -78
  152. package/components/commerce/drawer/index.tsx +0 -88
  153. package/components/commerce/drawer/micro.tsx +0 -145
  154. package/components/commerce/drawer/shell.tsx +0 -85
  155. package/components/contact-dialog/contact-form.tsx +0 -116
  156. package/components/contact-dialog/disclaimer.tsx +0 -13
  157. package/components/contact-dialog/index.tsx +0 -64
  158. package/components/copyright.tsx +0 -21
  159. package/components/drawer-margin.tsx +0 -28
  160. package/components/footer.tsx +0 -78
  161. package/components/header/desktop-nav-menu.tsx +0 -204
  162. package/components/header/desktop.tsx +0 -65
  163. package/components/header/index.tsx +0 -50
  164. package/components/header/mobile-bag-drawer.tsx +0 -51
  165. package/components/header/mobile-menu-toggle-button.tsx +0 -35
  166. package/components/header/mobile-nav-menu-ai.tsx +0 -51
  167. package/components/header/mobile-nav-menu-item.tsx +0 -47
  168. package/components/header/mobile-nav-menu.tsx +0 -102
  169. package/components/header/mobile.tsx +0 -170
  170. package/components/header/theme-toggle.tsx +0 -26
  171. package/components/icons/avatar.tsx +0 -11
  172. package/components/icons/bag-icon.tsx +0 -10
  173. package/components/icons/index.ts +0 -6
  174. package/components/icons/left-arrow.tsx +0 -11
  175. package/components/icons/lux-logo.tsx +0 -10
  176. package/components/icons/right-arrow.tsx +0 -10
  177. package/components/icons/social-icon.tsx +0 -35
  178. package/components/icons/social-svg.css +0 -3
  179. package/components/index.ts +0 -26
  180. package/components/logo.tsx +0 -92
  181. package/components/main.tsx +0 -27
  182. package/components/mini-chart/index.tsx +0 -8
  183. package/components/mini-chart/mini-chart-props.ts +0 -44
  184. package/components/mini-chart/mini-chart.tsx +0 -85
  185. package/components/mini-chart/wrapper.tsx +0 -23
  186. package/components/not-found/index.tsx +0 -28
  187. package/components/not-found/not-found-content.mdx +0 -5
  188. package/components/tooltip.tsx +0 -31
  189. package/environment.d.ts +0 -6
  190. package/next/analytics/fpixel.ts +0 -16
  191. package/next/analytics/google-analytics.ts +0 -14
  192. package/next/analytics/index.ts +0 -3
  193. package/next/analytics/pixel-analytics.tsx +0 -55
  194. package/next/font/get-app-router-font-classes.ts +0 -17
  195. package/next/font/load-and-return-lux-next-fonts-on-import.ts +0 -68
  196. package/next/font/local/Druk-Wide-Bold.ttf +0 -0
  197. package/next/font/local/Druk-Wide-Medium.ttf +0 -0
  198. package/next/font/local/InterVariable-Italic.ttf +0 -0
  199. package/next/font/local/InterVariable-Italic.woff2 +0 -0
  200. package/next/font/local/InterVariable.ttf +0 -0
  201. package/next/font/local/InterVariable.woff2 +0 -0
  202. package/next/font/next-font-desc.ts +0 -28
  203. package/next/font/pages-router-font-vars.tsx +0 -18
  204. package/next/head-metadata/from-next/metadata-types.ts +0 -158
  205. package/next/head-metadata/from-next/opengraph-types.ts +0 -267
  206. package/next/head-metadata/from-next/twitter-types.ts +0 -92
  207. package/next/head-metadata/index.tsx +0 -208
  208. package/next/index.ts +0 -2
  209. package/next/middleware/determine-device-mw.ts +0 -29
  210. package/root-layout/WHY_THIS_IS_SEPARATE.txt +0 -2
  211. package/root-layout/index.tsx +0 -112
  212. package/site-def/footer/community.tsx +0 -61
  213. package/site-def/footer/company.ts +0 -37
  214. package/site-def/footer/ecosystem.ts +0 -37
  215. package/site-def/footer/index.tsx +0 -26
  216. package/site-def/footer/legal.ts +0 -28
  217. package/site-def/footer/network.ts +0 -45
  218. package/site-def/footer/svg/warpcast-logo.svg +0 -12
  219. package/site-def/index.ts +0 -4
  220. package/site-def/main-nav.tsx +0 -460
  221. package/style/cart-animation.css +0 -29
  222. package/style/checkout-animation.css +0 -23
  223. package/style/drawer-handle-overrides.css +0 -160
  224. package/style/fonts/COPY_TO_PUBLIC_FOR_NON_NEXT.txt +0 -0
  225. package/style/fonts/Druk-Wide-Bold.ttf +0 -0
  226. package/style/fonts/Druk-Wide-Medium.ttf +0 -0
  227. package/style/fonts/InterVariable-Italic.ttf +0 -0
  228. package/style/fonts/InterVariable-Italic.woff2 +0 -0
  229. package/style/fonts/InterVariable.ttf +0 -0
  230. package/style/fonts/InterVariable.woff2 +0 -0
  231. package/style/lux-colors.css +0 -85
  232. package/style/lux-fonts.css +0 -30
  233. package/style/lux-global-non-next.css +0 -52
  234. package/style/lux-global.css +0 -51
  235. package/tailwind/fontFamily.tailwind.lux.ts +0 -18
  236. package/tailwind/index.ts +0 -2
  237. package/tailwind/lux-tw-fonts.ts +0 -40
  238. package/tailwind/tailwind.config.lux-preset.ts +0 -10
  239. package/tsconfig.json +0 -15
  240. package/types/chatbot-config.ts +0 -7
  241. package/types/chatbot-suggested-question.ts +0 -7
  242. package/types/contact-info.ts +0 -11
  243. package/types/index.ts +0 -4
  244. package/types/site-def.ts +0 -46
package/dist/tag.cjs ADDED
@@ -0,0 +1,651 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var classVarianceAuthority = require('class-variance-authority');
5
+ var React3 = require('react');
6
+ var clsx = require('clsx');
7
+ var tailwindMerge = require('tailwind-merge');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+ var RadixTooltip = require('@radix-ui/react-tooltip');
10
+ var usehooks = require('@uidotdev/usehooks');
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 React3__namespace = /*#__PURE__*/_interopNamespace(React3);
31
+ var RadixTooltip__namespace = /*#__PURE__*/_interopNamespace(RadixTooltip);
32
+
33
+ // src/tag.tsx
34
+ function cn(...inputs) {
35
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
36
+ }
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 CloseButton = React3__namespace.forwardRef(function CloseButton2(props, ref) {
39
+ const { variant: _variant, size: _size, className, children, ...rest } = props;
40
+ return /* @__PURE__ */ jsxRuntime.jsx(
41
+ "button",
42
+ {
43
+ type: "button",
44
+ "aria-label": "Close",
45
+ 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
+ ),
56
+ ...rest,
57
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
58
+ "svg",
59
+ {
60
+ className: "size-5",
61
+ viewBox: "0 0 20 20",
62
+ fill: "none",
63
+ "aria-hidden": "true",
64
+ children: /* @__PURE__ */ jsxRuntime.jsx(
65
+ "path",
66
+ {
67
+ d: CLOSE_ICON_PATH,
68
+ fill: "currentColor"
69
+ }
70
+ )
71
+ }
72
+ )
73
+ }
74
+ );
75
+ });
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`;
81
+ }
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;
94
+ }
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
+ }
238
+ }
239
+ return { style, rest };
240
+ }
241
+ var Skeleton = React3__namespace.forwardRef(
242
+ 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
+ });
333
+ 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;
337
+ 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 });
342
+ }
343
+ if (asChild && React3__namespace.isValidElement(children)) {
344
+ return /* @__PURE__ */ jsxRuntime.jsx(
345
+ Component,
346
+ {
347
+ ref,
348
+ "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
+ ),
356
+ style: mergedStyle,
357
+ ...htmlRest,
358
+ children
359
+ }
360
+ );
361
+ }
362
+ return /* @__PURE__ */ jsxRuntime.jsx(
363
+ Component,
364
+ {
365
+ ref,
366
+ "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
+ ),
374
+ style: mergedStyle,
375
+ ...htmlRest,
376
+ children
377
+ }
378
+ );
379
+ }
380
+ );
381
+ React3__namespace.forwardRef(
382
+ function SkeletonCircle2(props, ref) {
383
+ const { size = 40, loading = true, className, ...rest } = props;
384
+ const dimension = typeof size === "number" ? `${size}px` : size;
385
+ return /* @__PURE__ */ jsxRuntime.jsx(
386
+ Skeleton,
387
+ {
388
+ ref,
389
+ loading,
390
+ className: cn("rounded-full shrink-0", className),
391
+ style: { width: dimension, height: dimension, ...rest.style },
392
+ ...rest
393
+ }
394
+ );
395
+ }
396
+ );
397
+ React3__namespace.forwardRef(
398
+ function SkeletonText2(props, ref) {
399
+ const { noOfLines = 3, loading = true, className, ...rest } = props;
400
+ 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(
401
+ Skeleton,
402
+ {
403
+ loading,
404
+ className: cn("h-4", index === noOfLines - 1 && "max-w-[80%]")
405
+ },
406
+ index
407
+ )) });
408
+ }
409
+ );
410
+ var LG_BREAKPOINT = 1024;
411
+ function useIsMobile() {
412
+ const [isMobile, setIsMobile] = React3__namespace.useState(() => {
413
+ if (typeof window === "undefined") return false;
414
+ return window.innerWidth < LG_BREAKPOINT;
415
+ });
416
+ React3__namespace.useEffect(() => {
417
+ const mql = window.matchMedia(`(max-width: ${LG_BREAKPOINT - 1}px)`);
418
+ const handler = (e) => setIsMobile(e.matches);
419
+ setIsMobile(mql.matches);
420
+ mql.addEventListener("change", handler);
421
+ return () => mql.removeEventListener("change", handler);
422
+ }, []);
423
+ return isMobile;
424
+ }
425
+ var Tooltip = React3__namespace.forwardRef(
426
+ function Tooltip2(props, ref) {
427
+ const {
428
+ showArrow: showArrowProp,
429
+ onOpenChange,
430
+ variant,
431
+ selected,
432
+ children,
433
+ disabled,
434
+ disableOnMobile,
435
+ portalled = true,
436
+ content,
437
+ contentProps,
438
+ portalRef,
439
+ defaultOpen = false,
440
+ triggerProps,
441
+ closeDelay = 100,
442
+ openDelay = 100,
443
+ interactive,
444
+ positioning
445
+ } = props;
446
+ const [open, setOpen] = React3__namespace.useState(defaultOpen);
447
+ const timeoutRef = React3__namespace.useRef(null);
448
+ const isMobile = useIsMobile();
449
+ const handleOpenChange = React3__namespace.useCallback((nextOpen) => {
450
+ setOpen(nextOpen);
451
+ onOpenChange?.({ open: nextOpen });
452
+ }, [onOpenChange]);
453
+ const handleOpenChangeManual = React3__namespace.useCallback((nextOpen) => {
454
+ timeoutRef.current && window.clearTimeout(timeoutRef.current);
455
+ timeoutRef.current = window.setTimeout(() => {
456
+ setOpen(nextOpen);
457
+ onOpenChange?.({ open: nextOpen });
458
+ }, nextOpen ? openDelay : closeDelay);
459
+ }, [closeDelay, openDelay, onOpenChange]);
460
+ const handleClickAway = React3__namespace.useCallback(() => {
461
+ handleOpenChangeManual(false);
462
+ }, [handleOpenChangeManual]);
463
+ const triggerRef = usehooks.useClickAway(handleClickAway);
464
+ const handleTriggerClick = React3__namespace.useCallback(() => {
465
+ handleOpenChangeManual(!open);
466
+ }, [handleOpenChangeManual, open]);
467
+ const handleContentClick = React3__namespace.useCallback((event) => {
468
+ event.stopPropagation();
469
+ if (interactive) {
470
+ const closestLink = event.target?.closest("a");
471
+ if (closestLink) {
472
+ handleOpenChangeManual(false);
473
+ }
474
+ }
475
+ }, [interactive, handleOpenChangeManual]);
476
+ React3__namespace.useEffect(() => {
477
+ return () => {
478
+ if (timeoutRef.current) {
479
+ clearTimeout(timeoutRef.current);
480
+ }
481
+ };
482
+ }, []);
483
+ if (disabled || disableOnMobile && isMobile) return children;
484
+ const defaultShowArrow = variant === "popover" ? false : true;
485
+ 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
+ const isPopover = variant === "popover";
491
+ return /* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Provider, { delayDuration: openDelay, skipDelayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
492
+ RadixTooltip__namespace.Root,
493
+ {
494
+ open,
495
+ onOpenChange: handleOpenChange,
496
+ delayDuration: openDelay,
497
+ children: [
498
+ /* @__PURE__ */ jsxRuntime.jsx(
499
+ RadixTooltip__namespace.Trigger,
500
+ {
501
+ ref: open ? triggerRef : void 0,
502
+ asChild: true,
503
+ onClick: isMobile ? handleTriggerClick : void 0,
504
+ ...triggerProps,
505
+ children
506
+ }
507
+ ),
508
+ /* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Portal, { container: portalled ? portalRef?.current ?? void 0 : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
509
+ RadixTooltip__namespace.Content,
510
+ {
511
+ ref,
512
+ side,
513
+ align,
514
+ sideOffset,
515
+ onClick: interactive ? handleContentClick : void 0,
516
+ className: cn(
517
+ "z-[9999] overflow-hidden rounded-lg px-3 py-2 text-sm",
518
+ "animate-in fade-in-0 zoom-in-95",
519
+ isPopover && "bg-[var(--color-popover-bg)] text-[var(--color-text-primary)]",
520
+ isPopover && "shadow-[var(--shadow-popover)] border border-[var(--color-border-divider)] max-w-sm",
521
+ !isPopover && "bg-[var(--color-tooltip-bg)] text-[var(--color-tooltip-fg)] max-w-xs",
522
+ contentProps?.className
523
+ ),
524
+ ...selected ? { "data-selected": true } : {},
525
+ ...contentProps,
526
+ children: [
527
+ showArrow && /* @__PURE__ */ jsxRuntime.jsx(
528
+ RadixTooltip__namespace.Arrow,
529
+ {
530
+ className: cn(
531
+ isPopover ? "fill-[var(--color-popover-bg)]" : "fill-[var(--color-tooltip-bg)]"
532
+ )
533
+ }
534
+ ),
535
+ content
536
+ ]
537
+ }
538
+ ) })
539
+ ]
540
+ }
541
+ ) });
542
+ }
543
+ );
544
+ var nbsp = String.fromCharCode(160);
545
+ function TruncatedTextTooltip({ label, children }) {
546
+ return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
547
+ }
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
+ );
581
+ var TAG_SELECTED_CLASSES = [
582
+ "bg-[var(--color-tag-select-selected-bg)]",
583
+ "text-[var(--color-tag-select-selected-fg)]",
584
+ "hover:text-[var(--color-tag-select-selected-fg)]",
585
+ "hover:opacity-76"
586
+ ].join(" ");
587
+ var TAG_DISABLED_CLASSES = "opacity-40 pointer-events-none cursor-not-allowed";
588
+ var Tag = React3__namespace.forwardRef(
589
+ function Tag2(props, ref) {
590
+ const {
591
+ variant,
592
+ size,
593
+ startElement,
594
+ endElement,
595
+ endElementProps,
596
+ label,
597
+ onClose,
598
+ closable = Boolean(onClose),
599
+ children,
600
+ truncated = false,
601
+ loading,
602
+ selected,
603
+ disabled,
604
+ className,
605
+ ...rest
606
+ } = props;
607
+ const labelElement = label ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[var(--color-text-secondary)]", children: [
608
+ label,
609
+ ":",
610
+ nbsp
611
+ ] }) : null;
612
+ const labelSpan = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "line-clamp-1 whitespace-nowrap text-ellipsis font-medium inline", children: [
613
+ labelElement,
614
+ children
615
+ ] });
616
+ const contentElement = truncated ? /* @__PURE__ */ jsxRuntime.jsx(TruncatedTextTooltip, { label: children, children: labelSpan }) : labelSpan;
617
+ return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
618
+ "span",
619
+ {
620
+ ref,
621
+ className: cn(
622
+ tagVariants({ variant, size }),
623
+ selected && !loading && TAG_SELECTED_CLASSES,
624
+ disabled && TAG_DISABLED_CLASSES,
625
+ className
626
+ ),
627
+ ...selected && !loading && { "data-selected": true },
628
+ ...disabled && { "data-disabled": true },
629
+ ...rest,
630
+ children: [
631
+ startElement && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 inline-flex items-center justify-center empty:hidden", children: startElement }),
632
+ contentElement,
633
+ endElement && /* @__PURE__ */ jsxRuntime.jsx(
634
+ "span",
635
+ {
636
+ ...endElementProps,
637
+ className: cn(
638
+ "shrink-0 inline-flex items-center justify-center",
639
+ endElementProps?.className
640
+ ),
641
+ children: endElement
642
+ }
643
+ ),
644
+ closable && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 inline-flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClick: onClose }) })
645
+ ]
646
+ }
647
+ ) });
648
+ }
649
+ );
650
+
651
+ exports.Tag = Tag;