Skip to content

Commit

Permalink
Merge pull request #1408 from dequelabs/release-v6.3.0
Browse files Browse the repository at this point in the history
chore(cauldron): Release 6.3.0
  • Loading branch information
scurker authored Mar 14, 2024
2 parents 5d6c08d + df6ec9a commit 27a1f0c
Show file tree
Hide file tree
Showing 71 changed files with 2,547 additions and 1,322 deletions.
17 changes: 1 addition & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,5 @@ module.exports = {
react: {
version: '16'
}
},
overrides: [
{
files: '**/*/__tests__/**/*.js',
globals: {
jest: true,
test: true,
expect: true,
afterEach: true,
afterAll: true,
beforeEach: true,
beforeAll: true
}
},
{ files: '*.js', rules: { '@typescript-eslint/no-var-requires': 'off' } }
]
}
};
5 changes: 2 additions & 3 deletions .github/workflows/vpat-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ jobs:
add_labels:
runs-on: ubuntu-latest
steps:
- uses: dequelabs/action-vpat-labels@main
- uses: dequelabs/action-a11y-issue-labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
include-title: 1
label-customer: ""
label-production: ""
label-customer: "bug"
label-production: "bug"
label-vpat: "vpat"
label-a11y: "accessibility"
label-blocker: "vpat:blocker"
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [6.3.0](https://github.com/dequelabs/cauldron/compare/v6.2.1...v6.3.0) (2024-03-14)


### Features

* **react,styles:** add SearchField and internal TextFieldWrapper components ([#1372](https://github.com/dequelabs/cauldron/issues/1372)) ([46b16a1](https://github.com/dequelabs/cauldron/commit/46b16a14b8ec5fc1480cefa5ba4dd2ad8c478cbc))
* **react:** Add property to include trailing children for SearchField component ([#1385](https://github.com/dequelabs/cauldron/issues/1385)) ([88e97f1](https://github.com/dequelabs/cauldron/commit/88e97f1950a23b62fe5a4b2a7c3e9750e26fb397))
* **react:** add ref support to Link ([#1357](https://github.com/dequelabs/cauldron/issues/1357)) ([5d92f1e](https://github.com/dequelabs/cauldron/commit/5d92f1e2b49f6a5ce814de4c996c285c79d4fab4))
* **react:** Add TextEllipsis utility component ([#1354](https://github.com/dequelabs/cauldron/issues/1354)) ([3e6e4cd](https://github.com/dequelabs/cauldron/commit/3e6e4cd8aa661f3b81bcdddbd538f77706f23283))


### Bug Fixes

* **react:** ensure Tooltip cleans up association id after removal ([#1370](https://github.com/dequelabs/cauldron/issues/1370)) ([595b9fb](https://github.com/dequelabs/cauldron/commit/595b9fbc6d1a1dde87c0ff54d7c26c6f5e135241))

### [6.2.1](https://github.com/dequelabs/cauldron/compare/v6.2.0...v6.2.1) (2024-02-20)


Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ The testing methodology should account for both testing the interface of a compo

### Unit Tests

Cauldron uses [Jest](https://jestjs.io/) as its test runner to run unit tests along with [Enzyme](https://enzymejs.github.io/enzyme) (deprecated) and [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/). We are currently in the process of migrating tests away from Enzyme to React Testing Library so no new tests should be using Enzyme.
Cauldron uses [Jest](https://jestjs.io/) as its test runner to run unit tests along with [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/).

> [!IMPORTANT]
> We are currently in the process of migrating existing tests away from Enzyme to React Testing Library. New tests should **not** be written in Enzyme.
### Accessibility Testing

Expand Down
1 change: 1 addition & 0 deletions docs/components/Spacing.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.cauldron--theme-dark {
--spacing-list-name-color: var(--gray-20);
--spacing-list-base-color: var(--gray-40);
--spacing-example-color: var(--accent-light);
}

.Spacing__example {
Expand Down
9 changes: 5 additions & 4 deletions docs/pages/components/Link.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,24 @@ A link with visual styling applied to make it look like a button with reduced he
children={{
required: true
}}
refType="HTMLAnchorElement"
props={[
{
name: 'variant',
type: ['button', 'button-secondary'],
description: 'Visual style of the button.'
description: 'Visual style of the link as a button variant.'
},
{
name: 'thin',
type: 'boolean',
defaultValue: 'false',
description: 'Thinner visual style of button.'
description: 'Thinner visual style of link as a button variant.'
},
{
name: 'buttonRef',
name: 'linkRef',
type: 'function',
description:
'Ref function for the button element. Use this to access the button element directly.'
'Ref function for the link element. Use this to access the link element directly.'
}
]}
/>
Expand Down
128 changes: 128 additions & 0 deletions docs/pages/components/SearchField.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
title: SearchField
description: A form element that allows users to type in text for searching.
source: https://github.com/dequelabs/cauldron/tree/develop/packages/react/src/components/SearchField/index.tsx
---

import { SearchField, FieldWrap } from '@deque/cauldron-react';

```js
import { SearchField } from '@deque/cauldron-react';
```

<Note>
Use [FieldWrap](./FieldWrap) to wrap all input components. The `SearchField`
component has been designed specifically to only be used when rendered as a
child of this component, and may not be completely accessible if rendered
outside of `FieldWrap`.
</Note>

## Examples

### Resting

```jsx example
<FieldWrap>
<SearchField label="Resting" />
</FieldWrap>
```

### Disabled

```jsx example
<FieldWrap>
<SearchField label="Disabled" disabled />
</FieldWrap>
```

### Label Hidden

```jsx example
<FieldWrap>
<SearchField label="Hidden" hideLabel />
</FieldWrap>
```

### Usage in Form

By default, SearchField is wrapped in a `<form role="search">` to provide better accessibility hints to users of assistive technology. If your search field needs to be placed inside of an existing form, you must use isForm="false".

```jsx example
<form role="search">
<FieldWrap>
<SearchField label="Nested in Form" isForm={false} />
</FieldWrap>
</form>
```

### SearchField with trailing children

We include trailing children to allow for additional input context to be provided, such as texts, buttons, icons, etc. The trailing children will be placed at the right end of SearchField.

```jsx example
<FieldWrap>
<SearchField
label="Search Field with trailing children"
trailingChildren={
<span style={{ marginRight: '8px' }}>
<strong>1</strong> of <strong>1</strong>
</span>
}
/>
</FieldWrap>
```

## Props

<ComponentProps
className={true}
refType="HTMLInputElement"
props={[
{
name: 'label',
type: 'ContentNode',
required: true,
description: 'Label for the field.'
},
{
name: 'defaultValue',
type: 'string',
description:
'The default value to be applied to the field. Optionally used for "uncontrolled" fields.'
},
{
name: 'value',
type: 'string',
description:
'The value to be applied to the field. Used for "controlled" fields.'
},
{
name: 'onChange',
type: 'function',
description: "Callback function when the field's value changes."
},
{
name: 'hideLabel',
type: 'boolean',
description: 'If true, the label will be rendered off-screen.',
defaultValue: 'false'
},
{
name: 'isForm',
type: 'boolean',
description:
'If true, the label and input will be rendered in a `<form>` tag. If false, the label and input will be rendered in a `<div>` tag.',
defaultValue: 'true'
},
{
name: 'trailingChildren',
type: 'ReactNode',
description:
'If provided, the children will be slotted into the right end of the field.'
}
]}
/>

## Related Components

- [FieldWrap](./FieldWrap)
83 changes: 83 additions & 0 deletions docs/pages/components/TextEllipsis.mdx
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)
2 changes: 1 addition & 1 deletion docs/pages/components/Tooltip.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function BigTooltipExample() {
},
{
name: 'association',
type: ['aria-labelledby', 'aria-describedby'],
type: ['aria-labelledby', 'aria-describedby', 'none'],
description: 'Sets the aria relationship for the targeted element.',
defaultValue: 'aria-describedby'
},
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/components/TwoColumnPanel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ function TwoColumnPanelGroupedItemsExample() {
return (
<TwoColumnPanel>
<ColumnLeft aria-labelledby="group-heading">
<ColumnHeader>Grouped Items</ColumnHeader>
<ColumnHeader id="group-heading">Grouped Items</ColumnHeader>
<ColumnList>
<ColumnGroupHeader id="group-heading">
<ColumnGroupHeader>
<h3>Optional group heading</h3>
</ColumnGroupHeader>
<nav aria-labelledby="group-heading">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cauldron",
"private": true,
"version": "6.2.1",
"version": "6.3.0",
"license": "MPL-2.0",
"scripts": {
"clean": "rimraf dist docs/dist",
Expand Down
11 changes: 9 additions & 2 deletions packages/react/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ module.exports = {
plugins: ['ssr-friendly'],
overrides: [
{
files: ['__tests__/**/*', '**/*.test.[j|t]sx?', 'src/setupTests.ts'],
files: ['__tests__/**/*', '**/*/*.test.{j,t}sx', 'src/setupTests.ts'],
rules: {
'ssr-friendly/no-dom-globals-in-module-scope': 'off',
'ssr-friendly/no-dom-globals-in-constructor': 'off',
'ssr-friendly/no-dom-globals-in-react-cc-render': 'off',
'ssr-friendly/no-dom-globals-in-react-fc': 'off'
'ssr-friendly/no-dom-globals-in-react-fc': 'off',
'react/display-name': 'off'
}
},
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off'
}
}
]
Expand Down
Loading

0 comments on commit 27a1f0c

Please sign in to comment.