@ledgerhq/lumen-ui-react 0.1.4 → 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/_virtual/dynamic-import-helper.js +1 -8
- package/dist/index.js +70 -69
- package/dist/lib/Components/BaseInput/BaseInput.js +72 -75
- package/dist/lib/Components/DataTable/DataTable.js +108 -108
- package/dist/lib/Components/Menu/Menu.js +50 -51
- package/dist/lib/Components/SideBar/SideBar.js +57 -57
- package/dist/lib/Components/Table/Table.js +50 -50
- package/dist/lib/Components/Table/utils/useThrottledScrollBottom.js +20 -21
- 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/lib/Components/Tile/Tile.js +48 -48
- package/dist/lib/Components/TileButton/TileButton.js +24 -24
- package/dist/node_modules/react-i18next/dist/es/context.js +9 -12
- package/dist/package.json +1 -1
- package/dist/utils/useControllableState/useControllableState.js +17 -18
- package/package.json +1 -1
|
@@ -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
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createSafeContext as T, cn as
|
|
1
|
+
import { jsx as i, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { createSafeContext as T, cn as l } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import { cva as f } from "class-variance-authority";
|
|
4
4
|
import { useCallback as x } from "react";
|
|
5
5
|
import { Spot as v } from "../Spot/Spot.js";
|
|
6
6
|
import { InteractiveIcon as y } from "../InteractiveIcon/InteractiveIcon.js";
|
|
7
|
-
const [N,
|
|
7
|
+
const [N, s] = T("Tile"), m = {
|
|
8
8
|
root: f([
|
|
9
9
|
"group relative flex flex-col items-center rounded-md text-base transition-colors focus-visible:outline-2 focus-visible:outline-focus"
|
|
10
10
|
]),
|
|
@@ -39,14 +39,14 @@ const [N, l] = T("Tile"), m = {
|
|
|
39
39
|
ref: t,
|
|
40
40
|
className: e,
|
|
41
41
|
onClick: a,
|
|
42
|
-
secondaryAction:
|
|
42
|
+
secondaryAction: o,
|
|
43
43
|
appearance: c = "no-background",
|
|
44
|
-
disabled:
|
|
44
|
+
disabled: r = !1,
|
|
45
45
|
centered: d = !1,
|
|
46
46
|
children: u,
|
|
47
47
|
style: p,
|
|
48
48
|
...n
|
|
49
|
-
}) => /* @__PURE__ */
|
|
49
|
+
}) => /* @__PURE__ */ i(N, { value: { disabled: r }, children: /* @__PURE__ */ b(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
52
|
ref: t,
|
|
@@ -55,61 +55,61 @@ const [N, l] = T("Tile"), m = {
|
|
|
55
55
|
className: e
|
|
56
56
|
}),
|
|
57
57
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ i(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
61
61
|
...n,
|
|
62
62
|
onClick: a,
|
|
63
|
-
disabled:
|
|
63
|
+
disabled: r,
|
|
64
64
|
className: m.inner({
|
|
65
65
|
appearance: c,
|
|
66
|
-
disabled:
|
|
66
|
+
disabled: r,
|
|
67
67
|
centered: d
|
|
68
68
|
}),
|
|
69
69
|
children: u
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
|
|
72
|
+
o
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
) });
|
|
76
76
|
g.displayName = "Tile";
|
|
77
77
|
const h = ({ size: t = 48, ...e }) => {
|
|
78
|
-
const { disabled: a } =
|
|
78
|
+
const { disabled: a } = s({
|
|
79
79
|
consumerName: "TileSpot",
|
|
80
80
|
contextRequired: !0
|
|
81
81
|
});
|
|
82
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ i(v, { ...e, size: t, disabled: a });
|
|
83
83
|
};
|
|
84
84
|
h.displayName = "TileSpot";
|
|
85
|
-
const
|
|
85
|
+
const C = ({
|
|
86
86
|
children: t,
|
|
87
87
|
className: e,
|
|
88
88
|
...a
|
|
89
|
-
}) => /* @__PURE__ */
|
|
89
|
+
}) => /* @__PURE__ */ i(
|
|
90
90
|
"div",
|
|
91
91
|
{
|
|
92
|
-
className:
|
|
92
|
+
className: l("flex w-full flex-col items-center text-center", e),
|
|
93
93
|
...a,
|
|
94
94
|
children: t
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
|
-
|
|
98
|
-
const
|
|
97
|
+
C.displayName = "TileContent";
|
|
98
|
+
const S = ({
|
|
99
99
|
children: t,
|
|
100
100
|
className: e,
|
|
101
101
|
...a
|
|
102
102
|
}) => {
|
|
103
|
-
const { disabled:
|
|
103
|
+
const { disabled: o } = s({
|
|
104
104
|
consumerName: "TileTitle",
|
|
105
105
|
contextRequired: !0
|
|
106
106
|
});
|
|
107
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ i(
|
|
108
108
|
"div",
|
|
109
109
|
{
|
|
110
|
-
className:
|
|
110
|
+
className: l(
|
|
111
111
|
"w-full truncate body-2-semi-bold",
|
|
112
|
-
|
|
112
|
+
o && "text-disabled",
|
|
113
113
|
e
|
|
114
114
|
),
|
|
115
115
|
...a,
|
|
@@ -117,22 +117,22 @@ const w = ({
|
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
119
|
};
|
|
120
|
-
|
|
121
|
-
const
|
|
120
|
+
S.displayName = "TileTitle";
|
|
121
|
+
const k = ({
|
|
122
122
|
children: t,
|
|
123
123
|
className: e,
|
|
124
124
|
...a
|
|
125
125
|
}) => {
|
|
126
|
-
const { disabled:
|
|
126
|
+
const { disabled: o } = s({
|
|
127
127
|
consumerName: "TileDescription",
|
|
128
128
|
contextRequired: !0
|
|
129
129
|
});
|
|
130
|
-
return /* @__PURE__ */
|
|
130
|
+
return /* @__PURE__ */ i(
|
|
131
131
|
"div",
|
|
132
132
|
{
|
|
133
|
-
className:
|
|
133
|
+
className: l(
|
|
134
134
|
"w-full truncate body-3",
|
|
135
|
-
|
|
135
|
+
o ? "text-disabled" : "text-muted",
|
|
136
136
|
e
|
|
137
137
|
),
|
|
138
138
|
...a,
|
|
@@ -140,63 +140,63 @@ const q = ({
|
|
|
140
140
|
}
|
|
141
141
|
);
|
|
142
142
|
};
|
|
143
|
-
|
|
144
|
-
const
|
|
143
|
+
k.displayName = "TileDescription";
|
|
144
|
+
const w = ({
|
|
145
145
|
children: t,
|
|
146
146
|
className: e,
|
|
147
147
|
...a
|
|
148
|
-
}) => /* @__PURE__ */
|
|
148
|
+
}) => /* @__PURE__ */ i(
|
|
149
149
|
"div",
|
|
150
150
|
{
|
|
151
|
-
className:
|
|
151
|
+
className: l("mt-4 flex w-full flex-col items-center gap-8", e),
|
|
152
152
|
...a,
|
|
153
153
|
children: t
|
|
154
154
|
}
|
|
155
155
|
);
|
|
156
|
-
|
|
157
|
-
const
|
|
156
|
+
w.displayName = "TileTrailingContent";
|
|
157
|
+
const q = ({
|
|
158
158
|
ref: t,
|
|
159
159
|
onClick: e,
|
|
160
160
|
icon: a,
|
|
161
|
-
className:
|
|
161
|
+
className: o,
|
|
162
162
|
"aria-label": c,
|
|
163
|
-
...
|
|
163
|
+
...r
|
|
164
164
|
}) => {
|
|
165
|
-
const { disabled: d } =
|
|
165
|
+
const { disabled: d } = s({
|
|
166
166
|
consumerName: "TileSecondaryAction",
|
|
167
167
|
contextRequired: !0
|
|
168
168
|
}), u = x(
|
|
169
169
|
(n) => {
|
|
170
|
-
n.stopPropagation(), n.preventDefault(), e
|
|
170
|
+
n.stopPropagation(), n.preventDefault(), e?.(n);
|
|
171
171
|
},
|
|
172
172
|
[e]
|
|
173
173
|
);
|
|
174
174
|
if (d) return null;
|
|
175
175
|
const p = a;
|
|
176
|
-
return /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ i(
|
|
177
177
|
y,
|
|
178
178
|
{
|
|
179
|
-
className:
|
|
179
|
+
className: l(
|
|
180
180
|
"absolute top-8 right-4 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100",
|
|
181
|
-
|
|
181
|
+
o
|
|
182
182
|
),
|
|
183
183
|
"data-secondary-button-container": !0,
|
|
184
184
|
iconType: "stroked",
|
|
185
185
|
onClick: u,
|
|
186
186
|
"aria-label": c,
|
|
187
187
|
ref: t,
|
|
188
|
-
...
|
|
189
|
-
children: /* @__PURE__ */
|
|
188
|
+
...r,
|
|
189
|
+
children: /* @__PURE__ */ i(p, { size: 24 })
|
|
190
190
|
}
|
|
191
191
|
);
|
|
192
192
|
};
|
|
193
|
-
|
|
193
|
+
q.displayName = "TileSecondaryAction";
|
|
194
194
|
export {
|
|
195
195
|
g as Tile,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
C as TileContent,
|
|
197
|
+
k as TileDescription,
|
|
198
|
+
q as TileSecondaryAction,
|
|
199
199
|
h as TileSpot,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
S as TileTitle,
|
|
201
|
+
w as TileTrailingContent
|
|
202
202
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as b, jsx as
|
|
1
|
+
import { jsxs as b, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { cn as p } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import { Slot as v, Slottable as x } from "@radix-ui/react-slot";
|
|
4
|
-
import { cva as
|
|
4
|
+
import { cva as i } from "class-variance-authority";
|
|
5
5
|
import { useCallback as g } from "react";
|
|
6
|
-
const N =
|
|
6
|
+
const N = i(
|
|
7
7
|
[
|
|
8
8
|
"flex flex-col items-center gap-8 rounded-md p-12",
|
|
9
9
|
"bg-muted body-2-semi-bold text-base transition-colors",
|
|
@@ -24,7 +24,7 @@ const N = r(
|
|
|
24
24
|
isFull: !1
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
), V =
|
|
27
|
+
), V = i("shrink-0", {
|
|
28
28
|
variants: {
|
|
29
29
|
disabled: {
|
|
30
30
|
true: "text-disabled",
|
|
@@ -34,17 +34,17 @@ const N = r(
|
|
|
34
34
|
defaultVariants: {
|
|
35
35
|
disabled: !1
|
|
36
36
|
}
|
|
37
|
-
}),
|
|
38
|
-
ref:
|
|
37
|
+
}), k = ({
|
|
38
|
+
ref: r,
|
|
39
39
|
icon: n,
|
|
40
|
-
children:
|
|
41
|
-
onClick:
|
|
40
|
+
children: a,
|
|
41
|
+
onClick: l,
|
|
42
42
|
disabled: e = !1,
|
|
43
43
|
isFull: u = !1,
|
|
44
|
-
className:
|
|
45
|
-
asChild:
|
|
46
|
-
"aria-label":
|
|
47
|
-
...
|
|
44
|
+
className: c,
|
|
45
|
+
asChild: t = !1,
|
|
46
|
+
"aria-label": f,
|
|
47
|
+
...m
|
|
48
48
|
}) => {
|
|
49
49
|
const d = g(
|
|
50
50
|
(o) => {
|
|
@@ -52,29 +52,29 @@ const N = r(
|
|
|
52
52
|
o.preventDefault();
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
l?.(o);
|
|
56
56
|
},
|
|
57
|
-
[e,
|
|
57
|
+
[e, l]
|
|
58
58
|
);
|
|
59
59
|
return /* @__PURE__ */ b(
|
|
60
|
-
|
|
60
|
+
t ? v : "button",
|
|
61
61
|
{
|
|
62
|
-
ref:
|
|
63
|
-
type:
|
|
64
|
-
className: p(N({ disabled: e, isFull: u }),
|
|
62
|
+
ref: r,
|
|
63
|
+
type: t ? void 0 : "button",
|
|
64
|
+
className: p(N({ disabled: e, isFull: u }), c),
|
|
65
65
|
onClick: d,
|
|
66
66
|
disabled: e,
|
|
67
67
|
"data-disabled": e || void 0,
|
|
68
|
-
"aria-label":
|
|
69
|
-
...
|
|
68
|
+
"aria-label": f,
|
|
69
|
+
...m,
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
71
|
+
/* @__PURE__ */ s(n, { size: 20, className: V({ disabled: e }) }),
|
|
72
|
+
t ? /* @__PURE__ */ s(x, { children: a }) : /* @__PURE__ */ s("span", { className: "line-clamp-2 text-center", children: a })
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
};
|
|
77
|
-
|
|
77
|
+
k.displayName = "TileButton";
|
|
78
78
|
export {
|
|
79
|
-
|
|
79
|
+
k as TileButton
|
|
80
80
|
};
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { createContext as p } from "react";
|
|
5
|
-
const d = p();
|
|
6
|
-
class N {
|
|
1
|
+
import { createContext as a } from "react";
|
|
2
|
+
const o = a();
|
|
3
|
+
class p {
|
|
7
4
|
constructor() {
|
|
8
|
-
t(this, "getUsedNamespaces", () => Object.keys(this.usedNamespaces));
|
|
9
5
|
this.usedNamespaces = {};
|
|
10
6
|
}
|
|
11
|
-
addUsedNamespaces(
|
|
12
|
-
|
|
13
|
-
this.usedNamespaces[
|
|
7
|
+
addUsedNamespaces(s) {
|
|
8
|
+
s.forEach((e) => {
|
|
9
|
+
this.usedNamespaces[e] || (this.usedNamespaces[e] = !0);
|
|
14
10
|
});
|
|
15
11
|
}
|
|
12
|
+
getUsedNamespaces = () => Object.keys(this.usedNamespaces);
|
|
16
13
|
}
|
|
17
14
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
o as I18nContext,
|
|
16
|
+
p as ReportNamespaces
|
|
20
17
|
};
|
package/dist/package.json
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
function
|
|
1
|
+
import { useState as S, useRef as l, useCallback as d, startTransition as C, useEffect as R } from "react";
|
|
2
|
+
function b({
|
|
3
3
|
prop: t,
|
|
4
|
-
defaultProp:
|
|
5
|
-
onChange:
|
|
4
|
+
defaultProp: i,
|
|
5
|
+
onChange: c
|
|
6
6
|
}) {
|
|
7
|
-
const [
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}), (o = e.current) == null || o.call(e, c), s.current = c;
|
|
7
|
+
const [f, r] = S(t ?? i), e = t !== void 0, a = e ? t : f, o = l(c);
|
|
8
|
+
o.current = c;
|
|
9
|
+
const n = l(a), v = d(
|
|
10
|
+
(s) => {
|
|
11
|
+
const u = typeof s == "function" ? s(n.current) : s;
|
|
12
|
+
e || C(() => {
|
|
13
|
+
r(u);
|
|
14
|
+
}), o.current?.(u), n.current = u;
|
|
16
15
|
},
|
|
17
|
-
[
|
|
16
|
+
[e]
|
|
18
17
|
);
|
|
19
|
-
return
|
|
20
|
-
t !== void 0 && (
|
|
21
|
-
}, [t]), [
|
|
18
|
+
return R(() => {
|
|
19
|
+
t !== void 0 && (r(t), n.current = t);
|
|
20
|
+
}, [t]), [a, v];
|
|
22
21
|
}
|
|
23
22
|
export {
|
|
24
|
-
|
|
23
|
+
b as useControllableState
|
|
25
24
|
};
|