Skip to content

Commit ba807ca

Browse files
committed
refactor(ui-view): do not support deprecated color tokens in ContextView
1 parent f8bdc32 commit ba807ca

File tree

2 files changed

+7
-25
lines changed

2 files changed

+7
-25
lines changed

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

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,7 @@ type ContextViewOwnProps = {
6161
shadow?: Shadow
6262
stacking?: Stacking
6363
placement?: PlacementPropValues
64-
borderColor?:
65-
| string
66-
| 'transparent'
67-
| 'primary'
68-
| 'secondary'
69-
| 'brand'
70-
| 'info'
71-
| 'success'
72-
| 'warning'
73-
| 'alert'
74-
| 'danger'
64+
borderColor?: string
7565
}
7666

7767
type PropKeys = keyof ContextViewOwnProps
@@ -156,20 +146,9 @@ const propTypes: PropValidators<PropKeys> = {
156146

157147
/**
158148
* Sets the color of the ContextView border.
159-
* Accepts a color string value (e.g., "#FFFFFF", "red") or one of the predefined theme color options.
149+
* Accepts a color string value (e.g., "#FFFFFF", "red")
160150
*/
161-
borderColor: PropTypes.oneOf([
162-
PropTypes.string,
163-
'transparent',
164-
'primary',
165-
'secondary',
166-
'brand',
167-
'info',
168-
'success',
169-
'warning',
170-
'alert',
171-
'danger'
172-
])
151+
borderColor: PropTypes.string
173152
}
174153

175154
const allowedProps: AllowedPropKeys = [

packages/ui-view/src/ContextView/styles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ const generateStyle = (
308308
...arrowBaseStyles,
309309
display: 'block',
310310
borderWidth: `calc(${componentTheme?.arrowSize} + ${componentTheme?.arrowBorderWidth})`,
311-
borderColor: borderColor || arrowBackGroundVariants[background!],
311+
borderColor:
312+
borderColor ||
313+
arrowBackGroundVariants[borderColor!] ||
314+
arrowBackGroundVariants[background!],
312315
...arrowPlacementVariant.main,
313316
...getArrowCorrections(placement!, componentTheme),
314317
'&::after': {

0 commit comments

Comments
 (0)