@ledgerhq/lumen-ui-react 0.1.11 → 0.1.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/index.js +53 -55
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +10 -10
- package/dist/lib/Components/AmountInput/AmountInput.d.ts +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.js +35 -32
- package/dist/lib/Components/Banner/Banner.js +5 -5
- package/dist/lib/Components/BaseInput/BaseInput.d.ts +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.js +44 -41
- package/dist/lib/Components/Button/BaseButton.d.ts +1 -1
- package/dist/lib/Components/Button/BaseButton.d.ts.map +1 -1
- package/dist/lib/Components/Button/BaseButton.js +28 -25
- package/dist/lib/Components/Button/Button.js +9 -9
- package/dist/lib/Components/ButtonTrigger/ButtonTrigger.d.ts +1 -1
- package/dist/lib/Components/ButtonTrigger/ButtonTrigger.d.ts.map +1 -1
- package/dist/lib/Components/ButtonTrigger/ButtonTrigger.js +37 -34
- package/dist/lib/Components/Card/Card.d.ts.map +1 -1
- package/dist/lib/Components/Card/Card.js +132 -129
- package/dist/lib/Components/Card/types.d.ts +1 -0
- package/dist/lib/Components/Card/types.d.ts.map +1 -1
- package/dist/lib/Components/CardButton/CardButton.d.ts +1 -1
- package/dist/lib/Components/CardButton/CardButton.d.ts.map +1 -1
- package/dist/lib/Components/CardButton/CardButton.js +28 -24
- package/dist/lib/Components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/lib/Components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/lib/Components/Checkbox/Checkbox.js +26 -14
- package/dist/lib/Components/Dialog/DialogHeader/DialogHeader.js +2 -2
- package/dist/lib/Components/Dialog/types.d.ts +1 -1
- package/dist/lib/Components/Icon/Icon.js +4 -4
- package/dist/lib/Components/Icon/createIcon.js +4 -4
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +1 -1
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +24 -18
- package/dist/lib/Components/InteractiveIcon/types.d.ts +6 -1
- package/dist/lib/Components/InteractiveIcon/types.d.ts.map +1 -1
- package/dist/lib/Components/Link/Link.d.ts +1 -1
- package/dist/lib/Components/Link/Link.d.ts.map +1 -1
- package/dist/lib/Components/Link/Link.js +44 -33
- package/dist/lib/Components/Link/types.d.ts +5 -0
- package/dist/lib/Components/Link/types.d.ts.map +1 -1
- package/dist/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/lib/Components/ListItem/ListItem.js +72 -65
- package/dist/lib/Components/Menu/Menu.d.ts +3 -3
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +133 -104
- package/dist/lib/Components/NavBar/CoinCapsule.js +4 -4
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.js +88 -51
- package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.d.ts +2 -2
- package/dist/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.js +94 -76
- package/dist/lib/Components/SideBar/SideBar.d.ts +1 -1
- package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.js +77 -74
- package/dist/lib/Components/SideBar/types.d.ts +12 -4
- package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
- package/dist/lib/Components/Spot/Spot.js +3 -3
- package/dist/lib/Components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/lib/Components/Stepper/Stepper.js +34 -24
- package/dist/lib/Components/Subheader/Subheader.d.ts +2 -7
- package/dist/lib/Components/Subheader/Subheader.d.ts.map +1 -1
- package/dist/lib/Components/Subheader/Subheader.js +31 -49
- package/dist/lib/Components/Subheader/index.d.ts +1 -1
- package/dist/lib/Components/Subheader/index.d.ts.map +1 -1
- package/dist/lib/Components/Subheader/types.d.ts +1 -11
- package/dist/lib/Components/Subheader/types.d.ts.map +1 -1
- package/dist/lib/Components/Switch/Switch.d.ts +1 -1
- package/dist/lib/Components/Switch/Switch.d.ts.map +1 -1
- package/dist/lib/Components/Switch/Switch.js +30 -22
- package/dist/lib/Components/Table/Table.js +49 -49
- package/dist/lib/Components/Tag/Tag.d.ts +1 -1
- package/dist/lib/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/lib/Components/Tag/Tag.js +17 -14
- package/dist/lib/Components/Tile/Tile.d.ts +5 -12
- package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/lib/Components/Tile/Tile.js +79 -82
- package/dist/lib/Components/Tile/index.d.ts +1 -1
- package/dist/lib/Components/Tile/index.d.ts.map +1 -1
- package/dist/lib/Components/Tile/types.d.ts +1 -10
- package/dist/lib/Components/Tile/types.d.ts.map +1 -1
- package/dist/lib/Components/TileButton/TileButton.d.ts +1 -1
- package/dist/lib/Components/TileButton/TileButton.d.ts.map +1 -1
- package/dist/lib/Components/TileButton/TileButton.js +26 -23
- package/dist/libs/utils-shared/dist/index.js +95 -90
- package/dist/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { cn as o } from "../../../libs/utils-shared/dist/index.js";
|
|
1
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { cn as o, useDisabledContext as c, DisabledProvider as p } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import * as t from "@radix-ui/react-dropdown-menu";
|
|
4
|
-
import { Check as
|
|
5
|
-
import { Divider as
|
|
6
|
-
import { ChevronRight as
|
|
7
|
-
const
|
|
4
|
+
import { Check as b } from "../../Symbols/Icons/Check.js";
|
|
5
|
+
import { Divider as g } from "../Divider/Divider.js";
|
|
6
|
+
import { ChevronRight as h } from "../../Symbols/Icons/ChevronRight.js";
|
|
7
|
+
const N = o(
|
|
8
8
|
"z-menu min-w-160 overflow-hidden rounded-sm bg-muted p-8",
|
|
9
9
|
"shadow-sm",
|
|
10
10
|
"data-[state=open]:animate-fade-in",
|
|
11
11
|
"data-[state=closed]:animate-fade-out"
|
|
12
|
-
),
|
|
12
|
+
), l = o(
|
|
13
13
|
"relative flex cursor-default items-center gap-12 select-none",
|
|
14
14
|
"h-44 rounded-sm px-8 outline-hidden",
|
|
15
15
|
"body-2-semi-bold text-base",
|
|
@@ -17,169 +17,198 @@ const c = o(
|
|
|
17
17
|
"focus:bg-base-transparent-hover",
|
|
18
18
|
"active:bg-base-transparent-pressed",
|
|
19
19
|
"data-disabled:pointer-events-none data-disabled:text-disabled"
|
|
20
|
-
),
|
|
21
|
-
|
|
20
|
+
), y = o("px-8 py-4 body-3-semi-bold text-muted"), f = o(
|
|
21
|
+
l,
|
|
22
22
|
"data-[state=open]:bg-base-transparent-hover"
|
|
23
23
|
);
|
|
24
|
-
function
|
|
24
|
+
function G({ ...e }) {
|
|
25
25
|
return /* @__PURE__ */ a(t.Root, { "data-slot": "menu", ...e });
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const x = ({ ref: e, ...s }) => /* @__PURE__ */ a(
|
|
28
28
|
t.Trigger,
|
|
29
29
|
{
|
|
30
30
|
ref: e,
|
|
31
31
|
"data-slot": "menu-trigger",
|
|
32
|
-
...
|
|
32
|
+
...s
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
|
-
|
|
36
|
-
function
|
|
35
|
+
x.displayName = t.Trigger.displayName;
|
|
36
|
+
function L({ ...e }) {
|
|
37
37
|
return /* @__PURE__ */ a(t.Group, { "data-slot": "menu-group", ...e });
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function W({
|
|
40
40
|
...e
|
|
41
41
|
}) {
|
|
42
42
|
return /* @__PURE__ */ a(t.Portal, { ...e });
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function q({
|
|
45
45
|
...e
|
|
46
46
|
}) {
|
|
47
47
|
return /* @__PURE__ */ a(t.Sub, { ...e });
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function A({ ...e }) {
|
|
50
50
|
return /* @__PURE__ */ a(t.RadioGroup, { "data-slot": "menu-radio-group", ...e });
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const M = ({
|
|
53
53
|
ref: e,
|
|
54
|
-
className:
|
|
55
|
-
inset:
|
|
54
|
+
className: s,
|
|
55
|
+
inset: n,
|
|
56
56
|
children: i,
|
|
57
|
-
...
|
|
58
|
-
}) => /* @__PURE__ */
|
|
57
|
+
...d
|
|
58
|
+
}) => /* @__PURE__ */ u(
|
|
59
59
|
t.SubTrigger,
|
|
60
60
|
{
|
|
61
61
|
ref: e,
|
|
62
62
|
"data-slot": "menu-sub-trigger",
|
|
63
|
-
className: o(
|
|
64
|
-
...
|
|
63
|
+
className: o(f, n && "pl-32", s),
|
|
64
|
+
...d,
|
|
65
65
|
children: [
|
|
66
66
|
i,
|
|
67
|
-
/* @__PURE__ */ a(
|
|
67
|
+
/* @__PURE__ */ a(h, { size: 20, className: "ml-auto text-muted" })
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
-
|
|
72
|
-
const
|
|
71
|
+
M.displayName = t.SubTrigger.displayName;
|
|
72
|
+
const I = ({ ref: e, className: s, ...n }) => /* @__PURE__ */ a(
|
|
73
73
|
t.SubContent,
|
|
74
74
|
{
|
|
75
75
|
ref: e,
|
|
76
76
|
"data-slot": "menu-sub-content",
|
|
77
|
-
className: o(
|
|
78
|
-
...
|
|
77
|
+
className: o(N, s),
|
|
78
|
+
...n
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
|
-
|
|
82
|
-
const
|
|
81
|
+
I.displayName = t.SubContent.displayName;
|
|
82
|
+
const v = ({
|
|
83
83
|
ref: e,
|
|
84
|
-
className:
|
|
85
|
-
sideOffset:
|
|
84
|
+
className: s,
|
|
85
|
+
sideOffset: n = 4,
|
|
86
86
|
align: i = "start",
|
|
87
|
-
...
|
|
87
|
+
...d
|
|
88
88
|
}) => /* @__PURE__ */ a(t.Portal, { children: /* @__PURE__ */ a(
|
|
89
89
|
t.Content,
|
|
90
90
|
{
|
|
91
91
|
ref: e,
|
|
92
92
|
"data-slot": "menu-content",
|
|
93
|
-
sideOffset:
|
|
94
|
-
className: o(
|
|
95
|
-
onClick: (
|
|
96
|
-
|
|
93
|
+
sideOffset: n,
|
|
94
|
+
className: o(N, s),
|
|
95
|
+
onClick: (r) => {
|
|
96
|
+
r.stopPropagation(), d.onClick?.(r);
|
|
97
97
|
},
|
|
98
98
|
align: i,
|
|
99
|
-
...
|
|
99
|
+
...d
|
|
100
100
|
}
|
|
101
101
|
) });
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
v.displayName = t.Content.displayName;
|
|
103
|
+
const C = ({
|
|
104
|
+
ref: e,
|
|
105
|
+
className: s,
|
|
106
|
+
inset: n,
|
|
107
|
+
disabled: i,
|
|
108
|
+
...d
|
|
109
|
+
}) => {
|
|
110
|
+
const r = c({
|
|
111
|
+
consumerName: "MenuItem",
|
|
112
|
+
mergeWith: { disabled: i }
|
|
113
|
+
});
|
|
114
|
+
return /* @__PURE__ */ a(p, { value: { disabled: r }, children: /* @__PURE__ */ a(
|
|
115
|
+
t.Item,
|
|
116
|
+
{
|
|
117
|
+
ref: e,
|
|
118
|
+
"data-slot": "menu-item",
|
|
119
|
+
className: o(l, n && "pl-32", s),
|
|
120
|
+
disabled: r,
|
|
121
|
+
...d
|
|
122
|
+
}
|
|
123
|
+
) });
|
|
124
|
+
};
|
|
125
|
+
C.displayName = t.Item.displayName;
|
|
113
126
|
const S = ({
|
|
114
127
|
ref: e,
|
|
115
|
-
className:
|
|
116
|
-
children:
|
|
128
|
+
className: s,
|
|
129
|
+
children: n,
|
|
117
130
|
checked: i,
|
|
131
|
+
disabled: d,
|
|
118
132
|
...r
|
|
119
|
-
}) =>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
}) => {
|
|
134
|
+
const m = c({
|
|
135
|
+
consumerName: "MenuCheckboxItem",
|
|
136
|
+
mergeWith: { disabled: d }
|
|
137
|
+
});
|
|
138
|
+
return /* @__PURE__ */ a(p, { value: { disabled: m }, children: /* @__PURE__ */ u(
|
|
139
|
+
t.CheckboxItem,
|
|
140
|
+
{
|
|
141
|
+
ref: e,
|
|
142
|
+
"data-slot": "menu-checkbox-item",
|
|
143
|
+
className: o(l, s),
|
|
144
|
+
checked: i,
|
|
145
|
+
disabled: m,
|
|
146
|
+
...r,
|
|
147
|
+
children: [
|
|
148
|
+
n,
|
|
149
|
+
/* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(b, { disabled: m, size: 24, className: "text-active" }) }) })
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
) });
|
|
153
|
+
};
|
|
133
154
|
S.displayName = t.CheckboxItem.displayName;
|
|
134
|
-
const
|
|
155
|
+
const k = ({
|
|
135
156
|
ref: e,
|
|
136
|
-
className:
|
|
137
|
-
children:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
className: s,
|
|
158
|
+
children: n,
|
|
159
|
+
disabled: i,
|
|
160
|
+
...d
|
|
161
|
+
}) => {
|
|
162
|
+
const r = c({
|
|
163
|
+
consumerName: "MenuRadioItem",
|
|
164
|
+
mergeWith: { disabled: i }
|
|
165
|
+
});
|
|
166
|
+
return /* @__PURE__ */ a(p, { value: { disabled: r }, children: /* @__PURE__ */ u(
|
|
167
|
+
t.RadioItem,
|
|
168
|
+
{
|
|
169
|
+
ref: e,
|
|
170
|
+
"data-slot": "menu-radio-item",
|
|
171
|
+
disabled: r,
|
|
172
|
+
className: o(l, s),
|
|
173
|
+
...d,
|
|
174
|
+
children: [
|
|
175
|
+
n,
|
|
176
|
+
/* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(b, { disabled: r, size: 24, className: "text-active" }) }) })
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
) });
|
|
180
|
+
};
|
|
181
|
+
k.displayName = t.RadioItem.displayName;
|
|
182
|
+
const R = ({
|
|
154
183
|
ref: e,
|
|
155
|
-
className:
|
|
156
|
-
inset:
|
|
184
|
+
className: s,
|
|
185
|
+
inset: n,
|
|
157
186
|
...i
|
|
158
187
|
}) => /* @__PURE__ */ a(
|
|
159
188
|
t.Label,
|
|
160
189
|
{
|
|
161
190
|
ref: e,
|
|
162
191
|
"data-slot": "menu-label",
|
|
163
|
-
className: o(
|
|
192
|
+
className: o(y, n && "pl-32", s),
|
|
164
193
|
...i
|
|
165
194
|
}
|
|
166
195
|
);
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
196
|
+
R.displayName = t.Label.displayName;
|
|
197
|
+
const T = ({ ref: e, className: s, ...n }) => /* @__PURE__ */ a(g, { ref: e, className: o("mx-8 my-4 w-auto", s), ...n });
|
|
198
|
+
T.displayName = "MenuSeparator";
|
|
170
199
|
export {
|
|
171
|
-
|
|
200
|
+
G as Menu,
|
|
172
201
|
S as MenuCheckboxItem,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
202
|
+
v as MenuContent,
|
|
203
|
+
L as MenuGroup,
|
|
204
|
+
C as MenuItem,
|
|
205
|
+
R as MenuLabel,
|
|
206
|
+
W as MenuPortal,
|
|
207
|
+
A as MenuRadioGroup,
|
|
208
|
+
k as MenuRadioItem,
|
|
209
|
+
T as MenuSeparator,
|
|
210
|
+
q as MenuSub,
|
|
211
|
+
I as MenuSubContent,
|
|
212
|
+
M as MenuSubTrigger,
|
|
213
|
+
x as MenuTrigger
|
|
185
214
|
};
|
|
@@ -2,21 +2,21 @@ import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn as l } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
const i = ({
|
|
4
4
|
ref: s,
|
|
5
|
-
ticker:
|
|
5
|
+
ticker: n,
|
|
6
6
|
icon: a,
|
|
7
|
-
className:
|
|
7
|
+
className: t
|
|
8
8
|
}) => /* @__PURE__ */ r(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
11
|
ref: s,
|
|
12
12
|
className: l(
|
|
13
13
|
"flex items-center gap-8 rounded-full bg-muted-transparent py-8 pr-12 pl-8",
|
|
14
|
-
|
|
14
|
+
t
|
|
15
15
|
),
|
|
16
16
|
"data-slot": "coin-capsule",
|
|
17
17
|
children: [
|
|
18
18
|
/* @__PURE__ */ e("span", { className: "flex size-24 shrink-0 items-center justify-center", children: a }),
|
|
19
|
-
/* @__PURE__ */ e("span", { className: "body-1 text-base select-none", children:
|
|
19
|
+
/* @__PURE__ */ e("span", { className: "body-1 text-base select-none", children: n })
|
|
20
20
|
]
|
|
21
21
|
}
|
|
22
22
|
);
|
|
@@ -3,7 +3,7 @@ export declare function SegmentedControlButton({ value, children, icon: Icon, on
|
|
|
3
3
|
export declare namespace SegmentedControlButton {
|
|
4
4
|
var displayName: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function SegmentedControl({ selectedValue, onSelectedChange, children, className, disabled, appearance, ...props }: SegmentedControlProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function SegmentedControl({ selectedValue, onSelectedChange, children, className, disabled: disabledProp, appearance, ...props }: SegmentedControlProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare namespace SegmentedControl {
|
|
8
8
|
var displayName: string;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAwCjB,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,QAAQ,EACR,IAAI,EAAE,IAAI,EACV,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,2BAA2B,2CAgC7B;yBAvCe,sBAAsB;;;AA2CtC,wBAAgB,gBAAgB,CAAC,EAC/B,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,QAAQ,EAAE,YAAY,EACtB,UAAyB,EACzB,GAAG,KAAK,EACT,EAAE,qBAAqB,2CAgDvB;yBAxDe,gBAAgB"}
|
|
@@ -1,74 +1,112 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { cn as p, useDisabledContext as g } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as c } from "class-variance-authority";
|
|
4
|
+
import { useRef as x } from "react";
|
|
5
|
+
import { useSegmentedControlContext as h, SegmentedControlContextProvider as v } from "./SegmentedControlContext.js";
|
|
6
|
+
import { useSegmentedControlSelectedIndex as C, usePillElementLayoutEffect as y } from "./usePillElementLayoutEffect.js";
|
|
7
|
+
const f = {
|
|
8
|
+
root: c("relative flex w-full flex-row items-center rounded-sm", {
|
|
9
|
+
variants: {
|
|
10
|
+
appearance: {
|
|
11
|
+
background: "bg-surface",
|
|
12
|
+
"no-background": "bg-transparent"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}),
|
|
16
|
+
pill: c(
|
|
17
|
+
"pointer-events-none absolute top-0 left-0 z-0 rounded-sm transition-transform duration-250 ease-in-out",
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
disabled: {
|
|
21
|
+
true: "bg-base-transparent-pressed",
|
|
22
|
+
false: "bg-muted-transparent"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
item: c(
|
|
28
|
+
"z-10 flex min-w-0 flex-1 cursor-pointer flex-row items-center justify-center rounded-sm px-16 py-8 select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:cursor-not-allowed",
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
selected: {
|
|
32
|
+
true: "body-2-semi-bold text-base",
|
|
33
|
+
false: "body-2 text-muted hover:body-2-semi-bold hover:text-muted-hover"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
};
|
|
39
|
+
function S({
|
|
7
40
|
value: o,
|
|
8
|
-
children:
|
|
41
|
+
children: a,
|
|
9
42
|
icon: e,
|
|
10
|
-
onClick:
|
|
11
|
-
className:
|
|
12
|
-
...
|
|
43
|
+
onClick: l,
|
|
44
|
+
className: d,
|
|
45
|
+
...m
|
|
13
46
|
}) {
|
|
14
|
-
const { selectedValue: u, onSelectedChange:
|
|
47
|
+
const { selectedValue: u, onSelectedChange: n, disabled: t } = h(), i = u === o;
|
|
15
48
|
return /* @__PURE__ */ s(
|
|
16
49
|
"button",
|
|
17
50
|
{
|
|
18
51
|
type: "button",
|
|
19
52
|
role: "radio",
|
|
20
|
-
"aria-checked":
|
|
21
|
-
"aria-disabled":
|
|
22
|
-
disabled:
|
|
23
|
-
onClick: (
|
|
24
|
-
|
|
53
|
+
"aria-checked": i,
|
|
54
|
+
"aria-disabled": t,
|
|
55
|
+
disabled: t,
|
|
56
|
+
onClick: (r) => {
|
|
57
|
+
t || (n(o), l?.(r));
|
|
25
58
|
},
|
|
26
|
-
className:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
59
|
+
className: p(
|
|
60
|
+
f.item({
|
|
61
|
+
selected: i
|
|
62
|
+
}),
|
|
63
|
+
d
|
|
30
64
|
),
|
|
31
|
-
...
|
|
32
|
-
children: /* @__PURE__ */
|
|
65
|
+
...m,
|
|
66
|
+
children: /* @__PURE__ */ b("span", { className: "inline-flex shrink-0 items-center justify-center gap-8", children: [
|
|
33
67
|
e && /* @__PURE__ */ s(e, { size: 16 }),
|
|
34
|
-
/* @__PURE__ */ s("span", { children:
|
|
68
|
+
/* @__PURE__ */ s("span", { children: a })
|
|
35
69
|
] })
|
|
36
70
|
}
|
|
37
71
|
);
|
|
38
72
|
}
|
|
39
|
-
|
|
40
|
-
function
|
|
73
|
+
S.displayName = "SegmentedControlButton";
|
|
74
|
+
function w({
|
|
41
75
|
selectedValue: o,
|
|
42
|
-
onSelectedChange:
|
|
76
|
+
onSelectedChange: a,
|
|
43
77
|
children: e,
|
|
44
|
-
className:
|
|
45
|
-
disabled:
|
|
46
|
-
appearance:
|
|
78
|
+
className: l,
|
|
79
|
+
disabled: d,
|
|
80
|
+
appearance: m = "background",
|
|
47
81
|
...u
|
|
48
82
|
}) {
|
|
49
|
-
const
|
|
83
|
+
const n = g({
|
|
84
|
+
consumerName: "SegmentedControl",
|
|
85
|
+
mergeWith: { disabled: d }
|
|
86
|
+
}), t = x(null), i = C(
|
|
50
87
|
o,
|
|
51
88
|
e
|
|
52
|
-
), { pill:
|
|
53
|
-
ref:
|
|
54
|
-
selectedIndex:
|
|
89
|
+
), { pill: r } = y({
|
|
90
|
+
ref: t,
|
|
91
|
+
selectedIndex: i,
|
|
55
92
|
children: e
|
|
56
93
|
});
|
|
57
94
|
return /* @__PURE__ */ s(
|
|
58
|
-
|
|
95
|
+
v,
|
|
59
96
|
{
|
|
60
|
-
value: { selectedValue: o, onSelectedChange:
|
|
61
|
-
children: /* @__PURE__ */
|
|
97
|
+
value: { selectedValue: o, onSelectedChange: a, disabled: n },
|
|
98
|
+
children: /* @__PURE__ */ b(
|
|
62
99
|
"div",
|
|
63
100
|
{
|
|
64
101
|
...u,
|
|
65
|
-
ref:
|
|
102
|
+
ref: t,
|
|
66
103
|
role: "radiogroup",
|
|
67
104
|
"aria-disabled": n,
|
|
68
|
-
className:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
105
|
+
className: p(
|
|
106
|
+
f.root({
|
|
107
|
+
appearance: m
|
|
108
|
+
}),
|
|
109
|
+
l
|
|
72
110
|
),
|
|
73
111
|
children: [
|
|
74
112
|
e,
|
|
@@ -76,14 +114,13 @@ function y({
|
|
|
76
114
|
"div",
|
|
77
115
|
{
|
|
78
116
|
"aria-hidden": !0,
|
|
79
|
-
className:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
),
|
|
117
|
+
className: f.pill({
|
|
118
|
+
disabled: n
|
|
119
|
+
}),
|
|
83
120
|
style: {
|
|
84
|
-
width:
|
|
85
|
-
height:
|
|
86
|
-
transform: `translateX(${
|
|
121
|
+
width: r.width,
|
|
122
|
+
height: r.height,
|
|
123
|
+
transform: `translateX(${r.x}px)`
|
|
87
124
|
}
|
|
88
125
|
}
|
|
89
126
|
)
|
|
@@ -93,8 +130,8 @@ function y({
|
|
|
93
130
|
}
|
|
94
131
|
);
|
|
95
132
|
}
|
|
96
|
-
|
|
133
|
+
w.displayName = "SegmentedControl";
|
|
97
134
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
135
|
+
w as SegmentedControl,
|
|
136
|
+
S as SegmentedControlButton
|
|
100
137
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type SegmentedControlContextValue = {
|
|
2
2
|
selectedValue: string;
|
|
3
3
|
onSelectedChange: (value: string) => void;
|
|
4
|
-
disabled
|
|
4
|
+
disabled: boolean;
|
|
5
5
|
};
|
|
6
6
|
declare const SegmentedControlContextProvider: import('react').FC<{
|
|
7
7
|
children: import('react').ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControlContext.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/SegmentedControlContext.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,4BAA4B,GAAG;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,
|
|
1
|
+
{"version":3,"file":"SegmentedControlContext.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/SegmentedControl/SegmentedControlContext.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,4BAA4B,GAAG;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,QAAA,MAAO,+BAA+B;;;EAC+B,CAAC;AAEtE,eAAO,MAAM,0BAA0B,oCAInC,CAAC;AAEL,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SelectProps, SelectTriggerProps, SelectContentProps, SelectGroupProps, SelectLabelProps, SelectItemTextProps, SelectItemProps, SelectSeparatorProps, SelectButtonTriggerProps } from './types';
|
|
2
|
-
declare function Select({ value, defaultValue, onValueChange, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function Select({ value, defaultValue, onValueChange, disabled: disabledProp, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare function SelectGroup({ ...props }: SelectGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const SelectTrigger: {
|
|
5
|
-
({ render, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
({ render, disabled, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
displayName: string | undefined;
|
|
7
7
|
};
|
|
8
8
|
declare const SelectContent: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Select/Select.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,iBAAS,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Select/Select.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,iBAAS,MAAM,CAAC,EACd,KAAK,EACL,YAAY,EACZ,aAAa,EACb,QAAQ,EAAE,YAAY,EACtB,GAAG,KAAK,EACT,EAAE,WAAW,2CAsBb;AAED,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAElD;AAwDD,QAAA,MAAM,aAAa;qCAAoC,kBAAkB;;CA2BxE,CAAC;AAwCF,QAAA,MAAM,aAAa;uDAMhB,kBAAkB;;CAgBpB,CAAC;AAGF,QAAA,MAAM,WAAW;mCAAkC,gBAAgB;;CAOlE,CAAC;AAcF,QAAA,MAAM,UAAU;6CAKb,eAAe;;CAcjB,CAAC;AAGF,QAAA,MAAM,eAAe;mCAIlB,oBAAoB;;CAEtB,CAAC;AAGF,QAAA,MAAM,cAAc;mCAAkC,mBAAmB;;CAOxE,CAAC;AAuCF,QAAA,MAAM,mBAAmB,GAAI,qDAK1B,wBAAwB,4CAI1B,CAAC;AAEF,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,UAAU,EACV,eAAe,EACf,mBAAmB,GACpB,CAAC"}
|