Skip to content

Commit

Permalink
fix: card component flex issue - Ds 849 (#3817)
Browse files Browse the repository at this point in the history
* fix: adjust the estimated cost condition to control the visibility of the description

* fix: card component flex issue

* fix: card component flex issue

* fix: card component flex issue

* fix: card component flex issue

* fix: card component flex issue

* fix: card component flex issue

* fix: card component flex issue

* test(snapshots): update snap

* fix: card component flex issue

* test(snapshots): update snap

---------

Co-authored-by: Alexandre Philibeaux <aphilibeaux@scaleway.com>
  • Loading branch information
Lawndlwd and philibea committed May 24, 2024
1 parent 0c77ec7 commit a915531
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 103 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-eagles-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ultraviolet/ui": patch
---

Fix Card component style by removing flex
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dist/
coverage
storybook-static
.reports

.pnpm-store

# VSCode extension "Local History"
.history
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ exports[`FAQ > should work with default props 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding: 16px;
text-align: left;
}
Expand Down Expand Up @@ -106,13 +99,6 @@ exports[`FAQ > should work with illustration 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding: 16px;
text-align: left;
}
Expand Down Expand Up @@ -278,13 +264,6 @@ exports[`FAQ > should work with illustrationTest 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding: 16px;
text-align: left;
}
Expand Down Expand Up @@ -406,13 +385,6 @@ exports[`FAQ > should work with notes 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding: 16px;
text-align: left;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,6 @@ exports[`SteppedListCard > should work with custom hide action 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding: 0;
}
Expand Down Expand Up @@ -551,13 +544,6 @@ exports[`SteppedListCard > should work with default props 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
padding: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ exports[`Card > renders correctly with advanced header 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.emotion-2[data-is-active='true'] {
Expand Down Expand Up @@ -78,13 +71,6 @@ exports[`Card > renders correctly with className 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.emotion-0[data-is-active='true'] {
Expand Down Expand Up @@ -115,13 +101,6 @@ exports[`Card > renders correctly with data-testid 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.emotion-0[data-is-active='true'] {
Expand Down Expand Up @@ -153,13 +132,6 @@ exports[`Card > renders correctly with disabled 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.emotion-0[data-is-active='true'] {
Expand Down Expand Up @@ -228,13 +200,6 @@ exports[`Card > renders correctly with disabled and header 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.emotion-4[data-is-active='true'] {
Expand Down Expand Up @@ -313,13 +278,6 @@ exports[`Card > renders correctly with header 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.emotion-4[data-is-active='true'] {
Expand Down Expand Up @@ -360,13 +318,6 @@ exports[`Card > renders correctly with isActive 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.emotion-0[data-is-active='true'] {
Expand Down Expand Up @@ -397,13 +348,6 @@ exports[`Card > renders correctly without header 1`] = `
border: 1px solid #d9dadd;
border-radius: 4px;
padding: 24px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.emotion-0[data-is-active='true'] {
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/components/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ const BorderedBox = styled.div`
border: 1px solid ${({ theme }) => theme.colors.neutral.border};
border-radius: ${({ theme }) => theme.radii.default};
padding: ${({ theme }) => theme.space['3']};
flex: 1;
display: flex;
&[data-is-active='true'] {
border: 1px solid ${({ theme }) => theme.colors.primary.border};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event'
import { renderWithTheme } from '@utils/test'
import type { ReactNode } from 'react'
import { act } from 'react'
import { beforeAll, describe, expect, test, vi } from 'vitest'
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
import { SelectInputV2 } from '..'
import { OptionalInfo, cities, dataGrouped, dataUnGrouped } from './resources'

Expand All @@ -16,13 +16,17 @@ export type OptionType = {
}

describe('SelectInputV2', () => {
beforeAll(() => {
beforeEach(() => {
Object.defineProperty(HTMLElement.prototype, 'offsetWidth', {
configurable: true,
value: 500,
})
})

afterEach(() => {
Object.defineProperty(HTMLElement.prototype, 'offsetWidth', {})
})

test('renders correctly', () => {
const { asFragment } = renderWithTheme(
<SelectInputV2 name="test" options={dataUnGrouped} label="label" />,
Expand Down

0 comments on commit a915531

Please sign in to comment.