@preply/ds-web-lib 10.0.0 → 11.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 (303) hide show
  1. package/dist/Accordion-B0hR-tcI.js +96 -0
  2. package/dist/AlertBannerProvider-Cf7w9AOq.js +76 -0
  3. package/dist/AlertDialog-BG-diKBi.js +475 -0
  4. package/dist/Avatar-B-JdqVyg.js +66 -0
  5. package/dist/AvatarWithStatus-CD9jEqEB.js +36 -0
  6. package/dist/Badge-Dd-CLBoW.js +50 -0
  7. package/dist/Box-BJBE9KNm.js +91 -0
  8. package/dist/BubbleCounter.module-BU2S0euA.js +16 -0
  9. package/dist/Button-C35BZJZT.js +91 -0
  10. package/dist/ButtonBase-8eUyTWxX.js +215 -0
  11. package/dist/Checkbox-CtolNbxI.js +108 -0
  12. package/dist/Chips-BRGw7Uup.js +99 -0
  13. package/dist/ChipsPrimitive-Bezq7ptE.js +1179 -0
  14. package/dist/CountryFlag-DVDKHmQH.js +43 -0
  15. package/dist/Dialog.module-Db2BJAn4.js +21 -0
  16. package/dist/DialogCloseButton-DjDd9Mid.js +98 -0
  17. package/dist/DialogDescription-8zw9t6pm.js +44 -0
  18. package/dist/DialogRoot-B67oJduC.js +335 -0
  19. package/dist/DialogRootContext-Bz8RW-Mq.js +12 -0
  20. package/dist/DialogTitle-C2Nn2ys-.js +43 -0
  21. package/dist/Divider-DvwDWB9_.js +17 -0
  22. package/dist/DropdownMenu.primitives-BrsTBvMk.js +4007 -0
  23. package/dist/FieldButton-B2slox8P.js +32 -0
  24. package/dist/FormControl-qnbQL1iF.js +128 -0
  25. package/dist/Heading-DA9gHfsx.js +71 -0
  26. package/dist/Icon-CixAeOSd.js +48 -0
  27. package/dist/IconButton-BPKpgfep.js +31 -0
  28. package/dist/InputContainer-CzzuOe_p.js +38 -0
  29. package/dist/LayoutFlex-e9auDvWD.js +86 -0
  30. package/dist/LayoutFlexItem-D9ziMmHe.js +48 -0
  31. package/dist/LayoutGridItem-Q8Lnvrri.js +34 -0
  32. package/dist/Link-CdoJVeER.js +66 -0
  33. package/dist/Loader-BMOxdJce.js +26 -0
  34. package/dist/OnboardingTooltip-B47_Yrsj.js +165 -0
  35. package/dist/OnboardingTour-DUUoI5WE.js +131 -0
  36. package/dist/PasswordField-Bx5YG62t.js +93 -0
  37. package/dist/PreplyLogo-abgOre30.js +112 -0
  38. package/dist/ProgressBar-CEU4GyHn.js +31 -0
  39. package/dist/ProgressSteps-BSqopxqv.js +45 -0
  40. package/dist/Select-Bo7PX_8V.js +124 -0
  41. package/dist/Slider-Crg4DEn_.js +64 -0
  42. package/dist/Spinner-Ck8KQA22.js +86 -0
  43. package/dist/Stars-D5QspUBE.js +72 -0
  44. package/dist/Steps-DbN5vFrP.js +173 -0
  45. package/dist/Switch-Ck_xB0ID.js +49 -0
  46. package/dist/Text-CaOF75Z-.js +121 -0
  47. package/dist/TextHighlighted-Dwq9Clgn.js +34 -0
  48. package/dist/TextInline-BcA4H2Tk.js +34 -0
  49. package/dist/Toast-wJAjSLfo.js +1019 -0
  50. package/dist/TokyoUIChevronDown-DGcVqR1z.js +14 -0
  51. package/dist/Tooltip-grvKQxTN.js +84 -0
  52. package/dist/VisuallyHidden-CtcHcZCK.js +29 -0
  53. package/dist/align-self-VrZUceie.js +42 -0
  54. package/dist/assets/Accordion.css +2 -2
  55. package/dist/assets/AlertBannerProvider.css +2 -2
  56. package/dist/assets/AlertDialog.css +2 -2
  57. package/dist/assets/Avatar.css +3 -3
  58. package/dist/assets/AvatarWithStatus.css +2 -2
  59. package/dist/assets/Badge.css +1 -1
  60. package/dist/assets/Box.css +3 -3
  61. package/dist/assets/BubbleCounter.css +1 -1
  62. package/dist/assets/Button.css +4 -4
  63. package/dist/assets/ButtonBase.css +40 -46
  64. package/dist/assets/Checkbox.css +1 -1
  65. package/dist/assets/Chips.css +2 -2
  66. package/dist/assets/ChipsPrimitive.css +2 -2
  67. package/dist/assets/CountryFlag.css +1 -1
  68. package/dist/assets/Dialog.css +13 -4
  69. package/dist/assets/Divider.css +1 -1
  70. package/dist/assets/DropdownMenu.css +2 -2
  71. package/dist/assets/FieldButton.css +3 -3
  72. package/dist/assets/FormControl.css +1 -1
  73. package/dist/assets/Heading.css +3 -3
  74. package/dist/assets/Icon.css +3 -3
  75. package/dist/assets/InputContainer.css +2 -2
  76. package/dist/assets/LayoutFlex.css +1 -1
  77. package/dist/assets/LayoutFlexItem.css +1 -1
  78. package/dist/assets/Link.css +3 -3
  79. package/dist/assets/Loader.css +1 -1
  80. package/dist/assets/OnboardingTooltip.css +6 -4
  81. package/dist/assets/OnboardingTour.css +3 -2
  82. package/dist/assets/PreplyLogo.css +1 -1
  83. package/dist/assets/ProgressBar.css +1 -1
  84. package/dist/assets/ProgressSteps.css +1 -1
  85. package/dist/assets/Select.css +2 -2
  86. package/dist/assets/Slider.css +1 -1
  87. package/dist/assets/Spinner.css +3 -3
  88. package/dist/assets/Stars.css +3 -3
  89. package/dist/assets/Steps.css +2 -2
  90. package/dist/assets/Switch.css +1 -1
  91. package/dist/assets/Text.css +3 -3
  92. package/dist/assets/TextHighlighted.css +3 -3
  93. package/dist/assets/TextInline.css +3 -3
  94. package/dist/assets/Toast.css +2 -2
  95. package/dist/assets/Tooltip.css +1 -1
  96. package/dist/assets/align-self.css +1 -1
  97. package/dist/assets/{IconTile.css → components.css} +9 -1
  98. package/dist/assets/exp-color.css +2 -2
  99. package/dist/assets/index.css +1 -1
  100. package/dist/assets/layout-gap.css +3 -3
  101. package/dist/assets/layout-grid.css +3 -3
  102. package/dist/assets/layout-hide.css +1 -1
  103. package/dist/assets/layout-padding.css +3 -3
  104. package/dist/assets/layout-relative.css +1 -1
  105. package/dist/assets/text-accent.css +2 -2
  106. package/dist/assets/text-centered.css +1 -1
  107. package/dist/assets/text-weight.css +2 -2
  108. package/dist/chunk-BVTlhY3a.js +24 -0
  109. package/dist/components/Accordion/Accordion.js +4 -60
  110. package/dist/components/Accordion/hooks/useOnOpenChange.js +19 -28
  111. package/dist/components/AlertBanner/AlertBanner.js +11 -26
  112. package/dist/components/AlertBanner/AlertBannerProvider.js +3 -8
  113. package/dist/components/AlertBanner/primitives/AlertBannerAction.js +11 -69
  114. package/dist/components/AlertBanner/primitives/AlertBannerIcon.js +77 -39
  115. package/dist/components/AlertBanner/primitives/AlertBannerRoot.js +26 -22
  116. package/dist/components/AlertBanner/primitives/AlertBannerText.js +11 -70
  117. package/dist/components/AlertDialog/AlertDialog.d.ts +3 -3
  118. package/dist/components/AlertDialog/AlertDialog.d.ts.map +1 -1
  119. package/dist/components/AlertDialog/AlertDialog.js +5 -94
  120. package/dist/components/Avatar/Avatar.js +3 -71
  121. package/dist/components/AvatarWithStatus/AvatarWithStatus.js +3 -43
  122. package/dist/components/Badge/Badge.js +4 -62
  123. package/dist/components/Box/Box.js +3 -95
  124. package/dist/components/BubbleCounter/BubbleCounter.js +23 -28
  125. package/dist/components/Button/Button.js +4 -80
  126. package/dist/components/CalloutBanner/CalloutBanner.js +61 -12
  127. package/dist/components/CalloutBanner/primitives/CalloutBannerDismissButton.js +50 -22
  128. package/dist/components/CalloutBanner/primitives/CalloutBannerIcon.js +86 -45
  129. package/dist/components/CalloutBanner/primitives/CalloutBannerRoot.js +50 -24
  130. package/dist/components/CalloutBanner/primitives/CalloutBannerText.js +41 -11
  131. package/dist/components/Checkbox/Checkbox.js +4 -78
  132. package/dist/components/Checkbox/hooks/useIndeterminate.js +24 -30
  133. package/dist/components/Chips/Chips.types.js +0 -1
  134. package/dist/components/Chips/DismissibleChips.js +117 -86
  135. package/dist/components/Chips/MultiSelectChips.js +98 -64
  136. package/dist/components/Chips/SingleSelectChips.js +94 -57
  137. package/dist/components/Chips/private/ChipsPrimitive.js +4 -17
  138. package/dist/components/CountryFlag/CountryFlag.js +3 -44
  139. package/dist/components/Dialog/Dialog.js +56 -31
  140. package/dist/components/Dialog/DialogSteps.js +40 -29
  141. package/dist/components/Dialog/primitives/DialogActions.js +26 -19
  142. package/dist/components/Dialog/primitives/DialogButtonStack.d.ts.map +1 -1
  143. package/dist/components/Dialog/primitives/DialogButtonStack.js +22 -15
  144. package/dist/components/Dialog/primitives/DialogCloseButton.d.ts +1 -1
  145. package/dist/components/Dialog/primitives/DialogCloseButton.d.ts.map +1 -1
  146. package/dist/components/Dialog/primitives/DialogCloseButton.js +4 -93
  147. package/dist/components/Dialog/primitives/DialogDescription.js +3 -43
  148. package/dist/components/Dialog/primitives/DialogFooter.js +37 -34
  149. package/dist/components/Dialog/primitives/DialogRoot.js +4 -1459
  150. package/dist/components/Dialog/primitives/DialogTitle.js +3 -42
  151. package/dist/components/Divider/Divider.js +3 -14
  152. package/dist/components/DropdownMenu/DropdownMenu.js +253 -188
  153. package/dist/components/DropdownMenu/primitives/DropdownMenu.primitives.js +5 -34
  154. package/dist/components/DropdownMenu/primitives/DropdownMenuSelectItem.primitives.js +121 -71
  155. package/dist/components/FieldButton/FieldButton.js +3 -37
  156. package/dist/components/FormControl/FormControl.js +3 -105
  157. package/dist/components/Heading/Heading.js +3 -78
  158. package/dist/components/Icon/Icon.js +4 -49
  159. package/dist/components/IconButton/IconButton.d.ts +5 -1
  160. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  161. package/dist/components/IconButton/IconButton.js +4 -28
  162. package/dist/components/IconTile/IconTile.js +11 -69
  163. package/dist/components/IntlFormatted/IntlFormattedAggregatedDateTime.js +16 -32
  164. package/dist/components/IntlFormatted/IntlFormattedCurrency.js +20 -42
  165. package/dist/components/IntlFormatted/IntlFormattedDate.js +73 -195
  166. package/dist/components/IntlFormatted/IntlFormattedTime.js +14 -24
  167. package/dist/components/IntlFormatted/Wrapper.js +14 -8
  168. package/dist/components/LayoutFlex/LayoutFlex.js +3 -100
  169. package/dist/components/LayoutFlex/style/getStyleAttrs.js +71 -143
  170. package/dist/components/LayoutFlex/tests/AlignItems.js +67 -97
  171. package/dist/components/LayoutFlex/tests/ColumnReverse.js +63 -100
  172. package/dist/components/LayoutFlex/tests/DataOverride.js +1498 -1093
  173. package/dist/components/LayoutFlex/tests/Default.js +19 -20
  174. package/dist/components/LayoutFlex/tests/Direction.js +65 -88
  175. package/dist/components/LayoutFlex/tests/Gap.js +115 -197
  176. package/dist/components/LayoutFlex/tests/HideInline.js +95 -136
  177. package/dist/components/LayoutFlex/tests/JustifyContent.js +75 -108
  178. package/dist/components/LayoutFlex/tests/Nowrap.js +35 -42
  179. package/dist/components/LayoutFlex/tests/Padding.js +207 -263
  180. package/dist/components/LayoutFlex/tests/Relative.js +49 -64
  181. package/dist/components/LayoutFlexItem/LayoutFlexItem.js +3 -54
  182. package/dist/components/LayoutGrid/LayoutGrid.js +26 -34
  183. package/dist/components/LayoutGridItem/LayoutGridItem.js +3 -41
  184. package/dist/components/Link/Link.js +3 -72
  185. package/dist/components/Loader/Loader.js +3 -32
  186. package/dist/components/NumberField/NumberField.js +33 -35
  187. package/dist/components/ObserveIntersection/ObserveIntersection.js +41 -42
  188. package/dist/components/OnboardingTooltip/OnboardingTooltip.js +4 -115
  189. package/dist/components/OnboardingTour/OnboardingTour.js +4 -114
  190. package/dist/components/PasswordField/PasswordField.js +3 -78
  191. package/dist/components/PreplyLogo/PreplyLogo.js +3 -81
  192. package/dist/components/ProgressBar/ProgressBar.js +3 -27
  193. package/dist/components/ProgressSteps/ProgressSteps.js +3 -48
  194. package/dist/components/Rating/Rating.js +29 -20
  195. package/dist/components/Rating/RatingInput.js +57 -59
  196. package/dist/components/Rating/Stars.js +4 -8
  197. package/dist/components/Rating/hooks/useHasError.js +11 -15
  198. package/dist/components/Rating/hooks/useHoverPercentage.js +37 -45
  199. package/dist/components/Rating/hooks/useInputState.js +18 -24
  200. package/dist/components/Rating/hooks/useLocalizations.js +12 -24
  201. package/dist/components/Rating/utils/roundToHalfDecimal.js +4 -4
  202. package/dist/components/SelectField/Select.js +5 -112
  203. package/dist/components/SelectField/SelectField.js +29 -24
  204. package/dist/components/SelectField/hooks/useBreakpointMatch.js +18 -19
  205. package/dist/components/ShowOnIntersection/ShowOnIntersection.js +32 -21
  206. package/dist/components/Slider/RangeSlider.js +62 -52
  207. package/dist/components/Slider/Slider.js +3 -10
  208. package/dist/components/Steps/Steps.js +4 -210
  209. package/dist/components/Switch/Switch.js +3 -51
  210. package/dist/components/Text/Text.js +3 -128
  211. package/dist/components/TextField/TextField.js +27 -29
  212. package/dist/components/TextHighlighted/TextHighlighted.js +3 -41
  213. package/dist/components/TextInline/TextInline.js +3 -40
  214. package/dist/components/TextareaField/TextareaField.js +26 -28
  215. package/dist/components/Toast/Toast.js +4 -1168
  216. package/dist/components/Tooltip/Tooltip.js +3 -66
  217. package/dist/components/deprecated/Chips/Chips.js +4 -76
  218. package/dist/components/deprecated/NativeSelectField/NativeSelect.js +40 -32
  219. package/dist/components/deprecated/NativeSelectField/NativeSelectField.js +34 -33
  220. package/dist/components/deprecated/index.js +5 -6
  221. package/dist/components/index.js +50 -150
  222. package/dist/components/private/ButtonBase/ButtonBase.d.ts +7 -11
  223. package/dist/components/private/ButtonBase/ButtonBase.d.ts.map +1 -1
  224. package/dist/components/private/ButtonBase/ButtonBase.js +3 -247
  225. package/dist/components/private/Input/Input.js +27 -19
  226. package/dist/components/private/Input/InputContainer.js +3 -5
  227. package/dist/components/private/Input/Textarea.js +24 -20
  228. package/dist/components/private/Input/index.js +2 -4
  229. package/dist/components/private/Spinner/Spinner.js +3 -52
  230. package/dist/components/private/VisuallyHidden/VisuallyHidden.js +3 -15
  231. package/dist/components-BIYP8wHJ.js +200 -0
  232. package/dist/exp-color-C5mKAN91.js +74 -0
  233. package/dist/floating-ui.utils.dom-CoeTbDZx.js +215 -0
  234. package/dist/index.js +50 -150
  235. package/dist/index.module-1c7ENvxc.js +7 -0
  236. package/dist/jsx-runtime-i4KUlhDu.js +743 -0
  237. package/dist/layout-gap.module-DLD8bcR4.js +95 -0
  238. package/dist/layout-grid.module-CZfhrKrB.js +101 -0
  239. package/dist/layout-hide.module-B1P0N4i3.js +53 -0
  240. package/dist/layout-padding-ugY-yd2q.js +389 -0
  241. package/dist/layout-relative.module-B5xrFD9j.js +6 -0
  242. package/dist/render-icon-Ch3b2dE0.js +290 -0
  243. package/dist/shared-styles/align-self/align-self.js +2 -36
  244. package/dist/shared-styles/exp-color/exp-color.js +2 -68
  245. package/dist/shared-styles/layout-gap/layout-gap.js +13 -7
  246. package/dist/shared-styles/layout-grid/layout-grid.js +28 -28
  247. package/dist/shared-styles/layout-grid-responsive-columns/layout-grid-responsive-columns.js +29 -43
  248. package/dist/shared-styles/layout-hide/layout-hide.js +8 -8
  249. package/dist/shared-styles/layout-padding/layout-padding.js +2 -5
  250. package/dist/shared-styles/layout-relative/layout-relative.js +14 -8
  251. package/dist/shared-styles/text-accent/text-accent.js +2 -25
  252. package/dist/shared-styles/text-centered/text-centered.js +2 -24
  253. package/dist/shared-styles/text-weight/text-weight.js +2 -15
  254. package/dist/store-sN_eYeZT.js +1064 -0
  255. package/dist/storybook-utils/consts.js +6 -8
  256. package/dist/storybook-utils/index.js +1 -5
  257. package/dist/text-accent-CfUFx-1K.js +30 -0
  258. package/dist/text-centered-Dwp2_-Yp.js +30 -0
  259. package/dist/text-weight-CwoqmM4o.js +21 -0
  260. package/dist/useBaseUiId-CWAD_PSs.js +13 -0
  261. package/dist/useBreakpointMatch-D9a3CTNK.js +338 -0
  262. package/dist/useButton-DHTh3Hm7.js +148 -0
  263. package/dist/useDialogClose-BzFIyWco.js +22 -0
  264. package/dist/useId-CJsH-2wV.js +34 -0
  265. package/dist/useOpenInteractionType-D8vA_ZKI.js +4104 -0
  266. package/dist/useRenderElement-ZBds6eRN.js +341 -0
  267. package/dist/utils/Orientation/OrientationProvider.js +54 -23
  268. package/dist/utils/Orientation/index.js +2 -4
  269. package/dist/utils/RovingTabIndex/RovingTabIndexProvider.js +70 -44
  270. package/dist/utils/RovingTabIndex/index.js +2 -4
  271. package/dist/utils/createRequiredContext.js +23 -13
  272. package/dist/utils/filterAttributesPassedByRadixUIAtRuntime.js +28 -25
  273. package/dist/utils/render-icon.js +3 -320
  274. package/dist/utils/shared-strings.js +24 -32
  275. package/dist/utils/useBreakpointMatch.d.ts.map +1 -1
  276. package/dist/utils/useBreakpointMatch.js +2 -183
  277. package/dist/utils/useControllableState/useControllableState.js +31 -25
  278. package/dist/utils/useMergeRefs.js +29 -14
  279. package/dist/utils/useStableCallback/useStableCallback.js +28 -13
  280. package/package.json +17 -22
  281. package/dist/AlertBannerProvider-DTx2Xp3V.js +0 -50
  282. package/dist/BubbleCounter.module-QMwXWFIS.js +0 -16
  283. package/dist/ChipsPrimitive-DzsaOWgY.js +0 -1244
  284. package/dist/Dialog.module-Ba1X7b3N.js +0 -29
  285. package/dist/DialogRootContext-BCXmmJAw.js +0 -15
  286. package/dist/DropdownMenu.primitives-CqJE9k4D.js +0 -5871
  287. package/dist/IconTile-D1G7MljH.js +0 -172
  288. package/dist/InputContainer-oHJlLWIi.js +0 -30
  289. package/dist/Slider-DB4Maswa.js +0 -55
  290. package/dist/Stars-C_mHop2H.js +0 -67
  291. package/dist/TokyoUIChevronDown-D_tD1yU8.js +0 -11
  292. package/dist/floating-ui.utils.dom-BvMNldxo.js +0 -234
  293. package/dist/index.module-Q9TzIR6B.js +0 -11
  294. package/dist/layout-gap.module-MKn_un_k.js +0 -97
  295. package/dist/layout-grid.module-P4B4WVUy.js +0 -103
  296. package/dist/layout-hide.module-Bpl3Pl-a.js +0 -55
  297. package/dist/layout-padding-D5I6rRlL.js +0 -373
  298. package/dist/layout-relative.module-1z75aSwo.js +0 -8
  299. package/dist/useBaseUiId-DavsGYu9.js +0 -8
  300. package/dist/useButton-fjQ0ak8m.js +0 -193
  301. package/dist/useId-BhIOp2JG.js +0 -28
  302. package/dist/useOpenInteractionType-DNYFqf-a.js +0 -2880
  303. package/dist/useRenderElement-BSthtPOr.js +0 -350
