-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into tag-button-position
- Loading branch information
Showing
35 changed files
with
843 additions
and
354 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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
title: TextEllipsis | ||
description: A utility component to truncate long text and provide an alternative means of accessing hidden text | ||
source: https://github.com/dequelabs/cauldron/tree/develop/packages/react/src/components/TextEllipsis/index.tsx | ||
--- | ||
|
||
import { TextEllipsis, Link } from '@deque/cauldron-react' | ||
|
||
```js | ||
import { TextEllipsis } from '@deque/cauldron-react' | ||
``` | ||
|
||
`TextEllipsis` is a utility component to provide an accessible means of preventing overflow for text that does not fit within a constrained area. | ||
|
||
<Note> | ||
This component should be used sparingly and only when absolutely necessary. While this component addresses specific accessibility issues ([1.4.10 Reflow](https://www.w3.org/WAI/WCAG22/Understanding/reflow.html), [1.4.12 Text Spacing](https://www.w3.org/WAI/WCAG22/Understanding/text-spacing.html)) that may arise from overflowing text, ellipsizing text can still present usability issues to users as additional interaction is needed to show the full text content. | ||
</Note> | ||
|
||
Some good examples of where it's appropriate to use this component: | ||
|
||
- Long URL links | ||
- Long user provided content or names | ||
- Links that point to a page that contains non-truncated text | ||
|
||
Truncation should **not** be used on headers, labels, error messages, or notifications. | ||
|
||
## Examples | ||
|
||
### One-line Ellipsis | ||
|
||
```jsx example | ||
<TextEllipsis>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</TextEllipsis> | ||
``` | ||
|
||
If your component is a Button, Link, or some other kind of interactive element with a `tabIndex`, you _must_ provide your component as a Polymorphic component using the `as` prop to avoid nesting interactive elements: | ||
|
||
```jsx example | ||
<TextEllipsis as={Link}>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</TextEllipsis> | ||
``` | ||
|
||
<Note> | ||
When using the `as` property it is expected the element getting passed in is an interactive element. Passing an element that is not interactive will result in accessibility issues. | ||
</Note> | ||
|
||
### Multi-line Ellipsis | ||
|
||
```jsx example | ||
<TextEllipsis maxLines={2}> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. | ||
</TextEllipsis> | ||
``` | ||
|
||
## Props | ||
|
||
<ComponentProps | ||
children={{ | ||
required: true, | ||
type: 'string' | ||
}} | ||
refType="HTMLElement" | ||
props={[ | ||
{ | ||
name: 'maxLines', | ||
type: 'number', | ||
defaultValue: '1', | ||
description: 'Sets the maximum number of display line before truncation.' | ||
}, | ||
{ | ||
name: 'as', | ||
type: ['React.ElementType', 'string'], | ||
description: 'A component to render the TextEllipsis as.', | ||
}, | ||
{ | ||
name: 'tooltipProps', | ||
type: 'object', | ||
description: 'Props to pass and configure the displayed tooltip.' | ||
} | ||
]} | ||
/> | ||
|
||
## Related Components | ||
|
||
- [Tooltip](./Tooltip) |
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
85 changes: 0 additions & 85 deletions
85
packages/react/__tests__/src/components/LoaderOverlay/index.js
This file was deleted.
Oops, something went wrong.
102 changes: 0 additions & 102 deletions
102
packages/react/__tests__/src/components/Stepper/index.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.