Skip to content

Commit 223d55b

Browse files
committed
fix: update PropTypes to align with the new spacing tokens
INSTUI-4501
1 parent a9a68a4 commit 223d55b

File tree

39 files changed

+49
-110
lines changed

39 files changed

+49
-110
lines changed

packages/__docs__/src/ContentWrap/props.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
import PropTypes from 'prop-types'
2626
import type { PropValidators } from '@instructure/shared-types'
27-
import { ThemeablePropTypes } from '@instructure/emotion'
2827
import type { Spacing } from '@instructure/emotion'
2928

3029
type ContentWrapOwnProps = {
@@ -42,7 +41,7 @@ type ContentWrapProps = ContentWrapOwnProps
4241
const propTypes: PropValidators<PropKeys> = {
4342
children: PropTypes.node,
4443
maxWidth: PropTypes.string,
45-
padding: ThemeablePropTypes.spacing
44+
padding: PropTypes.string
4645
}
4746

4847
const allowedProps: AllowedPropKeys = ['children', 'maxWidth', 'padding']

packages/emotion/src/styleUtils/ThemeablePropTypes.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ const {
4040
BORDER_WIDTHS,
4141
BORDER_RADII,
4242
BACKGROUNDS,
43-
SIZES,
44-
SPACING
43+
SIZES
4544
} = ThemeablePropValues
4645

4746
/**
@@ -57,8 +56,7 @@ const ThemeablePropTypes = {
5756
borderWidth: shorthandPropType(Object.values(BORDER_WIDTHS)),
5857
borderRadius: shorthandPropType(Object.values(BORDER_RADII)),
5958
background: PropTypes.oneOf(Object.values(BACKGROUNDS)),
60-
size: PropTypes.oneOf(Object.values(SIZES)),
61-
spacing: shorthandPropType(Object.values(SPACING))
59+
size: PropTypes.oneOf(Object.values(SIZES))
6260
}
6361

6462
type ValueKeys =

packages/ui-alerts/src/Alert/props.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import { ReactNode } from 'react'
2626
import PropTypes from 'prop-types'
2727

28-
import { ThemeablePropTypes } from '@instructure/emotion'
29-
3028
import type {
3129
Spacing,
3230
WithStyleProps,
@@ -122,7 +120,7 @@ type AlertStyle = ComponentStyle<'alert' | 'icon' | 'closeButton' | 'content'>
122120
const propTypes: PropValidators<PropKeys> = {
123121
children: PropTypes.node,
124122
variant: PropTypes.oneOf(['info', 'success', 'warning', 'error']),
125-
margin: ThemeablePropTypes.spacing,
123+
margin: PropTypes.string,
126124
liveRegion: PropTypes.func,
127125
liveRegionPoliteness: PropTypes.oneOf(['polite', 'assertive']),
128126
isLiveRegionAtomic: PropTypes.bool,

packages/ui-avatar/src/Avatar/props.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import { SyntheticEvent } from 'react'
2626
import PropTypes from 'prop-types'
2727

28-
import { ThemeablePropTypes } from '@instructure/emotion'
29-
3028
import type {
3129
Spacing,
3230
WithStyleProps,
@@ -146,7 +144,7 @@ const propTypes: PropValidators<PropKeys> = {
146144
hasInverseColor: PropTypes.bool,
147145
showBorder: PropTypes.oneOf(['auto', 'always', 'never']),
148146
shape: PropTypes.oneOf(['circle', 'rectangle']),
149-
margin: ThemeablePropTypes.spacing,
147+
margin: PropTypes.string,
150148
display: PropTypes.oneOf(['inline-block', 'block']),
151149
onImageLoaded: PropTypes.func,
152150
as: PropTypes.elementType,

packages/ui-badge/src/Badge/props.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import PropTypes from 'prop-types'
2626

2727
import { PositionPropTypes } from '@instructure/ui-position'
28-
import { ThemeablePropTypes } from '@instructure/emotion'
2928

3029
import type {
3130
AsElementType,
@@ -110,7 +109,7 @@ const propTypes: PropValidators<PropKeys> = {
110109
variant: PropTypes.oneOf(['primary', 'success', 'danger', 'inverse']),
111110
placement: PositionPropTypes.placement,
112111
display: PropTypes.oneOf(['inline-block', 'block']),
113-
margin: ThemeablePropTypes.spacing,
112+
margin: PropTypes.string,
114113
elementRef: PropTypes.func,
115114
formatOverflowText: PropTypes.func,
116115
formatOutput: PropTypes.func,

packages/ui-billboard/src/Billboard/props.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
import PropTypes from 'prop-types'
2626

27-
import { ThemeablePropTypes } from '@instructure/emotion'
28-
2927
import type {
3028
Spacing,
3129
WithStyleProps,
@@ -127,7 +125,7 @@ const propTypes: PropValidators<PropKeys> = {
127125
href: PropTypes.string,
128126
disabled: PropTypes.bool,
129127
readOnly: PropTypes.bool,
130-
margin: ThemeablePropTypes.spacing
128+
margin: PropTypes.string
131129
}
132130

133131
const allowedProps: AllowedPropKeys = [

packages/ui-breadcrumb/src/Breadcrumb/props.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import PropTypes from 'prop-types'
2626

2727
import { Children } from '@instructure/ui-prop-types'
28-
import { ThemeablePropTypes } from '@instructure/emotion'
2928

3029
import { BreadcrumbLink } from './BreadcrumbLink'
3130

@@ -70,7 +69,7 @@ const propTypes: PropValidators<PropKeys> = {
7069
children: Children.oneOf([BreadcrumbLink]),
7170
label: PropTypes.string.isRequired,
7271
size: PropTypes.oneOf(['small', 'medium', 'large']),
73-
margin: ThemeablePropTypes.spacing
72+
margin: PropTypes.string
7473
}
7574

7675
const allowedProps: AllowedPropKeys = ['children', 'label', 'margin', 'size']

packages/ui-buttons/src/BaseButton/props.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import React from 'react'
2626
import PropTypes from 'prop-types'
2727

28-
import { ThemeablePropTypes } from '@instructure/emotion'
29-
3028
import type { InteractionType } from '@instructure/ui-react-utils'
3129
import type {
3230
Spacing,
@@ -205,7 +203,7 @@ const propTypes: PropValidators<PropKeys> = {
205203
withBackground: PropTypes.bool,
206204
withBorder: PropTypes.bool,
207205
isCondensed: PropTypes.bool,
208-
margin: ThemeablePropTypes.spacing,
206+
margin: PropTypes.string,
209207
cursor: PropTypes.string,
210208
href: PropTypes.string,
211209
onClick: PropTypes.func,

packages/ui-buttons/src/Button/props.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import React from 'react'
2626
import PropTypes from 'prop-types'
2727

28-
import { ThemeablePropTypes } from '@instructure/emotion'
29-
3028
import type { Spacing, WithStyleProps } from '@instructure/emotion'
3129
import type {
3230
ToProp,
@@ -153,7 +151,7 @@ const propTypes: PropValidators<PropKeys> = {
153151
display: PropTypes.oneOf(['inline-block', 'block']),
154152
textAlign: PropTypes.oneOf(['start', 'center']),
155153
withBackground: PropTypes.bool,
156-
margin: ThemeablePropTypes.spacing,
154+
margin: PropTypes.string,
157155
cursor: PropTypes.string,
158156
href: PropTypes.string,
159157
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),

packages/ui-buttons/src/CloseButton/props.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import React from 'react'
2626
import PropTypes from 'prop-types'
2727

28-
import { ThemeablePropTypes } from '@instructure/emotion'
29-
3028
import type {
3129
Spacing,
3230
WithStyleProps,
@@ -141,7 +139,7 @@ const propTypes: PropValidators<PropKeys> = {
141139
elementRef: PropTypes.func,
142140
size: PropTypes.oneOf(['small', 'medium', 'large']),
143141
onClick: PropTypes.func,
144-
margin: ThemeablePropTypes.spacing,
142+
margin: PropTypes.string,
145143
placement: PropTypes.oneOf(['start', 'end', 'static']),
146144
offset: PropTypes.oneOf(['none', 'x-small', 'small', 'medium']),
147145
type: PropTypes.oneOf(['button', 'submit', 'reset']),

0 commit comments

Comments
 (0)