mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
feat(components): add SkeletonPlaceholder
This commit is contained in:
parent
a56e45058a
commit
f3e5da73db
6 changed files with 61 additions and 0 deletions
|
@ -33,6 +33,7 @@ Currently, the following components are supported:
|
|||
- Link
|
||||
- ListItem
|
||||
- OrderedList
|
||||
- SkeletonPlaceholder
|
||||
- SkeletonText
|
||||
- Tag
|
||||
- TagSkeleton
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<script>
|
||||
import Layout from '../../internal/ui/Layout.svelte';
|
||||
import SkeletonPlaceholder from './SkeletonPlaceholder.svelte';
|
||||
</script>
|
||||
|
||||
<style>
|
||||
:global(.my--skeleton__placeholder--small) {
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
:global(.my--skeleton__placeholder--medium) {
|
||||
height: 150px;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
:global(.my--skeleton__placeholder--large) {
|
||||
height: 250px;
|
||||
width: 250px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<Layout>
|
||||
<div style="height: 250px; width: 250px;">
|
||||
<SkeletonPlaceholder {...$$props} />
|
||||
</div>
|
||||
</Layout>
|
|
@ -0,0 +1,17 @@
|
|||
import { withKnobs, select } from '@storybook/addon-knobs';
|
||||
import Component from './SkeletonPlaceholder.Story.svelte';
|
||||
|
||||
export default { title: 'Skeleton Placeholder', decorators: [withKnobs] };
|
||||
|
||||
const classes = {
|
||||
'my--skeleton__placeholder--small': 'my--skeleton__placeholder--small',
|
||||
'my--skeleton__placeholder--medium': 'my--skeleton__placeholder--medium',
|
||||
'my--skeleton__placeholder--large': 'my--skeleton__placeholder--large'
|
||||
};
|
||||
|
||||
export const Default = () => ({
|
||||
Component,
|
||||
props: {
|
||||
class: select('Classes with different sizes', classes)
|
||||
}
|
||||
});
|
|
@ -0,0 +1,11 @@
|
|||
<script>
|
||||
let className = undefined;
|
||||
export { className as class };
|
||||
export let props = {};
|
||||
|
||||
import { cx } from '../../lib';
|
||||
|
||||
const _class = cx('--skeleton__placeholder', className);
|
||||
</script>
|
||||
|
||||
<div {...props} class={_class} />
|
3
src/components/SkeletonPlaceholder/index.js
Normal file
3
src/components/SkeletonPlaceholder/index.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
import SkeletonPlaceholder from './SkeletonPlaceholder.svelte';
|
||||
|
||||
export default SkeletonPlaceholder;
|
|
@ -10,6 +10,7 @@ import Loading from './components/Loading';
|
|||
import Link from './components/Link';
|
||||
import ListItem from './components/ListItem';
|
||||
import OrderedList from './components/OrderedList';
|
||||
import SkeletonPlaceholder from './components/SkeletonPlaceholder';
|
||||
import SkeletonText from './components/SkeletonText';
|
||||
import Tag, { TagSkeleton } from './components/Tag';
|
||||
import TextArea, { TextAreaSkeleton } from './components/TextArea';
|
||||
|
@ -39,6 +40,7 @@ export {
|
|||
Link,
|
||||
ListItem,
|
||||
OrderedList,
|
||||
SkeletonPlaceholder,
|
||||
SkeletonText,
|
||||
Tag,
|
||||
TagSkeleton,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue