@ledgerhq/lumen-ui-react 0.1.44 → 0.1.45
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 +111 -107
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +1 -0
- 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 +34 -32
- package/dist/lib/Components/AmountInput/types.d.ts +8 -0
- package/dist/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts +1 -0
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.js +9 -8
- package/dist/lib/Components/BaseInput/BaseInput.js +13 -13
- package/dist/lib/Components/Button/Button.js +9 -9
- package/dist/lib/Components/Card/Card.js +14 -14
- package/dist/lib/Components/DataTable/DataTable.js +6 -6
- package/dist/lib/Components/Divider/Divider.js +4 -4
- package/dist/lib/Components/DotIcon/DotIcon.js +5 -5
- package/dist/lib/Components/Icon/Icon.js +4 -4
- package/dist/lib/Components/Link/Link.js +6 -6
- package/dist/lib/Components/MediaImage/MediaImage.js +6 -6
- package/dist/lib/Components/Menu/Menu.d.ts +8 -3
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +40 -33
- package/dist/lib/Components/Menu/types.d.ts +6 -5
- package/dist/lib/Components/Menu/types.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/NavBar.js +9 -9
- package/dist/lib/Components/Pagination/Pagination.js +10 -10
- package/dist/lib/Components/Popover/Popover.js +10 -10
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +8 -3
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.js +41 -32
- package/dist/lib/Components/SegmentedControl/types.d.ts +6 -5
- package/dist/lib/Components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.d.ts +19 -5
- package/dist/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.js +127 -104
- package/dist/lib/Components/Select/index.d.ts +1 -1
- package/dist/lib/Components/Select/index.d.ts.map +1 -1
- package/dist/lib/Components/Select/types.d.ts +20 -19
- package/dist/lib/Components/Select/types.d.ts.map +1 -1
- package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts +9 -9
- package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts.map +1 -1
- package/dist/lib/Components/Select/utils/groupItems.d.ts +2 -2
- package/dist/lib/Components/Select/utils/groupItems.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.d.ts +11 -3
- package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.js +61 -51
- package/dist/lib/Components/SideBar/index.d.ts +2 -2
- package/dist/lib/Components/SideBar/index.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/types.d.ts +7 -6
- package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
- package/dist/lib/Components/Table/Table.js +49 -49
- package/dist/lib/Components/Table/utils/useThrottledScrollBottom.js +5 -5
- package/dist/lib/Components/TileButton/TileButton.js +6 -6
- package/dist/lib/Components/Tooltip/Tooltip.js +4 -4
- package/dist/libs/utils-shared/dist/index.js +138 -143
- package/dist/package.json +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import { AmountInput as i } from "./lib/Components/AmountInput/AmountInput.js";
|
|
|
4
4
|
import { AmountDisplay as m } from "./lib/Components/AmountDisplay/AmountDisplay.js";
|
|
5
5
|
import { Avatar as d } from "./lib/Components/Avatar/Avatar.js";
|
|
6
6
|
import { Banner as T } from "./lib/Components/Banner/Banner.js";
|
|
7
|
-
import { BaseInput as
|
|
8
|
-
import { Button as
|
|
7
|
+
import { BaseInput as c } from "./lib/Components/BaseInput/BaseInput.js";
|
|
8
|
+
import { Button as u } 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";
|
|
@@ -19,7 +19,7 @@ import { Dialog as ee, DialogBody as oe, DialogBodyStickyContent as te, DialogCo
|
|
|
19
19
|
import { DialogHeader as pe } from "./lib/Components/Dialog/DialogHeader/DialogHeader.js";
|
|
20
20
|
import { Divider as le } from "./lib/Components/Divider/Divider.js";
|
|
21
21
|
import { DotCount as xe } from "./lib/Components/DotCount/DotCount.js";
|
|
22
|
-
import { DotIcon as fe, dotIconSizeMap as
|
|
22
|
+
import { DotIcon as fe, dotIconSizeMap as ce, mediaImageDotIconSizeMap as Se, spotDotIconSizeMap as ue } from "./lib/Components/DotIcon/DotIcon.js";
|
|
23
23
|
import { DotIndicator as ge } from "./lib/Components/DotIndicator/DotIndicator.js";
|
|
24
24
|
import { DotSymbol as Be, mediaImageDotSizeMap as be, spotDotSizeMap as se } from "./lib/Components/DotSymbol/DotSymbol.js";
|
|
25
25
|
import { IconButton as Me } from "./lib/Components/IconButton/IconButton.js";
|
|
@@ -31,30 +31,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";
|
|
32
32
|
import { MediaImage as Qe } from "./lib/Components/MediaImage/MediaImage.js";
|
|
33
33
|
import { MediaTag as We } from "./lib/Components/MediaTag/MediaTag.js";
|
|
34
|
-
import { Menu as Ye, MenuCheckboxItem as Ze, MenuContent as $e, MenuGroup as eo, MenuItem as oo, MenuLabel as to, MenuRadioGroup as ro, MenuRadioItem as ao, MenuSeparator as no, MenuSub as io, MenuSubContent as po, MenuSubTrigger as mo, MenuTrigger as lo } from "./lib/Components/Menu/Menu.js";
|
|
35
|
-
import { NavBar as
|
|
36
|
-
import { Popover as
|
|
37
|
-
import { PageIndicator as
|
|
38
|
-
import { Pagination as
|
|
39
|
-
import { SearchInput as
|
|
40
|
-
import { SegmentedControl as
|
|
41
|
-
import { Select as
|
|
42
|
-
import { SideBar as
|
|
43
|
-
import { Skeleton as
|
|
44
|
-
import { Spinner as
|
|
45
|
-
import { Spot as
|
|
46
|
-
import { Stepper as
|
|
47
|
-
import { Subheader as
|
|
48
|
-
import { Switch as
|
|
49
|
-
import { Table as
|
|
50
|
-
import { Tag as
|
|
51
|
-
import { TextInput as
|
|
52
|
-
import { Tile as
|
|
53
|
-
import { TileButton as
|
|
54
|
-
import { Tooltip as
|
|
55
|
-
import { Trend as
|
|
56
|
-
import { ThemeProvider as
|
|
57
|
-
import { COLOR_SCHEMES as
|
|
34
|
+
import { Menu as Ye, MenuCheckboxItem as Ze, MenuContent as $e, MenuGroup as eo, MenuItem as oo, MenuLabel as to, MenuRadioGroup as ro, MenuRadioItem as ao, MenuSeparator as no, MenuSub as io, MenuSubContent as po, MenuSubTrigger as mo, MenuTrigger as lo, createMenuRadioGroup as xo } from "./lib/Components/Menu/Menu.js";
|
|
35
|
+
import { NavBar as fo, NavBarBackButton as co, NavBarCoinCapsule as So, NavBarDescription as uo, NavBarLeading as Co, NavBarTitle as go, NavBarTrailing as Io } from "./lib/Components/NavBar/NavBar.js";
|
|
36
|
+
import { Popover as bo, PopoverContent as so, PopoverTrigger as Do, createPopoverHandle as Mo } from "./lib/Components/Popover/Popover.js";
|
|
37
|
+
import { PageIndicator as ho } from "./lib/Components/PageIndicator/PageIndicator.js";
|
|
38
|
+
import { Pagination as Ro } from "./lib/Components/Pagination/Pagination.js";
|
|
39
|
+
import { SearchInput as Ao } from "./lib/Components/SearchInput/SearchInput.js";
|
|
40
|
+
import { SegmentedControl as Ho, SegmentedControlButton as Po, createSegmentedControl as No } from "./lib/Components/SegmentedControl/SegmentedControl.js";
|
|
41
|
+
import { Select as zo, SelectContent as Go, SelectEmptyState as Eo, SelectItem as Fo, SelectItemContent as Oo, SelectItemDescription as Vo, SelectItemText as _o, SelectList as jo, SelectSearch as qo, SelectSeparator as Jo, SelectTrigger as Ko, createSelect as Qo } from "./lib/Components/Select/Select.js";
|
|
42
|
+
import { SideBar as Wo, SideBarCollapseToggle as Xo, SideBarItem as Yo, SideBarLeading as Zo, SideBarTrailing as $o, createSideBar as et } from "./lib/Components/SideBar/SideBar.js";
|
|
43
|
+
import { Skeleton as tt } from "./lib/Components/Skeleton/Skeleton.js";
|
|
44
|
+
import { Spinner as at } from "./lib/Components/Spinner/Spinner.js";
|
|
45
|
+
import { Spot as it } from "./lib/Components/Spot/Spot.js";
|
|
46
|
+
import { Stepper as mt } from "./lib/Components/Stepper/Stepper.js";
|
|
47
|
+
import { Subheader as dt, SubheaderCount as xt, SubheaderDescription as Tt, SubheaderInfo as ft, SubheaderRow as ct, SubheaderShowMore as St, SubheaderTitle as ut } from "./lib/Components/Subheader/Subheader.js";
|
|
48
|
+
import { Switch as gt } from "./lib/Components/Switch/Switch.js";
|
|
49
|
+
import { Table as Bt, TableActionBar as bt, TableActionBarLeading as st, TableActionBarTrailing as Dt, TableBody as Mt, TableCell as Lt, TableCellContent as ht, TableGroupHeaderRow as vt, TableHeader as Rt, TableHeaderCell as wt, TableHeaderRow as At, TableInfoIcon as yt, TableLoadingRow as Ht, TableRoot as Pt, TableRow as Nt, TableSortButton as kt } from "./lib/Components/Table/Table.js";
|
|
50
|
+
import { Tag as Gt } from "./lib/Components/Tag/Tag.js";
|
|
51
|
+
import { TextInput as Ft } from "./lib/Components/TextInput/TextInput.js";
|
|
52
|
+
import { Tile as Vt, TileContent as _t, TileDescription as jt, TileSecondaryAction as qt, TileTitle as Jt, TileTrailingContent as Kt } from "./lib/Components/Tile/Tile.js";
|
|
53
|
+
import { TileButton as Ut } from "./lib/Components/TileButton/TileButton.js";
|
|
54
|
+
import { Tooltip as Xt, TooltipContent as Yt, TooltipProvider as Zt, TooltipTrigger as $t } from "./lib/Components/Tooltip/Tooltip.js";
|
|
55
|
+
import { Trend as or } from "./lib/Components/Trend/Trend.js";
|
|
56
|
+
import { ThemeProvider as rr, useTheme as ar } from "./lib/Components/ThemeProvider/ThemeProvider.js";
|
|
57
|
+
import { COLOR_SCHEMES as ir } from "./lib/Components/ThemeProvider/ThemeProvider.types.js";
|
|
58
58
|
export {
|
|
59
59
|
a as AddressInput,
|
|
60
60
|
m as AmountDisplay,
|
|
@@ -62,9 +62,9 @@ export {
|
|
|
62
62
|
d as Avatar,
|
|
63
63
|
T as Banner,
|
|
64
64
|
g as BaseButton,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
c as BaseInput,
|
|
66
|
+
u as Button,
|
|
67
|
+
ir as COLOR_SCHEMES,
|
|
68
68
|
B as Card,
|
|
69
69
|
y as CardButton,
|
|
70
70
|
b as CardContent,
|
|
@@ -134,86 +134,90 @@ export {
|
|
|
134
134
|
po as MenuSubContent,
|
|
135
135
|
mo as MenuSubTrigger,
|
|
136
136
|
lo as MenuTrigger,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
fo as NavBar,
|
|
138
|
+
co as NavBarBackButton,
|
|
139
|
+
So as NavBarCoinCapsule,
|
|
140
|
+
uo as NavBarDescription,
|
|
141
141
|
Co as NavBarLeading,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
142
|
+
go as NavBarTitle,
|
|
143
|
+
Io as NavBarTrailing,
|
|
144
|
+
ho as PageIndicator,
|
|
145
|
+
Ro as Pagination,
|
|
146
|
+
bo as Popover,
|
|
147
|
+
so as PopoverContent,
|
|
148
|
+
Do as PopoverTrigger,
|
|
149
|
+
Ao as SearchInput,
|
|
150
|
+
Ho as SegmentedControl,
|
|
151
|
+
Po as SegmentedControlButton,
|
|
152
|
+
zo as Select,
|
|
153
|
+
Go as SelectContent,
|
|
154
|
+
Eo as SelectEmptyState,
|
|
155
|
+
Fo as SelectItem,
|
|
156
|
+
Oo as SelectItemContent,
|
|
157
|
+
Vo as SelectItemDescription,
|
|
158
|
+
_o as SelectItemText,
|
|
159
|
+
jo as SelectList,
|
|
160
|
+
qo as SelectSearch,
|
|
161
|
+
Jo as SelectSeparator,
|
|
162
|
+
Ko as SelectTrigger,
|
|
163
|
+
Wo as SideBar,
|
|
164
|
+
Xo as SideBarCollapseToggle,
|
|
165
|
+
Yo as SideBarItem,
|
|
166
|
+
Zo as SideBarLeading,
|
|
167
|
+
$o as SideBarTrailing,
|
|
168
|
+
tt as Skeleton,
|
|
169
|
+
at as Spinner,
|
|
170
|
+
it as Spot,
|
|
171
|
+
mt as Stepper,
|
|
172
|
+
dt as Subheader,
|
|
173
|
+
xt as SubheaderCount,
|
|
174
|
+
Tt as SubheaderDescription,
|
|
175
|
+
ft as SubheaderInfo,
|
|
176
|
+
ct as SubheaderRow,
|
|
177
|
+
St as SubheaderShowMore,
|
|
178
|
+
ut as SubheaderTitle,
|
|
179
|
+
gt as Switch,
|
|
180
|
+
Bt as Table,
|
|
181
|
+
bt as TableActionBar,
|
|
182
|
+
st as TableActionBarLeading,
|
|
183
|
+
Dt as TableActionBarTrailing,
|
|
184
|
+
Mt as TableBody,
|
|
185
|
+
Lt as TableCell,
|
|
186
|
+
ht as TableCellContent,
|
|
187
|
+
vt as TableGroupHeaderRow,
|
|
188
|
+
Rt as TableHeader,
|
|
189
|
+
wt as TableHeaderCell,
|
|
190
|
+
At as TableHeaderRow,
|
|
191
|
+
yt as TableInfoIcon,
|
|
192
|
+
Ht as TableLoadingRow,
|
|
193
|
+
Pt as TableRoot,
|
|
194
|
+
Nt as TableRow,
|
|
195
|
+
kt as TableSortButton,
|
|
196
|
+
Gt as Tag,
|
|
197
|
+
Ft as TextInput,
|
|
198
|
+
rr as ThemeProvider,
|
|
199
|
+
Vt as Tile,
|
|
200
|
+
Ut as TileButton,
|
|
201
|
+
_t as TileContent,
|
|
202
|
+
jt as TileDescription,
|
|
203
|
+
qt as TileSecondaryAction,
|
|
204
|
+
Jt as TileTitle,
|
|
205
|
+
Kt as TileTrailingContent,
|
|
206
|
+
Xt as Tooltip,
|
|
207
|
+
Yt as TooltipContent,
|
|
208
|
+
Zt as TooltipProvider,
|
|
209
|
+
$t as TooltipTrigger,
|
|
210
|
+
or as Trend,
|
|
211
|
+
xo as createMenuRadioGroup,
|
|
212
|
+
Mo as createPopoverHandle,
|
|
213
|
+
No as createSegmentedControl,
|
|
214
|
+
Qo as createSelect,
|
|
215
|
+
et as createSideBar,
|
|
216
|
+
ce as dotIconSizeMap,
|
|
213
217
|
Se as mediaImageDotIconSizeMap,
|
|
214
218
|
be as mediaImageDotSizeMap,
|
|
215
|
-
|
|
219
|
+
ue as spotDotIconSizeMap,
|
|
216
220
|
se as spotDotSizeMap,
|
|
217
221
|
q as useLumenDataTable,
|
|
218
|
-
|
|
222
|
+
ar as useTheme
|
|
219
223
|
};
|
|
@@ -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;AAqHjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,MAAc,EACd,OAAe,EACf,OAAc,EACd,IAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,MAAc,EACd,OAAe,EACf,OAAc,EACd,IAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,2CA8DpB"}
|
|
@@ -4,5 +4,5 @@ import { AmountInputProps } from './types';
|
|
|
4
4
|
* This is a controlled component - both `value` and `onChange` props are required.
|
|
5
5
|
* The currency text can be positioned either on the left or right side of the input.
|
|
6
6
|
*/
|
|
7
|
-
export declare const AmountInput: ({ ref, className, size, align, currencyText, currencyPosition, disabled: disabledProp, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, value, onChange, ...props }: AmountInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const AmountInput: ({ ref, className, size, align, currencyText, currencyPosition, disabled: disabledProp, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, decimalSeparator, value, onChange, ...props }: AmountInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=AmountInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,6MAgBzB,gBAAgB,4CAgFlB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useDisabledContext as
|
|
1
|
+
import { jsxs as R, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useDisabledContext as k, useMergedRef as z, getFontSize as M, cn as p } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import { cva as i } from "class-variance-authority";
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { useAmountInputValue as
|
|
6
|
-
import { useAutoWidthInput as
|
|
7
|
-
const
|
|
4
|
+
import { useMemo as D } from "react";
|
|
5
|
+
import { useAmountInputValue as F } from "./useAmountInputValue/useAmountInputValue.js";
|
|
6
|
+
import { useAutoWidthInput as W } from "./useAutoWidthInput/useAutoWidthInput.js";
|
|
7
|
+
const q = i(
|
|
8
8
|
[
|
|
9
9
|
"bg-transparent caret-active outline-hidden transition-colors",
|
|
10
10
|
"text-base placeholder:text-muted-subtle",
|
|
@@ -28,7 +28,7 @@ const W = i(
|
|
|
28
28
|
isChanging: !1
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
),
|
|
31
|
+
), E = i(
|
|
32
32
|
[
|
|
33
33
|
"cursor-text text-base",
|
|
34
34
|
"group-has-[input:placeholder-shown]:text-muted-subtle",
|
|
@@ -46,7 +46,7 @@ const W = i(
|
|
|
46
46
|
size: "md"
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
),
|
|
49
|
+
), O = i("invisible absolute whitespace-pre", {
|
|
50
50
|
variants: {
|
|
51
51
|
size: {
|
|
52
52
|
md: "heading-0-semi-bold",
|
|
@@ -56,7 +56,7 @@ const W = i(
|
|
|
56
56
|
defaultVariants: {
|
|
57
57
|
size: "md"
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), B = i(
|
|
60
60
|
"group relative flex w-full items-center overflow-visible transition-transform",
|
|
61
61
|
{
|
|
62
62
|
variants: {
|
|
@@ -70,7 +70,7 @@ const W = i(
|
|
|
70
70
|
align: "center"
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
), m = ({ size: r, style: o, children: e }) => /* @__PURE__ */ a("span", { className: p(
|
|
73
|
+
), m = ({ size: r, style: o, children: e }) => /* @__PURE__ */ a("span", { className: p(E({ size: r }), "shrink-0"), style: o, children: e }), U = ({
|
|
74
74
|
ref: r,
|
|
75
75
|
className: o,
|
|
76
76
|
size: e = "md",
|
|
@@ -82,34 +82,36 @@ const W = i(
|
|
|
82
82
|
maxDecimalLength: g = 9,
|
|
83
83
|
allowDecimals: b = !0,
|
|
84
84
|
thousandsSeparator: v = !0,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
decimalSeparator: x = ".",
|
|
86
|
+
value: w,
|
|
87
|
+
onChange: y,
|
|
88
|
+
...S
|
|
88
89
|
}) => {
|
|
89
|
-
const
|
|
90
|
+
const C = k({
|
|
90
91
|
consumerName: "AmountInput",
|
|
91
92
|
mergeWith: { disabled: f }
|
|
92
|
-
}), { inputValue: n, isChanging:
|
|
93
|
-
value:
|
|
94
|
-
onChange:
|
|
93
|
+
}), { inputValue: n, isChanging: A, setIsChanging: V, handleChange: j } = F({
|
|
94
|
+
value: w,
|
|
95
|
+
onChange: y,
|
|
95
96
|
formatOptions: {
|
|
96
97
|
allowDecimals: b,
|
|
97
98
|
thousandsSeparator: v,
|
|
98
99
|
maxIntegerLength: h,
|
|
99
|
-
maxDecimalLength: g
|
|
100
|
+
maxDecimalLength: g,
|
|
101
|
+
decimalSeparator: x
|
|
100
102
|
}
|
|
101
|
-
}), { spanRef:
|
|
103
|
+
}), { spanRef: I, inputRef: d } = W({
|
|
102
104
|
inputValue: n,
|
|
103
105
|
currencyText: t,
|
|
104
106
|
size: e
|
|
105
|
-
}),
|
|
106
|
-
() =>
|
|
107
|
+
}), N = z(r, d), s = { fontSize: D(
|
|
108
|
+
() => M(n, e) + "px",
|
|
107
109
|
[n, e]
|
|
108
110
|
), letterSpacing: "normal" };
|
|
109
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ R(
|
|
110
112
|
"div",
|
|
111
113
|
{
|
|
112
|
-
className:
|
|
114
|
+
className: B({ align: c }),
|
|
113
115
|
onPointerDown: () => {
|
|
114
116
|
const u = d.current;
|
|
115
117
|
u && window.requestAnimationFrame(() => {
|
|
@@ -121,8 +123,8 @@ const W = i(
|
|
|
121
123
|
/* @__PURE__ */ a(
|
|
122
124
|
"span",
|
|
123
125
|
{
|
|
124
|
-
ref:
|
|
125
|
-
className:
|
|
126
|
+
ref: I,
|
|
127
|
+
className: O({ size: e }),
|
|
126
128
|
"aria-hidden": "true",
|
|
127
129
|
style: s,
|
|
128
130
|
children: n
|
|
@@ -131,15 +133,15 @@ const W = i(
|
|
|
131
133
|
/* @__PURE__ */ a(
|
|
132
134
|
"input",
|
|
133
135
|
{
|
|
134
|
-
ref:
|
|
136
|
+
ref: N,
|
|
135
137
|
type: "text",
|
|
136
138
|
inputMode: "decimal",
|
|
137
|
-
disabled:
|
|
139
|
+
disabled: C,
|
|
138
140
|
value: n,
|
|
139
|
-
onChange:
|
|
140
|
-
onAnimationEnd: () =>
|
|
141
|
-
className: p(
|
|
142
|
-
...
|
|
141
|
+
onChange: j,
|
|
142
|
+
onAnimationEnd: () => V(!1),
|
|
143
|
+
className: p(q({ size: e, isChanging: A }), o),
|
|
144
|
+
...S,
|
|
143
145
|
style: s
|
|
144
146
|
}
|
|
145
147
|
),
|
|
@@ -149,5 +151,5 @@ const W = i(
|
|
|
149
151
|
);
|
|
150
152
|
};
|
|
151
153
|
export {
|
|
152
|
-
|
|
154
|
+
U as AmountInput
|
|
153
155
|
};
|
|
@@ -55,5 +55,13 @@ export type AmountInputProps = {
|
|
|
55
55
|
* @default true
|
|
56
56
|
*/
|
|
57
57
|
thousandsSeparator?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Character used to display the decimal separator (e.g. `1 234,5` vs `1 234.5`).
|
|
60
|
+
* Typing always accepts both `,` and `.` regardless of this value, so it stays
|
|
61
|
+
* compatible with any locale keyboard. The value returned by `onChange` uses
|
|
62
|
+
* this separator.
|
|
63
|
+
* @default '.'
|
|
64
|
+
*/
|
|
65
|
+
decimalSeparator?: '.' | ',';
|
|
58
66
|
} & Omit<ComponentPropsWithRef<'input'>, 'size' | 'prefix' | 'value' | 'onChange'>;
|
|
59
67
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/AmountInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,GAAG,IAAI,CACN,qBAAqB,CAAC,OAAO,CAAC,EAC9B,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CACzC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/AmountInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CAC9B,GAAG,IAAI,CACN,qBAAqB,CAAC,OAAO,CAAC,EAC9B,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CACzC,CAAC"}
|
|
@@ -1 +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;
|
|
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;IACzB,gBAAgB,EAAE,GAAG,GAAG,GAAG,CAAC;CAC7B,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,yBAkC5B,CAAC"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { textFormatter as m } from "../../../../libs/utils-shared/dist/index.js";
|
|
2
|
-
import { useCallback as
|
|
2
|
+
import { useCallback as d, useState as g, useRef as i, useEffect as f } from "react";
|
|
3
3
|
const I = ({
|
|
4
4
|
value: r,
|
|
5
5
|
onChange: o,
|
|
6
6
|
formatOptions: t
|
|
7
7
|
}) => {
|
|
8
|
-
const a =
|
|
8
|
+
const a = d(
|
|
9
9
|
(e) => m(String(e), t),
|
|
10
10
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11
11
|
[
|
|
12
12
|
t.allowDecimals,
|
|
13
13
|
t.thousandsSeparator,
|
|
14
14
|
t.maxIntegerLength,
|
|
15
|
-
t.maxDecimalLength
|
|
15
|
+
t.maxDecimalLength,
|
|
16
|
+
t.decimalSeparator
|
|
16
17
|
]
|
|
17
|
-
), [
|
|
18
|
-
return
|
|
18
|
+
), [c, s] = g(() => a(r)), [h, l] = g(!1), u = i(c);
|
|
19
|
+
return f(() => {
|
|
19
20
|
const e = a(r);
|
|
20
|
-
|
|
21
|
-
}, [r, a]), { inputValue:
|
|
21
|
+
s(e), u.current = e;
|
|
22
|
+
}, [r, a]), { inputValue: c, isChanging: h, setIsChanging: l, handleChange: (e) => {
|
|
22
23
|
const n = a(e.target.value);
|
|
23
|
-
|
|
24
|
+
s(n), o({ ...e, target: { ...e.target, value: n } }), n !== u.current && l(!0), u.current = n;
|
|
24
25
|
} };
|
|
25
26
|
};
|
|
26
27
|
export {
|
|
@@ -37,7 +37,7 @@ const te = u(
|
|
|
37
37
|
"group-has-disabled:text-disabled",
|
|
38
38
|
"peer-focus:top-6 peer-focus:translate-y-0 peer-focus:body-4",
|
|
39
39
|
"w-[calc(100%-var(--size-56))] truncate"
|
|
40
|
-
),
|
|
40
|
+
), se = u(ae, {
|
|
41
41
|
variants: {
|
|
42
42
|
status: {
|
|
43
43
|
default: "",
|
|
@@ -53,7 +53,7 @@ const te = u(
|
|
|
53
53
|
status: "default",
|
|
54
54
|
floated: !1
|
|
55
55
|
}
|
|
56
|
-
}),
|
|
56
|
+
}), oe = u("mt-8 flex items-center gap-2 body-3", {
|
|
57
57
|
variants: {
|
|
58
58
|
status: {
|
|
59
59
|
default: "text-muted",
|
|
@@ -90,8 +90,8 @@ const te = u(
|
|
|
90
90
|
}), { t: E } = Z(), t = K(null), L = Q(), c = k || `input-${L}`, A = D ?? (e === "error" ? !0 : void 0), i = a.value !== void 0, [H, f] = X(
|
|
91
91
|
a.defaultValue?.toString() || ""
|
|
92
92
|
), M = Y(
|
|
93
|
-
(
|
|
94
|
-
i || f(
|
|
93
|
+
(s) => {
|
|
94
|
+
i || f(s.target.value), h?.(s);
|
|
95
95
|
},
|
|
96
96
|
[i, h]
|
|
97
97
|
), O = i ? !!a.value && a.value.toString().length > 0 : H.length > 0, { inputPlaceholder: T, labelStaysFloatedWithPlaceholder: W } = G({
|
|
@@ -111,17 +111,17 @@ const te = u(
|
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
113
|
className: n(te({ status: e }), S),
|
|
114
|
-
onPointerDown: (
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
118
|
-
const x =
|
|
114
|
+
onPointerDown: (s) => {
|
|
115
|
+
if (s.target.closest("input, button, a")) return;
|
|
116
|
+
const o = t.current;
|
|
117
|
+
if (!o) return;
|
|
118
|
+
const x = o.value.length > 0 ? o.value.length : 0;
|
|
119
119
|
window.requestAnimationFrame(() => {
|
|
120
120
|
try {
|
|
121
|
-
|
|
121
|
+
o.setSelectionRange(x, x);
|
|
122
122
|
} catch {
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
o.focus();
|
|
125
125
|
});
|
|
126
126
|
},
|
|
127
127
|
children: [
|
|
@@ -149,7 +149,7 @@ const te = u(
|
|
|
149
149
|
{
|
|
150
150
|
htmlFor: c,
|
|
151
151
|
className: n(
|
|
152
|
-
|
|
152
|
+
se({
|
|
153
153
|
status: e,
|
|
154
154
|
floated: W
|
|
155
155
|
}),
|
|
@@ -176,7 +176,7 @@ const te = u(
|
|
|
176
176
|
"div",
|
|
177
177
|
{
|
|
178
178
|
id: g,
|
|
179
|
-
className:
|
|
179
|
+
className: oe({ status: e }),
|
|
180
180
|
role: e === "error" ? "alert" : void 0,
|
|
181
181
|
children: [
|
|
182
182
|
e === "error" && /* @__PURE__ */ r(y, { size: 16, className: "text-error" }),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { cva as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cn as d } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as e } from "class-variance-authority";
|
|
4
4
|
import { BaseButton as b } from "./BaseButton.js";
|
|
5
|
-
const l =
|
|
5
|
+
const l = e("", {
|
|
6
6
|
variants: {
|
|
7
7
|
size: {
|
|
8
8
|
sm: "px-16 py-10 body-2-semi-bold",
|
|
@@ -15,22 +15,22 @@ const l = d("", {
|
|
|
15
15
|
}
|
|
16
16
|
}), x = ({
|
|
17
17
|
ref: t,
|
|
18
|
-
className:
|
|
19
|
-
loading:
|
|
18
|
+
className: s,
|
|
19
|
+
loading: m,
|
|
20
20
|
disabled: r,
|
|
21
21
|
children: a,
|
|
22
22
|
size: o,
|
|
23
23
|
icon: i,
|
|
24
24
|
...p
|
|
25
|
-
}) => /* @__PURE__ */
|
|
25
|
+
}) => /* @__PURE__ */ n(
|
|
26
26
|
b,
|
|
27
27
|
{
|
|
28
28
|
ref: t,
|
|
29
29
|
size: o,
|
|
30
30
|
disabled: r,
|
|
31
31
|
icon: i,
|
|
32
|
-
loading:
|
|
33
|
-
className:
|
|
32
|
+
loading: m,
|
|
33
|
+
className: d(l({ size: o }), "gap-8", s),
|
|
34
34
|
...p,
|
|
35
35
|
children: a
|
|
36
36
|
}
|