@@ -1,65 +1,63 @@
1
1
  "use client";
2
- import { jsxs, jsx } from "react/jsx-runtime";
3
- import { forwardRef } from "react";
4
- import { webComponentNames } from "@preply/ds-visual-coverage-preply-component-names";
5
- import { moduleClassNames, stringClassNames, getDatasetProps } from "@preply/ds-web-core";
6
- import { s as styles, S as Stars } from "../../Stars-C_mHop2H.js";
7
- import { useHoverPercentage } from "./hooks/useHoverPercentage.js";
2
+ import "../../render-icon-Ch3b2dE0.js";
3
+ import { t as require_jsx_runtime } from "../../jsx-runtime-i4KUlhDu.js";
4
+ import { n as index_module_default, t as Stars } from "../../Stars-D5QspUBE.js";
8
5
  import { roundToHalfDecimal } from "./utils/roundToHalfDecimal.js";
9
6
  import { useLocalizations } from "./hooks/useLocalizations.js";
7
+ import { useHoverPercentage } from "./hooks/useHoverPercentage.js";
10
8
  import { useInputState } from "./hooks/useInputState.js";
11
9
  import { useHasError } from "./hooks/useHasError.js";
12
- const amountOfStars = 5;
13
- const RatingInput = forwardRef(function Rating({
14
- id,
15
- name,
16
- value: valueProp,
17
- defaultValue = 0,
18
- onValueChange,
19
- onChange: onChangeProp,
20
- hasError: hasErrorProp,
21
- required,
22
- "aria-label": ariaLabel,
23
- "aria-labelledby": ariaLabelledby,
24
- "aria-describedby": ariaDescribedby,
25
- dataset,
26
- dsInternalSimulation,
27
- onBlur,
28
- onFocus,
29
- "aria-invalid": ariaInvalid
30
- }, ref) {
31
- const {
32
- value,
33
- onChange
34
- } = useInputState({
35
- onChange: onChangeProp,
36
- onValueChange,
37
- defaultValue,
38
- value: valueProp
39
- });
40
- const roundedValue = roundToHalfDecimal(value);
41
- const {
42
- ariaValueText
43
- } = useLocalizations(roundedValue);
44
- const hasError = useHasError({
45
- hasError: hasErrorProp,
46
- ariaInvalid
47
- });
48
- const {
49
- hoverValue,
50
- ref: hoverRef
51
- } = useHoverPercentage({
52
- amountOfStars
53
- });
54
- const shownValue = typeof hoverValue === "number" ? hoverValue : roundedValue;
55
- const classNames = [...moduleClassNames(styles, "rating"), ...moduleClassNames(styles, "ratingInput", [stringClassNames(`dsInternalSimulation`, dsInternalSimulation)])];
56
- return /* @__PURE__ */ jsxs("div", { className: classNames.join(" "), ...getDatasetProps(dataset, {
57
- preplyDsComponent: webComponentNames.RatingInput
58
- }), ref: hoverRef, children: [
59
- /* @__PURE__ */ jsx(Stars, { filledPerc: shownValue / amountOfStars }),
60
- /* @__PURE__ */ jsx("input", { type: "range", min: 0, max: amountOfStars, step: 1, value: roundedValue, id, name, "aria-invalid": hasError === true ? true : void 0, "aria-required": required === true ? true : void 0, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-valuetext": ariaValueText, onBlur, onFocus, onChange, ref })
61
- ] });
10
+ import { forwardRef } from "react";
11
+ import { getDatasetProps, moduleClassNames, stringClassNames } from "@preply/ds-web-core";
12
+ import { webComponentNames } from "@preply/ds-visual-coverage-preply-component-names";
13
+ //#region src/components/Rating/RatingInput.tsx
14
+ var import_jsx_runtime = require_jsx_runtime();
15
+ var amountOfStars = 5;
16
+ /**
17
+ * A component that allows rating through a series of discrete values.
18
+ *
19
+ * If you need to visualize the current rating without the users changing it, look at Rating.
20
+ * @see Rating
21
+ */
22
+ var RatingInput = forwardRef(function Rating({ id, name, value: valueProp, defaultValue = 0, onValueChange, onChange: onChangeProp, hasError: hasErrorProp, required, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, dataset, dsInternalSimulation, onBlur, onFocus, "aria-invalid": ariaInvalid }, ref) {
23
+ const { value, onChange } = useInputState({
24
+ onChange: onChangeProp,
25
+ onValueChange,
26
+ defaultValue,
27
+ value: valueProp
28
+ });
29
+ const roundedValue = roundToHalfDecimal(value);
30
+ const { ariaValueText } = useLocalizations(roundedValue);
31
+ const hasError = useHasError({
32
+ hasError: hasErrorProp,
33
+ ariaInvalid
34
+ });
35
+ const { hoverValue, ref: hoverRef } = useHoverPercentage({ amountOfStars });
36
+ const shownValue = typeof hoverValue === "number" ? hoverValue : roundedValue;
37
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
38
+ className: [...moduleClassNames(index_module_default, "rating"), ...moduleClassNames(index_module_default, "ratingInput", [stringClassNames(`dsInternalSimulation`, dsInternalSimulation)])].join(" "),
39
+ ...getDatasetProps(dataset, { preplyDsComponent: webComponentNames.RatingInput }),
40
+ ref: hoverRef,
41
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Stars, { filledPerc: shownValue / amountOfStars }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
42
+ type: "range",
43
+ min: 0,
44
+ max: amountOfStars,
45
+ step: 1,
46
+ value: roundedValue,
47
+ id,
48
+ name,
49
+ "aria-invalid": hasError === true ? true : void 0,
50
+ "aria-required": required === true ? true : void 0,
51
+ "aria-label": ariaLabel,
52
+ "aria-labelledby": ariaLabelledby,
53
+ "aria-describedby": ariaDescribedby,
54
+ "aria-valuetext": ariaValueText,
55
+ onBlur,
56
+ onFocus,
57
+ onChange,
58
+ ref
59
+ })]
60
+ });
62
61
  });
63
- export {
64
- RatingInput
65
- };
62
+ //#endregion
63
+ export { RatingInput };
@@ -1,8 +1,4 @@
1
- import "react/jsx-runtime";
2
- import "@preply/ds-media-icons/dist/24/TokyoUIStar.svg";
3
- import "@preply/ds-media-icons/dist/24/TokyoUIStarFilled.svg";
4
- import { S } from "../../Stars-C_mHop2H.js";
5
- import "../../utils/render-icon.js";
6
- export {
7
- S as Stars
8
- };
1
+ import "../../render-icon-Ch3b2dE0.js";
2
+ import "../../jsx-runtime-i4KUlhDu.js";
3
+ import { t as Stars } from "../../Stars-D5QspUBE.js";
4
+ export { Stars };
@@ -1,16 +1,12 @@
1
- function useHasError({
2
- hasError,
3
- ariaInvalid
4
- }) {
5
- const errorsClash = typeof ariaInvalid === "boolean" && typeof hasError === "boolean";
6
- if (errorsClash) {
7
- console.warn(`You provided both 'hasError' and 'aria-invalid' props. 'hasError' will take precedence. If you're using RatingInput inside FormControl, please remove 'hasError' prop.`);
8
- return hasError;
9
- }
10
- if (typeof hasError === "boolean") return hasError;
11
- if (typeof ariaInvalid === "boolean") return ariaInvalid;
12
- return false;
1
+ //#region src/components/Rating/hooks/useHasError.ts
2
+ function useHasError({ hasError, ariaInvalid }) {
3
+ if (typeof ariaInvalid === "boolean" && typeof hasError === "boolean") {
4
+ console.warn(`You provided both 'hasError' and 'aria-invalid' props. 'hasError' will take precedence. If you're using RatingInput inside FormControl, please remove 'hasError' prop.`);
5
+ return hasError;
6
+ }
7
+ if (typeof hasError === "boolean") return hasError;
8
+ if (typeof ariaInvalid === "boolean") return ariaInvalid;
9
+ return false;
13
10
  }
14
- export {
15
- useHasError
16
- };
11
+ //#endregion
12
+ export { useHasError };
@@ -1,47 +1,39 @@
1
- import { useRef, useState, useEffect } from "react";
2
- function getValueFromMousePosition({
3
- // A 0-1 number
4
- mousePercentage,
5
- amountOfStars
6
- }) {
7
- const rawValue = mousePercentage * amountOfStars;
8
- const fixedValue = rawValue + 0.01;
9
- return Math.ceil(fixedValue);
1
+ import { useEffect, useRef, useState } from "react";
2
+ //#region src/components/Rating/hooks/useHoverPercentage.ts
3
+ function getValueFromMousePosition({ mousePercentage, amountOfStars }) {
4
+ const fixedValue = mousePercentage * amountOfStars + .01;
5
+ return Math.ceil(fixedValue);
10
6
  }
11
- function useHoverPercentage({
12
- amountOfStars
13
- }) {
14
- const ref = useRef(null);
15
- const [hoverValue, setHoverValue] = useState(null);
16
- useEffect(() => {
17
- const canHover = window.matchMedia("(hover: hover)").matches === true;
18
- if (!ref.current || !canHover) return;
19
- const el = ref.current;
20
- function onMouseMove(event) {
21
- const rect = el.getBoundingClientRect();
22
- const x = event.clientX - rect.left;
23
- setHoverValue(getValueFromMousePosition({
24
- mousePercentage: x / rect.width,
25
- amountOfStars
26
- }));
27
- }
28
- function onMouseLeave() {
29
- setHoverValue(null);
30
- }
31
- el.addEventListener("mousemove", onMouseMove);
32
- el.addEventListener("mouseenter", onMouseMove);
33
- el.addEventListener("mouseleave", onMouseLeave);
34
- return () => {
35
- el.removeEventListener("mousemove", onMouseMove);
36
- el.removeEventListener("mouseenter", onMouseMove);
37
- el.removeEventListener("mouseleave", onMouseLeave);
38
- };
39
- }, [amountOfStars]);
40
- return {
41
- hoverValue,
42
- ref
43
- };
7
+ function useHoverPercentage({ amountOfStars }) {
8
+ const ref = useRef(null);
9
+ const [hoverValue, setHoverValue] = useState(null);
10
+ useEffect(() => {
11
+ const canHover = window.matchMedia("(hover: hover)").matches === true;
12
+ if (!ref.current || !canHover) return;
13
+ const el = ref.current;
14
+ function onMouseMove(event) {
15
+ const rect = el.getBoundingClientRect();
16
+ setHoverValue(getValueFromMousePosition({
17
+ mousePercentage: (event.clientX - rect.left) / rect.width,
18
+ amountOfStars
19
+ }));
20
+ }
21
+ function onMouseLeave() {
22
+ setHoverValue(null);
23
+ }
24
+ el.addEventListener("mousemove", onMouseMove);
25
+ el.addEventListener("mouseenter", onMouseMove);
26
+ el.addEventListener("mouseleave", onMouseLeave);
27
+ return () => {
28
+ el.removeEventListener("mousemove", onMouseMove);
29
+ el.removeEventListener("mouseenter", onMouseMove);
30
+ el.removeEventListener("mouseleave", onMouseLeave);
31
+ };
32
+ }, [amountOfStars]);
33
+ return {
34
+ hoverValue,
35
+ ref
36
+ };
44
37
  }
45
- export {
46
- useHoverPercentage
47
- };
38
+ //#endregion
39
+ export { useHoverPercentage };
@@ -1,27 +1,21 @@
1
- import { useCallback } from "react";
2
1
  import { useControllableState } from "../../../utils/useControllableState/useControllableState.js";
2
+ import { useCallback } from "react";
3
+ //#region src/components/Rating/hooks/useInputState.ts
3
4
  function useInputState(options) {
4
- const {
5
- defaultValue,
6
- value: valueProp,
7
- onChange: onChangeProp,
8
- onValueChange: onValueChangeProp
9
- } = options;
10
- const [value, onValueChange] = useControllableState({
11
- defaultValue,
12
- value: valueProp,
13
- onValueChange: onValueChangeProp
14
- });
15
- const onChange = useCallback((event) => {
16
- onChangeProp == null ? void 0 : onChangeProp(event);
17
- if (event.defaultPrevented) return;
18
- onValueChange == null ? void 0 : onValueChange(event.currentTarget.valueAsNumber);
19
- }, [onChangeProp, onValueChange]);
20
- return {
21
- value,
22
- onChange
23
- };
5
+ const { defaultValue, value: valueProp, onChange: onChangeProp, onValueChange: onValueChangeProp } = options;
6
+ const [value, onValueChange] = useControllableState({
7
+ defaultValue,
8
+ value: valueProp,
9
+ onValueChange: onValueChangeProp
10
+ });
11
+ return {
12
+ value,
13
+ onChange: useCallback((event) => {
14
+ onChangeProp === null || onChangeProp === void 0 || onChangeProp(event);
15
+ if (event.defaultPrevented) return;
16
+ onValueChange === null || onValueChange === void 0 || onValueChange(event.currentTarget.valueAsNumber);
17
+ }, [onChangeProp, onValueChange])
18
+ };
24
19
  }
25
- export {
26
- useInputState
27
- };
20
+ //#endregion
21
+ export { useInputState };
@@ -1,27 +1,15 @@
1
1
  import { useIntl } from "react-intl";
2
+ //#region src/components/Rating/hooks/useLocalizations.ts
2
3
  function useLocalizations(value) {
3
- const {
4
- formatMessage
5
- } = useIntl();
6
- return {
7
- ariaValueText: formatMessage({
8
- id: "preply-ds.rating.value-text",
9
- defaultMessage: [{
10
- "type": 1,
11
- "value": "currentValue"
12
- }, {
13
- "type": 0,
14
- "value": " out of "
15
- }, {
16
- "type": 1,
17
- "value": "maxValue"
18
- }]
19
- }, {
20
- currentValue: value,
21
- maxValue: 5
22
- })
23
- };
4
+ const { formatMessage } = useIntl();
5
+ return { ariaValueText: formatMessage({
6
+ id: "preply-ds.rating.value-text",
7
+ defaultMessage: "{currentValue} out of {maxValue}",
8
+ description: "The current rating. Will be announced by screen readers as '4 out of 5'."
9
+ }, {
10
+ currentValue: value,
11
+ maxValue: 5
12
+ }) };
24
13
  }
25
- export {
26
- useLocalizations
27
- };
14
+ //#endregion
15
+ export { useLocalizations };
@@ -1,6 +1,6 @@
1
+ //#region src/components/Rating/utils/roundToHalfDecimal.ts
1
2
  function roundToHalfDecimal(value) {
2
- return Math.round(value * 2) / 2;
3
+ return Math.round(value * 2) / 2;
3
4
  }
4
- export {
5
- roundToHalfDecimal
6
- };
5
+ //#endregion
6
+ export { roundToHalfDecimal };
@@ -1,112 +1,5 @@
1
- "use client";
2
- import { jsxs, jsx } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import { forwardRef, useState } from "react";
5
- import { Select as Select$1 } from "radix-ui";
6
- import { getDatasetProps } from "@preply/ds-web-core";
7
- import { usePortalElement } from "@preply/ds-web-root";
8
- import { webComponentNames } from "@preply/ds-visual-coverage-preply-component-names";
9
- import { F as ForwardRef$1 } from "../../TokyoUIChevronDown-D_tD1yU8.js";
10
- import { Icon } from "../Icon/Icon.js";
11
- import { useBreakpointMatch } from "./hooks/useBreakpointMatch.js";
12
- import '../../assets/Select.css';const SvgTokyoUiCheckmark = ({
13
- title,
14
- titleId,
15
- ...props
16
- }, ref) => /* @__PURE__ */ React.createElement("svg", { "data-preply-ds-component": "SvgTokyoUIIcon", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ref, "aria-labelledby": titleId, ...props }, title ? /* @__PURE__ */ React.createElement("title", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement("path", { fillRule: "evenodd", d: "M8.707 18 4 13.293l1.414-1.414 3.293 3.293L18 5.879l1.414 1.414L8.707 18Z", clipRule: "evenodd" }));
17
- const ForwardRef = forwardRef(SvgTokyoUiCheckmark);
18
- const trigger = "trigger__e7qqO";
19
- const chevron = "chevron__jR5Zn";
20
- const content = "content__NwpTO";
21
- const viewport = "viewport__SgLBh";
22
- const item = "item__iOFtY";
23
- const indicator = "indicator__FesN8";
24
- const group = "group__rZ-2W";
25
- const groupLabel = "groupLabel__fC3jF";
26
- const styles = {
27
- trigger,
28
- chevron,
29
- content,
30
- viewport,
31
- item,
32
- indicator,
33
- group,
34
- groupLabel
35
- };
36
- const Select = forwardRef(function Select2({
37
- value,
38
- defaultValue,
39
- placeholder,
40
- disabled,
41
- onValueChange,
42
- children,
43
- dataset,
44
- icon,
45
- name,
46
- id,
47
- required,
48
- onFocus,
49
- onBlur,
50
- onKeyDown,
51
- onKeyUp,
52
- "aria-label": ariaLabel,
53
- "aria-labelledby": ariaLabelledby,
54
- "aria-describedby": ariaDescribedby,
55
- "aria-invalid": ariaInvalid,
56
- "aria-errormessage": ariaErrorMessage
57
- }, ref) {
58
- const [isOpen, setIsOpen] = useState(false);
59
- const portalElement = usePortalElement();
60
- const datasetProps = getDatasetProps(dataset, {
61
- preplyDsComponent: webComponentNames.Select
62
- });
63
- const isPopover = useBreakpointMatch("medium-s");
64
- const handleValueChange = (newValue) => {
65
- onValueChange == null ? void 0 : onValueChange(newValue);
66
- };
67
- return /* @__PURE__ */ jsxs(Select$1.Root, { value, defaultValue, onValueChange: handleValueChange, disabled, name, open: isOpen, onOpenChange: setIsOpen, required, children: [
68
- /* @__PURE__ */ jsxs(Select$1.Trigger, { ref, id, className: styles.trigger, onFocus, onBlur, onKeyDown, onKeyUp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-errormessage": ariaErrorMessage, ...datasetProps, children: [
69
- icon,
70
- /* @__PURE__ */ jsx(Select$1.Value, { placeholder }),
71
- /* @__PURE__ */ jsx(Select$1.Icon, { className: styles.chevron, children: /* @__PURE__ */ jsx(Icon, { svg: ForwardRef$1 }) })
72
- ] }),
73
- /* @__PURE__ */ jsx(Select$1.Portal, { container: portalElement, children: /* @__PURE__ */ jsx(Select$1.Content, { position: isPopover ? "popper" : void 0, sideOffset: isPopover ? 5 : void 0, className: styles.content, children: /* @__PURE__ */ jsx(
74
- Select$1.Viewport,
75
- {
76
- className: styles.viewport,
77
- role: "group",
78
- tabIndex: 0,
79
- children
80
- }
81
- ) }) })
82
- ] });
83
- });
84
- function SelectOption({
85
- value,
86
- disabled,
87
- children,
88
- leadingIcon,
89
- dataset
90
- }) {
91
- return /* @__PURE__ */ jsxs(Select$1.Item, { value, disabled, className: styles.item, ...getDatasetProps(dataset, {
92
- preplyDsComponent: webComponentNames.SelectFieldOption
93
- }), children: [
94
- leadingIcon,
95
- /* @__PURE__ */ jsx(Select$1.ItemText, { children }),
96
- /* @__PURE__ */ jsx(Select$1.ItemIndicator, { className: styles.indicator, children: /* @__PURE__ */ jsx(Icon, { svg: ForwardRef }) })
97
- ] });
98
- }
99
- function SelectGroup({
100
- children,
101
- label
102
- }) {
103
- return /* @__PURE__ */ jsxs(Select$1.Group, { className: styles.group, children: [
104
- /* @__PURE__ */ jsx(Select$1.Label, { className: styles.groupLabel, children: label }),
105
- children
106
- ] });
107
- }
108
- export {
109
- Select,
110
- SelectGroup,
111
- SelectOption
112
- };
1
+ import "../../render-icon-Ch3b2dE0.js";
2
+ import "../../jsx-runtime-i4KUlhDu.js";
3
+ import "../../TokyoUIChevronDown-DGcVqR1z.js";
4
+ import { n as SelectGroup, r as SelectOption, t as Select } from "../../Select-Bo7PX_8V.js";
5
+ export { Select, SelectGroup, SelectOption };
@@ -1,28 +1,33 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
2
+ import "../../render-icon-Ch3b2dE0.js";
3
+ import { t as require_jsx_runtime } from "../../jsx-runtime-i4KUlhDu.js";
4
+ import { t as FormControl } from "../../FormControl-qnbQL1iF.js";
5
+ import "../../TokyoUIChevronDown-DGcVqR1z.js";
6
+ import { n as SelectGroup, r as SelectOption, t as Select } from "../../Select-Bo7PX_8V.js";
3
7
  import { forwardRef } from "react";
4
8
  import { webComponentNames } from "@preply/ds-visual-coverage-preply-component-names";
5
- import { FormControl } from "../FormControl/FormControl.js";
6
- import { Select, SelectOption, SelectGroup } from "./Select.js";
7
- const SelectField = forwardRef(function SelectField2({
8
- id,
9
- label,
10
- description,
11
- error,
12
- required,
13
- dataset,
14
- hideLabel,
15
- hasError,
16
- useLegacyRequiredLabel,
17
- inputDataset,
18
- ...selectProps
19
- }, ref) {
20
- return /* @__PURE__ */ jsx(FormControl, { id, label, description, error, hasError, required, dataset, hideLabel, useLegacyRequiredLabel, preplyDsComponent: webComponentNames.SelectField, children: /* @__PURE__ */ jsx(Select, { ref, dataset: inputDataset, ...selectProps }) });
9
+ //#region src/components/SelectField/SelectField.tsx
10
+ var import_jsx_runtime = require_jsx_runtime();
11
+ var SelectField = forwardRef(function SelectField({ id, label, description, error, required, dataset, hideLabel, hasError, useLegacyRequiredLabel, inputDataset, ...selectProps }, ref) {
12
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormControl, {
13
+ id,
14
+ label,
15
+ description,
16
+ error,
17
+ hasError,
18
+ required,
19
+ dataset,
20
+ hideLabel,
21
+ useLegacyRequiredLabel,
22
+ preplyDsComponent: webComponentNames.SelectField,
23
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Select, {
24
+ ref,
25
+ dataset: inputDataset,
26
+ ...selectProps
27
+ })
28
+ });
21
29
  });
22
- const SelectFieldOption = SelectOption;
23
- const SelectFieldGroup = SelectGroup;
24
- export {
25
- SelectField,
26
- SelectFieldGroup,
27
- SelectFieldOption
28
- };
30
+ var SelectFieldOption = SelectOption;
31
+ var SelectFieldGroup = SelectGroup;
32
+ //#endregion
33
+ export { SelectField, SelectFieldGroup, SelectFieldOption };
@@ -1,22 +1,21 @@
1
+ import { useEffect, useState } from "react";
1
2
  import { BREAKPOINT } from "@preply/ds-core";
2
- import { useState, useEffect } from "react";
3
+ //#region src/components/SelectField/hooks/useBreakpointMatch.ts
3
4
  function useBreakpointMatch(breakpoint) {
4
- const size = BREAKPOINT[breakpoint];
5
- const query = `(min-width: ${size}px)`;
6
- const [matches, setMatches] = useState(false);
7
- useEffect(() => {
8
- const mediaQuery = window.matchMedia(query);
9
- setMatches(mediaQuery.matches);
10
- const handleChange = (e) => {
11
- setMatches(e.matches);
12
- };
13
- mediaQuery.addEventListener("change", handleChange);
14
- return () => {
15
- mediaQuery.removeEventListener("change", handleChange);
16
- };
17
- }, [query]);
18
- return matches;
5
+ const query = `(min-width: ${BREAKPOINT[breakpoint]}px)`;
6
+ const [matches, setMatches] = useState(false);
7
+ useEffect(() => {
8
+ const mediaQuery = window.matchMedia(query);
9
+ setMatches(mediaQuery.matches);
10
+ const handleChange = (e) => {
11
+ setMatches(e.matches);
12
+ };
13
+ mediaQuery.addEventListener("change", handleChange);
14
+ return () => {
15
+ mediaQuery.removeEventListener("change", handleChange);
16
+ };
17
+ }, [query]);
18
+ return matches;
19
19
  }
20
- export {
21
- useBreakpointMatch
22
- };
20
+ //#endregion
21
+ export { useBreakpointMatch };
@@ -1,24 +1,35 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
3
- import { useState, useCallback } from "react";
2
+ import { t as require_jsx_runtime } from "../../jsx-runtime-i4KUlhDu.js";
4
3
  import { ObserveIntersection } from "../ObserveIntersection/ObserveIntersection.js";
5
- const ShowOnIntersection = ({
6
- onIntersect,
7
- once,
8
- threshold,
9
- tag,
10
- dataset,
11
- children
12
- }) => {
13
- const [shouldShow, setShouldShow] = useState(false);
14
- const intersectionCallback = useCallback(() => {
15
- if (!shouldShow) {
16
- setShouldShow(true);
17
- }
18
- onIntersect == null ? void 0 : onIntersect();
19
- }, [shouldShow, onIntersect]);
20
- return /* @__PURE__ */ jsx(ObserveIntersection, { onIntersect: intersectionCallback, once: !onIntersect ? true : once, threshold, tag, dataset, children: shouldShow && children });
21
- };
22
- export {
23
- ShowOnIntersection
4
+ import { useCallback, useState } from "react";
5
+ //#region src/components/ShowOnIntersection/ShowOnIntersection.tsx
6
+ var import_jsx_runtime = require_jsx_runtime();
7
+ /**
8
+ * Only renders the wrapped components once it intersects with the viewport.
9
+ *
10
+ * Note that elements will not be detached from the DOM if the component is
11
+ * scrolled out of view again.
12
+ *
13
+ * You can use `React.lazy` to lazy-load the wrapped components.
14
+ *
15
+ * Additionally, an `onIntersect` callback can be provided. As with
16
+ * `ObserveIntersection`, this callback will be called every time the component
17
+ * intersects with the viewport, or only the first time if `once` is set to
18
+ * `true`.
19
+ */
20
+ var ShowOnIntersection = ({ onIntersect, once, threshold, tag, dataset, children }) => {
21
+ const [shouldShow, setShouldShow] = useState(false);
22
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ObserveIntersection, {
23
+ onIntersect: useCallback(() => {
24
+ if (!shouldShow) setShouldShow(true);
25
+ onIntersect === null || onIntersect === void 0 || onIntersect();
26
+ }, [shouldShow, onIntersect]),
27
+ once: !onIntersect ? true : once,
28
+ threshold,
29
+ tag,
30
+ dataset,
31
+ children: shouldShow && children
32
+ });
24
33
  };
34
+ //#endregion
35
+ export { ShowOnIntersection };