mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
Align v10.37 (#697)
* chore(deps-dev): upgrade carbon-components to v10.27.1 * fix(toolbar-search): omit size prop * feat(progress-bar): add ProgressBar * refactor(text-input): use class directive * chore(deps-dev): rebuild yarn.lock * fix(notification): omit iconDescription from NotificationIcon #672 Fixes #672
This commit is contained in:
parent
2f5d01d0c0
commit
fb5c7553ac
19 changed files with 294 additions and 22 deletions
|
@ -11,7 +11,7 @@
|
|||
"devDependencies": {
|
||||
"@sveltech/routify": "^1.9.9",
|
||||
"autoprefixer": "^10.2.3",
|
||||
"carbon-components": "10.36.0",
|
||||
"carbon-components": "10.37.0",
|
||||
"carbon-components-svelte": "../",
|
||||
"mdsvex": "^0.8.8",
|
||||
"npm-run-all": "^4.1.5",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"total": 167,
|
||||
"total": 168,
|
||||
"components": [
|
||||
{
|
||||
"moduleName": "Accordion",
|
||||
|
@ -7302,6 +7302,72 @@
|
|||
"typedefs": [],
|
||||
"rest_props": { "type": "Element", "name": "div" }
|
||||
},
|
||||
{
|
||||
"moduleName": "ProgressBar",
|
||||
"filePath": "src/ProgressBar/ProgressBar.svelte",
|
||||
"props": [
|
||||
{
|
||||
"name": "value",
|
||||
"kind": "let",
|
||||
"description": "Specify the current value",
|
||||
"type": "number",
|
||||
"isFunction": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "max",
|
||||
"kind": "let",
|
||||
"description": "Specify the maximum value",
|
||||
"type": "number",
|
||||
"value": "100",
|
||||
"isFunction": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "labelText",
|
||||
"kind": "let",
|
||||
"description": "Specify the label text",
|
||||
"type": "string",
|
||||
"value": "\"\"",
|
||||
"isFunction": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "hideLabel",
|
||||
"kind": "let",
|
||||
"description": "Set to `true` to visually hide the label text",
|
||||
"type": "boolean",
|
||||
"value": "false",
|
||||
"isFunction": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "helperText",
|
||||
"kind": "let",
|
||||
"description": "Specify the helper text",
|
||||
"type": "string",
|
||||
"value": "\"\"",
|
||||
"isFunction": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
}
|
||||
],
|
||||
"slots": [
|
||||
{
|
||||
"name": "labelText",
|
||||
"default": false,
|
||||
"fallback": "{labelText}",
|
||||
"slot_props": "{}"
|
||||
}
|
||||
],
|
||||
"events": [],
|
||||
"typedefs": [],
|
||||
"rest_props": { "type": "Element", "name": "div" }
|
||||
},
|
||||
{
|
||||
"moduleName": "ProgressIndicator",
|
||||
"filePath": "src/ProgressIndicator/ProgressIndicator.svelte",
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
import Footer from "../components/Footer.svelte";
|
||||
|
||||
const deprecated = ["ToggleSmall", "Icon"];
|
||||
const new_components = ["Popover", "ContextMenu"];
|
||||
const new_components = ["ProgressBar"];
|
||||
|
||||
let isOpen = false;
|
||||
let isSideNavOpen = true;
|
||||
|
|
24
docs/src/pages/components/ProgressBar.svx
Normal file
24
docs/src/pages/components/ProgressBar.svx
Normal file
|
@ -0,0 +1,24 @@
|
|||
<script>
|
||||
import { ProgressBar } from "carbon-components-svelte";
|
||||
import Preview from "../../components/Preview.svelte";
|
||||
</script>
|
||||
|
||||
### Default
|
||||
|
||||
Without a specified `value` prop, the progress bar is indeterminate.
|
||||
|
||||
<ProgressBar helperText="Loading..." />
|
||||
|
||||
### Percentage
|
||||
|
||||
<ProgressBar value={40} labelText="Upload status" helperText="40 MB of 100 MB" />
|
||||
|
||||
### Custom max value
|
||||
|
||||
The default `max` value is `100`.
|
||||
|
||||
<ProgressBar value={40} max={200} labelText="Upload status" helperText="40 MB of 200 MB" />
|
||||
|
||||
### Hidden label
|
||||
|
||||
<ProgressBar hideLabel value={40} labelText="Upload status" helperText="40 MB of 100 MB" />
|
36
docs/src/pages/framed/ProgressBar/ProgressBarUx.svelte
Normal file
36
docs/src/pages/framed/ProgressBar/ProgressBarUx.svelte
Normal file
|
@ -0,0 +1,36 @@
|
|||
<script>
|
||||
import { onMount } from "svelte";
|
||||
import { ProgressBar } from "carbon-components-svelte";
|
||||
|
||||
let max = 328;
|
||||
let value = 0;
|
||||
let timer = undefined;
|
||||
|
||||
onMount(() => {
|
||||
timer = setTimeout(() => {
|
||||
const interval = setInterval(() => {
|
||||
const delta = Math.random() * 10;
|
||||
|
||||
if (value + delta < max) {
|
||||
value += delta;
|
||||
} else {
|
||||
value = max;
|
||||
clearInterval(interval);
|
||||
}
|
||||
}, 20);
|
||||
}, 2000);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
});
|
||||
|
||||
$: helperText =
|
||||
value > 0 ? `${value.toFixed(0)}MB of ${max}MB` : "Preparing upload...";
|
||||
$: if (value === max) helperText = "Done";
|
||||
</script>
|
||||
|
||||
<ProgressBar
|
||||
labelText="Upload status"
|
||||
value="{value}"
|
||||
max="{max}"
|
||||
helperText="{helperText}"
|
||||
/>
|
|
@ -837,16 +837,16 @@ caniuse-lite@^1.0.30001173, caniuse-lite@^1.0.30001178:
|
|||
integrity sha512-n8JVqXuZMVSPKiPiypjFtDTXc4jWIdjxull0f92WLo7e1MSi3uJ3NvveakSh/aCl1QKFAvIz3vIj0v+0K+FrXw==
|
||||
|
||||
carbon-components-svelte@../:
|
||||
version "0.35.0"
|
||||
version "0.36.0"
|
||||
dependencies:
|
||||
carbon-icons-svelte "^10.27.0"
|
||||
clipboard-copy "3.2.0"
|
||||
flatpickr "4.6.9"
|
||||
|
||||
carbon-components@10.36.0:
|
||||
version "10.36.0"
|
||||
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.36.0.tgz#ce523b19df3a404e379113dafbbe0219bb22b17f"
|
||||
integrity sha512-k+UR+Whz/qXbev2RT9JjV+QbkSKcHrLNF25bEpr3KZHmpCGhwGz5mVyv0ohZ4B6rKkpuvlgYfLsANL0yQX77zA==
|
||||
carbon-components@10.37.0:
|
||||
version "10.37.0"
|
||||
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.37.0.tgz#bc53138151ea58e79f5b249b1ec5be8ae2c0a7e4"
|
||||
integrity sha512-LHReeqzzieP/q/xAHfKJNWLdWhOkr7+DIVZkrQGPf6kZYj5H8tb1KYKOIhasvCNRxJ2es8QJXuH7XW0JoLDfdQ==
|
||||
dependencies:
|
||||
"@carbon/telemetry" "0.0.0-alpha.6"
|
||||
flatpickr "4.6.1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue