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