Skip to content

Commit

Permalink
feat(Chip): use Label internally, deprecate Chip (#10049)
Browse files Browse the repository at this point in the history
* feat(Chip): use Label internally, deprecate Chip

* clean up rebase

* update references

* update chip usages, tests

* integration test updates

* code-editor to import deprecated chip

* update codeeditor example, update tests

* adjust closeBtnAriaLabel default

* use Label in ToolbarFilter
  • Loading branch information
kmcfaul authored Feb 19, 2024
1 parent 32be844 commit 5cdb725
Show file tree
Hide file tree
Showing 43 changed files with 453 additions and 733 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,31 @@ import PlayIcon from '@patternfly/react-icons/dist/esm/icons/play-icon';
### Basic

```ts file="./CodeEditorBasic.tsx"

```

### With sizeToFit height, height will grow/shrink with content

```ts file="./CodeEditorSizeToFit.tsx"

```

### With shortcut menu and main header content

These examples below are the shortcuts that we recommend describing in the popover since they are monaco features.

```ts file="./CodeEditorShortcutMainHeader.tsx"

```

### With actions

```ts file="./CodeEditorWithActions.tsx"

```

### With custom control

```ts file="CodeEditorCustomControl.tsx"

```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { CodeEditor, Language } from '@patternfly/react-code-editor';
import { Grid, GridItem, Chip } from '@patternfly/react-core';
import { Grid, GridItem, Label } from '@patternfly/react-core';

export const CodeEditorShortcutMainHeader: React.FunctionComponent = () => {
const onEditorDidMount = (editor, monaco) => {
Expand Down Expand Up @@ -40,9 +40,9 @@ export const CodeEditorShortcutMainHeader: React.FunctionComponent = () => {
<GridItem style={{ textAlign: 'right', marginRight: '1em' }}>
{shortcut.keys
.map((key) => (
<Chip key={key} isReadOnly>
<Label variant="outline" key={key}>
{key}
</Chip>
</Label>
))
.reduce((prev, curr) => (
<>{[prev, ' + ', curr]}</>
Expand Down
216 changes: 0 additions & 216 deletions packages/react-core/src/components/Chip/Chip.tsx

This file was deleted.

Loading

0 comments on commit 5cdb725

Please sign in to comment.