Skip to content

Commit da7a14d

Browse files
author
Elliot
authored
Action List: Remove highlights on selected items (and hovered items when onClickRowSelect is true) (#894)
* Minor docs changes * Removed purple color from selected rows * Removed blue highlight when onClickRowSelect is true * Added CHANGELOG entry
1 parent 2bc61e2 commit da7a14d

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- `MenuItem` renders an empty Box with the same size as the icon(s) of sibling `MenuItem's (if any)
2424
- `MenuList`, `MenuGroup` contain piece of state the tracks the size of the preserved icon space
2525
- Labels in `FieldInline` and `ButtonItem` now include the `for` attribute
26+
- `ActionList` no longer highlights selected rows or hovered rows (when onClickRowSelect is true)
2627
- Fields have more explicit line-heights to enforce consistent layout.
2728
- `Fieldset` default spacing switched from `xsmall` to `small` to improve visual relationship with their `Input*`
2829

@@ -33,7 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3334
- Clears out old `defaultValue` when new `defaultValue` is passed in
3435
- Clears out any user input after pressing cancel button
3536
- Updated test suite to prevent future regressions for the above fixes
36-
- `InlineInputText` add placeholder attribute
37+
- `InlineInputText` add placeholder attribute
3738

3839
### Removed
3940

packages/components/src/ActionList/ActionListRow.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,13 @@ ActionListRowLayout.displayName = 'ActionListRowLayout'
8282
export const ActionListRow = styled(ActionListRowLayout)`
8383
display: flex;
8484
85-
background: ${({ checked, disabled, hasCheckbox, theme }) =>
86-
disabled
87-
? theme.colors.palette.charcoal100
88-
: checked && hasCheckbox
89-
? theme.colors.palette.purple000
90-
: undefined};
85+
background: ${({ disabled, theme }) =>
86+
disabled && theme.colors.palette.charcoal100};
9187
9288
&:focus,
9389
&:hover {
9490
box-shadow: ${({ theme, supportsRaised, onClick }) =>
9591
supportsRaised && onClick && theme.shadows[2]};
96-
background: ${({ theme, supportsRaised, onClick }) =>
97-
!supportsRaised && onClick && theme.colors.palette.blue100};
9892
cursor: ${({ onClick }) => onClick && 'pointer'};
9993
outline: none;
10094

packages/playground/src/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@
2727
import React from 'react'
2828
import ReactDOM from 'react-dom'
2929
import { ComponentsProvider } from '@looker/components'
30-
import { RangeSliderDemo } from './Form/RangeSliderDemo'
31-
import { FieldsDemo } from './Form/FieldsDemo'
30+
import { ActionListDemo } from './ActionList/ActionListDemo'
3231

3332
const App: React.FC = () => {
3433
return (
3534
<ComponentsProvider>
36-
<RangeSliderDemo />
37-
<FieldsDemo />
35+
<ActionListDemo />
3836
</ComponentsProvider>
3937
)
4038
}

packages/www/src/documentation/components/content/action-list.mdx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,24 @@ The `<ActionListItemAction>` component represents an actionable item on the rows
147147

148148
In the event that your page and `<ActionList>` render before data is available (i.e. before a Promise resolves), you can use an `<ActionListManager>` component to conditionally render a loading icon until your data is ready.
149149

150-
Passing a falsy value into an `<ActionListManager>`'s `isLoading` prop will render a `<Spinner>` icon. Once the `isLoading` prop receives a boolean 'true', its child will rendered instead.
150+
Passing "false" into an `<ActionListManager>`'s `isLoading` prop will render a `<Spinner>` icon. Once you pass in "true" into the `isLoading` prop, the `<ActionListManager>` will render its children instead.
151151

152-
You can also use an `<ActionListManager>` element to render a "No Results" message using the `noResults` prop.
152+
Additionally, you can render a "No Results" message using the `noResults` prop. When `noResults` is "true", the `<ActionListManager>` will display a "No Results" message in place of its children.
153+
154+
To customize the "No Results" message text, use the `noResultsText` prop.
153155

154156
```jsx
155157
;() => {
156158
const [isLoading, setIsLoading] = useState(true)
157159
setTimeout(() => setIsLoading(false), 5000)
158160

161+
// Change noResults to "true" to render the noResultsText
159162
return (
160-
<ActionListManager isLoading={isLoading} noResults={false}>
163+
<ActionListManager
164+
isLoading={isLoading}
165+
noResults={false}
166+
noResultsText={'No Cheese Here :('}
167+
>
161168
Swiss
162169
</ActionListManager>
163170
)

0 commit comments

Comments
 (0)