Skip to content

Commit

Permalink
3230 Refactor internal components - getGlobalFocusStyles (#3380)
Browse files Browse the repository at this point in the history
* refactor(getGlobalFocusStyles): moved to internal

* refactor(getGlobalFocusStyles): moved to internal/utils
  • Loading branch information
agreenberry authored Jun 7, 2023
1 parent bda0e31 commit 1736670
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Button/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import styled from 'styled-components'
import sx, {SxProp} from '../sx'
import getGlobalFocusStyles from '../_getGlobalFocusStyles'
import getGlobalFocusStyles from '../internal/utils/getGlobalFocusStyles'

export const StyledButton = styled.button<SxProp>`
${getGlobalFocusStyles('-2px')};
Expand Down
2 changes: 1 addition & 1 deletion src/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sx, {SxProp} from '../sx'
import useLayoutEffect from '../utils/useIsomorphicLayoutEffect'
import {FormValidationStatus} from '../utils/types/FormValidationStatus'
import {CheckboxGroupContext} from '../CheckboxGroup/CheckboxGroupContext'
import getGlobalFocusStyles from '../_getGlobalFocusStyles'
import getGlobalFocusStyles from '../internal/utils/getGlobalFocusStyles'
import {get} from '../constants'
import {sharedCheckboxAndRadioStyles} from '../internal/utils/sharedCheckboxAndRadioStyles'

Expand Down
2 changes: 1 addition & 1 deletion src/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components'
import Box from '../Box'
import {get} from '../constants'
import sx, {SxProp} from '../sx'
import getGlobalFocusStyles from '../_getGlobalFocusStyles'
import getGlobalFocusStyles from '../internal/utils/getGlobalFocusStyles'
import {buildComponentData, buildPaginationModel} from './model'

const Page = styled.a`
Expand Down
2 changes: 1 addition & 1 deletion src/Radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, {ChangeEventHandler, InputHTMLAttributes, ReactElement, useContext
import sx, {SxProp} from '../sx'
import {FormValidationStatus} from '../utils/types/FormValidationStatus'
import {RadioGroupContext} from '../RadioGroup/RadioGroup'
import getGlobalFocusStyles from '../_getGlobalFocusStyles'
import getGlobalFocusStyles from '../internal/utils/getGlobalFocusStyles'
import {get} from '../constants'
import {sharedCheckboxAndRadioStyles} from '../internal/utils/sharedCheckboxAndRadioStyles'

Expand Down
2 changes: 1 addition & 1 deletion src/TabNav/TabNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {get} from '../constants'
import {FocusKeys, useFocusZone} from '../hooks/useFocusZone'
import sx, {SxProp} from '../sx'
import {ComponentProps} from '../utils/types'
import getGlobalFocusStyles from '../_getGlobalFocusStyles'
import getGlobalFocusStyles from '../internal/utils/getGlobalFocusStyles'

const ITEM_CLASS = 'TabNav-item'
const SELECTED_CLASS = 'selected'
Expand Down
2 changes: 1 addition & 1 deletion src/UnderlineNav/UnderlineNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components'
import {get} from '../constants'
import sx, {SxProp} from '../sx'
import {ComponentProps} from '../utils/types'
import getGlobalFocusStyles from '../_getGlobalFocusStyles'
import getGlobalFocusStyles from '../internal/utils/getGlobalFocusStyles'

const ITEM_CLASS = 'PRC-UnderlineNav-item'
const SELECTED_CLASS = 'PRC-selected'
Expand Down
2 changes: 1 addition & 1 deletion src/drafts/Button2/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import styled from 'styled-components'
import sx, {SxProp} from '../../sx'
import getGlobalFocusStyles from '../../_getGlobalFocusStyles'
import getGlobalFocusStyles from '../../internal/utils/getGlobalFocusStyles'

export const StyledButton = styled.button<SxProp>`
${getGlobalFocusStyles('-2px')};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {CSSProperties} from 'react'
import {css} from 'styled-components'
import {get} from './constants'
import {get} from '../../constants'

const globalFocusStyle = css`
box-shadow: none;
Expand Down

0 comments on commit 1736670

Please sign in to comment.