@luxfi/ui 7.4.10 → 7.4.12
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.
- package/dist/accordion.cjs +107 -166
- package/dist/accordion.d.cts +18 -51
- package/dist/accordion.d.ts +18 -51
- package/dist/accordion.js +109 -166
- package/dist/alert.cjs +68 -46
- package/dist/alert.js +69 -46
- package/dist/avatar.cjs +49 -46
- package/dist/avatar.js +52 -48
- package/dist/badge.cjs +82 -49
- package/dist/badge.js +83 -50
- package/dist/checkbox.cjs +42 -75
- package/dist/checkbox.js +43 -76
- package/dist/chrome.cjs +196 -386
- package/dist/chrome.js +198 -386
- package/dist/close-button.cjs +3 -7
- package/dist/close-button.js +3 -7
- package/dist/collapsible.cjs +35 -26
- package/dist/collapsible.d.cts +2 -1
- package/dist/collapsible.d.ts +2 -1
- package/dist/collapsible.js +34 -24
- package/dist/dialog.cjs +3 -7
- package/dist/dialog.d.cts +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +3 -7
- package/dist/drawer.cjs +95 -122
- package/dist/drawer.d.cts +43 -10
- package/dist/drawer.d.ts +43 -10
- package/dist/drawer.js +97 -122
- package/dist/empty-state.cjs +13 -13
- package/dist/empty-state.js +13 -13
- package/dist/expiration-selector.cjs +58 -63
- package/dist/expiration-selector.js +58 -63
- package/dist/field.cjs +60 -109
- package/dist/field.d.cts +0 -1
- package/dist/field.d.ts +0 -1
- package/dist/field.js +61 -109
- package/dist/greeks-display.cjs +48 -39
- package/dist/greeks-display.js +48 -39
- package/dist/heading.cjs +10 -17
- package/dist/heading.d.cts +0 -2
- package/dist/heading.d.ts +0 -2
- package/dist/heading.js +10 -17
- package/dist/icon-button.cjs +82 -82
- package/dist/icon-button.d.cts +16 -12
- package/dist/icon-button.d.ts +16 -12
- package/dist/icon-button.js +82 -82
- package/dist/index.cjs +1812 -2105
- package/dist/index.d.cts +1 -5
- package/dist/index.d.ts +1 -5
- package/dist/index.js +1814 -2100
- package/dist/input-group.cjs +11 -12
- package/dist/input-group.js +11 -12
- package/dist/input.cjs +27 -27
- package/dist/input.d.cts +21 -1
- package/dist/input.d.ts +21 -1
- package/dist/input.js +25 -28
- package/dist/menu.cjs +160 -271
- package/dist/menu.d.cts +41 -57
- package/dist/menu.d.ts +41 -57
- package/dist/menu.js +161 -251
- package/dist/option-chain.cjs +89 -67
- package/dist/option-chain.js +89 -67
- package/dist/option-position.cjs +88 -85
- package/dist/option-position.js +88 -85
- package/dist/pnl-diagram.cjs +20 -20
- package/dist/pnl-diagram.js +20 -20
- package/dist/popover.cjs +4 -8
- package/dist/popover.js +4 -8
- package/dist/progress.cjs +15 -22
- package/dist/progress.d.cts +6 -6
- package/dist/progress.d.ts +6 -6
- package/dist/progress.js +15 -22
- package/dist/radio.cjs +35 -67
- package/dist/radio.d.cts +18 -18
- package/dist/radio.d.ts +18 -18
- package/dist/radio.js +36 -68
- package/dist/select.cjs +40 -39
- package/dist/select.d.cts +35 -4
- package/dist/select.d.ts +35 -4
- package/dist/select.js +40 -38
- package/dist/separator.cjs +8 -33
- package/dist/separator.js +8 -33
- package/dist/slider.cjs +33 -49
- package/dist/slider.js +34 -50
- package/dist/switch.cjs +48 -55
- package/dist/switch.js +49 -56
- package/dist/tabs.cjs +108 -197
- package/dist/tabs.d.cts +16 -60
- package/dist/tabs.d.ts +16 -60
- package/dist/tabs.js +109 -196
- package/dist/tag.cjs +112 -69
- package/dist/tag.js +113 -69
- package/dist/textarea.cjs +56 -27
- package/dist/textarea.js +57 -28
- package/dist/toaster.cjs +97 -79
- package/dist/toaster.d.cts +7 -8
- package/dist/toaster.d.ts +7 -8
- package/dist/toaster.js +78 -80
- package/dist/tooltip.cjs +28 -17
- package/dist/tooltip.js +30 -18
- package/package.json +2 -16
- package/src/accordion.tsx +173 -227
- package/src/alert.tsx +78 -45
- package/src/avatar.tsx +54 -37
- package/src/badge.tsx +65 -44
- package/src/checkbox.tsx +70 -89
- package/src/close-button.tsx +3 -8
- package/src/collapsible.tsx +55 -52
- package/src/drawer.tsx +123 -115
- package/src/empty-state.tsx +21 -17
- package/src/expiration-selector.tsx +84 -66
- package/src/field.tsx +68 -124
- package/src/greeks-display.tsx +59 -51
- package/src/heading.tsx +22 -26
- package/src/icon-button.tsx +134 -141
- package/src/ink.tsx +37 -0
- package/src/input-group.tsx +59 -36
- package/src/input.tsx +41 -32
- package/src/menu.tsx +224 -397
- package/src/option-chain.tsx +154 -104
- package/src/option-position.tsx +136 -114
- package/src/pin-input.tsx +37 -29
- package/src/pnl-diagram.tsx +36 -28
- package/src/popover.tsx +1 -1
- package/src/progress.tsx +17 -21
- package/src/radio.tsx +56 -75
- package/src/select.tsx +80 -59
- package/src/separator.tsx +13 -34
- package/src/slider.tsx +43 -44
- package/src/strategy-builder.tsx +245 -156
- package/src/switch.tsx +63 -64
- package/src/tabs.tsx +166 -296
- package/src/tag.tsx +89 -51
- package/src/textarea.tsx +19 -29
- package/src/toaster.tsx +118 -86
- package/src/tooltip.tsx +21 -13
- package/tokens.css +79 -0
package/dist/icon-button.js
CHANGED
|
@@ -209,59 +209,74 @@ var IconButtonFrame = styled(View, {
|
|
|
209
209
|
size: {
|
|
210
210
|
"2xs": { width: 20, height: 20, borderRadius: 4 },
|
|
211
211
|
"2xs_alt": { width: 20, height: 20, borderRadius: 4 },
|
|
212
|
-
md: { width: 32, height: 32, borderRadius:
|
|
212
|
+
md: { width: 32, height: 32, borderRadius: 8 }
|
|
213
213
|
},
|
|
214
214
|
disabled: {
|
|
215
|
-
true: {
|
|
216
|
-
opacity: 0.4,
|
|
217
|
-
cursor: "not-allowed",
|
|
218
|
-
pointerEvents: "none"
|
|
219
|
-
}
|
|
215
|
+
true: { opacity: 0.4, cursor: "not-allowed", pointerEvents: "none" }
|
|
220
216
|
}
|
|
221
217
|
}
|
|
222
218
|
});
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
219
|
+
var HOVER = "var(--color-hover)";
|
|
220
|
+
var SELECTED_BG = "var(--color-selected-control-bg)";
|
|
221
|
+
var SELECTED_FG = "var(--color-selected-control-text)";
|
|
222
|
+
var VARIANT = {
|
|
223
|
+
plain: {
|
|
224
|
+
rest: { backgroundColor: "transparent", hoverStyle: { backgroundColor: "transparent" } }
|
|
225
|
+
},
|
|
226
|
+
icon_secondary: {
|
|
227
|
+
rest: {
|
|
228
|
+
backgroundColor: "transparent",
|
|
229
|
+
color: "var(--color-icon-secondary)",
|
|
230
|
+
hoverStyle: { color: HOVER }
|
|
231
|
+
},
|
|
232
|
+
selected: { backgroundColor: SELECTED_BG, color: SELECTED_FG, hoverStyle: { color: HOVER } },
|
|
233
|
+
expanded: { color: HOVER }
|
|
234
|
+
},
|
|
235
|
+
icon_background: {
|
|
236
|
+
rest: {
|
|
237
|
+
backgroundColor: "var(--color-button-icon-background-bg)",
|
|
238
|
+
color: "var(--color-icon-secondary)",
|
|
239
|
+
hoverStyle: { color: HOVER }
|
|
240
|
+
},
|
|
241
|
+
selected: { backgroundColor: SELECTED_BG, color: SELECTED_FG, hoverStyle: { color: HOVER } },
|
|
242
|
+
expanded: { color: HOVER }
|
|
243
|
+
},
|
|
244
|
+
link: {
|
|
245
|
+
rest: {
|
|
246
|
+
backgroundColor: "transparent",
|
|
247
|
+
color: "var(--color-link-primary)",
|
|
248
|
+
fontWeight: "400",
|
|
249
|
+
paddingHorizontal: 0,
|
|
250
|
+
height: "auto",
|
|
251
|
+
hoverStyle: { backgroundColor: "transparent", color: "var(--color-link-primary-hover)" },
|
|
252
|
+
disabledStyle: { color: "var(--color-text-secondary)" }
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
dropdown: {
|
|
256
|
+
rest: {
|
|
257
|
+
borderWidth: 2,
|
|
258
|
+
borderStyle: "solid",
|
|
259
|
+
backgroundColor: "transparent",
|
|
260
|
+
color: "var(--color-button-dropdown-fg)",
|
|
261
|
+
borderColor: "var(--color-button-dropdown-border)",
|
|
262
|
+
hoverStyle: { backgroundColor: "transparent", color: HOVER, borderColor: HOVER }
|
|
263
|
+
},
|
|
264
|
+
selected: { backgroundColor: SELECTED_BG, color: SELECTED_FG, borderColor: "transparent", hoverStyle: { color: HOVER } },
|
|
265
|
+
expanded: { backgroundColor: "transparent", color: HOVER, borderColor: HOVER }
|
|
266
|
+
},
|
|
267
|
+
pagination: {
|
|
268
|
+
rest: {
|
|
269
|
+
borderWidth: 2,
|
|
270
|
+
borderStyle: "solid",
|
|
271
|
+
backgroundColor: "transparent",
|
|
272
|
+
color: "var(--color-button-pagination-fg)",
|
|
273
|
+
borderColor: "var(--color-button-pagination-border)",
|
|
274
|
+
hoverStyle: { backgroundColor: "transparent", color: HOVER, borderColor: HOVER }
|
|
275
|
+
},
|
|
276
|
+
selected: { backgroundColor: SELECTED_BG, color: SELECTED_FG, borderColor: "transparent" }
|
|
277
|
+
}
|
|
263
278
|
};
|
|
264
|
-
var
|
|
279
|
+
var ICON_SIZE = { "2xs": 20, "2xs_alt": 12, md: 20 };
|
|
265
280
|
var IconButton = React.forwardRef(
|
|
266
281
|
function IconButton2(props, ref) {
|
|
267
282
|
const {
|
|
@@ -275,58 +290,43 @@ var IconButton = React.forwardRef(
|
|
|
275
290
|
disabled,
|
|
276
291
|
className,
|
|
277
292
|
children,
|
|
278
|
-
as:
|
|
293
|
+
as: asProp,
|
|
279
294
|
style: styleProp,
|
|
280
|
-
// Strip Chakra style props
|
|
281
|
-
boxSize: _boxSize,
|
|
282
|
-
color: _color,
|
|
283
|
-
px: _px,
|
|
284
|
-
borderRadius: _borderRadius,
|
|
285
|
-
ml: _ml,
|
|
286
|
-
mr: _mr,
|
|
287
|
-
_hover,
|
|
288
|
-
_expanded,
|
|
289
295
|
...rest
|
|
290
296
|
} = props;
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
const bs = typeof _boxSize === "number" ? `${_boxSize * SP}px` : _boxSize;
|
|
294
|
-
shimStyle.width = bs;
|
|
295
|
-
shimStyle.height = bs;
|
|
296
|
-
}
|
|
297
|
-
if (_color) shimStyle.color = _color;
|
|
298
|
-
if (_px !== void 0) {
|
|
299
|
-
const v = typeof _px === "number" ? `${_px * SP}px` : _px;
|
|
300
|
-
shimStyle.paddingLeft = v;
|
|
301
|
-
shimStyle.paddingRight = v;
|
|
302
|
-
}
|
|
303
|
-
if (_borderRadius) shimStyle.borderRadius = _borderRadius;
|
|
304
|
-
if (_ml !== void 0) shimStyle.marginLeft = typeof _ml === "number" ? `${_ml * SP}px` : _ml;
|
|
305
|
-
if (_mr !== void 0) shimStyle.marginRight = typeof _mr === "number" ? `${_mr * SP}px` : _mr;
|
|
306
|
-
const mergedStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
|
|
307
|
-
const variantClass = VARIANT_CLASSES[variant] ?? VARIANT_CLASSES.plain;
|
|
308
|
-
const iconSizeClass = size ? ICON_SIZE_CLASSES[size] ?? "" : "";
|
|
309
|
-
const combinedClassName = [variantClass, iconSizeClass, className].filter(Boolean).join(" ");
|
|
297
|
+
const look = VARIANT[variant] ?? VARIANT.plain;
|
|
298
|
+
const iconSize = size ? ICON_SIZE[size] : void 0;
|
|
310
299
|
const button = /* @__PURE__ */ jsx(
|
|
311
300
|
IconButtonFrame,
|
|
312
301
|
{
|
|
313
302
|
ref,
|
|
314
303
|
size,
|
|
315
304
|
disabled: !loadingSkeleton && (loading || disabled) || void 0,
|
|
316
|
-
render:
|
|
317
|
-
className:
|
|
318
|
-
style:
|
|
305
|
+
render: asProp ? React.createElement(asProp) : void 0,
|
|
306
|
+
className: ["lux-icon", className].filter(Boolean).join(" "),
|
|
307
|
+
style: { ...styleProp, ...iconSize ? { "--icon-size": `${iconSize}px` } : null },
|
|
308
|
+
...look.rest,
|
|
309
|
+
...selected ? look.selected : null,
|
|
310
|
+
...expanded ? look.expanded : null,
|
|
319
311
|
...expanded ? { "data-expanded": true } : {},
|
|
320
312
|
...selected ? { "data-selected": true } : {},
|
|
321
313
|
...highlighted ? { "data-highlighted": true } : {},
|
|
322
314
|
...loadingSkeleton ? { "data-loading-skeleton": true } : {},
|
|
323
315
|
...rest,
|
|
324
316
|
children: loading ? /* @__PURE__ */ jsx(
|
|
325
|
-
|
|
317
|
+
View,
|
|
326
318
|
{
|
|
327
|
-
className: "
|
|
319
|
+
className: "lux-spin",
|
|
320
|
+
render: /* @__PURE__ */ jsx("span", {}),
|
|
328
321
|
role: "status",
|
|
329
|
-
"aria-label": "Loading"
|
|
322
|
+
"aria-label": "Loading",
|
|
323
|
+
width: 20,
|
|
324
|
+
height: 20,
|
|
325
|
+
borderRadius: 1e3,
|
|
326
|
+
borderWidth: 2,
|
|
327
|
+
borderColor: "currentColor",
|
|
328
|
+
borderBottomColor: "transparent",
|
|
329
|
+
borderLeftColor: "transparent"
|
|
330
330
|
}
|
|
331
331
|
) : children
|
|
332
332
|
}
|