Skip to content

Commit a08bb3e

Browse files
committed
feat(many): add prop most shared tokens to prop options in view
INSTUI-4945
1 parent b949dfa commit a08bb3e

10 files changed

Lines changed: 232 additions & 69 deletions

File tree

packages/emotion/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ export type {
6161
Shadow,
6262
Stacking,
6363
Background,
64-
BorderRadiiValues,
65-
BorderRadii,
6664
BorderWidthValues,
6765
BorderWidth
6866
} from './styleUtils'

packages/emotion/src/styleUtils/ThemeablePropValues.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ const ThemeablePropValues = {
2929
resting: 'resting',
3030
above: 'above',
3131
topmost: 'topmost',
32-
none: 'none'
32+
none: 'none',
33+
elevation1: 'elevation1',
34+
elevation2: 'elevation2',
35+
elevation3: 'elevation3',
36+
elevation4: 'elevation4'
3337
},
3438

3539
STACKING_TYPES: {
@@ -178,12 +182,6 @@ type Stacking = (typeof ThemeablePropValues.STACKING_TYPES)[StackingKeys]
178182
type BackgroundKeys = keyof typeof ThemeablePropValues.BACKGROUNDS
179183
type Background = (typeof ThemeablePropValues.BACKGROUNDS)[BackgroundKeys]
180184

181-
// BORDER_RADII
182-
type BorderRadiiKeys = keyof typeof ThemeablePropValues.BORDER_RADII
183-
type BorderRadiiValues =
184-
(typeof ThemeablePropValues.BORDER_RADII)[BorderRadiiKeys]
185-
type BorderRadii = CSSShorthandValue<BorderRadiiValues | string> // TODO type better for actual values like '12px'
186-
187185
// BORDER_WIDTHS
188186
type BorderWidthKeys = keyof typeof ThemeablePropValues.BORDER_WIDTHS
189187
type BorderWidthValues =
@@ -199,8 +197,6 @@ export type {
199197
Shadow,
200198
Stacking,
201199
Background,
202-
BorderRadiiValues,
203-
BorderRadii,
204200
BorderWidthValues,
205201
BorderWidth
206202
}

packages/emotion/src/styleUtils/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ export type {
3636
Shadow,
3737
Stacking,
3838
Background,
39-
BorderRadiiValues,
40-
BorderRadii,
4139
BorderWidthValues,
4240
BorderWidth
4341
} from './ThemeablePropValues'

packages/ui-expandable/src/Expandable/v1/props.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,14 @@
2424

2525
import { JSX } from 'react'
2626
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
27-
import type { ViewProps } from '@instructure/ui-view/latest'
2827

2928
type ExpandableToggleProps = (props?: {
30-
onClick?: (
31-
event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>
32-
) => void
29+
onClick?: (event: React.KeyboardEvent<any> | React.MouseEvent<any>) => void
3330
[key: string]: unknown
3431
}) => {
3532
'aria-controls': string
3633
'aria-expanded': boolean
37-
onClick: (
38-
event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>
39-
) => void
34+
onClick: (event: React.KeyboardEvent<any> | React.MouseEvent<any>) => void
4035
[key: string]: unknown
4136
}
4237

@@ -70,7 +65,7 @@ type ExpandableOwnProps = {
7065
* Function invoked when this component is expanded/collapsed
7166
*/
7267
onToggle?: (
73-
event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>,
68+
event: React.KeyboardEvent<any> | React.MouseEvent<any>,
7469
expanded: boolean
7570
) => void
7671

packages/ui-popover/src/Popover/v1/props.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import React from 'react'
2525
import { BorderWidth } from '@instructure/emotion'
2626

27-
import type { Shadow, Stacking, WithStyleProps } from '@instructure/emotion'
27+
import type { Stacking, WithStyleProps } from '@instructure/emotion'
2828

2929
import type {
3030
PlacementPropValues,
@@ -70,7 +70,7 @@ type PopoverOwnProps = {
7070
/**
7171
* Controls the shadow depth for the `<Popover />`
7272
*/
73-
shadow?: Shadow
73+
shadow?: 'resting' | 'above' | 'topmost' | 'none'
7474

7575
/**
7676
* Controls the z-index depth for the `<Popover />` content

packages/ui-view/src/ContextView/v1/props.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import type {
3030
} from '@instructure/shared-types'
3131
import type { PlacementPropValues } from '@instructure/ui-position'
3232
import type {
33-
Shadow,
3433
Spacing,
3534
Stacking,
3635
WithStyleProps,
@@ -52,7 +51,7 @@ type ContextViewOwnProps = {
5251
debug?: boolean
5352
margin?: Spacing
5453
padding?: Spacing
55-
shadow?: Shadow
54+
shadow?: 'resting' | 'above' | 'topmost' | 'none'
5655
stacking?: Stacking
5756
placement?: PlacementPropValues
5857
borderColor?: string

packages/ui-view/src/View/v1/props.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ import type {
3333
WithStyleProps,
3434
Spacing,
3535
BorderWidth,
36-
BorderRadii,
37-
Shadow,
3836
Stacking,
3937
ComponentStyle,
4038
StyleObject
@@ -182,11 +180,11 @@ type ViewOwnProps = {
182180
* assigned to individual corners in CSS shorthand style (e.g., `"medium large none pill"`).
183181
* Also accepts valid CSS length values like `1rem` or `12px`
184182
*/
185-
borderRadius?: BorderRadii
183+
borderRadius?: string
186184
/**
187185
* Controls the shadow depth for the `<View />`
188186
*/
189-
shadow?: Shadow
187+
shadow?: 'resting' | 'above' | 'topmost' | 'none'
190188

191189
/**
192190
* Controls the z-index depth for the `<View />`

0 commit comments

Comments
 (0)