From ce84977714b7f7992dcc8dfe32c2b93daf67a112 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Tue, 6 Oct 2020 17:04:47 -0400 Subject: [PATCH] Remove unused lines prop, remove unused subtitle comp --- app/src/components/register.ts | 5 +- .../components/v-divider/v-divider.story.ts | 10 +- app/src/components/v-list/index.ts | 15 +- app/src/components/v-list/readme.md | 293 ------------ .../components/v-list/v-list-item-icon.vue | 18 +- .../v-list/v-list-item-subtitle.vue | 39 -- ...st-item-title.vue => v-list-item-text.vue} | 6 +- app/src/components/v-list/v-list-item.vue | 47 +- app/src/components/v-list/v-list.story.ts | 442 ------------------ app/src/components/v-list/v-list.test.ts | 223 --------- app/src/components/v-list/v-list.vue | 16 +- app/src/components/v-select/v-select.test.ts | 4 +- .../docs/components/navigation-item.vue | 4 +- .../settings/components/navigation.vue | 6 +- 14 files changed, 35 insertions(+), 1093 deletions(-) delete mode 100644 app/src/components/v-list/readme.md delete mode 100644 app/src/components/v-list/v-list-item-subtitle.vue rename app/src/components/v-list/{v-list-item-title.vue => v-list-item-text.vue} (73%) delete mode 100644 app/src/components/v-list/v-list.story.ts delete mode 100644 app/src/components/v-list/v-list.test.ts diff --git a/app/src/components/register.ts b/app/src/components/register.ts index 791834dcaa..37167caa28 100644 --- a/app/src/components/register.ts +++ b/app/src/components/register.ts @@ -27,7 +27,7 @@ import VList, { VListItemHint, VListItemIcon, VListItemSubtitle, - VListItemTitle, + VListItemText, } from './v-list/'; import VMenu from './v-menu/'; import VModal from './v-modal/'; @@ -77,8 +77,7 @@ Vue.component('v-list-group', VListGroup); Vue.component('v-list-item-content', VListItemContent); Vue.component('v-list-item-hint', VListItemHint); Vue.component('v-list-item-icon', VListItemIcon); -Vue.component('v-list-item-subtitle', VListItemSubtitle); -Vue.component('v-list-item-title', VListItemTitle); +Vue.component('v-list-item-text', VListItemText); Vue.component('v-list-item', VListItem); Vue.component('v-list', VList); Vue.component('v-menu', VMenu); diff --git a/app/src/components/v-divider/v-divider.story.ts b/app/src/components/v-divider/v-divider.story.ts index 1ebd5467c0..2e53db5426 100644 --- a/app/src/components/v-divider/v-divider.story.ts +++ b/app/src/components/v-divider/v-divider.story.ts @@ -3,7 +3,7 @@ import readme from './readme.md'; import withPadding from '../../../.storybook/decorators/with-padding'; import { withKnobs, boolean } from '@storybook/addon-knobs'; import { defineComponent } from '@vue/composition-api'; -import VList, { VListItem, VListItemContent, VListItemTitle, VListItemIcon } from '@/components/v-list'; +import VList, { VListItem, VListItemContent, VListItemText, VListItemIcon } from '@/components/v-list'; import VIcon from '@/components/v-icon/'; export default { @@ -72,7 +72,7 @@ export const inList = () => VListItem, VListItemContent, VListItemIcon, - VListItemTitle, + VListItemText, VIcon, }, props: {}, @@ -82,7 +82,7 @@ export const inList = () => - Item {{ n }} + Item {{ n }} @@ -91,7 +91,7 @@ export const inList = () => - Item {{ n + 3 }} + Item {{ n + 3 }} @@ -100,7 +100,7 @@ export const inList = () => - Item {{ n + 4 }} + Item {{ n + 4 }} diff --git a/app/src/components/v-list/index.ts b/app/src/components/v-list/index.ts index 9f91d5c3a4..e6ac55a2ae 100644 --- a/app/src/components/v-list/index.ts +++ b/app/src/components/v-list/index.ts @@ -1,20 +1,11 @@ import VList from './v-list.vue'; import VListItem from './v-list-item.vue'; import VListItemContent from './v-list-item-content.vue'; -import VListItemTitle from './v-list-item-title.vue'; -import VListItemSubtitle from './v-list-item-subtitle.vue'; +import VListItemText from './v-list-item-text.vue'; import VListItemIcon from './v-list-item-icon.vue'; import VListItemHint from './v-list-item-hint.vue'; import VListGroup from './v-list-group.vue'; -export { - VList, - VListItem, - VListItemContent, - VListItemTitle, - VListItemSubtitle, - VListItemIcon, - VListItemHint, - VListGroup, -}; +export { VList, VListItem, VListItemContent, VListItemText, VListItemIcon, VListItemHint, VListGroup }; + export default VList; diff --git a/app/src/components/v-list/readme.md b/app/src/components/v-list/readme.md deleted file mode 100644 index 756cb7bf22..0000000000 --- a/app/src/components/v-list/readme.md +++ /dev/null @@ -1,293 +0,0 @@ -# List - -```html - - - - {{ item.text }} - - - -``` - -## Props - -| Prop | Description | Default | -| ----------- | ----------------------------------------------------------------------------------------------------------- | ------- | -| `dense` | Removes some padding to make the list items closer together | `false` | -| `threeLine` | Limits list items to three lines of text (1 of title, 2 of subtitle). Only works in webkit enabled browsers | `false` | -| `nav` | Adds a small margin and border-radius for nav menu styling | `false` | -| `multiple` | Allows multiple child groups to be open at once | `true` | - -## Events - -n/a - -## Slots - -| Slot | Description | Data | -| --------- | ------------ | ---- | -| _default_ | List content | | - -## CSS Variables - -| Variable | Default | -| ---------------------------------- | -------------------------------- | -| `--v-list-padding` | `8px 0` | -| `--v-list-max-height` | `none` | -| `--v-list-max-width` | `none` | -| `--v-list-min-width` | `none` | -| `--v-list-min-height` | `none` | -| `--v-list-color` | `var(--foreground-normal)` | -| `--v-list-color-hover` | `var(--foreground-normal)` | -| `--v-list-color-active` | `var(--foreground-normal)` | -| `--v-list-background-color-hover` | `var(--background-normal-alt)` | -| `--v-list-background-color-active` | `var(--background-normal-alt)` | - ---- - -# List Item - -A wrapper for list items that formats children nicely. Can be used on its own or inside a list component. Best used with subcomponents (see below). - -## Usage - -```html - - Hello, world! - -``` - -## Props - -| Prop | Description | Default | -|------------|----------------------------------------------------------------------|---------| -| `dense` | Removes some padding to make the individual list item shorter | `false` | -| `lines` | Sets if the list item will support `1`, `2`, or `3` lines of content | `null` | -| `to` | Render as vue router-link with to link | `null` | -| `disabled` | Disable the list item | `false` | -| `active` | Enable the list item's active state | `false` | -| `exact` | Set the `exact` prop on router-link. Used with `to` | `false` | - -## Events - -n/a - -## Slots - -| Slot | Description | Data | -| --------- | ----------------- | ---- | -| _default_ | List item content | | - -## CSS Variables - -| Variable | Default | -| ------------------------------------------- | ----------------------------------------------------------------------- | -| `--v-list-item-one-line-min-height` | `48px` | -| `--v-list-item-two-line-min-height` | `60px` | -| `--v-list-item-three-line-min-height` | `76px` | -| `--v-list-item-one-line-min-height-dense` | `40px` | -| `--v-list-item-two-line-min-height-dense` | `48px` | -| `--v-list-item-three-line-min-height-dense` | `64px` | -| `--v-list-item-padding` | `0 16px 0 calc(16px + var(--v-list-item-indent, 0px))` | -| `--v-list-item-min-width` | `none` | -| `--v-list-item-max-width` | `none` | -| `--v-list-item-min-height` | `var(--v-list-item-one-line-min-height)` | -| `--v-list-item-max-height` | `auto` | -| `--v-list-item-border-radius` | `0` | -| `--v-list-item-margin-bottom` | `0` | -| `--v-list-item-color` | `var(--v-list-color, var(--foreground-normal))` | -| `--v-list-item-color-hover` | `var(--v-list-color-hover, var(--foreground-normal))` | -| `--v-list-item-color-active` | `var(--v-list-color-active, var(--foreground-normal))` | -| `--v-list-item-background-color-hover` | `var(--v-list-background-color-hover, var(--background-normal-alt))` | -| `--v-list-item-background-color-active` | `var(--v-list-background-color-active, var(--background-normal-alt))` | - ---- - -# List Item Content - -A wrapper for the main text content of a list item. It adds some padding and helps control overflow. The parent of `v-list-title` and `v-list-subtitle` components, it's also the main controller of the `dense` option on lists. - -## Usage - -```html -Hello, world! -``` - -## Props - -n/a - -## Events - -n/a - -## Slots - -| Slot | Description | Data | -| --------- | ------------------------- | ---- | -| _default_ | List item content content | | - -## CSS Variables - -| Variable | Default | -| ------------------------------- | -------- | -| `--v-list-item-content-padding` | `12px 0` | - ---- - -# List Item Title - -Wrapper that adds typographic styling and margin for the subtitle/description of the list item. Responsive to `dense` and `threeLine` props. - -## Usage - -```html -Hello, world -``` - -## Props - -n/a - -## Events - -n/a - -## Slots - -| Slot | Description | Data | -| --------- | ----------------------- | ---- | -| _default_ | List item title content | | - -## CSS Variables - -n/a - ---- - -# List Item Subtitle - -Wrapper that adds typographic styling and margin for the subtitle/description of the list item. Responsive to `dense` and `threeLine` props. - -## Usage - -```html -This is the subtitle -``` - -## Props - -n/a - -## Events - -n/a - -## Slots - -| Slot | Description | Data | -| --------- | -------------------------- | ---- | -| _default_ | List item subtitle content | | - -## CSS Variables - -n/a - ---- - -# List Item Icon - -Wrapper for icon, action, or avatar type elements in a list item. Can be used on the left or right of an item. - -## Usage - -```html - - - -``` - -## Props - -| Prop | Description | Default | -| -------- | ------------------------------------------------------------------- | ------- | -| `center` | Whether to center the element (good for action elements or avatars) | `false` | - -## Events - -n/a - -## Slots - -| Slot | Description | Data | -| --------- | ---------------------- | ---- | -| _default_ | List item icon content | | - -## CSS Variables - -n/a - ---- - -# List Group - -Provides the ability to make a collapsable (sub)group of list items, within a list or independently. List groups can be nested to an arbitrary depth. - -```html - - - - - - - - - - ...item content etc. - - - - - - - - - - - - - - - - - -``` - -## Props - -| Prop | Description | Default | -|------------|---------------------------------------------------------------------------------|---------| -| `multiple` | Allow multiple subgroups to be open at the same time | `true` | -| `to` | Where to link to. This will only make the chevron toggle the group active state | | -| `active` | Render the activitor item in the active state | `false` | - -## Events - -n/a - -## Slots - -| Slot | Description | Data | -| --------- | ------------- | ---- | -| _default_ | Group content | | - -## CSS Variables - -n/a diff --git a/app/src/components/v-list/v-list-item-icon.vue b/app/src/components/v-list/v-list-item-icon.vue index 033fb30c39..52a9184299 100644 --- a/app/src/components/v-list/v-list-item-icon.vue +++ b/app/src/components/v-list/v-list-item-icon.vue @@ -35,6 +35,7 @@ body { &:first-child { margin-right: 12px; } + &:last-child { margin-left: 12px; } @@ -44,31 +45,22 @@ body { .v-list, .v-list-item { #{$this} { + --v-icon-color: var(--v-list-item-icon-color); + margin-top: 4px; margin-bottom: 4px; - --v-icon-color: var(--v-list-item-icon-color); + &:not(:only-child) { &:first-child { margin-right: 8px; } + &:last-child { margin-left: 8px; } } } - &.large { - &.three-line, - &.two-line { - #{$this} { - align-self: flex-start; - &.center { - align-self: center; - } - } - } - } - &.large #{$this} .v-icon { --v-icon-color: none; } diff --git a/app/src/components/v-list/v-list-item-subtitle.vue b/app/src/components/v-list/v-list-item-subtitle.vue deleted file mode 100644 index e28675f90c..0000000000 --- a/app/src/components/v-list/v-list-item-subtitle.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/app/src/components/v-list/v-list-item-title.vue b/app/src/components/v-list/v-list-item-text.vue similarity index 73% rename from app/src/components/v-list/v-list-item-title.vue rename to app/src/components/v-list/v-list-item-text.vue index 39c7c7ba00..3fc14f3f10 100644 --- a/app/src/components/v-list/v-list-item-title.vue +++ b/app/src/components/v-list/v-list-item-text.vue @@ -1,11 +1,11 @@