@okam/next-component 2.0.2 → 2.1.0

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/hooks/useLink/interface.d.ts +4 -1
  3. package/{providers/DraftMode/index.mjs → index-Ber8Ecgv.mjs} +2 -3
  4. package/{providers/DraftMode/index.js → index-DV6W6v68.js} +0 -2
  5. package/index.js +590 -18
  6. package/index.mjs +587 -15
  7. package/package.json +3 -4
  8. package/server.js +31 -7
  9. package/server.mjs +30 -6
  10. package/components/AdminBar/index.js +0 -14
  11. package/components/AdminBar/index.mjs +0 -15
  12. package/components/Filter/index.js +0 -54
  13. package/components/Filter/index.mjs +0 -55
  14. package/components/Img/index.js +0 -29
  15. package/components/Img/index.mjs +0 -30
  16. package/components/Link/index.js +0 -39
  17. package/components/Link/index.mjs +0 -40
  18. package/hooks/useFilterState/index.js +0 -50
  19. package/hooks/useFilterState/index.mjs +0 -50
  20. package/hooks/useHash/index.js +0 -25
  21. package/hooks/useHash/index.mjs +0 -25
  22. package/hooks/useLink/index.js +0 -99
  23. package/hooks/useLink/index.mjs +0 -99
  24. package/lib/createServerContext/index.js +0 -12
  25. package/lib/createServerContext/index.mjs +0 -12
  26. package/providers/AdminBar/index.js +0 -17
  27. package/providers/AdminBar/index.mjs +0 -17
  28. package/providers/DraftMode/server.js +0 -10
  29. package/providers/DraftMode/server.mjs +0 -11
  30. package/theme/AdminBar/index.js +0 -120
  31. package/theme/AdminBar/index.mjs +0 -120
  32. package/theme/Button/index.js +0 -75
  33. package/theme/Button/index.mjs +0 -76
  34. package/theme/Filter/index.js +0 -72
  35. package/theme/Filter/index.mjs +0 -73
  36. package/theme/Typography/index.js +0 -43
  37. package/theme/Typography/index.mjs +0 -44
  38. package/theme/index.js +0 -16
  39. package/theme/index.mjs +0 -17
