@ledgerhq/lumen-ui-react 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +70 -69
- package/dist/lib/Components/ThemeProvider/ThemeProvider.d.ts +2 -9
- package/dist/lib/Components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/lib/Components/ThemeProvider/ThemeProvider.js +14 -25
- package/dist/lib/Components/ThemeProvider/ThemeProvider.types.d.ts +9 -3
- package/dist/lib/Components/ThemeProvider/ThemeProvider.types.d.ts.map +1 -1
- package/dist/lib/Components/ThemeProvider/ThemeProvider.types.js +8 -0
- package/dist/lib/Components/ThemeProvider/useRootColorModeSideEffect.d.ts +3 -3
- package/dist/lib/Components/ThemeProvider/useRootColorModeSideEffect.d.ts.map +1 -1
- package/dist/lib/Components/ThemeProvider/useRootColorModeSideEffect.js +20 -14
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,37 +8,38 @@ import { BaseInput as S } from "./lib/Components/BaseInput/BaseInput.js";
|
|
|
8
8
|
import { Button as d } from "./lib/Components/Button/Button.js";
|
|
9
9
|
import { BaseButton as c } from "./lib/Components/Button/BaseButton.js";
|
|
10
10
|
import { ContentBanner as I, ContentBannerContent as C, ContentBannerDescription as s, ContentBannerTitle as L } from "./lib/Components/ContentBanner/ContentBanner.js";
|
|
11
|
-
import { CardButton as
|
|
11
|
+
import { CardButton as M } from "./lib/Components/CardButton/CardButton.js";
|
|
12
12
|
import { Checkbox as v } from "./lib/Components/Checkbox/Checkbox.js";
|
|
13
|
-
import { DataTable as
|
|
14
|
-
import { useLumenDataTable as
|
|
13
|
+
import { DataTable as A, DataTableGlobalSearchInput as w, DataTableRoot as H } from "./lib/Components/DataTable/DataTable.js";
|
|
14
|
+
import { useLumenDataTable as G } from "./lib/Components/DataTable/useLumenDataTable/useLumenDataTable.js";
|
|
15
15
|
import { DialogClose as y } from "./lib/Components/Dialog/DialogClose/DialogClose.js";
|
|
16
|
-
import { Dialog as
|
|
17
|
-
import { DialogHeader as
|
|
18
|
-
import { Divider as
|
|
19
|
-
import { IconButton as
|
|
20
|
-
import { InteractiveIcon as
|
|
21
|
-
import { Link as
|
|
16
|
+
import { Dialog as E, DialogBody as O, DialogContent as F, DialogFooter as _, DialogTrigger as j } from "./lib/Components/Dialog/Dialog.js";
|
|
17
|
+
import { DialogHeader as z } from "./lib/Components/Dialog/DialogHeader/DialogHeader.js";
|
|
18
|
+
import { Divider as K } from "./lib/Components/Divider/Divider.js";
|
|
19
|
+
import { IconButton as U } from "./lib/Components/IconButton/IconButton.js";
|
|
20
|
+
import { InteractiveIcon as W } from "./lib/Components/InteractiveIcon/InteractiveIcon.js";
|
|
21
|
+
import { Link as Y } from "./lib/Components/Link/Link.js";
|
|
22
22
|
import { ListItem as $, ListItemContent as ee, ListItemDescription as oe, ListItemIcon as te, ListItemLeading as re, ListItemSpot as ae, ListItemTitle as ne, ListItemTrailing as ie, ListItemTruncate as le } from "./lib/Components/ListItem/ListItem.js";
|
|
23
23
|
import { Menu as me, MenuCheckboxItem as Te, MenuContent as ue, MenuGroup as xe, MenuItem as fe, MenuLabel as Se, MenuPortal as be, MenuRadioGroup as de, MenuRadioItem as ge, MenuSeparator as ce, MenuSub as Be, MenuSubContent as Ie, MenuSubTrigger as Ce, MenuTrigger as se } from "./lib/Components/Menu/Menu.js";
|
|
24
|
-
import { NavBar as De, NavBarBackButton as
|
|
24
|
+
import { NavBar as De, NavBarBackButton as Me, NavBarCoinCapsule as he, NavBarTitle as ve, NavBarTrailing as Re } from "./lib/Components/NavBar/NavBar.js";
|
|
25
25
|
import { PageIndicator as we } from "./lib/Components/PageIndicator/PageIndicator.js";
|
|
26
|
-
import { SearchInput as
|
|
27
|
-
import { Select as Ne, SelectContent as ye, SelectGroup as Pe, SelectItem as
|
|
28
|
-
import { SideBar as
|
|
29
|
-
import { Skeleton as
|
|
30
|
-
import { Spinner as
|
|
26
|
+
import { SearchInput as ke } from "./lib/Components/SearchInput/SearchInput.js";
|
|
27
|
+
import { Select as Ne, SelectContent as ye, SelectGroup as Pe, SelectItem as Ee, SelectItemText as Oe, SelectLabel as Fe, SelectSeparator as _e, SelectTrigger as je } from "./lib/Components/Select/Select.js";
|
|
28
|
+
import { SideBar as ze, SideBarCollapseToggle as Je, SideBarItem as Ke, SideBarLeading as Qe, SideBarTrailing as Ue } from "./lib/Components/SideBar/SideBar.js";
|
|
29
|
+
import { Skeleton as We } from "./lib/Components/Skeleton/Skeleton.js";
|
|
30
|
+
import { Spinner as Ye } from "./lib/Components/Spinner/Spinner.js";
|
|
31
31
|
import { Spot as $e } from "./lib/Components/Spot/Spot.js";
|
|
32
32
|
import { Stepper as oo } from "./lib/Components/Stepper/Stepper.js";
|
|
33
33
|
import { Subheader as ro, SubheaderAction as ao, SubheaderCount as no, SubheaderDescription as io, SubheaderInfo as lo, SubheaderRow as po, SubheaderShowMore as mo, SubheaderTitle as To } from "./lib/Components/Subheader/Subheader.js";
|
|
34
34
|
import { Switch as xo } from "./lib/Components/Switch/Switch.js";
|
|
35
|
-
import { Table as So, TableActionBar as bo, TableActionBarLeading as go, TableActionBarTrailing as co, TableBody as Bo, TableCell as Io, TableCellContent as Co, TableGroupHeaderRow as so, TableHeader as Lo, TableHeaderCell as Do, TableHeaderRow as
|
|
36
|
-
import { Tag as
|
|
35
|
+
import { Table as So, TableActionBar as bo, TableActionBarLeading as go, TableActionBarTrailing as co, TableBody as Bo, TableCell as Io, TableCellContent as Co, TableGroupHeaderRow as so, TableHeader as Lo, TableHeaderCell as Do, TableHeaderRow as Mo, TableInfoIcon as ho, TableLoadingRow as vo, TableRoot as Ro, TableRow as Ao, TableSortButton as wo } from "./lib/Components/Table/Table.js";
|
|
36
|
+
import { Tag as ko } from "./lib/Components/Tag/Tag.js";
|
|
37
37
|
import { TextInput as No } from "./lib/Components/TextInput/TextInput.js";
|
|
38
|
-
import { Tile as Po, TileContent as
|
|
39
|
-
import { TileButton as
|
|
40
|
-
import { Tooltip as
|
|
41
|
-
import { ThemeProvider as
|
|
38
|
+
import { Tile as Po, TileContent as Eo, TileDescription as Oo, TileSecondaryAction as Fo, TileSpot as _o, TileTitle as jo, TileTrailingContent as qo } from "./lib/Components/Tile/Tile.js";
|
|
39
|
+
import { TileButton as Jo } from "./lib/Components/TileButton/TileButton.js";
|
|
40
|
+
import { Tooltip as Qo, TooltipContent as Uo, TooltipProvider as Vo, TooltipTrigger as Wo } from "./lib/Components/Tooltip/Tooltip.js";
|
|
41
|
+
import { ThemeProvider as Yo } from "./lib/Components/ThemeProvider/ThemeProvider.js";
|
|
42
|
+
import { COLOR_SCHEMES as $o } from "./lib/Components/ThemeProvider/ThemeProvider.types.js";
|
|
42
43
|
export {
|
|
43
44
|
a as AddressInput,
|
|
44
45
|
p as AmountDisplay,
|
|
@@ -48,27 +49,28 @@ export {
|
|
|
48
49
|
c as BaseButton,
|
|
49
50
|
S as BaseInput,
|
|
50
51
|
d as Button,
|
|
51
|
-
|
|
52
|
+
$o as COLOR_SCHEMES,
|
|
53
|
+
M as CardButton,
|
|
52
54
|
v as Checkbox,
|
|
53
55
|
I as ContentBanner,
|
|
54
56
|
C as ContentBannerContent,
|
|
55
57
|
s as ContentBannerDescription,
|
|
56
58
|
L as ContentBannerTitle,
|
|
57
|
-
|
|
59
|
+
A as DataTable,
|
|
58
60
|
w as DataTableGlobalSearchInput,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
H as DataTableRoot,
|
|
62
|
+
E as Dialog,
|
|
63
|
+
O as DialogBody,
|
|
62
64
|
y as DialogClose,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
F as DialogContent,
|
|
66
|
+
_ as DialogFooter,
|
|
67
|
+
z as DialogHeader,
|
|
68
|
+
j as DialogTrigger,
|
|
69
|
+
K as Divider,
|
|
70
|
+
U as IconButton,
|
|
71
|
+
W as InteractiveIcon,
|
|
70
72
|
t as Languages,
|
|
71
|
-
|
|
73
|
+
Y as Link,
|
|
72
74
|
$ as ListItem,
|
|
73
75
|
ee as ListItemContent,
|
|
74
76
|
oe as ListItemDescription,
|
|
@@ -93,27 +95,27 @@ export {
|
|
|
93
95
|
Ce as MenuSubTrigger,
|
|
94
96
|
se as MenuTrigger,
|
|
95
97
|
De as NavBar,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
Me as NavBarBackButton,
|
|
99
|
+
he as NavBarCoinCapsule,
|
|
98
100
|
ve as NavBarTitle,
|
|
99
|
-
|
|
101
|
+
Re as NavBarTrailing,
|
|
100
102
|
we as PageIndicator,
|
|
101
|
-
|
|
103
|
+
ke as SearchInput,
|
|
102
104
|
Ne as Select,
|
|
103
105
|
ye as SelectContent,
|
|
104
106
|
Pe as SelectGroup,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
Ee as SelectItem,
|
|
108
|
+
Oe as SelectItemText,
|
|
109
|
+
Fe as SelectLabel,
|
|
110
|
+
_e as SelectSeparator,
|
|
111
|
+
je as SelectTrigger,
|
|
112
|
+
ze as SideBar,
|
|
113
|
+
Je as SideBarCollapseToggle,
|
|
114
|
+
Ke as SideBarItem,
|
|
115
|
+
Qe as SideBarLeading,
|
|
116
|
+
Ue as SideBarTrailing,
|
|
117
|
+
We as Skeleton,
|
|
118
|
+
Ye as Spinner,
|
|
117
119
|
$e as Spot,
|
|
118
120
|
oo as Stepper,
|
|
119
121
|
ro as Subheader,
|
|
@@ -135,27 +137,26 @@ export {
|
|
|
135
137
|
so as TableGroupHeaderRow,
|
|
136
138
|
Lo as TableHeader,
|
|
137
139
|
Do as TableHeaderCell,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
Mo as TableHeaderRow,
|
|
141
|
+
ho as TableInfoIcon,
|
|
140
142
|
vo as TableLoadingRow,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
Ro as TableRoot,
|
|
144
|
+
Ao as TableRow,
|
|
143
145
|
wo as TableSortButton,
|
|
144
|
-
|
|
146
|
+
ko as Tag,
|
|
145
147
|
No as TextInput,
|
|
146
|
-
|
|
148
|
+
Yo as ThemeProvider,
|
|
147
149
|
Po as Tile,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
_o as useTheme
|
|
150
|
+
Jo as TileButton,
|
|
151
|
+
Eo as TileContent,
|
|
152
|
+
Oo as TileDescription,
|
|
153
|
+
Fo as TileSecondaryAction,
|
|
154
|
+
_o as TileSpot,
|
|
155
|
+
jo as TileTitle,
|
|
156
|
+
qo as TileTrailingContent,
|
|
157
|
+
Qo as Tooltip,
|
|
158
|
+
Uo as TooltipContent,
|
|
159
|
+
Vo as TooltipProvider,
|
|
160
|
+
Wo as TooltipTrigger,
|
|
161
|
+
G as useLumenDataTable
|
|
161
162
|
};
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
declare const ThemeProvider: FC<ThemeProviderProps>;
|
|
4
|
-
declare const useTheme: () => {
|
|
5
|
-
toggleMode: () => void;
|
|
6
|
-
mode: ThemeMode;
|
|
7
|
-
setMode: (mode: ThemeMode) => void;
|
|
8
|
-
locale: ThemeProviderProps["locale"];
|
|
9
|
-
};
|
|
10
|
-
export { ThemeProvider, useTheme };
|
|
2
|
+
import { ThemeProviderProps } from './ThemeProvider.types';
|
|
3
|
+
export declare const ThemeProvider: FC<ThemeProviderProps>;
|
|
11
4
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAiB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAU1E,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAoBhD,CAAC"}
|
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { createSafeContext as i } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { useMemo as f } from "react";
|
|
4
|
+
import { COLOR_SCHEMES as s } from "./ThemeProvider.types.js";
|
|
5
|
+
import { useRootColorModeSideEffect as n } from "./useRootColorModeSideEffect.js";
|
|
6
|
+
import { I18nProvider as d } from "../../../i18n/I18nProvider.js";
|
|
7
|
+
const [p] = i("ThemeProvider"), M = ({
|
|
8
|
+
children: t,
|
|
9
|
+
colorScheme: r = s.system,
|
|
9
10
|
locale: o
|
|
10
11
|
}) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const d = c(
|
|
12
|
+
n({ colorScheme: r });
|
|
13
|
+
const m = f(
|
|
14
14
|
() => ({
|
|
15
|
-
|
|
16
|
-
setMode: n,
|
|
15
|
+
colorScheme: r,
|
|
17
16
|
locale: o
|
|
18
17
|
}),
|
|
19
|
-
[
|
|
18
|
+
[r, o]
|
|
20
19
|
);
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
}, P = () => {
|
|
23
|
-
const e = p({
|
|
24
|
-
consumerName: "useTheme",
|
|
25
|
-
contextRequired: !0
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
...e,
|
|
29
|
-
toggleMode: () => e.setMode(e.mode === m ? T : m)
|
|
30
|
-
};
|
|
20
|
+
return /* @__PURE__ */ e(p, { value: m, children: /* @__PURE__ */ e(d, { locale: o, children: t }) });
|
|
31
21
|
};
|
|
32
22
|
export {
|
|
33
|
-
|
|
34
|
-
P as useTheme
|
|
23
|
+
M as ThemeProvider
|
|
35
24
|
};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { SupportedLocale } from '../../../i18n';
|
|
3
|
-
export
|
|
3
|
+
export declare const COLOR_SCHEMES: {
|
|
4
|
+
readonly light: "light";
|
|
5
|
+
readonly dark: "dark";
|
|
6
|
+
readonly system: "system";
|
|
7
|
+
};
|
|
8
|
+
export type ColorSchemeName = (typeof COLOR_SCHEMES)[keyof typeof COLOR_SCHEMES];
|
|
4
9
|
export type ThemeProviderProps = PropsWithChildren & {
|
|
5
10
|
/**
|
|
6
|
-
* The
|
|
11
|
+
* The color scheme of the theme.
|
|
12
|
+
* system will follow the user's OS preference via `prefers-color-scheme`.
|
|
7
13
|
* @default 'system'
|
|
8
14
|
*/
|
|
9
|
-
|
|
15
|
+
colorScheme?: ColorSchemeName;
|
|
10
16
|
/**
|
|
11
17
|
* The locale to use for translations.
|
|
12
18
|
* When changed, translations will be lazy-loaded automatically.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/ThemeProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/ThemeProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG;IACnD;;;;OAIG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColorSchemeName } from './ThemeProvider.types';
|
|
2
2
|
export declare const LIGHT_MODE = "light";
|
|
3
3
|
export declare const DARK_MODE = "dark";
|
|
4
4
|
export declare const SYSTEM_MODE = "system";
|
|
@@ -6,7 +6,7 @@ export declare const SYSTEM_MODE = "system";
|
|
|
6
6
|
* Updates the root element className when the theme mode changes.
|
|
7
7
|
* This allows the design-system theme config to be applied
|
|
8
8
|
*/
|
|
9
|
-
export declare const useRootColorModeSideEffect: ({
|
|
10
|
-
|
|
9
|
+
export declare const useRootColorModeSideEffect: ({ colorScheme, }: {
|
|
10
|
+
colorScheme: ColorSchemeName;
|
|
11
11
|
}) => void;
|
|
12
12
|
//# sourceMappingURL=useRootColorModeSideEffect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRootColorModeSideEffect.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/useRootColorModeSideEffect.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"useRootColorModeSideEffect.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ThemeProvider/useRootColorModeSideEffect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEvE,eAAO,MAAM,UAAU,UAAU,CAAC;AAClC,eAAO,MAAM,SAAS,SAAS,CAAC;AAChC,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,0BAA0B,qBAEpC;IACD,WAAW,EAAE,eAAe,CAAC;CAC9B,SA0BA,CAAC"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { useLayoutEffect as a } from "react";
|
|
2
|
+
import { COLOR_SCHEMES as c } from "./ThemeProvider.types.js";
|
|
3
|
+
const r = "light", n = "dark", m = ({
|
|
4
|
+
colorScheme: t
|
|
5
|
+
}) => {
|
|
6
|
+
a(() => {
|
|
7
|
+
const e = window.document.documentElement;
|
|
8
|
+
if (e.classList.remove(r, n), t === c.system) {
|
|
9
|
+
const s = window.matchMedia("(prefers-color-scheme: dark)"), o = () => {
|
|
10
|
+
e.classList.remove(r, n), e.classList.add(s.matches ? n : r);
|
|
11
|
+
};
|
|
12
|
+
return o(), s.addEventListener("change", o), () => {
|
|
13
|
+
s.removeEventListener("change", o);
|
|
14
|
+
};
|
|
9
15
|
}
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
return e.classList.add(t), () => {
|
|
17
|
+
};
|
|
18
|
+
}, [t]);
|
|
12
19
|
};
|
|
13
20
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
a as useRootColorModeSideEffect
|
|
21
|
+
n as DARK_MODE,
|
|
22
|
+
r as LIGHT_MODE,
|
|
23
|
+
m as useRootColorModeSideEffect
|
|
18
24
|
};
|
package/dist/package.json
CHANGED