@ledgerhq/lumen-ui-react 0.1.15 → 0.1.17
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/ai-rules/RULES.md +2 -2
- package/dist/i18n/i18n.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +146 -142
- package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/Avatar/Avatar.js +24 -24
- package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.js +78 -85
- package/dist/lib/Components/CardButton/CardButton.js +10 -10
- package/dist/lib/Components/Dialog/Dialog.js +39 -39
- package/dist/lib/Components/Dialog/types.d.ts +3 -3
- package/dist/lib/Components/Icon/Icon.js +5 -5
- package/dist/lib/Components/Icon/createIcon.d.ts.map +1 -1
- package/dist/lib/Components/Link/Link.d.ts.map +1 -1
- package/dist/lib/Components/Link/Link.js +25 -32
- package/dist/lib/Components/ListItem/ListItem.d.ts +17 -28
- package/dist/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/lib/Components/ListItem/ListItem.js +81 -93
- package/dist/lib/Components/ListItem/types.d.ts +13 -32
- package/dist/lib/Components/ListItem/types.d.ts.map +1 -1
- package/dist/lib/Components/MediaImage/MediaImage.d.ts +19 -0
- package/dist/lib/Components/MediaImage/MediaImage.d.ts.map +1 -0
- package/dist/lib/Components/MediaImage/MediaImage.js +75 -0
- package/dist/lib/Components/MediaImage/index.d.ts +3 -0
- package/dist/lib/Components/MediaImage/index.d.ts.map +1 -0
- package/dist/lib/Components/MediaImage/types.d.ts +38 -0
- package/dist/lib/Components/MediaImage/types.d.ts.map +1 -0
- package/dist/lib/Components/Menu/Menu.d.ts +4 -4
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/NavBar.d.ts +0 -1
- package/dist/lib/Components/NavBar/NavBar.d.ts.map +1 -1
- package/dist/lib/Components/Popover/Popover.js +7 -7
- package/dist/lib/Components/Popover/types.d.ts +3 -3
- package/dist/lib/Components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/lib/Components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/lib/Components/SearchInput/SearchInput.js +24 -20
- package/dist/lib/Components/SearchInput/types.d.ts +1 -1
- package/dist/lib/Components/SearchInput/types.d.ts.map +1 -1
- 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 +97 -81
- package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +1 -0
- package/dist/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/types.d.ts +7 -0
- package/dist/lib/Components/SegmentedControl/types.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/usePillElementLayoutEffect.d.ts +5 -6
- package/dist/lib/Components/SegmentedControl/usePillElementLayoutEffect.d.ts.map +1 -1
- package/dist/lib/Components/SegmentedControl/usePillElementLayoutEffect.js +30 -25
- package/dist/lib/Components/Select/Select.d.ts +27 -12
- package/dist/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.js +356 -202
- package/dist/lib/Components/Select/SelectContext.d.ts +3 -1
- package/dist/lib/Components/Select/SelectContext.d.ts.map +1 -1
- 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 +171 -140
- package/dist/lib/Components/Select/types.d.ts.map +1 -1
- package/dist/lib/Components/Select/useSelectItems/index.d.ts +2 -0
- package/dist/lib/Components/Select/useSelectItems/index.d.ts.map +1 -0
- package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts +30 -0
- package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts.map +1 -0
- package/dist/lib/Components/Select/useSelectItems/useSelectItems.js +42 -0
- package/dist/lib/Components/Select/utils/groupItems.d.ts +13 -0
- package/dist/lib/Components/Select/utils/groupItems.d.ts.map +1 -0
- package/dist/lib/Components/Select/utils/groupItems.js +16 -0
- package/dist/lib/Components/Select/utils/index.d.ts +2 -0
- package/dist/lib/Components/Select/utils/index.d.ts.map +1 -0
- 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 +93 -89
- package/dist/lib/Components/SideBar/types.d.ts +7 -1
- package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
- package/dist/lib/Components/Stepper/Stepper.d.ts +5 -6
- package/dist/lib/Components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/lib/Components/Stepper/Stepper.js +100 -102
- package/dist/lib/Components/Stepper/types.d.ts +2 -2
- package/dist/lib/Components/Stepper/types.d.ts.map +1 -1
- package/dist/lib/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/lib/Components/Tag/Tag.js +1 -1
- package/dist/lib/Components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/lib/Components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/lib/Components/TriggerButton/TriggerButton.js +8 -8
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/libs/utils-shared/dist/index.js +151 -124
- package/dist/node_modules/@base-ui/react/esm/combobox/chips/ComboboxChipsContext.js +10 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/collection/ComboboxCollection.js +17 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/collection/GroupCollectionContext.js +23 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/empty/ComboboxEmpty.js +26 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/group/ComboboxGroup.js +34 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/group/ComboboxGroupContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/group-label/ComboboxGroupLabel.js +27 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/input/ComboboxInput.js +221 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/item/ComboboxItem.js +113 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/item/ComboboxItemContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/item-indicator/ComboboxItemIndicator.js +52 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/list/ComboboxList.js +65 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/popup/ComboboxPopup.js +76 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortal.js +24 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortalContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositioner.js +102 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositionerContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/root/AriaCombobox.js +596 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/root/ComboboxRoot.js +23 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/root/ComboboxRootContext.js +41 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/root/utils/constants.js +8 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/root/utils/index.js +23 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/root/utils/useFilter.js +43 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/row/ComboboxRowContext.js +10 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/store.js +74 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/trigger/ComboboxTrigger.js +135 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/utils/ComboboxInternalDismissButton.js +32 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/utils/stateAttributesMapping.js +15 -0
- package/dist/node_modules/@base-ui/react/esm/combobox/value/ComboboxValue.js +19 -0
- package/dist/node_modules/@base-ui/react/esm/composite/list/CompositeList.js +81 -0
- package/dist/node_modules/@base-ui/react/esm/composite/list/CompositeListContext.js +23 -0
- package/dist/node_modules/@base-ui/react/esm/composite/list/useCompositeListItem.js +55 -0
- package/dist/node_modules/@base-ui/react/esm/field/control/FieldControlDataAttributes.js +6 -0
- package/dist/node_modules/@base-ui/react/esm/field/root/FieldRootContext.js +53 -0
- package/dist/node_modules/@base-ui/react/esm/field/useField.js +51 -0
- package/dist/node_modules/@base-ui/react/esm/field/utils/constants.js +37 -0
- package/dist/node_modules/@base-ui/react/esm/field/utils/getCombinedFieldValidityData.js +12 -0
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useListNavigation.js +287 -0
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useTypeahead.js +71 -0
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/utils/composite.js +218 -4
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/utils/constants.js +7 -3
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js +3 -3
- package/dist/node_modules/@base-ui/react/esm/form/FormContext.js +23 -0
- package/dist/node_modules/@base-ui/react/esm/labelable-provider/LabelableContext.js +19 -0
- package/dist/node_modules/@base-ui/react/esm/labelable-provider/useLabelableId.js +44 -0
- package/dist/node_modules/@base-ui/react/esm/utils/constants.js +11 -8
- package/dist/node_modules/@base-ui/react/esm/utils/createBaseUIEventDetails.js +22 -13
- package/dist/node_modules/@base-ui/react/esm/utils/getPseudoElementBounds.js +18 -0
- package/dist/node_modules/@base-ui/react/esm/utils/itemEquality.js +20 -0
- package/dist/node_modules/@base-ui/react/esm/utils/reason-parts.js +13 -6
- package/dist/node_modules/@base-ui/react/esm/utils/resolveAriaLabelledBy.js +6 -0
- package/dist/node_modules/@base-ui/react/esm/utils/resolveValueLabel.js +73 -0
- package/dist/node_modules/@base-ui/react/esm/utils/serializeValue.js +14 -0
- package/dist/node_modules/@base-ui/utils/esm/detectBrowser.js +8 -7
- package/dist/node_modules/@base-ui/utils/esm/empty.js +3 -2
- package/dist/node_modules/@base-ui/utils/esm/useControlled.js +31 -0
- package/dist/node_modules/@base-ui/utils/esm/visuallyHidden.js +5 -1
- package/dist/node_modules/i18next/dist/esm/i18next.js +45 -47
- package/dist/package.json +1 -2
- package/dist/utils/icon-template.d.ts.map +1 -1
- package/package.json +1 -2
- package/dist/lib/Patterns/index.d.ts +0 -3
- package/dist/lib/Patterns/index.d.ts.map +0 -1
|
@@ -4,11 +4,11 @@ const d = (n) => typeof n == "string", I = () => {
|
|
|
4
4
|
n = s, e = i;
|
|
5
5
|
});
|
|
6
6
|
return t.resolve = n, t.reject = e, t;
|
|
7
|
-
}, X = (n) => n == null ? "" : "" + n,
|
|
7
|
+
}, X = (n) => n == null ? "" : "" + n, ge = (n, e, t) => {
|
|
8
8
|
n.forEach((s) => {
|
|
9
9
|
e[s] && (t[s] = e[s]);
|
|
10
10
|
});
|
|
11
|
-
},
|
|
11
|
+
}, ce = /###/g, q = (n) => n && n.indexOf("###") > -1 ? n.replace(ce, ".") : n, _ = (n) => !n || d(n), A = (n, e, t) => {
|
|
12
12
|
const s = d(e) ? e.split(".") : e;
|
|
13
13
|
let i = 0;
|
|
14
14
|
for (; i < s.length - 1; ) {
|
|
@@ -33,7 +33,7 @@ const d = (n) => typeof n == "string", I = () => {
|
|
|
33
33
|
for (; o.obj === void 0 && a.length; )
|
|
34
34
|
r = `${a[a.length - 1]}.${r}`, a = a.slice(0, a.length - 1), o = A(n, a, Object), o && o.obj && typeof o.obj[`${o.k}.${r}`] < "u" && (o.obj = void 0);
|
|
35
35
|
o.obj[`${o.k}.${r}`] = t;
|
|
36
|
-
},
|
|
36
|
+
}, de = (n, e, t, s) => {
|
|
37
37
|
const {
|
|
38
38
|
obj: i,
|
|
39
39
|
k: r
|
|
@@ -46,7 +46,7 @@ const d = (n) => typeof n == "string", I = () => {
|
|
|
46
46
|
} = A(n, e);
|
|
47
47
|
if (t)
|
|
48
48
|
return t[s];
|
|
49
|
-
},
|
|
49
|
+
}, pe = (n, e, t) => {
|
|
50
50
|
const s = U(n, t);
|
|
51
51
|
return s !== void 0 ? s : U(e, t);
|
|
52
52
|
}, le = (n, e, t) => {
|
|
@@ -54,7 +54,7 @@ const d = (n) => typeof n == "string", I = () => {
|
|
|
54
54
|
s !== "__proto__" && s !== "constructor" && (s in n ? d(n[s]) || n[s] instanceof String || d(e[s]) || e[s] instanceof String ? t && (n[s] = e[s]) : le(n[s], e[s], t) : n[s] = e[s]);
|
|
55
55
|
return n;
|
|
56
56
|
}, R = (n) => n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
57
|
-
var
|
|
57
|
+
var me = {
|
|
58
58
|
"&": "&",
|
|
59
59
|
"<": "<",
|
|
60
60
|
">": ">",
|
|
@@ -62,8 +62,8 @@ var xe = {
|
|
|
62
62
|
"'": "'",
|
|
63
63
|
"/": "/"
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
class
|
|
65
|
+
const xe = (n) => d(n) ? n.replace(/[&<>"'\/]/g, (e) => me[e]) : n;
|
|
66
|
+
class be {
|
|
67
67
|
constructor(e) {
|
|
68
68
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
69
69
|
}
|
|
@@ -75,11 +75,11 @@ class ye {
|
|
|
75
75
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, s), this.regExpQueue.push(e), s;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
const
|
|
78
|
+
const ye = [" ", ",", "?", "!", ";"], Se = new be(20), Oe = (n, e, t) => {
|
|
79
79
|
e = e || "", t = t || "";
|
|
80
|
-
const s =
|
|
80
|
+
const s = ye.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
|
|
81
81
|
if (s.length === 0) return !0;
|
|
82
|
-
const i =
|
|
82
|
+
const i = Se.getRegExp(`(${s.map((a) => a === "?" ? "\\?" : a).join("|")})`);
|
|
83
83
|
let r = !i.test(n);
|
|
84
84
|
if (!r) {
|
|
85
85
|
const a = n.indexOf(t);
|
|
@@ -106,7 +106,7 @@ const Se = [" ", ",", "?", "!", ";"], Oe = new ye(20), Le = (n, e, t) => {
|
|
|
106
106
|
i = a;
|
|
107
107
|
}
|
|
108
108
|
return i;
|
|
109
|
-
}, M = (n) => n && n.replace("_", "-"),
|
|
109
|
+
}, M = (n) => n && n.replace("_", "-"), Le = {
|
|
110
110
|
type: "logger",
|
|
111
111
|
log(n) {
|
|
112
112
|
this.output("log", n);
|
|
@@ -128,7 +128,7 @@ class H {
|
|
|
128
128
|
}
|
|
129
129
|
init(e) {
|
|
130
130
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
131
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
131
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || Le, this.options = t, this.debug = t.debug;
|
|
132
132
|
}
|
|
133
133
|
log() {
|
|
134
134
|
for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
|
|
@@ -288,7 +288,7 @@ const se = {};
|
|
|
288
288
|
class z extends J {
|
|
289
289
|
constructor(e) {
|
|
290
290
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
291
|
-
super(),
|
|
291
|
+
super(), ge(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = C.create("translator");
|
|
292
292
|
}
|
|
293
293
|
changeLanguage(e) {
|
|
294
294
|
e && (this.language = e);
|
|
@@ -307,7 +307,7 @@ class z extends J {
|
|
|
307
307
|
s === void 0 && (s = ":");
|
|
308
308
|
const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
309
309
|
let r = t.ns || this.options.defaultNS || [];
|
|
310
|
-
const a = s && e.indexOf(s) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
310
|
+
const a = s && e.indexOf(s) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Oe(e, s, i);
|
|
311
311
|
if (a && !o) {
|
|
312
312
|
const l = e.match(this.interpolator.nestingRegexp);
|
|
313
313
|
if (l && l.length > 0)
|
|
@@ -382,11 +382,11 @@ class z extends J {
|
|
|
382
382
|
u = u.join(O), u && (u = this.extendTranslation(u, e, t, s));
|
|
383
383
|
else {
|
|
384
384
|
let b = !1, L = !1;
|
|
385
|
-
const w = t.count !== void 0 && !d(t.count), S = z.hasDefaultValue(t), D = w ? this.pluralResolver.getSuffix(f, t.count, t) : "",
|
|
385
|
+
const w = t.count !== void 0 && !d(t.count), S = z.hasDefaultValue(t), D = w ? this.pluralResolver.getSuffix(f, t.count, t) : "", fe = t.ordinal && w ? this.pluralResolver.getSuffix(f, t.count, {
|
|
386
386
|
ordinal: !1
|
|
387
|
-
}) : "", Y = w && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), k = Y && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${D}`] || t[`defaultValue${
|
|
387
|
+
}) : "", Y = w && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), k = Y && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${D}`] || t[`defaultValue${fe}`] || t.defaultValue;
|
|
388
388
|
!this.isValidLookup(u) && S && (b = !0, u = k), this.isValidLookup(u) || (L = !0, u = a);
|
|
389
|
-
const
|
|
389
|
+
const he = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && L ? void 0 : u, E = S && k !== u && this.options.updateMissing;
|
|
390
390
|
if (L || b || E) {
|
|
391
391
|
if (this.logger.log(E ? "updateKey" : "missingKey", f, l, a, E ? k : u), r) {
|
|
392
392
|
const v = this.resolve(a, {
|
|
@@ -402,7 +402,7 @@ class z extends J {
|
|
|
402
402
|
F.push(T[v]);
|
|
403
403
|
else this.options.saveMissingTo === "all" ? F = this.languageUtils.toResolveHierarchy(t.lng || this.language) : F.push(t.lng || this.language);
|
|
404
404
|
const G = (v, N, j) => {
|
|
405
|
-
const Z = S && j !== u ? j :
|
|
405
|
+
const Z = S && j !== u ? j : he;
|
|
406
406
|
this.options.missingKeyHandler ? this.options.missingKeyHandler(v, l, N, Z, E, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(v, l, N, Z, E, t), this.emit("missingKey", v, l, N, u);
|
|
407
407
|
};
|
|
408
408
|
this.options.saveMissing && (this.options.saveMissingPlurals && w ? F.forEach((v) => {
|
|
@@ -597,7 +597,7 @@ class ie {
|
|
|
597
597
|
}), i;
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
let
|
|
600
|
+
let ve = [{
|
|
601
601
|
lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
|
|
602
602
|
nr: [1, 2],
|
|
603
603
|
fc: 1
|
|
@@ -689,7 +689,7 @@ let we = [{
|
|
|
689
689
|
lngs: ["he", "iw"],
|
|
690
690
|
nr: [1, 2, 20, 21],
|
|
691
691
|
fc: 22
|
|
692
|
-
}],
|
|
692
|
+
}], we = {
|
|
693
693
|
1: (n) => +(n > 1),
|
|
694
694
|
2: (n) => +(n != 1),
|
|
695
695
|
3: (n) => 0,
|
|
@@ -713,28 +713,28 @@ let we = [{
|
|
|
713
713
|
21: (n) => n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0,
|
|
714
714
|
22: (n) => n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3
|
|
715
715
|
};
|
|
716
|
-
const
|
|
716
|
+
const Ce = ["v1", "v2", "v3"], Ne = ["v4"], ne = {
|
|
717
717
|
zero: 0,
|
|
718
718
|
one: 1,
|
|
719
719
|
two: 2,
|
|
720
720
|
few: 3,
|
|
721
721
|
many: 4,
|
|
722
722
|
other: 5
|
|
723
|
-
},
|
|
723
|
+
}, Re = () => {
|
|
724
724
|
const n = {};
|
|
725
|
-
return
|
|
725
|
+
return ve.forEach((e) => {
|
|
726
726
|
e.lngs.forEach((t) => {
|
|
727
727
|
n[t] = {
|
|
728
728
|
numbers: e.nr,
|
|
729
|
-
plurals:
|
|
729
|
+
plurals: we[e.fc]
|
|
730
730
|
};
|
|
731
731
|
});
|
|
732
732
|
}), n;
|
|
733
733
|
};
|
|
734
|
-
class
|
|
734
|
+
class Pe {
|
|
735
735
|
constructor(e) {
|
|
736
736
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
737
|
-
this.languageUtils = e, this.options = t, this.logger = C.create("pluralResolver"), (!this.options.compatibilityJSON ||
|
|
737
|
+
this.languageUtils = e, this.options = t, this.logger = C.create("pluralResolver"), (!this.options.compatibilityJSON || Ne.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = Re(), this.pluralRulesCache = {};
|
|
738
738
|
}
|
|
739
739
|
addRule(e, t) {
|
|
740
740
|
this.rules[e] = t;
|
|
@@ -792,14 +792,14 @@ class $e {
|
|
|
792
792
|
return this.options.compatibilityJSON === "v1" ? i === 1 ? "" : typeof i == "number" ? `_plural_${i.toString()}` : r() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? r() : this.options.prepend && s.toString() ? this.options.prepend + s.toString() : s.toString();
|
|
793
793
|
}
|
|
794
794
|
shouldUseIntlApi() {
|
|
795
|
-
return !
|
|
795
|
+
return !Ce.includes(this.options.compatibilityJSON);
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
798
|
const re = function(n, e, t) {
|
|
799
|
-
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r =
|
|
799
|
+
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r = pe(n, e, t);
|
|
800
800
|
return !r && i && d(t) && (r = Q(n, t, s), r === void 0 && (r = Q(e, t, s))), r;
|
|
801
801
|
}, W = (n) => n.replace(/\$/g, "$$$$");
|
|
802
|
-
class
|
|
802
|
+
class $e {
|
|
803
803
|
constructor() {
|
|
804
804
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
805
805
|
this.logger = C.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
|
|
@@ -828,7 +828,7 @@ class ke {
|
|
|
828
828
|
maxReplaces: O,
|
|
829
829
|
alwaysFormat: y
|
|
830
830
|
} = e.interpolation;
|
|
831
|
-
this.escape = t !== void 0 ? t :
|
|
831
|
+
this.escape = t !== void 0 ? t : xe, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = r ? R(r) : a || "{{", this.suffix = o ? R(o) : l || "}}", this.formatSeparator = f || ",", this.unescapePrefix = h ? "" : g || "-", this.unescapeSuffix = this.unescapePrefix ? "" : h || "", this.nestingPrefix = u ? R(u) : c || R("$t("), this.nestingSuffix = p ? R(p) : x || R(")"), this.nestingOptionsSeparator = m || ",", this.maxReplaces = O || 1e3, this.alwaysFormat = y !== void 0 ? y : !1, this.resetRegExp();
|
|
832
832
|
}
|
|
833
833
|
reset() {
|
|
834
834
|
this.options && this.init(this.options);
|
|
@@ -923,7 +923,7 @@ class ke {
|
|
|
923
923
|
return e;
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
|
-
const
|
|
926
|
+
const ke = (n) => {
|
|
927
927
|
let e = n.toLowerCase().trim();
|
|
928
928
|
const t = {};
|
|
929
929
|
if (n.indexOf("(") > -1) {
|
|
@@ -954,7 +954,7 @@ const Ee = (n) => {
|
|
|
954
954
|
return o || (o = n(M(s), i), e[a] = o), o(t);
|
|
955
955
|
};
|
|
956
956
|
};
|
|
957
|
-
class
|
|
957
|
+
class Ee {
|
|
958
958
|
constructor() {
|
|
959
959
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
960
960
|
this.logger = C.create("formatter"), this.options = e, this.formats = {
|
|
@@ -1014,7 +1014,7 @@ class Fe {
|
|
|
1014
1014
|
const {
|
|
1015
1015
|
formatName: f,
|
|
1016
1016
|
formatOptions: h
|
|
1017
|
-
} =
|
|
1017
|
+
} = ke(l);
|
|
1018
1018
|
if (this.formats[f]) {
|
|
1019
1019
|
let g = o;
|
|
1020
1020
|
try {
|
|
@@ -1034,10 +1034,10 @@ class Fe {
|
|
|
1034
1034
|
}, e);
|
|
1035
1035
|
}
|
|
1036
1036
|
}
|
|
1037
|
-
const
|
|
1037
|
+
const Fe = (n, e) => {
|
|
1038
1038
|
n.pending[e] !== void 0 && (delete n.pending[e], n.pendingCount--);
|
|
1039
1039
|
};
|
|
1040
|
-
class
|
|
1040
|
+
class je extends J {
|
|
1041
1041
|
constructor(e, t, s) {
|
|
1042
1042
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
1043
1043
|
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = i, this.logger = C.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(s, i.backend, i);
|
|
@@ -1070,7 +1070,7 @@ class Ie extends J {
|
|
|
1070
1070
|
}), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
|
|
1071
1071
|
const o = {};
|
|
1072
1072
|
this.queue.forEach((l) => {
|
|
1073
|
-
|
|
1073
|
+
de(l.loaded, [r], a), Fe(l, e), t && l.errors.push(t), l.pendingCount === 0 && !l.done && (Object.keys(l.loaded).forEach((f) => {
|
|
1074
1074
|
o[f] || (o[f] = {});
|
|
1075
1075
|
const h = l.loaded[f];
|
|
1076
1076
|
h.length && h.forEach((g) => {
|
|
@@ -1229,7 +1229,7 @@ const ae = () => ({
|
|
|
1229
1229
|
skipOnVariables: !0
|
|
1230
1230
|
}
|
|
1231
1231
|
}), oe = (n) => (d(n.ns) && (n.ns = [n.ns]), d(n.fallbackLng) && (n.fallbackLng = [n.fallbackLng]), d(n.fallbackNS) && (n.fallbackNS = [n.fallbackNS]), n.supportedLngs && n.supportedLngs.indexOf("cimode") < 0 && (n.supportedLngs = n.supportedLngs.concat(["cimode"])), n), K = () => {
|
|
1232
|
-
},
|
|
1232
|
+
}, Ie = (n) => {
|
|
1233
1233
|
Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t) => {
|
|
1234
1234
|
typeof n[t] == "function" && (n[t] = n[t].bind(n));
|
|
1235
1235
|
});
|
|
@@ -1239,7 +1239,7 @@ class V extends J {
|
|
|
1239
1239
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1240
1240
|
if (super(), this.options = oe(e), this.services = {}, this.logger = C, this.modules = {
|
|
1241
1241
|
external: []
|
|
1242
|
-
},
|
|
1242
|
+
}, Ie(this), t && !this.isInitialized && !e.isClone) {
|
|
1243
1243
|
if (!this.options.initImmediate)
|
|
1244
1244
|
return this.init(e, t), this;
|
|
1245
1245
|
setTimeout(() => {
|
|
@@ -1264,17 +1264,17 @@ class V extends J {
|
|
|
1264
1264
|
if (!this.options.isClone) {
|
|
1265
1265
|
this.modules.logger ? C.init(r(this.modules.logger), this.options) : C.init(null, this.options);
|
|
1266
1266
|
let h;
|
|
1267
|
-
this.modules.formatter ? h = this.modules.formatter : typeof Intl < "u" && (h =
|
|
1267
|
+
this.modules.formatter ? h = this.modules.formatter : typeof Intl < "u" && (h = Ee);
|
|
1268
1268
|
const g = new ie(this.options);
|
|
1269
1269
|
this.store = new te(this.options.resources, this.options);
|
|
1270
1270
|
const u = this.services;
|
|
1271
|
-
u.logger = C, u.resourceStore = this.store, u.languageUtils = g, u.pluralResolver = new
|
|
1271
|
+
u.logger = C, u.resourceStore = this.store, u.languageUtils = g, u.pluralResolver = new Pe(g, {
|
|
1272
1272
|
prepend: this.options.pluralSeparator,
|
|
1273
1273
|
compatibilityJSON: this.options.compatibilityJSON,
|
|
1274
1274
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1275
|
-
}), h && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (u.formatter = r(h), u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new
|
|
1275
|
+
}), h && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (u.formatter = r(h), u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new $e(this.options), u.utils = {
|
|
1276
1276
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1277
|
-
}, u.backendConnector = new
|
|
1277
|
+
}, u.backendConnector = new je(r(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", function(c) {
|
|
1278
1278
|
for (var p = arguments.length, x = new Array(p > 1 ? p - 1 : 0), m = 1; m < p; m++)
|
|
1279
1279
|
x[m - 1] = arguments[m];
|
|
1280
1280
|
e.emit(c, ...x);
|
|
@@ -1472,10 +1472,8 @@ class V extends J {
|
|
|
1472
1472
|
};
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1477
|
-
const De = fe.t;
|
|
1475
|
+
const Ae = V.createInstance();
|
|
1476
|
+
Ae.createInstance = V.createInstance;
|
|
1478
1477
|
export {
|
|
1479
|
-
|
|
1480
|
-
De as t
|
|
1478
|
+
Ae as default
|
|
1481
1479
|
};
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"@radix-ui/react-checkbox": "^1.3.2",
|
|
51
51
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
52
52
|
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
53
|
-
"@radix-ui/react-select": "^2.2.6",
|
|
54
53
|
"@radix-ui/react-slot": "^1.2.3",
|
|
55
54
|
"@radix-ui/react-switch": "^1.2.6",
|
|
56
55
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-template.d.ts","sourceRoot":"","sources":["../../src/utils/icon-template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon-template.d.ts","sourceRoot":"","sources":["../../src/utils/icon-template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE,QAAA,MAAM,QAAQ,EAAE,QAuCf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"@radix-ui/react-checkbox": "^1.3.2",
|
|
51
51
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
52
52
|
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
53
|
-
"@radix-ui/react-select": "^2.2.6",
|
|
54
53
|
"@radix-ui/react-slot": "^1.2.3",
|
|
55
54
|
"@radix-ui/react-switch": "^1.2.6",
|
|
56
55
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Patterns/index.ts"],"names":[],"mappings":";AAAA,wBAAkB"}
|