Skip to content

Commit caeaed2

Browse files
authored
chore: Release 1/5/22 (#2929)
Latest updates including fixes for #2928 and #2921
1 parent 79ebaaf commit caeaed2

File tree

198 files changed

+4008
-539
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+4008
-539
lines changed

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,48 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# 2.8.14
7+
8+
## `@looker/components` 2.8.14
9+
10+
### Bug Fixes
11+
12+
- **Button:** Shrinking in flex layouts
13+
- **DataTable:** Header icon duplicate tooltip
14+
- **Tab/Tab2:** Text vertical alignment
15+
16+
## `@looker/filter-components` 0.10.14
17+
18+
### Features
19+
20+
- **DateFilter:** Localize units
21+
22+
### Bug Fixes
23+
24+
- Input error styling
25+
26+
## `@looker/visualizations` 0.2.7
27+
28+
### Features
29+
30+
- Row totals support
31+
32+
### Bug Fixes
33+
34+
- Hide y-axis label when query has multiple measures
35+
36+
## `@looker/visualizations-table` 0.2.7
37+
38+
### Features
39+
40+
- **Table:** Zebra-style row background
41+
42+
## `@looker/visualizations-visx` 0.2.6
43+
44+
### Features
45+
46+
- **Pie:** Labels mode for legend type
47+
648
# 2.8.13
749

850
## `@looker/components` 2.8.13

packages/components-providers/src/TrapStack/TrapStackProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import React, { useRef, useMemo } from 'react'
2929
import type { Trap, TrapStackContextProps, TrapMap } from './types'
3030
import { getActiveTrap } from './utils'
3131

32-
export interface TrapStackProviderProps<O extends unknown = unknown> {
32+
export interface TrapStackProviderProps<O = unknown> {
3333
activate: (trap: Trap<O>) => () => void
3434
children?: ReactNode
3535
context: Context<TrapStackContextProps<O>>

packages/components-providers/src/TrapStack/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626

2727
import type { MutableRefObject } from 'react'
2828

29-
export interface Trap<O extends unknown = unknown> {
29+
export interface Trap<O = unknown> {
3030
element: HTMLElement
3131
options?: O
3232
}
3333

34-
export interface TrapStackContextProps<O extends unknown = unknown> {
34+
export interface TrapStackContextProps<O = unknown> {
3535
/**
3636
* Stores the element for the active trap (undefined if none are active)
3737
*/
@@ -58,6 +58,6 @@ export interface TrapStackContextProps<O extends unknown = unknown> {
5858
removeTrap?: (id: string) => void
5959
}
6060

61-
export interface TrapMap<O extends unknown = unknown> {
61+
export interface TrapMap<O = unknown> {
6262
[key: string]: Trap<O>
6363
}

packages/components-providers/src/TrapStack/utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
*/
2626
import type { TrapMap } from './types'
2727

28-
export const getActiveTrap = <O extends unknown = unknown>(
29-
trapMap: TrapMap<O>
30-
) => {
28+
export const getActiveTrap = <O = unknown>(trapMap: TrapMap<O>) => {
3129
// Sort the traps according to their element's dom position and return the last
3230
// which we assume to be stacked on top since all components using Portal
3331
// share a single zIndexFloor and use dom order to determine stacking

packages/components-test-utils/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
"@looker/eslint-config-oss"
2727
]
2828
},
29-
"gitHead": "734f77cda8050d9eea83a187113333dfad8650ca"
29+
"gitHead": "734f77cda8050d9eea83a187113333dfad8650ca",
30+
"dependencies": {}
3031
}

packages/components/src/Button/Button.stories.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,21 @@ export const ShrinkingIconRepro = () => {
123123
</ThemeProvider>
124124
)
125125
}
126-
ShrinkingIconRepro.parameters = {
127-
storyshots: { disable: true },
126+
127+
export const ShrinkingButtonRepro = () => {
128+
return (
129+
<ThemeProvider
130+
theme={theme => ({
131+
...theme,
132+
defaults: { ...theme.defaults, brandAnimation: true },
133+
})}
134+
>
135+
<Box2 display="flex" width={200}>
136+
<Box2 width={250}>Some text</Box2>
137+
<Button>Don't shrink me</Button>
138+
</Box2>
139+
</ThemeProvider>
140+
)
128141
}
129142

130143
export default {

packages/components/src/Button/ButtonBase.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const buttonCSS = css<ButtonColorProps>`
5959
border-radius: ${({ theme }) => theme.radii.medium};
6060
cursor: pointer;
6161
display: inline-flex;
62+
flex-shrink: 0;
6263
font-family: ${({ theme }) => theme.fonts.brand};
6364
font-weight: ${({ theme }) => theme.fontWeights.medium};
6465
justify-content: center;

packages/components/src/DataTable/Header/DataTableHeaderCell.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { Space } from '../../Layout/Space'
3434
import { Tooltip } from '../../Tooltip'
3535
import { Truncate } from '../../Truncate'
3636
import { useClickable } from '../../utils'
37+
import { VisuallyHidden } from '../../VisuallyHidden'
3738
import { columnSize, sizeInfersTruncate } from '../Column/columnSize'
3839
import type { DataTableColumn } from '../Column'
3940
import { FocusableCell } from '../Column/FocusableCell'
@@ -73,9 +74,12 @@ const DataTableHeaderCellLayout = forwardRef(
7374

7475
if (titleIcon) {
7576
label = (
76-
<Tooltip content={title}>
77-
<Icon color="ui3" title={title} icon={titleIcon} size="small" />
78-
</Tooltip>
77+
<>
78+
<VisuallyHidden>{title}</VisuallyHidden>
79+
<Tooltip content={title}>
80+
<Icon color="ui3" icon={titleIcon} size="small" />
81+
</Tooltip>
82+
</>
7983
)
8084
} else if (size && sizeInfersTruncate(size)) {
8185
label = <Truncate width="auto">{title}</Truncate>

packages/components/src/Dialog/Dialog.spec.tsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ describe('Dialog', () => {
5454
renderWithTheme(
5555
<Dialog isOpen placement="top" content={<SimpleContent />} />
5656
)
57-
expect(screen.queryByText('Dialog content')).toBeInTheDocument()
57+
expect(screen.getByText('Dialog content')).toBeInTheDocument()
5858
})
5959

6060
test('defaultOpen', async () => {
6161
renderWithTheme(<Dialog defaultOpen content={<DialogMediumContent />} />)
62-
expect(screen.queryByText(/We the People/)).toBeInTheDocument()
62+
expect(screen.getByText(/We the People/)).toBeInTheDocument()
6363
expect(
64-
screen.queryByLabelText(/The Constitution/, {
64+
screen.getByLabelText(/The Constitution/, {
6565
selector: '[role="dialog"]',
6666
})
6767
).toBeInTheDocument()
6868
const doneButton = screen.getByText('Done Reading')
6969
fireEvent.click(doneButton)
70-
await waitForElementToBeRemoved(() => screen.getByText(/We the People/))
70+
await waitForElementToBeRemoved(() => screen.queryByText(/We the People/))
7171
})
7272

7373
test('Dialog can be opened & closed', async () => {
@@ -84,12 +84,12 @@ describe('Dialog', () => {
8484
const link = screen.getByText('Open Dialog')
8585
expect(link).toBeInTheDocument()
8686
fireEvent.click(link)
87-
expect(screen.queryByText('Dialog content')).toBeInTheDocument()
87+
expect(screen.getByText('Dialog content')).toBeInTheDocument()
8888

8989
// Close the Dialog
9090
const doneButton = screen.getByText('Done')
9191
fireEvent.click(doneButton)
92-
await waitForElementToBeRemoved(() => screen.getByText('Dialog content'))
92+
await waitForElementToBeRemoved(() => screen.queryByText('Dialog content'))
9393
})
9494

9595
test('Backdrop can be clicked to close', async () => {
@@ -100,13 +100,13 @@ describe('Dialog', () => {
100100
)
101101

102102
// Confirm Dialog is open
103-
expect(screen.queryByText('Dialog content')).toBeInTheDocument()
103+
expect(screen.getByText('Dialog content')).toBeInTheDocument()
104104

105105
// Find & click the backdrop
106106
fireEvent.click(screen.getByTestId('backdrop'))
107107

108108
// Confirm Dialog closes
109-
await waitForElementToBeRemoved(() => screen.getByText('Dialog content'))
109+
await waitForElementToBeRemoved(() => screen.queryByText('Dialog content'))
110110
})
111111

112112
test('Render props style', async () => {
@@ -119,12 +119,12 @@ describe('Dialog', () => {
119119
// Open Dialog
120120
const link = screen.getByText('Open Dialog')
121121
fireEvent.click(link)
122-
expect(screen.queryByText('Dialog content')).toBeInTheDocument()
122+
expect(screen.getByText('Dialog content')).toBeInTheDocument()
123123

124124
// Close the Dialog
125125
const doneButton = screen.getByText('Done')
126126
fireEvent.click(doneButton)
127-
await waitForElementToBeRemoved(() => screen.getByText('Dialog content'))
127+
await waitForElementToBeRemoved(() => screen.queryByText('Dialog content'))
128128
})
129129

130130
test('Controlled', async () => {
@@ -133,12 +133,12 @@ describe('Dialog', () => {
133133
// Open Dialog
134134
const link = screen.getByText('Open Dialog')
135135
fireEvent.click(link)
136-
expect(screen.queryByText(/We the People/)).toBeInTheDocument()
136+
expect(screen.getByText(/We the People/)).toBeInTheDocument()
137137

138138
// Close the Dialog
139139
const doneButton = screen.getByText('Done Reading')
140140
fireEvent.click(doneButton)
141-
await waitForElementToBeRemoved(() => screen.getByText(/We the People/))
141+
await waitForElementToBeRemoved(() => screen.queryByText(/We the People/))
142142
})
143143

144144
test('Controlled no callbacks', async () => {
@@ -158,7 +158,7 @@ describe('Dialog', () => {
158158
// Open Dialog
159159
const link = screen.getByText('Open Dialog')
160160
fireEvent.click(link)
161-
expect(screen.queryByText(/We the People/)).toBeInTheDocument()
161+
expect(screen.getByText(/We the People/)).toBeInTheDocument()
162162
})
163163

164164
test('Controlled - no children', async () => {
@@ -167,12 +167,12 @@ describe('Dialog', () => {
167167
// Open Dialog
168168
const link = screen.getByText('Open Dialog')
169169
fireEvent.click(link)
170-
expect(screen.queryByText(/We the People/)).toBeInTheDocument()
170+
expect(screen.getByText(/We the People/)).toBeInTheDocument()
171171

172172
// Close the Dialog
173173
const doneButton = screen.getByText('Done Reading')
174174
fireEvent.click(doneButton)
175-
await waitForElementToBeRemoved(() => screen.getByText(/We the People/))
175+
await waitForElementToBeRemoved(() => screen.queryByText(/We the People/))
176176
})
177177

178178
test('Controlled - legacy', async () => {
@@ -181,12 +181,12 @@ describe('Dialog', () => {
181181
// Open Dialog
182182
const link = screen.getByText('Open Dialog')
183183
fireEvent.click(link)
184-
expect(screen.queryByText(/We the People/)).toBeInTheDocument()
184+
expect(screen.getByText(/We the People/)).toBeInTheDocument()
185185

186186
// Close the Dialog
187187
const doneButton = screen.getByText('Done Reading')
188188
fireEvent.click(doneButton)
189-
await waitForElementToBeRemoved(() => screen.getByText(/We the People/))
189+
await waitForElementToBeRemoved(() => screen.queryByText(/We the People/))
190190
})
191191

192192
describe('Animation behavior', () => {
@@ -220,7 +220,9 @@ describe('Dialog', () => {
220220
runTimers()
221221
expect(onAfterOpen).toBeCalled()
222222
fireEvent.click(screen.getByText('Done'))
223-
await waitForElementToBeRemoved(() => screen.getByText('Dialog content'))
223+
await waitForElementToBeRemoved(() =>
224+
screen.queryByText('Dialog content')
225+
)
224226
expect(onAfterClose).toBeCalled()
225227
})
226228

@@ -240,7 +242,7 @@ describe('Dialog', () => {
240242
// Close button has tooltip on next focus
241243
fireEvent.blur(closeButton)
242244
fireEvent.focus(closeButton)
243-
expect(screen.queryByRole('tooltip')).toBeInTheDocument()
245+
expect(screen.getByRole('tooltip')).toBeInTheDocument()
244246
// Close the dialog to avoid act warning
245247
fireEvent.click(closeButton)
246248

packages/components/src/Dialog/Layout/DialogLayout.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('DialogLayout', () => {
4444

4545
test('Replaces the built-in `IconButton` with an arbitrary ReactNode', () => {
4646
renderWithTheme(<HeaderDetail />)
47-
expect(screen.queryByText('Header text')).toBeInTheDocument()
47+
expect(screen.getByText('Header text')).toBeInTheDocument()
4848
expect(screen.getByText('Cancel')).toBeInTheDocument()
4949
})
5050

0 commit comments

Comments
 (0)