let
| Yes | boolean
| false
| Set to `true` for the icon-only variant |
| kind | let
| No | "primary" | "secondary" | "tertiary" | "ghost" | "danger" | "danger-tertiary" | "danger-ghost"
| "primary"
| Specify the kind of button |
| size | let
| No | "default" | "field" | "small"
| "default"
| Specify the size of button |
+| isSelected | let
| No | boolean
| false
| Set to `true` to enable the selected state for an icon-only, ghost button |
| icon | let
| No | typeof import("carbon-icons-svelte").CarbonIcon
| -- | Specify the icon from `carbon-icons-svelte` to render |
| iconDescription | let
| No | string
| -- | Specify the ARIA label for the button icon |
| tooltipAlignment | let
| No | "start" | "center" | "end"
| "center"
| Set the alignment of the tooltip relative to the iconlet
| Yes | boolean
| false
| Set to `true` if an error occurs when loading the image |
+| loaded | let
| Yes | boolean
| false
| Set to `true` when the image is loaded |
+| loading | let
| Yes | boolean
| false
| Set to `true` when `loaded` is `true` and `error` is false |
+| src | let
| No | string
| ""
| Specify the image source |
+| alt | let
| No | string
| ""
| Specify the image alt text |
+| ratio | let
| No | "2x1" | "16x9" | "4x3" | "1x1" | "3x4" | "9x16" | "1x2"
| -- | Specify the aspect ratio for the image wrapper |
+| fadeIn | let
| No | boolean
| false
| Set to `true` to fade in the image on loadconst
| No | (url?: string) => void
| (url) => { if (image != null) image = null; loaded = false; error = false; image = new Image(); image.src = url || src; image.onload = () => (loaded = true); image.onerror = () => (error = true); }
| Method invoked to load the image provided a `src` value |
+
+### Slots
+
+| Slot name | Default | Props | Fallback |
+| :-------- | :------ | :---- | :------- |
+| error | No | -- | -- |
+| loading | No | -- | -- |
+
+### Events
+
+| Event name | Type | Detail |
+| :--------- | :--------- | :--------------- |
+| load | dispatched | any
|
+| error | dispatched | any
|
+
## `InlineLoading`
### Props
@@ -1957,7 +1989,7 @@ export type ListBoxSelectionTranslationId = "clearAll" | "clearSelection";
| Prop name | Kind | Reactive | Type | Default value | Description |
| :-------------- | :----------------- | :------- | :----------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------ |
| ref | let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the top-level HTML element |
-| selectionCount | let
| No | any
| -- | Specify the number of selected items |
+| selectionCount | let
| No | number
| -- | Specify the number of selected items |
| disabled | let
| No | boolean
| false
| Set to `true` to disable the list box selection |
| translationIds | const
| No | { clearAll: "clearAll", clearSelection: "clearSelection", }
| { clearAll: "clearAll", clearSelection: "clearSelection", }
| Default translation ids |
| translateWithId | let
| No | (id: ListBoxSelectionTranslationId) => string
| (id) => defaultTranslations[id]
| Override the default translation ids |
@@ -2013,6 +2045,26 @@ None.
None.
+## `LocalStorage`
+
+### Props
+
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :-------- | :--------------- | :------- | :------------------ | -------------------------------- | ----------------------------- |
+| value | let
| Yes | any
| ""
| Provide a value to persist |
+| key | let
| No | string
| "local-storage-key"
| Specify the local storage key |
+
+### Slots
+
+None.
+
+### Events
+
+| Event name | Type | Detail |
+| :--------- | :--------- | :------------------------------------------- |
+| save | dispatched | any
|
+| update | dispatched | { prevValue: any; value: any; }
|
+
## `Modal`
### Props
@@ -2183,13 +2235,13 @@ None.
### Events
-| Event name | Type | Detail |
-| :--------- | :--------- | :----- |
-| clear | forwarded | -- |
-| keydown | forwarded | -- |
-| focus | forwarded | -- |
-| blur | forwarded | -- |
-| select | dispatched | -- |
+| Event name | Type | Detail |
+| :--------- | :--------- | :-------------------------------------------------------------------------------------------------- |
+| select | dispatched | { selectedIds: string[]; selected: MultiSelectItem[]; unselected: MultiSelectItem[]; }
|
+| clear | forwarded | -- |
+| keydown | forwarded | -- |
+| focus | forwarded | -- |
+| blur | forwarded | -- |
## `NotificationActionButton`
@@ -2694,15 +2746,17 @@ None.
| :------------ | :--------------- | :------- | :------------------------------------------ | ------------------------- | -------------------------------------------- |
| selected | let
| Yes | string
| -- | Set the selected radio button value |
| disabled | let
| No | boolean
| false
| Set to `true` to disable the radio buttons |
+| legendText | let
| No | string
| ""
| Specify the legend text |
| labelPosition | let
| No | "right" | "left"
| "right"
| Specify the label position |
| orientation | let
| No | "horizontal" | "vertical"
| "horizontal"
| Specify the orientation of the radio buttons |
| id | let
| No | string
| -- | Set an id for the container div element |
### Slots
-| Slot name | Default | Props | Fallback |
-| :-------- | :------ | :---- | :------- |
-| -- | Yes | -- | -- |
+| Slot name | Default | Props | Fallback |
+| :--------- | :------ | :---- | :------------------------ |
+| -- | Yes | -- | -- |
+| legendText | No | -- | {legendText}
|
### Events
@@ -3083,7 +3137,9 @@ None.
### Slots
-None.
+| Slot name | Default | Props | Fallback |
+| :-------- | :------ | :---- | :------------------ |
+| -- | Yes | -- | {text}
|
### Events
@@ -3647,16 +3703,17 @@ None.
### Props
-| Prop name | Kind | Reactive | Type | Default value | Description |
-| :-------- | :--------------- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------ |
-| type | let
| No | "red" | "magenta" | "purple" | "blue" | "cyan" | "teal" | "green" | "gray" | "cool-gray" | "warm-gray" | "high-contrast"
| -- | Specify the type of tag |
-| size | let
| No | "sm" | "default"
| "default"
| -- |
-| filter | let
| No | boolean
| false
| Set to `true` to use filterable variant |
-| disabled | let
| No | boolean
| false
| Set to `true` to disable a filterable tag |
-| skeleton | let
| No | boolean
| false
| Set to `true` to display the skeleton state |
-| title | let
| No | string
| "Clear filter"
| Set the title for the close button in a filterable tag |
-| icon | let
| No | typeof import("carbon-icons-svelte").CarbonIcon
| -- | Specify the icon from `carbon-icons-svelte` to render |
-| id | let
| No | string
| "ccs-" + Math.random().toString(36)
| Set an id for the filterable tag |
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :---------- | :--------------- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------- |
+| type | let
| No | "red" | "magenta" | "purple" | "blue" | "cyan" | "teal" | "green" | "gray" | "cool-gray" | "warm-gray" | "high-contrast"
| -- | Specify the type of tag |
+| size | let
| No | "sm" | "default"
| "default"
| -- |
+| filter | let
| No | boolean
| false
| Set to `true` to use filterable variant |
+| disabled | let
| No | boolean
| false
| Set to `true` to disable a filterable tag |
+| interactive | let
| No | boolean
| false
| Set to `true` to render a `button` element instead of a `div` |
+| skeleton | let
| No | boolean
| false
| Set to `true` to display the skeleton state |
+| title | let
| No | string
| "Clear filter"
| Set the title for the close button in a filterable tag |
+| icon | let
| No | typeof import("carbon-icons-svelte").CarbonIcon
| -- | Specify the icon from `carbon-icons-svelte` to render |
+| id | let
| No | string
| "ccs-" + Math.random().toString(36)
| Set an id for the filterable tag |
### Slots
@@ -4183,6 +4240,7 @@ None.
| Event name | Type | Detail |
| :--------- | :-------- | :----- |
+| clear | forwarded | -- |
| change | forwarded | -- |
| input | forwarded | -- |
| focus | forwarded | -- |
diff --git a/docs/package.json b/docs/package.json
index fd6c270e..f4d109ec 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -11,7 +11,7 @@
"devDependencies": {
"@sveltech/routify": "^1.9.9",
"autoprefixer": "^10.2.3",
- "carbon-components": "10.29.0",
+ "carbon-components": "10.30.0",
"carbon-components-svelte": "../",
"clipboard-copy": "^3.1.0",
"mdsvex": "^0.8.8",
diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json
index 34654213..aee2c87c 100644
--- a/docs/src/COMPONENT_API.json
+++ b/docs/src/COMPONENT_API.json
@@ -1,5 +1,5 @@
{
- "total": 158,
+ "total": 160,
"components": [
{
"moduleName": "Accordion",
@@ -368,6 +368,16 @@
"constant": false,
"reactive": false
},
+ {
+ "name": "isSelected",
+ "kind": "let",
+ "description": "Set to `true` to enable the selected state for an icon-only, ghost button",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
{
"name": "hasIconOnly",
"kind": "let",
@@ -1387,7 +1397,7 @@
"ts": "interface ComboBoxItem { id: string; text: string; }"
}
],
- "rest_props": { "type": "Element", "name": "div" }
+ "rest_props": { "type": "Element", "name": "input" }
},
{
"moduleName": "ComposedModal",
@@ -2239,7 +2249,7 @@
{ "type": "forwarded", "name": "blur", "element": "input" }
],
"typedefs": [],
- "rest_props": { "type": "Element", "name": "div" }
+ "rest_props": { "type": "Element", "name": "input" }
},
{
"moduleName": "DatePickerSkeleton",
@@ -4042,6 +4052,101 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
},
+ {
+ "moduleName": "ImageLoader",
+ "filePath": "src/ImageLoader/ImageLoader.svelte",
+ "props": [
+ {
+ "name": "src",
+ "kind": "let",
+ "description": "Specify the image source",
+ "type": "string",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "alt",
+ "kind": "let",
+ "description": "Specify the image alt text",
+ "type": "string",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "ratio",
+ "kind": "let",
+ "description": "Specify the aspect ratio for the image wrapper",
+ "type": "\"2x1\" | \"16x9\" | \"4x3\" | \"1x1\" | \"3x4\" | \"9x16\" | \"1x2\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "loading",
+ "kind": "let",
+ "description": "Set to `true` when `loaded` is `true` and `error` is false",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "loaded",
+ "kind": "let",
+ "description": "Set to `true` when the image is loaded",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "error",
+ "kind": "let",
+ "description": "Set to `true` if an error occurs when loading the image",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "fadeIn",
+ "kind": "let",
+ "description": "Set to `true` to fade in the image on load\nThe duration uses the `fast-02` value following Carbon guidelines on motion",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "loadImage",
+ "kind": "const",
+ "description": "Method invoked to load the image provided a `src` value",
+ "type": "(url?: string) => void",
+ "value": "(url) => { if (image != null) image = null; loaded = false; error = false; image = new Image(); image.src = url || src; image.onload = () => (loaded = true); image.onerror = () => (error = true); }",
+ "isFunction": true,
+ "constant": true,
+ "reactive": false
+ }
+ ],
+ "slots": [
+ { "name": "error", "default": false, "slot_props": "{}" },
+ { "name": "loading", "default": false, "slot_props": "{}" }
+ ],
+ "events": [
+ { "type": "dispatched", "name": "load", "detail": "any" },
+ { "type": "dispatched", "name": "error", "detail": "any" }
+ ],
+ "typedefs": [],
+ "rest_props": { "type": "Element", "name": "img" }
+ },
{
"moduleName": "InlineLoading",
"filePath": "src/InlineLoading/InlineLoading.svelte",
@@ -4585,7 +4690,7 @@
"name": "selectionCount",
"kind": "let",
"description": "Specify the number of selected items",
- "type": "any",
+ "type": "number",
"isFunction": false,
"constant": false,
"reactive": false
@@ -4716,6 +4821,42 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
},
+ {
+ "moduleName": "LocalStorage",
+ "filePath": "src/LocalStorage/LocalStorage.svelte",
+ "props": [
+ {
+ "name": "key",
+ "kind": "let",
+ "description": "Specify the local storage key",
+ "type": "string",
+ "value": "\"local-storage-key\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
+ {
+ "name": "value",
+ "kind": "let",
+ "description": "Provide a value to persist",
+ "type": "any",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ }
+ ],
+ "slots": [],
+ "events": [
+ { "type": "dispatched", "name": "save", "detail": "any" },
+ {
+ "type": "dispatched",
+ "name": "update",
+ "detail": "{ prevValue: any; value: any; }"
+ }
+ ],
+ "typedefs": []
+ },
{
"moduleName": "Modal",
"filePath": "src/Modal/Modal.svelte",
@@ -5393,11 +5534,15 @@
],
"slots": [],
"events": [
+ {
+ "type": "dispatched",
+ "name": "select",
+ "detail": "{ selectedIds: string[]; selected: MultiSelectItem[]; unselected: MultiSelectItem[]; }"
+ },
{ "type": "forwarded", "name": "clear", "element": "ListBoxSelection" },
{ "type": "forwarded", "name": "keydown", "element": "input" },
{ "type": "forwarded", "name": "focus", "element": "input" },
- { "type": "forwarded", "name": "blur", "element": "input" },
- { "type": "dispatched", "name": "select" }
+ { "type": "forwarded", "name": "blur", "element": "input" }
],
"typedefs": [
{
@@ -5416,7 +5561,7 @@
"ts": "interface MultiSelectItem { id: MultiSelectItemId; text: MultiSelectItemText; }"
}
],
- "rest_props": { "type": "Element", "name": "div" }
+ "rest_props": { "type": "Element", "name": "input" }
},
{
"moduleName": "NotificationActionButton",
@@ -5827,7 +5972,7 @@
"ts": "type NumberInputTranslationId = \"increment\" | \"decrement\""
}
],
- "rest_props": { "type": "Element", "name": "div" }
+ "rest_props": { "type": "Element", "name": "input" }
},
{
"moduleName": "NumberInputSkeleton",
@@ -6950,6 +7095,16 @@
"constant": false,
"reactive": false
},
+ {
+ "name": "legendText",
+ "kind": "let",
+ "description": "Specify the legend text",
+ "type": "string",
+ "value": "\"\"",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
{
"name": "labelPosition",
"kind": "let",
@@ -6980,7 +7135,15 @@
"reactive": false
}
],
- "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
+ "slots": [
+ { "name": "__default__", "default": true, "slot_props": "{}" },
+ {
+ "name": "legendText",
+ "default": false,
+ "fallback": "{legendText}",
+ "slot_props": "{}"
+ }
+ ],
"events": [
{ "type": "forwarded", "name": "click", "element": "div" },
{ "type": "forwarded", "name": "mouseover", "element": "div" },
@@ -7947,7 +8110,14 @@
"reactive": true
}
],
- "slots": [],
+ "slots": [
+ {
+ "name": "__default__",
+ "default": true,
+ "fallback": "{text}",
+ "slot_props": "{}"
+ }
+ ],
"events": [{ "type": "forwarded", "name": "click", "element": "a" }],
"typedefs": [],
"rest_props": { "type": "Element", "name": "a" }
@@ -9032,6 +9202,16 @@
"constant": false,
"reactive": false
},
+ {
+ "name": "interactive",
+ "kind": "let",
+ "description": "Set to `true` to render a `button` element instead of a `div`",
+ "type": "boolean",
+ "value": "false",
+ "isFunction": false,
+ "constant": false,
+ "reactive": false
+ },
{
"name": "skeleton",
"kind": "let",
@@ -9748,7 +9928,7 @@
{ "type": "forwarded", "name": "blur", "element": "input" }
],
"typedefs": [],
- "rest_props": { "type": "Element", "name": "div" }
+ "rest_props": { "type": "Element", "name": "input" }
},
{
"moduleName": "TimePickerSelect",
@@ -10372,6 +10552,7 @@
],
"slots": [],
"events": [
+ { "type": "forwarded", "name": "clear", "element": "Search" },
{ "type": "forwarded", "name": "change", "element": "Search" },
{ "type": "forwarded", "name": "input", "element": "Search" },
{ "type": "forwarded", "name": "focus", "element": "Search" },
diff --git a/docs/src/pages/_layout.svelte b/docs/src/pages/_layout.svelte
index 1d3e0340..3b1a616d 100644
--- a/docs/src/pages/_layout.svelte
+++ b/docs/src/pages/_layout.svelte
@@ -13,11 +13,15 @@
SideNavItems,
SideNavMenu,
SideNavMenuItem,
+ Tag,
} from "carbon-components-svelte";
import LogoGithub20 from "carbon-icons-svelte/lib/LogoGithub20";
import Theme from "../components/Theme.svelte";
import Footer from "../components/Footer.svelte";
+ const deprecated = ["ToggleSmall", "Icon"];
+ const new_components = ["ImageLoader", "LocalStorage"];
+
let isOpen = false;
let isSideNavOpen = true;
let innerWidth = 2048;
@@ -98,16 +102,25 @@
text="{child.title}"
href="{$url(child.path)}"
isSelected="{$isActive($url(child.path))}"
- />
+ >
+ {child.title}
+ {#if deprecated.includes(child.title)}
+ + Storage tiers may vary based on geolocation. +
+
diff --git a/docs/src/pages/framed/Button/SelectedIconOnlyButton.svelte b/docs/src/pages/framed/Button/SelectedIconOnlyButton.svelte
new file mode 100644
index 00000000..ca23da37
--- /dev/null
+++ b/docs/src/pages/framed/Button/SelectedIconOnlyButton.svelte
@@ -0,0 +1,30 @@
+
+
+
+
+
diff --git a/docs/src/pages/framed/ImageLoader/ProgrammaticImageLoader.svelte b/docs/src/pages/framed/ImageLoader/ProgrammaticImageLoader.svelte
new file mode 100644
index 00000000..471a15c8
--- /dev/null
+++ b/docs/src/pages/framed/ImageLoader/ProgrammaticImageLoader.svelte
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+ {JSON.stringify(events, null, 2)} +diff --git a/docs/src/pages/framed/RadioButton/ProgrammaticRadioButton.svelte b/docs/src/pages/framed/RadioButton/ProgrammaticRadioButton.svelte index f0cffa46..ee361f5b 100644 --- a/docs/src/pages/framed/RadioButton/ProgrammaticRadioButton.svelte +++ b/docs/src/pages/framed/RadioButton/ProgrammaticRadioButton.svelte @@ -2,7 +2,6 @@ import { ButtonSet, Button, - FormGroup, RadioButtonGroup, RadioButton, } from "carbon-components-svelte"; @@ -10,17 +9,17 @@ let plan = "standard"; -