Skip to content

Commit bda4aa5

Browse files
authored
Merge pull request #1739 from opencloud-eu/fix/design-system-filter-margins
fix(design-system): filter chip margins
2 parents 360e5e4 + 9691bd7 commit bda4aa5

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

packages/design-system/src/components/OcFilterChip/OcFilterChip.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
>
66
<oc-button
77
:id="id"
8-
class="oc-filter-chip-button oc-pill py-1 px-2 text-xs rounded-full h-[26px] max-w-40 gap-1 focus:z-90"
9-
:class="{ 'oc-filter-chip-button-selected rounded-l-full rounded-r-none': filterActive }"
8+
:gap-size="filterActive ? 'small' : 'none'"
9+
class="oc-filter-chip-button oc-pill py-1 text-xs rounded-full h-[26px] max-w-40 focus:z-90 transition-[gap]"
10+
:class="{
11+
'oc-filter-chip-button-selected rounded-l-full rounded-r-none pr-2 pl-3': filterActive,
12+
'px-3': !filterActive
13+
}"
1014
:appearance="buttonAppearance"
1115
:color-role="buttonColorRole"
1216
:no-hover="filterActive || !hasActiveState"
@@ -26,7 +30,13 @@
2630
v-text="!!selectedItemNames.length ? selectedItemNames[0] : filterLabel"
2731
/>
2832
<span v-if="selectedItemNames.length > 1" v-text="` +${selectedItemNames.length - 1}`" />
29-
<oc-icon v-if="!filterActive && !isToggle" name="arrow-down-s" size="small" />
33+
<oc-icon
34+
v-if="!filterActive && !isToggle"
35+
name="arrow-down-s"
36+
size="small"
37+
fill-type="line"
38+
class="ml-1"
39+
/>
3040
</oc-button>
3141
<oc-drop
3242
v-if="!isToggle"

packages/web-pkg/tests/unit/components/Filters/__snapshots__/DateFilter.spec.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`DateFilter > can use a custom attribute as display name 1`] = `
44
"<div data-v-e73bd97a="" class="date-filter flex overflow-hidden [&amp;_label]:text-sm date-filter-users">
5-
<div data-v-e73bd97a="" class="oc-filter-chip flex"><button type="button" class="oc-button-secondary oc-button-outline oc-button-secondary-outline gap-2 justify-center text-base min-h-4 oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default oc-filter-chip-button oc-pill py-1 px-2 text-xs rounded-full h-[26px] max-w-40 gap-1 focus:z-90" id="oc-filter-chip-4">
5+
<div data-v-e73bd97a="" class="oc-filter-chip flex"><button type="button" class="oc-button-secondary oc-button-outline oc-button-secondary-outline gap-0 justify-center text-base min-h-4 oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default oc-filter-chip-button oc-pill py-1 text-xs rounded-full h-[26px] max-w-40 focus:z-90 transition-[gap] px-3" id="oc-filter-chip-4">
66
<!--v-if-->
77
<!-- @slot Content of the button --> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4 transform-[scale(0)] ease-out w-0 transition-all duration-250"><svg data-testid="inline-svg-stub" src="icons/check-fill.svg" transform-source="(svg) => {
88
if (__props.accessibleLabel !== &quot;&quot;) {
@@ -13,7 +13,7 @@ exports[`DateFilter > can use a custom attribute as display name 1`] = `
1313
};
1414
return svg;
1515
}" aria-hidden="true" focusable="false" class="size-4"></svg></span> <span class="truncate oc-filter-chip-label">Users</span>
16-
<!--v-if--> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4"><svg data-testid="inline-svg-stub" src="icons/arrow-down-s-fill.svg" transform-source="(svg) => {
16+
<!--v-if--> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4 ml-1"><svg data-testid="inline-svg-stub" src="icons/arrow-down-s-line.svg" transform-source="(svg) => {
1717
if (__props.accessibleLabel !== &quot;&quot;) {
1818
const title = document.createElement(&quot;title&quot;);
1919
title.setAttribute(&quot;id&quot;, svgTitleId.value);
@@ -119,7 +119,7 @@ exports[`DateFilter > can use a custom attribute as display name 1`] = `
119119
120120
exports[`DateFilter > renders all items 1`] = `
121121
"<div data-v-e73bd97a="" class="date-filter flex overflow-hidden [&amp;_label]:text-sm date-filter-users">
122-
<div data-v-e73bd97a="" class="oc-filter-chip flex"><button type="button" class="oc-button-secondary oc-button-outline oc-button-secondary-outline gap-2 justify-center text-base min-h-4 oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default oc-filter-chip-button oc-pill py-1 px-2 text-xs rounded-full h-[26px] max-w-40 gap-1 focus:z-90" id="oc-filter-chip-1">
122+
<div data-v-e73bd97a="" class="oc-filter-chip flex"><button type="button" class="oc-button-secondary oc-button-outline oc-button-secondary-outline gap-0 justify-center text-base min-h-4 oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default oc-filter-chip-button oc-pill py-1 text-xs rounded-full h-[26px] max-w-40 focus:z-90 transition-[gap] px-3" id="oc-filter-chip-1">
123123
<!--v-if-->
124124
<!-- @slot Content of the button --> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4 transform-[scale(0)] ease-out w-0 transition-all duration-250"><svg data-testid="inline-svg-stub" src="icons/check-fill.svg" transform-source="(svg) => {
125125
if (__props.accessibleLabel !== &quot;&quot;) {
@@ -130,7 +130,7 @@ exports[`DateFilter > renders all items 1`] = `
130130
};
131131
return svg;
132132
}" aria-hidden="true" focusable="false" class="size-4"></svg></span> <span class="truncate oc-filter-chip-label">Users</span>
133-
<!--v-if--> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4"><svg data-testid="inline-svg-stub" src="icons/arrow-down-s-fill.svg" transform-source="(svg) => {
133+
<!--v-if--> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4 ml-1"><svg data-testid="inline-svg-stub" src="icons/arrow-down-s-line.svg" transform-source="(svg) => {
134134
if (__props.accessibleLabel !== &quot;&quot;) {
135135
const title = document.createElement(&quot;title&quot;);
136136
title.setAttribute(&quot;id&quot;, svgTitleId.value);

packages/web-pkg/tests/unit/components/__snapshots__/ItemFilter.spec.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`ItemFilter > can use a custom attribute as display name 1`] = `
44
"<div class="item-filter flex item-filter-users">
5-
<div class="oc-filter-chip flex"><button type="button" class="oc-button-secondary oc-button-outline oc-button-secondary-outline gap-2 justify-center text-base min-h-4 oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default oc-filter-chip-button oc-pill py-1 px-2 text-xs rounded-full h-[26px] max-w-40 gap-1 focus:z-90" id="oc-filter-chip-3">
5+
<div class="oc-filter-chip flex"><button type="button" class="oc-button-secondary oc-button-outline oc-button-secondary-outline gap-0 justify-center text-base min-h-4 oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default oc-filter-chip-button oc-pill py-1 text-xs rounded-full h-[26px] max-w-40 focus:z-90 transition-[gap] px-3" id="oc-filter-chip-3">
66
<!--v-if-->
77
<!-- @slot Content of the button --> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4 transform-[scale(0)] ease-out w-0 transition-all duration-250"><svg data-testid="inline-svg-stub" src="icons/check-fill.svg" transform-source="(svg) => {
88
if (__props.accessibleLabel !== &quot;&quot;) {
@@ -13,7 +13,7 @@ exports[`ItemFilter > can use a custom attribute as display name 1`] = `
1313
};
1414
return svg;
1515
}" aria-hidden="true" focusable="false" class="size-4"></svg></span> <span class="truncate oc-filter-chip-label">Users</span>
16-
<!--v-if--> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4"><svg data-testid="inline-svg-stub" src="icons/arrow-down-s-fill.svg" transform-source="(svg) => {
16+
<!--v-if--> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4 ml-1"><svg data-testid="inline-svg-stub" src="icons/arrow-down-s-line.svg" transform-source="(svg) => {
1717
if (__props.accessibleLabel !== &quot;&quot;) {
1818
const title = document.createElement(&quot;title&quot;);
1919
title.setAttribute(&quot;id&quot;, svgTitleId.value);
@@ -61,7 +61,7 @@ exports[`ItemFilter > can use a custom attribute as display name 1`] = `
6161

6262
exports[`ItemFilter > renders all items 1`] = `
6363
"<div class="item-filter flex item-filter-users">
64-
<div class="oc-filter-chip flex"><button type="button" class="oc-button-secondary oc-button-outline oc-button-secondary-outline gap-2 justify-center text-base min-h-4 oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default oc-filter-chip-button oc-pill py-1 px-2 text-xs rounded-full h-[26px] max-w-40 gap-1 focus:z-90" id="oc-filter-chip-1">
64+
<div class="oc-filter-chip flex"><button type="button" class="oc-button-secondary oc-button-outline oc-button-secondary-outline gap-0 justify-center text-base min-h-4 oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default oc-filter-chip-button oc-pill py-1 text-xs rounded-full h-[26px] max-w-40 focus:z-90 transition-[gap] px-3" id="oc-filter-chip-1">
6565
<!--v-if-->
6666
<!-- @slot Content of the button --> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4 transform-[scale(0)] ease-out w-0 transition-all duration-250"><svg data-testid="inline-svg-stub" src="icons/check-fill.svg" transform-source="(svg) => {
6767
if (__props.accessibleLabel !== &quot;&quot;) {
@@ -72,7 +72,7 @@ exports[`ItemFilter > renders all items 1`] = `
7272
};
7373
return svg;
7474
}" aria-hidden="true" focusable="false" class="size-4"></svg></span> <span class="truncate oc-filter-chip-label">Users</span>
75-
<!--v-if--> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4"><svg data-testid="inline-svg-stub" src="icons/arrow-down-s-fill.svg" transform-source="(svg) => {
75+
<!--v-if--> <span class="oc-icon box-content inline-block align-baseline [&amp;_svg]:block size-4 ml-1"><svg data-testid="inline-svg-stub" src="icons/arrow-down-s-line.svg" transform-source="(svg) => {
7676
if (__props.accessibleLabel !== &quot;&quot;) {
7777
const title = document.createElement(&quot;title&quot;);
7878
title.setAttribute(&quot;id&quot;, svgTitleId.value);

0 commit comments

Comments
 (0)