@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/alert.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var classVarianceAuthority = require('class-variance-authority');
5
4
  var React2 = 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
9
 
10
10
  function _interopNamespace(e) {
@@ -32,24 +32,47 @@ function cn(...inputs) {
32
32
  return tailwindMerge.twMerge(clsx.clsx(inputs));
33
33
  }
34
34
  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";
35
+ var CloseButtonFrame = core.styled(core.View, {
36
+ name: "LuxCloseButton",
37
+ render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
38
+ role: "button",
39
+ cursor: "pointer",
40
+ display: "inline-flex",
41
+ alignItems: "center",
42
+ justifyContent: "center",
43
+ width: 20,
44
+ height: 20,
45
+ minWidth: 0,
46
+ flexShrink: 1,
47
+ padding: 0,
48
+ borderRadius: 4,
49
+ borderWidth: 0,
50
+ overflow: "hidden",
51
+ backgroundColor: "transparent",
52
+ hoverStyle: {
53
+ backgroundColor: "transparent"
54
+ },
55
+ variants: {
56
+ disabled: {
57
+ true: {
58
+ opacity: 0.4,
59
+ pointerEvents: "none"
60
+ }
61
+ }
62
+ }
63
+ });
64
+ var CLOSE_BUTTON_CLASSES = [
65
+ "text-[var(--closeButton-fg,currentColor)]",
66
+ "hover:text-[var(--hover-color,currentColor)]",
67
+ "disabled:opacity-40"
68
+ ].join(" ");
35
69
  var CloseButton = React2__namespace.forwardRef(function CloseButton2(props, ref) {
36
70
  const { variant: _variant, size: _size, className, children, ...rest } = props;
37
71
  return /* @__PURE__ */ jsxRuntime.jsx(
38
- "button",
72
+ CloseButtonFrame,
39
73
  {
40
- type: "button",
41
- "aria-label": "Close",
42
74
  ref,
43
- className: cn(
44
- "inline-flex items-center justify-center",
45
- "size-5 min-w-0 shrink-0 p-0",
46
- "rounded-sm border-0 overflow-hidden",
47
- "bg-transparent text-[var(--closeButton-fg,currentColor)]",
48
- "hover:bg-transparent hover:text-[var(--hover-color,currentColor)]",
49
- "disabled:opacity-40",
50
- "cursor-pointer",
51
- className
52
- ),
75
+ className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
53
76
  ...rest,
54
77
  children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
55
78
  "svg",
@@ -70,272 +93,137 @@ var CloseButton = React2__namespace.forwardRef(function CloseButton2(props, ref)
70
93
  }
71
94
  );
72
95
  });
73
- var SPACING_SCALE = 4;
74
- function toStylePx(value) {
75
- if (value === void 0) return void 0;
76
- if (typeof value === "string") return value;
77
- return `${value * SPACING_SCALE}px`;
96
+ var SHIM_PROPS = [
97
+ "w",
98
+ "h",
99
+ "minW",
100
+ "maxW",
101
+ "display",
102
+ "flexGrow",
103
+ "flexShrink",
104
+ "flexBasis",
105
+ "fontWeight",
106
+ "textStyle",
107
+ "borderRadius",
108
+ "alignSelf",
109
+ "alignItems",
110
+ "justifyContent",
111
+ "color",
112
+ "mt",
113
+ "mb",
114
+ "ml",
115
+ "mr",
116
+ "height",
117
+ "overflow",
118
+ "whiteSpace",
119
+ "textOverflow",
120
+ "textTransform",
121
+ "gap",
122
+ "gridTemplateColumns",
123
+ "minWidth",
124
+ "boxSize",
125
+ "py",
126
+ "px",
127
+ "p",
128
+ "hideBelow",
129
+ "fontSize",
130
+ "flexWrap",
131
+ "wordBreak",
132
+ "lineHeight",
133
+ "marginRight",
134
+ "position",
135
+ "background"
136
+ ];
137
+ var S = 4;
138
+ function dim(v) {
139
+ if (v == null) return void 0;
140
+ if (typeof v === "number") return `${v * S}px`;
141
+ if (typeof v === "string") return v;
142
+ if (typeof v === "object") {
143
+ const o = v;
144
+ return o.base ?? o.lg ?? o.xl ?? Object.values(o)[0];
145
+ }
146
+ return void 0;
78
147
  }
79
- function extractSkeletonStyleProps(props) {
80
- const style = {};
81
- const rest = {};
82
- function resolveDimension(value) {
83
- if (value === void 0 || value === null) return void 0;
84
- if (typeof value === "number") return `${value * SPACING_SCALE}px`;
85
- if (typeof value === "string") return value;
86
- if (typeof value === "object") {
87
- const obj = value;
88
- return obj.base ?? obj.lg ?? obj.xl ?? Object.values(obj)[0];
89
- }
90
- return void 0;
148
+ function sp(v) {
149
+ if (v === void 0) return void 0;
150
+ return typeof v === "number" ? `${v * S}px` : v;
151
+ }
152
+ function shimToStyle(props) {
153
+ const s = {};
154
+ if (props.w !== void 0) s.width = dim(props.w);
155
+ if (props.h !== void 0) s.height = dim(props.h);
156
+ if (props.minW !== void 0) s.minWidth = dim(props.minW);
157
+ if (props.maxW !== void 0) s.maxWidth = dim(props.maxW);
158
+ if (props.display !== void 0) s.display = props.display;
159
+ if (props.flexGrow !== void 0) s.flexGrow = props.flexGrow;
160
+ if (props.flexShrink !== void 0) s.flexShrink = props.flexShrink;
161
+ if (props.flexBasis !== void 0) s.flexBasis = props.flexBasis;
162
+ if (props.fontWeight !== void 0) s.fontWeight = props.fontWeight;
163
+ if (props.borderRadius !== void 0) s.borderRadius = props.borderRadius;
164
+ if (props.alignSelf !== void 0) s.alignSelf = props.alignSelf;
165
+ if (props.alignItems !== void 0) s.alignItems = props.alignItems;
166
+ if (props.justifyContent !== void 0) s.justifyContent = props.justifyContent;
167
+ if (props.color !== void 0) s.color = props.color;
168
+ if (props.mt !== void 0) s.marginTop = sp(props.mt);
169
+ if (props.mb !== void 0) s.marginBottom = sp(props.mb);
170
+ if (props.ml !== void 0) s.marginLeft = sp(props.ml);
171
+ if (props.mr !== void 0) s.marginRight = sp(props.mr);
172
+ if (props.height !== void 0) s.height = props.height;
173
+ if (props.overflow !== void 0) s.overflow = props.overflow;
174
+ if (props.whiteSpace !== void 0) s.whiteSpace = props.whiteSpace;
175
+ if (props.textOverflow !== void 0) s.textOverflow = props.textOverflow;
176
+ if (props.textTransform !== void 0) s.textTransform = props.textTransform;
177
+ if (props.gap !== void 0) s.gap = sp(props.gap);
178
+ if (props.gridTemplateColumns !== void 0) s.gridTemplateColumns = props.gridTemplateColumns;
179
+ if (props.minWidth !== void 0) s.minWidth = props.minWidth;
180
+ if (props.boxSize !== void 0) {
181
+ const v = typeof props.boxSize === "number" ? `${props.boxSize * S}px` : props.boxSize;
182
+ s.width = v;
183
+ s.height = v;
91
184
  }
92
- for (const [key, value] of Object.entries(props)) {
93
- if (value === void 0) continue;
94
- switch (key) {
95
- case "w": {
96
- const v = resolveDimension(value);
97
- if (v) style.width = v;
98
- break;
99
- }
100
- case "h": {
101
- const v = resolveDimension(value);
102
- if (v) style.height = v;
103
- break;
104
- }
105
- case "minW": {
106
- const v = resolveDimension(value);
107
- if (v) style.minWidth = v;
108
- break;
109
- }
110
- case "maxW": {
111
- const v = resolveDimension(value);
112
- if (v) style.maxWidth = v;
113
- break;
114
- }
115
- case "height":
116
- style.height = value;
117
- break;
118
- case "display":
119
- style.display = value;
120
- break;
121
- case "flexGrow":
122
- style.flexGrow = value;
123
- break;
124
- case "flexShrink":
125
- style.flexShrink = value;
126
- break;
127
- case "flexBasis":
128
- style.flexBasis = value;
129
- break;
130
- case "fontWeight":
131
- style.fontWeight = value;
132
- break;
133
- case "borderRadius":
134
- style.borderRadius = value;
135
- break;
136
- case "alignSelf":
137
- style.alignSelf = value;
138
- break;
139
- case "alignItems":
140
- style.alignItems = value;
141
- break;
142
- case "justifyContent":
143
- style.justifyContent = value;
144
- break;
145
- case "color":
146
- style.color = value;
147
- break;
148
- case "mt":
149
- style.marginTop = toStylePx(value);
150
- break;
151
- case "mb":
152
- style.marginBottom = toStylePx(value);
153
- break;
154
- case "ml":
155
- style.marginLeft = toStylePx(value);
156
- break;
157
- case "mr":
158
- style.marginRight = toStylePx(value);
159
- break;
160
- case "overflow":
161
- style.overflow = value;
162
- break;
163
- case "whiteSpace":
164
- style.whiteSpace = value;
165
- break;
166
- case "textOverflow":
167
- style.textOverflow = value;
168
- break;
169
- case "textTransform":
170
- style.textTransform = value;
171
- break;
172
- case "gap":
173
- style.gap = typeof value === "number" ? `${value * SPACING_SCALE}px` : value;
174
- break;
175
- case "gridTemplateColumns":
176
- style.gridTemplateColumns = value;
177
- break;
178
- case "minWidth":
179
- style.minWidth = value;
180
- break;
181
- case "boxSize": {
182
- const s = typeof value === "number" ? `${value * SPACING_SCALE}px` : value;
183
- style.width = s;
184
- style.height = s;
185
- break;
186
- }
187
- case "py": {
188
- const v = toStylePx(value);
189
- style.paddingTop = v;
190
- style.paddingBottom = v;
191
- break;
192
- }
193
- case "px": {
194
- const v = toStylePx(value);
195
- style.paddingLeft = v;
196
- style.paddingRight = v;
197
- break;
198
- }
199
- case "p": {
200
- const v = toStylePx(value);
201
- style.padding = v;
202
- break;
203
- }
204
- case "hideBelow":
205
- break;
206
- // handled via className
207
- case "textStyle":
208
- break;
209
- // drop textStyle, not directly applicable
210
- case "fontSize":
211
- style.fontSize = value;
212
- break;
213
- case "flexWrap":
214
- style.flexWrap = value;
215
- break;
216
- case "wordBreak":
217
- style.wordBreak = value;
218
- break;
219
- case "lineHeight":
220
- style.lineHeight = value;
221
- break;
222
- case "marginRight":
223
- style.marginRight = value;
224
- break;
225
- case "position":
226
- style.position = value;
227
- break;
228
- case "background":
229
- style.background = value;
230
- break;
231
- default:
232
- rest[key] = value;
233
- break;
234
- }
185
+ if (props.py !== void 0) {
186
+ const v = sp(props.py);
187
+ s.paddingTop = v;
188
+ s.paddingBottom = v;
189
+ }
190
+ if (props.px !== void 0) {
191
+ const v = sp(props.px);
192
+ s.paddingLeft = v;
193
+ s.paddingRight = v;
235
194
  }
236
- return { style, rest };
195
+ if (props.p !== void 0) s.padding = sp(props.p);
196
+ if (props.fontSize !== void 0) s.fontSize = props.fontSize;
197
+ if (props.flexWrap !== void 0) s.flexWrap = props.flexWrap;
198
+ if (props.wordBreak !== void 0) s.wordBreak = props.wordBreak;
199
+ if (props.lineHeight !== void 0) s.lineHeight = props.lineHeight;
200
+ if (props.marginRight !== void 0) s.marginRight = props.marginRight;
201
+ if (props.position !== void 0) s.position = props.position;
202
+ if (props.background !== void 0) s.background = props.background;
203
+ return s;
237
204
  }
205
+ function stripShims(props) {
206
+ const out = { ...props };
207
+ for (const k of SHIM_PROPS) delete out[k];
208
+ return out;
209
+ }
210
+ var SKELETON_CLASSES = [
211
+ "animate-skeleton-shimmer rounded-sm",
212
+ "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
213
+ "bg-[length:200%_100%]"
214
+ ].join(" ");
215
+ var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
238
216
  var Skeleton = React2__namespace.forwardRef(
239
217
  function Skeleton2(props, ref) {
240
- const {
241
- loading = false,
242
- asChild,
243
- className,
244
- children,
245
- style: styleProp,
246
- // Destructure style-prop shims so they don't leak into DOM
247
- w: _w,
248
- h: _h,
249
- minW: _minW,
250
- maxW: _maxW,
251
- display: _display,
252
- flexGrow: _flexGrow,
253
- flexShrink: _flexShrink,
254
- flexBasis: _flexBasis,
255
- fontWeight: _fontWeight,
256
- textStyle: _textStyle,
257
- borderRadius: _borderRadius,
258
- alignSelf: _alignSelf,
259
- alignItems: _alignItems,
260
- justifyContent: _justifyContent,
261
- color: _color,
262
- mt: _mt,
263
- mb: _mb,
264
- ml: _ml,
265
- mr: _mr,
266
- height: _height,
267
- overflow: _overflow,
268
- whiteSpace: _whiteSpace,
269
- textOverflow: _textOverflow,
270
- textTransform: _textTransform,
271
- gap: _gap,
272
- gridTemplateColumns: _gridTemplateColumns,
273
- minWidth: _minWidth,
274
- boxSize: _boxSize,
275
- py: _py,
276
- px: _px,
277
- p: _p,
278
- hideBelow: _hideBelow,
279
- fontSize: _fontSize,
280
- flexWrap: _flexWrap,
281
- wordBreak: _wordBreak,
282
- lineHeight: _lineHeight,
283
- marginRight: _marginRight,
284
- position: _position,
285
- background: _background,
286
- as: Component = "div",
287
- ...htmlRest
288
- } = props;
289
- const { style: shimStyle } = extractSkeletonStyleProps({
290
- w: _w,
291
- h: _h,
292
- minW: _minW,
293
- maxW: _maxW,
294
- display: _display,
295
- flexGrow: _flexGrow,
296
- flexShrink: _flexShrink,
297
- flexBasis: _flexBasis,
298
- fontWeight: _fontWeight,
299
- textStyle: _textStyle,
300
- borderRadius: _borderRadius,
301
- alignSelf: _alignSelf,
302
- alignItems: _alignItems,
303
- justifyContent: _justifyContent,
304
- color: _color,
305
- mt: _mt,
306
- mb: _mb,
307
- ml: _ml,
308
- mr: _mr,
309
- height: _height,
310
- overflow: _overflow,
311
- whiteSpace: _whiteSpace,
312
- textOverflow: _textOverflow,
313
- textTransform: _textTransform,
314
- gap: _gap,
315
- gridTemplateColumns: _gridTemplateColumns,
316
- minWidth: _minWidth,
317
- boxSize: _boxSize,
318
- py: _py,
319
- px: _px,
320
- p: _p,
321
- hideBelow: _hideBelow,
322
- fontSize: _fontSize,
323
- flexWrap: _flexWrap,
324
- wordBreak: _wordBreak,
325
- lineHeight: _lineHeight,
326
- marginRight: _marginRight,
327
- position: _position,
328
- background: _background
329
- });
218
+ const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
219
+ const shimStyle = shimToStyle(props);
330
220
  const mergedStyle = Object.keys(shimStyle).length > 0 || styleProp ? { ...shimStyle, ...styleProp } : void 0;
331
- const HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
332
- const hideBelowClass = _hideBelow ? HIDE_BELOW_MAP[_hideBelow] : void 0;
333
- const finalClassName = hideBelowClass ? cn(className, hideBelowClass) : className;
221
+ const hideBelowClass = props.hideBelow ? HIDE_BELOW_MAP[props.hideBelow] : void 0;
222
+ const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
223
+ const htmlRest = stripShims(allRest);
334
224
  if (!loading) {
335
- if (asChild && React2__namespace.isValidElement(children)) {
336
- return children;
337
- }
338
- return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: finalClassName, style: mergedStyle, ...htmlRest, children });
225
+ if (asChild && React2__namespace.isValidElement(children)) return children;
226
+ return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
339
227
  }
340
228
  if (asChild && React2__namespace.isValidElement(children)) {
341
229
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -343,13 +231,7 @@ var Skeleton = React2__namespace.forwardRef(
343
231
  {
344
232
  ref,
345
233
  "data-loading": true,
346
- className: cn(
347
- "animate-skeleton-shimmer rounded-sm",
348
- "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
349
- "bg-[length:200%_100%]",
350
- "text-transparent [&_*]:invisible",
351
- finalClassName
352
- ),
234
+ className: cn(SKELETON_CLASSES, "text-transparent [&_*]:invisible", cls),
353
235
  style: mergedStyle,
354
236
  ...htmlRest,
355
237
  children
@@ -361,13 +243,7 @@ var Skeleton = React2__namespace.forwardRef(
361
243
  {
362
244
  ref,
363
245
  "data-loading": true,
364
- className: cn(
365
- "animate-skeleton-shimmer rounded-sm",
366
- "bg-[linear-gradient(90deg,var(--color-skeleton-start)_0%,var(--color-skeleton-end)_50%,var(--color-skeleton-start)_100%)]",
367
- "bg-[length:200%_100%]",
368
- children ? "text-transparent [&_*]:invisible" : "min-h-5",
369
- finalClassName
370
- ),
246
+ className: cn(SKELETON_CLASSES, children ? "text-transparent [&_*]:invisible" : "min-h-5", cls),
371
247
  style: mergedStyle,
372
248
  ...htmlRest,
373
249
  children
@@ -405,52 +281,22 @@ React2__namespace.forwardRef(
405
281
  }
406
282
  );
407
283
  var IndicatorIcon = ({ className }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm.75-11.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM9.25 10a.75.75 0 011.5 0v3a.75.75 0 01-1.5 0v-3z" }) });
408
- var alertRoot = classVarianceAuthority.cva(
409
- // base
410
- "w-full flex items-start relative rounded text-[var(--color-alert-fg)]",
411
- {
412
- variants: {
413
- status: {
414
- info: "bg-[var(--color-alert-bg-info)]",
415
- warning: "bg-[var(--color-alert-bg-warning)]",
416
- warning_table: "bg-[var(--color-alert-bg-warning-table)]",
417
- success: "bg-[var(--color-alert-bg-success)]",
418
- error: "bg-[var(--color-alert-bg-error)]"
419
- },
420
- size: {
421
- sm: "gap-2 px-2 py-2 text-xs",
422
- md: "gap-2 px-3 py-2 text-base"
423
- }
424
- },
425
- defaultVariants: {
426
- status: "info",
427
- size: "md"
428
- }
429
- }
430
- );
431
- var alertContent = classVarianceAuthority.cva("flex flex-1", {
432
- variants: {
433
- inline: {
434
- "true": "inline-flex flex-row items-center",
435
- "false": "flex flex-col"
436
- }
437
- },
438
- defaultVariants: {
439
- inline: true
440
- }
441
- });
442
- var INDICATOR_BASE = "inline-flex items-center justify-center shrink-0 w-5 h-5 text-[var(--color-alert-fg)] [&>svg]:w-full [&>svg]:h-full";
443
- var indicatorVariants = classVarianceAuthority.cva(INDICATOR_BASE, {
444
- variants: {
445
- size: {
446
- sm: "w-5 h-5 my-0",
447
- md: "w-5 h-5 my-[2px]"
448
- }
449
- },
450
- defaultVariants: {
451
- size: "md"
452
- }
453
- });
284
+ var ALERT_BASE = "w-full flex items-start relative rounded text-[var(--color-alert-fg)]";
285
+ var STATUS_CLASSES = {
286
+ info: "bg-[var(--color-alert-bg-info)]",
287
+ warning: "bg-[var(--color-alert-bg-warning)]",
288
+ warning_table: "bg-[var(--color-alert-bg-warning-table)]",
289
+ success: "bg-[var(--color-alert-bg-success)]",
290
+ error: "bg-[var(--color-alert-bg-error)]"
291
+ };
292
+ var SIZE_CLASSES = {
293
+ sm: "gap-2 px-2 py-2 text-xs",
294
+ md: "gap-2 px-3 py-2 text-base"
295
+ };
296
+ var INDICATOR_SIZE_CLASSES = {
297
+ sm: "w-5 h-5 my-0",
298
+ md: "w-5 h-5 my-[2px]"
299
+ };
454
300
  var Alert = React2__namespace.forwardRef(
455
301
  function Alert2(props, ref) {
456
302
  const {
@@ -486,7 +332,10 @@ var Alert = React2__namespace.forwardRef(
486
332
  if (!showIcon && icon === void 0) {
487
333
  return null;
488
334
  }
489
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: indicatorVariants({ size: resolvedSize }), children: icon || defaultIcon });
335
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
336
+ "inline-flex items-center justify-center shrink-0 text-[var(--color-alert-fg)] [&>svg]:w-full [&>svg]:h-full",
337
+ INDICATOR_SIZE_CLASSES[resolvedSize]
338
+ ), children: icon || defaultIcon });
490
339
  })();
491
340
  const handleClose = React2__namespace.useCallback(() => {
492
341
  setIsOpen(false);
@@ -519,12 +368,12 @@ var Alert = React2__namespace.forwardRef(
519
368
  "div",
520
369
  {
521
370
  ref,
522
- className: cn(alertRoot({ status, size: resolvedSize }), className),
371
+ className: cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES[resolvedSize], className),
523
372
  style: alertStyle,
524
373
  ...alertRest,
525
374
  children: [
526
375
  iconElement,
527
- children ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: alertContent({ inline }), children: [
376
+ children ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-1", inline ? "inline-flex flex-row items-center" : "flex flex-col"), children: [
528
377
  title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold", children: title }),
529
378
  /* @__PURE__ */ jsxRuntime.jsx(
530
379
  "div",