unframer 2.2.2 → 2.3.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.
package/src/react.tsx CHANGED
@@ -9,7 +9,11 @@ import {
9
9
  useMemo,
10
10
  useSyncExternalStore,
11
11
  } from 'react'
12
- import { breakpointSizes, breakpointsStyles, getFontsStyles } from './css.js'
12
+ import {
13
+ breakpointsStyles,
14
+ defaultBreakpointSizes,
15
+ getFontsStyles,
16
+ } from './css.js'
13
17
 
14
18
  function classNames(...args) {
15
19
  return args.filter(Boolean).join(' ')
@@ -17,14 +21,14 @@ function classNames(...args) {
17
21
 
18
22
  // breakpoints from the higher to the lower
19
23
  const defaultBreakpoints = Object.keys(
20
- breakpointSizes,
24
+ defaultBreakpointSizes,
21
25
  ).reverse() as UnframerBreakpoint[]
22
26
 
23
- export type UnframerBreakpoint = keyof typeof breakpointSizes
27
+ export type UnframerBreakpoint = keyof typeof defaultBreakpointSizes
24
28
 
25
29
  function getBreakpointNameFromWindowWidth(windowWidth: number) {
26
30
  return defaultBreakpoints.find(
27
- (name) => windowWidth >= breakpointSizes[name],
31
+ (name) => windowWidth >= defaultBreakpointSizes[name],
28
32
  )
29
33
  }
30
34
 
@@ -50,7 +54,6 @@ const nothing = () => {
50
54
  return () => {}
51
55
  }
52
56
 
53
-
54
57
  /**
55
58
  * @deprecated Use styles.css import instead
56
59
  */
@@ -62,7 +65,9 @@ export function FramerStyles({ Components = [] as any[] }): any {
62
65
  )
63
66
  const breakpoints = (
64
67
  <style
65
- dangerouslySetInnerHTML={{ __html: breakpointsStyles }}
68
+ dangerouslySetInnerHTML={{
69
+ __html: breakpointsStyles(defaultBreakpointSizes),
70
+ }}
66
71
  key='breakpointsStyles'
67
72
  suppressHydrationWarning
68
73
  hidden