Skip to content

Commit

Permalink
Hide colorpicker legends; remove space instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Sep 23, 2024
1 parent 7b23874 commit f30081b
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 65 deletions.
3 changes: 2 additions & 1 deletion src/app/content/highlights/components/ColorIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Check } from 'styled-icons/fa-solid/Check';
import { isDefined } from '../../../guards';
import { highlightStyles } from '../../constants';
import { defaultFocusOutline } from '../../../theme';
import { useIntl } from 'react-intl';
import trashIcon from '../../../../assets/trash-347.svg';

interface StyleProps {
Expand Down Expand Up @@ -126,7 +127,7 @@ function TB({
<button
type='button'
className={className}
aria-label='remove highlight'
aria-label={useIntl().formatMessage({id: 'i18n:a11y:keyboard-shortcuts:deselect-highlight-color'})}
onClick={onClick}
>
<img src={trashIcon} alt='' />
Expand Down
13 changes: 5 additions & 8 deletions src/app/content/highlights/components/ColorPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { HighlightColorEnum } from '@openstax/highlighter/dist/api';
import React from 'react';
import { useIntl } from 'react-intl';
import { hiddenButAccessible } from '../../../theme';
import styled from 'styled-components/macro';
import { match, not } from '../../../fpUtils';
import { highlightStyles } from '../../constants';
Expand Down Expand Up @@ -87,6 +88,10 @@ const FSWrapper = styled.fieldset`
border: 0;
display: flex;
flex-direction: row;
legend {
${hiddenButAccessible}
}
`;

// tslint:disable-next-line:variable-name
Expand Down Expand Up @@ -169,12 +174,4 @@ export default styled(ColorPicker)`
overflow: visible;
gap: ${cardPadding}rem;
padding: ${cardPadding}rem 0.3rem;
legend {
position: absolute;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(1px, 1px, 1px, 1px);
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,19 @@ exports[`ContextMenu match snapshot when open 1`] = `
flex-direction: row;
}
.c14 legend {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
-webkit-clip: rect(0,0,0,0);
clip: rect(0,0,0,0);
white-space: nowrap;
border: 0;
}
.c16 {
border: 0;
outline: none;
Expand All @@ -438,15 +451,6 @@ exports[`ContextMenu match snapshot when open 1`] = `
padding: 0.8rem 0.3rem;
}
.c16 legend {
position: absolute;
height: 1px;
width: 1px;
overflow: hidden;
-webkit-clip: rect(1px,1px,1px,1px);
clip: rect(1px,1px,1px,1px);
}
.c4 {
cursor: pointer;
border: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,19 @@ exports[`ColorPicker matches snapshot no selection 1`] = `
flex-direction: row;
}
.c0 legend {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
-webkit-clip: rect(0,0,0,0);
clip: rect(0,0,0,0);
white-space: nowrap;
border: 0;
}
.c1 {
border: 0;
outline: none;
Expand All @@ -310,15 +323,6 @@ exports[`ColorPicker matches snapshot no selection 1`] = `
padding: 0.8rem 0.3rem;
}
.c1 legend {
position: absolute;
height: 1px;
width: 1px;
overflow: hidden;
-webkit-clip: rect(1px,1px,1px,1px);
clip: rect(1px,1px,1px,1px);
}
<fieldset
className="c0"
>
Expand Down Expand Up @@ -632,7 +636,7 @@ exports[`ColorPicker matches snapshot no selection 1`] = `
</label>
</fieldset>
<button
aria-label="remove highlight"
aria-label="Deselect current highlight color"
className="c18"
onClick={[MockFunction]}
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ const ShowKeyboardShortcuts = () => (
<Shortcut keys={['alt', 'h']} msgKey='move-focus-in-out'/>
<Shortcut keys={['tab']} msgKey='move-through-note-editing'/>
<Shortcut keys={['arrows']} msgKey='select-highlight-color'/>
<Shortcut keys={['space']} msgKey='deselect-highlight-color'/>
<Shortcut keys={['enter']} msgKey='save-or-cancel'/>
</ShortcutsTable>
</ShortcutsCard>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,24 +480,6 @@ exports[`KeyboardShortcuts renders keyboard shortcuts modal if it is open 1`] =
Select a different highlight color
</div>
</div>
<div
className="c11"
>
<div
className="c12"
>
<span
className="c13"
>
Space
</span>
</div>
<div
className="c12"
>
Deselect current highlight color
</div>
</div>
<div
className="c11"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,24 +252,6 @@ exports[`ShowKeyboardShortcuts renders the keyboard shortcuts menu 1`] = `
Select a different highlight color
</div>
</div>
<div
className="c4"
>
<div
className="c5"
>
<span
className="c6"
>
Space
</span>
</div>
<div
className="c5"
>
Deselect current highlight color
</div>
</div>
<div
className="c4"
>
Expand Down

0 comments on commit f30081b

Please sign in to comment.