Skip to content

Commit

Permalink
feat: [button/alert] - wrap button label set tofalse by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgoud committed Nov 28, 2023
1 parent de8a269 commit 912ad53
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/components/alert/src/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const alertProps = buildProps({
buttonWrapLabel: {
type: Boolean,
required: false,
default: true,
default: false,
},
isClosable: {
type: Boolean,
Expand Down
56 changes: 48 additions & 8 deletions packages/components/alert/stories/alert.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
description: 'Set the carriage return of the button label',
table: {
defaultValue: {
summary: true,
summary: false,
},
},
},
Expand All @@ -67,7 +67,7 @@ export default {
variant: 'success',
disableBorders: false,
buttonLabel: 'Button',
buttonWrapLabel: true,
buttonWrapLabel: false,
isClosable: false,
},
} as Meta
Expand Down Expand Up @@ -134,14 +134,25 @@ export const Default = {
},
}

export const buttonWrapLabelToFalse: StoryObj = {
export const buttonWrapLabel: StoryObj = {
render: () => ({
components: {
PuikAlert,
},
template: `
<div class="flex flex-col space-y-4">
<puik-alert title="Title" button-label="Button with a very long label" :button-wrap-Label="false">
<puik-alert title="buttonWrapLabel to true" button-label="Button with a very long label" button-wrap-Label>
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
</puik-alert>
<puik-alert title="buttonWrapLabel to false (by default)" button-label="Button with a very long label">
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
Expand All @@ -162,9 +173,25 @@ export const buttonWrapLabelToFalse: StoryObj = {
code: `
<!--VueJS Snippet-->
<puik-alert
title="Title"
button-label="No wrap button with a very long label"
:button-wrap-Label="false"
title="buttonWrapLabel to true"
button-label="Button with a very long label"
button-wrap-Label
@click="click"
>
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
This an alert with a very long description.
</puik-alert>
<puik-alert
title="buttonWrapLabel to false (by default)"
button-label="Button with a very long label"
@click="click"
>
This an alert with a very long description.
Expand All @@ -183,7 +210,20 @@ export const buttonWrapLabelToFalse: StoryObj = {
<div class="puik-alert__content">
<div class="puik-icon puik-alert__icon" style="font-size: 1.25rem;">check_circle</div>
<div class="puik-alert__text">
<p class="puik-alert__title">Title</p>
<p class="puik-alert__title">buttonWrapLabel to true</p>
<span class="puik-alert__description"> This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. </span>
</div>
</div>
<button class="puik-button puik-button--success puik-button--md puik-button--no-wrap puik-alert__button">
Button with a very long label
</button>
</div>
<div class="puik-alert__container">
<div class="puik-alert__content">
<div class="puik-icon puik-alert__icon" style="font-size: 1.25rem;">check_circle</div>
<div class="puik-alert__text">
<p class="puik-alert__title">buttonWrapLabel to false (by default)</p>
<span class="puik-alert__description"> This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. This an alert with a very long description. </span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/button/src/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const buttonProps = buildProps({
wrapLabel: {
type: Boolean,
required: false,
default: true,
default: false,
},
disabled: {
type: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/button/stories/button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
description: 'Set the carriage return of the button label',
table: {
defaultValue: {
summary: true,
summary: false,
},
},
},
Expand Down

0 comments on commit 912ad53

Please sign in to comment.