mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(button-skeleton): add size prop consistent with Button
This commit is contained in:
parent
6d12d7e6e2
commit
6d48ff38cb
5 changed files with 33 additions and 9 deletions
|
@ -462,10 +462,11 @@ import { ButtonSkeleton } from "carbon-components-svelte";
|
||||||
|
|
||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop name | Type | Default value |
|
| Prop name | Type | Default value |
|
||||||
| :-------- | :------------------- | :------------ |
|
| :-------- | :--------------------------------------------------- | :------------ |
|
||||||
| href | <code>string</code> | -- |
|
| href | <code>string</code> | -- |
|
||||||
| small | <code>boolean</code> | false |
|
| size | <code>"default" | "field" | "small"</code> | "default" |
|
||||||
|
| small | <code>boolean</code> | false |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
@ -3219,6 +3220,7 @@ import { ProgressIndicatorSkeleton } from "carbon-components-svelte";
|
||||||
| Prop name | Type | Default value |
|
| Prop name | Type | Default value |
|
||||||
| :-------- | :------------------- | :------------ |
|
| :-------- | :------------------- | :------------ |
|
||||||
| vertical | <code>boolean</code> | false |
|
| vertical | <code>boolean</code> | false |
|
||||||
|
| count | <code>number</code> | 4 |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
|
|
@ -68,4 +68,6 @@ description: High-level description
|
||||||
|
|
||||||
### Skeleton
|
### Skeleton
|
||||||
|
|
||||||
<Button skeleton />
|
<Button skeleton />
|
||||||
|
<Button skeleton size="field" />
|
||||||
|
<Button skeleton size="small" />
|
|
@ -5,6 +5,12 @@
|
||||||
*/
|
*/
|
||||||
export let href = undefined;
|
export let href = undefined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the size of button skeleton
|
||||||
|
* @type {"default" | "field" | "small"} [size="default"]
|
||||||
|
*/
|
||||||
|
export let size = "default";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to use the small variant
|
* Set to `true` to use the small variant
|
||||||
* @type {boolean} [small=false]
|
* @type {boolean} [small=false]
|
||||||
|
@ -19,7 +25,8 @@
|
||||||
role="button"
|
role="button"
|
||||||
class:bx--skeleton="{true}"
|
class:bx--skeleton="{true}"
|
||||||
class:bx--btn="{true}"
|
class:bx--btn="{true}"
|
||||||
class:bx--btn--sm="{small}"
|
class:bx--btn--field="{size === 'field'}"
|
||||||
|
class:bx--btn--sm="{size === 'small' || small}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click
|
on:click
|
||||||
on:mouseover
|
on:mouseover
|
||||||
|
@ -32,7 +39,8 @@
|
||||||
<div
|
<div
|
||||||
class:bx--skeleton="{true}"
|
class:bx--skeleton="{true}"
|
||||||
class:bx--btn="{true}"
|
class:bx--btn="{true}"
|
||||||
class:bx--btn--sm="{small}"
|
class:bx--btn--field="{size === 'field'}"
|
||||||
|
class:bx--btn--sm="{size === 'small' || small}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click
|
on:click
|
||||||
on:mouseover
|
on:mouseover
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
{#if skeleton}
|
{#if skeleton}
|
||||||
<ButtonSkeleton
|
<ButtonSkeleton
|
||||||
href="{href}"
|
href="{href}"
|
||||||
small="{size === 'small'}"
|
size="{size}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
style="{hasIconOnly && 'width: 3rem;'}"
|
style="{hasIconOnly && 'width: 3rem;'}"
|
||||||
on:click
|
on:click
|
||||||
|
|
14
types/index.d.ts
vendored
14
types/index.d.ts
vendored
|
@ -227,7 +227,13 @@ export class ButtonSkeleton extends CarbonSvelteComponent {
|
||||||
href?: string;
|
href?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to use the small variant
|
* Specify the size of button skeleton
|
||||||
|
* @default "default"
|
||||||
|
*/
|
||||||
|
size?: "default" | "field" | "small";
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
small?: boolean;
|
small?: boolean;
|
||||||
|
@ -3144,6 +3150,12 @@ export class ProgressIndicatorSkeleton extends CarbonSvelteComponent {
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
vertical?: boolean;
|
vertical?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the number of steps to render
|
||||||
|
* @default 4
|
||||||
|
*/
|
||||||
|
count?: number;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue