@luxfi/ui 5.5.2 → 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 (249) 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 -66
  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 -111
  212. package/server/auth-wrapper.ts +0 -24
  213. package/server-actions/TO-DO.txt +0 -1
  214. package/server-actions/firebase-app.ts +0 -29
  215. package/server-actions/index.ts +0 -5
  216. package/server-actions/store-contact.ts +0 -66
  217. package/site-def/footer/community.tsx +0 -61
  218. package/site-def/footer/company.ts +0 -37
  219. package/site-def/footer/ecosystem.ts +0 -37
  220. package/site-def/footer/index.tsx +0 -26
  221. package/site-def/footer/legal.ts +0 -28
  222. package/site-def/footer/network.ts +0 -45
  223. package/site-def/footer/svg/warpcast-logo.svg +0 -12
  224. package/site-def/index.ts +0 -4
  225. package/site-def/main-nav.tsx +0 -460
  226. package/style/cart-animation.css +0 -29
  227. package/style/checkout-animation.css +0 -23
  228. package/style/drawer-handle-overrides.css +0 -160
  229. package/style/fonts/COPY_TO_PUBLIC_FOR_NON_NEXT.txt +0 -0
  230. package/style/fonts/Druk-Wide-Bold.ttf +0 -0
  231. package/style/fonts/Druk-Wide-Medium.ttf +0 -0
  232. package/style/fonts/InterVariable-Italic.ttf +0 -0
  233. package/style/fonts/InterVariable-Italic.woff2 +0 -0
  234. package/style/fonts/InterVariable.ttf +0 -0
  235. package/style/fonts/InterVariable.woff2 +0 -0
  236. package/style/lux-colors.css +0 -85
  237. package/style/lux-fonts.css +0 -30
  238. package/style/lux-global-non-next.css +0 -52
  239. package/style/lux-global.css +0 -51
  240. package/tailwind/fontFamily.tailwind.lux.ts +0 -18
  241. package/tailwind/index.ts +0 -2
  242. package/tailwind/lux-tw-fonts.ts +0 -40
  243. package/tailwind/tailwind.config.lux-preset.ts +0 -10
  244. package/tsconfig.json +0 -15
  245. package/types/chatbot-config.ts +0 -7
  246. package/types/chatbot-suggested-question.ts +0 -7
  247. package/types/contact-info.ts +0 -11
  248. package/types/index.ts +0 -4
  249. package/types/site-def.ts +0 -46
