Skip to content

Commit

Permalink
Add labels to fields to make inspection easier
Browse files Browse the repository at this point in the history
  • Loading branch information
destructobeam committed Mar 30, 2019
1 parent 71df767 commit 35d636d
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/__tests__/__snapshots__/Async.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ exports[`defaults - snapshot 1`] = `
}
>
<div
className="css-10nd86i"
className="css-1pcexqc-container"
onKeyDown={[Function]}
>
<Control
Expand Down Expand Up @@ -264,7 +264,7 @@ exports[`defaults - snapshot 1`] = `
}
>
<div
className="css-vj8t7z"
className="css-bg1rzq-control"
onMouseDown={[Function]}
onTouchEnd={[Function]}
>
Expand Down Expand Up @@ -454,7 +454,7 @@ exports[`defaults - snapshot 1`] = `
}
>
<div
className="css-1492t68"
className="css-151xaom-placeholder"
>
Select...
</div>
Expand Down Expand Up @@ -574,6 +574,7 @@ exports[`defaults - snapshot 1`] = `
"border": 0,
"color": "inherit",
"fontSize": "inherit",
"label": "input",
"opacity": 1,
"outline": 0,
"padding": 0,
Expand Down Expand Up @@ -614,6 +615,7 @@ exports[`defaults - snapshot 1`] = `
"boxSizing": "content-box",
"color": "inherit",
"fontSize": "inherit",
"label": "input",
"opacity": 1,
"outline": 0,
"padding": 0,
Expand Down Expand Up @@ -828,7 +830,7 @@ exports[`defaults - snapshot 1`] = `
}
>
<span
className="css-d8oujb"
className="css-bgvzuu-indicatorSeparator"
/>
</IndicatorSeparator>
<DropdownIndicator
Expand Down Expand Up @@ -931,7 +933,7 @@ exports[`defaults - snapshot 1`] = `
>
<div
aria-hidden="true"
className="css-1ep9fjw"
className="css-16pqwjk-indicatorContainer"
onMouseDown={[Function]}
onTouchEnd={[Function]}
>
Expand Down
12 changes: 7 additions & 5 deletions src/__tests__/__snapshots__/AsyncCreatable.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ exports[`defaults - snapshot 1`] = `
}
>
<div
className="css-10nd86i"
className="css-1pcexqc-container"
onKeyDown={[Function]}
>
<Control
Expand Down Expand Up @@ -298,7 +298,7 @@ exports[`defaults - snapshot 1`] = `
}
>
<div
className="css-vj8t7z"
className="css-bg1rzq-control"
onMouseDown={[Function]}
onTouchEnd={[Function]}
>
Expand Down Expand Up @@ -498,7 +498,7 @@ exports[`defaults - snapshot 1`] = `
}
>
<div
className="css-1492t68"
className="css-151xaom-placeholder"
>
Select...
</div>
Expand Down Expand Up @@ -623,6 +623,7 @@ exports[`defaults - snapshot 1`] = `
"border": 0,
"color": "inherit",
"fontSize": "inherit",
"label": "input",
"opacity": 1,
"outline": 0,
"padding": 0,
Expand Down Expand Up @@ -663,6 +664,7 @@ exports[`defaults - snapshot 1`] = `
"boxSizing": "content-box",
"color": "inherit",
"fontSize": "inherit",
"label": "input",
"opacity": 1,
"outline": 0,
"padding": 0,
Expand Down Expand Up @@ -887,7 +889,7 @@ exports[`defaults - snapshot 1`] = `
}
>
<span
className="css-d8oujb"
className="css-bgvzuu-indicatorSeparator"
/>
</IndicatorSeparator>
<DropdownIndicator
Expand Down Expand Up @@ -995,7 +997,7 @@ exports[`defaults - snapshot 1`] = `
>
<div
aria-hidden="true"
className="css-1ep9fjw"
className="css-16pqwjk-indicatorContainer"
onMouseDown={[Function]}
onTouchEnd={[Function]}
>
Expand Down
1 change: 1 addition & 0 deletions src/components/Control.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const css = ({
isFocused,
theme: { colors, borderRadius, spacing },
}: ControlProps) => ({
label: 'control',
alignItems: 'center',
backgroundColor: isDisabled ? colors.neutral5 : colors.neutral0,
borderColor: isDisabled
Expand Down
1 change: 1 addition & 0 deletions src/components/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const Group = (props: GroupProps) => {
};

export const groupHeadingCSS = ({ theme: { spacing } }: GroupProps) => ({
label: 'group',
color: '#999',
cursor: 'default',
display: 'block',
Expand Down
1 change: 1 addition & 0 deletions src/components/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const inputCSS = ({ isDisabled, theme: { spacing, colors } }: InputProps)
color: colors.neutral80,
});
const inputStyle = isHidden => ({
label: 'input',
background: 0,
border: 0,
fontSize: 'inherit',
Expand Down
1 change: 1 addition & 0 deletions src/components/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export const menuCSS = ({
placement,
theme: { borderRadius, spacing, colors },
}: MenuStateWithProps) => ({
label: 'menu',
[alignToControl(placement)]: '100%',
backgroundColor: colors.neutral0,
borderRadius: borderRadius,
Expand Down
1 change: 1 addition & 0 deletions src/components/MultiValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type MultiValueProps = CommonProps & {
export const multiValueCSS = ({
theme: { spacing, borderRadius, colors },
}: MultiValueProps) => ({
label: 'multiValue',
backgroundColor: colors.neutral10,
borderRadius: borderRadius / 2,
display: 'flex',
Expand Down
1 change: 1 addition & 0 deletions src/components/Option.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const optionCSS = ({
isSelected,
theme: { spacing, colors },
}: OptionProps) => ({
label: 'option',
backgroundColor: isSelected
? colors.primary
: isFocused ? colors.primary25 : 'transparent',
Expand Down
1 change: 1 addition & 0 deletions src/components/Placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type PlaceholderProps = CommonProps & {
};

export const placeholderCSS = ({ theme: { spacing, colors } }: PlaceholderProps) => ({
label: 'placeholder',
color: colors.neutral50,
marginLeft: spacing.baseUnit / 2,
marginRight: spacing.baseUnit / 2,
Expand Down
1 change: 1 addition & 0 deletions src/components/SingleValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type ValueProps = {
export type SingleValueProps = CommonProps & ValueProps & State;

export const css = ({ isDisabled, theme: { spacing, colors } }: SingleValueProps) => ({
label: 'singleValue',
color: isDisabled ? colors.neutral40 : colors.neutral80,
marginLeft: spacing.baseUnit / 2,
marginRight: spacing.baseUnit / 2,
Expand Down
1 change: 1 addition & 0 deletions src/components/containers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type ContainerProps = CommonProps &
innerProps: { onKeyDown: KeyboardEventHandler },
};
export const containerCSS = ({ isDisabled, isRtl }: ContainerState) => ({
label: 'container',
direction: isRtl ? 'rtl' : null,
pointerEvents: isDisabled ? 'none' : null, // cancel mouse events when disabled
position: 'relative',
Expand Down
3 changes: 3 additions & 0 deletions src/components/indicators.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const baseCSS = ({
isFocused,
theme: { spacing: { baseUnit }, colors },
}: IndicatorProps) => ({
label: 'indicatorContainer',
color: isFocused ? colors.neutral60 : colors.neutral20,
display: 'flex',
padding: baseUnit * 2,
Expand Down Expand Up @@ -116,6 +117,7 @@ export const indicatorSeparatorCSS = ({
isDisabled,
theme: { spacing: { baseUnit }, colors },
}: (CommonProps & SeparatorState)) => ({
label: 'indicatorSeparator',
alignSelf: 'stretch',
backgroundColor: isDisabled ? colors.neutral10 : colors.neutral20,
marginBottom: baseUnit * 2,
Expand Down Expand Up @@ -153,6 +155,7 @@ export const loadingIndicatorCSS = ({
size: number,
theme: Theme,
}) => ({
label: 'loadingIndicator',
color: isFocused ? colors.neutral60 : colors.neutral20,
display: 'flex',
padding: baseUnit * 2,
Expand Down
1 change: 1 addition & 0 deletions src/internal/A11yText.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { css } from 'emotion';
const A11yText = (props: ElementConfig<'span'>) => (
<span
className={css({
label: 'a11yText',
zIndex: 9999,
border: 0,
clip: 'rect(1px, 1px, 1px, 1px)',
Expand Down
1 change: 1 addition & 0 deletions src/internal/DummyInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default class DummyInput extends Component<any> {
ref={innerRef}
{...props}
className={css({
label: 'dummyInput',
// get rid of any default styles
background: 0,
border: 0,
Expand Down

0 comments on commit 35d636d

Please sign in to comment.