@ledgerhq/lumen-ui-react 0.1.11 → 0.1.13
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 +3 -0
- package/dist/i18n/locales/de.json.js +4 -2
- package/dist/i18n/locales/en.json.d.ts +3 -0
- package/dist/i18n/locales/en.json.js +6 -4
- package/dist/i18n/locales/es.json.d.ts +3 -0
- package/dist/i18n/locales/es.json.js +6 -4
- package/dist/i18n/locales/fr.json.d.ts +3 -0
- package/dist/i18n/locales/fr.json.js +6 -4
- package/dist/i18n/locales/ja.json.d.ts +3 -0
- package/dist/i18n/locales/ja.json.js +6 -4
- package/dist/i18n/locales/ko.json.d.ts +3 -0
- package/dist/i18n/locales/ko.json.js +6 -4
- package/dist/i18n/locales/pt.json.d.ts +3 -0
- package/dist/i18n/locales/pt.json.js +6 -4
- package/dist/i18n/locales/ru.json.d.ts +3 -0
- package/dist/i18n/locales/ru.json.js +6 -4
- package/dist/i18n/locales/th.json.d.ts +3 -0
- package/dist/i18n/locales/th.json.js +6 -4
- package/dist/i18n/locales/tr.json.d.ts +3 -0
- package/dist/i18n/locales/tr.json.js +6 -4
- package/dist/i18n/locales/zh.json.d.ts +3 -0
- package/dist/i18n/locales/zh.json.js +6 -4
- package/dist/index.js +114 -113
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +41 -41
- 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 +35 -32
- package/dist/lib/Components/Banner/Banner.js +5 -5
- package/dist/lib/Components/BaseInput/BaseInput.d.ts +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.js +44 -41
- package/dist/lib/Components/Button/BaseButton.d.ts +1 -1
- package/dist/lib/Components/Button/BaseButton.d.ts.map +1 -1
- package/dist/lib/Components/Button/BaseButton.js +28 -25
- package/dist/lib/Components/Button/Button.js +9 -9
- package/dist/lib/Components/Card/Card.d.ts.map +1 -1
- package/dist/lib/Components/Card/Card.js +110 -107
- package/dist/lib/Components/Card/types.d.ts +1 -0
- package/dist/lib/Components/Card/types.d.ts.map +1 -1
- package/dist/lib/Components/CardButton/CardButton.d.ts +1 -1
- package/dist/lib/Components/CardButton/CardButton.d.ts.map +1 -1
- package/dist/lib/Components/CardButton/CardButton.js +28 -24
- package/dist/lib/Components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/lib/Components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/lib/Components/Checkbox/Checkbox.js +26 -14
- package/dist/lib/Components/Dialog/DialogHeader/DialogHeader.js +2 -2
- package/dist/lib/Components/Dialog/types.d.ts +1 -1
- package/dist/lib/Components/Icon/Icon.js +4 -4
- package/dist/lib/Components/Icon/createIcon.js +4 -4
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +1 -1
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +40 -20
- package/dist/lib/Components/InteractiveIcon/types.d.ts +14 -1
- package/dist/lib/Components/InteractiveIcon/types.d.ts.map +1 -1
- package/dist/lib/Components/Link/Link.d.ts +1 -1
- package/dist/lib/Components/Link/Link.d.ts.map +1 -1
- package/dist/lib/Components/Link/Link.js +44 -33
- package/dist/lib/Components/Link/types.d.ts +5 -0
- package/dist/lib/Components/Link/types.d.ts.map +1 -1
- package/dist/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/lib/Components/ListItem/ListItem.js +72 -65
- package/dist/lib/Components/MediaCard/MediaCard.d.ts +33 -0
- package/dist/lib/Components/MediaCard/MediaCard.d.ts.map +1 -0
- package/dist/lib/Components/MediaCard/MediaCard.js +128 -0
- package/dist/lib/Components/MediaCard/index.d.ts +3 -0
- package/dist/lib/Components/MediaCard/index.d.ts.map +1 -0
- package/dist/lib/Components/MediaCard/types.d.ts +30 -0
- package/dist/lib/Components/MediaCard/types.d.ts.map +1 -0
- package/dist/lib/Components/Menu/Menu.d.ts +3 -3
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +133 -104
- package/dist/lib/Components/NavBar/CoinCapsule.js +4 -4
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControl.js +88 -51
- package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +1 -1
- package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.d.ts +5 -5
- package/dist/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.js +94 -76
- package/dist/lib/Components/Select/index.d.ts +1 -1
- package/dist/lib/Components/Select/types.d.ts +4 -4
- package/dist/lib/Components/SideBar/SideBar.d.ts +1 -1
- package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.js +77 -74
- package/dist/lib/Components/SideBar/types.d.ts +12 -4
- package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
- package/dist/lib/Components/Spot/Spot.js +3 -3
- package/dist/lib/Components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/lib/Components/Stepper/Stepper.js +34 -24
- package/dist/lib/Components/Subheader/Subheader.d.ts +2 -7
- package/dist/lib/Components/Subheader/Subheader.d.ts.map +1 -1
- package/dist/lib/Components/Subheader/Subheader.js +31 -49
- package/dist/lib/Components/Subheader/index.d.ts +1 -1
- package/dist/lib/Components/Subheader/index.d.ts.map +1 -1
- package/dist/lib/Components/Subheader/types.d.ts +1 -11
- package/dist/lib/Components/Subheader/types.d.ts.map +1 -1
- package/dist/lib/Components/Switch/Switch.d.ts +1 -1
- package/dist/lib/Components/Switch/Switch.d.ts.map +1 -1
- package/dist/lib/Components/Switch/Switch.js +30 -22
- package/dist/lib/Components/Table/Table.js +49 -49
- package/dist/lib/Components/Tag/Tag.d.ts +1 -1
- package/dist/lib/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/lib/Components/Tag/Tag.js +17 -14
- package/dist/lib/Components/Tile/Tile.d.ts +5 -12
- package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/lib/Components/Tile/Tile.js +79 -82
- package/dist/lib/Components/Tile/index.d.ts +1 -1
- package/dist/lib/Components/Tile/index.d.ts.map +1 -1
- package/dist/lib/Components/Tile/types.d.ts +1 -10
- package/dist/lib/Components/Tile/types.d.ts.map +1 -1
- package/dist/lib/Components/TileButton/TileButton.d.ts +1 -1
- package/dist/lib/Components/TileButton/TileButton.d.ts.map +1 -1
- package/dist/lib/Components/TileButton/TileButton.js +26 -23
- package/dist/lib/Components/{ButtonTrigger/ButtonTrigger.d.ts → TriggerButton/TriggerButton.d.ts} +10 -10
- package/dist/lib/Components/TriggerButton/TriggerButton.d.ts.map +1 -0
- package/dist/lib/Components/TriggerButton/TriggerButton.js +76 -0
- package/dist/lib/Components/TriggerButton/index.d.ts +3 -0
- package/dist/lib/Components/{ButtonTrigger → TriggerButton}/index.d.ts.map +1 -1
- package/dist/lib/Components/{ButtonTrigger → TriggerButton}/types.d.ts +1 -1
- package/dist/lib/Components/{ButtonTrigger → TriggerButton}/types.d.ts.map +1 -1
- package/dist/lib/Components/index.d.ts +2 -1
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/lib/Symbols/Icons/NanoGen5.d.ts +29 -0
- package/dist/lib/Symbols/Icons/NanoGen5.d.ts.map +1 -0
- package/dist/lib/Symbols/Icons/NanoGen5.js +27 -0
- package/dist/lib/Symbols/index.d.ts +1 -0
- package/dist/lib/Symbols/index.d.ts.map +1 -1
- package/dist/lib/Symbols/index.js +194 -192
- package/dist/libs/utils-shared/dist/index.js +95 -90
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/lib/Components/ButtonTrigger/ButtonTrigger.d.ts.map +0 -1
- package/dist/lib/Components/ButtonTrigger/ButtonTrigger.js +0 -73
- package/dist/lib/Components/ButtonTrigger/index.d.ts +0 -3
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { useSplitText as y, buildAriaLabel as x, cn as p } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import { memo as d } from "react";
|
|
4
4
|
import { DIGITS as b } from "./types.js";
|
|
5
5
|
import { useCommonTranslation as D } from "../../../i18n/useCommonTranslation.js";
|
|
6
6
|
const N = {
|
|
7
|
-
0:
|
|
8
|
-
1: 15,
|
|
9
|
-
2: 23,
|
|
10
|
-
3: 24,
|
|
11
|
-
4: 25,
|
|
12
|
-
5: 23,
|
|
13
|
-
6:
|
|
14
|
-
7:
|
|
15
|
-
8: 24,
|
|
16
|
-
9: 24
|
|
7
|
+
0: 25,
|
|
8
|
+
1: 15.5,
|
|
9
|
+
2: 23.5,
|
|
10
|
+
3: 24.5,
|
|
11
|
+
4: 25.5,
|
|
12
|
+
5: 23.5,
|
|
13
|
+
6: 25,
|
|
14
|
+
7: 22,
|
|
15
|
+
8: 24.5,
|
|
16
|
+
9: 24.5
|
|
17
17
|
}, I = {
|
|
18
|
-
0: 17,
|
|
19
|
-
1:
|
|
20
|
-
2: 16,
|
|
21
|
-
3:
|
|
22
|
-
4:
|
|
23
|
-
5:
|
|
24
|
-
6: 17,
|
|
25
|
-
7:
|
|
26
|
-
8:
|
|
27
|
-
9:
|
|
18
|
+
0: 17.5,
|
|
19
|
+
1: 11,
|
|
20
|
+
2: 16.5,
|
|
21
|
+
3: 17,
|
|
22
|
+
4: 18,
|
|
23
|
+
5: 16,
|
|
24
|
+
6: 17.5,
|
|
25
|
+
7: 15,
|
|
26
|
+
8: 17,
|
|
27
|
+
9: 17
|
|
28
28
|
}, T = d(({ value: a, animate: l, type: i }) => {
|
|
29
29
|
const s = (i === "integer" ? N : I)[a];
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ c(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
33
|
className: "relative overflow-hidden mask-fade-y transition-[width] duration-600",
|
|
@@ -44,50 +44,50 @@ const N = {
|
|
|
44
44
|
style: {
|
|
45
45
|
transform: `translateY(-${a * 10}%)`
|
|
46
46
|
},
|
|
47
|
-
children: b.map((
|
|
47
|
+
children: b.map((n, r) => /* @__PURE__ */ e("span", { inert: n !== a, children: n }, r))
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
}), m = d(({ items: a, type: l, animate: i }) => a.map((s,
|
|
54
|
-
const
|
|
55
|
-
return s.type === "separator" ? /* @__PURE__ */ e("span", { children: s.value },
|
|
53
|
+
}), m = d(({ items: a, type: l, animate: i }) => a.map((s, n) => {
|
|
54
|
+
const r = a.length - n;
|
|
55
|
+
return s.type === "separator" ? /* @__PURE__ */ e("span", { children: s.value }, r) : /* @__PURE__ */ e(
|
|
56
56
|
T,
|
|
57
57
|
{
|
|
58
58
|
value: Number(s.value),
|
|
59
59
|
animate: i,
|
|
60
60
|
type: l
|
|
61
61
|
},
|
|
62
|
-
|
|
62
|
+
r
|
|
63
63
|
);
|
|
64
64
|
})), g = ({
|
|
65
65
|
value: a,
|
|
66
66
|
formatter: l,
|
|
67
67
|
hidden: i = !1,
|
|
68
68
|
loading: s = !1,
|
|
69
|
-
animate:
|
|
70
|
-
className:
|
|
69
|
+
animate: n = !0,
|
|
70
|
+
className: r,
|
|
71
71
|
...u
|
|
72
72
|
}) => {
|
|
73
|
-
const t = l(a),
|
|
73
|
+
const t = l(a), o = y(t), { t: f } = D(), h = x(
|
|
74
74
|
t,
|
|
75
75
|
i,
|
|
76
76
|
f("components.amountDisplay.amountHiddenAriaLabel")
|
|
77
77
|
);
|
|
78
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ e(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
81
|
className: p(
|
|
82
82
|
s && "animate-pulse",
|
|
83
|
-
"relative inline-flex
|
|
84
|
-
|
|
83
|
+
"relative inline-flex",
|
|
84
|
+
r
|
|
85
85
|
),
|
|
86
86
|
"aria-label": h,
|
|
87
87
|
"aria-busy": s,
|
|
88
88
|
...u,
|
|
89
|
-
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ c("div", { className: "flex items-baseline", children: [
|
|
90
|
+
/* @__PURE__ */ c(
|
|
91
91
|
"span",
|
|
92
92
|
{
|
|
93
93
|
className: "inline-flex heading-1-semi-bold text-base",
|
|
@@ -97,15 +97,15 @@ const N = {
|
|
|
97
97
|
i ? /* @__PURE__ */ e("span", { children: "••••" }) : /* @__PURE__ */ e(
|
|
98
98
|
m,
|
|
99
99
|
{
|
|
100
|
-
items:
|
|
101
|
-
animate:
|
|
100
|
+
items: o.integerPart,
|
|
101
|
+
animate: n,
|
|
102
102
|
type: "integer"
|
|
103
103
|
}
|
|
104
104
|
)
|
|
105
105
|
]
|
|
106
106
|
}
|
|
107
107
|
),
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ c(
|
|
109
109
|
"span",
|
|
110
110
|
{
|
|
111
111
|
className: "inline-flex heading-2-semi-bold text-muted",
|
|
@@ -115,8 +115,8 @@ const N = {
|
|
|
115
115
|
t.decimalPart && !i && /* @__PURE__ */ e(
|
|
116
116
|
m,
|
|
117
117
|
{
|
|
118
|
-
items:
|
|
119
|
-
animate:
|
|
118
|
+
items: o.decimalPart,
|
|
119
|
+
animate: n,
|
|
120
120
|
type: "decimal"
|
|
121
121
|
}
|
|
122
122
|
),
|
|
@@ -124,7 +124,7 @@ const N = {
|
|
|
124
124
|
]
|
|
125
125
|
}
|
|
126
126
|
)
|
|
127
|
-
]
|
|
127
|
+
] })
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
130
|
};
|
|
@@ -5,7 +5,7 @@ import { AmountInputProps } from './types';
|
|
|
5
5
|
* The currency text can be positioned either on the left or right side of the input.
|
|
6
6
|
*/
|
|
7
7
|
export declare const AmountInput: {
|
|
8
|
-
({ ref, className, currencyText, currencyPosition, disabled, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, value, onChange, ...props }: AmountInputProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
({ ref, className, currencyText, currencyPosition, disabled: disabledProp, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, value, onChange, ...props }: AmountInputProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=AmountInput.d.ts.map
|
|
@@ -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":"AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgC3C;;;;GAIG;AACH,eAAO,MAAM,WAAW;mLAarB,gBAAgB;;CAkHlB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { getFontSize as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useRef as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as j, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useDisabledContext as F, getFontSize as z, cn as a, textFormatter as D } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as M } from "class-variance-authority";
|
|
4
|
+
import { useRef as d, useState as h, useMemo as W, useLayoutEffect as q, useEffect as L } from "react";
|
|
5
|
+
const Q = M(
|
|
6
6
|
[
|
|
7
7
|
"bg-transparent heading-0 caret-active outline-hidden transition-colors",
|
|
8
8
|
"text-base placeholder:text-muted-subtle",
|
|
@@ -28,11 +28,11 @@ const H = z(
|
|
|
28
28
|
"group-has-[input:placeholder-shown]:text-muted-subtle",
|
|
29
29
|
"group-has-[input:disabled]:cursor-not-allowed group-has-[input:disabled]:text-disabled",
|
|
30
30
|
'group-has-[input[aria-invalid="true"]]:text-error'
|
|
31
|
-
),
|
|
31
|
+
), Y = ({
|
|
32
32
|
ref: x,
|
|
33
33
|
className: S,
|
|
34
|
-
currencyText:
|
|
35
|
-
currencyPosition:
|
|
34
|
+
currencyText: s,
|
|
35
|
+
currencyPosition: p = "left",
|
|
36
36
|
disabled: v,
|
|
37
37
|
maxIntegerLength: w = 9,
|
|
38
38
|
maxDecimalLength: y = 9,
|
|
@@ -40,9 +40,12 @@ const H = z(
|
|
|
40
40
|
thousandsSeparator: N = !0,
|
|
41
41
|
value: u,
|
|
42
42
|
onChange: A,
|
|
43
|
-
...
|
|
43
|
+
...I
|
|
44
44
|
}) => {
|
|
45
|
-
const
|
|
45
|
+
const R = F({
|
|
46
|
+
consumerName: "AmountInput",
|
|
47
|
+
mergeWith: { disabled: v }
|
|
48
|
+
}), c = d(null), r = d(null), [n, m] = h(u.toString()), [k, f] = h(!1), g = d(n);
|
|
46
49
|
function E(...t) {
|
|
47
50
|
return (e) => {
|
|
48
51
|
t.forEach((o) => {
|
|
@@ -50,41 +53,41 @@ const H = z(
|
|
|
50
53
|
});
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
|
-
const i =
|
|
56
|
+
const i = W(() => z(n) + "px", [n]);
|
|
54
57
|
q(() => {
|
|
55
|
-
if (c.current &&
|
|
58
|
+
if (c.current && r.current) {
|
|
56
59
|
const t = c.current.offsetWidth, e = n === "" ? 33 : 8;
|
|
57
|
-
|
|
60
|
+
r.current.style.width = `${t + e}px`;
|
|
58
61
|
}
|
|
59
|
-
}, [n]),
|
|
60
|
-
|
|
62
|
+
}, [n]), L(() => {
|
|
63
|
+
m(u.toString());
|
|
61
64
|
}, [u]);
|
|
62
|
-
const
|
|
63
|
-
const e =
|
|
65
|
+
const V = (t) => {
|
|
66
|
+
const e = D(t.target.value, {
|
|
64
67
|
allowDecimals: C,
|
|
65
68
|
thousandsSeparator: N,
|
|
66
69
|
maxIntegerLength: w,
|
|
67
70
|
maxDecimalLength: y
|
|
68
71
|
});
|
|
69
|
-
|
|
72
|
+
m(e), A({ ...t, target: { ...t.target, value: e } }), e !== g.current && f(!0), g.current = e;
|
|
70
73
|
};
|
|
71
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ j(
|
|
72
75
|
"div",
|
|
73
76
|
{
|
|
74
77
|
className: "group relative flex items-center justify-center transition-transform",
|
|
75
78
|
onPointerDown: () => {
|
|
76
|
-
const t =
|
|
79
|
+
const t = r.current;
|
|
77
80
|
t && window.requestAnimationFrame(() => {
|
|
78
81
|
t.focus();
|
|
79
82
|
});
|
|
80
83
|
},
|
|
81
84
|
children: [
|
|
82
|
-
|
|
85
|
+
s && p === "left" && /* @__PURE__ */ l(
|
|
83
86
|
"span",
|
|
84
87
|
{
|
|
85
88
|
className: a(b, "shrink-0"),
|
|
86
89
|
style: { fontSize: i, letterSpacing: "normal" },
|
|
87
|
-
children:
|
|
90
|
+
children: s
|
|
88
91
|
}
|
|
89
92
|
),
|
|
90
93
|
/* @__PURE__ */ l(
|
|
@@ -100,31 +103,31 @@ const H = z(
|
|
|
100
103
|
/* @__PURE__ */ l(
|
|
101
104
|
"input",
|
|
102
105
|
{
|
|
103
|
-
ref: E(x,
|
|
106
|
+
ref: E(x, r),
|
|
104
107
|
type: "text",
|
|
105
108
|
inputMode: "decimal",
|
|
106
|
-
disabled:
|
|
109
|
+
disabled: R,
|
|
107
110
|
value: n,
|
|
108
|
-
onChange:
|
|
109
|
-
onAnimationEnd: () =>
|
|
110
|
-
className: a(
|
|
111
|
-
...
|
|
111
|
+
onChange: V,
|
|
112
|
+
onAnimationEnd: () => f(!1),
|
|
113
|
+
className: a(Q({ isChanging: k }), S),
|
|
114
|
+
...I,
|
|
112
115
|
style: { fontSize: i, letterSpacing: "normal" }
|
|
113
116
|
}
|
|
114
117
|
),
|
|
115
|
-
|
|
118
|
+
s && p === "right" && /* @__PURE__ */ l(
|
|
116
119
|
"span",
|
|
117
120
|
{
|
|
118
121
|
className: a(b, "shrink-0"),
|
|
119
122
|
style: { fontSize: i, letterSpacing: "normal" },
|
|
120
|
-
children:
|
|
123
|
+
children: s
|
|
121
124
|
}
|
|
122
125
|
)
|
|
123
126
|
]
|
|
124
127
|
}
|
|
125
128
|
);
|
|
126
129
|
};
|
|
127
|
-
|
|
130
|
+
Y.displayName = "AmountInput";
|
|
128
131
|
export {
|
|
129
|
-
|
|
132
|
+
Y as AmountInput
|
|
130
133
|
};
|
|
@@ -29,8 +29,8 @@ const k = {
|
|
|
29
29
|
appearance: s = "info",
|
|
30
30
|
title: a,
|
|
31
31
|
description: o,
|
|
32
|
-
primaryAction:
|
|
33
|
-
secondaryAction:
|
|
32
|
+
primaryAction: n,
|
|
33
|
+
secondaryAction: l,
|
|
34
34
|
className: t,
|
|
35
35
|
onClose: i,
|
|
36
36
|
closeAriaLabel: f,
|
|
@@ -50,9 +50,9 @@ const k = {
|
|
|
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
|
-
(
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
(n || l) && /* @__PURE__ */ e("div", { className: "flex gap-4", children: [
|
|
54
|
+
n,
|
|
55
|
+
l
|
|
56
56
|
] })
|
|
57
57
|
] }),
|
|
58
58
|
i && /* @__PURE__ */ r(
|
|
@@ -19,7 +19,7 @@ import { BaseInputProps } from './types';
|
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
21
|
export declare const BaseInput: {
|
|
22
|
-
({ ref, className, containerClassName, inputClassName, labelClassName, label, id, disabled, errorMessage, suffix, prefix, onClear, hideClearButton, "aria-invalid": ariaInvalidProp, onChange: onChangeProp, ...props }: BaseInputProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
({ ref, className, containerClassName, inputClassName, labelClassName, label, id, disabled: disabledProp, errorMessage, suffix, prefix, onClear, hideClearButton, "aria-invalid": ariaInvalidProp, onChange: onChangeProp, ...props }: BaseInputProps): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
//# sourceMappingURL=BaseInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2BzC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS;
|
|
1
|
+
{"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2BzC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,SAAS;2OAiBnB,cAAc;;CAyKhB,CAAC"}
|
|
@@ -1,63 +1,66 @@
|
|
|
1
1
|
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { cn as a } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
-
import
|
|
4
|
-
import { useCommonTranslation as
|
|
5
|
-
import { InteractiveIcon as
|
|
2
|
+
import { useDisabledContext as $, cn as a } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import d from "react";
|
|
4
|
+
import { useCommonTranslation as q } from "../../../i18n/useCommonTranslation.js";
|
|
5
|
+
import { InteractiveIcon as H } from "../InteractiveIcon/InteractiveIcon.js";
|
|
6
6
|
import { DeleteCircleFill as x } from "../../Symbols/Icons/DeleteCircleFill.js";
|
|
7
|
-
const
|
|
7
|
+
const P = a(
|
|
8
8
|
"group relative flex h-48 w-full cursor-text items-center gap-8 rounded-sm bg-muted px-16 transition-colors",
|
|
9
9
|
"focus-within:ring-2 focus-within:ring-active hover:bg-muted-hover",
|
|
10
10
|
"has-disabled:cursor-not-allowed has-disabled:bg-disabled has-disabled:text-disabled",
|
|
11
11
|
"has-invalid:border-error has-invalid:ring-1 has-invalid:ring-error",
|
|
12
12
|
'has-[input[aria-invalid="true"]]:border-error has-[input[aria-invalid="true"]]:ring-1 has-[input[aria-invalid="true"]]:ring-error'
|
|
13
|
-
),
|
|
13
|
+
), U = a(
|
|
14
14
|
"peer w-full flex-1 bg-muted body-1 text-base caret-active outline-hidden transition-colors",
|
|
15
15
|
"group-hover:bg-muted-hover group-disabled:bg-disabled",
|
|
16
16
|
"group-has-disabled:cursor-not-allowed group-has-disabled:bg-disabled group-has-disabled:text-disabled",
|
|
17
17
|
"placeholder:text-muted group-has-disabled:placeholder:text-disabled",
|
|
18
18
|
"[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
19
19
|
"truncate"
|
|
20
|
-
),
|
|
20
|
+
), W = a(
|
|
21
21
|
"pointer-events-none absolute top-6 left-16 origin-left body-4 text-muted transition-all duration-300",
|
|
22
22
|
"peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-placeholder-shown:body-2",
|
|
23
23
|
"group-has-disabled:text-disabled",
|
|
24
24
|
"peer-focus:top-6 peer-focus:translate-y-0 peer-focus:body-4",
|
|
25
25
|
"w-[calc(100%-var(--size-56))] truncate"
|
|
26
|
-
),
|
|
26
|
+
), G = ({
|
|
27
27
|
ref: y,
|
|
28
28
|
className: I,
|
|
29
29
|
containerClassName: C,
|
|
30
30
|
inputClassName: S,
|
|
31
31
|
labelClassName: N,
|
|
32
|
-
label:
|
|
32
|
+
label: u,
|
|
33
33
|
id: k,
|
|
34
|
-
disabled:
|
|
34
|
+
disabled: R,
|
|
35
35
|
errorMessage: o,
|
|
36
|
-
suffix:
|
|
37
|
-
prefix:
|
|
38
|
-
onClear:
|
|
39
|
-
hideClearButton:
|
|
36
|
+
suffix: B,
|
|
37
|
+
prefix: D,
|
|
38
|
+
onClear: E,
|
|
39
|
+
hideClearButton: j = !1,
|
|
40
40
|
"aria-invalid": b,
|
|
41
|
-
onChange:
|
|
41
|
+
onChange: h,
|
|
42
42
|
...i
|
|
43
43
|
}) => {
|
|
44
|
-
const
|
|
44
|
+
const m = $({
|
|
45
|
+
consumerName: "BaseInput",
|
|
46
|
+
mergeWith: { disabled: R }
|
|
47
|
+
}), { t: z } = q(), n = d.useRef(null), F = d.useId(), c = k || `input-${F}`, L = b || (o ? !0 : void 0), s = i.value !== void 0, [T, v] = d.useState(
|
|
45
48
|
i.defaultValue?.toString() || ""
|
|
46
|
-
),
|
|
49
|
+
), V = d.useCallback(
|
|
47
50
|
(t) => {
|
|
48
|
-
s || v(t.target.value),
|
|
51
|
+
s || v(t.target.value), h?.(t);
|
|
49
52
|
},
|
|
50
|
-
[s,
|
|
51
|
-
), f = (s ? !!i.value && i.value.toString().length > 0 :
|
|
53
|
+
[s, h]
|
|
54
|
+
), f = (s ? !!i.value && i.value.toString().length > 0 : T.length > 0) && !m && !j, g = `${c}-error`, A = () => {
|
|
52
55
|
if (!n.current) return;
|
|
53
56
|
Object.getOwnPropertyDescriptor(
|
|
54
57
|
window.HTMLInputElement.prototype,
|
|
55
58
|
"value"
|
|
56
59
|
)?.set?.call(n.current, ""), s || v("");
|
|
57
60
|
const l = new Event("input", { bubbles: !0 });
|
|
58
|
-
n.current.dispatchEvent(l), n.current.focus(),
|
|
61
|
+
n.current.dispatchEvent(l), n.current.focus(), E?.();
|
|
59
62
|
};
|
|
60
|
-
function
|
|
63
|
+
function O(...t) {
|
|
61
64
|
return (l) => {
|
|
62
65
|
t.forEach((e) => {
|
|
63
66
|
e && (typeof e == "function" ? e(l) : e.current = l);
|
|
@@ -68,7 +71,7 @@ const q = a(
|
|
|
68
71
|
/* @__PURE__ */ p(
|
|
69
72
|
"div",
|
|
70
73
|
{
|
|
71
|
-
className: a(
|
|
74
|
+
className: a(P, C),
|
|
72
75
|
onPointerDown: (t) => {
|
|
73
76
|
if (t.target.closest("input, button, a")) return;
|
|
74
77
|
const e = n.current;
|
|
@@ -83,47 +86,47 @@ const q = a(
|
|
|
83
86
|
});
|
|
84
87
|
},
|
|
85
88
|
children: [
|
|
86
|
-
|
|
89
|
+
D,
|
|
87
90
|
/* @__PURE__ */ r(
|
|
88
91
|
"input",
|
|
89
92
|
{
|
|
90
|
-
ref:
|
|
91
|
-
id:
|
|
92
|
-
disabled:
|
|
93
|
+
ref: O(y, n),
|
|
94
|
+
id: c,
|
|
95
|
+
disabled: m,
|
|
93
96
|
placeholder: " ",
|
|
94
|
-
"aria-invalid":
|
|
97
|
+
"aria-invalid": L,
|
|
95
98
|
"aria-describedby": o ? g : void 0,
|
|
96
99
|
className: a(
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
U,
|
|
101
|
+
u && "pt-12 body-2",
|
|
99
102
|
S
|
|
100
103
|
),
|
|
101
|
-
onChange:
|
|
104
|
+
onChange: V,
|
|
102
105
|
...i
|
|
103
106
|
}
|
|
104
107
|
),
|
|
105
|
-
|
|
108
|
+
u && /* @__PURE__ */ r(
|
|
106
109
|
"label",
|
|
107
110
|
{
|
|
108
|
-
htmlFor:
|
|
111
|
+
htmlFor: c,
|
|
109
112
|
className: a(
|
|
110
|
-
|
|
113
|
+
W,
|
|
111
114
|
o && "text-error",
|
|
112
115
|
N
|
|
113
116
|
),
|
|
114
|
-
children:
|
|
117
|
+
children: u
|
|
115
118
|
}
|
|
116
119
|
),
|
|
117
120
|
f && /* @__PURE__ */ r(
|
|
118
|
-
|
|
121
|
+
H,
|
|
119
122
|
{
|
|
120
123
|
iconType: "filled",
|
|
121
|
-
onClick:
|
|
122
|
-
"aria-label":
|
|
124
|
+
onClick: A,
|
|
125
|
+
"aria-label": z("components.baseInput.clearInputAriaLabel"),
|
|
123
126
|
children: /* @__PURE__ */ r(x, { size: 20 })
|
|
124
127
|
}
|
|
125
128
|
),
|
|
126
|
-
!f &&
|
|
129
|
+
!f && B
|
|
127
130
|
]
|
|
128
131
|
}
|
|
129
132
|
),
|
|
@@ -141,7 +144,7 @@ const q = a(
|
|
|
141
144
|
)
|
|
142
145
|
] });
|
|
143
146
|
};
|
|
144
|
-
|
|
147
|
+
G.displayName = "BaseInput";
|
|
145
148
|
export {
|
|
146
|
-
|
|
149
|
+
G as BaseInput
|
|
147
150
|
};
|
|
@@ -7,7 +7,7 @@ export declare const baseButtonVariants: (props?: ({
|
|
|
7
7
|
isFull?: boolean | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
9
|
export declare const BaseButton: {
|
|
10
|
-
({ ref, className, appearance, size, isFull, disabled, asChild, icon: Icon, loading, children, onClick, ...props }: BaseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
({ ref, className, appearance, size, isFull, disabled: disabledProp, asChild, icon: Icon, loading, children, onClick, ...props }: BaseButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=BaseButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,kBAAkB;;;;;;8EAqD9B,CAAC;AAkBF,eAAO,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,kBAAkB;;;;;;8EAqD9B,CAAC;AAkBF,eAAO,MAAM,UAAU;sIAapB,eAAe;;CAgDjB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { Slot as
|
|
1
|
+
import { jsxs as x, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useDisabledContext as f, cn as h } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { Slot as B, Slottable as z } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva as l } from "class-variance-authority";
|
|
5
|
-
import { Spinner as
|
|
5
|
+
import { Spinner as N } from "../Spinner/Spinner.js";
|
|
6
6
|
const S = l(
|
|
7
7
|
"inline-flex size-fit cursor-pointer items-center justify-center rounded-full transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
|
|
8
8
|
{
|
|
@@ -65,60 +65,63 @@ const S = l(
|
|
|
65
65
|
true: "text-disabled"
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
}),
|
|
69
|
-
ref:
|
|
68
|
+
}), y = ({
|
|
69
|
+
ref: c,
|
|
70
70
|
className: u,
|
|
71
71
|
appearance: a = "base",
|
|
72
72
|
size: s,
|
|
73
73
|
isFull: v,
|
|
74
|
-
disabled:
|
|
75
|
-
asChild:
|
|
76
|
-
icon:
|
|
74
|
+
disabled: p = !1,
|
|
75
|
+
asChild: o = !1,
|
|
76
|
+
icon: n,
|
|
77
77
|
loading: r = !1,
|
|
78
|
-
children:
|
|
79
|
-
onClick:
|
|
78
|
+
children: i,
|
|
79
|
+
onClick: m,
|
|
80
80
|
...g
|
|
81
81
|
}) => {
|
|
82
|
-
const
|
|
82
|
+
const e = f({
|
|
83
|
+
consumerName: "BaseButton",
|
|
84
|
+
mergeWith: { disabled: p }
|
|
85
|
+
}), d = s ? {
|
|
83
86
|
xs: 16,
|
|
84
87
|
sm: 20,
|
|
85
88
|
md: 24,
|
|
86
89
|
lg: 24
|
|
87
90
|
}[s] : 24;
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
|
|
91
|
+
return /* @__PURE__ */ x(
|
|
92
|
+
o ? B : "button",
|
|
90
93
|
{
|
|
91
|
-
className:
|
|
94
|
+
className: h(
|
|
92
95
|
S({ disabled: e, loading: r, appearance: a, size: s, isFull: v }),
|
|
93
96
|
u
|
|
94
97
|
),
|
|
95
|
-
ref:
|
|
98
|
+
ref: c,
|
|
96
99
|
"data-disabled": e || void 0,
|
|
97
100
|
disabled: e,
|
|
98
|
-
onClick:
|
|
101
|
+
onClick: m,
|
|
99
102
|
...g,
|
|
100
103
|
children: [
|
|
101
104
|
r && /* @__PURE__ */ t(
|
|
102
|
-
|
|
105
|
+
N,
|
|
103
106
|
{
|
|
104
|
-
size:
|
|
107
|
+
size: d,
|
|
105
108
|
className: b({ appearance: a, disabled: e })
|
|
106
109
|
}
|
|
107
110
|
),
|
|
108
|
-
!r &&
|
|
109
|
-
|
|
111
|
+
!r && n && /* @__PURE__ */ t(
|
|
112
|
+
n,
|
|
110
113
|
{
|
|
111
|
-
size:
|
|
114
|
+
size: d,
|
|
112
115
|
className: b({ appearance: a, disabled: e })
|
|
113
116
|
}
|
|
114
117
|
),
|
|
115
|
-
|
|
118
|
+
i && (o ? /* @__PURE__ */ t(z, { children: i }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: i }))
|
|
116
119
|
]
|
|
117
120
|
}
|
|
118
121
|
);
|
|
119
122
|
};
|
|
120
|
-
|
|
123
|
+
y.displayName = "BaseButton";
|
|
121
124
|
export {
|
|
122
|
-
|
|
125
|
+
y as BaseButton,
|
|
123
126
|
S as baseButtonVariants
|
|
124
127
|
};
|