@ledgerhq/lumen-ui-react 0.1.39 → 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 (48) 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/AmountInput/AmountInput.d.ts.map +1 -1
  25. package/dist/lib/Components/AmountInput/AmountInput.js +64 -103
  26. package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts +21 -0
  27. package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts.map +1 -0
  28. package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.js +28 -0
  29. package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.d.ts +13 -0
  30. package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.d.ts.map +1 -0
  31. package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.js +29 -0
  32. package/dist/lib/Components/IconButton/IconButton.d.ts.map +1 -1
  33. package/dist/lib/Components/IconButton/IconButton.js +17 -16
  34. package/dist/lib/Components/Pagination/Pagination.d.ts +13 -0
  35. package/dist/lib/Components/Pagination/Pagination.d.ts.map +1 -0
  36. package/dist/lib/Components/Pagination/Pagination.js +93 -0
  37. package/dist/lib/Components/Pagination/getPaginationRange.d.ts +6 -0
  38. package/dist/lib/Components/Pagination/getPaginationRange.d.ts.map +1 -0
  39. package/dist/lib/Components/Pagination/getPaginationRange.js +25 -0
  40. package/dist/lib/Components/Pagination/index.d.ts +3 -0
  41. package/dist/lib/Components/Pagination/index.d.ts.map +1 -0
  42. package/dist/lib/Components/Pagination/types.d.ts +26 -0
  43. package/dist/lib/Components/Pagination/types.d.ts.map +1 -0
  44. package/dist/lib/Components/Table/Table.js +37 -37
  45. package/dist/lib/Components/index.d.ts +1 -0
  46. package/dist/lib/Components/index.d.ts.map +1 -1
  47. package/dist/package.json +1 -1
  48. 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":"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,4CAgIlB,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 G, jsx as u } from "react/jsx-runtime";
2
- import { useDisabledContext as H, useMergedRef as Y, textFormatter as w, getFontSize as F, cn as I } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as c } from "class-variance-authority";
4
- import { useRef as v, useCallback as P, useState as y, useMemo as O, useLayoutEffect as z, useEffect as E } from "react";
5
- const q = 33, B = 8, J = 24, Q = 16, Z = {
6
- md: J,
7
- sm: Q
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
- ), S = 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 q = 33, B = 8, J = 24, Q = 16, Z = {
50
46
  size: "md"
51
47
  }
52
48
  }
