@faststore/ui 1.6.19 → 1.6.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/ui",
3
- "version": "1.6.19",
3
+ "version": "1.6.22",
4
4
  "description": "A lightweight, framework agnostic component library for React",
5
5
  "author": "emersonlaurentino",
6
6
  "license": "MIT",
@@ -76,7 +76,7 @@
76
76
  "@types/jest-axe": "^3.5.3",
77
77
  "@types/tabbable": "^3.1.1",
78
78
  "@types/testing-library__jest-dom": "^5.9.5",
79
- "@vtex/theme-b2c-tailwind": "^1.6.19",
79
+ "@vtex/theme-b2c-tailwind": "^1.6.22",
80
80
  "@vtex/tsconfig": "^0.5.0",
81
81
  "chalk": "^5.0.0",
82
82
  "jest-axe": "^5.0.1",
@@ -89,5 +89,5 @@
89
89
  "tsdx": "^0.14.1",
90
90
  "typescript": "^4.2.4"
91
91
  },
92
- "gitHead": "b0e6e5d161efa1c18544388d60fe3a6249361514"
92
+ "gitHead": "f1a7cc39edfe0556d7ee6e19402bedbb212ba2eb"
93
93
  }
@@ -12,11 +12,11 @@ type DropdownPosition = {
12
12
  */
13
13
  export const useDropdownPosition = (): DropdownPosition => {
14
14
  const { dropdownButtonRef } = useDropdown()
15
-
16
- const topLevel = dropdownButtonRef?.current?.offsetTop ?? 0
17
- const topOffset = dropdownButtonRef?.current?.offsetHeight ?? 0
15
+ const buttonRect = dropdownButtonRef?.current?.getBoundingClientRect()
16
+ const topLevel: number = buttonRect?.top ?? 0
17
+ const topOffset: number = buttonRect?.height ?? 0
18
18
  const topPosition = topLevel + topOffset
19
- const leftPosition = dropdownButtonRef?.current?.offsetLeft ?? 0
19
+ const leftPosition = buttonRect?.left ?? 0
20
20
 
21
21
  return {
22
22
  position: 'absolute',
@@ -5,12 +5,24 @@ import DropdownButton from '../DropdownButton'
5
5
  import DropdownItem from '../DropdownItem'
6
6
  import DropdownMenu from '../DropdownMenu'
7
7
 
8
- # Dropdown
8
+ # DropdownUncontrolled
9
9
 
10
10
  <Canvas>
11
11
  <Story id="molecules-dropdown--uncontrolled" />
12
12
  </Canvas>
13
13
 
14
+ # DropdownControlled
15
+
16
+ <Canvas>
17
+ <Story id="molecules-dropdown--controlled" />
18
+ </Canvas>
19
+
20
+ # DropdownSelectable
21
+
22
+ <Canvas>
23
+ <Story id="molecules-dropdown--selectable" />
24
+ </Canvas>
25
+
14
26
  ## Components
15
27
 
16
28
  The `Dropdown` uses the [Compound Component](https://kentcdodds.com/blog/compound-components-with-react-hooks) pattern, its components are: