Skip to content

Commit 995ca21

Browse files
authored
Hotfix/fix fluid clickable (#872)
#### Por favor, verifique se o seu pull request está de acordo com o checklist abaixo: - [x] A implementação feita possui testes (Caso haja um motivo para não haver testes/haver apenas testes de snapshot, descrever abaixo) - [x] A documentação no mdx foi feita ou atualizada, caso necessário - [x] O eslint passou localmente ### 1 - Resumo ### 2 - Tipo de pull request - [ ] 🧱 Novo componente - [ ] ✨ Nova feature ou melhoria - [X] 🐛 Fix - [ ] 👨‍💻 Refatoração - [ ] 📝 Documentação - [ ] 🎨 Estilo - [ ] 🤖 Build ou CI/CD ### 3 - Esse PR fecha alguma issue? Favor referenciá-la Não ### 4 - Quais são os passos para avaliar o pull request? Corrige fluidez do wrapper clickable/box ### 5 - Imagem ou exemplo de uso: ### 6 - Esse pull request adiciona _breaking changes_? - [ ] Sim - [X] Não
1 parent 16cecd3 commit 995ca21

File tree

10 files changed

+33
-38
lines changed

10 files changed

+33
-38
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sysvale/cuida",
3-
"version": "3.99.0",
3+
"version": "3.99.1",
44
"description": "A design system built by Sysvale, using storybook and Vue components",
55
"repository": {
66
"type": "git",

src/components/Box.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<cds-clickable
88
class="box__container"
99
:clickable="clickable"
10+
:fluid="fluid"
1011
@click="handleClick"
1112
>
1213
<!-- @slot Slot utilizado para renderização do conteúdo interno do Box.-->

src/components/Clickable.vue

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,28 @@ export default {
2525
clickable: {
2626
type: Boolean,
2727
default: false,
28-
}
29-
}
28+
},
29+
/**
30+
* Permite que o clickable se expanda de forma fluida
31+
*/
32+
fluid: {
33+
type: Boolean,
34+
default: false,
35+
required: false,
36+
},
37+
},
38+
39+
computed: {
40+
widthResolver() {
41+
return this.fluid ? '100%' : 'fit-content';
42+
},
43+
},
3044
}
3145
</script>
3246

3347
<style lang="scss">
3448
.clickable__container {
35-
width: fit-content;
49+
width: v-bind(widthResolver);
3650
3751
&--clickable {
3852
@extend .clickable__container;

src/components/Spacer.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export default {
129129

130130
<style lang="scss" scoped>
131131
.spacer {
132+
width: 100%;
132133
margin-bottom: v-bind(marginBottomResolver);
133134
margin-left: v-bind(marginLeftResolver);
134135
margin-right: v-bind(marginRightResolver);

src/components/Tile.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function handleClick() {
154154
}
155155
</script>
156156

157-
<style lang="scss">
157+
<style lang="scss" scoped>
158158
@import '../assets/sass/tokens.scss';
159159
160160
.cds-tile {

src/stories/components/BaseInput.stories.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ export const supportingText = ['We’ll use this address if', 'Ask for help'];
125125
errorMessage: 'Campo obrigatório',
126126
tooltip: '',
127127
tooltipIcon: 'info-outline',
128-
linkText: 'link',
129128
trailingIcon: 'info-outline',
130129
leadingIcon: 'info-outline',
131130
}}

src/stories/components/Label.stories.mdx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,6 @@ import Label from '../../components/Label.vue';
44
<Meta
55
title="Componentes/Forms/Label"
66
component={ Label }
7-
argTypes={{
8-
variant: {
9-
control:{
10-
type: 'select',
11-
options: [
12-
'green',
13-
'teal',
14-
'turquoise',
15-
'blue',
16-
'indigo',
17-
'violet',
18-
'pink',
19-
'red',
20-
'orange',
21-
'amber',
22-
'dark'
23-
],
24-
}
25-
},
26-
}}
277
parameters={{
288
viewMode: 'docs',
299
previewTabs: { canvas: { hidden: true }},
@@ -100,8 +80,8 @@ export const Template = (args) => ({
10080
required: false,
10181
fluid: false,
10282
for: 'input-id',
103-
label: 'Label',
104-
tooltip: '',
83+
text: 'Label',
84+
tooltip: '',
10585
tooltipIcon: 'info-outline',
10686
supportLink: '',
10787
supportLinkUrl: '',

src/tests/__snapshots__/Breadcrumb.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`Breadcrumb snapshot test > renders correctly 1`] = `
44
"<nav data-v-1a0f46d9="">
55
<ul data-v-1a0f46d9="" class="breadcrumb">
66
<li data-v-1a0f46d9="" role="presentation">
7-
<cds-clickable-stub data-v-1a0f46d9="" clickable="true"></cds-clickable-stub>
7+
<cds-clickable-stub data-v-1a0f46d9="" clickable="true" fluid="false"></cds-clickable-stub>
88
</li>
99
<li data-v-1a0f46d9="" role="presentation">
1010
<cds-spacer-stub data-v-1a0f46d9="" padding="0" paddingtop="0" paddingright="0" paddingbottom="0" paddingleft="0" margin="0" margintop="0" marginright="1" marginbottom="0" marginleft="1" class="breadcrumb__item"></cds-spacer-stub>

src/tests/__snapshots__/Table.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ exports[`Table > renders correctly 1`] = `
99
<!--
1010
@slot Slot usado para renderizar itens personalizados para o cabeçalho da tabela. Dados do item referente à coluna podem ser acessados através da propriedade \`data\`. Os dados do escopo do slot podem ser acessados no formato a seguir: slot-scope={ data }
1111
-->
12-
<cds-clickable-stub data-v-83c58b0d="" clickable="false" id="sort-icon-field1"></cds-clickable-stub>
12+
<cds-clickable-stub data-v-83c58b0d="" clickable="false" fluid="false" id="sort-icon-field1"></cds-clickable-stub>
1313
</div>
1414
</th>
1515
<th data-v-83c58b0d="" class="table__header-item">
1616
<div data-v-83c58b0d="" class="table__header-item-content">
1717
<!--
1818
@slot Slot usado para renderizar itens personalizados para o cabeçalho da tabela. Dados do item referente à coluna podem ser acessados através da propriedade \`data\`. Os dados do escopo do slot podem ser acessados no formato a seguir: slot-scope={ data }
1919
-->
20-
<cds-clickable-stub data-v-83c58b0d="" clickable="false" id="sort-icon-field2"></cds-clickable-stub>
20+
<cds-clickable-stub data-v-83c58b0d="" clickable="false" fluid="false" id="sort-icon-field2"></cds-clickable-stub>
2121
</div>
2222
</th>
2323
<th data-v-83c58b0d="" class="table__header-item--last">
2424
<div data-v-83c58b0d="" class="table__header-item-content">
2525
<!--
2626
@slot Slot usado para renderizar itens personalizados para o cabeçalho da tabela. Dados do item referente à coluna podem ser acessados através da propriedade \`data\`. Os dados do escopo do slot podem ser acessados no formato a seguir: slot-scope={ data }
2727
-->
28-
<cds-clickable-stub data-v-83c58b0d="" clickable="false" id="sort-icon-field3"></cds-clickable-stub>
28+
<cds-clickable-stub data-v-83c58b0d="" clickable="false" fluid="false" id="sort-icon-field3"></cds-clickable-stub>
2929
</div>
3030
</th>
3131
</tr>

src/tests/__snapshots__/Tile.spec.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`Tile > renders correctly 1`] = `
4-
"<div data-v-f9290560="" class="box--green--light">
4+
"<div data-v-f9290560="" data-v-b66d1b07="" class="box--green--light">
55
<!--
66
Evento emitido quando o wrapper é clicado
77
@event cds-click
@@ -10,16 +10,16 @@ exports[`Tile > renders correctly 1`] = `
1010
<div data-v-f9290560="" class="clickable__container--clickable box__container">
1111
<!-- @slot Slot utilizado para renderização do conteúdo interno do Box.-->
1212
<div data-v-9cc3ee57="" data-v-f9290560="" class="spacer">
13-
<div class="cds-tile__extra-container">
14-
<div class="cds-tile__extra">
13+
<div data-v-b66d1b07="" class="cds-tile__extra-container">
14+
<div data-v-b66d1b07="" class="cds-tile__extra">
1515
<!-- @slot Slot para incluir conteúdo adicional no canto superior direito da tile.-->
1616
</div>
1717
</div>
18-
<div>
19-
<div class="cds-tile__image--green cds-tile__image--md"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="trash-outline" role="presentation" class="cds-tile__icon">
18+
<div data-v-b66d1b07="">
19+
<div data-v-b66d1b07="" class="cds-tile__image--green cds-tile__image--md"><svg data-v-b66d1b07="" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="trash-outline" role="presentation" class="cds-tile__icon">
2020
<g fill="currentColor"></g>
2121
</svg></div>
22-
<div class="cds-tile__text--green cds-tile__text--md">Tile content</div>
22+
<div data-v-b66d1b07="" class="cds-tile__text--green cds-tile__text--md">Tile content</div>
2323
</div>
2424
</div>
2525
</div>

0 commit comments

Comments
 (0)