@okam/next-component 1.2.0 → 1.2.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,413 @@
1
+ ## 1.2.1 (2025-11-01)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **next-component:** build project via @nx/vite:build ([36aa25d](https://github.com/OKAMca/stack/commit/36aa25d))
6
+ - **next-component:** build using .mjs/.js formats, support /server output directory ([564ace3](https://github.com/OKAMca/stack/commit/564ace3))
7
+
8
+ ### ❤️ Thank You
9
+
10
+ - poclerson
11
+
12
+ ## 1.2.0 (2025-11-01)
13
+
14
+ ### 🚀 Features
15
+
16
+ - **next-component:** createServerContext function ([eaafb92](https://github.com/OKAMca/stack/commit/eaafb92))
17
+
18
+ ### ❤️ Thank You
19
+
20
+ - poclerson
21
+
22
+ ## 1.1.5 (2025-10-17)
23
+
24
+ ### 🧱 Updated Dependencies
25
+
26
+ - Updated stack-ui to 1.42.3
27
+
28
+ ## 1.1.4 (2025-10-14)
29
+
30
+ ### 🧱 Updated Dependencies
31
+
32
+ - Updated stack-ui to 1.42.2
33
+
34
+ ## 1.1.3 (2025-10-09)
35
+
36
+ ### 🧱 Updated Dependencies
37
+
38
+ - Updated stack-ui to 1.42.1
39
+
40
+ ## 1.1.2 (2025-10-02)
41
+
42
+ ### 🧱 Updated Dependencies
43
+
44
+ - Updated stack-ui to 1.42.0
45
+
46
+ ## 1.1.1 (2025-09-25)
47
+
48
+ ### 🧱 Updated Dependencies
49
+
50
+ - Updated stack-ui to 1.41.2
51
+
52
+ ## 1.1.0 (2025-09-25)
53
+
54
+ ### 🚀 Features
55
+
56
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
57
+
58
+ ### 🩹 Fixes
59
+
60
+ - **next-component:** null guard against undefined next useParams return ([c347f3a](https://github.com/OKAMca/stack/commit/c347f3a))
61
+ - **next-component:** link component doesnt prepend ext links with locale ([8659974](https://github.com/OKAMca/stack/commit/8659974))
62
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
63
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
64
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
65
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
66
+
67
+ ### ❤️ Thank You
68
+
69
+ - Marie-Maxime Tanguay
70
+ - Pierre-Olivier Clerson @poclerson
71
+ - poclerson
72
+
73
+ ## 1.0.15 (2025-09-04)
74
+
75
+ ### 🚀 Features
76
+
77
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
78
+
79
+ ### 🩹 Fixes
80
+
81
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
82
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
83
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
84
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
85
+
86
+ ### 🧱 Updated Dependencies
87
+
88
+ - Updated stack-ui to 1.41.1
89
+
90
+ ### ❤️ Thank You
91
+
92
+ - Marie-Maxime Tanguay
93
+ - Pierre-Olivier Clerson @poclerson
94
+
95
+ ## 1.0.14 (2025-08-28)
96
+
97
+ ### 🚀 Features
98
+
99
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
100
+
101
+ ### 🩹 Fixes
102
+
103
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
104
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
105
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
106
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
107
+
108
+ ### 🧱 Updated Dependencies
109
+
110
+ - Updated stack-ui to 1.41.0
111
+
112
+ ### ❤️ Thank You
113
+
114
+ - Marie-Maxime Tanguay
115
+ - Pierre-Olivier Clerson @poclerson
116
+
117
+ ## 1.0.13 (2025-08-22)
118
+
119
+ ### 🚀 Features
120
+
121
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
122
+
123
+ ### 🩹 Fixes
124
+
125
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
126
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
127
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
128
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
129
+
130
+ ### 🧱 Updated Dependencies
131
+
132
+ - Updated stack-ui to 1.40.1
133
+
134
+ ### ❤️ Thank You
135
+
136
+ - Marie-Maxime Tanguay
137
+ - Pierre-Olivier Clerson @poclerson
138
+
139
+ ## 1.0.12 (2025-08-11)
140
+
141
+ ### 🚀 Features
142
+
143
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
144
+
145
+ ### 🩹 Fixes
146
+
147
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
148
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
149
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
150
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
151
+
152
+ ### 🧱 Updated Dependencies
153
+
154
+ - Updated stack-ui to 1.40.0
155
+
156
+ ### ❤️ Thank You
157
+
158
+ - Marie-Maxime Tanguay
159
+ - Pierre-Olivier Clerson @poclerson
160
+
161
+ ## 1.0.10 (2025-07-18)
162
+
163
+ ### 🚀 Features
164
+
165
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
166
+
167
+ ### 🩹 Fixes
168
+
169
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
170
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
171
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
172
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
173
+
174
+ ### 🧱 Updated Dependencies
175
+
176
+ - Updated stack-ui to 1.39.2
177
+
178
+ ### ❤️ Thank You
179
+
180
+ - Marie-Maxime Tanguay
181
+ - Pierre-Olivier Clerson @poclerson
182
+
183
+ ## 1.0.9 (2025-07-18)
184
+
185
+ ### 🚀 Features
186
+
187
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
188
+
189
+ ### 🩹 Fixes
190
+
191
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
192
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
193
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
194
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
195
+
196
+ ### 🧱 Updated Dependencies
197
+
198
+ - Updated stack-ui to 1.39.1
199
+
200
+ ### ❤️ Thank You
201
+
202
+ - Marie-Maxime Tanguay
203
+ - Pierre-Olivier Clerson @poclerson
204
+
205
+ ## 1.0.8 (2025-07-04)
206
+
207
+ ### 🚀 Features
208
+
209
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
210
+
211
+ ### 🩹 Fixes
212
+
213
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
214
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
215
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
216
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
217
+
218
+ ### 🧱 Updated Dependencies
219
+
220
+ - Updated stack-ui to 1.39.0
221
+
222
+ ### ❤️ Thank You
223
+
224
+ - Marie-Maxime Tanguay
225
+ - Pierre-Olivier Clerson @poclerson
226
+
227
+ ## 1.0.7 (2025-07-01)
228
+
229
+ ### 🚀 Features
230
+
231
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
232
+
233
+ ### 🩹 Fixes
234
+
235
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
236
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
237
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
238
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
239
+
240
+ ### 🧱 Updated Dependencies
241
+
242
+ - Updated stack-ui to 1.38.1
243
+
244
+ ### ❤️ Thank You
245
+
246
+ - Marie-Maxime Tanguay
247
+ - Pierre-Olivier Clerson @poclerson
248
+
249
+ ## 1.0.6 (2025-07-01)
250
+
251
+ ### 🚀 Features
252
+
253
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
254
+
255
+ ### 🩹 Fixes
256
+
257
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
258
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
259
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
260
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
261
+
262
+ ### 🧱 Updated Dependencies
263
+
264
+ - Updated stack-ui to 1.38.0
265
+
266
+ ### ❤️ Thank You
267
+
268
+ - Marie-Maxime Tanguay
269
+ - Pierre-Olivier Clerson @poclerson
270
+
271
+ ## 1.0.5 (2025-05-26)
272
+
273
+ ### 🚀 Features
274
+
275
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
276
+
277
+ ### 🩹 Fixes
278
+
279
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
280
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
281
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
282
+
283
+ ### 🧱 Updated Dependencies
284
+
285
+ - Updated stack-ui to 1.37.0
286
+
287
+ ### ❤️ Thank You
288
+
289
+ - Marie-Maxime Tanguay
290
+
291
+ ## 1.0.4 (2025-05-26)
292
+
293
+ ### 🚀 Features
294
+
295
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
296
+
297
+ ### 🩹 Fixes
298
+
299
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
300
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
301
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
302
+
303
+ ### 🧱 Updated Dependencies
304
+
305
+ - Updated stack-ui to 1.37.0
306
+
307
+ ### ❤️ Thank You
308
+
309
+ - Marie-Maxime Tanguay
310
+
311
+ ## 1.0.3 (2025-05-22)
312
+
313
+ ### 🚀 Features
314
+
315
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
316
+
317
+ ### 🩹 Fixes
318
+
319
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
320
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
321
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
322
+
323
+ ### 🧱 Updated Dependencies
324
+
325
+ - Updated stack-ui to 1.37.0
326
+
327
+ ### ❤️ Thank You
328
+
329
+ - Marie-Maxime Tanguay
330
+
331
+ ## 1.0.1 (2025-05-01)
332
+
333
+ ### 🚀 Features
334
+
335
+ - **next-component:** next link wrapper component + hook ([ed654da](https://github.com/OKAMca/stack/commit/ed654da))
336
+ - add header option to select component ([0338ebc](https://github.com/OKAMca/stack/commit/0338ebc))
337
+ - bump versions to force publish ([6e3eb60](https://github.com/OKAMca/stack/commit/6e3eb60))
338
+ - project cleanup ([a5dde9d](https://github.com/OKAMca/stack/commit/a5dde9d))
339
+
340
+ ### 🩹 Fixes
341
+
342
+ - bump package ([b6259d1](https://github.com/OKAMca/stack/commit/b6259d1))
343
+ - issue with typing not resolving correctly when installing package ([bc4c81d](https://github.com/OKAMca/stack/commit/bc4c81d))
344
+
345
+ ### 🧱 Updated Dependencies
346
+
347
+ - Updated stack-ui to 1.31.0
348
+
349
+ ### ❤️ Thank You
350
+
351
+ - Marie-Maxime Tanguay @marie-maxime
352
+ - Pierre-Olivier Clerson @poclerson
353
+
354
+ ## 0.3.0 (2024-10-04)
355
+
356
+
357
+ ### 🚀 Features
358
+
359
+ - updates & cleanup packages and dependancies ([#210](https://github.com/OKAMca/stack/pull/210))
360
+
361
+
362
+ ### ❤️ Thank You
363
+
364
+ - Marie-Maxime Tanguay @marie-maxime
365
+
366
+ ## 0.2.0 (2024-08-15)
367
+
368
+
369
+ ### 🚀 Features
370
+
371
+ - directus image support for videos ([4d45c9c](https://github.com/OKAMca/stack/commit/4d45c9c))
372
+
373
+
374
+ ### ❤️ Thank You
375
+
376
+ - Jérôme Trottier
377
+ - Marie-Maxime Tanguay @marie-maxime
378
+ - mykimd
379
+ - Pierre-Olivier Clerson @poclerson
380
+ - poclerson
381
+ - Yan Morin
382
+ - yanmorinokamca @yanmorinokamca
383
+
384
+ ## 0.1.1 (2024-07-16)
385
+
386
+
387
+ ### 🩹 Fixes
388
+
389
+ - **publish:** add building packages step to workflow ([c9ce442](https://github.com/OKAMca/stack/commit/c9ce442))
390
+
391
+
392
+ ### ❤️ Thank You
393
+
394
+ - Jérôme Trottier
395
+ - Pierre-Olivier Clerson @poclerson
396
+ - yanmorinokamca @yanmorinokamca
397
+
398
+ ## 0.1.0 (2024-06-28)
399
+
400
+
401
+ ### 🚀 Features
402
+
403
+ - add new libs ([#71](https://github.com/OKAMca/stack/pull/71))
404
+
405
+
406
+ ### 🩹 Fixes
407
+
408
+ - publishing for new libs ([#125](https://github.com/OKAMca/stack/pull/125))
409
+
410
+
411
+ ### ❤️ Thank You
412
+
413
+ - Marie-Maxime Tanguay @marie-maxime
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ "use strict";
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const stackUi = require("@okam/stack-ui");
5
+ const Image = require("next/image.js");
6
+ const Img = (props) => {
7
+ const { src, width, height, themeName = "img", tokens, customTheme, ...rest } = props;
8
+ const theme = stackUi.useThemeContext(themeName, tokens, customTheme);
9
+ if (typeof src === "object") {
10
+ const { blurWidth, blurHeight, width: srcWidth, height: srcHeight, ...withoutBlurDimensions } = src;
11
+ const blur = {
12
+ blurwidth: blurWidth,
13
+ blurheight: blurHeight
14
+ };
15
+ return /* @__PURE__ */ jsxRuntime.jsx(
16
+ Image,
17
+ {
18
+ className: theme,
19
+ ...withoutBlurDimensions,
20
+ ...rest,
21
+ ...blur,
22
+ width: srcWidth ?? width,
23
+ height: srcHeight ?? height
24
+ }
25
+ );
26
+ }
27
+ return /* @__PURE__ */ jsxRuntime.jsx(Image, { width, height, className: theme, src, ...rest });
28
+ };
29
+ module.exports = Img;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useThemeContext } from "@okam/stack-ui";
4
+ import Image from "next/image.js";
5
+ const Img = (props) => {
6
+ const { src, width, height, themeName = "img", tokens, customTheme, ...rest } = props;
7
+ const theme = useThemeContext(themeName, tokens, customTheme);
8
+ if (typeof src === "object") {
9
+ const { blurWidth, blurHeight, width: srcWidth, height: srcHeight, ...withoutBlurDimensions } = src;
10
+ const blur = {
11
+ blurwidth: blurWidth,
12
+ blurheight: blurHeight
13
+ };
14
+ return /* @__PURE__ */ jsx(
15
+ Image,
16
+ {
17
+ className: theme,
18
+ ...withoutBlurDimensions,
19
+ ...rest,
20
+ ...blur,
21
+ width: srcWidth ?? width,
22
+ height: srcHeight ?? height
23
+ }
24
+ );
25
+ }
26
+ return /* @__PURE__ */ jsx(Image, { width, height, className: theme, src, ...rest });
27
+ };
28
+ export {
29
+ Img as default
30
+ };
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ "use strict";
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const stackUi = require("@okam/stack-ui");
5
+ const NextLink = require("next/link.js");
6
+ const react = require("react");
7
+ const index = require("../../hooks/useLink/index.js");
8
+ const Link = react.forwardRef((props, ref) => {
9
+ const {
10
+ themeName = "link",
11
+ tokens,
12
+ customTheme,
13
+ as = NextLink,
14
+ children,
15
+ scroll,
16
+ onPathnameChange,
17
+ onSearchParamsChange,
18
+ onHashChange,
19
+ behavior,
20
+ urlDecorator: urlDecoratorProp,
21
+ href: hrefProp,
22
+ ...rest
23
+ } = props;
24
+ const linkProps = index.useLink(props);
25
+ return /* @__PURE__ */ jsxRuntime.jsx(
26
+ stackUi.Anchor,
27
+ {
28
+ ref,
29
+ ...rest,
30
+ nextLinkProps: linkProps,
31
+ as,
32
+ themeName,
33
+ tokens,
34
+ customTheme,
35
+ children
36
+ }
37
+ );
38
+ });
39
+ Link.displayName = "Link";
40
+ module.exports = Link;
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Anchor } from "@okam/stack-ui";
4
+ import NextLink from "next/link.js";
5
+ import { forwardRef } from "react";
6
+ import { useLink } from "../../hooks/useLink/index.mjs";
7
+ const Link = forwardRef((props, ref) => {
8
+ const {
9
+ themeName = "link",
10
+ tokens,
11
+ customTheme,
12
+ as = NextLink,
13
+ children,
14
+ scroll,
15
+ onPathnameChange,
16
+ onSearchParamsChange,
17
+ onHashChange,
18
+ behavior,
19
+ urlDecorator: urlDecoratorProp,
20
+ href: hrefProp,
21
+ ...rest
22
+ } = props;
23
+ const linkProps = useLink(props);
24
+ return /* @__PURE__ */ jsx(
25
+ Anchor,
26
+ {
27
+ ref,
28
+ ...rest,
29
+ nextLinkProps: linkProps,
30
+ as,
31
+ themeName,
32
+ tokens,
33
+ customTheme,
34
+ children
35
+ }
36
+ );
37
+ });
38
+ Link.displayName = "Link";
39
+ export {
40
+ Link as default
41
+ };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const react = require("react");
5
+ const reactUse = require("react-use");
6
+ function getHash() {
7
+ if (typeof window === "undefined") return "";
8
+ return window.location.hash;
9
+ }
10
+ function useHash() {
11
+ const defaultHash = getHash();
12
+ const [hash, setHash] = react.useState(defaultHash);
13
+ const handleHashChangeEvent = ({ newURL }) => {
14
+ if (!URL.canParse(newURL)) return;
15
+ const { hash: newHash } = new URL(newURL);
16
+ if (!newHash || newHash === hash) return;
17
+ setHash(newHash);
18
+ };
19
+ reactUse.useEvent("hashchange", handleHashChangeEvent);
20
+ return hash;
21
+ }
22
+ exports.useHash = useHash;
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { useState } from "react";
3
+ import { useEvent } from "react-use";
4
+ function getHash() {
5
+ if (typeof window === "undefined") return "";
6
+ return window.location.hash;
7
+ }
8
+ function useHash() {
9
+ const defaultHash = getHash();
10
+ const [hash, setHash] = useState(defaultHash);
11
+ const handleHashChangeEvent = ({ newURL }) => {
12
+ if (!URL.canParse(newURL)) return;
13
+ const { hash: newHash } = new URL(newURL);
14
+ if (!newHash || newHash === hash) return;
15
+ setHash(newHash);
16
+ };
17
+ useEvent("hashchange", handleHashChangeEvent);
18
+ return hash;
19
+ }
20
+ export {
21
+ useHash
22
+ };
@@ -0,0 +1,96 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const navigation_js = require("next/navigation.js");
5
+ const react = require("react");
6
+ const reactAria = require("react-aria");
7
+ const index = require("../useHash/index.js");
8
+ function scrollToTop(behavior) {
9
+ var _a;
10
+ (_a = window == null ? void 0 : window.scrollTo) == null ? void 0 : _a.call(window, { top: 0, behavior });
11
+ }
12
+ function getParamsLocale(params) {
13
+ const { locale } = params ?? {};
14
+ if (Array.isArray(locale)) return locale[0];
15
+ return locale;
16
+ }
17
+ function useLinkLocale(props) {
18
+ const { locale } = props;
19
+ const params = navigation_js.useParams();
20
+ const paramsLocale = getParamsLocale(params);
21
+ const { locale: ctxLocale } = reactAria.useLocale();
22
+ return locale ?? ctxLocale ?? paramsLocale ?? false;
23
+ }
24
+ function localizeHref(href, locale) {
25
+ const hrefString = href.toString();
26
+ const isExternal = /^[a-z]+:\/\//i.test(hrefString) || hrefString.startsWith("//");
27
+ if (isExternal) return hrefString;
28
+ if (locale) {
29
+ return `/${locale}${hrefString}`;
30
+ }
31
+ return hrefString;
32
+ }
33
+ function useLink(props) {
34
+ const {
35
+ scroll = true,
36
+ onMouseEnter,
37
+ onTouchStart,
38
+ onClick,
39
+ onPathnameChange,
40
+ onHashChange,
41
+ onSearchParamsChange,
42
+ href,
43
+ urlDecorator,
44
+ replace,
45
+ prefetch,
46
+ shallow,
47
+ passHref,
48
+ legacyBehavior,
49
+ behavior = "instant"
50
+ } = props;
51
+ const locale = useLinkLocale(props);
52
+ const localizedHref = localizeHref(href, locale);
53
+ const pathname = navigation_js.usePathname();
54
+ const searchParams = navigation_js.useSearchParams();
55
+ const hash = index.useHash();
56
+ const isNextScroll = typeof scroll === "boolean";
57
+ const nextScroll = isNextScroll ? scroll : false;
58
+ const handleScroll = react.useCallback(() => {
59
+ if (isNextScroll) return;
60
+ scrollToTop(behavior);
61
+ }, [behavior, isNextScroll]);
62
+ const handleClick = (event) => {
63
+ onClick == null ? void 0 : onClick(event);
64
+ handleScroll();
65
+ };
66
+ const handleTouchStart = (event) => {
67
+ onTouchStart == null ? void 0 : onTouchStart(event);
68
+ handleScroll();
69
+ };
70
+ react.useEffect(() => {
71
+ onPathnameChange == null ? void 0 : onPathnameChange(pathname);
72
+ }, [onPathnameChange, pathname]);
73
+ react.useEffect(() => {
74
+ onSearchParamsChange == null ? void 0 : onSearchParamsChange(searchParams);
75
+ }, [onSearchParamsChange, searchParams]);
76
+ react.useEffect(() => {
77
+ onHashChange == null ? void 0 : onHashChange(hash);
78
+ }, [onHashChange, hash]);
79
+ return {
80
+ href: localizedHref.toString(),
81
+ as: urlDecorator,
82
+ replace,
83
+ locale,
84
+ prefetch,
85
+ shallow,
86
+ onClick: handleClick,
87
+ onTouchStart: handleTouchStart,
88
+ onMouseEnter,
89
+ scroll: nextScroll,
90
+ passHref,
91
+ legacyBehavior
92
+ };
93
+ }
94
+ exports.localizeHref = localizeHref;
95
+ exports.useLink = useLink;
96
+ exports.useLinkLocale = useLinkLocale;
@@ -0,0 +1,96 @@
1
+ "use client";
2
+ import { usePathname, useSearchParams, useParams } from "next/navigation.js";
3
+ import { useCallback, useEffect } from "react";
4
+ import { useLocale } from "react-aria";
5
+ import { useHash } from "../useHash/index.mjs";
6
+ function scrollToTop(behavior) {
7
+ var _a;
8
+ (_a = window == null ? void 0 : window.scrollTo) == null ? void 0 : _a.call(window, { top: 0, behavior });
9
+ }
10
+ function getParamsLocale(params) {
11
+ const { locale } = params ?? {};
12
+ if (Array.isArray(locale)) return locale[0];
13
+ return locale;
14
+ }
15
+ function useLinkLocale(props) {
16
+ const { locale } = props;
17
+ const params = useParams();
18
+ const paramsLocale = getParamsLocale(params);
19
+ const { locale: ctxLocale } = useLocale();
20
+ return locale ?? ctxLocale ?? paramsLocale ?? false;
21
+ }
22
+ function localizeHref(href, locale) {
23
+ const hrefString = href.toString();
24
+ const isExternal = /^[a-z]+:\/\//i.test(hrefString) || hrefString.startsWith("//");
25
+ if (isExternal) return hrefString;
26
+ if (locale) {
27
+ return `/${locale}${hrefString}`;
28
+ }
29
+ return hrefString;
30
+ }
31
+ function useLink(props) {
32
+ const {
33
+ scroll = true,
34
+ onMouseEnter,
35
+ onTouchStart,
36
+ onClick,
37
+ onPathnameChange,
38
+ onHashChange,
39
+ onSearchParamsChange,
40
+ href,
41
+ urlDecorator,
42
+ replace,
43
+ prefetch,
44
+ shallow,
45
+ passHref,
46
+ legacyBehavior,
47
+ behavior = "instant"
48
+ } = props;
49
+ const locale = useLinkLocale(props);
50
+ const localizedHref = localizeHref(href, locale);
51
+ const pathname = usePathname();
52
+ const searchParams = useSearchParams();
53
+ const hash = useHash();
54
+ const isNextScroll = typeof scroll === "boolean";
55
+ const nextScroll = isNextScroll ? scroll : false;
56
+ const handleScroll = useCallback(() => {
57
+ if (isNextScroll) return;
58
+ scrollToTop(behavior);
59
+ }, [behavior, isNextScroll]);
60
+ const handleClick = (event) => {
61
+ onClick == null ? void 0 : onClick(event);
62
+ handleScroll();
63
+ };
64
+ const handleTouchStart = (event) => {
65
+ onTouchStart == null ? void 0 : onTouchStart(event);
66
+ handleScroll();
67
+ };
68
+ useEffect(() => {
69
+ onPathnameChange == null ? void 0 : onPathnameChange(pathname);
70
+ }, [onPathnameChange, pathname]);
71
+ useEffect(() => {
72
+ onSearchParamsChange == null ? void 0 : onSearchParamsChange(searchParams);
73
+ }, [onSearchParamsChange, searchParams]);
74
+ useEffect(() => {
75
+ onHashChange == null ? void 0 : onHashChange(hash);
76
+ }, [onHashChange, hash]);
77
+ return {
78
+ href: localizedHref.toString(),
79
+ as: urlDecorator,
80
+ replace,
81
+ locale,
82
+ prefetch,
83
+ shallow,
84
+ onClick: handleClick,
85
+ onTouchStart: handleTouchStart,
86
+ onMouseEnter,
87
+ scroll: nextScroll,
88
+ passHref,
89
+ legacyBehavior
90
+ };
91
+ }
92
+ export {
93
+ localizeHref,
94
+ useLink,
95
+ useLinkLocale
96
+ };
package/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const index = require("./components/Img/index.js");
4
+ const index$1 = require("./components/Link/index.js");
5
+ const index$2 = require("./hooks/useLink/index.js");
6
+ const index$3 = require("./hooks/useHash/index.js");
7
+ exports.Img = index;
8
+ exports.Link = index$1;
9
+ exports.useLink = index$2.useLink;
10
+ exports.useHash = index$3.useHash;
package/index.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import { default as default2 } from "./components/Img/index.mjs";
2
+ import { default as default3 } from "./components/Link/index.mjs";
3
+ import { useLink } from "./hooks/useLink/index.mjs";
4
+ import { useHash } from "./hooks/useHash/index.mjs";
5
+ export {
6
+ default2 as Img,
7
+ default3 as Link,
8
+ useHash,
9
+ useLink
10
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const react = require("react");
4
+ function createServerContext(defaultValue) {
5
+ const getRef = react.cache(() => ({ current: defaultValue }));
6
+ const getValue = () => getRef().current;
7
+ const setValue = (value) => {
8
+ getRef().current = value;
9
+ };
10
+ return [getValue, setValue];
11
+ }
12
+ exports.createServerContext = createServerContext;
@@ -0,0 +1,12 @@
1
+ import { cache } from "react";
2
+ function createServerContext(defaultValue) {
3
+ const getRef = cache(() => ({ current: defaultValue }));
4
+ const getValue = () => getRef().current;
5
+ const setValue = (value) => {
6
+ getRef().current = value;
7
+ };
8
+ return [getValue, setValue];
9
+ }
10
+ export {
11
+ createServerContext
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okam/next-component",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,9 +36,5 @@
36
36
  "react-use": "17.5.1",
37
37
  "tailwind-variants": "^0.3.0",
38
38
  "react-aria": "^3.39.0"
39
- },
40
- "module": "./index.esm.js",
41
- "type": "module",
42
- "main": "./index.esm.js",
43
- "types": "./index.esm.d.ts"
44
- }
39
+ }
40
+ }
package/server.js ADDED
@@ -0,0 +1,5 @@
1
+ "use server";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const index = require("./lib/createServerContext/index.js");
5
+ exports.createServerContext = index.createServerContext;
package/server.mjs ADDED
@@ -0,0 +1,5 @@
1
+ "use server";
2
+ import { createServerContext } from "./lib/createServerContext/index.mjs";
3
+ export {
4
+ createServerContext
5
+ };
package/index.esm.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src/index";
package/index.esm.js DELETED
@@ -1,390 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { useThemeContext, Anchor } from '@okam/stack-ui';
3
- import Image from 'next/image';
4
- import NextLink from 'next/link';
5
- import { useState, useCallback, useEffect, forwardRef } from 'react';
6
- import { usePathname, useSearchParams, useParams } from 'next/navigation';
7
- import { useLocale } from 'react-aria';
8
- import { useEvent } from 'react-use';
9
-
10
- function _define_property$1(obj, key, value) {
11
- if (key in obj) {
12
- Object.defineProperty(obj, key, {
13
- value: value,
14
- enumerable: true,
15
- configurable: true,
16
- writable: true
17
- });
18
- } else {
19
- obj[key] = value;
20
- }
21
- return obj;
22
- }
23
- function _object_spread$1(target) {
24
- for(var i = 1; i < arguments.length; i++){
25
- var source = arguments[i] != null ? arguments[i] : {};
26
- var ownKeys = Object.keys(source);
27
- if (typeof Object.getOwnPropertySymbols === "function") {
28
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
29
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
30
- }));
31
- }
32
- ownKeys.forEach(function(key) {
33
- _define_property$1(target, key, source[key]);
34
- });
35
- }
36
- return target;
37
- }
38
- function ownKeys$1(object, enumerableOnly) {
39
- var keys = Object.keys(object);
40
- if (Object.getOwnPropertySymbols) {
41
- var symbols = Object.getOwnPropertySymbols(object);
42
- keys.push.apply(keys, symbols);
43
- }
44
- return keys;
45
- }
46
- function _object_spread_props$1(target, source) {
47
- source = source != null ? source : {};
48
- if (Object.getOwnPropertyDescriptors) {
49
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
50
- } else {
51
- ownKeys$1(Object(source)).forEach(function(key) {
52
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
53
- });
54
- }
55
- return target;
56
- }
57
- function _object_without_properties$1(source, excluded) {
58
- if (source == null) return {};
59
- var target = _object_without_properties_loose$1(source, excluded);
60
- var key, i;
61
- if (Object.getOwnPropertySymbols) {
62
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
63
- for(i = 0; i < sourceSymbolKeys.length; i++){
64
- key = sourceSymbolKeys[i];
65
- if (excluded.indexOf(key) >= 0) continue;
66
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
67
- target[key] = source[key];
68
- }
69
- }
70
- return target;
71
- }
72
- function _object_without_properties_loose$1(source, excluded) {
73
- if (source == null) return {};
74
- var target = {};
75
- var sourceKeys = Object.keys(source);
76
- var key, i;
77
- for(i = 0; i < sourceKeys.length; i++){
78
- key = sourceKeys[i];
79
- if (excluded.indexOf(key) >= 0) continue;
80
- target[key] = source[key];
81
- }
82
- return target;
83
- }
84
- function _type_of(obj) {
85
- "@swc/helpers - typeof";
86
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
87
- }
88
- var Img = function(props) {
89
- var src = props.src, width = props.width, height = props.height, _props_themeName = props.themeName, themeName = _props_themeName === void 0 ? 'img' : _props_themeName, tokens = props.tokens, customTheme = props.customTheme, rest = _object_without_properties$1(props, [
90
- "src",
91
- "width",
92
- "height",
93
- "themeName",
94
- "tokens",
95
- "customTheme"
96
- ]);
97
- var theme = useThemeContext(themeName, tokens, customTheme);
98
- if ((typeof src === "undefined" ? "undefined" : _type_of(src)) === 'object') {
99
- var blurWidth = src.blurWidth, blurHeight = src.blurHeight, srcWidth = src.width, srcHeight = src.height, withoutBlurDimensions = _object_without_properties$1(src, [
100
- "blurWidth",
101
- "blurHeight",
102
- "width",
103
- "height"
104
- ]);
105
- var blur = {
106
- blurwidth: blurWidth,
107
- blurheight: blurHeight
108
- };
109
- return /*#__PURE__*/ jsx(Image, _object_spread_props$1(_object_spread$1({
110
- className: theme
111
- }, withoutBlurDimensions, rest, blur), {
112
- width: srcWidth !== null && srcWidth !== void 0 ? srcWidth : width,
113
- height: srcHeight !== null && srcHeight !== void 0 ? srcHeight : height
114
- }));
115
- }
116
- return /*#__PURE__*/ jsx(Image, _object_spread$1({
117
- width: width,
118
- height: height,
119
- className: theme,
120
- src: src
121
- }, rest));
122
- };
123
-
124
- function _array_like_to_array(arr, len) {
125
- if (len == null || len > arr.length) len = arr.length;
126
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
127
- return arr2;
128
- }
129
- function _array_with_holes(arr) {
130
- if (Array.isArray(arr)) return arr;
131
- }
132
- function _iterable_to_array_limit(arr, i) {
133
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
134
- if (_i == null) return;
135
- var _arr = [];
136
- var _n = true;
137
- var _d = false;
138
- var _s, _e;
139
- try {
140
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
141
- _arr.push(_s.value);
142
- if (i && _arr.length === i) break;
143
- }
144
- } catch (err) {
145
- _d = true;
146
- _e = err;
147
- } finally{
148
- try {
149
- if (!_n && _i["return"] != null) _i["return"]();
150
- } finally{
151
- if (_d) throw _e;
152
- }
153
- }
154
- return _arr;
155
- }
156
- function _non_iterable_rest() {
157
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
158
- }
159
- function _sliced_to_array(arr, i) {
160
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
161
- }
162
- function _unsupported_iterable_to_array(o, minLen) {
163
- if (!o) return;
164
- if (typeof o === "string") return _array_like_to_array(o, minLen);
165
- var n = Object.prototype.toString.call(o).slice(8, -1);
166
- if (n === "Object" && o.constructor) n = o.constructor.name;
167
- if (n === "Map" || n === "Set") return Array.from(n);
168
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
169
- }
170
- function getHash() {
171
- if (typeof window === 'undefined') return '';
172
- return window.location.hash;
173
- }
174
- /**
175
- * A hook that lets you read the current URL's hash.
176
- *
177
- * @returns The current `window.location.hash`, including the leading `#` character.
178
- */ function useHash() {
179
- var defaultHash = getHash();
180
- var _useState = _sliced_to_array(useState(defaultHash), 2), hash = _useState[0], setHash = _useState[1];
181
- var handleHashChangeEvent = function(param) {
182
- var newURL = param.newURL;
183
- if (!URL.canParse(newURL)) return;
184
- var _ref = new URL(newURL), newHash = _ref.hash;
185
- if (!newHash || newHash === hash) return;
186
- setHash(newHash);
187
- };
188
- useEvent('hashchange', handleHashChangeEvent);
189
- return hash;
190
- }
191
-
192
- function scrollToTop(behavior) {
193
- var _window_scrollTo, _window;
194
- (_window = window) === null || _window === void 0 ? void 0 : (_window_scrollTo = _window.scrollTo) === null || _window_scrollTo === void 0 ? void 0 : _window_scrollTo.call(_window, {
195
- top: 0,
196
- behavior: behavior
197
- });
198
- }
199
- function getParamsLocale(params) {
200
- var locale = (params !== null && params !== void 0 ? params : {}).locale;
201
- if (Array.isArray(locale)) return locale[0];
202
- return locale;
203
- }
204
- /**
205
- * Tries to get the locale, in order of priority:
206
- * 1. The locale prop. Still has priority even when set to `false`
207
- * 2. The locale from react-aria `useLocale`
208
- * 3. The locale from next/navigation `useParams`
209
- * @returns The best matched locale
210
- */ function useLinkLocale(props) {
211
- var locale = props.locale;
212
- var params = useParams();
213
- var paramsLocale = getParamsLocale(params);
214
- var _useLocale = useLocale(), ctxLocale = _useLocale.locale;
215
- var _ref, _ref1;
216
- return (_ref1 = (_ref = locale !== null && locale !== void 0 ? locale : ctxLocale) !== null && _ref !== void 0 ? _ref : paramsLocale) !== null && _ref1 !== void 0 ? _ref1 : false;
217
- }
218
- function localizeHref(href, locale) {
219
- var hrefString = href.toString();
220
- var isExternal = /^[a-z]+:\/\//i.test(hrefString) || hrefString.startsWith('//');
221
- if (isExternal) return hrefString;
222
- if (locale) {
223
- return "/".concat(locale).concat(hrefString);
224
- }
225
- return hrefString;
226
- }
227
- /**
228
- * @params {props.locale} - The direct locale prop always gets priority. If no `locale` prop is provided, the prop will try to fall back to react-aria `useLocale` and then next/navigation `useParams`. If a locale is found, it will be automatically prepended to the href. Otherwise, href will be returned as is.
229
- */ function useLink(props) {
230
- var _props_scroll = props.scroll, scroll = _props_scroll === void 0 ? true : _props_scroll, onMouseEnter = props.onMouseEnter, onTouchStart = props.onTouchStart, onClick = props.onClick, onPathnameChange = props.onPathnameChange, onHashChange = props.onHashChange, onSearchParamsChange = props.onSearchParamsChange, href = props.href, urlDecorator = props.urlDecorator, replace = props.replace, prefetch = props.prefetch, shallow = props.shallow, passHref = props.passHref, legacyBehavior = props.legacyBehavior, _props_behavior = props.behavior, behavior = _props_behavior === void 0 ? 'instant' : _props_behavior;
231
- var locale = useLinkLocale(props);
232
- var localizedHref = localizeHref(href, locale);
233
- var pathname = usePathname();
234
- var searchParams = useSearchParams();
235
- var hash = useHash();
236
- var isNextScroll = typeof scroll === 'boolean';
237
- var nextScroll = isNextScroll ? scroll : false;
238
- var handleScroll = useCallback(function() {
239
- if (isNextScroll) return;
240
- scrollToTop(behavior);
241
- }, [
242
- behavior,
243
- isNextScroll
244
- ]);
245
- var handleClick = function(event) {
246
- onClick === null || onClick === void 0 ? void 0 : onClick(event);
247
- handleScroll();
248
- };
249
- var handleTouchStart = function(event) {
250
- onTouchStart === null || onTouchStart === void 0 ? void 0 : onTouchStart(event);
251
- handleScroll();
252
- };
253
- useEffect(function() {
254
- onPathnameChange === null || onPathnameChange === void 0 ? void 0 : onPathnameChange(pathname);
255
- }, [
256
- onPathnameChange,
257
- pathname
258
- ]);
259
- useEffect(function() {
260
- onSearchParamsChange === null || onSearchParamsChange === void 0 ? void 0 : onSearchParamsChange(searchParams);
261
- }, [
262
- onSearchParamsChange,
263
- searchParams
264
- ]);
265
- useEffect(function() {
266
- onHashChange === null || onHashChange === void 0 ? void 0 : onHashChange(hash);
267
- }, [
268
- onHashChange,
269
- hash
270
- ]);
271
- return {
272
- href: localizedHref.toString(),
273
- as: urlDecorator,
274
- replace: replace,
275
- locale: locale,
276
- prefetch: prefetch,
277
- shallow: shallow,
278
- onClick: handleClick,
279
- onTouchStart: handleTouchStart,
280
- onMouseEnter: onMouseEnter,
281
- scroll: nextScroll,
282
- passHref: passHref,
283
- legacyBehavior: legacyBehavior
284
- };
285
- }
286
-
287
- function _define_property(obj, key, value) {
288
- if (key in obj) {
289
- Object.defineProperty(obj, key, {
290
- value: value,
291
- enumerable: true,
292
- configurable: true,
293
- writable: true
294
- });
295
- } else {
296
- obj[key] = value;
297
- }
298
- return obj;
299
- }
300
- function _object_spread(target) {
301
- for(var i = 1; i < arguments.length; i++){
302
- var source = arguments[i] != null ? arguments[i] : {};
303
- var ownKeys = Object.keys(source);
304
- if (typeof Object.getOwnPropertySymbols === "function") {
305
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
306
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
307
- }));
308
- }
309
- ownKeys.forEach(function(key) {
310
- _define_property(target, key, source[key]);
311
- });
312
- }
313
- return target;
314
- }
315
- function ownKeys(object, enumerableOnly) {
316
- var keys = Object.keys(object);
317
- if (Object.getOwnPropertySymbols) {
318
- var symbols = Object.getOwnPropertySymbols(object);
319
- keys.push.apply(keys, symbols);
320
- }
321
- return keys;
322
- }
323
- function _object_spread_props(target, source) {
324
- source = source != null ? source : {};
325
- if (Object.getOwnPropertyDescriptors) {
326
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
327
- } else {
328
- ownKeys(Object(source)).forEach(function(key) {
329
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
330
- });
331
- }
332
- return target;
333
- }
334
- function _object_without_properties(source, excluded) {
335
- if (source == null) return {};
336
- var target = _object_without_properties_loose(source, excluded);
337
- var key, i;
338
- if (Object.getOwnPropertySymbols) {
339
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
340
- for(i = 0; i < sourceSymbolKeys.length; i++){
341
- key = sourceSymbolKeys[i];
342
- if (excluded.indexOf(key) >= 0) continue;
343
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
344
- target[key] = source[key];
345
- }
346
- }
347
- return target;
348
- }
349
- function _object_without_properties_loose(source, excluded) {
350
- if (source == null) return {};
351
- var target = {};
352
- var sourceKeys = Object.keys(source);
353
- var key, i;
354
- for(i = 0; i < sourceKeys.length; i++){
355
- key = sourceKeys[i];
356
- if (excluded.indexOf(key) >= 0) continue;
357
- target[key] = source[key];
358
- }
359
- return target;
360
- }
361
- var Link = /*#__PURE__*/ forwardRef(function(props, ref) {
362
- var _props_themeName = props.themeName, themeName = _props_themeName === void 0 ? 'link' : _props_themeName, tokens = props.tokens, customTheme = props.customTheme, _props_as = props.as, as = _props_as === void 0 ? NextLink : _props_as, children = props.children; props.scroll; props.onPathnameChange; props.onSearchParamsChange; props.onHashChange; props.behavior; props.urlDecorator; props.href; var rest = _object_without_properties(props, [
363
- "themeName",
364
- "tokens",
365
- "customTheme",
366
- "as",
367
- "children",
368
- "scroll",
369
- "onPathnameChange",
370
- "onSearchParamsChange",
371
- "onHashChange",
372
- "behavior",
373
- "urlDecorator",
374
- "href"
375
- ]);
376
- var linkProps = useLink(props);
377
- return /*#__PURE__*/ jsx(Anchor, _object_spread_props(_object_spread({
378
- ref: ref
379
- }, rest), {
380
- nextLinkProps: linkProps,
381
- as: as,
382
- themeName: themeName,
383
- tokens: tokens,
384
- customTheme: customTheme,
385
- children: children
386
- }));
387
- });
388
- Link.displayName = 'Link';
389
-
390
- export { Img, Link, useHash, useLink };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes