@fanvue/ui 3.23.0 → 3.25.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 (113) hide show
  1. package/dist/charts.d.ts +94 -4
  2. package/dist/charts.mjs +4 -0
  3. package/dist/charts.mjs.map +1 -1
  4. package/dist/cjs/charts.cjs +4 -0
  5. package/dist/cjs/charts.cjs.map +1 -1
  6. package/dist/cjs/components/AiButton/AiButton.cjs +170 -0
  7. package/dist/cjs/components/AiButton/AiButton.cjs.map +1 -0
  8. package/dist/cjs/components/AnimatedNumber/AnimatedNumber.cjs +170 -0
  9. package/dist/cjs/components/AnimatedNumber/AnimatedNumber.cjs.map +1 -0
  10. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs +24 -2
  11. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs.map +1 -1
  12. package/dist/cjs/components/Chart/ChartMetricTrend.cjs +71 -0
  13. package/dist/cjs/components/Chart/ChartMetricTrend.cjs.map +1 -0
  14. package/dist/cjs/components/Chart/ChartSkeleton.cjs +95 -0
  15. package/dist/cjs/components/Chart/ChartSkeleton.cjs.map +1 -0
  16. package/dist/cjs/components/Chip/Chip.cjs +40 -11
  17. package/dist/cjs/components/Chip/Chip.cjs.map +1 -1
  18. package/dist/cjs/components/CountryFlag/CountryFlag.cjs +91 -0
  19. package/dist/cjs/components/CountryFlag/CountryFlag.cjs.map +1 -0
  20. package/dist/cjs/components/CountryFlag/flagShapes.cjs +3358 -0
  21. package/dist/cjs/components/CountryFlag/flagShapes.cjs.map +1 -0
  22. package/dist/cjs/components/CyclingText/CyclingText.cjs +9 -26
  23. package/dist/cjs/components/CyclingText/CyclingText.cjs.map +1 -1
  24. package/dist/cjs/components/CyclingText/useCyclingMotion.cjs +53 -0
  25. package/dist/cjs/components/CyclingText/useCyclingMotion.cjs.map +1 -0
  26. package/dist/cjs/components/Demographics/Demographics.cjs +39 -0
  27. package/dist/cjs/components/Demographics/Demographics.cjs.map +1 -0
  28. package/dist/cjs/components/Drawer/Drawer.cjs +9 -1
  29. package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
  30. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +115 -16
  31. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
  32. package/dist/cjs/components/IconButton/IconButton.cjs +11 -1
  33. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  34. package/dist/cjs/components/ProgressBar/ProgressBar.cjs +9 -1
  35. package/dist/cjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
  36. package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs +14 -4
  37. package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  38. package/dist/cjs/components/Tabs/TabsList.cjs +123 -91
  39. package/dist/cjs/components/Tabs/TabsList.cjs.map +1 -1
  40. package/dist/cjs/components/Tooltip/Tooltip.cjs +36 -25
  41. package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  42. package/dist/cjs/components/Tooltip/TooltipLabel.cjs +71 -0
  43. package/dist/cjs/components/Tooltip/TooltipLabel.cjs.map +1 -0
  44. package/dist/cjs/components/TrendPill/TrendPill.cjs +46 -0
  45. package/dist/cjs/components/TrendPill/TrendPill.cjs.map +1 -0
  46. package/dist/cjs/components/UserItem/UserItem.cjs +7 -2
  47. package/dist/cjs/components/UserItem/UserItem.cjs.map +1 -1
  48. package/dist/cjs/components/UserItem/UserItemTrailing.cjs +34 -0
  49. package/dist/cjs/components/UserItem/UserItemTrailing.cjs.map +1 -0
  50. package/dist/cjs/flags.cjs +6 -0
  51. package/dist/cjs/flags.cjs.map +1 -0
  52. package/dist/cjs/index.cjs +13 -0
  53. package/dist/cjs/index.cjs.map +1 -1
  54. package/dist/cjs/{components/CyclingText → utils}/usePrefersReducedMotion.cjs +14 -14
  55. package/dist/cjs/utils/usePrefersReducedMotion.cjs.map +1 -0
  56. package/dist/components/AiButton/AiButton.mjs +153 -0
  57. package/dist/components/AiButton/AiButton.mjs.map +1 -0
  58. package/dist/components/AnimatedNumber/AnimatedNumber.mjs +153 -0
  59. package/dist/components/AnimatedNumber/AnimatedNumber.mjs.map +1 -0
  60. package/dist/components/Chart/ChartLoadingOverlay.mjs +24 -2
  61. package/dist/components/Chart/ChartLoadingOverlay.mjs.map +1 -1
  62. package/dist/components/Chart/ChartMetricTrend.mjs +54 -0
  63. package/dist/components/Chart/ChartMetricTrend.mjs.map +1 -0
  64. package/dist/components/Chart/ChartSkeleton.mjs +78 -0
  65. package/dist/components/Chart/ChartSkeleton.mjs.map +1 -0
  66. package/dist/components/Chip/Chip.mjs +40 -11
  67. package/dist/components/Chip/Chip.mjs.map +1 -1
  68. package/dist/components/CountryFlag/CountryFlag.mjs +74 -0
  69. package/dist/components/CountryFlag/CountryFlag.mjs.map +1 -0
  70. package/dist/components/CountryFlag/flagShapes.mjs +3358 -0
  71. package/dist/components/CountryFlag/flagShapes.mjs.map +1 -0
  72. package/dist/components/CyclingText/CyclingText.mjs +9 -26
  73. package/dist/components/CyclingText/CyclingText.mjs.map +1 -1
  74. package/dist/components/CyclingText/useCyclingMotion.mjs +36 -0
  75. package/dist/components/CyclingText/useCyclingMotion.mjs.map +1 -0
  76. package/dist/components/Demographics/Demographics.mjs +22 -0
  77. package/dist/components/Demographics/Demographics.mjs.map +1 -0
  78. package/dist/components/Drawer/Drawer.mjs +9 -1
  79. package/dist/components/Drawer/Drawer.mjs.map +1 -1
  80. package/dist/components/DropdownMenu/DropdownMenu.mjs +115 -16
  81. package/dist/components/DropdownMenu/DropdownMenu.mjs.map +1 -1
  82. package/dist/components/IconButton/IconButton.mjs +11 -1
  83. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  84. package/dist/components/ProgressBar/ProgressBar.mjs +9 -1
  85. package/dist/components/ProgressBar/ProgressBar.mjs.map +1 -1
  86. package/dist/components/SegmentedControl/SegmentedControl.mjs +15 -5
  87. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  88. package/dist/components/Tabs/TabsList.mjs +123 -91
  89. package/dist/components/Tabs/TabsList.mjs.map +1 -1
  90. package/dist/components/Tooltip/Tooltip.mjs +37 -26
  91. package/dist/components/Tooltip/Tooltip.mjs.map +1 -1
  92. package/dist/components/Tooltip/TooltipLabel.mjs +54 -0
  93. package/dist/components/Tooltip/TooltipLabel.mjs.map +1 -0
  94. package/dist/components/TrendPill/TrendPill.mjs +29 -0
  95. package/dist/components/TrendPill/TrendPill.mjs.map +1 -0
  96. package/dist/components/UserItem/UserItem.mjs +7 -2
  97. package/dist/components/UserItem/UserItem.mjs.map +1 -1
  98. package/dist/components/UserItem/UserItemTrailing.mjs +17 -0
  99. package/dist/components/UserItem/UserItemTrailing.mjs.map +1 -0
  100. package/dist/flags.d.ts +59 -0
  101. package/dist/flags.mjs +6 -0
  102. package/dist/flags.mjs.map +1 -0
  103. package/dist/index.d.ts +406 -17
  104. package/dist/index.mjs +14 -1
  105. package/dist/index.mjs.map +1 -1
  106. package/dist/styles/base.css +166 -0
  107. package/dist/styles/theme.css +12 -0
  108. package/dist/utils/usePrefersReducedMotion.mjs +22 -0
  109. package/dist/utils/usePrefersReducedMotion.mjs.map +1 -0
  110. package/package.json +14 -3
  111. package/dist/cjs/components/CyclingText/usePrefersReducedMotion.cjs.map +0 -1
  112. package/dist/components/CyclingText/usePrefersReducedMotion.mjs +0 -22
  113. package/dist/components/CyclingText/usePrefersReducedMotion.mjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -4,7 +4,9 @@ import { Accordion } from "./components/Accordion/Accordion.mjs";
4
4
  import { AccordionContent } from "./components/Accordion/AccordionContent.mjs";
5
5
  import { AccordionItem } from "./components/Accordion/AccordionItem.mjs";
6
6
  import { AccordionTrigger } from "./components/Accordion/AccordionTrigger.mjs";
7
+ import { AiButton } from "./components/AiButton/AiButton.mjs";
7
8
  import { Alert } from "./components/Alert/Alert.mjs";
9
+ import { AnimatedNumber } from "./components/AnimatedNumber/AnimatedNumber.mjs";
8
10
  import { AudioPlayer } from "./components/AudioPlayer/AudioPlayer.mjs";
9
11
  import { AudioRecordButton } from "./components/AudioRecordButton/AudioRecordButton.mjs";
10
12
  import { AudioUpload } from "./components/AudioUpload/AudioUpload.mjs";
@@ -30,10 +32,11 @@ import { CreatorCover } from "./components/CreatorCover/CreatorCover.mjs";
30
32
  import { CreatorTile } from "./components/CreatorTile/CreatorTile.mjs";
31
33
  import { CriticalBanner } from "./components/CriticalBanner/CriticalBanner.mjs";
32
34
  import { CyclingText } from "./components/CyclingText/CyclingText.mjs";
35
+ import { Demographics } from "./components/Demographics/Demographics.mjs";
33
36
  import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger } from "./components/Dialog/Dialog.mjs";
34
37
  import { Divider } from "./components/Divider/Divider.mjs";
35
38
  import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger } from "./components/Drawer/Drawer.mjs";
36
- import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "./components/DropdownMenu/DropdownMenu.mjs";
39
+ import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "./components/DropdownMenu/DropdownMenu.mjs";
37
40
  import { EmptyState } from "./components/EmptyState/EmptyState.mjs";
38
41
  import { FanFollowerCount } from "./components/FanFollowerCount/FanFollowerCount.mjs";
39
42
  import { FloatingActionButton } from "./components/FloatingActionButton/FloatingActionButton.mjs";
@@ -250,9 +253,12 @@ import { TextArea } from "./components/TextArea/TextArea.mjs";
250
253
  import { TextField } from "./components/TextField/TextField.mjs";
251
254
  import { Toast, ToastProvider, ToastViewport } from "./components/Toast/Toast.mjs";
252
255
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/Tooltip/Tooltip.mjs";
256
+ import { TooltipLabel } from "./components/Tooltip/TooltipLabel.mjs";
257
+ import { TrendPill } from "./components/TrendPill/TrendPill.mjs";
253
258
  import { UserDisplayName } from "./components/UserDisplayName/UserDisplayName.mjs";
254
259
  import { UserHandle } from "./components/UserHandle/UserHandle.mjs";
255
260
  import { UserItem } from "./components/UserItem/UserItem.mjs";
261
+ import { UserItemTrailing } from "./components/UserItem/UserItemTrailing.mjs";
256
262
  import { VoiceNote } from "./components/VoiceNote/VoiceNote.mjs";
257
263
  import { cn } from "./utils/cn.mjs";
258
264
  import { getInitials } from "./utils/getInitials.mjs";
