Skip to content

Commit 1c85342

Browse files
author
Roman Snapko
authored
Add animation to SkeletonField component (#2184)
<!-- Ensure the title clearly reflects what was changed. Provide a clear and concise description of the changes made. The PR should only contain the changes related to the issue, and no other unrelated changes. --> Fixes OPS-4043
1 parent 4a6492e commit 1c85342

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

packages/ui-components/src/components/skeleton/skeleton-field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const SkeletonField = ({
2222
data-testid="skeleton-field"
2323
className={cn(
2424
'w-full h-full rounded-xl',
25-
'bg-gradient-to-r from-muted to-border',
25+
'animate-shimmer bg-gradient-to-l from-muted via-border to-muted bg-[length:200%_100%]',
2626
className,
2727
)}
2828
/>

packages/ui-components/src/stories/skeleton/skeleton-field.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const meta: Meta<typeof SkeletonField> = {
1616
tags: ['autodocs'],
1717
parameters: {
1818
layout: 'centered',
19+
chromatic: { pauseAnimationAtEnd: true },
1920
},
2021
decorators: [ThemeAwareDecorator],
2122
};

packages/ui-components/tailwind.base.config.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,18 @@ module.exports = {
162162
from: { height: 'var(--radix-collapsible-content-height)' },
163163
to: { height: '0' },
164164
},
165+
shimmer: {
166+
'0%': { backgroundPosition: '200% 0' },
167+
'100%': { backgroundPosition: '-200% 0' },
168+
},
165169
},
166170
animation: {
167171
'accordion-down': 'accordion-down 0.2s ease-out',
168172
'accordion-up': 'accordion-up 0.2s ease-out',
169173
slideDown: 'slideDown 0.2s ease-out',
170174
slideUp: 'slideUp 0.2s ease-out',
171175
fade: 'fade 0.2s ease-out',
176+
shimmer: 'shimmer 3s infinite linear',
172177
},
173178
boxShadow: {
174179
editor: '3px 8px 23px 0px hsla(var(--editor-shadow-color))',

0 commit comments

Comments
 (0)