@ledgerhq/lumen-ui-react 0.1.38 → 0.1.40
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/i18n/locales/de.json.d.ts +15 -0
- package/dist/i18n/locales/de.json.js +1 -1
- package/dist/i18n/locales/en.json.d.ts +11 -0
- package/dist/i18n/locales/en.json.js +2 -2
- package/dist/i18n/locales/es.json.d.ts +15 -0
- package/dist/i18n/locales/es.json.js +1 -1
- package/dist/i18n/locales/fr.json.d.ts +11 -0
- package/dist/i18n/locales/fr.json.js +1 -1
- package/dist/i18n/locales/ja.json.d.ts +15 -0
- package/dist/i18n/locales/ja.json.js +2 -2
- package/dist/i18n/locales/ko.json.d.ts +15 -0
- package/dist/i18n/locales/ko.json.js +2 -2
- package/dist/i18n/locales/pt.json.d.ts +15 -0
- package/dist/i18n/locales/pt.json.js +1 -1
- package/dist/i18n/locales/ru.json.d.ts +15 -0
- package/dist/i18n/locales/ru.json.js +2 -2
- package/dist/i18n/locales/th.json.d.ts +15 -0
- package/dist/i18n/locales/th.json.js +2 -2
- package/dist/i18n/locales/tr.json.d.ts +15 -0
- package/dist/i18n/locales/tr.json.js +2 -2
- package/dist/i18n/locales/zh.json.d.ts +15 -0
- package/dist/i18n/locales/zh.json.js +2 -2
- package/dist/index.js +90 -88
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +47 -44
- package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.js +63 -92
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts +21 -0
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts.map +1 -0
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.js +28 -0
- package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.d.ts +13 -0
- package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.d.ts.map +1 -0
- package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.js +29 -0
- package/dist/lib/Components/Avatar/Avatar.d.ts +1 -1
- package/dist/lib/Components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/lib/Components/Avatar/Avatar.js +32 -26
- package/dist/lib/Components/Avatar/types.d.ts +7 -1
- package/dist/lib/Components/Avatar/types.d.ts.map +1 -1
- package/dist/lib/Components/Button/BaseButton.d.ts +1 -1
- package/dist/lib/Components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/lib/Components/IconButton/IconButton.js +17 -16
- package/dist/lib/Components/Pagination/Pagination.d.ts +13 -0
- package/dist/lib/Components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/lib/Components/Pagination/Pagination.js +93 -0
- package/dist/lib/Components/Pagination/getPaginationRange.d.ts +6 -0
- package/dist/lib/Components/Pagination/getPaginationRange.d.ts.map +1 -0
- package/dist/lib/Components/Pagination/getPaginationRange.js +25 -0
- package/dist/lib/Components/Pagination/index.d.ts +3 -0
- package/dist/lib/Components/Pagination/index.d.ts.map +1 -0
- package/dist/lib/Components/Pagination/types.d.ts +26 -0
- package/dist/lib/Components/Pagination/types.d.ts.map +1 -0
- package/dist/lib/Components/Table/Table.js +37 -37
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Button as C } from "./lib/Components/Button/Button.js";
|
|
|
9
9
|
import { BaseButton as g } from "./lib/Components/Button/BaseButton.js";
|
|
10
10
|
import { Card as B, CardContent as b, CardContentDescription as s, CardContentRow as D, CardContentTitle as M, CardFooter as L, CardFooterActions as h, CardHeader as v, CardLeading as R, CardTrailing as w } from "./lib/Components/Card/Card.js";
|
|
11
11
|
import { CardButton as y } from "./lib/Components/CardButton/CardButton.js";
|
|
12
|
-
import { Checkbox as
|
|
12
|
+
import { Checkbox as P } from "./lib/Components/Checkbox/Checkbox.js";
|
|
13
13
|
import { ContentBanner as k, ContentBannerContent as z, ContentBannerDescription as G, ContentBannerTitle as E } from "./lib/Components/ContentBanner/ContentBanner.js";
|
|
14
14
|
import { DataTable as O, DataTableGlobalSearchInput as V, DataTableRoot as _ } from "./lib/Components/DataTable/DataTable.js";
|
|
15
15
|
import { useLumenDataTable as q } from "./lib/Components/DataTable/useLumenDataTable/useLumenDataTable.js";
|
|
@@ -25,7 +25,7 @@ import { DotSymbol as Be, mediaImageDotSizeMap as be, spotDotSizeMap as se } fro
|
|
|
25
25
|
import { IconButton as Me } from "./lib/Components/IconButton/IconButton.js";
|
|
26
26
|
import { InteractiveIcon as he } from "./lib/Components/InteractiveIcon/InteractiveIcon.js";
|
|
27
27
|
import { Link as Re } from "./lib/Components/Link/Link.js";
|
|
28
|
-
import { ListItem as Ae, ListItemContent as ye, ListItemContentRow as He, ListItemDescription as
|
|
28
|
+
import { ListItem as Ae, ListItemContent as ye, ListItemContentRow as He, ListItemDescription as Pe, ListItemLeading as Ne, ListItemTitle as ke, ListItemTrailing as ze } from "./lib/Components/ListItem/ListItem.js";
|
|
29
29
|
import { MediaBanner as Ee, MediaBannerDescription as Fe, MediaBannerTitle as Oe } from "./lib/Components/MediaBanner/MediaBanner.js";
|
|
30
30
|
import { MediaButton as _e } from "./lib/Components/MediaButton/MediaButton.js";
|
|
31
31
|
import { MediaCard as qe, MediaCardTitle as Je } from "./lib/Components/MediaCard/MediaCard.js";
|
|
@@ -35,25 +35,26 @@ import { Menu as Ye, MenuCheckboxItem as Ze, MenuContent as $e, MenuGroup as eo,
|
|
|
35
35
|
import { NavBar as To, NavBarBackButton as fo, NavBarCoinCapsule as uo, NavBarDescription as So, NavBarLeading as Co, NavBarTitle as co, NavBarTrailing as go } from "./lib/Components/NavBar/NavBar.js";
|
|
36
36
|
import { Popover as Bo, PopoverContent as bo, PopoverTrigger as so, createPopoverHandle as Do } from "./lib/Components/Popover/Popover.js";
|
|
37
37
|
import { PageIndicator as Lo } from "./lib/Components/PageIndicator/PageIndicator.js";
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
38
|
+
import { Pagination as vo } from "./lib/Components/Pagination/Pagination.js";
|
|
39
|
+
import { SearchInput as wo } from "./lib/Components/SearchInput/SearchInput.js";
|
|
40
|
+
import { SegmentedControl as yo, SegmentedControlButton as Ho } from "./lib/Components/SegmentedControl/SegmentedControl.js";
|
|
41
|
+
import { Select as No, SelectContent as ko, SelectEmptyState as zo, SelectItem as Go, SelectItemContent as Eo, SelectItemDescription as Fo, SelectItemText as Oo, SelectList as Vo, SelectSearch as _o, SelectSeparator as jo, SelectTrigger as qo } from "./lib/Components/Select/Select.js";
|
|
42
|
+
import { SideBar as Ko, SideBarCollapseToggle as Qo, SideBarItem as Uo, SideBarLeading as Wo, SideBarTrailing as Xo } from "./lib/Components/SideBar/SideBar.js";
|
|
43
|
+
import { Skeleton as Zo } from "./lib/Components/Skeleton/Skeleton.js";
|
|
44
|
+
import { Spinner as et } from "./lib/Components/Spinner/Spinner.js";
|
|
45
|
+
import { Spot as tt } from "./lib/Components/Spot/Spot.js";
|
|
46
|
+
import { Stepper as at } from "./lib/Components/Stepper/Stepper.js";
|
|
47
|
+
import { Subheader as it, SubheaderCount as pt, SubheaderDescription as mt, SubheaderInfo as lt, SubheaderRow as dt, SubheaderShowMore as xt, SubheaderTitle as Tt } from "./lib/Components/Subheader/Subheader.js";
|
|
48
|
+
import { Switch as ut } from "./lib/Components/Switch/Switch.js";
|
|
49
|
+
import { Table as Ct, TableActionBar as ct, TableActionBarLeading as gt, TableActionBarTrailing as It, TableBody as Bt, TableCell as bt, TableCellContent as st, TableGroupHeaderRow as Dt, TableHeader as Mt, TableHeaderCell as Lt, TableHeaderRow as ht, TableInfoIcon as vt, TableLoadingRow as Rt, TableRoot as wt, TableRow as At, TableSortButton as yt } from "./lib/Components/Table/Table.js";
|
|
50
|
+
import { Tag as Pt } from "./lib/Components/Tag/Tag.js";
|
|
51
|
+
import { TextInput as kt } from "./lib/Components/TextInput/TextInput.js";
|
|
52
|
+
import { Tile as Gt, TileContent as Et, TileDescription as Ft, TileSecondaryAction as Ot, TileTitle as Vt, TileTrailingContent as _t } from "./lib/Components/Tile/Tile.js";
|
|
53
|
+
import { TileButton as qt } from "./lib/Components/TileButton/TileButton.js";
|
|
54
|
+
import { Tooltip as Kt, TooltipContent as Qt, TooltipProvider as Ut, TooltipTrigger as Wt } from "./lib/Components/Tooltip/Tooltip.js";
|
|
55
|
+
import { Trend as Yt } from "./lib/Components/Trend/Trend.js";
|
|
56
|
+
import { ThemeProvider as $t, useTheme as er } from "./lib/Components/ThemeProvider/ThemeProvider.js";
|
|
57
|
+
import { COLOR_SCHEMES as tr } from "./lib/Components/ThemeProvider/ThemeProvider.types.js";
|
|
57
58
|
export {
|
|
58
59
|
a as AddressInput,
|
|
59
60
|
m as AmountDisplay,
|
|
@@ -63,7 +64,7 @@ export {
|
|
|
63
64
|
g as BaseButton,
|
|
64
65
|
u as BaseInput,
|
|
65
66
|
C as Button,
|
|
66
|
-
|
|
67
|
+
tr as COLOR_SCHEMES,
|
|
67
68
|
B as Card,
|
|
68
69
|
y as CardButton,
|
|
69
70
|
b as CardContent,
|
|
@@ -75,7 +76,7 @@ export {
|
|
|
75
76
|
v as CardHeader,
|
|
76
77
|
R as CardLeading,
|
|
77
78
|
w as CardTrailing,
|
|
78
|
-
|
|
79
|
+
P as Checkbox,
|
|
79
80
|
k as ContentBanner,
|
|
80
81
|
z as ContentBannerContent,
|
|
81
82
|
G as ContentBannerDescription,
|
|
@@ -108,8 +109,8 @@ export {
|
|
|
108
109
|
Ae as ListItem,
|
|
109
110
|
ye as ListItemContent,
|
|
110
111
|
He as ListItemContentRow,
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
Pe as ListItemDescription,
|
|
113
|
+
Ne as ListItemLeading,
|
|
113
114
|
ke as ListItemTitle,
|
|
114
115
|
ze as ListItemTrailing,
|
|
115
116
|
Ee as MediaBanner,
|
|
@@ -141,71 +142,72 @@ export {
|
|
|
141
142
|
co as NavBarTitle,
|
|
142
143
|
go as NavBarTrailing,
|
|
143
144
|
Lo as PageIndicator,
|
|
145
|
+
vo as Pagination,
|
|
144
146
|
Bo as Popover,
|
|
145
147
|
bo as PopoverContent,
|
|
146
148
|
so as PopoverTrigger,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
149
|
+
wo as SearchInput,
|
|
150
|
+
yo as SegmentedControl,
|
|
151
|
+
Ho as SegmentedControlButton,
|
|
152
|
+
No as Select,
|
|
153
|
+
ko as SelectContent,
|
|
154
|
+
zo as SelectEmptyState,
|
|
155
|
+
Go as SelectItem,
|
|
156
|
+
Eo as SelectItemContent,
|
|
157
|
+
Fo as SelectItemDescription,
|
|
158
|
+
Oo as SelectItemText,
|
|
159
|
+
Vo as SelectList,
|
|
160
|
+
_o as SelectSearch,
|
|
161
|
+
jo as SelectSeparator,
|
|
162
|
+
qo as SelectTrigger,
|
|
163
|
+
Ko as SideBar,
|
|
164
|
+
Qo as SideBarCollapseToggle,
|
|
165
|
+
Uo as SideBarItem,
|
|
166
|
+
Wo as SideBarLeading,
|
|
167
|
+
Xo as SideBarTrailing,
|
|
168
|
+
Zo as Skeleton,
|
|
169
|
+
et as Spinner,
|
|
170
|
+
tt as Spot,
|
|
171
|
+
at as Stepper,
|
|
172
|
+
it as Subheader,
|
|
173
|
+
pt as SubheaderCount,
|
|
174
|
+
mt as SubheaderDescription,
|
|
175
|
+
lt as SubheaderInfo,
|
|
176
|
+
dt as SubheaderRow,
|
|
177
|
+
xt as SubheaderShowMore,
|
|
178
|
+
Tt as SubheaderTitle,
|
|
179
|
+
ut as Switch,
|
|
180
|
+
Ct as Table,
|
|
181
|
+
ct as TableActionBar,
|
|
182
|
+
gt as TableActionBarLeading,
|
|
183
|
+
It as TableActionBarTrailing,
|
|
184
|
+
Bt as TableBody,
|
|
185
|
+
bt as TableCell,
|
|
186
|
+
st as TableCellContent,
|
|
187
|
+
Dt as TableGroupHeaderRow,
|
|
188
|
+
Mt as TableHeader,
|
|
189
|
+
Lt as TableHeaderCell,
|
|
190
|
+
ht as TableHeaderRow,
|
|
191
|
+
vt as TableInfoIcon,
|
|
192
|
+
Rt as TableLoadingRow,
|
|
193
|
+
wt as TableRoot,
|
|
194
|
+
At as TableRow,
|
|
195
|
+
yt as TableSortButton,
|
|
196
|
+
Pt as Tag,
|
|
197
|
+
kt as TextInput,
|
|
198
|
+
$t as ThemeProvider,
|
|
199
|
+
Gt as Tile,
|
|
200
|
+
qt as TileButton,
|
|
201
|
+
Et as TileContent,
|
|
202
|
+
Ft as TileDescription,
|
|
203
|
+
Ot as TileSecondaryAction,
|
|
204
|
+
Vt as TileTitle,
|
|
205
|
+
_t as TileTrailingContent,
|
|
206
|
+
Kt as Tooltip,
|
|
207
|
+
Qt as TooltipContent,
|
|
208
|
+
Ut as TooltipProvider,
|
|
209
|
+
Wt as TooltipTrigger,
|
|
210
|
+
Yt as Trend,
|
|
209
211
|
Do as createPopoverHandle,
|
|
210
212
|
ue as dotIconSizeMap,
|
|
211
213
|
Se as mediaImageDotIconSizeMap,
|
|
@@ -213,5 +215,5 @@ export {
|
|
|
213
215
|
Ce as spotDotIconSizeMap,
|
|
214
216
|
se as spotDotSizeMap,
|
|
215
217
|
q as useLumenDataTable,
|
|
216
|
-
|
|
218
|
+
er as useTheme
|
|
217
219
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountDisplay.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/AmountDisplay/AmountDisplay.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAMnB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"AmountDisplay.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/AmountDisplay/AmountDisplay.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAMnB,MAAM,SAAS,CAAC;AAqHjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,MAAc,EACd,OAAe,EACf,OAAc,EACd,IAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,2CA6DpB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useSplitText as y, buildAriaLabel as w, cn as
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { useSplitText as y, buildAriaLabel as w, cn as m } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import { memo as u } from "react";
|
|
4
|
-
import { DIGITS as
|
|
5
|
-
import { useCommonTranslation as
|
|
6
|
-
const
|
|
4
|
+
import { DIGITS as v } from "./types.js";
|
|
5
|
+
import { useCommonTranslation as D } from "../../../i18n/useCommonTranslation.js";
|
|
6
|
+
const d = {
|
|
7
7
|
"heading-1-semi-bold": {
|
|
8
8
|
0: 25,
|
|
9
9
|
1: 15.5,
|
|
@@ -40,47 +40,50 @@ const m = {
|
|
|
40
40
|
8: 12.5,
|
|
41
41
|
9: 12.5
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, S = {
|
|
44
44
|
md: {
|
|
45
45
|
integer: {
|
|
46
46
|
className: "heading-1-semi-bold",
|
|
47
|
-
widths:
|
|
47
|
+
widths: d["heading-1-semi-bold"]
|
|
48
48
|
},
|
|
49
49
|
decimal: {
|
|
50
50
|
className: "heading-2-semi-bold",
|
|
51
|
-
widths:
|
|
51
|
+
widths: d["heading-2-semi-bold"]
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
sm: {
|
|
55
55
|
integer: {
|
|
56
56
|
className: "heading-2-semi-bold",
|
|
57
|
-
widths:
|
|
57
|
+
widths: d["heading-2-semi-bold"]
|
|
58
58
|
},
|
|
59
59
|
decimal: {
|
|
60
60
|
className: "heading-4-semi-bold",
|
|
61
|
-
widths:
|
|
61
|
+
widths: d["heading-4-semi-bold"]
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
}, b = u(({ value:
|
|
65
|
-
const t = s
|
|
66
|
-
return /* @__PURE__ */
|
|
64
|
+
}, b = u(({ value: s, animate: l, widths: a }) => {
|
|
65
|
+
const t = a[s];
|
|
66
|
+
return /* @__PURE__ */ o(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
|
-
className:
|
|
69
|
+
className: m(
|
|
70
|
+
"relative overflow-x-visible overflow-y-clip mask-fade-y mask-no-clip [-webkit-mask-clip:no-clip]",
|
|
71
|
+
l && "transition-[width] duration-600"
|
|
72
|
+
),
|
|
70
73
|
style: { width: t + "px" },
|
|
71
74
|
children: [
|
|
72
75
|
/* @__PURE__ */ e("span", { className: "invisible", children: "0" }),
|
|
73
76
|
/* @__PURE__ */ e(
|
|
74
77
|
"span",
|
|
75
78
|
{
|
|
76
|
-
className:
|
|
79
|
+
className: m(
|
|
77
80
|
"absolute inset-x-0 top-0 flex flex-col items-center justify-center",
|
|
78
81
|
l && "transition-transform duration-600 ease-in-out"
|
|
79
82
|
),
|
|
80
83
|
style: {
|
|
81
|
-
transform: `translateY(-${
|
|
84
|
+
transform: `translateY(-${s * 10}%)`
|
|
82
85
|
},
|
|
83
|
-
children:
|
|
86
|
+
children: v.map((n, r) => /* @__PURE__ */ e("span", { inert: n !== s, children: n }, r))
|
|
84
87
|
}
|
|
85
88
|
)
|
|
86
89
|
]
|
|
@@ -88,40 +91,40 @@ const m = {
|
|
|
88
91
|
);
|
|
89
92
|
});
|
|
90
93
|
b.displayName = "DigitStrip";
|
|
91
|
-
const
|
|
92
|
-
({ items:
|
|
93
|
-
const r =
|
|
94
|
+
const p = u(
|
|
95
|
+
({ items: s, widths: l, animate: a }) => s.map((t, n) => {
|
|
96
|
+
const r = s.length - n;
|
|
94
97
|
return t.type === "separator" ? /* @__PURE__ */ e("span", { children: t.value }, r) : /* @__PURE__ */ e(
|
|
95
98
|
b,
|
|
96
99
|
{
|
|
97
100
|
value: Number(t.value),
|
|
98
|
-
animate:
|
|
101
|
+
animate: a,
|
|
99
102
|
widths: l
|
|
100
103
|
},
|
|
101
104
|
r
|
|
102
105
|
);
|
|
103
106
|
})
|
|
104
107
|
);
|
|
105
|
-
|
|
106
|
-
function
|
|
107
|
-
value:
|
|
108
|
+
p.displayName = "DigitStripList";
|
|
109
|
+
function A({
|
|
110
|
+
value: s,
|
|
108
111
|
formatter: l,
|
|
109
|
-
hidden:
|
|
112
|
+
hidden: a = !1,
|
|
110
113
|
loading: t = !1,
|
|
111
114
|
animate: n = !0,
|
|
112
115
|
size: r = "md",
|
|
113
116
|
className: f,
|
|
114
117
|
...g
|
|
115
118
|
}) {
|
|
116
|
-
const i = l(
|
|
119
|
+
const i = l(s), h = y(i), { t: N } = D(), x = w(
|
|
117
120
|
i,
|
|
118
|
-
|
|
121
|
+
a,
|
|
119
122
|
N("components.amountDisplay.amountHiddenAriaLabel")
|
|
120
|
-
),
|
|
123
|
+
), c = S[r];
|
|
121
124
|
return /* @__PURE__ */ e(
|
|
122
125
|
"div",
|
|
123
126
|
{
|
|
124
|
-
className:
|
|
127
|
+
className: m(
|
|
125
128
|
t && "animate-pulse",
|
|
126
129
|
"relative inline-flex",
|
|
127
130
|
f
|
|
@@ -129,38 +132,38 @@ function j({
|
|
|
129
132
|
"aria-label": x,
|
|
130
133
|
"aria-busy": t,
|
|
131
134
|
...g,
|
|
132
|
-
children: /* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ o("div", { className: "flex items-baseline", children: [
|
|
136
|
+
/* @__PURE__ */ o(
|
|
134
137
|
"span",
|
|
135
138
|
{
|
|
136
|
-
className:
|
|
139
|
+
className: m("inline-flex text-base", c.integer.className),
|
|
137
140
|
"aria-hidden": "true",
|
|
138
141
|
children: [
|
|
139
142
|
i.currencyPosition === "start" && /* @__PURE__ */ e("span", { className: "me-4", children: i.currencyText }),
|
|
140
|
-
|
|
141
|
-
|
|
143
|
+
a ? /* @__PURE__ */ e("span", { children: "••••" }) : /* @__PURE__ */ e(
|
|
144
|
+
p,
|
|
142
145
|
{
|
|
143
|
-
items:
|
|
146
|
+
items: h.integerPart,
|
|
144
147
|
animate: n,
|
|
145
|
-
widths:
|
|
148
|
+
widths: c.integer.widths
|
|
146
149
|
}
|
|
147
150
|
)
|
|
148
151
|
]
|
|
149
152
|
}
|
|
150
153
|
),
|
|
151
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ o(
|
|
152
155
|
"span",
|
|
153
156
|
{
|
|
154
|
-
className:
|
|
157
|
+
className: m("inline-flex text-muted", c.decimal.className),
|
|
155
158
|
"aria-hidden": "true",
|
|
156
159
|
children: [
|
|
157
|
-
!
|
|
158
|
-
i.decimalPart && !
|
|
159
|
-
|
|
160
|
+
!a && i.decimalPart && /* @__PURE__ */ e("span", { children: i.decimalSeparator }),
|
|
161
|
+
i.decimalPart && !a && /* @__PURE__ */ e(
|
|
162
|
+
p,
|
|
160
163
|
{
|
|
161
|
-
items:
|
|
164
|
+
items: h.decimalPart,
|
|
162
165
|
animate: n,
|
|
163
|
-
widths:
|
|
166
|
+
widths: c.decimal.widths
|
|
164
167
|
}
|
|
165
168
|
),
|
|
166
169
|
i.currencyPosition === "end" && /* @__PURE__ */ e("span", { className: "ms-4", children: i.currencyText })
|
|
@@ -172,5 +175,5 @@ function j({
|
|
|
172
175
|
);
|
|
173
176
|
}
|
|
174
177
|
export {
|
|
175
|
-
|
|
178
|
+
A as AmountDisplay
|
|
176
179
|
};
|
|
@@ -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":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,SAAS,CAAC;AA0FjE;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,2LAezB,gBAAgB,4CA+ElB,CAAC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useDisabledContext as
|
|
3
|
-
import { cva as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, Q = (m, p, e) => {
|
|
9
|
-
const i = m === "" ? L : z;
|
|
10
|
-
return p ? i : i + J[e];
|
|
11
|
-
}, Z = c(
|
|
1
|
+
import { jsxs as N, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useDisabledContext as R, useMergedRef as k, getFontSize as z, cn as p } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as i } from "class-variance-authority";
|
|
4
|
+
import { useMemo as M } from "react";
|
|
5
|
+
import { useAmountInputValue as D } from "./useAmountInputValue/useAmountInputValue.js";
|
|
6
|
+
import { useAutoWidthInput as F } from "./useAutoWidthInput/useAutoWidthInput.js";
|
|
7
|
+
const W = i(
|
|
12
8
|
[
|
|
13
9
|
"bg-transparent caret-active outline-hidden transition-colors",
|
|
14
10
|
"text-base placeholder:text-muted-subtle",
|
|
@@ -32,7 +28,7 @@ const L = 33, z = 8, q = 24, B = 16, J = {
|
|
|
32
28
|
isChanging: !1
|
|
33
29
|
}
|
|
34
30
|
}
|
|
35
|
-
),
|
|
31
|
+
), q = i(
|
|
36
32
|
[
|
|
37
33
|
"cursor-text text-base",
|
|
38
34
|
"group-has-[input:placeholder-shown]:text-muted-subtle",
|
|
@@ -50,7 +46,7 @@ const L = 33, z = 8, q = 24, B = 16, J = {
|
|
|
50
46
|
size: "md"
|
|
51
47
|
}
|
|
52
48
|
}
|
|
53
|
-
),
|
|
49
|
+
), E = i("invisible absolute whitespace-pre", {
|
|
54
50
|
variants: {
|
|
55
51
|
size: {
|
|
56
52
|
md: "heading-0-semi-bold",
|
|
@@ -60,7 +56,7 @@ const L = 33, z = 8, q = 24, B = 16, J = {
|
|
|
60
56
|
defaultVariants: {
|
|
61
57
|
size: "md"
|
|
62
58
|
}
|
|
63
|
-
}),
|
|
59
|
+
}), J = i(
|
|
64
60
|
"group relative flex w-full items-center overflow-visible transition-transform",
|
|
65
61
|
{
|
|
66
62
|
variants: {
|
|
@@ -74,109 +70,84 @@ const L = 33, z = 8, q = 24, B = 16, J = {
|
|
|
74
70
|
align: "center"
|
|
75
71
|
}
|
|
76
72
|
}
|
|
77
|
-
),
|
|
78
|
-
ref:
|
|
79
|
-
className:
|
|
73
|
+
), m = ({ size: r, style: o, children: e }) => /* @__PURE__ */ a("span", { className: p(q({ size: r }), "shrink-0"), style: o, children: e }), Q = ({
|
|
74
|
+
ref: r,
|
|
75
|
+
className: o,
|
|
80
76
|
size: e = "md",
|
|
81
|
-
align:
|
|
82
|
-
currencyText:
|
|
83
|
-
currencyPosition:
|
|
84
|
-
disabled:
|
|
85
|
-
maxIntegerLength:
|
|
86
|
-
maxDecimalLength:
|
|
87
|
-
allowDecimals:
|
|
88
|
-
thousandsSeparator:
|
|
89
|
-
value:
|
|
90
|
-
onChange:
|
|
91
|
-
...
|
|
77
|
+
align: c = "center",
|
|
78
|
+
currencyText: t,
|
|
79
|
+
currencyPosition: l = "left",
|
|
80
|
+
disabled: f,
|
|
81
|
+
maxIntegerLength: h = 9,
|
|
82
|
+
maxDecimalLength: g = 9,
|
|
83
|
+
allowDecimals: b = !0,
|
|
84
|
+
thousandsSeparator: v = !0,
|
|
85
|
+
value: x,
|
|
86
|
+
onChange: w,
|
|
87
|
+
...y
|
|
92
88
|
}) => {
|
|
93
|
-
const
|
|
89
|
+
const S = R({
|
|
94
90
|
consumerName: "AmountInput",
|
|
95
|
-
mergeWith: { disabled:
|
|
96
|
-
}),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
o.current.style.width = `${t + n}px`;
|
|
91
|
+
mergeWith: { disabled: f }
|
|
92
|
+
}), { inputValue: n, isChanging: C, setIsChanging: A, handleChange: V } = D({
|
|
93
|
+
value: x,
|
|
94
|
+
onChange: w,
|
|
95
|
+
formatOptions: {
|
|
96
|
+
allowDecimals: b,
|
|
97
|
+
thousandsSeparator: v,
|
|
98
|
+
maxIntegerLength: h,
|
|
99
|
+
maxDecimalLength: g
|
|
105
100
|
}
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const V = (t) => {
|
|
116
|
-
const n = H(t.target.value, {
|
|
117
|
-
allowDecimals: S,
|
|
118
|
-
thousandsSeparator: P,
|
|
119
|
-
maxIntegerLength: C,
|
|
120
|
-
maxDecimalLength: R
|
|
121
|
-
});
|
|
122
|
-
I(n), y({ ...t, target: { ...t.target, value: n } }), n !== _.current && N(!0), _.current = n;
|
|
123
|
-
}, d = { fontSize: U, letterSpacing: "normal" };
|
|
124
|
-
return /* @__PURE__ */ T(
|
|
101
|
+
}), { spanRef: j, inputRef: d } = F({
|
|
102
|
+
inputValue: n,
|
|
103
|
+
currencyText: t,
|
|
104
|
+
size: e
|
|
105
|
+
}), I = k(r, d), s = { fontSize: M(
|
|
106
|
+
() => z(n, e) + "px",
|
|
107
|
+
[n, e]
|
|
108
|
+
), letterSpacing: "normal" };
|
|
109
|
+
return /* @__PURE__ */ N(
|
|
125
110
|
"div",
|
|
126
111
|
{
|
|
127
|
-
className:
|
|
112
|
+
className: J({ align: c }),
|
|
128
113
|
onPointerDown: () => {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
114
|
+
const u = d.current;
|
|
115
|
+
u && window.requestAnimationFrame(() => {
|
|
116
|
+
u.focus();
|
|
132
117
|
});
|
|
133
118
|
},
|
|
134
119
|
children: [
|
|
135
|
-
|
|
120
|
+
t && l === "left" && /* @__PURE__ */ a(m, { size: e, style: s, children: t }),
|
|
121
|
+
/* @__PURE__ */ a(
|
|
136
122
|
"span",
|
|
137
123
|
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
children: a
|
|
141
|
-
}
|
|
142
|
-
),
|
|
143
|
-
/* @__PURE__ */ u(
|
|
144
|
-
"span",
|
|
145
|
-
{
|
|
146
|
-
ref: r,
|
|
147
|
-
className: $({ size: e }),
|
|
124
|
+
ref: j,
|
|
125
|
+
className: E({ size: e }),
|
|
148
126
|
"aria-hidden": "true",
|
|
149
|
-
style:
|
|
150
|
-
children:
|
|
127
|
+
style: s,
|
|
128
|
+
children: n
|
|
151
129
|
}
|
|
152
130
|
),
|
|
153
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ a(
|
|
154
132
|
"input",
|
|
155
133
|
{
|
|
156
|
-
ref:
|
|
134
|
+
ref: I,
|
|
157
135
|
type: "text",
|
|
158
136
|
inputMode: "decimal",
|
|
159
|
-
disabled:
|
|
160
|
-
value:
|
|
137
|
+
disabled: S,
|
|
138
|
+
value: n,
|
|
161
139
|
onChange: V,
|
|
162
|
-
onAnimationEnd: () =>
|
|
163
|
-
className:
|
|
164
|
-
...
|
|
165
|
-
style:
|
|
140
|
+
onAnimationEnd: () => A(!1),
|
|
141
|
+
className: p(W({ size: e, isChanging: C }), o),
|
|
142
|
+
...y,
|
|
143
|
+
style: s
|
|
166
144
|
}
|
|
167
145
|
),
|
|
168
|
-
|
|
169
|
-
"span",
|
|
170
|
-
{
|
|
171
|
-
className: h(x({ size: e }), "shrink-0"),
|
|
172
|
-
style: d,
|
|
173
|
-
children: a
|
|
174
|
-
}
|
|
175
|
-
)
|
|
146
|
+
t && l === "right" && /* @__PURE__ */ a(m, { size: e, style: s, children: t })
|
|
176
147
|
]
|
|
177
148
|
}
|
|
178
149
|
);
|
|
179
150
|
};
|
|
180
151
|
export {
|
|
181
|
-
|
|
152
|
+
Q as AmountInput
|
|
182
153
|
};
|