@vtmn/svelte
Advanced tools
Comparing version 1.1.0 to 2.0.0
{ | ||
"name": "@vtmn/svelte", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Decathlon Design System - Vitamin Svelte components library", | ||
@@ -132,3 +132,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "c71998ff2355e86131948c54a8bfbbe7f9e2cfb0" | ||
"gitHead": "77e734a3dea971f316243f6adade1f6eb94401a4" | ||
} |
@@ -9,12 +9,2 @@ /** | ||
export const VTMN_SKELETON_UNIT = { | ||
EM: 'em', | ||
REM: 'rem', | ||
VW: 'vw', | ||
CH: 'ch', | ||
PERCENT: '%', | ||
PX: 'px', | ||
}; | ||
export const VTMN_SKELETON_DEFAULT_WIDTH = 100; | ||
export const VTMN_SKELETON_DEFAULT_UNIT = VTMN_SKELETON_UNIT.PERCENT; | ||
export const VTMN_SKELETON_DEFAULT_WIDTH = '100%'; |
@@ -26,4 +26,4 @@ import '@testing-library/jest-dom'; | ||
test("Should have a width 100% if width = '100'", () => { | ||
const { container } = render(VtmnSkeleton, { width: '100' }); | ||
test("Should have a width 100% if width = '100%'", () => { | ||
const { container } = render(VtmnSkeleton, { width: '100%' }); | ||
expect(getSkeleton(container)).toHaveClass('skeleton-width'); | ||
@@ -49,15 +49,5 @@ expect(getSkeleton(container)).toHaveStyle('--skeleton-width:100%'); | ||
test('Should change the unit', () => { | ||
const { container } = render(VtmnSkeleton, { unit: 'px' }); | ||
const { container } = render(VtmnSkeleton, { width: '100px' }); | ||
expect(getSkeleton(container)).toHaveStyle('--skeleton-width:100px'); | ||
}); | ||
test('Should set the unit as % if unit not found', () => { | ||
const { container } = render(VtmnSkeleton, { unit: 'foo', width: 50 }); | ||
expect(getSkeleton(container)).toHaveStyle('--skeleton-width:100%'); | ||
}); | ||
test('Should set the width as 0 if width are negative', () => { | ||
const { container } = render(VtmnSkeleton, { width: -1, unit: 'px' }); | ||
expect(getSkeleton(container)).toHaveStyle('--skeleton-width:100%'); | ||
}); | ||
}); |
@@ -8,3 +8,4 @@ /** | ||
Object.entries(obj) | ||
.filter(([, value]) => value != undefined) | ||
.map(([key, value]) => `${key}:${value}`) | ||
.join(';'); |
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 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
1494972
32231