Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update align prop value across various components #17834

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 38 additions & 26 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -793,13 +793,17 @@ Map {
"args": Array [
Array [
"top",
"top-left",
"top-right",
"bottom",
"bottom-left",
"bottom-right",
"left",
"right",
"top-start",
"top-end",
"bottom-start",
"bottom-end",
"left-end",
"left-start",
"right-end",
"right-start",
],
],
"type": "oneOf",
Expand Down Expand Up @@ -1454,17 +1458,17 @@ Map {
"args": Array [
Array [
"top",
"top-left",
"bottom",
"left",
"right",
"top-start",
"top-right",
"top-end",
"bottom",
"bottom-left",
"bottom-start",
"bottom-right",
"bottom-end",
"left",
"right",
"left-end",
"left-start",
"right-end",
"right-start",
],
],
"type": "oneOf",
Expand Down Expand Up @@ -1801,13 +1805,17 @@ Map {
"args": Array [
Array [
"top",
"top-left",
"top-right",
"bottom",
"bottom-left",
"bottom-right",
"left",
"right",
"top-start",
"top-end",
"bottom-start",
"bottom-end",
"left-end",
"left-start",
"right-end",
"right-start",
],
],
"type": "oneOf",
Expand Down Expand Up @@ -1841,13 +1849,17 @@ Map {
"args": Array [
Array [
"top",
"top-left",
"top-right",
"bottom",
"bottom-left",
"bottom-right",
"left",
"right",
"top-start",
"top-end",
"bottom-start",
"bottom-end",
"left-end",
"left-start",
"right-end",
"right-start",
],
],
"type": "oneOf",
Expand Down Expand Up @@ -4234,17 +4246,17 @@ Map {
"args": Array [
Array [
"top",
"top-left",
"bottom",
"left",
"right",
"top-start",
"top-right",
"top-end",
"bottom",
"bottom-left",
"bottom-start",
"bottom-right",
"bottom-end",
"left",
"right",
"left-end",
"left-start",
"right-end",
"right-start",
],
],
"type": "oneOf",
Expand Down
27 changes: 18 additions & 9 deletions packages/react/src/components/CodeSnippet/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ export interface CodeSnippetProps {
*/
align?:
| 'top'
| 'top-left'
| 'top-right'
| 'bottom'
| 'bottom-left'
| 'bottom-right'
| 'left'
| 'right';
| 'right'
| 'top-start'
| 'top-end'
| 'bottom-start'
| 'bottom-end'
| 'left-end'
| 'left-start'
| 'right-end'
| 'right-start';

/**
* **Experimental**: Will attempt to automatically align the tooltip
Expand Down Expand Up @@ -420,13 +424,18 @@ CodeSnippet.propTypes = {
*/
align: PropTypes.oneOf([
'top',
'top-left',
'top-right',
'bottom',
'bottom-left',
'bottom-right',
'left',
'right',
// new values to match floating-ui
'top-start',
'top-end',
'bottom-start',
'bottom-end',
'left-end',
'left-start',
'right-end',
'right-start',
]),

/**
Expand Down
15 changes: 8 additions & 7 deletions packages/react/src/components/ComboButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,18 @@ ComboButton.propTypes = {
*/
tooltipAlignment: PropTypes.oneOf([
'top',
'top-left',
'bottom',
'left',
'right',
// new values to match floating-ui
'top-start',
'top-right',
'top-end',
'bottom',
'bottom-left',
'bottom-start',
'bottom-right',
'bottom-end',
'left',
'right',
'left-end',
'left-start',
'right-end',
'right-start',
]),

/**
Expand Down
27 changes: 18 additions & 9 deletions packages/react/src/components/Copy/Copy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ interface CopyProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
*/
align?:
| 'top'
| 'top-left'
| 'top-right'
| 'bottom'
| 'bottom-left'
| 'bottom-right'
| 'bottom-start'
| 'bottom-end'
| 'left'
| 'right';
| 'right'
| 'top-start'
| 'top-end'
| 'left-end'
| 'left-start'
| 'right-end'
| 'right-start';

/**
* **Experimental**: Will attempt to automatically align the tooltip
Expand Down Expand Up @@ -141,13 +145,18 @@ Copy.propTypes = {
*/
align: PropTypes.oneOf([
'top',
'top-left',
'top-right',
'bottom',
'bottom-left',
'bottom-right',
'left',
'right',
// new values to match floating-ui
'top-start',
'top-end',
'bottom-start',
'bottom-end',
'left-end',
'left-start',
'right-end',
'right-start',
]),

/**
Expand Down
27 changes: 18 additions & 9 deletions packages/react/src/components/CopyButton/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ export interface CopyButtonProps extends ButtonProps<'button'> {
*/
align?:
| 'top'
| 'top-left'
| 'top-right'
| 'bottom'
| 'bottom-left'
| 'bottom-right'
| 'bottom-start'
| 'bottom-end'
| 'left'
| 'right';
| 'right'
| 'top-start'
| 'top-end'
| 'left-end'
| 'left-start'
| 'right-end'
| 'right-start';

/**
* **Experimental**: Will attempt to automatically align the tooltip
Expand Down Expand Up @@ -96,13 +100,18 @@ CopyButton.propTypes = {
*/
align: PropTypes.oneOf([
'top',
'top-left',
'top-right',
'bottom',
'bottom-left',
'bottom-right',
'left',
'right',
// new values to match floating-ui
'top-start',
'top-end',
'bottom-start',
'bottom-end',
'left-end',
'left-start',
'right-end',
'right-start',
]),

/**
Expand Down
29 changes: 15 additions & 14 deletions packages/react/src/components/IconButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ interface IconButtonProps
*/
align?:
| 'top'
| 'top-left'
| 'top-start'
| 'top-right'
| 'top-end'
| 'bottom'
| 'bottom-left'
| 'bottom-start'
| 'bottom-right'
| 'bottom-end'
| 'left'
| 'right';
| 'right'
| 'top-start'
| 'top-end'
| 'left-end'
| 'left-start'
| 'right-end'
| 'right-start';

/**
* **Experimental**: Will attempt to automatically align the tooltip
Expand Down Expand Up @@ -172,17 +172,18 @@ IconButton.propTypes = {
*/
align: PropTypes.oneOf([
'top',
'top-left',
'bottom',
'left',
'right',
// new values to match floating-ui
'top-start',
'top-right',
'top-end',
'bottom',
'bottom-left',
'bottom-start',
'bottom-right',
'bottom-end',
'left',
'right',
'left-end',
'left-start',
'right-end',
'right-start',
]),

/**
Expand Down
16 changes: 8 additions & 8 deletions packages/react/src/components/OverflowMenu/next/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ interface OverflowMenuProps {
*/
tooltipAlignment?:
| 'top'
| 'top-left'
| 'top-right'
| 'top-start'
| 'top-end'
| 'bottom'
| 'bottom-left'
| 'bottom-right'
| 'bottom-start'
| 'bottom-end'
| 'left'
| 'right';

Expand Down Expand Up @@ -276,11 +276,11 @@ OverflowMenu.propTypes = {
*/
tooltipAlignment: PropTypes.oneOf([
'top',
'top-left',
'top-right',
'top-start',
'top-end',
'bottom',
'bottom-left',
'bottom-right',
'bottom-start',
'bottom-end',
'left',
'right',
]),
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ const Pagination = React.forwardRef(function Pagination(
<CaretLeft />
</IconButton>
<IconButton
align="top-right"
align="top-end"
disabled={forwardButtonDisabled || isLastPage}
kind="ghost"
className={forwardButtonClasses}
Expand Down
Loading