@drinksandco/celler
Advanced tools
Comparing version 1.1.0 to 1.2.0
{ | ||
"name": "@drinksandco/celler", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"private": false, | ||
@@ -26,2 +26,3 @@ "main": "dist/celler.umd.js", | ||
"dependencies": { | ||
"@alfsnd/vue-bootstrap-select": "^0.4.4", | ||
"core-js": "^3.6.5", | ||
@@ -28,0 +29,0 @@ "sass-mq": "^5.0.1", |
@@ -14,2 +14,3 @@ import { render } from '@testing-library/vue' | ||
expect(queryByRole('figure')).toBeInTheDocument() | ||
expect(queryByRole('filling')).not.toBeInTheDocument() | ||
expect(queryByRole('figure')).toContainHTML(ALL_ICONS[icon].paths[0]) | ||
@@ -27,2 +28,3 @@ expect(queryByRole('figure')).toContainHTML(ALL_ICONS[icon].viewBox) | ||
expect(queryByRole('figure')).toBeInTheDocument() | ||
expect(queryByRole('filling')).not.toBeInTheDocument() | ||
expect(queryByRole('figure')).toContainHTML(customPath) | ||
@@ -39,4 +41,20 @@ }) | ||
expect(queryByRole('figure')).toBeInTheDocument() | ||
expect(queryByRole('filling')).not.toBeInTheDocument() | ||
expect(queryByRole('figure')).toContainHTML(customViewBox) | ||
}) | ||
test('renders icon with a custom filling', () => { | ||
const customFillId = 1 | ||
const customProportion = 0.5 | ||
const { queryByRole } = render(DcIcon, { | ||
props: { | ||
fillId: customFillId, | ||
proportion: customProportion, | ||
}, | ||
}) | ||
expect(queryByRole('figure')).toBeInTheDocument() | ||
expect(queryByRole('filling')).toBeInTheDocument() | ||
}) | ||
}) |
import { storiesOf } from '@storybook/vue' | ||
import { withKnobs, select } from '@storybook/addon-knobs' | ||
import { withKnobs, select, number } from '@storybook/addon-knobs' | ||
@@ -15,4 +15,6 @@ import DcIcon from './DcIcon' | ||
const customColor = select('Color', ALL_COLORS, 'drinksco-blue') | ||
const customIcon = select('Icon', ALL_ICONS, 'search') | ||
const customFillColor = select('FillColor', ALL_COLORS, 'secondary-2') | ||
const customIcon = select('Icon', ALL_ICONS, 'star') | ||
const customSizes = select('Size', ALL_SIZES, 'md') | ||
const customProportion = number('Proportion (between 0 and 1)', 0) | ||
@@ -24,2 +26,5 @@ return { | ||
}, | ||
customFillColor: { | ||
default: customFillColor, | ||
}, | ||
customIcon: { | ||
@@ -31,2 +36,5 @@ default: customIcon, | ||
}, | ||
customProportion: { | ||
default: customProportion, | ||
}, | ||
}, | ||
@@ -37,8 +45,14 @@ | ||
template: ` | ||
<dc-icon | ||
:color="customColor" | ||
:icon="customIcon" | ||
:size="customSizes" | ||
/>`, | ||
<div> | ||
<dc-icon | ||
:color="customColor" | ||
:fill-color="customFillColor" | ||
:icon="customIcon" | ||
:size="customSizes" | ||
:proportion="customProportion" | ||
fill-id=0 | ||
/> | ||
</div> | ||
`, | ||
} | ||
}) |
@@ -24,7 +24,7 @@ import { render } from '@testing-library/vue' | ||
const icons = queryAllByRole('figure') | ||
const coloredIcons = icons.filter(icon => | ||
icon.classList.contains('dc-icon--color-dark-blue') | ||
) | ||
const coloredIcons = icons.filter((icon) => { | ||
return icon.__vue__['$options'].propsData.proportion > 0 | ||
}) | ||
expect(coloredIcons).toHaveLength(3) | ||
expect(coloredIcons).toHaveLength(4) | ||
}) | ||
@@ -40,3 +40,3 @@ | ||
const icons = queryAllByRole('figure') | ||
const coloredIcons = icons.filter(icon => | ||
const coloredIcons = icons.filter((icon) => | ||
icon.classList.contains('dc-icon--color-dark-blue') | ||
@@ -43,0 +43,0 @@ ) |
@@ -13,2 +13,3 @@ import DcButton from './components/atoms/DcButton' | ||
import DcNavbar from './components/molecules/DcNavbar' | ||
import DcOrderSummary from './components/molecules/DcOrderSummary' | ||
import DcSearchInput from './components/molecules/DcSearchInput' | ||
@@ -36,2 +37,3 @@ import DcSidebarMenu from './components/molecules/DcSidebarMenu' | ||
DcNavbar, | ||
DcOrderSummary, | ||
DcSearchInput, | ||
@@ -38,0 +40,0 @@ DcSidebarMenu, |
@@ -17,2 +17,16 @@ export const icons = { | ||
}, | ||
'minus-icon': { | ||
viewBox: '0 0 140 140', | ||
paths: [ | ||
'M70,0C31.34,0,0,31.34,0,70s31.34,70,70,70s70-31.34,70-70C139.96,31.36,108.64,0.04,70,0z M70,130c-33.14,0-60-26.86-60-60 s26.86-60,60-60s60,26.86,60,60C129.96,103.12,103.12,129.96,70,130z', | ||
'M101.82,65H38.18c-2.76,0-5,2.24-5,5s2.24,5,5,5h63.64c2.76,0,5-2.24,5-5S104.58,65,101.82,65z', | ||
], | ||
}, | ||
'plus-icon': { | ||
viewBox: '0 0 120 120', | ||
paths: [ | ||
'M102.43,17.58C79-5.86,41.01-5.86,17.58,17.57s-23.44,61.42-0.01,84.85s61.42,23.44,84.85,0.01 C113.68,91.18,120,75.92,120,60.01C120.04,44.09,113.72,28.81,102.43,17.58z M95.36,95.37c-19.52,19.53-51.18,19.53-70.71,0.01 S5.12,44.19,24.64,24.67s51.18-19.53,70.71-0.01C104.73,34.03,110,46.75,110,60.01C110.04,73.28,104.76,86.01,95.36,95.37 L95.36,95.37z', | ||
'M93,54.01H66v-27c0-2.76-2.24-5-5-5s-5,2.24-5,5v27H29c-2.76,0-5,2.24-5,5s2.24,5,5,5h27v27c0,2.76,2.24,5,5,5s5-2.24,5-5 v-27h27c2.76,0,5-2.24,5-5S95.76,54.01,93,54.01z', | ||
], | ||
}, | ||
profile: { | ||
@@ -19,0 +33,0 @@ viewBox: '0 0 24 24', |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
139
1825187
5
15078
+ Added@alfsnd/vue-bootstrap-select@0.4.4(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedvue-clickaway@2.2.2(transitive)