Skip to content

Commit

Permalink
Drop layout heeader buttons spacer (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec authored Mar 7, 2022
1 parent bd57815 commit cdbeedb
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 122 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fastybird/web-ui-theme",
"version": "0.8.0",
"version": "0.9.0",
"description": "FastyBird basic theme & Vue components for web apps",
"keywords": [
"fastybird",
Expand Down
8 changes: 6 additions & 2 deletions src/assets/components/layout/fb-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ $hamburger-bar-line-distance: 5px !default;
@include box-shadow(0 3px 9px rgba(0, 0, 0, 0.5));
}

@mixin flex-heading {
@mixin flex-buttons {
justify-content: space-between;

@include flex-row(nowrap);
}

flex-wrap: nowrap;
@mixin flex-heading {
@include flex-row(nowrap);
}
57 changes: 46 additions & 11 deletions src/components/layout/FbHeader/Button/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</template>

<template v-else>
{{ label }}
<slot />
</template>
</a>
</template>
Expand All @@ -28,7 +28,7 @@
</template>

<template v-else>
{{ label }}
<slot />
</template>
</router-link>
</template>
Expand All @@ -44,10 +44,30 @@
</template>

<template v-else>
{{ label }}
<slot />
</template>
</button>
</template>

<template v-else-if="actionType === menuItemTypes.TEXT">
<div
:class="['fb-theme-layout-header-button__container', {'fb-theme-layout-header-button__container-small': small}, {'fb-theme-layout-header-button__container-textual': !('icon' in $slots)}, {'fb-theme-layout-header-button__container-left': left}, {'fb-theme-layout-header-button__container-right': right}]"
>
<template v-if="'icon' in $slots">
<slot name="icon" />
</template>

<template v-else>
<slot />
</template>
</div>
</template>

<template v-else-if="actionType === menuItemTypes.BLANK">
<div
:class="['fb-theme-layout-header-button__container', {'fb-theme-layout-header-button__container-small': small}, {'fb-theme-layout-header-button__container-left': left}, {'fb-theme-layout-header-button__container-right': right}]"
/>
</template>
</teleport>
</template>

Expand All @@ -63,7 +83,7 @@
</template>

<template v-else>
{{ label }}
<slot />
</template>
</a>
</template>
Expand All @@ -79,7 +99,7 @@
</template>

<template v-else>
{{ label }}
<slot />
</template>
</router-link>
</template>
Expand All @@ -95,10 +115,30 @@
</template>

<template v-else>
{{ label }}
<slot />
</template>
</button>
</template>

<template v-else-if="actionType === menuItemTypes.TEXT">
<div
:class="['fb-theme-layout-header-button__container', {'fb-theme-layout-header-button__container-small': small}, {'fb-theme-layout-header-button__container-textual': !('icon' in $slots)}, {'fb-theme-layout-header-button__container-left': left}, {'fb-theme-layout-header-button__container-right': right}]"
>
<template v-if="'icon' in $slots">
<slot name="icon" />
</template>

<template v-else>
<slot />
</template>
</div>
</template>

<template v-else-if="actionType === menuItemTypes.BLANK">
<div
:class="['fb-theme-layout-header-button__container', {'fb-theme-layout-header-button__container-small': small}, {'fb-theme-layout-header-button__container-left': left}, {'fb-theme-layout-header-button__container-right': right}]"
/>
</template>
</template>
</template>

Expand Down Expand Up @@ -136,11 +176,6 @@ export default defineComponent({
},
},
label: {
type: String as PropType<string | null>,
default: null,
},
small: {
type: Boolean as PropType<boolean>,
default: false,
Expand Down
1 change: 0 additions & 1 deletion src/components/layout/FbHeader/Button/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { FbMenuItemTypes } from "@/types";
export interface IFbLayoutHeaderButtonProps {
actionType: FbMenuItemTypes;
action: string | { [key: string]: any } | null;
label: string | null;
small: boolean;
left: boolean;
right: boolean;
Expand Down
24 changes: 0 additions & 24 deletions src/components/layout/FbHeader/Spacer/index.scss

This file was deleted.

68 changes: 0 additions & 68 deletions src/components/layout/FbHeader/Spacer/index.vue

This file was deleted.

6 changes: 0 additions & 6 deletions src/components/layout/FbHeader/Spacer/types.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/layout/FbHeader/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
transition: height 0.3s ease-in-out;
overflow: hidden;

@include flex-heading;
@include flex-buttons;

&-expanded {
height: 3rem;
Expand Down
1 change: 0 additions & 1 deletion src/components/layout/FbHeader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export { default as FbLayoutHeaderButton } from "./Button/index.vue";
export { default as FbLayoutHeaderContent } from "./Content/index.vue";
export { default as FbLayoutHeaderHeading } from "./Heading/index.vue";
export { default as FbLayoutHeaderIcon } from "./Icon/index.vue";
export { default as FbLayoutHeaderSpacer } from "./Spacer/index.vue";
9 changes: 3 additions & 6 deletions src/components/layout/FbHeader/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
FbLayoutHeaderButton,
FbLayoutHeaderContent,
FbLayoutHeaderHeading,
FbLayoutHeaderSpacer,
} from "@/components/layout/FbHeader/index";
import { FbMenuItemTypes } from "@/types";

Expand Down Expand Up @@ -63,7 +62,6 @@ const Template: Story<ITemplateArgs> = (args) => {
FbLayoutHeader,
FbLayoutHeaderHeading,
FbLayoutHeaderButton,
FbLayoutHeaderSpacer,
FbLayoutHeaderContent,
},
setup(): any {
Expand All @@ -87,14 +85,13 @@ const Template: Story<ITemplateArgs> = (args) => {
</template>
<template #button-small>
<fb-layout-header-spacer :teleport="false" />
<fb-layout-header-button
:label="'Close'"
:teleport="false"
small
type="${FbMenuItemTypes.BUTTON}"
/>
>
Close
</fb-layout-header-button>
</template>
<template #sub-content>
Expand Down
1 change: 0 additions & 1 deletion src/components/layout/FbHeader/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from "./Button/types";
export * from "./Content/types";
export * from "./Heading/types";
export * from "./Icon/types";
export * from "./Spacer/types";

export interface IFbLayoutHeaderProps {
menuButtonHidden: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum FbMenuItemTypes {
VUE_LINK = "vue_link",
BUTTON = "button",
TEXT = "text",
BLANK = "blank",
}

export enum FbSizeTypes {
Expand Down

0 comments on commit cdbeedb

Please sign in to comment.