53
- ), X = 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 q = 33, B = 8, J = 24, Q = 16, Z = {
60
56
  defaultVariants: {
61
57
  size: "md"
62
58
  }
63
- }), L = c(
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
- ), at = ({
78
- ref: p,
79
- className: m,
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: D = "left",
84
- disabled: W,
85
- maxIntegerLength: f = 9,
86
- maxDecimalLength: b = 9,
87
- allowDecimals: h = !0,
88
- thousandsSeparator: g = !0,
89
- value: N,
90
- onChange: A,
91
- ...M
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 V = H({
89
+ const S = R({
94
90
  consumerName: "AmountInput",
95
- mergeWith: { disabled: W }
96
- }), r = v(null), o = v(null), U = Y(p, o), _ = P(
97
- (t) => w(t.toString(), {
98
- allowDecimals: h,
99
- thousandsSeparator: g,
100
- maxIntegerLength: f,
101
- maxDecimalLength: b
102
- }),
103
- [h, g, f, b]
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
- }, [s, a, e]);
117
- z(d, [d]), E(() => {
118
- const t = r.current;
119
- if (!t) return;
120
- const n = new ResizeObserver(d);
121
- return n.observe(t), () => n.disconnect();
122
- }, [d]), E(() => {
123
- C(_(N));
124
- }, [N, _]);
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: L({ align: i }),
112
+ className: J({ align: c }),
138
113
  onPointerDown: () => {
139
- const t = o.current;
140
- t && window.requestAnimationFrame(() => {
141
- t.focus();
114
+ const u = d.current;
115
+ u && window.requestAnimationFrame(() => {
116
+ u.focus();
142
117
  });
143
118
  },
144
119
  children: [
145
- a && D === "left" && /* @__PURE__ */ u(
120
+ t && l === "left" && /* @__PURE__ */ a(m, { size: e, style: s, children: t }),
121
+ /* @__PURE__ */ a(
146
122
  "span",
147
123
  {
148
- className: I(S({ size: e }), "shrink-0"),
149
- style: l,
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: l,
160
- children: s
127
+ style: s,
128
+ children: n
161
129
  }
162
130
  ),
163
- /* @__PURE__ */ u(
131
+ /* @__PURE__ */ a(
164
132
  "input",
165
133
  {
166
- ref: U,
134
+ ref: I,
167
135
  type: "text",
168
136
  inputMode: "decimal",
169
- disabled: V,
170
- value: s,
171
- onChange: k,
172
- onAnimationEnd: () => x(!1),
173
- className: I(K({ size: e, isChanging: T }), m),
174
- ...M,
175
- style: l
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
- a && D === "right" && /* @__PURE__ */ u(
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
- at as AmountInput
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
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,UAAU,GAAI,0HAUxB,eAAe,4CAuBjB,CAAC"}
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"}
@@ -1,32 +1,33 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { Tooltip as u, TooltipTrigger as d, TooltipContent as f } from "../Tooltip/Tooltip.js";
3
- import { BaseButton as h } from "../Button/BaseButton.js";
4
- const B = ({
1
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
+ import { cn as f } from "../../../libs/utils-shared/dist/index.js";
3
+ import { Tooltip as h, TooltipTrigger as u, TooltipContent as d } from "../Tooltip/Tooltip.js";
4
+ import { BaseButton as T } from "../Button/BaseButton.js";
5
+ const b = ({
5
6
  ref: n,
6
7
  className: e,
7
8
  icon: i,
8
- tooltip: l = !1,
9
- tooltipPlacement: p = "top",
10
- tooltipText: s,
11
- onTooltipOpenChange: a,
9
+ tooltip: s = !1,
10
+ tooltipPlacement: l = "top",
11
+ tooltipText: a,
12
+ onTooltipOpenChange: p,
12
13
  "aria-label": t,
13
- ...c
14
+ ...m
14
15
  }) => {
15
16
  const r = /* @__PURE__ */ o(
16
- h,
17
+ T,
17
18
  {
18
19
  ref: n,
19
20
  icon: i,
20
- className: e,
21
+ className: f("shrink-0", e),
21
22
  "aria-label": t,
22
- ...c
23
+ ...m
23
24
  }
24
25
  );
25
- return l ? /* @__PURE__ */ m(u, { onOpenChange: a, children: [
26
- /* @__PURE__ */ o(d, { asChild: !0, children: r }),
27
- /* @__PURE__ */ o(f, { side: p, children: s || t })
26
+ return s ? /* @__PURE__ */ c(h, { onOpenChange: p, children: [
27
+ /* @__PURE__ */ o(u, { asChild: !0, children: r }),
28
+ /* @__PURE__ */ o(d, { side: l, children: a || t })
28
29
  ] }) : r;
29
30
  };
30
31
  export {
31
- B as IconButton
32
+ b as IconButton
32
33
  };
@@ -0,0 +1,13 @@
1
+ import { PaginationProps } from './types';
2
+ /**
3
+ * Pagination navigation for tables and other paginated content.
4
+ *
5
+ * @example
6
+ * <Pagination
7
+ * page={page}
8
+ * totalPages={10}
9
+ * onPageChange={setPage}
10
+ * />
11
+ */
12
+ export declare const Pagination: ({ page, totalPages, onPageChange, siblingCount, className, ref, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ //# sourceMappingURL=Pagination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,4EAQxB,eAAe,mDA0EjB,CAAC"}