@luxfi/ui 7.4.0 → 7.4.2
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/avatar.cjs +7 -6
- package/dist/avatar.js +7 -5
- package/dist/badge.cjs +30 -32
- package/dist/badge.js +30 -32
- package/dist/bank.d.cts +3 -3
- package/dist/bank.d.ts +3 -3
- package/dist/checkbox.cjs +4 -4
- package/dist/checkbox.d.cts +3 -2
- package/dist/checkbox.d.ts +3 -2
- package/dist/checkbox.js +5 -4
- package/dist/chrome.cjs +950 -0
- package/dist/chrome.d.cts +93 -0
- package/dist/chrome.d.ts +93 -0
- package/dist/chrome.js +921 -0
- package/dist/drawer.cjs +86 -20
- package/dist/drawer.js +85 -19
- package/dist/expiration-selector.cjs +3 -2
- package/dist/expiration-selector.js +3 -2
- package/dist/greeks-display.cjs +6 -6
- package/dist/greeks-display.js +6 -6
- package/dist/gui.cjs +13 -0
- package/dist/gui.d.cts +2 -0
- package/dist/gui.d.ts +2 -0
- package/dist/gui.js +2 -0
- package/dist/heading.cjs +4 -2
- package/dist/heading.js +4 -2
- package/dist/iam.cjs +206 -0
- package/dist/iam.d.cts +65 -0
- package/dist/iam.d.ts +65 -0
- package/dist/iam.js +201 -0
- package/dist/icons.cjs +13 -0
- package/dist/icons.d.cts +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +2 -0
- package/dist/identity.cjs +420 -0
- package/dist/identity.d.cts +64 -0
- package/dist/identity.d.ts +64 -0
- package/dist/identity.js +398 -0
- package/dist/index.cjs +1597 -833
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +1574 -828
- package/dist/input.cjs +3 -1
- package/dist/input.d.cts +3 -5
- package/dist/input.d.ts +3 -5
- package/dist/input.js +3 -1
- package/dist/lux.config.cjs +23 -2
- package/dist/lux.config.d.cts +28 -10
- package/dist/lux.config.d.ts +28 -10
- package/dist/lux.config.js +23 -2
- package/dist/menu.cjs +4 -4
- package/dist/menu.js +4 -4
- package/dist/next.cjs +99 -0
- package/dist/next.d.cts +29 -0
- package/dist/next.d.ts +29 -0
- package/dist/next.js +96 -0
- package/dist/option-chain.cjs +1 -1
- package/dist/option-chain.js +1 -1
- package/dist/option-position.cjs +2 -1
- package/dist/option-position.js +2 -1
- package/dist/pnl-diagram.cjs +8 -6
- package/dist/pnl-diagram.js +8 -6
- package/dist/progress.cjs +7 -6
- package/dist/progress.js +7 -5
- package/dist/provider.cjs +136 -4
- package/dist/provider.d.cts +15 -3
- package/dist/provider.d.ts +15 -3
- package/dist/provider.js +136 -5
- package/dist/radio.cjs +9 -7
- package/dist/radio.js +10 -7
- package/dist/separator.cjs +3 -1
- package/dist/separator.js +3 -1
- package/dist/slider.cjs +28 -16
- package/dist/slider.js +28 -15
- package/dist/strategy-builder.cjs +2 -1
- package/dist/strategy-builder.js +2 -1
- package/dist/switch.cjs +11 -12
- package/dist/switch.js +12 -12
- package/dist/tag.cjs +31 -33
- package/dist/tag.js +30 -32
- package/dist/textarea.cjs +3 -1
- package/dist/textarea.js +3 -1
- package/dist/tooltip.cjs +25 -27
- package/dist/tooltip.js +24 -26
- package/dist/use-narrow.cjs +46 -0
- package/dist/use-narrow.d.cts +12 -0
- package/dist/use-narrow.d.ts +12 -0
- package/dist/use-narrow.js +20 -0
- package/dist/vite.cjs +40 -0
- package/dist/vite.d.cts +29 -0
- package/dist/vite.d.ts +29 -0
- package/dist/vite.js +38 -0
- package/dist/white-label.cjs +132 -0
- package/dist/white-label.d.cts +59 -0
- package/dist/white-label.d.ts +59 -0
- package/dist/white-label.js +124 -0
- package/package.json +85 -19
- package/src/avatar.tsx +22 -16
- package/src/checkbox.tsx +15 -10
- package/src/chrome.tsx +459 -0
- package/src/drawer.tsx +83 -10
- package/src/expiration-selector.tsx +3 -2
- package/src/greeks-display.tsx +9 -6
- package/src/gui.ts +17 -0
- package/src/heading.tsx +12 -8
- package/src/iam.ts +170 -0
- package/src/icons.ts +18 -0
- package/src/identity.tsx +318 -0
- package/src/index.ts +44 -1
- package/src/input.tsx +13 -9
- package/src/lux.config.ts +16 -15
- package/src/menu.tsx +4 -4
- package/src/next.ts +142 -0
- package/src/option-chain.tsx +1 -1
- package/src/option-position.tsx +2 -1
- package/src/pnl-diagram.tsx +11 -6
- package/src/progress.tsx +15 -8
- package/src/provider.tsx +48 -7
- package/src/radio.tsx +15 -11
- package/src/separator.tsx +8 -3
- package/src/slider.tsx +35 -19
- package/src/strategy-builder.tsx +3 -2
- package/src/switch.tsx +17 -16
- package/src/textarea.tsx +8 -4
- package/src/tooltip.tsx +2 -21
- package/src/use-narrow.ts +40 -0
- package/src/vite.ts +78 -0
- package/src/white-label.ts +240 -0
- package/tokens.css +544 -319
- package/src/tokens.css +0 -438
package/dist/radio.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var gui = require('@hanzo/gui');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -25,7 +25,6 @@ function _interopNamespace(e) {
|
|
|
25
25
|
return Object.freeze(n);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var RadixRadioGroup__namespace = /*#__PURE__*/_interopNamespace(RadixRadioGroup);
|
|
29
28
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
29
|
|
|
31
30
|
// src/radio.tsx
|
|
@@ -68,7 +67,8 @@ var RadioGroupBase = React__namespace.forwardRef(
|
|
|
68
67
|
disabled = false,
|
|
69
68
|
readOnly = false,
|
|
70
69
|
orientation = "vertical",
|
|
71
|
-
loop
|
|
70
|
+
// `loop` was a Radix-only knob; gui's roving focus always wraps.
|
|
71
|
+
loop: _loop = true,
|
|
72
72
|
defaultValue,
|
|
73
73
|
value,
|
|
74
74
|
onValueChange,
|
|
@@ -84,14 +84,14 @@ var RadioGroupBase = React__namespace.forwardRef(
|
|
|
84
84
|
[readOnly, onValueChange]
|
|
85
85
|
);
|
|
86
86
|
return /* @__PURE__ */ jsxRuntime.jsx(RadioSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
-
|
|
87
|
+
gui.RadioGroup,
|
|
88
88
|
{
|
|
89
89
|
ref,
|
|
90
|
+
unstyled: true,
|
|
90
91
|
name,
|
|
91
92
|
required,
|
|
92
93
|
disabled: disabled || readOnly,
|
|
93
94
|
orientation,
|
|
94
|
-
loop,
|
|
95
95
|
defaultValue,
|
|
96
96
|
value: value ?? void 0,
|
|
97
97
|
onValueChange: handleValueChange,
|
|
@@ -128,8 +128,9 @@ var RadioBase = React__namespace.forwardRef(
|
|
|
128
128
|
...rest,
|
|
129
129
|
children: [
|
|
130
130
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
131
|
-
|
|
131
|
+
gui.RadioGroup.Item,
|
|
132
132
|
{
|
|
133
|
+
unstyled: true,
|
|
133
134
|
value,
|
|
134
135
|
disabled,
|
|
135
136
|
className: cn(
|
|
@@ -141,8 +142,9 @@ var RadioBase = React__namespace.forwardRef(
|
|
|
141
142
|
sizeClasses.control
|
|
142
143
|
),
|
|
143
144
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
144
|
-
|
|
145
|
+
gui.RadioGroup.Indicator,
|
|
145
146
|
{
|
|
147
|
+
unstyled: true,
|
|
146
148
|
className: cn(
|
|
147
149
|
"block rounded-full bg-gray-800 dark:bg-white",
|
|
148
150
|
sizeClasses.indicator
|
package/dist/radio.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { RadioGroup } from '@hanzo/gui';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -37,7 +37,7 @@ var SIZE_CLASSES = {
|
|
|
37
37
|
};
|
|
38
38
|
var RadioSizeContext = React.createContext("md");
|
|
39
39
|
var RadioGroupBase = React.forwardRef(
|
|
40
|
-
function RadioGroup(props, ref) {
|
|
40
|
+
function RadioGroup$1(props, ref) {
|
|
41
41
|
const {
|
|
42
42
|
children,
|
|
43
43
|
name,
|
|
@@ -45,7 +45,8 @@ var RadioGroupBase = React.forwardRef(
|
|
|
45
45
|
disabled = false,
|
|
46
46
|
readOnly = false,
|
|
47
47
|
orientation = "vertical",
|
|
48
|
-
loop
|
|
48
|
+
// `loop` was a Radix-only knob; gui's roving focus always wraps.
|
|
49
|
+
loop: _loop = true,
|
|
49
50
|
defaultValue,
|
|
50
51
|
value,
|
|
51
52
|
onValueChange,
|
|
@@ -61,14 +62,14 @@ var RadioGroupBase = React.forwardRef(
|
|
|
61
62
|
[readOnly, onValueChange]
|
|
62
63
|
);
|
|
63
64
|
return /* @__PURE__ */ jsx(RadioSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx(
|
|
64
|
-
|
|
65
|
+
RadioGroup,
|
|
65
66
|
{
|
|
66
67
|
ref,
|
|
68
|
+
unstyled: true,
|
|
67
69
|
name,
|
|
68
70
|
required,
|
|
69
71
|
disabled: disabled || readOnly,
|
|
70
72
|
orientation,
|
|
71
|
-
loop,
|
|
72
73
|
defaultValue,
|
|
73
74
|
value: value ?? void 0,
|
|
74
75
|
onValueChange: handleValueChange,
|
|
@@ -105,8 +106,9 @@ var RadioBase = React.forwardRef(
|
|
|
105
106
|
...rest,
|
|
106
107
|
children: [
|
|
107
108
|
/* @__PURE__ */ jsx(
|
|
108
|
-
|
|
109
|
+
RadioGroup.Item,
|
|
109
110
|
{
|
|
111
|
+
unstyled: true,
|
|
110
112
|
value,
|
|
111
113
|
disabled,
|
|
112
114
|
className: cn(
|
|
@@ -118,8 +120,9 @@ var RadioBase = React.forwardRef(
|
|
|
118
120
|
sizeClasses.control
|
|
119
121
|
),
|
|
120
122
|
children: /* @__PURE__ */ jsx(
|
|
121
|
-
|
|
123
|
+
RadioGroup.Indicator,
|
|
122
124
|
{
|
|
125
|
+
unstyled: true,
|
|
123
126
|
className: cn(
|
|
124
127
|
"block rounded-full bg-gray-800 dark:bg-white",
|
|
125
128
|
sizeClasses.indicator
|
package/dist/separator.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var gui = require('@hanzo/gui');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var clsx = require('clsx');
|
|
6
7
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -35,9 +36,10 @@ var Separator = React__default.default.forwardRef(
|
|
|
35
36
|
function Separator2({ orientation = "horizontal", variant = "solid", size = "sm", className, ...rest }, ref) {
|
|
36
37
|
const isVertical = orientation === "vertical";
|
|
37
38
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
-
|
|
39
|
+
gui.Separator,
|
|
39
40
|
{
|
|
40
41
|
ref,
|
|
42
|
+
vertical: isVertical,
|
|
41
43
|
role: "separator",
|
|
42
44
|
"aria-orientation": orientation,
|
|
43
45
|
className: cn(
|
package/dist/separator.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Separator as Separator$1 } from '@hanzo/gui';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { clsx } from 'clsx';
|
|
4
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -29,9 +30,10 @@ var Separator = React.forwardRef(
|
|
|
29
30
|
function Separator2({ orientation = "horizontal", variant = "solid", size = "sm", className, ...rest }, ref) {
|
|
30
31
|
const isVertical = orientation === "vertical";
|
|
31
32
|
return /* @__PURE__ */ jsx(
|
|
32
|
-
|
|
33
|
+
Separator$1,
|
|
33
34
|
{
|
|
34
35
|
ref,
|
|
36
|
+
vertical: isVertical,
|
|
35
37
|
role: "separator",
|
|
36
38
|
"aria-orientation": orientation,
|
|
37
39
|
className: cn(
|
package/dist/slider.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var gui = require('@hanzo/gui');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -25,15 +25,12 @@ function _interopNamespace(e) {
|
|
|
25
25
|
return Object.freeze(n);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var RadixSlider__namespace = /*#__PURE__*/_interopNamespace(RadixSlider);
|
|
29
28
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
29
|
|
|
31
30
|
// src/slider.tsx
|
|
32
31
|
function cn(...inputs) {
|
|
33
32
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
34
33
|
}
|
|
35
|
-
var THUMB_SIZE = 20;
|
|
36
|
-
var TRACK_HEIGHT = 6;
|
|
37
34
|
var Slider = React__namespace.forwardRef(
|
|
38
35
|
function Slider2(props, ref) {
|
|
39
36
|
const {
|
|
@@ -46,7 +43,7 @@ var Slider = React__namespace.forwardRef(
|
|
|
46
43
|
max = 100,
|
|
47
44
|
step,
|
|
48
45
|
disabled,
|
|
49
|
-
orientation,
|
|
46
|
+
orientation = "horizontal",
|
|
50
47
|
name,
|
|
51
48
|
onValueChange,
|
|
52
49
|
onValueCommit,
|
|
@@ -58,6 +55,14 @@ var Slider = React__namespace.forwardRef(
|
|
|
58
55
|
return mark;
|
|
59
56
|
});
|
|
60
57
|
const hasMarkLabel = Boolean(marks?.some((mark) => mark.label));
|
|
58
|
+
const latest = React__namespace.useRef(value ?? defaultValue ?? []);
|
|
59
|
+
const handleValueChange = React__namespace.useCallback((next) => {
|
|
60
|
+
latest.current = next;
|
|
61
|
+
onValueChange?.(next);
|
|
62
|
+
}, [onValueChange]);
|
|
63
|
+
const handleSlideEnd = React__namespace.useCallback(() => {
|
|
64
|
+
onValueCommit?.(latest.current);
|
|
65
|
+
}, [onValueCommit]);
|
|
61
66
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
62
67
|
label && !showValue && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-text-secondary", children: label }),
|
|
63
68
|
label && showValue && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -65,9 +70,10 @@ var Slider = React__namespace.forwardRef(
|
|
|
65
70
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-text-secondary", children: (value ?? defaultValue ?? [])?.join(", ") })
|
|
66
71
|
] }),
|
|
67
72
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
68
|
-
|
|
73
|
+
gui.Slider,
|
|
69
74
|
{
|
|
70
75
|
ref,
|
|
76
|
+
unstyled: true,
|
|
71
77
|
className: cn(
|
|
72
78
|
"relative flex w-full touch-none select-none items-center",
|
|
73
79
|
hasMarkLabel && "mb-6"
|
|
@@ -80,24 +86,30 @@ var Slider = React__namespace.forwardRef(
|
|
|
80
86
|
disabled,
|
|
81
87
|
orientation,
|
|
82
88
|
name,
|
|
83
|
-
onValueChange,
|
|
84
|
-
|
|
89
|
+
onValueChange: handleValueChange,
|
|
90
|
+
onSlideEnd: handleSlideEnd,
|
|
85
91
|
children: [
|
|
86
92
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
-
|
|
93
|
+
gui.Slider.Track,
|
|
88
94
|
{
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
unstyled: true,
|
|
96
|
+
className: "relative grow h-1.5 rounded-full bg-border-divider",
|
|
97
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
98
|
+
gui.Slider.TrackActive,
|
|
99
|
+
{
|
|
100
|
+
unstyled: true,
|
|
101
|
+
className: "absolute h-full rounded-full bg-link-primary"
|
|
102
|
+
}
|
|
103
|
+
)
|
|
94
104
|
}
|
|
95
105
|
),
|
|
96
106
|
resolvedValue?.map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
97
|
-
|
|
107
|
+
gui.Slider.Thumb,
|
|
98
108
|
{
|
|
109
|
+
index,
|
|
110
|
+
unstyled: true,
|
|
99
111
|
className: cn(
|
|
100
|
-
|
|
112
|
+
"block h-5 w-5",
|
|
101
113
|
"rounded-full border-2 border-link-primary bg-white",
|
|
102
114
|
"shadow-sm transition-colors",
|
|
103
115
|
"hover:border-link-primary-hover",
|
package/dist/slider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { Slider as Slider$1 } from '@hanzo/gui';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -9,8 +9,6 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
9
9
|
function cn(...inputs) {
|
|
10
10
|
return twMerge(clsx(inputs));
|
|
11
11
|
}
|
|
12
|
-
var THUMB_SIZE = 20;
|
|
13
|
-
var TRACK_HEIGHT = 6;
|
|
14
12
|
var Slider = React.forwardRef(
|
|
15
13
|
function Slider2(props, ref) {
|
|
16
14
|
const {
|
|
@@ -23,7 +21,7 @@ var Slider = React.forwardRef(
|
|
|
23
21
|
max = 100,
|
|
24
22
|
step,
|
|
25
23
|
disabled,
|
|
26
|
-
orientation,
|
|
24
|
+
orientation = "horizontal",
|
|
27
25
|
name,
|
|
28
26
|
onValueChange,
|
|
29
27
|
onValueCommit,
|
|
@@ -35,6 +33,14 @@ var Slider = React.forwardRef(
|
|
|
35
33
|
return mark;
|
|
36
34
|
});
|
|
37
35
|
const hasMarkLabel = Boolean(marks?.some((mark) => mark.label));
|
|
36
|
+
const latest = React.useRef(value ?? defaultValue ?? []);
|
|
37
|
+
const handleValueChange = React.useCallback((next) => {
|
|
38
|
+
latest.current = next;
|
|
39
|
+
onValueChange?.(next);
|
|
40
|
+
}, [onValueChange]);
|
|
41
|
+
const handleSlideEnd = React.useCallback(() => {
|
|
42
|
+
onValueCommit?.(latest.current);
|
|
43
|
+
}, [onValueCommit]);
|
|
38
44
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
39
45
|
label && !showValue && /* @__PURE__ */ jsx("label", { className: "text-sm font-medium text-text-secondary", children: label }),
|
|
40
46
|
label && showValue && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -42,9 +48,10 @@ var Slider = React.forwardRef(
|
|
|
42
48
|
/* @__PURE__ */ jsx("span", { className: "text-sm text-text-secondary", children: (value ?? defaultValue ?? [])?.join(", ") })
|
|
43
49
|
] }),
|
|
44
50
|
/* @__PURE__ */ jsxs(
|
|
45
|
-
|
|
51
|
+
Slider$1,
|
|
46
52
|
{
|
|
47
53
|
ref,
|
|
54
|
+
unstyled: true,
|
|
48
55
|
className: cn(
|
|
49
56
|
"relative flex w-full touch-none select-none items-center",
|
|
50
57
|
hasMarkLabel && "mb-6"
|
|
@@ -57,24 +64,30 @@ var Slider = React.forwardRef(
|
|
|
57
64
|
disabled,
|
|
58
65
|
orientation,
|
|
59
66
|
name,
|
|
60
|
-
onValueChange,
|
|
61
|
-
|
|
67
|
+
onValueChange: handleValueChange,
|
|
68
|
+
onSlideEnd: handleSlideEnd,
|
|
62
69
|
children: [
|
|
63
70
|
/* @__PURE__ */ jsx(
|
|
64
|
-
|
|
71
|
+
Slider$1.Track,
|
|
65
72
|
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
unstyled: true,
|
|
74
|
+
className: "relative grow h-1.5 rounded-full bg-border-divider",
|
|
75
|
+
children: /* @__PURE__ */ jsx(
|
|
76
|
+
Slider$1.TrackActive,
|
|
77
|
+
{
|
|
78
|
+
unstyled: true,
|
|
79
|
+
className: "absolute h-full rounded-full bg-link-primary"
|
|
80
|
+
}
|
|
81
|
+
)
|
|
71
82
|
}
|
|
72
83
|
),
|
|
73
84
|
resolvedValue?.map((_, index) => /* @__PURE__ */ jsx(
|
|
74
|
-
|
|
85
|
+
Slider$1.Thumb,
|
|
75
86
|
{
|
|
87
|
+
index,
|
|
88
|
+
unstyled: true,
|
|
76
89
|
className: cn(
|
|
77
|
-
|
|
90
|
+
"block h-5 w-5",
|
|
78
91
|
"rounded-full border-2 border-link-primary bg-white",
|
|
79
92
|
"shadow-sm transition-colors",
|
|
80
93
|
"hover:border-link-primary-hover",
|
|
@@ -161,7 +161,8 @@ function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemov
|
|
|
161
161
|
type: "button",
|
|
162
162
|
className: cn(
|
|
163
163
|
"px-2 py-0.5 rounded text-xs font-medium transition-colors",
|
|
164
|
-
|
|
164
|
+
// Call vs put is a rank difference, not a hue difference.
|
|
165
|
+
leg.type === "call" ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
|
|
165
166
|
),
|
|
166
167
|
onClick: () => update({ type: leg.type === "call" ? "put" : "call" }),
|
|
167
168
|
children: leg.type === "call" ? "CALL" : "PUT"
|
package/dist/strategy-builder.js
CHANGED
|
@@ -139,7 +139,8 @@ function LegRow({ leg, index, strikes, expirations, removable, onChange, onRemov
|
|
|
139
139
|
type: "button",
|
|
140
140
|
className: cn(
|
|
141
141
|
"px-2 py-0.5 rounded text-xs font-medium transition-colors",
|
|
142
|
-
|
|
142
|
+
// Call vs put is a rank difference, not a hue difference.
|
|
143
|
+
leg.type === "call" ? "bg-[var(--secondary)] text-[var(--foreground)]" : "bg-[var(--muted)] text-[var(--muted-foreground)]"
|
|
143
144
|
),
|
|
144
145
|
onClick: () => update({ type: leg.type === "call" ? "put" : "call" }),
|
|
145
146
|
children: leg.type === "call" ? "CALL" : "PUT"
|
package/dist/switch.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var gui = require('@hanzo/gui');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -25,7 +25,6 @@ function _interopNamespace(e) {
|
|
|
25
25
|
return Object.freeze(n);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var RadixSwitch__namespace = /*#__PURE__*/_interopNamespace(RadixSwitch);
|
|
29
28
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
29
|
|
|
31
30
|
// src/switch.tsx
|
|
@@ -37,17 +36,17 @@ var NOOP = () => {
|
|
|
37
36
|
var SIZE_CLASSES = {
|
|
38
37
|
sm: {
|
|
39
38
|
root: "h-4 w-7",
|
|
40
|
-
thumb: "h-3 w-3
|
|
39
|
+
thumb: "h-3 w-3",
|
|
41
40
|
label: "text-xs"
|
|
42
41
|
},
|
|
43
42
|
md: {
|
|
44
43
|
root: "h-5 w-9",
|
|
45
|
-
thumb: "h-4 w-4
|
|
44
|
+
thumb: "h-4 w-4",
|
|
46
45
|
label: "text-sm"
|
|
47
46
|
},
|
|
48
47
|
lg: {
|
|
49
48
|
root: "h-6 w-11",
|
|
50
|
-
thumb: "h-5 w-5
|
|
49
|
+
thumb: "h-5 w-5",
|
|
51
50
|
label: "text-base"
|
|
52
51
|
}
|
|
53
52
|
};
|
|
@@ -78,9 +77,7 @@ var SwitchBase = React__namespace.forwardRef(
|
|
|
78
77
|
if (!isControlled) {
|
|
79
78
|
setInternalChecked(nextChecked);
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
onCheckedChange({ checked: nextChecked });
|
|
83
|
-
}
|
|
80
|
+
onCheckedChange?.({ checked: nextChecked });
|
|
84
81
|
},
|
|
85
82
|
[isControlled, onCheckedChange]
|
|
86
83
|
);
|
|
@@ -101,8 +98,9 @@ var SwitchBase = React__namespace.forwardRef(
|
|
|
101
98
|
...rest,
|
|
102
99
|
children: [
|
|
103
100
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
104
|
-
|
|
101
|
+
gui.Switch,
|
|
105
102
|
{
|
|
103
|
+
unstyled: true,
|
|
106
104
|
checked: checkedState,
|
|
107
105
|
onCheckedChange: handleCheckedChange,
|
|
108
106
|
disabled,
|
|
@@ -117,12 +115,13 @@ var SwitchBase = React__namespace.forwardRef(
|
|
|
117
115
|
children: [
|
|
118
116
|
trackLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-0 flex items-center justify-center text-[8px] font-bold text-white pointer-events-none", children: checkedState ? trackLabel.on : trackLabel.off }),
|
|
119
117
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
120
|
-
|
|
118
|
+
gui.Switch.Thumb,
|
|
121
119
|
{
|
|
120
|
+
unstyled: true,
|
|
121
|
+
"data-thumb": true,
|
|
122
|
+
transition: "quicker",
|
|
122
123
|
className: cn(
|
|
123
124
|
"block rounded-full bg-white shadow-sm",
|
|
124
|
-
"transition-transform duration-200",
|
|
125
|
-
"translate-x-0.5",
|
|
126
125
|
sizeClasses.thumb
|
|
127
126
|
),
|
|
128
127
|
children: thumbLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center h-full w-full text-[8px]", children: checkedState ? thumbLabel.on : thumbLabel.off })
|
package/dist/switch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { Switch } from '@hanzo/gui';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -14,22 +14,22 @@ var NOOP = () => {
|
|
|
14
14
|
var SIZE_CLASSES = {
|
|
15
15
|
sm: {
|
|
16
16
|
root: "h-4 w-7",
|
|
17
|
-
thumb: "h-3 w-3
|
|
17
|
+
thumb: "h-3 w-3",
|
|
18
18
|
label: "text-xs"
|
|
19
19
|
},
|
|
20
20
|
md: {
|
|
21
21
|
root: "h-5 w-9",
|
|
22
|
-
thumb: "h-4 w-4
|
|
22
|
+
thumb: "h-4 w-4",
|
|
23
23
|
label: "text-sm"
|
|
24
24
|
},
|
|
25
25
|
lg: {
|
|
26
26
|
root: "h-6 w-11",
|
|
27
|
-
thumb: "h-5 w-5
|
|
27
|
+
thumb: "h-5 w-5",
|
|
28
28
|
label: "text-base"
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
var SwitchBase = React.forwardRef(
|
|
32
|
-
function Switch(props, ref) {
|
|
32
|
+
function Switch$1(props, ref) {
|
|
33
33
|
const {
|
|
34
34
|
inputProps,
|
|
35
35
|
children,
|
|
@@ -55,9 +55,7 @@ var SwitchBase = React.forwardRef(
|
|
|
55
55
|
if (!isControlled) {
|
|
56
56
|
setInternalChecked(nextChecked);
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
onCheckedChange({ checked: nextChecked });
|
|
60
|
-
}
|
|
58
|
+
onCheckedChange?.({ checked: nextChecked });
|
|
61
59
|
},
|
|
62
60
|
[isControlled, onCheckedChange]
|
|
63
61
|
);
|
|
@@ -78,8 +76,9 @@ var SwitchBase = React.forwardRef(
|
|
|
78
76
|
...rest,
|
|
79
77
|
children: [
|
|
80
78
|
/* @__PURE__ */ jsxs(
|
|
81
|
-
|
|
79
|
+
Switch,
|
|
82
80
|
{
|
|
81
|
+
unstyled: true,
|
|
83
82
|
checked: checkedState,
|
|
84
83
|
onCheckedChange: handleCheckedChange,
|
|
85
84
|
disabled,
|
|
@@ -94,12 +93,13 @@ var SwitchBase = React.forwardRef(
|
|
|
94
93
|
children: [
|
|
95
94
|
trackLabel && /* @__PURE__ */ jsx("span", { className: "absolute inset-0 flex items-center justify-center text-[8px] font-bold text-white pointer-events-none", children: checkedState ? trackLabel.on : trackLabel.off }),
|
|
96
95
|
/* @__PURE__ */ jsx(
|
|
97
|
-
|
|
96
|
+
Switch.Thumb,
|
|
98
97
|
{
|
|
98
|
+
unstyled: true,
|
|
99
|
+
"data-thumb": true,
|
|
100
|
+
transition: "quicker",
|
|
99
101
|
className: cn(
|
|
100
102
|
"block rounded-full bg-white shadow-sm",
|
|
101
|
-
"transition-transform duration-200",
|
|
102
|
-
"translate-x-0.5",
|
|
103
103
|
sizeClasses.thumb
|
|
104
104
|
),
|
|
105
105
|
children: thumbLabel && /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center h-full w-full text-[8px]", children: checkedState ? thumbLabel.on : thumbLabel.off })
|