Skip to content

Commit

Permalink
feat: borderRadiusLevel의 토큰을 변경한다 (#822)
Browse files Browse the repository at this point in the history
* feat: change borderRaiusLevel token value

* refactor: replace changed borderRadiusLevel token

* fix: replace borderRadiusLevel in Dropdown, ModalBottomSheet

* test: update ModalBottomSheet snapshot

* fix: replace borderRadius with proper borderRadiusLevel

* test: udpate snapshot

---------

Co-authored-by: Mia (Jiyoung Yim) <[email protected]>
Co-authored-by: Mia (Jiyoung Yim) <[email protected]>
  • Loading branch information
3 people authored Aug 2, 2023
1 parent c61c810 commit 0029723
Show file tree
Hide file tree
Showing 66 changed files with 212 additions and 173 deletions.
2 changes: 1 addition & 1 deletion packages/vibrant-components/src/lib/Calendar/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const Calendar = withCalendarVariation(
backgroundColor="surface2"
width={320}
elevationLevel={2}
borderRadiusLevel={1}
rounded="sm"
testId={testId}
{...restProps}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,7 @@ export const CalenderDateItem = withCalendarDateItemVariation(
{date.getDate()}
</Body>
{today && (
<Box
position="absolute"
width={4}
height={4}
borderRadius={2}
bottom={8}
left={18}
backgroundColor="primary"
/>
<Box position="absolute" width={4} height={4} rounded="sm" bottom={8} left={18} backgroundColor="primary" />
)}
</Box>
</>
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-components/src/lib/Callout/Callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const Callout = withCalloutVariation(
backgroundColor={backgroundColor}
borderWidth={1}
borderColor="outline1"
borderRadius={2}
rounded="sm"
p={15}
data-testid={testId}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe('<ContainedButton />', () => {

expect(element).toHaveStyleRule('padding-right', paddingRight);

expect(element).toHaveStyleRule('border-radius', '2px');
expect(element).toHaveStyleRule('border-radius', '4px');

expect(element.clientHeight).toBe(height);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const ContainedButton = withContainedButtonVariation(
buttonType={type}
interactions={['hover', 'focus', 'active']}
overlayColor={onColor}
borderRadiusLevel={1}
rounded="sm"
disabled={loading || disabled}
>
<Box
Expand Down
7 changes: 3 additions & 4 deletions packages/vibrant-components/src/lib/DateInput/DateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@ export const DateInput = withDateInputVariation(
borderStyle="solid"
borderColor={(isFocused || calendarOpened) && state !== 'error' ? 'outlineNeutral' : borderColor}
height={height}
borderRadius={2}
rounded="sm"
flexShrink={0}
alignItems="center"
overflow="hidden"
{...restProps}
>
<Pressable
ref={composeRef}
pl={px}
height="100%"
justifyContent="center"
flexGrow={1}
disabled={disabled}
Expand All @@ -93,7 +92,7 @@ export const DateInput = withDateInputVariation(
</Body>
</>
</Pressable>
<HStack spacing={iconSpacing} pl={iconSpacing} height="100%">
<HStack spacing={iconSpacing} pl={iconSpacing}>
{!disabled && value ? (
<PressableBox as="button" onClick={onClear} hitSlop={hitSlop} justifyContent="center">
<Icon.CloseCircle.Fill size={iconSize} fill="onView2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ exports[`<DatePickerField /> when size is lg match snapshot 1`] = `
border-style: solid;
border-color: #00000026;
height: 50px;
border-radius: 2px;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border-radius: 4px;
overflow: hidden;
background-color: #ffffff;
}
Expand Down Expand Up @@ -75,7 +72,6 @@ exports[`<DatePickerField /> when size is lg match snapshot 1`] = `
-ms-flex-align: stretch;
align-items: stretch;
z-index: 0;
height: 100%;
padding-left: 15px;
-webkit-box-pack: center;
-ms-flex-pack: center;
Expand Down Expand Up @@ -119,7 +115,6 @@ exports[`<DatePickerField /> when size is lg match snapshot 1`] = `
box-sizing: border-box;
position: relative;
padding-left: 12px;
height: 100%;
-webkit-box-pack: start;
-ms-flex-pack: start;
-webkit-justify-content: flex-start;
Expand Down Expand Up @@ -292,11 +287,8 @@ exports[`<DatePickerField /> when size is md match snapshot 1`] = `
border-style: solid;
border-color: #00000026;
height: 38px;
border-radius: 2px;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border-radius: 4px;
overflow: hidden;
background-color: #ffffff;
}
Expand Down Expand Up @@ -326,7 +318,6 @@ exports[`<DatePickerField /> when size is md match snapshot 1`] = `
-ms-flex-align: stretch;
align-items: stretch;
z-index: 0;
height: 100%;
padding-left: 9px;
-webkit-box-pack: center;
-ms-flex-pack: center;
Expand Down Expand Up @@ -370,7 +361,6 @@ exports[`<DatePickerField /> when size is md match snapshot 1`] = `
box-sizing: border-box;
position: relative;
padding-left: 8px;
height: 100%;
-webkit-box-pack: start;
-ms-flex-pack: start;
-webkit-justify-content: flex-start;
Expand Down Expand Up @@ -543,11 +533,8 @@ exports[`<DatePickerField /> when size is sm match snapshot 1`] = `
border-style: solid;
border-color: #00000026;
height: 30px;
border-radius: 2px;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border-radius: 4px;
overflow: hidden;
background-color: #ffffff;
}
Expand Down Expand Up @@ -577,7 +564,6 @@ exports[`<DatePickerField /> when size is sm match snapshot 1`] = `
-ms-flex-align: stretch;
align-items: stretch;
z-index: 0;
height: 100%;
padding-left: 7px;
-webkit-box-pack: center;
-ms-flex-pack: center;
Expand Down Expand Up @@ -621,7 +607,6 @@ exports[`<DatePickerField /> when size is sm match snapshot 1`] = `
box-sizing: border-box;
position: relative;
padding-left: 6px;
height: 100%;
-webkit-box-pack: start;
-ms-flex-pack: start;
-webkit-justify-content: flex-start;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ exports[`<DrawerHeader /> when children is set match snapshot 1`] = `
-ms-flex-align: stretch;
align-items: stretch;
z-index: 0;
border-radius: 2px;
border-radius: 4px;
}
.emotion-7 {
Expand Down
6 changes: 3 additions & 3 deletions packages/vibrant-components/src/lib/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export const Dropdown = withDropdownVariation(
backgroundColor="surface2"
py={CONTENT_PADDING}
elevationLevel={4}
borderRadiusLevel={1}
rounded="sm"
minWidth={[280, 280, 240]}
>
<Transition
Expand Down Expand Up @@ -290,8 +290,8 @@ export const Dropdown = withDropdownVariation(
width="100%"
maxHeight={viewportHeight - BOTTOM_SHEET_MIN_TOP_MARGIN}
backgroundColor="surface2"
borderTopLeftRadiusLevel={4}
borderTopRightRadiusLevel={4}
roundedTopLeft="xxl"
roundedTopRight="xxl"
onLayout={handleContainerResize}
>
<Transition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const FieldLayout = withFieldLayoutVariation(
borderStyle="solid"
borderColor={borderColor}
backgroundColor={backgroundColor}
borderRadiusLevel={1}
rounded="sm"
>
<VStack flexShrink={0}>{renderStart?.()}</VStack>
<Box width="100%" height="100%" cursor={cursor}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const FilterChip = withFilterChipVariation(
testId={testId}
flexGrow={0}
flexShrink={0}
borderRadiusLevel={5}
rounded="full"
maxWidth={maxWidth}
flexDirection="row"
alignItems="center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const GhostButton = withGhostButtonVariation(
buttonType={type}
interactions={['focus', 'active']}
hitSlop={8}
borderRadiusLevel={1}
rounded="sm"
disabled={disabled}
data-testid={testId}
flexDirection="row"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const IconButton = withIconButtonVariation(
as="button"
buttonType={type}
interactions={['focus', 'active']}
borderRadiusLevel={1}
rounded="sm"
>
<IconComponent size={iconSize} fill={color} />
</Pressable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,8 @@ import { Ratio } from '../Ratio';
import { withImageThumbnailVariation } from './ImageThumbnailProps';

export const ImageThumbnail = withImageThumbnailVariation(
({
src,
alt = '',
borderRadiusLevel,
aspectRatio,
dim = true,
loading,
width = '100%',
testId = 'image-thumbnail',
}) => (
<Ratio
data-testid={testId}
ratio={aspectRatio}
width={width}
borderRadiusLevel={borderRadiusLevel}
overflow="hidden"
>
({ src, alt = '', aspectRatio, dim = true, loading, width = '100%', testId = 'image-thumbnail', ...props }) => (
<Ratio data-testid={testId} ratio={aspectRatio} width={width} overflow="hidden" {...props}>
{dim && (
<Box
data-testid={`${testId}-overlay`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export type ImageThumbnailProps = {
dim?: ResponsiveValue<boolean>;
aspectRatio: number;
testId?: string;
} & Pick<ImageProps, 'alt' | 'borderRadiusLevel' | 'loading' | 'objectFit' | 'sizes' | 'src' | 'width'>;
} & Pick<ImageProps, 'alt' | 'borderRadiusLevel' | 'loading' | 'objectFit' | 'rounded' | 'sizes' | 'src' | 'width'>;

export const withImageThumbnailVariation = withVariation<ImageThumbnailProps>('ImageThumbnail')();
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ export const ModalBottomSheet = withModalBottomSheetVariation(
maxWidth={[446, 480, desktopModalWidth]}
maxHeight={[viewportHeight - 120, 'unset']}
backgroundColor="surface2"
borderTopLeftRadiusLevel={4}
borderTopRightRadiusLevel={4}
borderBottomLeftRadiusLevel={[0, 4]}
borderBottomRightRadiusLevel={[0, 4]}
roundedTopLeft="xxl"
roundedTopRight="xxl"
roundedBottomLeft={['none', 'xxl']}
roundedBottomRight={['none', 'xxl']}
onLayout={handleContainerResize}
data-testid={testId}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ exports[`<ModalBottomSheet /> given mobile viewport width match snapshot 1`] = `
-ms-flex-align: stretch;
align-items: stretch;
z-index: 0;
border-radius: 2px;
border-radius: 4px;
}
.emotion-9 {
Expand Down Expand Up @@ -671,7 +671,7 @@ exports[`<ModalBottomSheet /> given viewport width larger than mobile match snap
-ms-flex-align: stretch;
align-items: stretch;
z-index: 0;
border-radius: 2px;
border-radius: 4px;
}
.emotion-9 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const NumericField = withNumericFieldVariation(
borderWidth={1}
borderColor="outline1"
borderStyle="solid"
borderRadius={2}
rounded="sm"
placeholder={placeholder?.toString()}
disabled={disabled}
hideInputSpinButton={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports[`<NumericField /> when NumericField rendered match snapshot 1`] = `
text-align: center;
border-color: #00000026;
border-style: solid;
border-radius: 2px;
border-radius: 4px;
-moz-appearance: textfield;
}
Expand Down Expand Up @@ -132,7 +132,7 @@ exports[`<NumericField /> when NumericField rendered match snapshot 1`] = `
-ms-flex-align: stretch;
align-items: stretch;
z-index: 0;
border-radius: 2px;
border-radius: 4px;
}
.emotion-4 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const OperatorButton = withOperationButtonVariation(
<Pressable
p={7}
borderWidth={0}
borderRadius={2}
rounded="sm"
backgroundColor={backgroundColor}
overlayColor="onView1"
interactions={['hover', 'focus', 'active']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports[`<OperatorButton /> when OperatorButton rendered match snapshot 1`] = `
-ms-flex-align: stretch;
align-items: stretch;
z-index: 0;
border-radius: 2px;
border-radius: 4px;
}
.emotion-1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const OutlinedButton = withOutlinedButtonVariation(
borderColor={borderColor}
borderWidth={1}
borderStyle="solid"
borderRadiusLevel={1}
rounded="sm"
disabled={loading || disabled}
>
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
export const Basic: ComponentStory<typeof Paper> = props => <Paper {...props} m={20} width={200} height={200} />;

export const BackgroundColor: ComponentStory<typeof Paper> = () => (
<Paper m={20} width={200} height={200} backgroundColor="primary" borderRadiusLevel={1} />
<Paper m={20} width={200} height={200} backgroundColor="primary" rounded="sm" />
);

export const BackgroundGradient: ComponentStory<typeof Paper> = () => (
Expand Down
6 changes: 5 additions & 1 deletion packages/vibrant-components/src/lib/Paper/PaperProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ type PaperProps = Pick<BorderSystemProps, 'borderColor' | 'borderStyle' | 'borde
| 'borderBottomRightRadiusLevel'
| 'borderTopLeftRadiusLevel'
| 'borderTopRightRadiusLevel'
| 'roundedBottomLeft'
| 'roundedBottomRight'
| 'roundedTopLeft'
| 'roundedTopRight'
>,
Pick<BorderSystemProps, 'borderRadiusLevel'>
Pick<BorderSystemProps, 'borderRadiusLevel' | 'rounded'>
>;

export const withPaperVariation = withVariation<PaperProps>('Paper')();
Loading

1 comment on commit 0029723

@vercel
Copy link

@vercel vercel bot commented on 0029723 Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.