Skip to content

Commit

Permalink
Merge pull request #206 from mapbox/STUDIO-1258
Browse files Browse the repository at this point in the history
Add context menu component
  • Loading branch information
tristen authored Mar 22, 2023
2 parents f4c8a1d + 3d9541a commit 6f59fc7
Show file tree
Hide file tree
Showing 18 changed files with 1,458 additions and 609 deletions.
1,284 changes: 786 additions & 498 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,21 @@
"react-dom": "^16.14.0"
},
"dependencies": {
"@mapbox/mbx-assembly": "^1.3.0",
"@mapbox/mbx-assembly": "^1.4.0",
"@mapbox/query-selector-contains-node": "^1.0.0",
"@radix-ui/react-accessible-icon": "^1.0.0",
"@radix-ui/react-accordion": "^1.0.0",
"@radix-ui/react-dialog": "^1.0.0",
"@radix-ui/react-label": "^1.0.0",
"@radix-ui/react-popover": "^1.0.0",
"@radix-ui/react-portal": "^1.0.0",
"@radix-ui/react-slider": "^1.0.0",
"@radix-ui/react-switch": "^1.0.0",
"@radix-ui/react-tabs": "^1.0.0",
"@radix-ui/react-tooltip": "^1.0.0",
"@radix-ui/react-visually-hidden": "^1.0.0",
"@radix-ui/react-toast": "^1.0.0",
"@radix-ui/react-accessible-icon": "^1.0.2",
"@radix-ui/react-accordion": "^1.1.1",
"@radix-ui/react-context-menu": "^2.1.3",
"@radix-ui/react-dialog": "^1.0.3",
"@radix-ui/react-label": "^2.0.1",
"@radix-ui/react-popover": "^1.0.5",
"@radix-ui/react-portal": "^1.0.2",
"@radix-ui/react-slider": "^1.1.1",
"@radix-ui/react-switch": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.3",
"@radix-ui/react-toast": "^1.1.3",
"@radix-ui/react-tooltip": "^1.0.5",
"@radix-ui/react-visually-hidden": "^1.0.2",
"classnames": "^2.2.6",
"clipboard": "^2.0.0",
"debounce": "^1.1.0",
Expand All @@ -59,10 +60,10 @@
"devDependencies": {
"@babel/cli": "^7.18.6",
"@mapbox/jsxtreme-markdown": "^0.9.3",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.1.2",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.2.1",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^27.5.2",
"@types/node": "^16.11.43",
"@types/react": "^17.0.47",
Expand Down
41 changes: 37 additions & 4 deletions src/components/accordion/__snapshots__/accordion.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
exports[`Accordion all options renders 1`] = `
<body>
<div>
<div>
<div
data-orientation="vertical"
>
<div
class="bg-red-faint border-b border--red-dark"
data-orientation="vertical"
data-state="open"
>
<button
aria-controls="radix-24"
aria-expanded="true"
class="w-full bg-red txt-l txt-bold link link--white bg-red-dark-on-hover px6 py6 cursor-pointer"
data-orientation="vertical"
data-radix-collection-item=""
data-state="open"
data-testid="accordion-trigger-one"
Expand All @@ -29,10 +33,11 @@ exports[`Accordion all options renders 1`] = `
</button>
<div
aria-labelledby="radix-25"
data-orientation="vertical"
data-state="open"
id="radix-24"
role="region"
style="--radix-accordion-content-height: var(--radix-collapsible-content-height); --radix-accordion-content-width: var(--radix-collapsible-content-width); transition-duration: 0s; animation-duration: 0s; animation-fill-mode: none;"
style="--radix-accordion-content-height: var(--radix-collapsible-content-height); --radix-accordion-content-width: var(--radix-collapsible-content-width); transition-duration: 0s; animation-name: none;"
>
<div
class="py6 px6 txt-l bg-red-light"
Expand All @@ -43,12 +48,14 @@ exports[`Accordion all options renders 1`] = `
</div>
<div
class="bg-red-faint border-b border--red-dark"
data-orientation="vertical"
data-state="closed"
>
<button
aria-controls="radix-26"
aria-expanded="false"
class="w-full bg-red txt-l txt-bold link link--white bg-red-dark-on-hover px6 py6 cursor-pointer"
data-orientation="vertical"
data-radix-collection-item=""
data-state="closed"
data-testid="accordion-trigger-two"
Expand All @@ -61,6 +68,7 @@ exports[`Accordion all options renders 1`] = `
</button>
<div
aria-labelledby="radix-27"
data-orientation="vertical"
data-state="closed"
hidden=""
id="radix-26"
Expand All @@ -70,12 +78,14 @@ exports[`Accordion all options renders 1`] = `
</div>
<div
class="bg-red-faint border-b border--red-dark"
data-orientation="vertical"
data-state="closed"
>
<button
aria-controls="radix-28"
aria-expanded="false"
class="w-full bg-red txt-l txt-bold link link--white bg-red-dark-on-hover px6 py6 cursor-pointer"
data-orientation="vertical"
data-radix-collection-item=""
data-state="closed"
data-testid="accordion-trigger-third"
Expand All @@ -88,6 +98,7 @@ exports[`Accordion all options renders 1`] = `
</button>
<div
aria-labelledby="radix-29"
data-orientation="vertical"
data-state="closed"
hidden=""
id="radix-28"
Expand All @@ -103,14 +114,18 @@ exports[`Accordion all options renders 1`] = `
exports[`Accordion basic renders 1`] = `
<body>
<div>
<div>
<div
data-orientation="vertical"
>
<div
data-orientation="vertical"
data-state="closed"
>
<button
aria-controls="radix-0"
aria-expanded="false"
class="w-full txt-s txt-bold txt-truncate link link--gray py6 cursor-pointer"
data-orientation="vertical"
data-radix-collection-item=""
data-state="closed"
data-testid="accordion-trigger-one"
Expand All @@ -123,6 +138,7 @@ exports[`Accordion basic renders 1`] = `
</button>
<div
aria-labelledby="radix-1"
data-orientation="vertical"
data-state="closed"
hidden=""
id="radix-0"
Expand All @@ -131,12 +147,14 @@ exports[`Accordion basic renders 1`] = `
/>
</div>
<div
data-orientation="vertical"
data-state="closed"
>
<button
aria-controls="radix-2"
aria-expanded="false"
class="w-full txt-s txt-bold txt-truncate link link--gray py6 cursor-pointer"
data-orientation="vertical"
data-radix-collection-item=""
data-state="closed"
data-testid="accordion-trigger-two"
Expand All @@ -149,6 +167,7 @@ exports[`Accordion basic renders 1`] = `
</button>
<div
aria-labelledby="radix-3"
data-orientation="vertical"
data-state="closed"
hidden=""
id="radix-2"
Expand All @@ -157,12 +176,14 @@ exports[`Accordion basic renders 1`] = `
/>
</div>
<div
data-orientation="vertical"
data-state="closed"
>
<button
aria-controls="radix-4"
aria-expanded="false"
class="w-full txt-s txt-bold txt-truncate link link--gray py6 cursor-pointer"
data-orientation="vertical"
data-radix-collection-item=""
data-state="closed"
data-testid="accordion-trigger-three"
Expand All @@ -175,6 +196,7 @@ exports[`Accordion basic renders 1`] = `
</button>
<div
aria-labelledby="radix-5"
data-orientation="vertical"
data-state="closed"
hidden=""
id="radix-4"
Expand All @@ -190,14 +212,18 @@ exports[`Accordion basic renders 1`] = `
exports[`Accordion disabled renders 1`] = `
<body>
<div>
<div>
<div
data-orientation="vertical"
>
<div
data-orientation="vertical"
data-state="closed"
>
<button
aria-controls="radix-12"
aria-expanded="false"
class="w-full txt-s txt-bold txt-truncate link link--gray py6 cursor-pointer"
data-orientation="vertical"
data-radix-collection-item=""
data-state="closed"
data-testid="accordion-trigger-one"
Expand All @@ -210,6 +236,7 @@ exports[`Accordion disabled renders 1`] = `
</button>
<div
aria-labelledby="radix-13"
data-orientation="vertical"
data-state="closed"
hidden=""
id="radix-12"
Expand All @@ -218,12 +245,14 @@ exports[`Accordion disabled renders 1`] = `
/>
</div>
<div
data-orientation="vertical"
data-state="closed"
>
<button
aria-controls="radix-14"
aria-expanded="false"
class="w-full txt-s txt-bold txt-truncate link link--gray py6 cursor-pointer"
data-orientation="vertical"
data-radix-collection-item=""
data-state="closed"
data-testid="accordion-trigger-two"
Expand All @@ -236,6 +265,7 @@ exports[`Accordion disabled renders 1`] = `
</button>
<div
aria-labelledby="radix-15"
data-orientation="vertical"
data-state="closed"
hidden=""
id="radix-14"
Expand All @@ -244,12 +274,14 @@ exports[`Accordion disabled renders 1`] = `
/>
</div>
<div
data-orientation="vertical"
data-state="closed"
>
<button
aria-controls="radix-16"
aria-expanded="false"
class="w-full txt-s txt-bold txt-truncate link link--gray py6 cursor-default color-gray-light"
data-orientation="vertical"
data-radix-collection-item=""
data-state="closed"
data-testid="accordion-trigger-three"
Expand All @@ -263,6 +295,7 @@ exports[`Accordion disabled renders 1`] = `
</button>
<div
aria-labelledby="radix-17"
data-orientation="vertical"
data-state="closed"
hidden=""
id="radix-16"
Expand Down
Loading

0 comments on commit 6f59fc7

Please sign in to comment.