Skip to content

Commit

Permalink
Update InputSelect size and border radius values
Browse files Browse the repository at this point in the history
  • Loading branch information
gustaveen committed Jul 7, 2023
1 parent 2358846 commit 64d9ac9
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const ChipButton = styled.button({
display: 'flex',
alignItems: 'center',
gap: theme.space.xs,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
backgroundColor: theme.colors.gray200,
textTransform: 'uppercase',
paddingTop: theme.space.xxs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ const SpaceBetween = styled.div({
gap: theme.space.xs,
})


const Chip = styled.div({
display: 'flex',
alignItems: 'center',
gap: theme.space.xxs,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
backgroundColor: theme.colors.gray200,
textTransform: 'uppercase',
paddingTop: theme.space.xxs,
Expand Down
2 changes: 1 addition & 1 deletion apps/store/src/components/CheckoutHeader/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Step = styled.li<{ active: boolean }>(({ active }) => ({

color: theme.colors.textTertiary,
backgroundColor: theme.colors.opaque1,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
border: `1px solid ${theme.colors.opaque1}`,

...(active && {
Expand Down
2 changes: 1 addition & 1 deletion apps/store/src/components/CheckoutPage/CheckoutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const TextLink = styled(Link)({
fontSize: theme.fontSizes.md,

':focus-visible': {
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
boxShadow: `${theme.colors.light} 0 0 0 3px, ${theme.colors.textPrimary} 0 0 0 4px`,
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const TextLink = styled(Link)({
fontSize: theme.fontSizes.md,

':focus-visible': {
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
boxShadow: `${theme.colors.light} 0 0 0 3px, ${theme.colors.textPrimary} 0 0 0 4px`,
},
})
8 changes: 4 additions & 4 deletions apps/store/src/components/ComparisonTable/ComparisonTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const Row = styled.tr({

':last-child': {
td: {
borderBottomLeftRadius: theme.radius.xs,
borderBottomRightRadius: theme.radius.xs,
borderBottomLeftRadius: theme.radius.xxs,
borderBottomRightRadius: theme.radius.xxs,
},
},
})
Expand Down Expand Up @@ -49,8 +49,8 @@ const TableHeader = styled.th({

const ActiveTableHeader = styled(TableHeader)({
backgroundColor: theme.colors.green100,
borderTopLeftRadius: theme.radius.xs,
borderTopRightRadius: theme.radius.xs,
borderTopLeftRadius: theme.radius.xxs,
borderTopRightRadius: theme.radius.xxs,
})

type TitleDataCellProps = { children: React.ReactNode; className?: string }
Expand Down
2 changes: 1 addition & 1 deletion apps/store/src/components/ConfirmationPage/CheckList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const PresentationCheckboxChecked = styled.div({
height: theme.space.lg,
width: theme.space.lg,
color: theme.colors.white,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
display: 'grid ',
placeItems: 'center',
backgroundColor: theme.colors.green600,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const CardSkeleton = styled(Card)({

const Pill = styled.div({
backgroundColor: theme.colors.light,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
paddingInline: theme.space.xs,
paddingBlock: theme.space.xxs,
display: 'inline-flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export const FetchInsuranceSuccess = ({ company, onClick, children }: Props) =>

const GrayCard = styled.div({
backgroundColor: theme.colors.gray100,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
padding: theme.space.md,
})
39 changes: 24 additions & 15 deletions apps/store/src/components/InputSelect/InputSelect.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'
import { Meta, StoryFn } from '@storybook/react'
import { Meta, StoryObj } from '@storybook/react'
import { InputSelect } from './InputSelect'

export default {
const meta: Meta<typeof InputSelect> = {
title: 'Inputs / Select',
component: InputSelect,
parameters: {
Expand All @@ -11,19 +11,28 @@ export default {
defaultViewport: 'iphonese2',
},
},
} as Meta<typeof InputSelect>
}

export default meta
type Story = StoryObj<typeof InputSelect>

const Template: StoryFn<typeof InputSelect> = (props) => {
return <InputSelect {...props} />
export const Small: Story = {
args: {
size: 'small',
placeholder: 'Byggnadstyp',
options: [
{ name: 'Garage', value: 'garage' },
{ name: 'Attefallshus', value: 'attefallshus' },
{ name: 'Växthus', value: 'växthus' },
{ name: 'Annan', value: 'annan' },
],
name: 'Byggnadstyp',
},
}
export const Default = Template.bind({})
Default.args = {
placeholder: 'Byggnadstyp',
options: [
{ name: 'Garage', value: 'garage' },
{ name: 'Attefallshus', value: 'attefallshus' },
{ name: 'Växthus', value: 'växthus' },
{ name: 'Annan', value: 'annan' },
],
name: 'Byggnadstyp',

export const Large: Story = {
args: {
...Small.args,
size: 'large',
},
}
6 changes: 4 additions & 2 deletions apps/store/src/components/InputSelect/InputSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ const StyledSelect = styled(
elementConfig,
)<SelectProps>(({ variantSize }) => ({
color: theme.colors.textPrimary,
borderRadius: theme.radius.sm,
width: '100%',
height: '3rem',
display: 'flex',
alignItems: 'center',
paddingLeft: theme.space.md,
Expand All @@ -100,11 +98,15 @@ const StyledSelect = styled(
backgroundColor: theme.colors.opaque1,

...(variantSize === 'small' && {
height: '2.5rem',
fontSize: theme.fontSizes.md,
borderRadius: theme.radius.xs,
}),

...(variantSize === 'large' && {
height: '3.5rem',
fontSize: theme.fontSizes.xl,
borderRadius: theme.radius.sm,
}),

'&:invalid, &:disabled': {
Expand Down
4 changes: 2 additions & 2 deletions apps/store/src/components/PriceCalculator/FetchInsurance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const FetchInsurance = ({
const DialogWindow = styled(Dialog.Window)({
padding: theme.space.md,
paddingTop: theme.space.lg,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
width: `calc(100% - ${theme.space.xs} * 2)`,
maxWidth: '28rem',
marginInline: 'auto',
Expand All @@ -191,5 +191,5 @@ const DialogIframeWindow = styled(Dialog.Window)({
maxHeight: '100%',
height: INSURELY_IFRAME_MAX_HEIGHT,
overflowY: 'auto',
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
})
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const TextButton = styled.button({

backgroundColor: theme.colors.light,
':focus-visible': {
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
boxShadow: `${theme.colors.light} 0 0 0 3px, ${theme.colors.textPrimary} 0 0 0 4px`,
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,13 @@ const Bar = styled.div({
maxWidth: '16rem',
marginInline: 'auto',
backgroundColor: theme.colors.gray500,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
})

const ProgressBar = styled(motion.div)({
height: '100%',
backgroundColor: theme.colors.gray1000,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
})

type ShowOfferStateProps = {
Expand Down
2 changes: 1 addition & 1 deletion apps/store/src/components/RichText/RichText.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const richTextStyles = css(
maxWidth: `calc(100% + ${theme.space.md})`,
marginBlock: '4.5rem',
marginInline: `-${theme.space.xs}`,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
},

[mq.md]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const Item = ({ title, price, description, value }: ItemProps) => {
const RadioGroupItem = styled(RadioGroup.Item)({
width: '100%',
padding: theme.space.xs,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
cursor: 'pointer',

'&[data-state=checked]': {
Expand Down
2 changes: 1 addition & 1 deletion apps/store/src/components/TierSelector/TierSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Trigger = styled(Collapsible.Trigger)({
alignItems: 'center',
textAlign: 'center',
justifyContent: 'space-between',
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
paddingInline: theme.space.md,
})

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const BadgeBase = styled(
display: 'inline-block',
color: theme.colors.dark,
backgroundColor: getColor(color),
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
...getBadgeSize(size),
...getMargins(props),
}
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/Button/Button.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ const SIZE_STYLES = {
height: HEIGHT.small,
paddingInline: theme.space.md,
fontSize: theme.fontSizes.xs,
borderRadius: theme.radius.xs,
borderRadius: theme.radius.xxs,
},
medium: {
height: HEIGHT.medium,
paddingInline: theme.space.md,
fontSize: theme.fontSizes.md,
borderRadius: theme.radius[1],
borderRadius: theme.radius.xs,
},
large: {
height: HEIGHT.large,
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/lib/theme/radius.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const radius = {
...base,

// Aliases
xxs: base[0],
xs: base[0],
sm: base[2],
md: base[3],
Expand Down

0 comments on commit 64d9ac9

Please sign in to comment.