Skip to content

Commit

Permalink
feat: APPS-2956 flexible-divider-way finder (#621)
Browse files Browse the repository at this point in the history
* feat: start flexibile divider way finder

* feat: finish horizontal divider

* chore: lint

* fix: errors with empty story (?)

* fix: broken spec, restore story

* fix: story url

---------

Co-authored-by: Jess Divers <[email protected]>
  • Loading branch information
farosFreed and Jess Divers authored Sep 27, 2024
1 parent 03c8948 commit 125cfe7
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib-components/DividerWayFinder.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup>
<script lang="ts" setup>
// Helpers
import { computed, onMounted, ref, watchEffect } from 'vue'
import { useRoute } from 'vue-router'
Expand Down
19 changes: 19 additions & 0 deletions src/lib-components/Flexible/HorizontalDivider.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script setup lang="ts">
import type { PropType } from 'vue'
import { defineProps } from 'vue'
import type { FlexibleHorizontalDividerBlock } from '@/types/flexible_types'
// COMPONENTS
import DividerWayFinder from '@/lib-components/DividerWayFinder.vue'
const { block } = defineProps({
block: {
type: Object as PropType<FlexibleHorizontalDividerBlock>,
default: () => { },
},
})
</script>

<template>
<DividerWayFinder v-if="block.horizontalDivider" />
</template>
1 change: 1 addition & 0 deletions src/lib-components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export { default as FlexibleCardWithImage } from './Flexible/CardWithImage.vue'
export { default as FlexibleForm } from './Flexible/Form.vue'
export { default as FlexibleGridGalleryCards } from './Flexible/GridGalleryCards.vue'
export { default as FlexibleHighlight } from './Flexible/Highlight.vue'
export { default as FlexibleHorizontalDivider } from './Flexible/HorizontalDivider.vue'
export { default as FlexibleImpactNumberCards } from './Flexible/ImpactNumberCards.vue'
export { default as FlexibleImpactNumbersCarousel } from './Flexible/ImpactNumbersCarousel.vue'
export { default as FlexibleMediaGallery } from './Flexible/MediaGallery.vue'
Expand Down
10 changes: 10 additions & 0 deletions src/stories/Flexible_HorizontalDivider.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe('FLEXIBLE / Horizontal Divider', () => {
it('Default', () => {
cy.visit(
'/iframe.html?id=flexible-horizontal-divider--default&args=&viewMode=story'
)
cy.get('.divider-way-finder').should('exist')

cy.percySnapshot('FLEXIBLE / HorizontalDivider: Default')
})
})
38 changes: 38 additions & 0 deletions src/stories/Flexible_HorizontalDivider.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import FlexibleHorizontalDivider from '@/lib-components/Flexible/HorizontalDivider.vue'

export default {
title: 'FLEXIBLE / Horizontal Divider',
component: FlexibleHorizontalDivider,
}

const mockHorizontalDivider = {
id: '1234556',
typeHandle: 'horizontalDivider',
horizontalDivider: true
}

// Default
export function Default() {
return {
data() {
return {
block: mockHorizontalDivider,
}
},
components: { FlexibleHorizontalDivider },
template: '<flexible-horizontal-divider :block="block" />',
}
}

// Hidden Divider
export function Hidden() {
return {
data() {
return {
block: { ...mockHorizontalDivider, horizontalDivider: false },
}
},
components: { FlexibleHorizontalDivider },
template: '<flexible-horizontal-divider :block="block" />',
}
}
6 changes: 6 additions & 0 deletions src/types/flexible_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ interface FlexibleHighlight {
to: string
}

export interface FlexibleHorizontalDividerBlock {
id: string
typeHandle: string
horizontalDivider: boolean
}

interface FlexibleImpactNumberCard {
id: string
title: string
Expand Down

1 comment on commit 125cfe7

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.