let
| Yes | Record
| { sm: false, md: false, lg: false, xlg: false, max: false, }
| Carbon grid sizes as an object |
+| size | let
| Yes | BreakpointSize
| -- | Determine the current Carbon grid breakpoint size |
+| breakpoints | const
| No | Record
| { sm: 320, md: 672, lg: 1056, xlg: 1312, max: 1584, }
| Reference the Carbon grid breakpoints |
+
+### Slots
+
+| Slot name | Default | Props | Fallback |
+| :-------- | :------ | :------------------------------------------------------------------------------ | :------- |
+| -- | Yes | { size: BreakpointSize; sizes: Record; }
| -- |
+
+### Events
+
+| Event name | Type | Detail |
+| :--------- | :--------- | :----------------------------------------------------------------------- |
+| match | dispatched | { size: BreakpointSize; breakpointValue: BreakpointValue; }
|
+
## `Button`
### Props
diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json
index 2f90e454..b94c4636 100644
--- a/docs/src/COMPONENT_API.json
+++ b/docs/src/COMPONENT_API.json
@@ -1,5 +1,5 @@
{
- "total": 170,
+ "total": 171,
"components": [
{
"moduleName": "Accordion",
@@ -344,6 +344,67 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
},
+ {
+ "moduleName": "Breakpoint",
+ "filePath": "src/Breakpoint/Breakpoint.svelte",
+ "props": [
+ {
+ "name": "size",
+ "kind": "let",
+ "description": "Determine the current Carbon grid breakpoint size",
+ "type": "BreakpointSize",
+ "isFunction": false,
+ "constant": false,
+ "reactive": true
+ },
+ {
+ "name": "sizes",
+ "kind": "let",
+ "description": "Carbon grid sizes as an object",
+ "type": "RecordNo typedefs.
diff --git a/docs/src/components/InlineSnippet.svelte b/docs/src/components/InlineSnippet.svelte index 48a02642..136fe90b 100644 --- a/docs/src/components/InlineSnippet.svelte +++ b/docs/src/components/InlineSnippet.svelte @@ -11,6 +11,6 @@ diff --git a/docs/src/pages/_layout.svelte b/docs/src/pages/_layout.svelte index 7f97d8e2..0946cf77 100644 --- a/docs/src/pages/_layout.svelte +++ b/docs/src/pages/_layout.svelte @@ -20,7 +20,7 @@ import Footer from "../components/Footer.svelte"; const deprecated = ["ToggleSmall", "Icon"]; - const new_components = ["ProgressBar", "RecursiveList", "TreeView"]; + const new_components = ["Breakpoint", "RecursiveList", "TreeView"]; let isOpen = false; let isSideNavOpen = true; diff --git a/docs/src/pages/components/Breakpoint.svx b/docs/src/pages/components/Breakpoint.svx new file mode 100644 index 00000000..082f57bc --- /dev/null +++ b/docs/src/pages/components/Breakpoint.svx @@ -0,0 +1,27 @@ + + + +The [Carbon Design System grid implementation](https://carbondesignsystem.com/guidelines/2x-grid/implementation#responsive-options) defines five responsive breakpoints: + +Resize the width of your browser.
++ {JSON.stringify(events,null, 2)} ++ + diff --git a/docs/svelte.config.js b/docs/svelte.config.js index 035a51dd..8f27725b 100644 --- a/docs/svelte.config.js +++ b/docs/svelte.config.js @@ -68,6 +68,7 @@ function plugin() { const formattedCode = format(scriptBlock + node.value, { parser: "svelte", svelteBracketNewLine: true, + svelteSortOrder: "scripts-markup-styles", }); const highlightedCode = Prism.highlight( formattedCode, diff --git a/src/Breakpoint/Breakpoint.svelte b/src/Breakpoint/Breakpoint.svelte new file mode 100644 index 00000000..19ef305f --- /dev/null +++ b/src/Breakpoint/Breakpoint.svelte @@ -0,0 +1,100 @@ + + +