diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index a931eb43..c10196d3 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -1,6 +1,6 @@ # Component Index -> 155 components exported from carbon-components-svelte@0.26.0. +> 160 components exported from carbon-components-svelte@0.26.0. ## Components @@ -46,6 +46,11 @@ - [`FormItem`](#formitem) - [`FormLabel`](#formlabel) - [`Grid`](#grid) +- [`Head`](#head) +- [`HeadAction`](#headaction) +- [`HeadActions`](#headactions) +- [`HeadFilters`](#headfilters) +- [`HeadIdentity`](#headidentity) - [`Header`](#header) - [`HeaderAction`](#headeraction) - [`HeaderActionLink`](#headeractionlink) @@ -1350,6 +1355,102 @@ None. None. +## `Head` + +### Props + +| Prop name | Kind | Reactive | Type | Default value | Description | +| :------------ | :--------------- | :------- | :-------------------------------------- | -------------------------- | --------------------------------- | +| flexDirection | let | No | "row" | "row-reverse" | 'row' | Set the flexDirection of the head | +| margin | let | No | string | '20px 0 15px' | Set the margin of the head | + +### Slots + +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :---- | :------- | +| -- | Yes | -- | -- | + +### Events + +None. + +## `HeadAction` + +### Props + +| Prop name | Kind | Reactive | Type | Default value | Description | +| :---------- | :--------------- | :------- | :----------------------------------------------------------- | ------------- | ----------------------------------------------------- | +| href | let | No | string | -- | Specify the href attribute | +| icon | let | No | typeof import("carbon-icons-svelte").CarbonIcon | -- | Specify the icon from `carbon-icons-svelte` to render | +| description | let | No | string | -- | Specify the description | + +### Slots + +None. + +### Events + +| Event name | Type | Detail | +| :--------- | :-------- | :----- | +| click | forwarded | -- | + +## `HeadActions` + +### Props + +| Prop name | Kind | Reactive | Type | Default value | Description | +| :-------- | :--------------- | :------- | :------------------ | ------------------- | --------------------------------- | +| width | let | No | string | "100%" | Set the width of the head actions | + +### Slots + +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :---- | :------- | +| -- | Yes | -- | -- | + +### Events + +None. + +## `HeadFilters` + +### Props + +None. + +### Slots + +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :---- | :------- | +| -- | Yes | -- | -- | + +### Events + +None. + +## `HeadIdentity` + +### Props + +| Prop name | Kind | Reactive | Type | Default value | Description | +| :-------- | :--------------- | :------- | :-------------------------------------------------- | --------------------- | ------------------------------ | +| title | let | No | string | -- | Specify the href attribute | +| subtitle | let | No | string | -- | Specify the subtitle attribute | +| imgSrc | let | No | string | -- | Specify the imgSrc attribute | +| imgSize | let | No | "small" | "normal" | "large" | 'normal' | Set the imgSize of the head | +| titleSize | let | No | "small" | "normal" | "large" | 'normal' | Set the titleSize of the head | + +### Slots + +| Slot name | Default | Props | Fallback | +| :-------- | :------ | :---- | :------- | +| -- | Yes | -- | -- | +| tabs | No | -- | -- | + +### Events + +None. + ## `Header` ### Props diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 2e1822ad..71d0ff46 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -1,5 +1,5 @@ { - "total": 155, + "total": 160, "components": [ { "moduleName": "SkeletonText", @@ -4910,6 +4910,157 @@ ], "rest_props": { "type": "Element", "name": "div" } }, + { + "moduleName": "Head", + "filePath": "/src/Head/Head.svelte", + "props": [ + { + "name": "flexDirection", + "kind": "let", + "description": "Set the flexDirection of the head", + "type": "\"row\" | \"row-reverse\"", + "value": "'row'", + "isFunction": false, + "constant": false, + "reactive": false + }, + { + "name": "margin", + "kind": "let", + "description": "Set the margin of the head", + "type": "string", + "value": "'20px 0 15px'", + "isFunction": false, + "constant": false, + "reactive": false + } + ], + "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }], + "events": [], + "typedefs": [] + }, + { + "moduleName": "HeadAction", + "filePath": "/src/Head/HeadAction.svelte", + "props": [ + { + "name": "href", + "kind": "let", + "description": "Specify the href attribute", + "type": "string", + "isFunction": false, + "constant": false, + "reactive": false + }, + { + "name": "icon", + "kind": "let", + "description": "Specify the icon from `carbon-icons-svelte` to render", + "type": "typeof import(\"carbon-icons-svelte\").CarbonIcon", + "isFunction": false, + "constant": false, + "reactive": false + }, + { + "name": "description", + "kind": "let", + "description": "Specify the description", + "type": "string", + "isFunction": false, + "constant": false, + "reactive": false + } + ], + "slots": [], + "events": [{ "type": "forwarded", "name": "click", "element": "Button" }], + "typedefs": [] + }, + { + "moduleName": "HeadActions", + "filePath": "/src/Head/HeadActions.svelte", + "props": [ + { + "name": "width", + "kind": "let", + "description": "Set the width of the head actions", + "type": "string", + "value": "\"100%\"", + "isFunction": false, + "constant": false, + "reactive": false + } + ], + "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }], + "events": [], + "typedefs": [] + }, + { + "moduleName": "HeadFilters", + "filePath": "/src/Head/HeadFilters.svelte", + "props": [], + "slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }], + "events": [], + "typedefs": [] + }, + { + "moduleName": "HeadIdentity", + "filePath": "/src/Head/HeadIdentity.svelte", + "props": [ + { + "name": "title", + "kind": "let", + "description": "Specify the href attribute", + "type": "string", + "isFunction": false, + "constant": false, + "reactive": false + }, + { + "name": "subtitle", + "kind": "let", + "description": "Specify the subtitle attribute", + "type": "string", + "isFunction": false, + "constant": false, + "reactive": false + }, + { + "name": "imgSrc", + "kind": "let", + "description": "Specify the imgSrc attribute", + "type": "string", + "isFunction": false, + "constant": false, + "reactive": false + }, + { + "name": "imgSize", + "kind": "let", + "description": "Set the imgSize of the head", + "type": "\"small\" | \"normal\" | \"large\"", + "value": "'normal'", + "isFunction": false, + "constant": false, + "reactive": false + }, + { + "name": "titleSize", + "kind": "let", + "description": "Set the titleSize of the head", + "type": "\"small\" | \"normal\" | \"large\"", + "value": "'normal'", + "isFunction": false, + "constant": false, + "reactive": false + } + ], + "slots": [ + { "name": "__default__", "default": true, "slot_props": "{}" }, + { "name": "tabs", "default": false, "slot_props": "{}" } + ], + "events": [], + "typedefs": [] + }, { "moduleName": "IconSkeleton", "filePath": "/src/Icon/IconSkeleton.svelte", diff --git a/docs/src/pages/_layout.svelte b/docs/src/pages/_layout.svelte index 2726efa3..e795d84b 100644 --- a/docs/src/pages/_layout.svelte +++ b/docs/src/pages/_layout.svelte @@ -23,10 +23,12 @@ let innerWidth = 2048; $: isMobile = innerWidth < 1056; + console.log("$layout", $layout); $: components = $layout.children.filter( (child) => child.title === "components" )[0]; $: recipes = $layout.children.filter((child) => child.title === "recipes")[0]; + $: avui = $layout.children.filter((child) => child.title === "avui")[0]; $beforeUrlChange(() => { if (isMobile) isSideNavOpen = false; @@ -217,7 +219,19 @@ + {#each avui.children as child, i (child.path)} + + {/each} + + {#each components.children as child, i (child.path)} diff --git a/docs/src/pages/avui/Head.svx b/docs/src/pages/avui/Head.svx new file mode 100644 index 00000000..0f793ad3 --- /dev/null +++ b/docs/src/pages/avui/Head.svx @@ -0,0 +1,78 @@ +--- +layout: "avui" +components: ["Head", "HeadIdentity", "HeadActions", "HeadFilters", "HeadAction"] +--- + + + +The `Head` component + +### Head with identity, filters and actions + + + + + + + + + + + + + + + + + + + + +### Head with Identity only (title, subtitle and image) + + + + + +### Sizes + +Small size: + + + + + +Large size: + + + + + +### Head without Identity + + + + + + + + + + + \ No newline at end of file diff --git a/docs/svelte.config.js b/docs/svelte.config.js index cad6f06f..2518c62e 100644 --- a/docs/svelte.config.js +++ b/docs/svelte.config.js @@ -144,6 +144,7 @@ module.exports = { remarkPlugins: [plugin, slug, carbonify], layout: { recipe: path.join(__dirname, "src/layouts/Recipe.svelte"), + avui: path.join(__dirname, "src/layouts/ComponentLayout.svelte"), _: path.join(__dirname, "src/layouts/ComponentLayout.svelte"), }, }), diff --git a/src/Head/Head.svelte b/src/Head/Head.svelte new file mode 100644 index 00000000..7c28a07a --- /dev/null +++ b/src/Head/Head.svelte @@ -0,0 +1,49 @@ + + + + + + + + + + + + diff --git a/src/Head/HeadAction.svelte b/src/Head/HeadAction.svelte new file mode 100644 index 00000000..7f50290b --- /dev/null +++ b/src/Head/HeadAction.svelte @@ -0,0 +1,33 @@ + + +