@okam/next-component 1.2.0 → 1.2.2

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,419 @@
1
+ ## 1.2.2 (2025-11-27)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated stack-ui to 1.42.4
6
+
7
+ ## 1.2.1 (2025-11-01)
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - **next-component:** build project via @nx/vite:build ([36aa25d](https://github.com/OKAMca/stack/commit/36aa25d))
12
+ - **next-component:** build using .mjs/.js formats, support /server output directory ([564ace3](https://github.com/OKAMca/stack/commit/564ace3))
13
+
14
+ ### ❤️ Thank You
15
+
16
+ - poclerson
17
+
18
+ ## 1.2.0 (2025-11-01)
19
+
20
+ ### 🚀 Features
21
+
22
+ - **next-component:** createServerContext function ([eaafb92](https://github.com/OKAMca/stack/commit/eaafb92))
23
+
24
+ ### ❤️ Thank You
25
+
26
+ - poclerson
27
+
28
+ ## 1.1.5 (2025-10-17)
29
+
30
+ ### 🧱 Updated Dependencies
31
+
32
+ - Updated stack-ui to 1.42.3
33
+
34
+ ## 1.1.4 (2025-10-14)
35
+
36
+ ### 🧱 Updated Dependencies
37
+
38
+ - Updated stack-ui to 1.42.2
39
+
40
+ ## 1.1.3 (2025-10-09)
41
+
42
+ ### 🧱 Updated Dependencies
43
+
44
+ - Updated stack-ui to 1.42.1
45
+
46
+ ## 1.1.2 (2025-10-02)
47
+
48
+ ### 🧱 Updated Dependencies
49
+
50
+ - Updated stack-ui to 1.42.0
51
+
52
+ ## 1.1.1 (2025-09-25)
53
+
54
+ ### 🧱 Updated Dependencies
55
+
56
+ - Updated stack-ui to 1.41.2
57
+
58
+ ## 1.1.0 (2025-09-25)
59
+
60
+ ### 🚀 Features
61
+
62
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
63
+
64
+ ### 🩹 Fixes
65
+
66
+ - **next-component:** null guard against undefined next useParams return ([c347f3a](https://github.com/OKAMca/stack/commit/c347f3a))
67
+ - **next-component:** link component doesnt prepend ext links with locale ([8659974](https://github.com/OKAMca/stack/commit/8659974))
68
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
69
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
70
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
71
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
72
+
73
+ ### ❤️ Thank You
74
+
75
+ - Marie-Maxime Tanguay
76
+ - Pierre-Olivier Clerson @poclerson
77
+ - poclerson
78
+
79
+ ## 1.0.15 (2025-09-04)
80
+
81
+ ### 🚀 Features
82
+
83
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
84
+
85
+ ### 🩹 Fixes
86
+
87
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
88
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
89
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
90
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
91
+
92
+ ### 🧱 Updated Dependencies
93
+
94
+ - Updated stack-ui to 1.41.1
95
+
96
+ ### ❤️ Thank You
97
+
98
+ - Marie-Maxime Tanguay
99
+ - Pierre-Olivier Clerson @poclerson
100
+
101
+ ## 1.0.14 (2025-08-28)
102
+
103
+ ### 🚀 Features
104
+
105
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
106
+
107
+ ### 🩹 Fixes
108
+
109
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
110
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
111
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
112
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
113
+
114
+ ### 🧱 Updated Dependencies
115
+
116
+ - Updated stack-ui to 1.41.0
117
+
118
+ ### ❤️ Thank You
119
+
120
+ - Marie-Maxime Tanguay
121
+ - Pierre-Olivier Clerson @poclerson
122
+
123
+ ## 1.0.13 (2025-08-22)
124
+
125
+ ### 🚀 Features
126
+
127
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
128
+
129
+ ### 🩹 Fixes
130
+
131
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
132
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
133
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
134
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
135
+
136
+ ### 🧱 Updated Dependencies
137
+
138
+ - Updated stack-ui to 1.40.1
139
+
140
+ ### ❤️ Thank You
141
+
142
+ - Marie-Maxime Tanguay
143
+ - Pierre-Olivier Clerson @poclerson
144
+
145
+ ## 1.0.12 (2025-08-11)
146
+
147
+ ### 🚀 Features
148
+
149
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
150
+
151
+ ### 🩹 Fixes
152
+
153
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
154
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
155
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
156
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
157
+
158
+ ### 🧱 Updated Dependencies
159
+
160
+ - Updated stack-ui to 1.40.0
161
+
162
+ ### ❤️ Thank You
163
+
164
+ - Marie-Maxime Tanguay
165
+ - Pierre-Olivier Clerson @poclerson
166
+
167
+ ## 1.0.10 (2025-07-18)
168
+
169
+ ### 🚀 Features
170
+
171
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
172
+
173
+ ### 🩹 Fixes
174
+
175
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
176
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
177
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
178
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
179
+
180
+ ### 🧱 Updated Dependencies
181
+
182
+ - Updated stack-ui to 1.39.2
183
+
184
+ ### ❤️ Thank You
185
+
186
+ - Marie-Maxime Tanguay
187
+ - Pierre-Olivier Clerson @poclerson
188
+
189
+ ## 1.0.9 (2025-07-18)
190
+
191
+ ### 🚀 Features
192
+
193
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
194
+
195
+ ### 🩹 Fixes
196
+
197
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
198
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
199
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
200
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
201
+
202
+ ### 🧱 Updated Dependencies
203
+
204
+ - Updated stack-ui to 1.39.1
205
+
206
+ ### ❤️ Thank You
207
+
208
+ - Marie-Maxime Tanguay
209
+ - Pierre-Olivier Clerson @poclerson
210
+
211
+ ## 1.0.8 (2025-07-04)
212
+
213
+ ### 🚀 Features
214
+
215
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
216
+
217
+ ### 🩹 Fixes
218
+
219
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
220
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
221
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
222
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
223
+
224
+ ### 🧱 Updated Dependencies
225
+
226
+ - Updated stack-ui to 1.39.0
227
+
228
+ ### ❤️ Thank You
229
+
230
+ - Marie-Maxime Tanguay
231
+ - Pierre-Olivier Clerson @poclerson
232
+
233
+ ## 1.0.7 (2025-07-01)
234
+
235
+ ### 🚀 Features
236
+
237
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
238
+
239
+ ### 🩹 Fixes
240
+
241
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
242
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
243
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
244
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
245
+
246
+ ### 🧱 Updated Dependencies
247
+
248
+ - Updated stack-ui to 1.38.1
249
+
250
+ ### ❤️ Thank You
251
+
252
+ - Marie-Maxime Tanguay
253
+ - Pierre-Olivier Clerson @poclerson
254
+
255
+ ## 1.0.6 (2025-07-01)
256
+
257
+ ### 🚀 Features
258
+
259
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
260
+
261
+ ### 🩹 Fixes
262
+
263
+ - update vite-plugin-dts to version 3 ([5d33c77](https://github.com/OKAMca/stack/commit/5d33c77))
264
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
265
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
266
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
267
+
268
+ ### 🧱 Updated Dependencies
269
+
270
+ - Updated stack-ui to 1.38.0
271
+
272
+ ### ❤️ Thank You
273
+
274
+ - Marie-Maxime Tanguay
275
+ - Pierre-Olivier Clerson @poclerson
276
+
277
+ ## 1.0.5 (2025-05-26)
278
+
279
+ ### 🚀 Features
280
+
281
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
282
+
283
+ ### 🩹 Fixes
284
+
285
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
286
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
287
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
288
+
289
+ ### 🧱 Updated Dependencies
290
+
291
+ - Updated stack-ui to 1.37.0
292
+
293
+ ### ❤️ Thank You
294
+
295
+ - Marie-Maxime Tanguay
296
+
297
+ ## 1.0.4 (2025-05-26)
298
+
299
+ ### 🚀 Features
300
+
301
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
302
+
303
+ ### 🩹 Fixes
304
+
305
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
306
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
307
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
308
+
309
+ ### 🧱 Updated Dependencies
310
+
311
+ - Updated stack-ui to 1.37.0
312
+
313
+ ### ❤️ Thank You
314
+
315
+ - Marie-Maxime Tanguay
316
+
317
+ ## 1.0.3 (2025-05-22)
318
+
319
+ ### 🚀 Features
320
+
321
+ - bump ([ab924b9](https://github.com/OKAMca/stack/commit/ab924b9))
322
+
323
+ ### 🩹 Fixes
324
+
325
+ - package deps error ([b665a45](https://github.com/OKAMca/stack/commit/b665a45))
326
+ - search field type export ([5ab6070](https://github.com/OKAMca/stack/commit/5ab6070))
327
+ - search field icon ([0850fde](https://github.com/OKAMca/stack/commit/0850fde))
328
+
329
+ ### 🧱 Updated Dependencies
330
+
331
+ - Updated stack-ui to 1.37.0
332
+
333
+ ### ❤️ Thank You
334
+
335
+ - Marie-Maxime Tanguay
336
+
337
+ ## 1.0.1 (2025-05-01)
338
+
339
+ ### 🚀 Features
340
+
341
+ - **next-component:** next link wrapper component + hook ([ed654da](https://github.com/OKAMca/stack/commit/ed654da))
342
+ - add header option to select component ([0338ebc](https://github.com/OKAMca/stack/commit/0338ebc))
343
+ - bump versions to force publish ([6e3eb60](https://github.com/OKAMca/stack/commit/6e3eb60))
344
+ - project cleanup ([a5dde9d](https://github.com/OKAMca/stack/commit/a5dde9d))
345
+
346
+ ### 🩹 Fixes
347
+
348
+ - bump package ([b6259d1](https://github.com/OKAMca/stack/commit/b6259d1))
349
+ - issue with typing not resolving correctly when installing package ([bc4c81d](https://github.com/OKAMca/stack/commit/bc4c81d))
350
+
351
+ ### 🧱 Updated Dependencies
352
+
353
+ - Updated stack-ui to 1.31.0
354
+
355
+ ### ❤️ Thank You
356
+
357
+ - Marie-Maxime Tanguay @marie-maxime
358
+ - Pierre-Olivier Clerson @poclerson
359
+
360
+ ## 0.3.0 (2024-10-04)
361
+
362
+
363
+ ### 🚀 Features
364
+
365
+ - updates & cleanup packages and dependancies ([#210](https://github.com/OKAMca/stack/pull/210))
366
+
367
+
368
+ ### ❤️ Thank You
369
+
370
+ - Marie-Maxime Tanguay @marie-maxime
371
+
372
+ ## 0.2.0 (2024-08-15)
373
+
374
+
375
+ ### 🚀 Features
376
+
377
+ - directus image support for videos ([4d45c9c](https://github.com/OKAMca/stack/commit/4d45c9c))
378
+
379
+
380
+ ### ❤️ Thank You
381
+
382
+ - Jérôme Trottier
383
+ - Marie-Maxime Tanguay @marie-maxime
384
+ - mykimd
385
+ - Pierre-Olivier Clerson @poclerson
386
+ - poclerson
387
+ - Yan Morin
388
+ - yanmorinokamca @yanmorinokamca
389
+
390
+ ## 0.1.1 (2024-07-16)
391
+
392
+
393
+ ### 🩹 Fixes
394
+
395
+ - **publish:** add building packages step to workflow ([c9ce442](https://github.com/OKAMca/stack/commit/c9ce442))
396
+
397
+
398
+ ### ❤️ Thank You
399
+
400
+ - Jérôme Trottier
401
+ - Pierre-Olivier Clerson @poclerson
402
+ - yanmorinokamca @yanmorinokamca
403
+
404
+ ## 0.1.0 (2024-06-28)
405
+
406
+
407
+ ### 🚀 Features
408
+
409
+ - add new libs ([#71](https://github.com/OKAMca/stack/pull/71))
410
+
411
+
412
+ ### 🩹 Fixes
413
+
414
+ - publishing for new libs ([#125](https://github.com/OKAMca/stack/pull/125))
415
+
416
+
417
+ ### ❤️ Thank You
418
+
419
+ - 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.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -30,15 +30,11 @@
30
30
  "url": "https://github.com/OKAMca/stack.git"
31
31
  },
32
32
  "dependencies": {
33
- "@okam/stack-ui": "1.42.3",
33
+ "@okam/stack-ui": "1.42.4",
34
34
  "next": "^14.1.1",
35
35
  "react": "18.3.1",
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