@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.
Files changed (56) hide show
  1. package/dist/i18n/locales/de.json.d.ts +15 -0
  2. package/dist/i18n/locales/de.json.js +1 -1
  3. package/dist/i18n/locales/en.json.d.ts +11 -0
  4. package/dist/i18n/locales/en.json.js +2 -2
  5. package/dist/i18n/locales/es.json.d.ts +15 -0
  6. package/dist/i18n/locales/es.json.js +1 -1
  7. package/dist/i18n/locales/fr.json.d.ts +11 -0
  8. package/dist/i18n/locales/fr.json.js +1 -1
  9. package/dist/i18n/locales/ja.json.d.ts +15 -0
  10. package/dist/i18n/locales/ja.json.js +2 -2
  11. package/dist/i18n/locales/ko.json.d.ts +15 -0
  12. package/dist/i18n/locales/ko.json.js +2 -2
  13. package/dist/i18n/locales/pt.json.d.ts +15 -0
  14. package/dist/i18n/locales/pt.json.js +1 -1
  15. package/dist/i18n/locales/ru.json.d.ts +15 -0
  16. package/dist/i18n/locales/ru.json.js +2 -2
  17. package/dist/i18n/locales/th.json.d.ts +15 -0
  18. package/dist/i18n/locales/th.json.js +2 -2
  19. package/dist/i18n/locales/tr.json.d.ts +15 -0
  20. package/dist/i18n/locales/tr.json.js +2 -2
  21. package/dist/i18n/locales/zh.json.d.ts +15 -0
  22. package/dist/i18n/locales/zh.json.js +2 -2
  23. package/dist/index.js +90 -88
  24. package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
  25. package/dist/lib/Components/AmountDisplay/AmountDisplay.js +47 -44
  26. package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  27. package/dist/lib/Components/AmountInput/AmountInput.js +63 -92
  28. package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts +21 -0
  29. package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts.map +1 -0
  30. package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.js +28 -0
  31. package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.d.ts +13 -0
  32. package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.d.ts.map +1 -0
  33. package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.js +29 -0
  34. package/dist/lib/Components/Avatar/Avatar.d.ts +1 -1
  35. package/dist/lib/Components/Avatar/Avatar.d.ts.map +1 -1
  36. package/dist/lib/Components/Avatar/Avatar.js +32 -26
  37. package/dist/lib/Components/Avatar/types.d.ts +7 -1
  38. package/dist/lib/Components/Avatar/types.d.ts.map +1 -1
  39. package/dist/lib/Components/Button/BaseButton.d.ts +1 -1
  40. package/dist/lib/Components/IconButton/IconButton.d.ts.map +1 -1
  41. package/dist/lib/Components/IconButton/IconButton.js +17 -16
  42. package/dist/lib/Components/Pagination/Pagination.d.ts +13 -0
  43. package/dist/lib/Components/Pagination/Pagination.d.ts.map +1 -0
  44. package/dist/lib/Components/Pagination/Pagination.js +93 -0
  45. package/dist/lib/Components/Pagination/getPaginationRange.d.ts +6 -0
  46. package/dist/lib/Components/Pagination/getPaginationRange.d.ts.map +1 -0
  47. package/dist/lib/Components/Pagination/getPaginationRange.js +25 -0
  48. package/dist/lib/Components/Pagination/index.d.ts +3 -0
  49. package/dist/lib/Components/Pagination/index.d.ts.map +1 -0
  50. package/dist/lib/Components/Pagination/types.d.ts +26 -0
  51. package/dist/lib/Components/Pagination/types.d.ts.map +1 -0
  52. package/dist/lib/Components/Table/Table.js +37 -37
  53. package/dist/lib/Components/index.d.ts +1 -0
  54. package/dist/lib/Components/index.d.ts.map +1 -1
  55. package/dist/package.json +1 -1
  56. 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 N } from "./lib/Components/Checkbox/Checkbox.js";
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 Ne, ListItemLeading as Pe, ListItemTitle as ke, ListItemTrailing as ze } from "./lib/Components/ListItem/ListItem.js";
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 { SearchInput as vo } from "./lib/Components/SearchInput/SearchInput.js";
39
- import { SegmentedControl as wo, SegmentedControlButton as Ao } from "./lib/Components/SegmentedControl/SegmentedControl.js";
40
- import { Select as Ho, SelectContent as No, SelectEmptyState as Po, SelectItem as ko, SelectItemContent as zo, SelectItemDescription as Go, SelectItemText as Eo, SelectList as Fo, SelectSearch as Oo, SelectSeparator as Vo, SelectTrigger as _o } from "./lib/Components/Select/Select.js";
41
- import { SideBar as qo, SideBarCollapseToggle as Jo, SideBarItem as Ko, SideBarLeading as Qo, SideBarTrailing as Uo } from "./lib/Components/SideBar/SideBar.js";
42
- import { Skeleton as Xo } from "./lib/Components/Skeleton/Skeleton.js";
43
- import { Spinner as Zo } from "./lib/Components/Spinner/Spinner.js";
44
- import { Spot as et } from "./lib/Components/Spot/Spot.js";
45
- import { Stepper as tt } from "./lib/Components/Stepper/Stepper.js";
46
- import { Subheader as at, SubheaderCount as nt, SubheaderDescription as it, SubheaderInfo as pt, SubheaderRow as mt, SubheaderShowMore as lt, SubheaderTitle as dt } from "./lib/Components/Subheader/Subheader.js";
47
- import { Switch as Tt } from "./lib/Components/Switch/Switch.js";
48
- import { Table as ut, TableActionBar as St, TableActionBarLeading as Ct, TableActionBarTrailing as ct, TableBody as gt, TableCell as It, TableCellContent as Bt, TableGroupHeaderRow as bt, TableHeader as st, TableHeaderCell as Dt, TableHeaderRow as Mt, TableInfoIcon as Lt, TableLoadingRow as ht, TableRoot as vt, TableRow as Rt, TableSortButton as wt } from "./lib/Components/Table/Table.js";
49
- import { Tag as yt } from "./lib/Components/Tag/Tag.js";
50
- import { TextInput as Nt } from "./lib/Components/TextInput/TextInput.js";
51
- import { Tile as kt, TileContent as zt, TileDescription as Gt, TileSecondaryAction as Et, TileTitle as Ft, TileTrailingContent as Ot } from "./lib/Components/Tile/Tile.js";
52
- import { TileButton as _t } from "./lib/Components/TileButton/TileButton.js";
53
- import { Tooltip as qt, TooltipContent as Jt, TooltipProvider as Kt, TooltipTrigger as Qt } from "./lib/Components/Tooltip/Tooltip.js";
54
- import { Trend as Wt } from "./lib/Components/Trend/Trend.js";
55
- import { ThemeProvider as Yt, useTheme as Zt } from "./lib/Components/ThemeProvider/ThemeProvider.js";
56
- import { COLOR_SCHEMES as er } from "./lib/Components/ThemeProvider/ThemeProvider.types.js";
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
- er as COLOR_SCHEMES,
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
- N as Checkbox,
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
- Ne as ListItemDescription,
112
- Pe as ListItemLeading,
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
- vo as SearchInput,
148
- wo as SegmentedControl,
149
- Ao as SegmentedControlButton,
150
- Ho as Select,
151
- No as SelectContent,
152
- Po as SelectEmptyState,
153
- ko as SelectItem,
154
- zo as SelectItemContent,
155
- Go as SelectItemDescription,
156
- Eo as SelectItemText,
157
- Fo as SelectList,
158
- Oo as SelectSearch,
159
- Vo as SelectSeparator,
160
- _o as SelectTrigger,
161
- qo as SideBar,
162
- Jo as SideBarCollapseToggle,
163
- Ko as SideBarItem,
164
- Qo as SideBarLeading,
165
- Uo as SideBarTrailing,
166
- Xo as Skeleton,
167
- Zo as Spinner,
168
- et as Spot,
169
- tt as Stepper,
170
- at as Subheader,
171
- nt as SubheaderCount,
172
- it as SubheaderDescription,
173
- pt as SubheaderInfo,
174
- mt as SubheaderRow,
175
- lt as SubheaderShowMore,
176
- dt as SubheaderTitle,
177
- Tt as Switch,
178
- ut as Table,
179
- St as TableActionBar,
180
- Ct as TableActionBarLeading,
181
- ct as TableActionBarTrailing,
182
- gt as TableBody,
183
- It as TableCell,
184
- Bt as TableCellContent,
185
- bt as TableGroupHeaderRow,
186
- st as TableHeader,
187
- Dt as TableHeaderCell,
188
- Mt as TableHeaderRow,
189
- Lt as TableInfoIcon,
190
- ht as TableLoadingRow,
191
- vt as TableRoot,
192
- Rt as TableRow,
193
- wt as TableSortButton,
194
- yt as Tag,
195
- Nt as TextInput,
196
- Yt as ThemeProvider,
197
- kt as Tile,
198
- _t as TileButton,
199
- zt as TileContent,
200
- Gt as TileDescription,
201
- Et as TileSecondaryAction,
202
- Ft as TileTitle,
203
- Ot as TileTrailingContent,
204
- qt as Tooltip,
205
- Jt as TooltipContent,
206
- Kt as TooltipProvider,
207
- Qt as TooltipTrigger,
208
- Wt as Trend,
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
- Zt as useTheme
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;AAkHjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
+ {"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 c } from "react/jsx-runtime";
2
- import { useSplitText as y, buildAriaLabel as w, cn as o } from "../../../libs/utils-shared/dist/index.js";
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 D } from "./types.js";
5
- import { useCommonTranslation as S } from "../../../i18n/useCommonTranslation.js";
6
- const m = {
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
- }, v = {
43
+ }, S = {
44
44
  md: {
45
45
  integer: {
46
46
  className: "heading-1-semi-bold",
47
- widths: m["heading-1-semi-bold"]
47
+ widths: d["heading-1-semi-bold"]
48
48
  },
49
49
  decimal: {
50
50
  className: "heading-2-semi-bold",
51
- widths: m["heading-2-semi-bold"]
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: m["heading-2-semi-bold"]
57
+ widths: d["heading-2-semi-bold"]
58
58
  },
59
59
  decimal: {
60
60
  className: "heading-4-semi-bold",
61
- widths: m["heading-4-semi-bold"]
61
+ widths: d["heading-4-semi-bold"]
62
62
  }
63
63
  }
64
- }, b = u(({ value: a, animate: l, widths: s }) => {
65
- const t = s[a];
66
- return /* @__PURE__ */ c(
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: "relative overflow-hidden mask-fade-y transition-[width] duration-600",
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: o(
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(-${a * 10}%)`
84
+ transform: `translateY(-${s * 10}%)`
82
85
  },
83
- children: D.map((n, r) => /* @__PURE__ */ e("span", { inert: n !== a, children: n }, r))
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 h = u(
92
- ({ items: a, widths: l, animate: s }) => a.map((t, n) => {
93
- const r = a.length - n;
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: s,
101
+ animate: a,
99
102
  widths: l
100
103
  },
101
104
  r
102
105
  );
103
106
  })
104
107
  );
105
- h.displayName = "DigitStripList";
106
- function j({
107
- value: a,
108
+ p.displayName = "DigitStripList";
109
+ function A({
110
+ value: s,
108
111
  formatter: l,
109
- hidden: s = !1,
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(a), p = y(i), { t: N } = S(), x = w(
119
+ const i = l(s), h = y(i), { t: N } = D(), x = w(
117
120
  i,
118
- s,
121
+ a,
119
122
  N("components.amountDisplay.amountHiddenAriaLabel")
120
- ), d = v[r];
123
+ ), c = S[r];
121
124
  return /* @__PURE__ */ e(
122
125
  "div",
123
126
  {
124
- className: o(
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__ */ c("div", { className: "flex items-baseline", children: [
133
- /* @__PURE__ */ c(
135
+ children: /* @__PURE__ */ o("div", { className: "flex items-baseline", children: [
136
+ /* @__PURE__ */ o(
134
137
  "span",
135
138
  {
136
- className: o("inline-flex text-base", d.integer.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
- s ? /* @__PURE__ */ e("span", { children: "••••" }) : /* @__PURE__ */ e(
141
- h,
143
+ a ? /* @__PURE__ */ e("span", { children: "••••" }) : /* @__PURE__ */ e(
144
+ p,
142
145
  {
143
- items: p.integerPart,
146
+ items: h.integerPart,
144
147
  animate: n,
145
- widths: d.integer.widths
148
+ widths: c.integer.widths
146
149
  }
147
150
  )
148
151
  ]
149
152
  }
150
153
  ),
151
- /* @__PURE__ */ c(
154
+ /* @__PURE__ */ o(
152
155
  "span",
153
156
  {
154
- className: o("inline-flex text-muted", d.decimal.className),
157
+ className: m("inline-flex text-muted", c.decimal.className),
155
158
  "aria-hidden": "true",
156
159
  children: [
157
- !s && i.decimalPart && /* @__PURE__ */ e("span", { children: i.decimalSeparator }),
158
- i.decimalPart && !s && /* @__PURE__ */ e(
159
- h,
160
+ !a && i.decimalPart && /* @__PURE__ */ e("span", { children: i.decimalSeparator }),
161
+ i.decimalPart && !a && /* @__PURE__ */ e(
162
+ p,
160
163
  {
161
- items: p.decimalPart,
164
+ items: h.decimalPart,
162
165
  animate: n,
163
- widths: d.decimal.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
- j as AmountDisplay
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":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,SAAS,CAAC;AAyGjE;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,2LAezB,gBAAgB,4CAmHlB,CAAC"}
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 T, jsx as u } from "react/jsx-runtime";
2
- import { useDisabledContext as j, useMergedRef as k, getFontSize as G, cn as h, textFormatter as H } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as c } from "class-variance-authority";
4
- import { useRef as g, useState as D, useMemo as Y, useCallback as F, useLayoutEffect as O, useEffect as v } from "react";
5
- const L = 33, z = 8, q = 24, B = 16, J = {
6
- md: q,
7
- sm: B
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
- ), x = c(
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
- ), $ = c("invisible absolute whitespace-pre", {
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
- }), K = c(
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
- ), st = ({
78
- ref: m,
79
- className: p,
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: i = "center",
82
- currencyText: a,
83
- currencyPosition: b = "left",
84
- disabled: w,
85
- maxIntegerLength: C = 9,
86
- maxDecimalLength: R = 9,
87
- allowDecimals: S = !0,
88
- thousandsSeparator: P = !0,
89
- value: f,
90
- onChange: y,
91
- ...W
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 A = j({
89
+ const S = R({
94
90
  consumerName: "AmountInput",
95
- mergeWith: { disabled: w }
96
- }), r = g(null), o = g(null), E = k(m, o), [s, I] = D(f.toString()), [M, N] = D(!1), _ = g(s), U = Y(
97
- () => G(s, e) + "px",
98
- [s, e]
99
- ), l = F(() => {
100
- if (r.current && o.current) {
101
- const t = Math.ceil(
102
- Math.max(r.current.scrollWidth, r.current.offsetWidth)
103
- ), n = Q(s, a, e);
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
- }, [s, a, e]);
107
- O(l, [l]), v(() => {
108
- const t = r.current;
109
- if (!t) return;
110
- const n = new ResizeObserver(l);
111
- return n.observe(t), () => n.disconnect();
112
- }, [l]), v(() => {
113
- I(f.toString());
114
- }, [f]);
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: K({ align: i }),
112
+ className: J({ align: c }),
128
113
  onPointerDown: () => {
129
- const t = o.current;
130
- t && window.requestAnimationFrame(() => {
131
- t.focus();
114
+ const u = d.current;
115
+ u && window.requestAnimationFrame(() => {
116
+ u.focus();
132
117
  });
133
118
  },
134
119
  children: [
135
- a && b === "left" && /* @__PURE__ */ u(
120
+ t && l === "left" && /* @__PURE__ */ a(m, { size: e, style: s, children: t }),
121
+ /* @__PURE__ */ a(
136
122
  "span",
137
123
  {
138
- className: h(x({ size: e }), "shrink-0"),
139
- style: d,
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: d,
150
- children: s
127
+ style: s,
128
+ children: n
151
129
  }
152
130
  ),
153
- /* @__PURE__ */ u(
131
+ /* @__PURE__ */ a(
154
132
  "input",
155
133
  {
156
- ref: E,
134
+ ref: I,
157
135
  type: "text",
158
136
  inputMode: "decimal",
159
- disabled: A,
160
- value: s,
137
+ disabled: S,
138
+ value: n,
161
139
  onChange: V,
162
- onAnimationEnd: () => N(!1),
163
- className: h(Z({ size: e, isChanging: M }), p),
164
- ...W,
165
- style: d
140
+ onAnimationEnd: () => A(!1),
141
+ className: p(W({ size: e, isChanging: C }), o),
142
+ ...y,
143
+ style: s
166
144
  }
167
145
  ),
168
- a && b === "right" && /* @__PURE__ */ u(
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
- st as AmountInput
152
+ Q as AmountInput
182
153
  };