mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
Merge pull request #2 from IBM/skeleton-placeholder
feat(components): add SkeletonPlaceholder
This commit is contained in:
commit
acbb3ace96
6 changed files with 61 additions and 0 deletions
|
@ -34,6 +34,7 @@ Currently, the following components are supported:
|
||||||
- OrderedList
|
- OrderedList
|
||||||
- Search
|
- Search
|
||||||
- SearchSkeleton
|
- SearchSkeleton
|
||||||
|
- SkeletonPlaceholder
|
||||||
- SkeletonText
|
- SkeletonText
|
||||||
- Tag
|
- Tag
|
||||||
- TagSkeleton
|
- 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;
|
|
@ -11,6 +11,7 @@ import Link from './components/Link';
|
||||||
import ListItem from './components/ListItem';
|
import ListItem from './components/ListItem';
|
||||||
import OrderedList from './components/OrderedList';
|
import OrderedList from './components/OrderedList';
|
||||||
import Search, { SearchSkeleton } from './components/Search';
|
import Search, { SearchSkeleton } from './components/Search';
|
||||||
|
import SkeletonPlaceholder from './components/SkeletonPlaceholder';
|
||||||
import SkeletonText from './components/SkeletonText';
|
import SkeletonText from './components/SkeletonText';
|
||||||
import Tag, { TagSkeleton } from './components/Tag';
|
import Tag, { TagSkeleton } from './components/Tag';
|
||||||
import TextArea, { TextAreaSkeleton } from './components/TextArea';
|
import TextArea, { TextAreaSkeleton } from './components/TextArea';
|
||||||
|
@ -42,6 +43,7 @@ export {
|
||||||
OrderedList,
|
OrderedList,
|
||||||
Search,
|
Search,
|
||||||
SearchSkeleton,
|
SearchSkeleton,
|
||||||
|
SkeletonPlaceholder,
|
||||||
SkeletonText,
|
SkeletonText,
|
||||||
Tag,
|
Tag,
|
||||||
TagSkeleton,
|
TagSkeleton,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue