-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DragDrop): new drag drop styling fixes (#9784)
* feat(DragDrop): introduce new package and deprecate old implementation * refactor a bunch * style fixes * fix lint errors * fix lint * update snap * update duallistselector example, try exporting interface from separate file * bump versions in dragdrop for mismatch * fix versions * pr feedback * fix versions after merge * version update after rebase * update md * move into next folder for docgen * update version after rebase * update ver after rebase * update ver after rebase * update ver after rebase * remove unused prop, update wording * move some examples to demos * update ver after rebase * update new demos text * update wording p1 * update wording p2 * update wording p3 * update wording p4 * fix links * remove beta flags since page is beta * update ver after rebase --------- Co-authored-by: nicolethoen <[email protected]>
- Loading branch information
1 parent
c90c7f2
commit 19ddee7
Showing
37 changed files
with
1,008 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './DragDrop'; | ||
export * from './Draggable'; | ||
export * from './Droppable'; | ||
export * from './DroppableContext'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
export * from './DualListSelector'; | ||
export * from './DualListSelectorContext'; | ||
export * from './DualListSelectorControl'; | ||
export * from './DualListSelectorControlsWrapper'; | ||
export * from './DualListSelectorPane'; | ||
export * from './DualListSelectorList'; | ||
export * from './DualListSelectorListItem'; | ||
export * from './DualListSelectorTree'; | ||
export * from './DualListSelectorContext'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "@patternfly/react-drag-drop", | ||
"version": "5.2.0-prelease.0", | ||
"description": "PatternFly drag and drop solution", | ||
"main": "dist/js/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/esm/index.d.ts", | ||
"sideEffects": false, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"patternfly:src": "src/", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/patternfly/patternfly-react.git" | ||
}, | ||
"keywords": [ | ||
"react", | ||
"patternfly", | ||
"drag-drop" | ||
], | ||
"author": "Red Hat", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/patternfly/patternfly-react/issues" | ||
}, | ||
"homepage": "https://github.com/patternfly/patternfly-react/tree/main/packages/react-drag-drop#readme", | ||
"scripts": { | ||
"clean": "rimraf dist" | ||
}, | ||
"dependencies": { | ||
"@dnd-kit/core": "^6.0.8", | ||
"@dnd-kit/modifiers": "^6.0.1", | ||
"@dnd-kit/sortable": "^7.0.2", | ||
"@patternfly/react-core": "^5.2.0-prerelease.41", | ||
"@patternfly/react-icons": "^5.2.0-prerelease.9", | ||
"@patternfly/react-styles": "^5.2.0-prerelease.6", | ||
"memoize-one": "^5.1.0", | ||
"resize-observer-polyfill": "^1.5.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^17 || ^18", | ||
"react-dom": "^17 || ^18" | ||
}, | ||
"devDependencies": { | ||
"rimraf": "^2.6.2", | ||
"typescript": "^4.7.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './next'; |
27 changes: 27 additions & 0 deletions
27
packages/react-drag-drop/src/next/components/DragDrop/DragButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
import { css } from '@patternfly/react-styles'; | ||
import dragButtonStyles from '@patternfly/react-styles/css/components/DataList/data-list'; | ||
import buttonStyles from '@patternfly/react-styles/css/components/Button/button'; | ||
import GripVerticalIcon from '@patternfly/react-icons/dist/esm/icons/grip-vertical-icon'; | ||
|
||
export interface DragButtonProps extends React.HTMLProps<HTMLButtonElement> { | ||
/** Additional classes added to the drag button */ | ||
className?: string; | ||
/** Sets button type */ | ||
type?: 'button' | 'submit' | 'reset'; | ||
/** Flag indicating if drag is disabled for the item */ | ||
isDisabled?: boolean; | ||
} | ||
|
||
export const DragButton: React.FunctionComponent<DragButtonProps> = ({ className, ...props }: DragButtonProps) => ( | ||
<button | ||
className={css(className, buttonStyles.button, buttonStyles.modifiers.plain)} | ||
aria-label="Drag button" | ||
{...props} | ||
> | ||
<span className={css(dragButtonStyles.dataListItemDraggableIcon)}> | ||
<GripVerticalIcon /> | ||
</span> | ||
</button> | ||
); | ||
DragButton.displayName = 'DragButton'; |
Oops, something went wrong.