Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeControls: Improve UI + UX #19916

Merged
merged 34 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a05b713
Start with new RangeControl component
Jan 23, 2020
8f11bca
Add tooltipPosition to RangeControl
Jan 23, 2020
78d2813
Improve styles and interactions for new RangeControl
Jan 24, 2020
99e409d
Add custom marks support
Jan 24, 2020
9ae09dd
Updated UI for Ranger Control
Jan 24, 2020
bbb0398
Improve layout rendering of RangeControl
Jan 24, 2020
40fac8c
Add wrapper for legacy/next RangeControl.
Jan 24, 2020
0687ac9
Adjusting range-control styles
Jan 24, 2020
327dbcb
Update RangeControl UI and snapshots
Jan 25, 2020
7b21afc
Darken thumb color
Jan 25, 2020
f6aefdf
Consolidate legacy/next implementation. Update styles
Jan 27, 2020
8deb219
Update snapshot + remove RangeControlNext test
Jan 27, 2020
7afa6db
Update README for RangeControl
Jan 27, 2020
165f4d5
Add RTL support
Jan 27, 2020
be4847b
Update storybook snapshots
Jan 27, 2020
704e4f6
Remove unused Range Control SCSS
Jan 27, 2020
66c86e6
Remove color prop and shadow. Improve focus interaction
Jan 29, 2020
dbbbbcc
Formatted RangeControl files
Feb 3, 2020
f064832
Merge branch 'master' into try/range-controls-ui-update
Feb 3, 2020
19a0c50
Update storybook snapshot
Feb 3, 2020
5a79f68
Format rail.js file
Feb 4, 2020
3c29316
Reduce component public API to adjust aesthetics / interactions
Feb 5, 2020
25aeca1
Add RTL knob for RangeControl story
Feb 6, 2020
36ea3d8
Update Storybook snapshot
Feb 6, 2020
63e8329
Add RTL renderer (cssjanus) and style mixins
Feb 6, 2020
0d571e8
Replace Dashicon with @wordpress/icons. Update RTL usage in Component
Feb 6, 2020
2acb222
Update rtl rendering in RangeControl styles
Feb 6, 2020
0e23ded
Fix styling for ActionRightWrapper
Feb 6, 2020
3c405af
Remove unnecessary RTL. Adjust RTL in ThumbWrapper
Feb 6, 2020
3fbd9c7
Restore Dashicon with RangeControl
Feb 6, 2020
baff972
Add style fix for RangeControl x FontSizePicker
Feb 6, 2020
2cad85d
Migrate on RangeControl styles to FontSizePicker
Feb 6, 2020
4d3c112
Replace cssjanus with basic rtl solution
Feb 6, 2020
110831f
Fix e2e test for FontSizePicker
Feb 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 121 additions & 5 deletions packages/components/src/range-control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ If this property is true, a button to reset the the slider is rendered.
- Required: No
- Platform: Web | Mobile

#### disabled

Disables the `input`, preventing new values from being applied.

- Type: `Boolean`
- Required: No
- Platform: Web

#### initialPosition

If no value exists this prop contains the slider starting position.
Expand All @@ -160,13 +168,41 @@ If no value exists this prop contains the slider starting position.
- Required: No
- Platform: Web | Mobile

#### value

The current value of the range slider.
#### marks

- Type: `Number`
- Required: Yes
- Platform: Web | Mobile
Renders a visual representation of `step` ticks. Custom mark indicators can be provided by an `Array`.

Example:

```jsx
const marks = [
{
value: 0,
label: '0',
Comment on lines +181 to +182
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a common use case that the label would be the same as value, could we make it optional and fall back to a stringified value?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it's common yet :).
I can see cases where you may want to render '10%' instead

},
{
value: 1,
label: '1',
},
{
value: 8,
label: '8',
},
{
value: 10,
label: '10',
},
];

const MyRangeControl() {
return (<RangeControl marks={ marks } min={ 0 } max={ 10 } step={ 1 } />)
}
```

- Type: `Array|Boolean`
- Required: No
- Platform: Web

#### onChange

Expand All @@ -193,6 +229,86 @@ The maximum value accepted. If higher values are inserted onChange will not be c
- Required: No
- Platform: Web | Mobile

#### renderTooltipContent

A way to customize the rendered UI of the value. Example:

```jsx
const customTooltipContent = value => `${value}%`

const MyRangeControl() {
return (<RangeControl renderTooltipContent={ customTooltipContent } />)
}
```

- Type: `Function`
- Required: No
- Platform: Web

#### showTooltip

Forcing the Tooltip UI to show or hide.

- Type: `Boolean`
- Required: No
- Platform: Web

#### step

The stepping interval between `min` and `max` values. Step is used both for user interface and validation purposes.

- Type: `Number`
- Required: No
- Platform: Web

#### tooltipPosition

Determines the render position of the Tooltip. Either `auto` (default), `top`, or `bottom`.

- Type: `String`
- Required: No
- Platform: Web

#### tooltipTimeout

Determines the `timeout` (ms) to hide the Tooltip based on mouse movements.

- Type: `Number`
- Required: No
- Platform: Web

#### tooltipZIndex

Determines the CSS `z-index` property of the Tooltip.

- Type: `Number`
- Required: No
- Platform: Web
youknowriad marked this conversation as resolved.
Show resolved Hide resolved

#### value

The current value of the range slider.

- Type: `Number`
- Required: Yes
- Platform: Web | Mobile

#### width
youknowriad marked this conversation as resolved.
Show resolved Hide resolved

The width to render the Component.

- Type: `Number|String`
- Required: No
- Platform: Web

#### withInputField

Determines if the `input` number field will render next to the RangeControl.

- Type: `Boolean`
- Required: No
- Platform: Web
Comment on lines +276 to +278
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to describe the default here, since it might be unexpected that the default is true (that it's an opt-out, not an opt-in).


#### icon

An icon to be shown above the slider next to it's container title.
Expand Down
Loading