Skip to content

Commit

Permalink
docs(lit-override): update lit-override docs
Browse files Browse the repository at this point in the history
  • Loading branch information
waldronmatt committed Oct 23, 2024
1 parent 27efc3b commit a1f96e0
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 83 deletions.
122 changes: 71 additions & 51 deletions packages/lit-override/custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"package": "./components/index.js"
}
},
{
"kind": "js",
"name": "*",
"declaration": {
"name": "*",
"package": "./context/index.js"
}
},
{
"kind": "js",
"name": "*",
Expand Down Expand Up @@ -92,7 +100,7 @@
},
{
"kind": "javascript-module",
"path": "src/components/lit-override-component.ts",
"path": "src/components/lit-override.component.ts",
"declarations": [
{
"kind": "class",
Expand Down Expand Up @@ -131,7 +139,6 @@
{
"kind": "field",
"name": "onConnectedCallback",
"attribute": "onConnectedCallback",
"type": {
"text": "function"
},
Expand All @@ -140,6 +147,23 @@
"name": "EmitConnectedCallback",
"module": "src/mixins/emit-connected-callback.ts"
}
},
{
"kind": "method",
"name": "setEmitConnectedCallback",
"privacy": "private",
"parameters": [
{
"name": "childInfo",
"type": {
"text": "EmitConnectedCallbackInfo"
}
}
],
"inheritedFrom": {
"name": "EmitConnectedCallback",
"module": "src/mixins/emit-connected-callback.ts"
}
}
],
"events": [
Expand Down Expand Up @@ -172,14 +196,6 @@
"name": "EmitConnectedCallback",
"module": "src/mixins/emit-connected-callback.ts"
}
},
{
"name": "onConnectedCallback",
"fieldName": "onConnectedCallback",
"inheritedFrom": {
"name": "EmitConnectedCallback",
"module": "src/mixins/emit-connected-callback.ts"
}
}
]
}
Expand All @@ -190,7 +206,7 @@
"name": "LitOverride",
"declaration": {
"name": "LitOverride",
"module": "src/components/lit-override-component.ts"
"module": "src/components/lit-override.component.ts"
}
}
]
Expand All @@ -205,7 +221,7 @@
"name": "*",
"declaration": {
"name": "*",
"package": "./lit-override-component.js"
"package": "./lit-override.component.js"
}
},
{
Expand All @@ -221,27 +237,26 @@
"name": "lit-override",
"declaration": {
"name": "LitOverride",
"module": "/src/components/lit-override-component.js"
"module": "/src/components/lit-override.component.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/context/consumer-component.ts",
"path": "src/context/consumer.component.ts",
"declarations": [
{
"kind": "class",
"description": "LitOverrideConsumer - `<lit-override-consumer>`\n\nContext consumer of custom styles and markup. Renders `nothing` by default.\n\nExample:\n\n```js\nconst customStyles = css`\n ::slotted([slot='heading']) {\n text-decoration: underline;\n }\n`;\n\nconst customMarkup = () => {\n return html`<slot name=\"heading\"></slot>`;\n};\n\nhtml`\n <lit-override-provider\n .override=${{ styles: customStyles, markup: customMarkup }}\n >\n <lit-override-consumer>\n <h3 slot=\"heading\">Hello World!</h3>\n </lit-override-consumer>\n </lit-override-provider>\n`\n```",
"description": "LitOverrideConsumer - `<lit-override-consumer>`\n\nContext consumer of custom styles and markup. Renders `nothing` by default.\n\nExample:\n\n```js\nconst customStyles = css`\n ::slotted([slot='heading']) {\n text-decoration: underline;\n }\n`;\n\nconst customMarkup = () => {\n return html`<slot name=\"heading\"></slot>`;\n};\n\nrender() {\n return html`\n <lit-override-provider\n .override=${{ styles: customStyles, markup: customMarkup }}\n >\n <lit-override-consumer>\n <h3 slot=\"heading\">Hello World!</h3>\n </lit-override-consumer>\n </lit-override-provider>\n `\n}\n```",
"name": "LitOverrideConsumer",
"members": [
{
"kind": "field",
"name": "override",
"type": {
"text": "Partial<LitOverrideContextProps> | undefined"
},
"privacy": "public"
}
},
{
"kind": "method",
Expand All @@ -263,7 +278,7 @@
"name": "LitOverrideConsumer",
"declaration": {
"name": "LitOverrideConsumer",
"module": "src/context/consumer-component.ts"
"module": "src/context/consumer.component.ts"
}
}
]
Expand All @@ -278,7 +293,7 @@
"name": "*",
"declaration": {
"name": "*",
"package": "./consumer-component.js"
"package": "./consumer.component.js"
}
},
{
Expand All @@ -294,7 +309,7 @@
"name": "lit-override-consumer",
"declaration": {
"name": "LitOverrideConsumer",
"module": "/src/context/consumer-component.js"
"module": "/src/context/consumer.component.js"
}
}
]
Expand Down Expand Up @@ -344,28 +359,20 @@
},
{
"kind": "javascript-module",
"path": "src/context/provider-component.ts",
"path": "src/context/provider.component.ts",
"declarations": [
{
"kind": "class",
"description": "LitOverrideProvider - `<lit-override-provider>`\n\nContext provider of custom styles and markup.",
"description": "LitOverrideProvider - `<lit-override-provider>`\n\nContext provider of custom styles and markup.\n\n**Note**: Set `clearStyles` to `true` to replace existing styles.\n\nExample:\n\n```js\nconst customStyles = css`\n ::slotted([slot='heading']) {\n text-decoration: underline;\n }\n`;\n\nconst customMarkup = () => {\n return html`<slot name=\"heading\"></slot>`;\n};\n\nrender() {\n return html`\n <lit-override-provider\n .override=${{ styles: customStyles, markup: customMarkup }}\n >\n <lit-override-consumer>\n <h3 slot=\"heading\">Hello World!</h3>\n </lit-override-consumer>\n </lit-override-provider>\n `\n}\n```",
"name": "LitOverrideProvider",
"slots": [
{
"description": "renders `<lit-override-consumer>`. Example: ```js const customStyles = css` ::slotted([slot='heading']) { text-decoration: underline; } `; const customMarkup = () => { return html`<slot name=\"heading\"></slot>`; }; html` <lit-override-provider .override=${{ styles: customStyles, markup: customMarkup }} > <lit-override-consumer> <h3 slot=\"heading\">Hello World!</h3> </lit-override-consumer> </lit-override-provider> ` ```",
"name": "`<slot></slot>`"
}
],
"members": [
{
"kind": "field",
"name": "override",
"type": {
"text": "object"
"text": "Partial<LitOverrideContextProps>"
},
"privacy": "public",
"default": "{}",
"description": "Set custom `styles` and `markup`."
"default": "{}"
}
],
"superclass": {
Expand All @@ -382,7 +389,7 @@
"name": "LitOverrideProvider",
"declaration": {
"name": "LitOverrideProvider",
"module": "src/context/provider-component.ts"
"module": "src/context/provider.component.ts"
}
}
]
Expand All @@ -397,7 +404,7 @@
"name": "*",
"declaration": {
"name": "*",
"package": "./provider-component.js"
"package": "./provider.component.js"
}
},
{
Expand All @@ -413,7 +420,7 @@
"name": "lit-override-provider",
"declaration": {
"name": "LitOverrideProvider",
"module": "/src/context/provider-component.js"
"module": "/src/context/provider.component.js"
}
}
]
Expand Down Expand Up @@ -457,16 +464,9 @@
"type": {
"text": "ShadowRoot"
},
"privacy": "private",
"default": "(this.host as LitElement).renderRoot"
},
{
"kind": "method",
"name": "hostConnected"
},
{
"kind": "method",
"name": "hostUpdated"
},
{
"kind": "method",
"name": "updateStylesheet",
Expand All @@ -489,6 +489,14 @@
"kind": "method",
"name": "removeComponentStyleTag",
"privacy": "private"
},
{
"kind": "method",
"name": "hostConnected"
},
{
"kind": "method",
"name": "hostUpdated"
}
]
}
Expand Down Expand Up @@ -543,12 +551,16 @@
"name": "queryTemplateById",
"parameters": [
{
"name": "{ fallback = false }",
"name": "{ cache = true, fallback = false }",
"default": "{}",
"type": {
"text": "QueryTemplateByIdParams"
}
},
{
"description": "caches the template element between component renders when enabled. Defaults to `true`.",
"name": "cache"
},
{
"description": "gets a template element if an id is not provided (not cached). Defaults to `false`.",
"name": "fallback"
Expand Down Expand Up @@ -667,8 +679,20 @@
},
{
"kind": "field",
"name": "onConnectedCallback",
"attribute": "onConnectedCallback"
"name": "onConnectedCallback"
},
{
"kind": "method",
"name": "setEmitConnectedCallback",
"privacy": "private",
"parameters": [
{
"name": "childInfo",
"type": {
"text": "EmitConnectedCallbackInfo"
}
}
]
}
],
"attributes": [
Expand All @@ -679,10 +703,6 @@
},
"default": "false",
"fieldName": "emitConnectedCallback"
},
{
"name": "onConnectedCallback",
"fieldName": "onConnectedCallback"
}
],
"parameters": [
Expand Down Expand Up @@ -775,7 +795,7 @@
{
"name": "template",
"type": {
"text": "TemplateResult"
"text": "() => TemplateResult"
},
"description": "TemplateResult"
}
Expand Down
Loading

0 comments on commit a1f96e0

Please sign in to comment.