diff --git a/packages/react-components/src/Chip/__snapshots__/chip.test.tsx.snap b/packages/react-components/src/Chip/__snapshots__/chip.test.tsx.snap index 53fe4333..9abb79c5 100644 --- a/packages/react-components/src/Chip/__snapshots__/chip.test.tsx.snap +++ b/packages/react-components/src/Chip/__snapshots__/chip.test.tsx.snap @@ -32,6 +32,7 @@ exports[` should have custom delete icon 1`] = ` white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); background-color: var(--pv-color-secondary); color: var(--pv-color-secondary-contrast); } @@ -49,7 +50,6 @@ exports[` should have custom delete icon 1`] = ` } .emotion-2 { - margin-left: var(--pv-size-base); display: inherit; } @@ -133,6 +133,7 @@ exports[` should have delete icon 1`] = ` white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); background-color: var(--pv-color-secondary); color: var(--pv-color-secondary-contrast); } @@ -150,7 +151,6 @@ exports[` should have delete icon 1`] = ` } .emotion-2 { - margin-left: var(--pv-size-base); display: inherit; } @@ -235,6 +235,7 @@ exports[` should pass className 1`] = ` white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); background-color: var(--pv-color-secondary); color: var(--pv-color-secondary-contrast); } @@ -295,6 +296,7 @@ exports[` should render with default styles 1`] = ` white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); background-color: var(--pv-color-secondary); color: var(--pv-color-secondary-contrast); } @@ -355,6 +357,7 @@ exports[` variants & colors variant "contained, color "default" 1`] = ` white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); background-color: var(--pv-color-gray-4); color: var(--pv-color-black); } @@ -415,6 +418,7 @@ exports[` variants & colors variant "contained, color "secondary" 1`] = white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); background-color: var(--pv-color-secondary); color: var(--pv-color-secondary-contrast); } @@ -475,6 +479,7 @@ exports[` variants & colors variant "contained, color "wrong" 1`] = ` white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); background-color: var(--pv-color-wrong); color: var(--pv-color-wrong-contrast); } @@ -535,6 +540,7 @@ exports[` variants & colors variant "outlined, color "default" 1`] = ` white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); border-color: var(--pv-color-gray-6); color: var(--pv-color-black); } @@ -595,6 +601,7 @@ exports[` variants & colors variant "outlined, color "secondary" 1`] = ` white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); border-color: var(--pv-color-secondary-tint-2); color: var(--pv-color-secondary); } @@ -655,6 +662,7 @@ exports[` variants & colors variant "outlined, color "wrong" 1`] = ` white-space: nowrap; -webkit-text-decoration: none; text-decoration: none; + gap: var(--pv-size-base); border-color: var(--pv-color-wrong-tint-2); color: var(--pv-color-wrong); } diff --git a/packages/react-components/src/Chip/chip.tsx b/packages/react-components/src/Chip/chip.tsx index a37c3f1b..49775ced 100644 --- a/packages/react-components/src/Chip/chip.tsx +++ b/packages/react-components/src/Chip/chip.tsx @@ -81,6 +81,7 @@ const ChipRoot = styled('div', { alignItems: 'center', whiteSpace: 'nowrap', textDecoration: 'none', + gap: 'var(--pv-size-base)', ...(props.disabled && { pointerEvents: 'none', }), @@ -204,12 +205,10 @@ const ChipDeleteIcon = styled('span')({ }); const ChipStartContent = styled('span')({ - marginRight: 'var(--pv-size-base)', display: 'inherit', }); const ChipEndContent = styled('span')({ - marginLeft: 'var(--pv-size-base)', display: 'inherit', }); diff --git a/packages/react-components/src/Select/select.tsx b/packages/react-components/src/Select/select.tsx index a2c2aa26..29e97f02 100644 --- a/packages/react-components/src/Select/select.tsx +++ b/packages/react-components/src/Select/select.tsx @@ -275,22 +275,17 @@ const SelectPopover = styled(Popover)({ const SelectTagsList = styled('div')({ overflow: 'hidden', width: '100%', + display: 'grid', + gridTemplateColumns: 'repeat(auto-fit, minmax(0, max-content))', + gap: 'var(--pv-size-base)', }); const SelectTag = styled(Chip)<{ - tagsLength: number, - limitTags: number, size: SelectOwnProps['size'], }>((props) => ({ label: 'Select-tag', borderRadius: '3px', - margin: '0 var(--pv-size-base) 0 0', - ...(props.tagsLength === 1 && { - maxWidth: 'calc(100% - var(--pv-size-base))', - }), - ...(props.tagsLength > 1 && props.limitTags && { - maxWidth: `calc(${100 / props.limitTags}% - var(--pv-size-base))`, - }), + margin: 0, ...(props.size === 'small' && { height: 'var(--pv-size-base-5)', }), @@ -425,8 +420,6 @@ Multiple extends boolean | undefined = false, color="secondary" variant="contained" size={size} - limitTags={limitTags} - tagsLength={value.length} > {getOptionLabel(v)}