package/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ ## 2.1.0 (2026-03-26)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **next-component:** deprecate onPathnameChange in favor of onNavigate ([#445](https://github.com/OKAMca/stack/pull/445))
6
+ * fix(next-component): keep deprecated onPathnameChange bridge
7
+ * fix(next-component): prevent prop leakage and align locale docs
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - resolve dependabot security alerts and clean up published package dependencies ([#441](https://github.com/OKAMca/stack/pull/441))
12
+ - replace use server by server-only in server chunks ([#437](https://github.com/OKAMca/stack/pull/437))
13
+
14
+ ### ❤️ Thank You
15
+
16
+ - Claude Opus 4.6 (1M context)
17
+ - GabrielAuclair7
18
+ - Marie-Maxime Tanguay @marie-maxime
19
+ - Pierre-Olivier Clerson @poclerson
20
+
21
+ ## 2.0.3 (2026-03-17)
22
+
23
+ ### 🩹 Fixes
24
+
25
+ - resolve high-severity dependabot alerts ([#429](https://github.com/OKAMca/stack/pull/429))
26
+
27
+ ### ❤️ Thank You
28
+
29
+ - Marie-Maxime Tanguay @marie-maxime
30
+
1
31
  ## 2.0.2 (2026-02-27)
2
32
 
3
33
  ### 🧱 Updated Dependencies
@@ -14,10 +14,13 @@ export interface TLink extends Omit<NextLinkProps, 'scroll' | 'as'> {
14
14
  * @default instant
15
15
  */
16
16
  behavior?: ScrollBehavior;
17
+ /**
18
+ * @deprecated Use `onNavigate` from next/link instead.
19
+ */
17
20
  onPathnameChange?: (_pathname: string) => void;
18
21
  onSearchParamsChange?: (_searchParams: ReadonlyURLSearchParams) => void;
19
22
  onHashChange?: (_hash: string) => void;
20
23
  }
21
- export interface TUseLinkReturn extends Omit<NextLinkProps, 'href'> {
24
+ export interface TUseLinkReturn extends Omit<NextLinkProps, 'href' | 'locale'> {
22
25
  href: string;
23
26
  }
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  import { jsx } from "react/jsx-runtime";
3
2
  import { createCtx } from "@okam/react-utils";
4
3
  import { useMemo } from "react";
@@ -11,6 +10,6 @@ function DraftModeContextProvider(props) {
11
10
  return /* @__PURE__ */ jsx(DraftModeProvider, { value, children });
12
11
  }
13
12
  export {
14
- DraftModeContextProvider,
15
- useDraftMode
13
+ DraftModeContextProvider as D,
14
+ useDraftMode as u
16
15
  };
@@ -1,6 +1,4 @@
1
- "use client";
2
1
  "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
2
  const jsxRuntime = require("react/jsx-runtime");
5
3
  const reactUtils = require("@okam/react-utils");
6
4
  const react = require("react");
package/index.js CHANGED
@@ -1,22 +1,594 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index$2 = require("./components/Filter/index.js");
4
- const index$3 = require("./components/Img/index.js");
5
- const index$4 = require("./components/Link/index.js");
6
- const index$6 = require("./hooks/useFilterState/index.js");
7
- const index$7 = require("./hooks/useHash/index.js");
8
- const index$8 = require("./hooks/useLink/index.js");
9
- const index = require("./providers/AdminBar/index.js");
10
- const index$1 = require("./providers/DraftMode/index.js");
11
- const index$5 = require("./theme/index.js");
12
- exports.Filter = index$2;
13
- exports.Img = index$3;
14
- exports.Link = index$4;
15
- exports.useFilterState = index$6.useFilterState;
16
- exports.useHash = index$7.useHash;
17
- exports.useLink = index$8.useLink;
18
- exports.AdminBarContextProvider = index.AdminBarContextProvider;
19
- exports.useAdminBar = index.useAdminBar;
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const stackUi = require("@okam/stack-ui");
5
+ const nuqs = require("nuqs");
6
+ const radashi = require("radashi");
7
+ const react = require("react");
8
+ const reactStately = require("react-stately");
9
+ const reactUse = require("react-use");
10
+ const Image = require("next/image");
11
+ const NextLink = require("next/link");
12
+ const navigation = require("next/navigation");
13
+ const reactAria = require("react-aria");
14
+ const reactUtils = require("@okam/react-utils");
15
+ const index$1 = require("./index-DV6W6v68.js");
16
+ const tailwindVariants = require("tailwind-variants");
17
+ function useFilterState(props) {
18
+ const {
19
+ id,
20
+ defaultSelectedKeys: defaultSelectedKeysProp = [],
21
+ onSelectionChange,
22
+ selectionMode = "multiple",
23
+ parser = nuqs.parseAsArrayOf(nuqs.parseAsString),
24
+ children,
25
+ items,
26
+ options,
27
+ ...rest
28
+ } = props;
29
+ const defaultValue = Array.from(defaultSelectedKeysProp).map((key) => key.toString());
30
+ const queryStateOptions = react.useMemo(
31
+ () => parser.withOptions(options ?? {}).withDefault(defaultValue),
32
+ [parser, options, defaultValue]
33
+ );
34
+ const [selectedKeys, setSelectedKeys] = nuqs.useQueryState(id, queryStateOptions);
35
+ const onSelectedKeysChange = (keys) => {
36
+ onSelectionChange?.(keys);
37
+ const stringKeys = Array.from(keys).map((key) => key.toString());
38
+ void setSelectedKeys(stringKeys);
39
+ };
40
+ const defaultSelectedKeys = /* @__PURE__ */ new Set([...defaultSelectedKeysProp, ...selectedKeys ?? []]);
41
+ const state = reactStately.useListState({
42
+ ...rest,
43
+ children,
44
+ items,
45
+ selectionMode,
46
+ defaultSelectedKeys,
47
+ onSelectionChange: onSelectedKeysChange
48
+ });
49
+ reactUse.useUpdateEffect(() => {
50
+ const next = [...state.selectionManager.selectedKeys].map(String);
51
+ if (radashi.isEqual(next, selectedKeys)) {
52
+ return;
53
+ }
54
+ void setSelectedKeys(next);
55
+ }, [state.selectionManager.selectedKeys]);
56
+ return { ...state, onSelectionChange: onSelectedKeysChange, selectedKeys: selectedKeys ?? void 0, defaultSelectedKeys };
57
+ }
58
+ function Filter(props) {
59
+ const {
60
+ // TagGroup-specific props
61
+ children,
62
+ items,
63
+ defaultSelectedKeys,
64
+ selectedKeys,
65
+ selectionBehavior,
66
+ selectionMode = "multiple",
67
+ options,
68
+ description,
69
+ disabledKeys,
70
+ disallowEmptySelection,
71
+ errorMessage,
72
+ onRemove,
73
+ onSelectionChange,
74
+ // Common props
75
+ themeName = "filter",
76
+ tokens,
77
+ customTheme,
78
+ // PopoverButton props with defaults
79
+ type = "dialog",
80
+ placement = "bottom",
81
+ // Remaining PopoverButton props
82
+ ...popoverButtonProps
83
+ } = props;
84
+ const tagGroupProps = {
85
+ items,
86
+ selectionBehavior,
87
+ selectionMode,
88
+ description,
89
+ disallowEmptySelection,
90
+ errorMessage,
91
+ onRemove
92
+ };
93
+ const state = useFilterState({ ...props, selectionMode });
94
+ return /* @__PURE__ */ jsxRuntime.jsx(stackUi.Box, { themeName: `${themeName}.wrapper`, tokens, customTheme, children: /* @__PURE__ */ jsxRuntime.jsx(
95
+ stackUi.PopoverButton,
96
+ {
97
+ themeName: `${themeName}.popover`,
98
+ tokens,
99
+ type,
100
+ placement,
101
+ ...popoverButtonProps,
102
+ children: /* @__PURE__ */ jsxRuntime.jsx(stackUi.TagGroup, { themeName: `${themeName}.tagGroup`, tokens, ...tagGroupProps, ...state, children })
103
+ }
104
+ ) });
105
+ }
106
+ function Img(props) {
107
+ const { src, width, height, themeName = "img", tokens, customTheme, ...rest } = props;
108
+ const theme = stackUi.useThemeContext(themeName, tokens, customTheme);
109
+ if (typeof src === "object") {
110
+ const { blurWidth, blurHeight, width: srcWidth, height: srcHeight, ...withoutBlurDimensions } = src;
111
+ const blur = {
112
+ blurwidth: blurWidth,
113
+ blurheight: blurHeight
114
+ };
115
+ return /* @__PURE__ */ jsxRuntime.jsx(
116
+ Image,
117
+ {
118
+ className: theme,
119
+ ...withoutBlurDimensions,
120
+ ...rest,
121
+ ...blur,
122
+ width: srcWidth ?? width,
123
+ height: srcHeight ?? height
124
+ }
125
+ );
126
+ }
127
+ return /* @__PURE__ */ jsxRuntime.jsx(Image, { width, height, className: theme, src, ...rest });
128
+ }
129
+ function getHash() {
130
+ if (typeof window === "undefined")
131
+ return "";
132
+ return window.location.hash;
133
+ }
134
+ function useHash() {
135
+ const defaultHash = getHash();
136
+ const [hash, setHash] = react.useState(defaultHash);
137
+ const handleHashChangeEvent = ({ newURL }) => {
138
+ if (!URL.canParse(newURL))
139
+ return;
140
+ const { hash: newHash } = new URL(newURL);
141
+ if (!newHash || newHash === hash)
142
+ return;
143
+ setHash(newHash);
144
+ };
145
+ reactUse.useEvent("hashchange", handleHashChangeEvent);
146
+ return hash;
147
+ }
148
+ function scrollToTop(behavior) {
149
+ window?.scrollTo?.({ top: 0, behavior });
150
+ }
151
+ function getParamsLocale(params) {
152
+ const { locale } = params ?? {};
153
+ if (Array.isArray(locale))
154
+ return locale[0];
155
+ return locale;
156
+ }
157
+ function useLinkLocale(props) {
158
+ const { locale } = props;
159
+ const params = navigation.useParams();
160
+ const paramsLocale = getParamsLocale(params);
161
+ const { locale: ctxLocale } = reactAria.useLocale();
162
+ return locale ?? ctxLocale ?? paramsLocale ?? false;
163
+ }
164
+ function localizeHref(href, locale) {
165
+ const hrefString = href.toString();
166
+ const isAnchor = hrefString.startsWith("#");
167
+ const isExternal = /^[a-z]+:\/\//i.test(hrefString) || hrefString.startsWith("//");
168
+ if (isExternal || isAnchor)
169
+ return hrefString;
170
+ if (locale != null && locale !== false) {
171
+ return `/${locale}${hrefString}`;
172
+ }
173
+ return hrefString;
174
+ }
175
+ function useLink(props) {
176
+ const {
177
+ scroll = true,
178
+ onMouseEnter,
179
+ onTouchStart,
180
+ onClick,
181
+ onNavigate,
182
+ onPathnameChange,
183
+ onHashChange,
184
+ onSearchParamsChange,
185
+ href,
186
+ urlDecorator,
187
+ replace,
188
+ prefetch,
189
+ shallow,
190
+ passHref,
191
+ legacyBehavior,
192
+ behavior = "instant"
193
+ } = props;
194
+ const locale = useLinkLocale(props);
195
+ const localizedHref = localizeHref(href, locale);
196
+ const pathname = navigation.usePathname();
197
+ const searchParams = navigation.useSearchParams();
198
+ const hash = useHash();
199
+ const hasWarnedOnPathnameChangeRef = react.useRef(false);
200
+ const isNextScroll = typeof scroll === "boolean";
201
+ const nextScroll = isNextScroll ? scroll : false;
202
+ const handleScroll = react.useCallback(() => {
203
+ if (isNextScroll)
204
+ return;
205
+ scrollToTop(behavior);
206
+ }, [behavior, isNextScroll]);
207
+ const handleClick = (event) => {
208
+ onClick?.(event);
209
+ handleScroll();
210
+ };
211
+ const handleTouchStart = (event) => {
212
+ onTouchStart?.(event);
213
+ handleScroll();
214
+ };
215
+ react.useEffect(() => {
216
+ if (process.env.NODE_ENV === "production" || onPathnameChange == null || hasWarnedOnPathnameChangeRef.current)
217
+ return;
218
+ console.warn("[next-component/Link] `onPathnameChange` is deprecated and will be removed in the next major version. Use `onNavigate` from next/link instead.");
219
+ hasWarnedOnPathnameChangeRef.current = true;
220
+ }, [onPathnameChange]);
221
+ react.useEffect(() => {
222
+ onPathnameChange?.(pathname);
223
+ }, [onPathnameChange, pathname]);
224
+ react.useEffect(() => {
225
+ onSearchParamsChange?.(searchParams);
226
+ }, [onSearchParamsChange, searchParams]);
227
+ react.useEffect(() => {
228
+ onHashChange?.(hash);
229
+ }, [onHashChange, hash]);
230
+ return {
231
+ href: localizedHref.toString(),
232
+ as: urlDecorator,
233
+ replace,
234
+ prefetch,
235
+ shallow,
236
+ onClick: handleClick,
237
+ onNavigate,
238
+ onTouchStart: handleTouchStart,
239
+ onMouseEnter,
240
+ scroll: nextScroll,
241
+ passHref,
242
+ legacyBehavior
243
+ };
244
+ }
245
+ function Link({ ref, ...props }) {
246
+ const {
247
+ themeName = "link",
248
+ tokens,
249
+ customTheme,
250
+ as = NextLink,
251
+ children,
252
+ locale,
253
+ scroll,
254
+ onPathnameChange,
255
+ onSearchParamsChange,
256
+ onHashChange,
257
+ behavior,
258
+ urlDecorator: urlDecoratorProp,
259
+ href: hrefProp,
260
+ ...rest
261
+ } = props;
262
+ const linkProps = useLink(props);
263
+ return /* @__PURE__ */ jsxRuntime.jsx(
264
+ stackUi.Anchor,
265
+ {
266
+ ref,
267
+ ...rest,
268
+ nextLinkProps: linkProps,
269
+ as,
270
+ themeName,
271
+ tokens,
272
+ customTheme,
273
+ children
274
+ }
275
+ );
276
+ }
277
+ Link.displayName = "Link";
278
+ const adminBarCtx = reactUtils.createCtx();
279
+ const useAdminBar = adminBarCtx[0];
280
+ const AdminBarProvider = adminBarCtx[1];
281
+ function AdminBarContextProvider(props) {
282
+ const { children } = props;
283
+ const [error, setError] = react.useState();
284
+ const value = react.useMemo(() => ({ error, setError }), [error]);
285
+ return /* @__PURE__ */ jsxRuntime.jsx(AdminBarProvider, { value, children });
286
+ }
287
+ const adminBarContainer = tailwindVariants.tv({
288
+ base: "w-full bg-gray-100 py-2 px-4 border-gray-200 fixed left-0 right-0 z-50",
289
+ variants: {
290
+ position: {
291
+ top: "top-0 border-b",
292
+ bottom: "bottom-0 border-t"
293
+ },
294
+ fullWidth: {
295
+ true: "max-w-full"
296
+ },
297
+ background: {
298
+ grey: "bg-gray-100",
299
+ dark: "bg-gray-800 text-white",
300
+ light: "bg-white"
301
+ },
302
+ padding: {
303
+ small: "py-1 px-2",
304
+ medium: "py-2 px-4",
305
+ large: "py-3 px-6"
306
+ }
307
+ },
308
+ defaultVariants: {
309
+ position: "top",
310
+ background: "grey",
311
+ padding: "medium"
312
+ }
313
+ });
314
+ const adminBarContent = tailwindVariants.tv({
315
+ base: "flex items-center",
316
+ variants: {
317
+ justify: {
318
+ start: "justify-start",
319
+ center: "justify-center",
320
+ end: "justify-end",
321
+ between: "justify-between",
322
+ around: "justify-around",
323
+ evenly: "justify-evenly"
324
+ },
325
+ gap: {
326
+ small: "gap-2",
327
+ medium: "gap-4",
328
+ large: "gap-6"
329
+ },
330
+ wrap: {
331
+ true: "flex-wrap",
332
+ false: "flex-nowrap"
333
+ }
334
+ },
335
+ defaultVariants: {
336
+ justify: "between",
337
+ gap: "medium",
338
+ wrap: false
339
+ }
340
+ });
341
+ const adminBarButton = tailwindVariants.tv({
342
+ base: "px-3 py-1 rounded text-sm font-medium transition-colors",
343
+ variants: {
344
+ variant: {
345
+ primary: "bg-blue-600 text-white hover:bg-blue-700",
346
+ secondary: "bg-gray-200 text-gray-800 hover:bg-gray-300",
347
+ danger: "bg-red-600 text-white hover:bg-red-700"
348
+ },
349
+ size: {
350
+ small: "text-xs px-2 py-0.5",
351
+ medium: "text-sm px-3 py-1",
352
+ large: "text-base px-4 py-2"
353
+ }
354
+ },
355
+ defaultVariants: {
356
+ variant: "secondary",
357
+ size: "medium"
358
+ }
359
+ });
360
+ const adminBarError = tailwindVariants.tv({
361
+ base: "flex items-center justify-center bg-red-50 text-red-700 px-3 py-1 rounded-md text-sm",
362
+ variants: {
363
+ severity: {
364
+ low: "bg-yellow-50 text-yellow-700",
365
+ medium: "bg-red-50 text-red-700",
366
+ high: "bg-red-100 text-red-800 font-bold"
367
+ },
368
+ hasBorder: {
369
+ true: "border border-red-300",
370
+ false: ""
371
+ }
372
+ },
373
+ defaultVariants: {
374
+ severity: "medium",
375
+ hasBorder: true
376
+ }
377
+ });
378
+ const adminBarErrorTypography = tailwindVariants.tv({
379
+ base: "text-red-700 text-sm font-medium",
380
+ variants: {
381
+ severity: {
382
+ low: "text-yellow-700",
383
+ medium: "text-red-700",
384
+ high: "text-red-800 font-bold"
385
+ }
386
+ },
387
+ defaultVariants: {
388
+ severity: "medium"
389
+ }
390
+ });
391
+ const adminBarTheme = {
392
+ container: adminBarContainer,
393
+ content: adminBarContent,
394
+ button: adminBarButton,
395
+ error: adminBarError,
396
+ errorTypography: adminBarErrorTypography
397
+ };
398
+ const button = tailwindVariants.tv({
399
+ base: `
400
+ flex
401
+ items-center
402
+ justify-center
403
+ gap-4
404
+ transition
405
+ duration-300
406
+ ease-in-out
407
+ disabled:pointer-events-none
408
+ disabled:opacity-30
409
+ focus-ring-black
410
+ `,
411
+ defaultVariants: {
412
+ buttonStyle: "default",
413
+ type: "button",
414
+ size: "default",
415
+ shape: "rounded"
416
+ },
417
+ variants: {
418
+ type: {
419
+ button: "",
420
+ menu: "text-2xl"
421
+ },
422
+ buttonStyle: {
423
+ default: `
424
+ px-4
425
+ py-2
426
+ text-white
427
+ !bg-color-1-500
428
+ hover:!bg-color-1-400
429
+ active:!bg-color-1-400
430
+ `,
431
+ outline: `
432
+ px-4
433
+ py-2
434
+ bg-transparent
435
+ !border-color-1-500
436
+ border-2
437
+ text-color-1-500
438
+ hover:bg-color-1-500
439
+ hover:text-white
440
+ active:bg-color-1-500
441
+ active:text-white
442
+ `,
443
+ hollow: `
444
+ px-2
445
+ bg-transparent
446
+ text-color-1-500
447
+ hover:border-b-color-1-500
448
+ active:border-b-color-1-500
449
+ focus:border-b-color-1-500
450
+ `
451
+ },
452
+ intent: {
453
+ error: `
454
+ !bg-error
455
+ text-white
456
+ pointer-events-none
457
+ !border-error
458
+ `
459
+ },
460
+ size: {
461
+ default: `min-w-12 min-h-6`,
462
+ large: `min-w-36 min-h-18`
463
+ },
464
+ shape: {
465
+ rounded: `rounded-md`,
466
+ circular: `rounded-full`
467
+ }
468
+ }
469
+ });
470
+ const typography = tailwindVariants.tv({
471
+ variants: {
472
+ size: {
473
+ h1: `text-5xl`,
474
+ h2: `text-4xl`,
475
+ h3: `text-3xl`,
476
+ h4: `text-2xl`,
477
+ h5: `text-xl`,
478
+ h6: `text-lg`,
479
+ leading: `text-md font-bold leading-normal`,
480
+ paragraph: `text-md inline`,
481
+ footnotes: `text-sm`,
482
+ xs: `text-xs`
483
+ },
484
+ font: {
485
+ body: `font-body`
486
+ },
487
+ weight: {
488
+ normal: `font-normal`,
489
+ light: `font-light`,
490
+ bold: "font-bold"
491
+ },
492
+ color: {
493
+ gray: `text-gray-500`,
494
+ white: `text-white`
495
+ },
496
+ isError: {
497
+ true: "text-sm text-error py-3"
498
+ },
499
+ align: {
500
+ center: "text-center",
501
+ left: "text-left",
502
+ right: "text-right"
503
+ }
504
+ },
505
+ defaultVariants: {
506
+ size: "paragraph",
507
+ font: "body"
508
+ }
509
+ });
510
+ const filterTagGroupWrapper = tailwindVariants.tv({
511
+ base: "w-full flex flex-col gap-2"
512
+ });
513
+ const filterTagGroupTags = tailwindVariants.tv({
514
+ base: "flex flex-col gap-2 max-w-[150px] items-center mx-auto"
515
+ });
516
+ const filterTagGroupLabel = tailwindVariants.tv({
517
+ extend: typography,
518
+ defaultVariants: { size: "h4" }
519
+ });
520
+ const filterTagGroupDescription = tailwindVariants.tv({
521
+ extend: typography,
522
+ base: "block",
523
+ defaultVariants: { size: "footnotes" }
524
+ });
525
+ const filterTagGroupErrorMessage = tailwindVariants.tv({
526
+ extend: typography,
527
+ base: "block",
528
+ defaultVariants: { isError: true }
529
+ });
530
+ const filterTagGroupTagWrapper = tailwindVariants.tv({
531
+ base: [
532
+ button({ buttonStyle: "outline" }),
533
+ `
534
+ focus-visible:outline
535
+ focus-visible:outline-offset-2
536
+ focus-visible:outline-2
537
+ focus-visible:outline-black
538
+ `
539
+ ],
540
+ variants: {
541
+ isSelected: {
542
+ true: [button({ buttonStyle: "default" })]
543
+ },
544
+ isDisabled: {
545
+ true: "pointer-events-none opacity-30"
546
+ }
547
+ }
548
+ });
549
+ const filterTagGroupTagContainer = tailwindVariants.tv({
550
+ extend: typography,
551
+ base: "flex items-center justify-center"
552
+ });
553
+ const filterPopoverButton = tailwindVariants.tv({
554
+ extend: button,
555
+ base: "!min-w-[200px]"
556
+ });
557
+ const filterPopoverPopover = tailwindVariants.tv({
558
+ base: "w-[var(--filter-popover-container-width)] bg-gray-300 rounded-md p-4"
559
+ });
560
+ const filterTheme = {
561
+ popover: {
562
+ button: filterPopoverButton,
563
+ popover: filterPopoverPopover
564
+ },
565
+ tagGroup: {
566
+ wrapper: filterTagGroupWrapper,
567
+ tags: filterTagGroupTags,
568
+ label: filterTagGroupLabel,
569
+ description: filterTagGroupDescription,
570
+ errorMessage: filterTagGroupErrorMessage,
571
+ tag: {
572
+ wrapper: filterTagGroupTagWrapper,
573
+ container: filterTagGroupTagContainer
574
+ }
575
+ }
576
+ };
577
+ const BaseTheme = stackUi.makeTheme({
578
+ filter: filterTheme,
579
+ button,
580
+ typography,
581
+ adminBar: adminBarTheme
582
+ });
583
+ const index = react.memo(stackUi.createThemeProvider(BaseTheme));
20
584
  exports.DraftModeContextProvider = index$1.DraftModeContextProvider;
21
585
  exports.useDraftMode = index$1.useDraftMode;
22
- exports.ThemeProvider = index$5;
586
+ exports.AdminBarContextProvider = AdminBarContextProvider;
587
+ exports.Filter = Filter;
588
+ exports.Img = Img;
589
+ exports.Link = Link;
590
+ exports.ThemeProvider = index;
591
+ exports.useAdminBar = useAdminBar;
592
+ exports.useFilterState = useFilterState;
593
+ exports.useHash = useHash;
594
+ exports.useLink = useLink;