package/dist/tag.js ADDED
@@ -0,0 +1,628 @@
1
+ "use client";
2
+ import { cva } from 'class-variance-authority';
3
+ import * as React3 from 'react';
4
+ import { clsx } from 'clsx';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
+ import * as RadixTooltip from '@radix-ui/react-tooltip';
8
+ import { useClickAway } from '@uidotdev/usehooks';
9
+
10
+ // src/tag.tsx
11
+ function cn(...inputs) {
12
+ return twMerge(clsx(inputs));
13
+ }
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 CloseButton = React3.forwardRef(function CloseButton2(props, ref) {
16
+ const { variant: _variant, size: _size, className, children, ...rest } = props;
17
+ return /* @__PURE__ */ jsx(
18
+ "button",
19
+ {
20
+ type: "button",
21
+ "aria-label": "Close",
22
+ 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
+ ),
33
+ ...rest,
34
+ children: children ?? /* @__PURE__ */ jsx(
35
+ "svg",
36
+ {
37
+ className: "size-5",
38
+ viewBox: "0 0 20 20",
39
+ fill: "none",
40
+ "aria-hidden": "true",
41
+ children: /* @__PURE__ */ jsx(
42
+ "path",
43
+ {
44
+ d: CLOSE_ICON_PATH,
45
+ fill: "currentColor"
46
+ }
47
+ )
48
+ }
49
+ )
50
+ }
51
+ );
52
+ });
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`;
58
+ }
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;
71
+ }
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
+ }
215
+ }
216
+ return { style, rest };
217
+ }
218
+ var Skeleton = React3.forwardRef(
219
+ 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
+ });
310
+ 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;
314
+ if (!loading) {
315
+ if (asChild && React3.isValidElement(children)) {
316
+ return children;
317
+ }
318
+ return /* @__PURE__ */ jsx(Component, { ref, className: finalClassName, style: mergedStyle, ...htmlRest, children });
319
+ }
320
+ if (asChild && React3.isValidElement(children)) {
321
+ return /* @__PURE__ */ jsx(
322
+ Component,
323
+ {
324
+ ref,
325
+ "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
+ ),
333
+ style: mergedStyle,
334
+ ...htmlRest,
335
+ children
336
+ }
337
+ );
338
+ }
339
+ return /* @__PURE__ */ jsx(
340
+ Component,
341
+ {
342
+ ref,
343
+ "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
+ ),
351
+ style: mergedStyle,
352
+ ...htmlRest,
353
+ children
354
+ }
355
+ );
356
+ }
357
+ );
358
+ React3.forwardRef(
359
+ function SkeletonCircle2(props, ref) {
360
+ const { size = 40, loading = true, className, ...rest } = props;
361
+ const dimension = typeof size === "number" ? `${size}px` : size;
362
+ return /* @__PURE__ */ jsx(
363
+ Skeleton,
364
+ {
365
+ ref,
366
+ loading,
367
+ className: cn("rounded-full shrink-0", className),
368
+ style: { width: dimension, height: dimension, ...rest.style },
369
+ ...rest
370
+ }
371
+ );
372
+ }
373
+ );
374
+ React3.forwardRef(
375
+ function SkeletonText2(props, ref) {
376
+ const { noOfLines = 3, loading = true, className, ...rest } = props;
377
+ return /* @__PURE__ */ jsx("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsx(
378
+ Skeleton,
379
+ {
380
+ loading,
381
+ className: cn("h-4", index === noOfLines - 1 && "max-w-[80%]")
382
+ },
383
+ index
384
+ )) });
385
+ }
386
+ );
387
+ var LG_BREAKPOINT = 1024;
388
+ function useIsMobile() {
389
+ const [isMobile, setIsMobile] = React3.useState(() => {
390
+ if (typeof window === "undefined") return false;
391
+ return window.innerWidth < LG_BREAKPOINT;
392
+ });
393
+ React3.useEffect(() => {
394
+ const mql = window.matchMedia(`(max-width: ${LG_BREAKPOINT - 1}px)`);
395
+ const handler = (e) => setIsMobile(e.matches);
396
+ setIsMobile(mql.matches);
397
+ mql.addEventListener("change", handler);
398
+ return () => mql.removeEventListener("change", handler);
399
+ }, []);
400
+ return isMobile;
401
+ }
402
+ var Tooltip = React3.forwardRef(
403
+ function Tooltip2(props, ref) {
404
+ const {
405
+ showArrow: showArrowProp,
406
+ onOpenChange,
407
+ variant,
408
+ selected,
409
+ children,
410
+ disabled,
411
+ disableOnMobile,
412
+ portalled = true,
413
+ content,
414
+ contentProps,
415
+ portalRef,
416
+ defaultOpen = false,
417
+ triggerProps,
418
+ closeDelay = 100,
419
+ openDelay = 100,
420
+ interactive,
421
+ positioning
422
+ } = props;
423
+ const [open, setOpen] = React3.useState(defaultOpen);
424
+ const timeoutRef = React3.useRef(null);
425
+ const isMobile = useIsMobile();
426
+ const handleOpenChange = React3.useCallback((nextOpen) => {
427
+ setOpen(nextOpen);
428
+ onOpenChange?.({ open: nextOpen });
429
+ }, [onOpenChange]);
430
+ const handleOpenChangeManual = React3.useCallback((nextOpen) => {
431
+ timeoutRef.current && window.clearTimeout(timeoutRef.current);
432
+ timeoutRef.current = window.setTimeout(() => {
433
+ setOpen(nextOpen);
434
+ onOpenChange?.({ open: nextOpen });
435
+ }, nextOpen ? openDelay : closeDelay);
436
+ }, [closeDelay, openDelay, onOpenChange]);
437
+ const handleClickAway = React3.useCallback(() => {
438
+ handleOpenChangeManual(false);
439
+ }, [handleOpenChangeManual]);
440
+ const triggerRef = useClickAway(handleClickAway);
441
+ const handleTriggerClick = React3.useCallback(() => {
442
+ handleOpenChangeManual(!open);
443
+ }, [handleOpenChangeManual, open]);
444
+ const handleContentClick = React3.useCallback((event) => {
445
+ event.stopPropagation();
446
+ if (interactive) {
447
+ const closestLink = event.target?.closest("a");
448
+ if (closestLink) {
449
+ handleOpenChangeManual(false);
450
+ }
451
+ }
452
+ }, [interactive, handleOpenChangeManual]);
453
+ React3.useEffect(() => {
454
+ return () => {
455
+ if (timeoutRef.current) {
456
+ clearTimeout(timeoutRef.current);
457
+ }
458
+ };
459
+ }, []);
460
+ if (disabled || disableOnMobile && isMobile) return children;
461
+ const defaultShowArrow = variant === "popover" ? false : true;
462
+ 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
+ const isPopover = variant === "popover";
468
+ return /* @__PURE__ */ jsx(RadixTooltip.Provider, { delayDuration: openDelay, skipDelayDuration: 0, children: /* @__PURE__ */ jsxs(
469
+ RadixTooltip.Root,
470
+ {
471
+ open,
472
+ onOpenChange: handleOpenChange,
473
+ delayDuration: openDelay,
474
+ children: [
475
+ /* @__PURE__ */ jsx(
476
+ RadixTooltip.Trigger,
477
+ {
478
+ ref: open ? triggerRef : void 0,
479
+ asChild: true,
480
+ onClick: isMobile ? handleTriggerClick : void 0,
481
+ ...triggerProps,
482
+ children
483
+ }
484
+ ),
485
+ /* @__PURE__ */ jsx(RadixTooltip.Portal, { container: portalled ? portalRef?.current ?? void 0 : void 0, children: /* @__PURE__ */ jsxs(
486
+ RadixTooltip.Content,
487
+ {
488
+ ref,
489
+ side,
490
+ align,
491
+ sideOffset,
492
+ onClick: interactive ? handleContentClick : void 0,
493
+ className: cn(
494
+ "z-[9999] overflow-hidden rounded-lg px-3 py-2 text-sm",
495
+ "animate-in fade-in-0 zoom-in-95",
496
+ isPopover && "bg-[var(--color-popover-bg)] text-[var(--color-text-primary)]",
497
+ isPopover && "shadow-[var(--shadow-popover)] border border-[var(--color-border-divider)] max-w-sm",
498
+ !isPopover && "bg-[var(--color-tooltip-bg)] text-[var(--color-tooltip-fg)] max-w-xs",
499
+ contentProps?.className
500
+ ),
501
+ ...selected ? { "data-selected": true } : {},
502
+ ...contentProps,
503
+ children: [
504
+ showArrow && /* @__PURE__ */ jsx(
505
+ RadixTooltip.Arrow,
506
+ {
507
+ className: cn(
508
+ isPopover ? "fill-[var(--color-popover-bg)]" : "fill-[var(--color-tooltip-bg)]"
509
+ )
510
+ }
511
+ ),
512
+ content
513
+ ]
514
+ }
515
+ ) })
516
+ ]
517
+ }
518
+ ) });
519
+ }
520
+ );
521
+ var nbsp = String.fromCharCode(160);
522
+ function TruncatedTextTooltip({ label, children }) {
523
+ return /* @__PURE__ */ jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
524
+ }
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
+ );
558
+ var TAG_SELECTED_CLASSES = [
559
+ "bg-[var(--color-tag-select-selected-bg)]",
560
+ "text-[var(--color-tag-select-selected-fg)]",
561
+ "hover:text-[var(--color-tag-select-selected-fg)]",
562
+ "hover:opacity-76"
563
+ ].join(" ");
564
+ var TAG_DISABLED_CLASSES = "opacity-40 pointer-events-none cursor-not-allowed";
565
+ var Tag = React3.forwardRef(
566
+ function Tag2(props, ref) {
567
+ const {
568
+ variant,
569
+ size,
570
+ startElement,
571
+ endElement,
572
+ endElementProps,
573
+ label,
574
+ onClose,
575
+ closable = Boolean(onClose),
576
+ children,
577
+ truncated = false,
578
+ loading,
579
+ selected,
580
+ disabled,
581
+ className,
582
+ ...rest
583
+ } = props;
584
+ const labelElement = label ? /* @__PURE__ */ jsxs("span", { className: "text-[var(--color-text-secondary)]", children: [
585
+ label,
586
+ ":",
587
+ nbsp
588
+ ] }) : null;
589
+ const labelSpan = /* @__PURE__ */ jsxs("span", { className: "line-clamp-1 whitespace-nowrap text-ellipsis font-medium inline", children: [
590
+ labelElement,
591
+ children
592
+ ] });
593
+ const contentElement = truncated ? /* @__PURE__ */ jsx(TruncatedTextTooltip, { label: children, children: labelSpan }) : labelSpan;
594
+ return /* @__PURE__ */ jsx(Skeleton, { loading, asChild: true, children: /* @__PURE__ */ jsxs(
595
+ "span",
596
+ {
597
+ ref,
598
+ className: cn(
599
+ tagVariants({ variant, size }),
600
+ selected && !loading && TAG_SELECTED_CLASSES,
601
+ disabled && TAG_DISABLED_CLASSES,
602
+ className
603
+ ),
604
+ ...selected && !loading && { "data-selected": true },
605
+ ...disabled && { "data-disabled": true },
606
+ ...rest,
607
+ children: [
608
+ startElement && /* @__PURE__ */ jsx("span", { className: "shrink-0 inline-flex items-center justify-center empty:hidden", children: startElement }),
609
+ contentElement,
610
+ endElement && /* @__PURE__ */ jsx(
611
+ "span",
612
+ {
613
+ ...endElementProps,
614
+ className: cn(
615
+ "shrink-0 inline-flex items-center justify-center",
616
+ endElementProps?.className
617
+ ),
618
+ children: endElement
619
+ }
620
+ ),
621
+ closable && /* @__PURE__ */ jsx("span", { className: "shrink-0 inline-flex items-center justify-center", children: /* @__PURE__ */ jsx(CloseButton, { onClick: onClose }) })
622
+ ]
623
+ }
624
+ ) });
625
+ }
626
+ );
627
+
628
+ export { Tag };
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var classVarianceAuthority = require('class-variance-authority');
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
+ var React__default = /*#__PURE__*/_interopDefault(React);
13
+
14
+ // src/textarea.tsx
15
+ function cn(...inputs) {
16
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
17
+ }
18
+ var textareaVariants = classVarianceAuthority.cva(
19
+ [
20
+ "w-full appearance-none outline-none transition-colors resize-y",
21
+ "bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
22
+ "placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
23
+ "hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
24
+ "focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
25
+ "focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
26
+ "disabled:opacity-40 disabled:cursor-not-allowed",
27
+ "read-only:opacity-70",
28
+ "data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
29
+ ].join(" "),
30
+ {
31
+ variants: {
32
+ size: {
33
+ xs: "px-2 py-1 text-xs rounded",
34
+ sm: "px-3 py-2 text-sm rounded-md",
35
+ md: "px-4 py-2 text-base rounded-md",
36
+ lg: "px-4 py-3 text-lg rounded-lg",
37
+ "2xl": "px-4 py-3 text-xl rounded-lg"
38
+ },
39
+ variant: {
40
+ outline: "border border-solid",
41
+ filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
42
+ unstyled: "border-0 bg-transparent p-0"
43
+ }
44
+ },
45
+ defaultVariants: {
46
+ size: "md",
47
+ variant: "outline"
48
+ }
49
+ }
50
+ );
51
+ var Textarea = React__default.default.forwardRef(
52
+ ({ size, variant, className, ...rest }, ref) => {
53
+ return /* @__PURE__ */ jsxRuntime.jsx(
54
+ "textarea",
55
+ {
56
+ ref,
57
+ className: cn(textareaVariants({ size, variant }), className),
58
+ ...rest
59
+ }
60
+ );
61
+ }
62
+ );
63
+ Textarea.displayName = "Textarea";
64
+
65
+ exports.Textarea = Textarea;