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 @@
+
+
+
diff --git a/src/Head/HeadActions.svelte b/src/Head/HeadActions.svelte
new file mode 100644
index 00000000..553ef20a
--- /dev/null
+++ b/src/Head/HeadActions.svelte
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/src/Head/HeadFilters.svelte b/src/Head/HeadFilters.svelte
new file mode 100644
index 00000000..fdfd30d5
--- /dev/null
+++ b/src/Head/HeadFilters.svelte
@@ -0,0 +1,12 @@
+
+
+
diff --git a/src/Head/HeadIdentity.svelte b/src/Head/HeadIdentity.svelte
new file mode 100644
index 00000000..9e4e5f32
--- /dev/null
+++ b/src/Head/HeadIdentity.svelte
@@ -0,0 +1,123 @@
+
+
+
+
+
diff --git a/src/Head/index.js b/src/Head/index.js
new file mode 100644
index 00000000..4718903f
--- /dev/null
+++ b/src/Head/index.js
@@ -0,0 +1,5 @@
+export { default as Head } from "./Head.svelte";
+export { default as HeadAction } from "./HeadAction.svelte";
+export { default as HeadActions } from "./HeadActions.svelte";
+export { default as HeadFilters } from "./HeadFilters.svelte";
+export { default as HeadIdentity } from "./HeadIdentity.svelte";
diff --git a/src/index.js b/src/index.js
index 522bc154..f2645f0d 100644
--- a/src/index.js
+++ b/src/index.js
@@ -47,6 +47,13 @@ export { FormGroup } from "./FormGroup";
export { FormItem } from "./FormItem";
export { FormLabel } from "./FormLabel";
export { Grid, Row, Column } from "./Grid";
+export {
+ Head,
+ HeadAction,
+ HeadActions,
+ HeadFilters,
+ HeadIdentity,
+} from "./Head";
export { Icon, IconSkeleton } from "./Icon";
export { InlineLoading } from "./InlineLoading";
export { Link } from "./Link";
diff --git a/types/Head/Head.d.ts b/types/Head/Head.d.ts
new file mode 100644
index 00000000..08e24cbf
--- /dev/null
+++ b/types/Head/Head.d.ts
@@ -0,0 +1,24 @@
+///
+
+export interface HeadProps {
+ /**
+ * Set the flexDirection of the head
+ * @default 'row'
+ */
+ flexDirection?: "row" | "row-reverse";
+
+ /**
+ * Set the margin of the head
+ * @default '20px 0 15px'
+ */
+ margin?: string;
+}
+
+export default class Head {
+ $$prop_def: HeadProps;
+ $$slot_def: {
+ default: {};
+ };
+
+ $on(eventname: string, cb: (event: Event) => void): () => void;
+}
diff --git a/types/Head/HeadAction.d.ts b/types/Head/HeadAction.d.ts
new file mode 100644
index 00000000..f3c8a7c9
--- /dev/null
+++ b/types/Head/HeadAction.d.ts
@@ -0,0 +1,26 @@
+///
+
+export interface HeadActionProps {
+ /**
+ * Specify the href attribute
+ */
+ href?: string;
+
+ /**
+ * Specify the icon from `carbon-icons-svelte` to render
+ */
+ icon?: typeof import("carbon-icons-svelte").CarbonIcon;
+
+ /**
+ * Specify the description
+ */
+ description?: string;
+}
+
+export default class HeadAction {
+ $$prop_def: HeadActionProps;
+ $$slot_def: {};
+
+ $on(eventname: "click", cb: (event: WindowEventMap["click"]) => void): () => void;
+ $on(eventname: string, cb: (event: Event) => void): () => void;
+}
diff --git a/types/Head/HeadActions.d.ts b/types/Head/HeadActions.d.ts
new file mode 100644
index 00000000..a58bfe16
--- /dev/null
+++ b/types/Head/HeadActions.d.ts
@@ -0,0 +1,18 @@
+///
+
+export interface HeadActionsProps {
+ /**
+ * Set the width of the head actions
+ * @default "100%"
+ */
+ width?: string;
+}
+
+export default class HeadActions {
+ $$prop_def: HeadActionsProps;
+ $$slot_def: {
+ default: {};
+ };
+
+ $on(eventname: string, cb: (event: Event) => void): () => void;
+}
diff --git a/types/Head/HeadFilters.d.ts b/types/Head/HeadFilters.d.ts
new file mode 100644
index 00000000..499e2af9
--- /dev/null
+++ b/types/Head/HeadFilters.d.ts
@@ -0,0 +1,12 @@
+///
+
+export interface HeadFiltersProps {}
+
+export default class HeadFilters {
+ $$prop_def: HeadFiltersProps;
+ $$slot_def: {
+ default: {};
+ };
+
+ $on(eventname: string, cb: (event: Event) => void): () => void;
+}
diff --git a/types/Head/HeadIdentity.d.ts b/types/Head/HeadIdentity.d.ts
new file mode 100644
index 00000000..2f4d2954
--- /dev/null
+++ b/types/Head/HeadIdentity.d.ts
@@ -0,0 +1,40 @@
+///
+
+export interface HeadIdentityProps {
+ /**
+ * Specify the href attribute
+ */
+ title?: string;
+
+ /**
+ * Specify the subtitle attribute
+ */
+ subtitle?: string;
+
+ /**
+ * Specify the imgSrc attribute
+ */
+ imgSrc?: string;
+
+ /**
+ * Set the imgSize of the head
+ * @default 'normal'
+ */
+ imgSize?: "small" | "normal" | "large";
+
+ /**
+ * Set the titleSize of the head
+ * @default 'normal'
+ */
+ titleSize?: "small" | "normal" | "large";
+}
+
+export default class HeadIdentity {
+ $$prop_def: HeadIdentityProps;
+ $$slot_def: {
+ default: {};
+ tabs: {};
+ };
+
+ $on(eventname: string, cb: (event: Event) => void): () => void;
+}
diff --git a/types/index.d.ts b/types/index.d.ts
index 087e3347..8a2bfcf6 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -70,6 +70,11 @@ export { default as FormLabel } from "./FormLabel/FormLabel";
export { default as Grid } from "./Grid/Grid";
export { default as Row } from "./Grid/Row";
export { default as Column } from "./Grid/Column";
+export { default as Head } from "./Head/Head";
+export { default as HeadAction } from "./Head/HeadAction";
+export { default as HeadActions } from "./Head/HeadActions";
+export { default as HeadFilters } from "./Head/HeadFilters";
+export { default as HeadIdentity } from "./Head/HeadIdentity";
export { default as IconSkeleton } from "./Icon/IconSkeleton";
export { default as Icon } from "./Icon/Icon";
export { default as InlineLoading } from "./InlineLoading/InlineLoading";