Skip to content

Commit

Permalink
Full height for RadioButtonLarge (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfriss committed Oct 26, 2022
1 parent ece09e1 commit 1db29e9
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 1.0.0-beta.63

### Features

Adds `full-height` prop to `RadioButtonLarge`

## 1.0.0-beta.62

### Features
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lob/ui-components",
"version": "1.0.0-beta.62",
"version": "1.0.0-beta.63",
"engines": {
"node": ">=14.18.2",
"npm": ">=8.3.0"
Expand Down
8 changes: 7 additions & 1 deletion src/components/RadioButtonLarge/RadioButtonLarge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
<div
:class="[
{'min-h-[60px]': revealText},
{'!cursor-not-allowed': disabled}
{'!cursor-not-allowed': disabled},
{'h-full': fullHeight}
]"
>
<div
:class="[
'min-h-[3rem] cursor-pointer bg-white top-1 inline-block mr-4 border border-gray-100 rounded-lg pl-2',
fullWidth ? 'w-full' : 'w-[200px]',
{'h-full': fullHeight},
{'hover:border-gray-300': !disabled},
{'!border-primary-500 ring-inset ring-1 ring-primary-500': checked && !disabled && !error},
{'bg-white-100 !cursor-not-allowed': disabled},
Expand Down Expand Up @@ -106,6 +108,10 @@ export default {
fullWidth: {
type: Boolean,
default: false
},
fullHeight: {
type: Boolean,
default: false
}
},
emits: ['update:modelValue', 'input', 'click'],
Expand Down
44 changes: 44 additions & 0 deletions src/components/RadioGroup/RadioGroup.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,47 @@ LargeGroup.args = {
legend: 'Postcard Size',
separateLines: false
};

const largeGroupWithFullHeightModel = '';

const LargeGroupWithFullHeightTemplate = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: { RadioGroup, RadioButtonLarge },
data: () => ({ largeGroupWithFullHeightModel }),
setup: () => ({ args }),
template: `
<radio-group large v-bind="args">
<div style="width: 50%; margin-right: 10px">
<radio-button-large
id="4x6"
name="postcard-size"
label="4x6"
value="4x6"
v-model="largeGroupWithFullHeightModel"
helper-text="This is a short description"
full-width
full-height
/>
</div>
<div style="width: 50%">
<radio-button-large
id="5x7"
name="postcard-size"
label="5x7"
value="5x7"
v-model="largeGroupWithFullHeightModel"
helper-text="This is a very long description so we can see what happens when the text takes up two (or more) lines. All of the text should show inside the radio button, and not overflow outside of it."
full-width
full-height
/>
</div>
</radio-group>
`
});

export const LargeGroupWithFullHeight = LargeGroupWithFullHeightTemplate.bind({});
LargeGroupWithFullHeight.args = {
legend: 'Postcard Size',
separateLines: false
};

0 comments on commit 1db29e9

Please sign in to comment.