mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
Align v10.54 (#1133)
* chore(deps-dev): bump carbon-components to v10.54.0 * feat(progress-bar): add size prop * docs(progress-bar): add "Small size" example * docs(progress-bar): add descriptions * refactor(structured-list): remove monkey patch * feat(radio-button-group): add hideLegend prop * docs(radio-button): add "Hidden legend" example
This commit is contained in:
parent
faeee2b1a1
commit
a3d116215d
13 changed files with 90 additions and 20 deletions
|
@ -2904,9 +2904,10 @@ None.
|
||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop name | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||||
| :--------- | :--------------- | :------- | :------------------- | ------------------------------------------------ | --------------------------------------------- |
|
| :--------- | :--------------- | :------- | :---------------------------- | ------------------------------------------------ | --------------------------------------------- |
|
||||||
| value | <code>let</code> | No | <code>number</code> | <code>undefined</code> | Specify the current value |
|
| value | <code>let</code> | No | <code>number</code> | <code>undefined</code> | Specify the current value |
|
||||||
| max | <code>let</code> | No | <code>number</code> | <code>100</code> | Specify the maximum value |
|
| max | <code>let</code> | No | <code>number</code> | <code>100</code> | Specify the maximum value |
|
||||||
|
| size | <code>let</code> | No | <code>"sm" | "md"</code> | <code>"md"</code> | Specify the size |
|
||||||
| labelText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text |
|
| labelText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text |
|
||||||
| hideLabel | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to visually hide the label text |
|
| hideLabel | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to visually hide the label text |
|
||||||
| helperText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the helper text |
|
| helperText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the helper text |
|
||||||
|
@ -3040,6 +3041,7 @@ None.
|
||||||
| selected | <code>let</code> | Yes | <code>string</code> | <code>undefined</code> | Set the selected radio button value |
|
| selected | <code>let</code> | Yes | <code>string</code> | <code>undefined</code> | Set the selected radio button value |
|
||||||
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the radio buttons |
|
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the radio buttons |
|
||||||
| legendText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the legend text |
|
| legendText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the legend text |
|
||||||
|
| hideLegend | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to visually hide the legend |
|
||||||
| labelPosition | <code>let</code> | No | <code>"right" | "left"</code> | <code>"right"</code> | Specify the label position |
|
| labelPosition | <code>let</code> | No | <code>"right" | "left"</code> | <code>"right"</code> | Specify the label position |
|
||||||
| orientation | <code>let</code> | No | <code>"horizontal" | "vertical"</code> | <code>"horizontal"</code> | Specify the orientation of the radio buttons |
|
| orientation | <code>let</code> | No | <code>"horizontal" | "vertical"</code> | <code>"horizontal"</code> | Specify the orientation of the radio buttons |
|
||||||
| id | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Set an id for the container div element |
|
| id | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Set an id for the container div element |
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"@sveltech/routify": "^1.9.9",
|
"@sveltech/routify": "^1.9.9",
|
||||||
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.33",
|
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.33",
|
||||||
"autoprefixer": "^10.2.3",
|
"autoprefixer": "^10.2.3",
|
||||||
"carbon-components": "10.53.0",
|
"carbon-components": "10.54.0",
|
||||||
"carbon-components-10.47": "npm:carbon-components@10.47",
|
"carbon-components-10.47": "npm:carbon-components@10.47",
|
||||||
"carbon-components-svelte": "../",
|
"carbon-components-svelte": "../",
|
||||||
"carbon-icons-svelte": "^10.44.3",
|
"carbon-icons-svelte": "^10.44.3",
|
||||||
|
|
|
@ -8354,6 +8354,17 @@
|
||||||
"constant": false,
|
"constant": false,
|
||||||
"reactive": false
|
"reactive": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "size",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Specify the size",
|
||||||
|
"type": "\"sm\" | \"md\"",
|
||||||
|
"value": "\"md\"",
|
||||||
|
"isFunction": false,
|
||||||
|
"isFunctionDeclaration": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "labelText",
|
"name": "labelText",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
|
@ -8782,6 +8793,17 @@
|
||||||
"constant": false,
|
"constant": false,
|
||||||
"reactive": false
|
"reactive": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "hideLegend",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Set to `true` to visually hide the legend",
|
||||||
|
"type": "boolean",
|
||||||
|
"value": "false",
|
||||||
|
"isFunction": false,
|
||||||
|
"isFunctionDeclaration": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "labelPosition",
|
"name": "labelPosition",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
|
|
|
@ -9,8 +9,16 @@ Without a specified `value` prop, the progress bar is indeterminate.
|
||||||
|
|
||||||
<ProgressBar helperText="Loading..." />
|
<ProgressBar helperText="Loading..." />
|
||||||
|
|
||||||
|
### Small size
|
||||||
|
|
||||||
|
Specify `size="sm"` to use the small variant.
|
||||||
|
|
||||||
|
<ProgressBar size="sm" helperText="Loading..." />
|
||||||
|
|
||||||
### Percentage
|
### Percentage
|
||||||
|
|
||||||
|
Specify a `value` for the progress bar to be determinate.
|
||||||
|
|
||||||
<ProgressBar value={40} labelText="Upload status" helperText="40 MB of 100 MB" />
|
<ProgressBar value={40} labelText="Upload status" helperText="40 MB of 100 MB" />
|
||||||
|
|
||||||
### Custom max value
|
### Custom max value
|
||||||
|
@ -21,6 +29,10 @@ The default `max` value is `100`.
|
||||||
|
|
||||||
### Hidden label
|
### Hidden label
|
||||||
|
|
||||||
|
It's recommended that you provide a `labelText` for accessibility.
|
||||||
|
|
||||||
|
Use `hideLabel` to visually hide the label text.
|
||||||
|
|
||||||
<ProgressBar hideLabel value={40} labelText="Upload status" helperText="40 MB of 100 MB" />
|
<ProgressBar hideLabel value={40} labelText="Upload status" helperText="40 MB of 100 MB" />
|
||||||
|
|
||||||
### UX example
|
### UX example
|
||||||
|
|
|
@ -41,6 +41,18 @@ Use the named "legendText" slot to customize the legend text.
|
||||||
<RadioButton labelText="Pro (128 GB)" value="pro" />
|
<RadioButton labelText="Pro (128 GB)" value="pro" />
|
||||||
</RadioButtonGroup>
|
</RadioButtonGroup>
|
||||||
|
|
||||||
|
### Hidden legend
|
||||||
|
|
||||||
|
It's recommended that you provide a legend for accessibility.
|
||||||
|
|
||||||
|
Use `hideLegend` to visually hide the legend text.
|
||||||
|
|
||||||
|
<RadioButtonGroup hideLegend legendText="Storage tier (disk)" selected="standard">
|
||||||
|
<RadioButton labelText="Free (1 GB)" value="free" />
|
||||||
|
<RadioButton labelText="Standard (10 GB)" value="standard" />
|
||||||
|
<RadioButton labelText="Pro (128 GB)" value="pro" />
|
||||||
|
</RadioButtonGroup>
|
||||||
|
|
||||||
### Reactive example
|
### Reactive example
|
||||||
|
|
||||||
Use the `selected` prop to bind and update the selected value.
|
Use the `selected` prop to bind and update the selected value.
|
||||||
|
|
|
@ -471,10 +471,10 @@ carbon-components-svelte@../:
|
||||||
dependencies:
|
dependencies:
|
||||||
flatpickr "4.6.9"
|
flatpickr "4.6.9"
|
||||||
|
|
||||||
carbon-components@10.53.0:
|
carbon-components@10.54.0:
|
||||||
version "10.53.0"
|
version "10.54.0"
|
||||||
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.53.0.tgz#260d77550a6f33b6cf69e3e61ce0be8089308f48"
|
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.54.0.tgz#f70d0a9fcc7e84f8fb00a45b6b9894d77155acce"
|
||||||
integrity sha512-w1my4Jm//CYeraDM002TT/rMULxDSJ8wG0MCWPHGXFF/9OPHVGWo9idbLppM3lCS/PMfl/gpLvfpUVedFr7Yfw==
|
integrity sha512-gl0b4wRG1E/ns02nG/M0FaNm4FCT91iTr1XFzqY+h1wFsjG1/2OOu7A6lth8Qtk0jsr//YZcB0MNjq8WFaFciw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@carbon/telemetry" "0.0.0-alpha.6"
|
"@carbon/telemetry" "0.0.0-alpha.6"
|
||||||
flatpickr "4.6.1"
|
flatpickr "4.6.1"
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
"@rollup/plugin-node-resolve": "^11.1.1",
|
"@rollup/plugin-node-resolve": "^11.1.1",
|
||||||
"@tsconfig/svelte": "^1.0.10",
|
"@tsconfig/svelte": "^1.0.10",
|
||||||
"autoprefixer": "^10.2.4",
|
"autoprefixer": "^10.2.4",
|
||||||
"carbon-components": "10.53.0",
|
"carbon-components": "10.54.0",
|
||||||
"carbon-components-10.47": "npm:carbon-components@10.47",
|
"carbon-components-10.47": "npm:carbon-components@10.47",
|
||||||
"carbon-icons-svelte": "^10.38.0",
|
"carbon-icons-svelte": "^10.38.0",
|
||||||
"husky": "^4.3.8",
|
"husky": "^4.3.8",
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
/** Specify the maximum value */
|
/** Specify the maximum value */
|
||||||
export let max = 100;
|
export let max = 100;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the size
|
||||||
|
* @type {"sm" | "md"}
|
||||||
|
*/
|
||||||
|
export let size = "md";
|
||||||
|
|
||||||
/** Specify the label text */
|
/** Specify the label text */
|
||||||
export let labelText = "";
|
export let labelText = "";
|
||||||
|
|
||||||
|
@ -29,6 +35,8 @@
|
||||||
<div
|
<div
|
||||||
class:bx--progress-bar="{true}"
|
class:bx--progress-bar="{true}"
|
||||||
class:bx--progress-bar--indeterminate="{indeterminate}"
|
class:bx--progress-bar--indeterminate="{indeterminate}"
|
||||||
|
class:bx--progress-bar--big="{size === 'md'}"
|
||||||
|
class:bx--progress-bar--small="{size === 'sm'}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
|
|
|
@ -11,6 +11,9 @@
|
||||||
/** Specify the legend text */
|
/** Specify the legend text */
|
||||||
export let legendText = "";
|
export let legendText = "";
|
||||||
|
|
||||||
|
/** Set to `true` to visually hide the legend */
|
||||||
|
export let hideLegend = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the label position
|
* Specify the label position
|
||||||
* @type {"right" | "left"}
|
* @type {"right" | "left"}
|
||||||
|
@ -84,7 +87,7 @@
|
||||||
disabled="{disabled}"
|
disabled="{disabled}"
|
||||||
>
|
>
|
||||||
{#if legendText || $$slots.legendText}
|
{#if legendText || $$slots.legendText}
|
||||||
<legend class:bx--label="{true}">
|
<legend class:bx--label="{true}" class:bx--visually-hidden="{hideLegend}">
|
||||||
<slot name="legendText">{legendText}</slot>
|
<slot name="legendText">{legendText}</slot>
|
||||||
</legend>
|
</legend>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
class:bx--structured-list--condensed="{condensed}"
|
class:bx--structured-list--condensed="{condensed}"
|
||||||
class:bx--structured-list--flush="{flush}"
|
class:bx--structured-list--flush="{flush}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
style="overflow-y: visible; {$$restProps.style}"
|
|
||||||
on:click
|
on:click
|
||||||
on:mouseover
|
on:mouseover
|
||||||
on:mouseenter
|
on:mouseenter
|
||||||
|
|
6
types/ProgressBar/ProgressBar.svelte.d.ts
vendored
6
types/ProgressBar/ProgressBar.svelte.d.ts
vendored
|
@ -15,6 +15,12 @@ export interface ProgressBarProps
|
||||||
*/
|
*/
|
||||||
max?: number;
|
max?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the size
|
||||||
|
* @default "md"
|
||||||
|
*/
|
||||||
|
size?: "sm" | "md";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the label text
|
* Specify the label text
|
||||||
* @default ""
|
* @default ""
|
||||||
|
|
|
@ -21,6 +21,12 @@ export interface RadioButtonGroupProps
|
||||||
*/
|
*/
|
||||||
legendText?: string;
|
legendText?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to visually hide the legend
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
hideLegend?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the label position
|
* Specify the label position
|
||||||
* @default "right"
|
* @default "right"
|
||||||
|
|
|
@ -469,10 +469,10 @@ caniuse-lite@^1.0.30001181:
|
||||||
lodash.debounce "^4.0.8"
|
lodash.debounce "^4.0.8"
|
||||||
warning "^3.0.0"
|
warning "^3.0.0"
|
||||||
|
|
||||||
carbon-components@10.53.0:
|
carbon-components@10.54.0:
|
||||||
version "10.53.0"
|
version "10.54.0"
|
||||||
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.53.0.tgz#260d77550a6f33b6cf69e3e61ce0be8089308f48"
|
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.54.0.tgz#f70d0a9fcc7e84f8fb00a45b6b9894d77155acce"
|
||||||
integrity sha512-w1my4Jm//CYeraDM002TT/rMULxDSJ8wG0MCWPHGXFF/9OPHVGWo9idbLppM3lCS/PMfl/gpLvfpUVedFr7Yfw==
|
integrity sha512-gl0b4wRG1E/ns02nG/M0FaNm4FCT91iTr1XFzqY+h1wFsjG1/2OOu7A6lth8Qtk0jsr//YZcB0MNjq8WFaFciw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@carbon/telemetry" "0.0.0-alpha.6"
|
"@carbon/telemetry" "0.0.0-alpha.6"
|
||||||
flatpickr "4.6.1"
|
flatpickr "4.6.1"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue