Skip to content

Commit

Permalink
feat(List): add new variant mini
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Jun 20, 2023
1 parent 0641f14 commit 2acc37b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/list/src/List.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ export const Small: Story = (args) => ({
`,
});

export const Mini = Small.bind({})
Mini.args = {
mini: true,
}

export const Shaped: Story = (args) => ({
components: {
List,
Expand Down
2 changes: 2 additions & 0 deletions packages/list/src/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Props = {
hideText?: boolean;
activeVariant?: "filled" | "bordered" | "filled-bordered";
activeBorderPosition?: "top" | "right" | "bottom" | "left";
mini?: boolean;
};
const props = withDefaults(defineProps<Props>(), {
Expand Down Expand Up @@ -51,6 +52,7 @@ const isBorderedVariant = computed(() => {
'v-list--small': small,
'v-list--large': large,
'v-list--hide-text': hideText,
'v-list--mini': mini,
[`v-list--active-${activeVariant}-${activeBorderPosition}`]: isBorderedVariant,
},
]"
Expand Down
14 changes: 14 additions & 0 deletions packages/themes/src/morpheme/_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@
flex-direction: column;
overflow: hidden;

&--mini {
max-width: var(--nav-drawer-mini-width, 64px);

.v-list-item {
justify-content: center;
min-height: 44px;

&-append,
&-content {
display: none;
}
}
}

&-item {
padding: var(--v-list-item-padding-y) var(--v-list-item-padding-x);
gap: var(--v-list-item-gap);
Expand Down

0 comments on commit 2acc37b

Please sign in to comment.