@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
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { AddressInput as n } from "./lib/Components/AddressInput/AddressInput.js
|
|
|
3
3
|
import { AmountInput as i } from "./lib/Components/AmountInput/AmountInput.js";
|
|
4
4
|
import { AmountDisplay as p } from "./lib/Components/AmountDisplay/AmountDisplay.js";
|
|
5
5
|
import { Avatar as T } from "./lib/Components/Avatar/Avatar.js";
|
|
6
|
-
import { Banner as
|
|
6
|
+
import { Banner as x } from "./lib/Components/Banner/Banner.js";
|
|
7
7
|
import { BaseInput as f } from "./lib/Components/BaseInput/BaseInput.js";
|
|
8
8
|
import { Button as S } from "./lib/Components/Button/Button.js";
|
|
9
9
|
import { BaseButton as b } from "./lib/Components/Button/BaseButton.js";
|
|
@@ -20,7 +20,7 @@ import { Divider as re } from "./lib/Components/Divider/Divider.js";
|
|
|
20
20
|
import { IconButton as ae } from "./lib/Components/IconButton/IconButton.js";
|
|
21
21
|
import { InteractiveIcon as le } from "./lib/Components/InteractiveIcon/InteractiveIcon.js";
|
|
22
22
|
import { Link as me } from "./lib/Components/Link/Link.js";
|
|
23
|
-
import { ListItem as ue, ListItemContent as
|
|
23
|
+
import { ListItem as ue, ListItemContent as xe, ListItemDescription as de, ListItemIcon as fe, ListItemLeading as Ce, ListItemSpot as Se, ListItemTitle as ge, ListItemTrailing as be, ListItemTruncate as ce } from "./lib/Components/ListItem/ListItem.js";
|
|
24
24
|
import { Menu as Ie, MenuCheckboxItem as se, MenuContent as Le, MenuGroup as De, MenuItem as Me, MenuLabel as he, MenuPortal as Re, MenuRadioGroup as ve, MenuRadioItem as Ae, MenuSeparator as we, MenuSub as He, MenuSubContent as ke, MenuSubTrigger as ye, MenuTrigger as Ge } from "./lib/Components/Menu/Menu.js";
|
|
25
25
|
import { NavBar as Pe, NavBarBackButton as Fe, NavBarCoinCapsule as Ee, NavBarTitle as Oe, NavBarTrailing as _e } from "./lib/Components/NavBar/NavBar.js";
|
|
26
26
|
import { PageIndicator as qe } from "./lib/Components/PageIndicator/PageIndicator.js";
|
|
@@ -33,27 +33,27 @@ import { Skeleton as fo } from "./lib/Components/Skeleton/Skeleton.js";
|
|
|
33
33
|
import { Spinner as So } from "./lib/Components/Spinner/Spinner.js";
|
|
34
34
|
import { Spot as bo } from "./lib/Components/Spot/Spot.js";
|
|
35
35
|
import { Stepper as Bo } from "./lib/Components/Stepper/Stepper.js";
|
|
36
|
-
import { Subheader as so,
|
|
37
|
-
import { Switch as
|
|
38
|
-
import { Table as
|
|
39
|
-
import { Tag as
|
|
40
|
-
import { TextInput as
|
|
41
|
-
import { Tile as
|
|
42
|
-
import { TileButton as
|
|
43
|
-
import { Tooltip as
|
|
44
|
-
import { ThemeProvider as
|
|
45
|
-
import { COLOR_SCHEMES as
|
|
36
|
+
import { Subheader as so, SubheaderCount as Lo, SubheaderDescription as Do, SubheaderInfo as Mo, SubheaderRow as ho, SubheaderShowMore as Ro, SubheaderTitle as vo } from "./lib/Components/Subheader/Subheader.js";
|
|
37
|
+
import { Switch as wo } from "./lib/Components/Switch/Switch.js";
|
|
38
|
+
import { Table as ko, TableActionBar as yo, TableActionBarLeading as Go, TableActionBarTrailing as No, TableBody as Po, TableCell as Fo, TableCellContent as Eo, TableGroupHeaderRow as Oo, TableHeader as _o, TableHeaderCell as jo, TableHeaderRow as qo, TableInfoIcon as zo, TableLoadingRow as Jo, TableRoot as Ko, TableRow as Qo, TableSortButton as Uo } from "./lib/Components/Table/Table.js";
|
|
39
|
+
import { Tag as Wo } from "./lib/Components/Tag/Tag.js";
|
|
40
|
+
import { TextInput as Yo } from "./lib/Components/TextInput/TextInput.js";
|
|
41
|
+
import { Tile as $o, TileContent as et, TileDescription as ot, TileSecondaryAction as tt, TileTitle as rt, TileTrailingContent as nt } from "./lib/Components/Tile/Tile.js";
|
|
42
|
+
import { TileButton as it } from "./lib/Components/TileButton/TileButton.js";
|
|
43
|
+
import { Tooltip as pt, TooltipContent as mt, TooltipProvider as Tt, TooltipTrigger as ut } from "./lib/Components/Tooltip/Tooltip.js";
|
|
44
|
+
import { ThemeProvider as dt } from "./lib/Components/ThemeProvider/ThemeProvider.js";
|
|
45
|
+
import { COLOR_SCHEMES as Ct } from "./lib/Components/ThemeProvider/ThemeProvider.types.js";
|
|
46
46
|
export {
|
|
47
47
|
n as AddressInput,
|
|
48
48
|
p as AmountDisplay,
|
|
49
49
|
i as AmountInput,
|
|
50
50
|
T as Avatar,
|
|
51
|
-
|
|
51
|
+
x as Banner,
|
|
52
52
|
b as BaseButton,
|
|
53
53
|
f as BaseInput,
|
|
54
54
|
S as Button,
|
|
55
55
|
ao as ButtonTrigger,
|
|
56
|
-
|
|
56
|
+
Ct as COLOR_SCHEMES,
|
|
57
57
|
B as Card,
|
|
58
58
|
H as CardButton,
|
|
59
59
|
I as CardContent,
|
|
@@ -87,8 +87,8 @@ export {
|
|
|
87
87
|
t as Languages,
|
|
88
88
|
me as Link,
|
|
89
89
|
ue as ListItem,
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
xe as ListItemContent,
|
|
91
|
+
de as ListItemDescription,
|
|
92
92
|
fe as ListItemIcon,
|
|
93
93
|
Ce as ListItemLeading,
|
|
94
94
|
Se as ListItemSpot,
|
|
@@ -137,44 +137,42 @@ export {
|
|
|
137
137
|
bo as Spot,
|
|
138
138
|
Bo as Stepper,
|
|
139
139
|
so as Subheader,
|
|
140
|
-
Lo as
|
|
141
|
-
Do as
|
|
142
|
-
Mo as
|
|
143
|
-
ho as
|
|
144
|
-
Ro as
|
|
145
|
-
vo as
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
yo as
|
|
149
|
-
Go as
|
|
150
|
-
No as
|
|
151
|
-
Po as
|
|
152
|
-
Fo as
|
|
153
|
-
Eo as
|
|
154
|
-
Oo as
|
|
155
|
-
_o as
|
|
156
|
-
jo as
|
|
157
|
-
qo as
|
|
158
|
-
zo as
|
|
159
|
-
Jo as
|
|
160
|
-
Ko as
|
|
161
|
-
Qo as
|
|
162
|
-
Uo as
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
ot as
|
|
170
|
-
tt as
|
|
171
|
-
rt as
|
|
172
|
-
nt as
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Tt as
|
|
176
|
-
ut as
|
|
177
|
-
dt as TooltipProvider,
|
|
178
|
-
xt as TooltipTrigger,
|
|
140
|
+
Lo as SubheaderCount,
|
|
141
|
+
Do as SubheaderDescription,
|
|
142
|
+
Mo as SubheaderInfo,
|
|
143
|
+
ho as SubheaderRow,
|
|
144
|
+
Ro as SubheaderShowMore,
|
|
145
|
+
vo as SubheaderTitle,
|
|
146
|
+
wo as Switch,
|
|
147
|
+
ko as Table,
|
|
148
|
+
yo as TableActionBar,
|
|
149
|
+
Go as TableActionBarLeading,
|
|
150
|
+
No as TableActionBarTrailing,
|
|
151
|
+
Po as TableBody,
|
|
152
|
+
Fo as TableCell,
|
|
153
|
+
Eo as TableCellContent,
|
|
154
|
+
Oo as TableGroupHeaderRow,
|
|
155
|
+
_o as TableHeader,
|
|
156
|
+
jo as TableHeaderCell,
|
|
157
|
+
qo as TableHeaderRow,
|
|
158
|
+
zo as TableInfoIcon,
|
|
159
|
+
Jo as TableLoadingRow,
|
|
160
|
+
Ko as TableRoot,
|
|
161
|
+
Qo as TableRow,
|
|
162
|
+
Uo as TableSortButton,
|
|
163
|
+
Wo as Tag,
|
|
164
|
+
Yo as TextInput,
|
|
165
|
+
dt as ThemeProvider,
|
|
166
|
+
$o as Tile,
|
|
167
|
+
it as TileButton,
|
|
168
|
+
et as TileContent,
|
|
169
|
+
ot as TileDescription,
|
|
170
|
+
tt as TileSecondaryAction,
|
|
171
|
+
rt as TileTitle,
|
|
172
|
+
nt as TileTrailingContent,
|
|
173
|
+
pt as Tooltip,
|
|
174
|
+
mt as TooltipContent,
|
|
175
|
+
Tt as TooltipProvider,
|
|
176
|
+
ut as TooltipTrigger,
|
|
179
177
|
J as useLumenDataTable
|
|
180
178
|
};
|
|
@@ -44,30 +44,30 @@ const N = {
|
|
|
44
44
|
style: {
|
|
45
45
|
transform: `translateY(-${a * 10}%)`
|
|
46
46
|
},
|
|
47
|
-
children: b.map((
|
|
47
|
+
children: b.map((n, r) => /* @__PURE__ */ e("span", { inert: n !== a, children: n }, r))
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
}), m = d(({ items: a, type: l, animate: i }) => a.map((s,
|
|
54
|
-
const
|
|
55
|
-
return s.type === "separator" ? /* @__PURE__ */ e("span", { children: s.value },
|
|
53
|
+
}), m = d(({ items: a, type: l, animate: i }) => a.map((s, n) => {
|
|
54
|
+
const r = a.length - n;
|
|
55
|
+
return s.type === "separator" ? /* @__PURE__ */ e("span", { children: s.value }, r) : /* @__PURE__ */ e(
|
|
56
56
|
T,
|
|
57
57
|
{
|
|
58
58
|
value: Number(s.value),
|
|
59
59
|
animate: i,
|
|
60
60
|
type: l
|
|
61
61
|
},
|
|
62
|
-
|
|
62
|
+
r
|
|
63
63
|
);
|
|
64
64
|
})), g = ({
|
|
65
65
|
value: a,
|
|
66
66
|
formatter: l,
|
|
67
67
|
hidden: i = !1,
|
|
68
68
|
loading: s = !1,
|
|
69
|
-
animate:
|
|
70
|
-
className:
|
|
69
|
+
animate: n = !0,
|
|
70
|
+
className: r,
|
|
71
71
|
...u
|
|
72
72
|
}) => {
|
|
73
73
|
const t = l(a), c = y(t), { t: f } = D(), h = x(
|
|
@@ -81,7 +81,7 @@ const N = {
|
|
|
81
81
|
className: p(
|
|
82
82
|
s && "animate-pulse",
|
|
83
83
|
"relative inline-flex items-baseline",
|
|
84
|
-
|
|
84
|
+
r
|
|
85
85
|
),
|
|
86
86
|
"aria-label": h,
|
|
87
87
|
"aria-busy": s,
|
|
@@ -98,7 +98,7 @@ const N = {
|
|
|
98
98
|
m,
|
|
99
99
|
{
|
|
100
100
|
items: c.integerPart,
|
|
101
|
-
animate:
|
|
101
|
+
animate: n,
|
|
102
102
|
type: "integer"
|
|
103
103
|
}
|
|
104
104
|
)
|
|
@@ -116,7 +116,7 @@ const N = {
|
|
|
116
116
|
m,
|
|
117
117
|
{
|
|
118
118
|
items: c.decimalPart,
|
|
119
|
-
animate:
|
|
119
|
+
animate: n,
|
|
120
120
|
type: "decimal"
|
|
121
121
|
}
|
|
122
122
|
),
|
|
@@ -5,7 +5,7 @@ import { AmountInputProps } from './types';
|
|
|
5
5
|
* The currency text can be positioned either on the left or right side of the input.
|
|
6
6
|
*/
|
|
7
7
|
export declare const AmountInput: {
|
|
8
|
-
({ ref, className, currencyText, currencyPosition, disabled, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, value, onChange, ...props }: AmountInputProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
({ ref, className, currencyText, currencyPosition, disabled: disabledProp, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, value, onChange, ...props }: AmountInputProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=AmountInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/AmountInput/AmountInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AmountInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/AmountInput/AmountInput.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgC3C;;;;GAIG;AACH,eAAO,MAAM,WAAW;mLAarB,gBAAgB;;CAkHlB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { getFontSize as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useRef as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as j, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useDisabledContext as F, getFontSize as z, cn as a, textFormatter as D } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as M } from "class-variance-authority";
|
|
4
|
+
import { useRef as d, useState as h, useMemo as W, useLayoutEffect as q, useEffect as L } from "react";
|
|
5
|
+
const Q = M(
|
|
6
6
|
[
|
|
7
7
|
"bg-transparent heading-0 caret-active outline-hidden transition-colors",
|
|
8
8
|
"text-base placeholder:text-muted-subtle",
|
|
@@ -28,11 +28,11 @@ const H = z(
|
|
|
28
28
|
"group-has-[input:placeholder-shown]:text-muted-subtle",
|
|
29
29
|
"group-has-[input:disabled]:cursor-not-allowed group-has-[input:disabled]:text-disabled",
|
|
30
30
|
'group-has-[input[aria-invalid="true"]]:text-error'
|
|
31
|
-
),
|
|
31
|
+
), Y = ({
|
|
32
32
|
ref: x,
|
|
33
33
|
className: S,
|
|
34
|
-
currencyText:
|
|
35
|
-
currencyPosition:
|
|
34
|
+
currencyText: s,
|
|
35
|
+
currencyPosition: p = "left",
|
|
36
36
|
disabled: v,
|
|
37
37
|
maxIntegerLength: w = 9,
|
|
38
38
|
maxDecimalLength: y = 9,
|
|
@@ -40,9 +40,12 @@ const H = z(
|
|
|
40
40
|
thousandsSeparator: N = !0,
|
|
41
41
|
value: u,
|
|
42
42
|
onChange: A,
|
|
43
|
-
...
|
|
43
|
+
...I
|
|
44
44
|
}) => {
|
|
45
|
-
const
|
|
45
|
+
const R = F({
|
|
46
|
+
consumerName: "AmountInput",
|
|
47
|
+
mergeWith: { disabled: v }
|
|
48
|
+
}), c = d(null), r = d(null), [n, m] = h(u.toString()), [k, f] = h(!1), g = d(n);
|
|
46
49
|
function E(...t) {
|
|
47
50
|
return (e) => {
|
|
48
51
|
t.forEach((o) => {
|
|
@@ -50,41 +53,41 @@ const H = z(
|
|
|
50
53
|
});
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
|
-
const i =
|
|
56
|
+
const i = W(() => z(n) + "px", [n]);
|
|
54
57
|
q(() => {
|
|
55
|
-
if (c.current &&
|
|
58
|
+
if (c.current && r.current) {
|
|
56
59
|
const t = c.current.offsetWidth, e = n === "" ? 33 : 8;
|
|
57
|
-
|
|
60
|
+
r.current.style.width = `${t + e}px`;
|
|
58
61
|
}
|
|
59
|
-
}, [n]),
|
|
60
|
-
|
|
62
|
+
}, [n]), L(() => {
|
|
63
|
+
m(u.toString());
|
|
61
64
|
}, [u]);
|
|
62
|
-
const
|
|
63
|
-
const e =
|
|
65
|
+
const V = (t) => {
|
|
66
|
+
const e = D(t.target.value, {
|
|
64
67
|
allowDecimals: C,
|
|
65
68
|
thousandsSeparator: N,
|
|
66
69
|
maxIntegerLength: w,
|
|
67
70
|
maxDecimalLength: y
|
|
68
71
|
});
|
|
69
|
-
|
|
72
|
+
m(e), A({ ...t, target: { ...t.target, value: e } }), e !== g.current && f(!0), g.current = e;
|
|
70
73
|
};
|
|
71
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ j(
|
|
72
75
|
"div",
|
|
73
76
|
{
|
|
74
77
|
className: "group relative flex items-center justify-center transition-transform",
|
|
75
78
|
onPointerDown: () => {
|
|
76
|
-
const t =
|
|
79
|
+
const t = r.current;
|
|
77
80
|
t && window.requestAnimationFrame(() => {
|
|
78
81
|
t.focus();
|
|
79
82
|
});
|
|
80
83
|
},
|
|
81
84
|
children: [
|
|
82
|
-
|
|
85
|
+
s && p === "left" && /* @__PURE__ */ l(
|
|
83
86
|
"span",
|
|
84
87
|
{
|
|
85
88
|
className: a(b, "shrink-0"),
|
|
86
89
|
style: { fontSize: i, letterSpacing: "normal" },
|
|
87
|
-
children:
|
|
90
|
+
children: s
|
|
88
91
|
}
|
|
89
92
|
),
|
|
90
93
|
/* @__PURE__ */ l(
|
|
@@ -100,31 +103,31 @@ const H = z(
|
|
|
100
103
|
/* @__PURE__ */ l(
|
|
101
104
|
"input",
|
|
102
105
|
{
|
|
103
|
-
ref: E(x,
|
|
106
|
+
ref: E(x, r),
|
|
104
107
|
type: "text",
|
|
105
108
|
inputMode: "decimal",
|
|
106
|
-
disabled:
|
|
109
|
+
disabled: R,
|
|
107
110
|
value: n,
|
|
108
|
-
onChange:
|
|
109
|
-
onAnimationEnd: () =>
|
|
110
|
-
className: a(
|
|
111
|
-
...
|
|
111
|
+
onChange: V,
|
|
112
|
+
onAnimationEnd: () => f(!1),
|
|
113
|
+
className: a(Q({ isChanging: k }), S),
|
|
114
|
+
...I,
|
|
112
115
|
style: { fontSize: i, letterSpacing: "normal" }
|
|
113
116
|
}
|
|
114
117
|
),
|
|
115
|
-
|
|
118
|
+
s && p === "right" && /* @__PURE__ */ l(
|
|
116
119
|
"span",
|
|
117
120
|
{
|
|
118
121
|
className: a(b, "shrink-0"),
|
|
119
122
|
style: { fontSize: i, letterSpacing: "normal" },
|
|
120
|
-
children:
|
|
123
|
+
children: s
|
|
121
124
|
}
|
|
122
125
|
)
|
|
123
126
|
]
|
|
124
127
|
}
|
|
125
128
|
);
|
|
126
129
|
};
|
|
127
|
-
|
|
130
|
+
Y.displayName = "AmountInput";
|
|
128
131
|
export {
|
|
129
|
-
|
|
132
|
+
Y as AmountInput
|
|
130
133
|
};
|
|
@@ -29,8 +29,8 @@ const k = {
|
|
|
29
29
|
appearance: s = "info",
|
|
30
30
|
title: a,
|
|
31
31
|
description: o,
|
|
32
|
-
primaryAction:
|
|
33
|
-
secondaryAction:
|
|
32
|
+
primaryAction: n,
|
|
33
|
+
secondaryAction: l,
|
|
34
34
|
className: t,
|
|
35
35
|
onClose: i,
|
|
36
36
|
closeAriaLabel: f,
|
|
@@ -50,9 +50,9 @@ const k = {
|
|
|
50
50
|
a && /* @__PURE__ */ r("h3", { className: "line-clamp-2 body-1-semi-bold", children: a }),
|
|
51
51
|
o && /* @__PURE__ */ r("div", { className: c("line-clamp-5 body-2", !a && "mt-2"), children: o })
|
|
52
52
|
] }),
|
|
53
|
-
(
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
(n || l) && /* @__PURE__ */ e("div", { className: "flex gap-4", children: [
|
|
54
|
+
n,
|
|
55
|
+
l
|
|
56
56
|
] })
|
|
57
57
|
] }),
|
|
58
58
|
i && /* @__PURE__ */ r(
|
|
@@ -19,7 +19,7 @@ import { BaseInputProps } from './types';
|
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
21
|
export declare const BaseInput: {
|
|
22
|
-
({ ref, className, containerClassName, inputClassName, labelClassName, label, id, disabled, errorMessage, suffix, prefix, onClear, hideClearButton, "aria-invalid": ariaInvalidProp, onChange: onChangeProp, ...props }: BaseInputProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
({ ref, className, containerClassName, inputClassName, labelClassName, label, id, disabled: disabledProp, errorMessage, suffix, prefix, onClear, hideClearButton, "aria-invalid": ariaInvalidProp, onChange: onChangeProp, ...props }: BaseInputProps): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
//# sourceMappingURL=BaseInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2BzC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS;
|
|
1
|
+
{"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2BzC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS;2OAiBnB,cAAc;;CAyKhB,CAAC"}
|
|
@@ -1,63 +1,66 @@
|
|
|
1
1
|
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { cn as a } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
-
import
|
|
4
|
-
import { useCommonTranslation as
|
|
5
|
-
import { InteractiveIcon as
|
|
2
|
+
import { useDisabledContext as $, cn as a } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import d from "react";
|
|
4
|
+
import { useCommonTranslation as q } from "../../../i18n/useCommonTranslation.js";
|
|
5
|
+
import { InteractiveIcon as H } from "../InteractiveIcon/InteractiveIcon.js";
|
|
6
6
|
import { DeleteCircleFill as x } from "../../Symbols/Icons/DeleteCircleFill.js";
|
|
7
|
-
const
|
|
7
|
+
const P = a(
|
|
8
8
|
"group relative flex h-48 w-full cursor-text items-center gap-8 rounded-sm bg-muted px-16 transition-colors",
|
|
9
9
|
"focus-within:ring-2 focus-within:ring-active hover:bg-muted-hover",
|
|
10
10
|
"has-disabled:cursor-not-allowed has-disabled:bg-disabled has-disabled:text-disabled",
|
|
11
11
|
"has-invalid:border-error has-invalid:ring-1 has-invalid:ring-error",
|
|
12
12
|
'has-[input[aria-invalid="true"]]:border-error has-[input[aria-invalid="true"]]:ring-1 has-[input[aria-invalid="true"]]:ring-error'
|
|
13
|
-
),
|
|
13
|
+
), U = a(
|
|
14
14
|
"peer w-full flex-1 bg-muted body-1 text-base caret-active outline-hidden transition-colors",
|
|
15
15
|
"group-hover:bg-muted-hover group-disabled:bg-disabled",
|
|
16
16
|
"group-has-disabled:cursor-not-allowed group-has-disabled:bg-disabled group-has-disabled:text-disabled",
|
|
17
17
|
"placeholder:text-muted group-has-disabled:placeholder:text-disabled",
|
|
18
18
|
"[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
19
19
|
"truncate"
|
|
20
|
-
),
|
|
20
|
+
), W = a(
|
|
21
21
|
"pointer-events-none absolute top-6 left-16 origin-left body-4 text-muted transition-all duration-300",
|
|
22
22
|
"peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-placeholder-shown:body-2",
|
|
23
23
|
"group-has-disabled:text-disabled",
|
|
24
24
|
"peer-focus:top-6 peer-focus:translate-y-0 peer-focus:body-4",
|
|
25
25
|
"w-[calc(100%-var(--size-56))] truncate"
|
|
26
|
-
),
|
|
26
|
+
), G = ({
|
|
27
27
|
ref: y,
|
|
28
28
|
className: I,
|
|
29
29
|
containerClassName: C,
|
|
30
30
|
inputClassName: S,
|
|
31
31
|
labelClassName: N,
|
|
32
|
-
label:
|
|
32
|
+
label: u,
|
|
33
33
|
id: k,
|
|
34
|
-
disabled:
|
|
34
|
+
disabled: R,
|
|
35
35
|
errorMessage: o,
|
|
36
|
-
suffix:
|
|
37
|
-
prefix:
|
|
38
|
-
onClear:
|
|
39
|
-
hideClearButton:
|
|
36
|
+
suffix: B,
|
|
37
|
+
prefix: D,
|
|
38
|
+
onClear: E,
|
|
39
|
+
hideClearButton: j = !1,
|
|
40
40
|
"aria-invalid": b,
|
|
41
|
-
onChange:
|
|
41
|
+
onChange: h,
|
|
42
42
|
...i
|
|
43
43
|
}) => {
|
|
44
|
-
const
|
|
44
|
+
const m = $({
|
|
45
|
+
consumerName: "BaseInput",
|
|
46
|
+
mergeWith: { disabled: R }
|
|
47
|
+
}), { t: z } = q(), n = d.useRef(null), F = d.useId(), c = k || `input-${F}`, L = b || (o ? !0 : void 0), s = i.value !== void 0, [T, v] = d.useState(
|
|
45
48
|
i.defaultValue?.toString() || ""
|
|
46
|
-
),
|
|
49
|
+
), V = d.useCallback(
|
|
47
50
|
(t) => {
|
|
48
|
-
s || v(t.target.value),
|
|
51
|
+
s || v(t.target.value), h?.(t);
|
|
49
52
|
},
|
|
50
|
-
[s,
|
|
51
|
-
), f = (s ? !!i.value && i.value.toString().length > 0 :
|
|
53
|
+
[s, h]
|
|
54
|
+
), f = (s ? !!i.value && i.value.toString().length > 0 : T.length > 0) && !m && !j, g = `${c}-error`, A = () => {
|
|
52
55
|
if (!n.current) return;
|
|
53
56
|
Object.getOwnPropertyDescriptor(
|
|
54
57
|
window.HTMLInputElement.prototype,
|
|
55
58
|
"value"
|
|
56
59
|
)?.set?.call(n.current, ""), s || v("");
|
|
57
60
|
const l = new Event("input", { bubbles: !0 });
|
|
58
|
-
n.current.dispatchEvent(l), n.current.focus(),
|
|
61
|
+
n.current.dispatchEvent(l), n.current.focus(), E?.();
|
|
59
62
|
};
|
|
60
|
-
function
|
|
63
|
+
function O(...t) {
|
|
61
64
|
return (l) => {
|
|
62
65
|
t.forEach((e) => {
|
|
63
66
|
e && (typeof e == "function" ? e(l) : e.current = l);
|
|
@@ -68,7 +71,7 @@ const q = a(
|
|
|
68
71
|
/* @__PURE__ */ p(
|
|
69
72
|
"div",
|
|
70
73
|
{
|
|
71
|
-
className: a(
|
|
74
|
+
className: a(P, C),
|
|
72
75
|
onPointerDown: (t) => {
|
|
73
76
|
if (t.target.closest("input, button, a")) return;
|
|
74
77
|
const e = n.current;
|
|
@@ -83,47 +86,47 @@ const q = a(
|
|
|
83
86
|
});
|
|
84
87
|
},
|
|
85
88
|
children: [
|
|
86
|
-
|
|
89
|
+
D,
|
|
87
90
|
/* @__PURE__ */ r(
|
|
88
91
|
"input",
|
|
89
92
|
{
|
|
90
|
-
ref:
|
|
91
|
-
id:
|
|
92
|
-
disabled:
|
|
93
|
+
ref: O(y, n),
|
|
94
|
+
id: c,
|
|
95
|
+
disabled: m,
|
|
93
96
|
placeholder: " ",
|
|
94
|
-
"aria-invalid":
|
|
97
|
+
"aria-invalid": L,
|
|
95
98
|
"aria-describedby": o ? g : void 0,
|
|
96
99
|
className: a(
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
U,
|
|
101
|
+
u && "pt-12 body-2",
|
|
99
102
|
S
|
|
100
103
|
),
|
|
101
|
-
onChange:
|
|
104
|
+
onChange: V,
|
|
102
105
|
...i
|
|
103
106
|
}
|
|
104
107
|
),
|
|
105
|
-
|
|
108
|
+
u && /* @__PURE__ */ r(
|
|
106
109
|
"label",
|
|
107
110
|
{
|
|
108
|
-
htmlFor:
|
|
111
|
+
htmlFor: c,
|
|
109
112
|
className: a(
|
|
110
|
-
|
|
113
|
+
W,
|
|
111
114
|
o && "text-error",
|
|
112
115
|
N
|
|
113
116
|
),
|
|
114
|
-
children:
|
|
117
|
+
children: u
|
|
115
118
|
}
|
|
116
119
|
),
|
|
117
120
|
f && /* @__PURE__ */ r(
|
|
118
|
-
|
|
121
|
+
H,
|
|
119
122
|
{
|
|
120
123
|
iconType: "filled",
|
|
121
|
-
onClick:
|
|
122
|
-
"aria-label":
|
|
124
|
+
onClick: A,
|
|
125
|
+
"aria-label": z("components.baseInput.clearInputAriaLabel"),
|
|
123
126
|
children: /* @__PURE__ */ r(x, { size: 20 })
|
|
124
127
|
}
|
|
125
128
|
),
|
|
126
|
-
!f &&
|
|
129
|
+
!f && B
|
|
127
130
|
]
|
|
128
131
|
}
|
|
129
132
|
),
|
|
@@ -141,7 +144,7 @@ const q = a(
|
|
|
141
144
|
)
|
|
142
145
|
] });
|
|
143
146
|
};
|
|
144
|
-
|
|
147
|
+
G.displayName = "BaseInput";
|
|
145
148
|
export {
|
|
146
|
-
|
|
149
|
+
G as BaseInput
|
|
147
150
|
};
|
|
@@ -7,7 +7,7 @@ export declare const baseButtonVariants: (props?: ({
|
|
|
7
7
|
isFull?: boolean | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
9
|
export declare const BaseButton: {
|
|
10
|
-
({ ref, className, appearance, size, isFull, disabled, asChild, icon: Icon, loading, children, onClick, ...props }: BaseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
({ ref, className, appearance, size, isFull, disabled: disabledProp, asChild, icon: Icon, loading, children, onClick, ...props }: BaseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=BaseButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,kBAAkB;;;;;;8EAqD9B,CAAC;AAkBF,eAAO,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,kBAAkB;;;;;;8EAqD9B,CAAC;AAkBF,eAAO,MAAM,UAAU;sIAapB,eAAe;;CAgDjB,CAAC"}
|