@ledgerhq/lumen-ui-react 0.1.39 → 0.1.41
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/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.js +64 -103
- 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/Banner/Banner.js +4 -4
- package/dist/lib/Components/Banner/types.d.ts +2 -2
- package/dist/lib/Components/Banner/types.d.ts.map +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/Trend/Trend.d.ts.map +1 -1
- package/dist/lib/Components/Trend/Trend.js +51 -34
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/package.json +2 -2
- 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":"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
|
-
}, $ = (p, m, e) => {
|
|
9
|
-
const i = p === "" ? q : B;
|
|
10
|
-
return m ? i : i + Z[e];
|
|
11
|
-
}, K = 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 q = 33, B = 8, J = 24, Q = 16, Z = {
|
|
|
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 q = 33, B = 8, J = 24, Q = 16, Z = {
|
|
|
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 q = 33, B = 8, J = 24, Q = 16, Z = {
|
|
|
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,119 +70,84 @@ const q = 33, B = 8, J = 24, Q = 16, Z = {
|
|
|
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
|
-
), [s, C] = y(
|
|
105
|
-
() => _(N)
|
|
106
|
-
), [T, x] = y(!1), R = v(s), j = O(
|
|
107
|
-
() => F(s, e) + "px",
|
|
108
|
-
[s, e]
|
|
109
|
-
), d = P(() => {
|
|
110
|
-
if (r.current && o.current) {
|
|
111
|
-
const t = Math.ceil(
|
|
112
|
-
Math.max(r.current.scrollWidth, r.current.offsetWidth)
|
|
113
|
-
), n = $(s, a, e);
|
|
114
|
-
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
|
|
115
100
|
}
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const k = (t) => {
|
|
126
|
-
const n = w(t.target.value, {
|
|
127
|
-
allowDecimals: h,
|
|
128
|
-
thousandsSeparator: g,
|
|
129
|
-
maxIntegerLength: f,
|
|
130
|
-
maxDecimalLength: b
|
|
131
|
-
});
|
|
132
|
-
C(n), A({ ...t, target: { ...t.target, value: n } }), n !== R.current && x(!0), R.current = n;
|
|
133
|
-
}, l = { fontSize: j, letterSpacing: "normal" };
|
|
134
|
-
return /* @__PURE__ */ G(
|
|
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(
|
|
135
110
|
"div",
|
|
136
111
|
{
|
|
137
|
-
className:
|
|
112
|
+
className: J({ align: c }),
|
|
138
113
|
onPointerDown: () => {
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
114
|
+
const u = d.current;
|
|
115
|
+
u && window.requestAnimationFrame(() => {
|
|
116
|
+
u.focus();
|
|
142
117
|
});
|
|
143
118
|
},
|
|
144
119
|
children: [
|
|
145
|
-
|
|
120
|
+
t && l === "left" && /* @__PURE__ */ a(m, { size: e, style: s, children: t }),
|
|
121
|
+
/* @__PURE__ */ a(
|
|
146
122
|
"span",
|
|
147
123
|
{
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
children: a
|
|
151
|
-
}
|
|
152
|
-
),
|
|
153
|
-
/* @__PURE__ */ u(
|
|
154
|
-
"span",
|
|
155
|
-
{
|
|
156
|
-
ref: r,
|
|
157
|
-
className: X({ size: e }),
|
|
124
|
+
ref: j,
|
|
125
|
+
className: E({ size: e }),
|
|
158
126
|
"aria-hidden": "true",
|
|
159
|
-
style:
|
|
160
|
-
children:
|
|
127
|
+
style: s,
|
|
128
|
+
children: n
|
|
161
129
|
}
|
|
162
130
|
),
|
|
163
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ a(
|
|
164
132
|
"input",
|
|
165
133
|
{
|
|
166
|
-
ref:
|
|
134
|
+
ref: I,
|
|
167
135
|
type: "text",
|
|
168
136
|
inputMode: "decimal",
|
|
169
|
-
disabled:
|
|
170
|
-
value:
|
|
171
|
-
onChange:
|
|
172
|
-
onAnimationEnd: () =>
|
|
173
|
-
className:
|
|
174
|
-
...
|
|
175
|
-
style:
|
|
137
|
+
disabled: S,
|
|
138
|
+
value: n,
|
|
139
|
+
onChange: V,
|
|
140
|
+
onAnimationEnd: () => A(!1),
|
|
141
|
+
className: p(W({ size: e, isChanging: C }), o),
|
|
142
|
+
...y,
|
|
143
|
+
style: s
|
|
176
144
|
}
|
|
177
145
|
),
|
|
178
|
-
|
|
179
|
-
"span",
|
|
180
|
-
{
|
|
181
|
-
className: I(S({ size: e }), "shrink-0"),
|
|
182
|
-
style: l,
|
|
183
|
-
children: a
|
|
184
|
-
}
|
|
185
|
-
)
|
|
146
|
+
t && l === "right" && /* @__PURE__ */ a(m, { size: e, style: s, children: t })
|
|
186
147
|
]
|
|
187
148
|
}
|
|
188
149
|
);
|
|
189
150
|
};
|
|
190
151
|
export {
|
|
191
|
-
|
|
152
|
+
Q as AmountInput
|
|
192
153
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
type FormatOptions = {
|
|
3
|
+
allowDecimals: boolean;
|
|
4
|
+
thousandsSeparator: boolean;
|
|
5
|
+
maxIntegerLength: number;
|
|
6
|
+
maxDecimalLength: number;
|
|
7
|
+
};
|
|
8
|
+
type UseAmountInputValueArgs = {
|
|
9
|
+
value: string | number;
|
|
10
|
+
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
formatOptions: FormatOptions;
|
|
12
|
+
};
|
|
13
|
+
type UseAmountInputValueReturn = {
|
|
14
|
+
inputValue: string;
|
|
15
|
+
isChanging: boolean;
|
|
16
|
+
setIsChanging: React.Dispatch<React.SetStateAction<boolean>>;
|
|
17
|
+
handleChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const useAmountInputValue: ({ value, onChange, formatOptions, }: UseAmountInputValueArgs) => UseAmountInputValueReturn;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=useAmountInputValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAmountInputValue.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGzC,KAAK,aAAa,GAAG;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7D,YAAY,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,qCAIjC,uBAAuB,KAAG,yBAiC5B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { textFormatter as m } from "../../../../libs/utils-shared/dist/index.js";
|
|
2
|
+
import { useCallback as f, useState as g, useRef as i, useEffect as d } from "react";
|
|
3
|
+
const I = ({
|
|
4
|
+
value: r,
|
|
5
|
+
onChange: o,
|
|
6
|
+
formatOptions: t
|
|
7
|
+
}) => {
|
|
8
|
+
const a = f(
|
|
9
|
+
(e) => m(String(e), t),
|
|
10
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11
|
+
[
|
|
12
|
+
t.allowDecimals,
|
|
13
|
+
t.thousandsSeparator,
|
|
14
|
+
t.maxIntegerLength,
|
|
15
|
+
t.maxDecimalLength
|
|
16
|
+
]
|
|
17
|
+
), [s, c] = g(() => a(r)), [h, l] = g(!1), u = i(s);
|
|
18
|
+
return d(() => {
|
|
19
|
+
const e = a(r);
|
|
20
|
+
c(e), u.current = e;
|
|
21
|
+
}, [r, a]), { inputValue: s, isChanging: h, setIsChanging: l, handleChange: (e) => {
|
|
22
|
+
const n = a(e.target.value);
|
|
23
|
+
c(n), o({ ...e, target: { ...e.target, value: n } }), n !== u.current && l(!0), u.current = n;
|
|
24
|
+
} };
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
I as useAmountInputValue
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AmountInputSize } from '../types';
|
|
2
|
+
type UseAutoWidthInputArgs = {
|
|
3
|
+
inputValue: string;
|
|
4
|
+
currencyText: string | undefined;
|
|
5
|
+
size: AmountInputSize;
|
|
6
|
+
};
|
|
7
|
+
type UseAutoWidthInputReturn = {
|
|
8
|
+
spanRef: React.RefObject<HTMLSpanElement | null>;
|
|
9
|
+
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
10
|
+
};
|
|
11
|
+
export declare const useAutoWidthInput: ({ inputValue, currencyText, size, }: UseAutoWidthInputArgs) => UseAutoWidthInputReturn;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=useAutoWidthInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutoWidthInput.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA+BhD,KAAK,qBAAqB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IACjD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;CACpD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,qCAI/B,qBAAqB,KAAG,uBA0B1B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useRef as _, useCallback as i, useLayoutEffect as I, useEffect as d } from "react";
|
|
2
|
+
const D = 33, f = 8, N = 24, P = 16, a = {
|
|
3
|
+
md: N,
|
|
4
|
+
sm: P
|
|
5
|
+
}, R = (n, e, r) => {
|
|
6
|
+
const t = n === "" ? D : f;
|
|
7
|
+
return e ? t : t + a[r];
|
|
8
|
+
}, W = ({
|
|
9
|
+
inputValue: n,
|
|
10
|
+
currencyText: e,
|
|
11
|
+
size: r
|
|
12
|
+
}) => {
|
|
13
|
+
const t = _(null), u = _(null), s = i(() => {
|
|
14
|
+
if (!t.current || !u.current) return;
|
|
15
|
+
const c = Math.ceil(
|
|
16
|
+
Math.max(t.current.scrollWidth, t.current.offsetWidth)
|
|
17
|
+
), o = R(n, e, r);
|
|
18
|
+
u.current.style.width = `${c + o}px`;
|
|
19
|
+
}, [n, e, r]);
|
|
20
|
+
return I(s, [s]), d(() => {
|
|
21
|
+
const c = t.current;
|
|
22
|
+
if (!c || typeof ResizeObserver > "u") return;
|
|
23
|
+
const o = new ResizeObserver(s);
|
|
24
|
+
return o.observe(c), () => o.disconnect();
|
|
25
|
+
}, [s]), { spanRef: t, inputRef: u };
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
W as useAutoWidthInput
|
|
29
|
+
};
|
|
@@ -36,7 +36,7 @@ const k = {
|
|
|
36
36
|
closeAriaLabel: f,
|
|
37
37
|
...p
|
|
38
38
|
}) => {
|
|
39
|
-
const { t:
|
|
39
|
+
const { t: x } = g(), d = k[s];
|
|
40
40
|
return /* @__PURE__ */ e(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
@@ -44,13 +44,13 @@ const k = {
|
|
|
44
44
|
className: c(F.root({ appearance: s }), t),
|
|
45
45
|
...p,
|
|
46
46
|
children: [
|
|
47
|
-
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-start py-4", children:
|
|
47
|
+
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-start py-4", children: d }),
|
|
48
48
|
/* @__PURE__ */ e("div", { className: "mr-8 flex flex-1 flex-col gap-8 py-4", children: [
|
|
49
49
|
/* @__PURE__ */ e("div", { className: "flex flex-col gap-4", children: [
|
|
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
|
-
(l || n) && /* @__PURE__ */ e("div", { className: "flex gap-4", children: [
|
|
53
|
+
(l || n) && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-4", children: [
|
|
54
54
|
l,
|
|
55
55
|
n
|
|
56
56
|
] })
|
|
@@ -62,7 +62,7 @@ const k = {
|
|
|
62
62
|
size: "xs",
|
|
63
63
|
icon: h,
|
|
64
64
|
onClick: () => i(),
|
|
65
|
-
"aria-label": f ||
|
|
65
|
+
"aria-label": f || x("components.banner.closeAriaLabel")
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
]
|
|
@@ -8,11 +8,11 @@ export type BannerProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
8
8
|
/**
|
|
9
9
|
* The main title of the banner.
|
|
10
10
|
*/
|
|
11
|
-
title?:
|
|
11
|
+
title?: ReactNode;
|
|
12
12
|
/**
|
|
13
13
|
* Optional descriptive text.
|
|
14
14
|
*/
|
|
15
|
-
description?:
|
|
15
|
+
description?: ReactNode;
|
|
16
16
|
/**
|
|
17
17
|
* Optional primary action.
|
|
18
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Banner/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9E,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACzD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACtD;;OAEG;IACH,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Banner/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9E,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACzD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACtD;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/IconButton/IconButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,UAAU,GAAI,0HAUxB,eAAe,4CAuBjB,CAAC"}
|