@@ -268,8 +274,10 @@ export {
268
274
  AccordionTrigger,
269
275
  AddIcon,
270
276
  AffiliatesIcon,
277
+ AiButton,
271
278
  Alert,
272
279
  AlertIcon,
280
+ AnimatedNumber,
273
281
  AppsIcon,
274
282
  ArrowDownIcon,
275
283
  ArrowLeftIcon,
@@ -344,6 +352,7 @@ export {
344
352
  CrossIcon,
345
353
  CrownIcon,
346
354
  CyclingText,
355
+ Demographics,
347
356
  DenseGridViewIcon,
348
357
  Dialog,
349
358
  DialogBody,
@@ -372,6 +381,7 @@ export {
372
381
  DrawerTitle,
373
382
  DrawerTrigger,
374
383
  DropdownMenu,
384
+ DropdownMenuCheckboxItem,
375
385
  DropdownMenuContent,
376
386
  DropdownMenuGroup,
377
387
  DropdownMenuHeader,
@@ -552,11 +562,13 @@ export {
552
562
  ToolsIcon,
553
563
  Tooltip,
554
564
  TooltipContent,
565
+ TooltipLabel,
555
566
  TooltipProvider,
556
567
  TooltipTrigger,
557
568
  TranscationArrowIcon,
558
569
  TrashBinIcon,
559
570
  TrashIcon,
571
+ TrendPill,
560
572
  TrophyIcon,
561
573
  TwitterIcon,
562
574
  UploadCloudIcon,
@@ -569,6 +581,7 @@ export {
569
581
  UserHandle,
570
582
  UserIcon,
571
583
  UserItem,
584
+ UserItemTrailing,
572
585
  UserMenuIcon,
573
586
  UsersIcon,
574
587
  VaultIcon,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -110,6 +110,172 @@
110
110
  }
111
111
  }
112
112
 
113
+ /*
114
+ * AiButton. Each letter runs `fv-ai-letter` on a staggered delay set inline from
115
+ * its index, which is what produces the left-to-right sweep — the alternative,
116
+ * a fixed set of :nth-child delays, silently stops staggering past whatever
117
+ * length the rules were written for.
118
+ */
119
+ @keyframes fv-ai-letter {
120
+ 50% {
121
+ color: var(--color-content-primary);
122
+ text-shadow: 0 0 6px var(--color-content-always-white);
123
+ }
124
+ }
125
+
126
+ @keyframes fv-ai-flicker {
127
+ 50% {
128
+ opacity: 0.45;
129
+ }
130
+ }
131
+
132
+ @keyframes fv-ai-letter-focus {
133
+ 0%,
134
+ 100% {
135
+ transform: scale(1);
136
+ filter: blur(0);
137
+ }
138
+ 50% {
139
+ transform: scale(1.6);
140
+ filter: blur(6px) brightness(150%)
141
+ drop-shadow(-12px 4px 8px var(--color-content-always-white));
142
+ }
143
+ }
144
+
145
+ /*
146
+ * Registering the property is what makes it animatable: an unregistered custom
147
+ * property is just a token string to the engine, so it would jump between values
148
+ * and the sheen would snap to centre on pointer-out instead of gliding there.
149
+ * Browsers without @property degrade to exactly that snap, which is the old
150
+ * behaviour rather than a broken one.
151
+ */
152
+ @property --fv-ai-x {
153
+ syntax: "<percentage>";
154
+ inherits: false;
155
+ initial-value: 50%;
156
+ }
157
+
158
+ /*
159
+ * AiButton surface. The lit rim and the sheen are pseudo-elements rather than
160
+ * box-shadows on the button so they can be masked and brightened independently
161
+ * of the border, which is what gives the control its "powered on" feel.
162
+ */
163
+ @utility fv-ai-button {
164
+ position: relative;
165
+
166
+ /*
167
+ * Horizontal centre of the sheen, as a percentage of the button's width. The
168
+ * component rewrites this inline on pointer move so the glow tracks the cursor;
169
+ * the default keeps it centred for keyboard focus and touch, where there is no
170
+ * pointer position to follow.
171
+ */
172
+ --fv-ai-x: 50%;
173
+
174
+ /*
175
+ * Rim just outside the border: unlit at rest, catching green as it lifts. It
176
+ * carries only inset glow — the 1px light/dark bevel pair it used to also draw
177
+ * read as a second outline ringing the button 3px out from its actual border.
178
+ */
179
+ &::before {
180
+ content: "";
181
+ position: absolute;
182
+ inset: -3px;
183
+ z-index: -1;
184
+ border-radius: inherit;
185
+ pointer-events: none;
186
+ transition: box-shadow 400ms ease-out;
187
+ box-shadow:
188
+ 0 -8px 8px -6px transparent inset,
189
+ 0 -16px 16px -8px transparent inset;
190
+ }
191
+
192
+ /*
193
+ * Sheen rising from the bottom edge, masked so it fades before the top. It is a
194
+ * radial pool anchored to the bottom and centred on `--fv-ai-x` rather than a
195
+ * flat linear wash, so it reads as light cast from wherever the cursor is.
196
+ *
197
+ * This block is the pointer-out state, and it is where the exit is shaped: the
198
+ * pool glides back to centre while `ease-in` holds the opacity near full before
199
+ * dropping it, and the filter deepens the green as it recedes. The effect is the
200
+ * light sliding away and going out, rather than blinking off wherever it stood.
201
+ */
202
+ &::after {
203
+ content: "";
204
+ position: absolute;
205
+ inset: 0;
206
+ border-radius: inherit;
207
+ pointer-events: none;
208
+ opacity: 0;
209
+ filter: brightness(150%) saturate(140%);
210
+ transition:
211
+ opacity 550ms ease-in,
212
+ filter 550ms ease-in,
213
+ --fv-ai-x 550ms ease-out;
214
+ background-image: radial-gradient(
215
+ 55% 130% at var(--fv-ai-x) 100%,
216
+ var(--color-brand-primary-default),
217
+ color-mix(in srgb, var(--color-brand-primary-default) 45%, transparent)
218
+ 35%,
219
+ transparent 70%
220
+ );
221
+ mask-image: linear-gradient(
222
+ 0deg,
223
+ var(--color-content-always-white),
224
+ transparent
225
+ );
226
+ }
227
+
228
+ &:hover::before {
229
+ box-shadow:
230
+ 0 -8px 8px -6px
231
+ color-mix(in srgb, var(--color-content-always-white) 60%, transparent)
232
+ inset,
233
+ 0 -16px 16px -8px
234
+ color-mix(in srgb, var(--color-brand-primary-default) 30%, transparent)
235
+ inset;
236
+ }
237
+
238
+ /*
239
+ * Pointer-in. `ease-out` over the same 400ms as the rim and the border, so the
240
+ * treatment lifts in as one movement and settles rather than arriving in pieces.
241
+ */
242
+ &:hover::after {
243
+ opacity: 1;
244
+ filter: none;
245
+ /* `--fv-ai-x` must not be transitioned while the pointer is over the button:
246
+ it is rewritten every move frame, and any duration here makes the glow
247
+ trail the cursor instead of sitting under it. */
248
+ transition:
249
+ opacity 400ms ease-out,
250
+ filter 400ms ease-out,
251
+ --fv-ai-x 0s;
252
+ }
253
+
254
+ &:focus-visible::after {
255
+ opacity: 0.6;
256
+ }
257
+
258
+ &:active::before {
259
+ box-shadow:
260
+ 0 -8px 12px -6px
261
+ color-mix(in srgb, var(--color-content-always-white) 66%, transparent)
262
+ inset,
263
+ 0 -16px 16px -8px
264
+ color-mix(in srgb, var(--color-brand-primary-default) 80%, transparent)
265
+ inset;
266
+ }
267
+
268
+ &:active::after {
269
+ opacity: 1;
270
+ filter: brightness(200%);
271
+ }
272
+
273
+ &:disabled::before,
274
+ &:disabled::after {
275
+ box-shadow: none;
276
+ opacity: 0;
277
+ }
278
+ }
113
279
  /*
114
280
  * Animate `height` between 0 and the panel's measured height
115
281
  * (`--radix-accordion-content-height`, which Radix sets from a getBoundingClientRect
@@ -133,6 +133,10 @@
133
133
  --color-special-chart-gray: #c6c6c6ff;
134
134
  --color-special-chart-pink: #ff59acff;
135
135
  --color-special-chart-purple: #785dffff;
136
+ --color-special-chart-yellow: #f5d90aff;
137
+ --color-special-chart-lime: #8fcb3aff;
138
+ --color-special-chart-red: #ff4d4dff;
139
+ --color-special-chart-muted-sky: #e3f3feff;
136
140
  --color-special-default: #9c27b0ff;
137
141
  --color-special-background: #fdf1ffff;
138
142
  --color-brand-primary-default: var(--primitives-color-green-500);
@@ -524,6 +528,10 @@
524
528
  --color-special-chart-gray: #c6c6c6ff;
525
529
  --color-special-chart-pink: #ff59acff;
526
530
  --color-special-chart-purple: #785dffff;
531
+ --color-special-chart-yellow: #f5d90aff;
532
+ --color-special-chart-lime: #8fcb3aff;
533
+ --color-special-chart-red: #ff4d4dff;
534
+ --color-special-chart-muted-sky: #e3f3feff;
527
535
  --color-special-default: #9c27b0ff;
528
536
  --color-special-background: #fdf1ffff;
529
537
  --color-brand-primary-default: var(--primitives-color-green-500);
@@ -738,6 +746,10 @@
738
746
  --color-special-chart-gray: #c6c6c6ff;
739
747
  --color-special-chart-pink: #ff59acff;
740
748
  --color-special-chart-purple: #785dffff;
749
+ --color-special-chart-yellow: #f5d90aff;
750
+ --color-special-chart-lime: #8fcb3aff;
751
+ --color-special-chart-red: #ff4d4dff;
752
+ --color-special-chart-muted-sky: #30506aff;
741
753
  --color-special-default: #ed81ffff;
742
754
  --color-special-background: #4f1259ff;
743
755
  --color-brand-primary-default: var(--primitives-color-green-500);
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
4
+ const isSupported = () => typeof window !== "undefined" && typeof window.matchMedia === "function";
5
+ const subscribe = (onStoreChange) => {
6
+ if (!isSupported()) {
7
+ return () => {
8
+ };
9
+ }
10
+ const mq = window.matchMedia(REDUCED_MOTION_QUERY);
11
+ mq.addEventListener("change", onStoreChange);
12
+ return () => mq.removeEventListener("change", onStoreChange);
13
+ };
14
+ const getSnapshot = () => isSupported() ? window.matchMedia(REDUCED_MOTION_QUERY).matches : false;
15
+ const getServerSnapshot = () => false;
16
+ function usePrefersReducedMotion() {
17
+ return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
18
+ }
19
+ export {
20
+ usePrefersReducedMotion
21
+ };
22
+ //# sourceMappingURL=usePrefersReducedMotion.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePrefersReducedMotion.mjs","sources":["../../src/utils/usePrefersReducedMotion.ts"],"sourcesContent":["import * as React from \"react\";\n\nconst REDUCED_MOTION_QUERY = \"(prefers-reduced-motion: reduce)\";\n\n// jsdom has no `matchMedia`, and `getSnapshot` runs during render, so an\n// unguarded call throws rather than degrades.\nconst isSupported = () => typeof window !== \"undefined\" && typeof window.matchMedia === \"function\";\n\nconst subscribe = (onStoreChange: () => void) => {\n if (!isSupported()) {\n return () => {};\n }\n const mq = window.matchMedia(REDUCED_MOTION_QUERY);\n mq.addEventListener(\"change\", onStoreChange);\n return () => mq.removeEventListener(\"change\", onStoreChange);\n};\n\nconst getSnapshot = () => (isSupported() ? window.matchMedia(REDUCED_MOTION_QUERY).matches : false);\n\nconst getServerSnapshot = () => false;\n\n/**\n * Whether the user has asked for reduced motion.\n *\n * Read during render rather than synced into state from an effect: an effect\n * returns `false` on the first render, which lets a reduced-motion user catch one\n * animated frame, and can read a stale value under concurrent rendering.\n */\nexport function usePrefersReducedMotion(): boolean {\n return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n"],"names":[],"mappings":";;AAEA,MAAM,uBAAuB;AAI7B,MAAM,cAAc,MAAM,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe;AAExF,MAAM,YAAY,CAAC,kBAA8B;AAC/C,MAAI,CAAC,eAAe;AAClB,WAAO,MAAM;AAAA,IAAC;AAAA,EAChB;AACA,QAAM,KAAK,OAAO,WAAW,oBAAoB;AACjD,KAAG,iBAAiB,UAAU,aAAa;AAC3C,SAAO,MAAM,GAAG,oBAAoB,UAAU,aAAa;AAC7D;AAEA,MAAM,cAAc,MAAO,gBAAgB,OAAO,WAAW,oBAAoB,EAAE,UAAU;AAE7F,MAAM,oBAAoB,MAAM;AASzB,SAAS,0BAAmC;AACjD,SAAO,MAAM,qBAAqB,WAAW,aAAa,iBAAiB;AAC7E;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fanvue/ui",
3
- "version": "3.23.0",
3
+ "version": "3.25.0",
4
4
  "description": "React component library built with Tailwind CSS for Fanvue ecosystem",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",
@@ -41,6 +41,16 @@
41
41
  "default": "./dist/cjs/date-picker.cjs"
42
42
  }
43
43
  },
44
+ "./flags": {
45
+ "import": {
46
+ "types": "./dist/flags.d.ts",
47
+ "default": "./dist/flags.mjs"
48
+ },
49
+ "require": {
50
+ "types": "./dist/flags.d.ts",
51
+ "default": "./dist/cjs/flags.cjs"
52
+ }
53
+ },
44
54
  "./styles/*": "./dist/styles/*"
45
55
  },
46
56
  "sideEffects": [
@@ -52,7 +62,7 @@
52
62
  "scripts": {
53
63
  "dev": "vite --host",
54
64
  "dev:watch": "vite build --watch",
55
- "build": "vite build && mkdir -p dist/styles && cp src/styles/theme.css src/styles/base.css dist/styles/",
65
+ "build": "rm -rf dist && vite build",
56
66
  "build:showcase": "vite build --config vite.showcase.config.ts",
57
67
  "preview": "vite preview",
58
68
  "test": "vitest run",
@@ -63,6 +73,7 @@
63
73
  "typecheck": "tsc --noEmit",
64
74
  "lint": "biome check .",
65
75
  "lint:fix": "biome check --write .",
76
+ "flags:generate": "node scripts/generate-flags.mjs",
66
77
  "format": "biome format --write .",
67
78
  "storybook": "storybook dev -p 6006",
68
79
  "size-limit": "size-limit",
@@ -166,7 +177,7 @@
166
177
  "minimatch": ">=10.2.3",
167
178
  "ajv": ">=8.18.0",
168
179
  "fast-uri": ">=3.1.4",
169
- "brace-expansion": ">=5.0.8",
180
+ "brace-expansion": ">=5.0.9",
170
181
  "yaml": ">=2.8.3",
171
182
  "postcss": ">=8.5.18",
172
183
  "tmp": ">=0.2.7",
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePrefersReducedMotion.cjs","sources":["../../../../src/components/CyclingText/usePrefersReducedMotion.ts"],"sourcesContent":["import * as React from \"react\";\n\nexport function usePrefersReducedMotion(): boolean {\n const [reduced, setReduced] = React.useState(false);\n\n React.useEffect(() => {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return;\n }\n const mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const sync = () => {\n setReduced(mq.matches);\n };\n sync();\n mq.addEventListener(\"change\", sync);\n return () => mq.removeEventListener(\"change\", sync);\n }, []);\n\n return reduced;\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEO,SAAS,0BAAmC;AACjD,QAAM,CAAC,SAAS,UAAU,IAAIA,iBAAM,SAAS,KAAK;AAElDA,mBAAM,UAAU,MAAM;AACpB,QAAI,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,YAAY;AAC5E;AAAA,IACF;AACA,UAAM,KAAK,OAAO,WAAW,kCAAkC;AAC/D,UAAM,OAAO,MAAM;AACjB,iBAAW,GAAG,OAAO;AAAA,IACvB;AACA,SAAA;AACA,OAAG,iBAAiB,UAAU,IAAI;AAClC,WAAO,MAAM,GAAG,oBAAoB,UAAU,IAAI;AAAA,EACpD,GAAG,CAAA,CAAE;AAEL,SAAO;AACT;;"}
@@ -1,22 +0,0 @@
1
- "use client";
2
- import * as React from "react";
3
- function usePrefersReducedMotion() {
4
- const [reduced, setReduced] = React.useState(false);
5
- React.useEffect(() => {
6
- if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
7
- return;
8
- }
9
- const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
10
- const sync = () => {
11
- setReduced(mq.matches);
12
- };
13
- sync();
14
- mq.addEventListener("change", sync);
15
- return () => mq.removeEventListener("change", sync);
16
- }, []);
17
- return reduced;
18
- }
19
- export {
20
- usePrefersReducedMotion
21
- };
22
- //# sourceMappingURL=usePrefersReducedMotion.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePrefersReducedMotion.mjs","sources":["../../../src/components/CyclingText/usePrefersReducedMotion.ts"],"sourcesContent":["import * as React from \"react\";\n\nexport function usePrefersReducedMotion(): boolean {\n const [reduced, setReduced] = React.useState(false);\n\n React.useEffect(() => {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return;\n }\n const mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const sync = () => {\n setReduced(mq.matches);\n };\n sync();\n mq.addEventListener(\"change\", sync);\n return () => mq.removeEventListener(\"change\", sync);\n }, []);\n\n return reduced;\n}\n"],"names":[],"mappings":";;AAEO,SAAS,0BAAmC;AACjD,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAS,KAAK;AAElD,QAAM,UAAU,MAAM;AACpB,QAAI,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,YAAY;AAC5E;AAAA,IACF;AACA,UAAM,KAAK,OAAO,WAAW,kCAAkC;AAC/D,UAAM,OAAO,MAAM;AACjB,iBAAW,GAAG,OAAO;AAAA,IACvB;AACA,SAAA;AACA,OAAG,iBAAiB,UAAU,IAAI;AAClC,WAAO,MAAM,GAAG,oBAAoB,UAAU,IAAI;AAAA,EACpD,GAAG,CAAA,CAAE;AAEL,SAAO;AACT;"}