@c2n/status-panel 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/status-panel.js +102 -0
- package/package.json +73 -0
- package/react.d.ts +24 -0
- package/react.js +3 -0
- package/types/src/status-panel.d.ts +80 -0
- package/types/src/status-panel.d.ts.map +1 -0
- package/vue.d.ts +33 -0
- package/vue.js +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Nguyen Thai Vinh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `c2-status-panel`
|
|
2
|
+
|
|
3
|
+
A composable Lit component for empty states, operation outcomes, recoverable errors and unavailable content.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<c2-status-panel status="success" heading="Workspace ready" description="Everything is configured.">
|
|
7
|
+
<c2-button slot="actions">Continue</c2-button>
|
|
8
|
+
</c2-status-panel>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
// TODO
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { LitElement, html, isServer, unsafeCSS } from "lit";
|
|
2
|
+
import { property, state } from "lit/decorators.js";
|
|
3
|
+
import { customElement } from "@c2n/core/element-helper.js";
|
|
4
|
+
//#region src/status-panel.scss?inline
|
|
5
|
+
var status_panel_default = "/* ex : var((width: 24px), width, c2-checkbox) returns var(--c2-checkbox-width, 24px) */\n:host {\n display: block;\n width: var(--c2-status-panel__container--width,100%);\n max-width: var(--c2-status-panel__container--max-width,720px);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n[hidden] {\n display: none;\n}\n\n.container {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: var(--c2-status-panel__container--min-height,240px);\n padding: var(--c2-status-panel__container--padding,40px 24px);\n gap: var(--c2-status-panel__container--gap,24px);\n border: var(--c2-status-panel__container--border,1px solid transparent);\n border-radius: var(--c2-status-panel__container--border-radius,14px);\n background-color: var(--c2-status-panel__container--background-color,transparent);\n text-align: center;\n}\n\n.message,\n.header {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.message {\n gap: var(--c2-status-panel__container--gap,24px);\n}\n\n.header {\n gap: var(--c2-status-panel__header--gap,6px);\n}\n\n.media {\n display: grid;\n flex: 0 0 auto;\n place-items: center;\n box-sizing: border-box;\n width: var(--c2-status-panel__media--size,64px);\n height: var(--c2-status-panel__media--size,64px);\n overflow: hidden;\n border-radius: var(--c2-status-panel__media--border-radius,999px);\n background-color: var(--c2-status-panel__media--background-color,#f4f4f5);\n color: var(--c2-status-panel__media--color,#71717a);\n}\n\n:host([status=info]) .media {\n background-color: var(--c2-status-panel__media__info--background-color,#edf1fe);\n color: var(--c2-status-panel__media__info--color,rgb(2, 101, 220));\n}\n\n:host([status=success]) .media {\n background-color: var(--c2-status-panel__media__success--background-color,#ecfdf3);\n color: var(--c2-status-panel__media__success--color,#15803d);\n}\n\n:host([status=warning]) .media {\n background-color: var(--c2-status-panel__media__warning--background-color,#fffbeb);\n color: var(--c2-status-panel__media__warning--color,#b45309);\n}\n\n:host([status=error]) .media {\n background-color: var(--c2-status-panel__media__error--background-color,#fef2f2);\n color: var(--c2-status-panel__media__error--color,#b91c1c);\n}\n\n.media svg,\n::slotted([slot=media]) {\n display: grid;\n place-items: center;\n width: var(--c2-status-panel__media-icon--size,32px);\n height: var(--c2-status-panel__media-icon--size,32px);\n}\n\n.media svg {\n fill: none;\n stroke: currentColor;\n stroke-width: 1.8;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.title {\n color: var(--c2-status-panel__title--color,#18181b);\n font-size: var(--c2-status-panel__title--font-size,20px);\n font-weight: var(--c2-status-panel__title--font-weight,600);\n line-height: var(--c2-status-panel__title--line-height,28px);\n}\n\n.description {\n max-width: var(--c2-status-panel__description--max-width,480px);\n color: var(--c2-status-panel__description--color,#71717a);\n font-size: var(--c2-status-panel__description--font-size,14px);\n line-height: var(--c2-status-panel__description--line-height,20px);\n}\n\n.actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: var(--c2-status-panel__actions--gap,8px);\n}\n\n.content {\n box-sizing: border-box;\n width: 100%;\n max-width: var(--c2-status-panel__content--max-width,560px);\n padding: var(--c2-status-panel__content--padding,16px);\n border-radius: var(--c2-status-panel__content--border-radius,8px);\n background-color: var(--c2-status-panel__content--background-color,#f4f4f5);\n}\n\n:host([align=start]) .container,\n:host([align=start]) .message,\n:host([align=start]) .header {\n align-items: flex-start;\n text-align: start;\n}\n\n:host([align=start]) .actions {\n justify-content: flex-start;\n}";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/decorate.js
|
|
8
|
+
function __decorate(decorators, target, key, desc) {
|
|
9
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
11
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/status-panel.ts
|
|
16
|
+
var StatusPanel = class StatusPanel extends LitElement {
|
|
17
|
+
constructor(..._args) {
|
|
18
|
+
super(..._args);
|
|
19
|
+
this.status = "neutral";
|
|
20
|
+
this.align = "center";
|
|
21
|
+
this.heading = "";
|
|
22
|
+
this.description = "";
|
|
23
|
+
this.headingLevel = 2;
|
|
24
|
+
this.titleSlotted = false;
|
|
25
|
+
this.descriptionSlotted = false;
|
|
26
|
+
this.actionsSlotted = false;
|
|
27
|
+
this.contentSlotted = false;
|
|
28
|
+
this.handleSlotChange = (event) => {
|
|
29
|
+
const slot = event.currentTarget;
|
|
30
|
+
const assigned = slot.assignedElements().length > 0;
|
|
31
|
+
if (slot.name === "title") this.titleSlotted = assigned;
|
|
32
|
+
else if (slot.name === "description") this.descriptionSlotted = assigned;
|
|
33
|
+
else if (slot.name === "actions") this.actionsSlotted = assigned;
|
|
34
|
+
else if (slot.name === "content") this.contentSlotted = assigned;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
static {
|
|
38
|
+
this.styles = unsafeCSS(status_panel_default);
|
|
39
|
+
}
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
super.connectedCallback();
|
|
42
|
+
if (!isServer) this.syncSlotState();
|
|
43
|
+
}
|
|
44
|
+
syncSlotState() {
|
|
45
|
+
this.titleSlotted = this.querySelector("[slot=\"title\"]") !== null;
|
|
46
|
+
this.descriptionSlotted = this.querySelector("[slot=\"description\"]") !== null;
|
|
47
|
+
this.actionsSlotted = this.querySelector("[slot=\"actions\"]") !== null;
|
|
48
|
+
this.contentSlotted = this.querySelector("[slot=\"content\"]") !== null;
|
|
49
|
+
}
|
|
50
|
+
renderDefaultMedia() {
|
|
51
|
+
if (this.status === "success") return html`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m5 12 4 4L19 6"></path></svg>`;
|
|
52
|
+
if (this.status === "warning") return html`<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
53
|
+
<path d="M10.3 3.7 2.6 17a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 3.7a2 2 0 0 0-3.4 0Z"></path>
|
|
54
|
+
<path d="M12 9v4M12 17h.01"></path>
|
|
55
|
+
</svg>`;
|
|
56
|
+
if (this.status === "error") return html`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg>`;
|
|
57
|
+
if (this.status === "info") return html`<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
58
|
+
<circle cx="12" cy="12" r="9"></circle>
|
|
59
|
+
<path d="M12 11v5M12 8h.01"></path>
|
|
60
|
+
</svg>`;
|
|
61
|
+
return html`<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
62
|
+
<path d="M4 8.5 7 4h10l3 4.5V19a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1Z"></path>
|
|
63
|
+
<path d="M4 13h4l1.5 2h5l1.5-2h4M7 4l2 4h6l2-4"></path>
|
|
64
|
+
</svg>`;
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
const hasTitle = Boolean(this.heading) || this.titleSlotted;
|
|
68
|
+
const hasDescription = Boolean(this.description) || this.descriptionSlotted;
|
|
69
|
+
return html`
|
|
70
|
+
<div class="container">
|
|
71
|
+
<div class="message">
|
|
72
|
+
<div class="media"><slot name="media" @slotchange=${this.handleSlotChange}>${this.renderDefaultMedia()}</slot></div>
|
|
73
|
+
<div class="header" ?hidden=${!hasTitle && !hasDescription}>
|
|
74
|
+
<div class="title" role="heading" aria-level=${this.headingLevel} ?hidden=${!hasTitle}>
|
|
75
|
+
<slot name="title" @slotchange=${this.handleSlotChange}>${this.heading}</slot>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="description" ?hidden=${!hasDescription}>
|
|
78
|
+
<slot name="description" @slotchange=${this.handleSlotChange}>${this.description}</slot>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="content" ?hidden=${!this.contentSlotted}><slot name="content" @slotchange=${this.handleSlotChange}></slot></div>
|
|
83
|
+
<div class="actions" ?hidden=${!this.actionsSlotted}><slot name="actions" @slotchange=${this.handleSlotChange}></slot></div>
|
|
84
|
+
</div>
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
__decorate([property({ reflect: true })], StatusPanel.prototype, "status", void 0);
|
|
89
|
+
__decorate([property({ reflect: true })], StatusPanel.prototype, "align", void 0);
|
|
90
|
+
__decorate([property()], StatusPanel.prototype, "heading", void 0);
|
|
91
|
+
__decorate([property()], StatusPanel.prototype, "description", void 0);
|
|
92
|
+
__decorate([property({
|
|
93
|
+
type: Number,
|
|
94
|
+
attribute: "heading-level"
|
|
95
|
+
})], StatusPanel.prototype, "headingLevel", void 0);
|
|
96
|
+
__decorate([state()], StatusPanel.prototype, "titleSlotted", void 0);
|
|
97
|
+
__decorate([state()], StatusPanel.prototype, "descriptionSlotted", void 0);
|
|
98
|
+
__decorate([state()], StatusPanel.prototype, "actionsSlotted", void 0);
|
|
99
|
+
__decorate([state()], StatusPanel.prototype, "contentSlotted", void 0);
|
|
100
|
+
StatusPanel = __decorate([customElement("c2-status-panel")], StatusPanel);
|
|
101
|
+
//#endregion
|
|
102
|
+
export { StatusPanel };
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@c2n/status-panel",
|
|
3
|
+
"version": "0.0.9",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/status-panel.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./types/src/status-panel.d.ts",
|
|
9
|
+
"default": "./dist/status-panel.js"
|
|
10
|
+
},
|
|
11
|
+
"./react": {
|
|
12
|
+
"types": "./react.d.ts",
|
|
13
|
+
"default": "./react.js"
|
|
14
|
+
},
|
|
15
|
+
"./vue": {
|
|
16
|
+
"types": "./vue.d.ts",
|
|
17
|
+
"default": "./vue.js"
|
|
18
|
+
},
|
|
19
|
+
"./custom-elements.json": "./custom-elements.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"types",
|
|
24
|
+
"react.d.ts",
|
|
25
|
+
"react.js",
|
|
26
|
+
"vue.d.ts",
|
|
27
|
+
"vue.js"
|
|
28
|
+
],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"status-panel",
|
|
31
|
+
"web component",
|
|
32
|
+
"lit"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"author": "code2nguyen@gmail.com",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"registry": "https://registry.npmjs.org",
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/code2nguyen/web-components.git"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"dev": "vite",
|
|
46
|
+
"build": "wireit",
|
|
47
|
+
"build:only": "vite build",
|
|
48
|
+
"type-check": "wireit"
|
|
49
|
+
},
|
|
50
|
+
"wireit": {
|
|
51
|
+
"type-check": {
|
|
52
|
+
"dependencies": [
|
|
53
|
+
"../../core:build"
|
|
54
|
+
],
|
|
55
|
+
"command": "tsc -p tsconfig.lib.json --composite false"
|
|
56
|
+
},
|
|
57
|
+
"build": {
|
|
58
|
+
"dependencies": [
|
|
59
|
+
"type-check"
|
|
60
|
+
],
|
|
61
|
+
"command": "vite build"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@c2n/core": "0.0.9",
|
|
66
|
+
"lit": "3.3.3"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@c2n/config": "*"
|
|
70
|
+
},
|
|
71
|
+
"customElements": "custom-elements.json",
|
|
72
|
+
"gitHead": "e4768cce5e0fbd5bc3165cd493a1e8d57cf0fff4"
|
|
73
|
+
}
|
package/react.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// GENERATED by @c2n/framework-types. Do not edit by hand.
|
|
2
|
+
//
|
|
3
|
+
// JSX types for the custom elements of @c2n/status-panel. Import once, anywhere in the program:
|
|
4
|
+
//
|
|
5
|
+
// import '@c2n/status-panel/react'
|
|
6
|
+
//
|
|
7
|
+
// Register the elements at module scope before React renders, or React writes an object prop as an
|
|
8
|
+
// attribute and it stringifies.
|
|
9
|
+
|
|
10
|
+
import type { DetailedHTMLProps, HTMLAttributes } from 'react'
|
|
11
|
+
import type { StatusPanel } from '@c2n/status-panel'
|
|
12
|
+
|
|
13
|
+
/** Standard React host-element attributes plus the element's own public properties. */
|
|
14
|
+
type C2Props<T> = DetailedHTMLProps<HTMLAttributes<T>, T> & Partial<Omit<T, keyof HTMLElement>>
|
|
15
|
+
|
|
16
|
+
declare module 'react' {
|
|
17
|
+
namespace JSX {
|
|
18
|
+
interface IntrinsicElements {
|
|
19
|
+
'c2-status-panel': C2Props<StatusPanel>
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {}
|
package/react.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
export type StatusPanelStatus = 'neutral' | 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type StatusPanelAlign = 'center' | 'start';
|
|
4
|
+
/**
|
|
5
|
+
* Presents a meaningful application state with optional media, supporting copy, actions and additional content. Use it
|
|
6
|
+
* for empty collections, completed operations, errors, unavailable pages and other places where the user needs a clear
|
|
7
|
+
* explanation and next step.
|
|
8
|
+
*
|
|
9
|
+
* @tag c2-status-panel
|
|
10
|
+
*
|
|
11
|
+
* @slot media - Illustration, icon, avatar or other visual. A status icon is shown by default.
|
|
12
|
+
* @slot title - Short heading. Falls back to the `heading` attribute.
|
|
13
|
+
* @slot description - Supporting explanation. Falls back to the `description` attribute.
|
|
14
|
+
* @slot actions - Primary and secondary actions.
|
|
15
|
+
* @slot content - Additional details, lists or controls below the actions.
|
|
16
|
+
*
|
|
17
|
+
* @cssproperty {length} [--c2-status-panel__container--width=100%] - Panel width.
|
|
18
|
+
* @cssproperty {length} [--c2-status-panel__container--max-width=720px] - Maximum panel width.
|
|
19
|
+
* @cssproperty {length} [--c2-status-panel__container--min-height=240px] - Minimum panel height.
|
|
20
|
+
* @cssproperty {padding} [--c2-status-panel__container--padding=40px 24px] - Panel padding.
|
|
21
|
+
* @cssproperty {length} [--c2-status-panel__container--gap=24px] - Space between the message, actions and content.
|
|
22
|
+
* @cssproperty {border} [--c2-status-panel__container--border=1px solid transparent] - Panel border.
|
|
23
|
+
* @cssproperty {border-radius} [--c2-status-panel__container--border-radius=14px] - Panel corner radius.
|
|
24
|
+
* @cssproperty {color} [--c2-status-panel__container--background-color=transparent] - Panel background.
|
|
25
|
+
* @cssproperty {length} [--c2-status-panel__media--size=64px] - Media container width and height.
|
|
26
|
+
* @cssproperty {border-radius} [--c2-status-panel__media--border-radius=999px] - Media container corner radius.
|
|
27
|
+
* @cssproperty {color} [--c2-status-panel__media--background-color=#f4f4f5] - Neutral media background.
|
|
28
|
+
* @cssproperty {color} [--c2-status-panel__media--color=#71717a] - Neutral media colour.
|
|
29
|
+
* @cssproperty {length} [--c2-status-panel__media-icon--size=32px] - Default and slotted icon size.
|
|
30
|
+
* @cssproperty {color} [--c2-status-panel__media__info--background-color=#edf1fe] - Information media background.
|
|
31
|
+
* @cssproperty {color} [--c2-status-panel__media__info--color=rgb(2, 101, 220)] - Information media colour.
|
|
32
|
+
* @cssproperty {color} [--c2-status-panel__media__success--background-color=#ecfdf3] - Success media background.
|
|
33
|
+
* @cssproperty {color} [--c2-status-panel__media__success--color=#15803d] - Success media colour.
|
|
34
|
+
* @cssproperty {color} [--c2-status-panel__media__warning--background-color=#fffbeb] - Warning media background.
|
|
35
|
+
* @cssproperty {color} [--c2-status-panel__media__warning--color=#b45309] - Warning media colour.
|
|
36
|
+
* @cssproperty {color} [--c2-status-panel__media__error--background-color=#fef2f2] - Error media background.
|
|
37
|
+
* @cssproperty {color} [--c2-status-panel__media__error--color=#b91c1c] - Error media colour.
|
|
38
|
+
* @cssproperty {length} [--c2-status-panel__header--gap=6px] - Space between title and description.
|
|
39
|
+
* @cssproperty {color} [--c2-status-panel__title--color=#18181b] - Title colour.
|
|
40
|
+
* @cssproperty {font-size} [--c2-status-panel__title--font-size=20px] - Title font size.
|
|
41
|
+
* @cssproperty {font-weight} [--c2-status-panel__title--font-weight=600] - Title font weight.
|
|
42
|
+
* @cssproperty {line-height} [--c2-status-panel__title--line-height=28px] - Title line height.
|
|
43
|
+
* @cssproperty {color} [--c2-status-panel__description--color=#71717a] - Description colour.
|
|
44
|
+
* @cssproperty {font-size} [--c2-status-panel__description--font-size=14px] - Description font size.
|
|
45
|
+
* @cssproperty {line-height} [--c2-status-panel__description--line-height=20px] - Description line height.
|
|
46
|
+
* @cssproperty {length} [--c2-status-panel__description--max-width=480px] - Maximum readable description width.
|
|
47
|
+
* @cssproperty {length} [--c2-status-panel__actions--gap=8px] - Space between actions.
|
|
48
|
+
* @cssproperty {length} [--c2-status-panel__content--max-width=560px] - Maximum additional-content width.
|
|
49
|
+
* @cssproperty {padding} [--c2-status-panel__content--padding=16px] - Additional-content padding.
|
|
50
|
+
* @cssproperty {border-radius} [--c2-status-panel__content--border-radius=8px] - Additional-content corner radius.
|
|
51
|
+
* @cssproperty {color} [--c2-status-panel__content--background-color=#f4f4f5] - Additional-content background.
|
|
52
|
+
*/
|
|
53
|
+
export declare class StatusPanel extends LitElement {
|
|
54
|
+
static styles: import("lit").CSSResult;
|
|
55
|
+
/** Visual tone and default media icon. */
|
|
56
|
+
status: StatusPanelStatus;
|
|
57
|
+
/** Centers the composition or aligns it to the inline start. */
|
|
58
|
+
align: StatusPanelAlign;
|
|
59
|
+
/** Plain-text title fallback. Use the `title` slot for rich content. */
|
|
60
|
+
heading: string;
|
|
61
|
+
/** Plain-text description fallback. Use the `description` slot for rich content. */
|
|
62
|
+
description: string;
|
|
63
|
+
/** Accessible heading level used by the title region. */
|
|
64
|
+
headingLevel: number;
|
|
65
|
+
private titleSlotted;
|
|
66
|
+
private descriptionSlotted;
|
|
67
|
+
private actionsSlotted;
|
|
68
|
+
private contentSlotted;
|
|
69
|
+
connectedCallback(): void;
|
|
70
|
+
private syncSlotState;
|
|
71
|
+
private handleSlotChange;
|
|
72
|
+
private renderDefaultMedia;
|
|
73
|
+
render(): TemplateResult<1>;
|
|
74
|
+
}
|
|
75
|
+
declare global {
|
|
76
|
+
interface HTMLElementTagNameMap {
|
|
77
|
+
'c2-status-panel': StatusPanel;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=status-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-panel.d.ts","sourceRoot":"","sources":["../../src/status-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA6B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAKhF,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;AACpF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,qBACa,WAAY,SAAQ,UAAU;IACzC,OAAgB,MAAM,0BAAoB;IAE1C,0CAA0C;IACb,MAAM,EAAE,iBAAiB,CAAY;IAElE,gEAAgE;IACnC,KAAK,EAAE,gBAAgB,CAAW;IAE/D,wEAAwE;IAC5D,OAAO,SAAK;IAExB,oFAAoF;IACxE,WAAW,SAAK;IAE5B,yDAAyD;IACD,YAAY,SAAI;IAE/D,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,kBAAkB,CAAQ;IAClC,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,cAAc,CAAQ;IAE9B,iBAAiB;IAK1B,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,gBAAgB,CAOvB;IAED,OAAO,CAAC,kBAAkB;IAqBjB,MAAM;CAsBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,WAAW,CAAA;KAC/B;CACF"}
|
package/vue.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// GENERATED by @c2n/framework-types. Do not edit by hand.
|
|
2
|
+
//
|
|
3
|
+
// Vue template types for the custom elements of @c2n/status-panel. Import once, anywhere in the program:
|
|
4
|
+
//
|
|
5
|
+
// import '@c2n/status-panel/vue'
|
|
6
|
+
//
|
|
7
|
+
// Tell the compiler about the tags as well, or every c2-* tag is resolved as a Vue component and renders
|
|
8
|
+
// nothing: template.compilerOptions.isCustomElement = (tag) => tag.startsWith('c2-') in vite.config.ts.
|
|
9
|
+
|
|
10
|
+
import type { DefineComponent, HTMLAttributes } from 'vue'
|
|
11
|
+
import type { StatusPanel } from '@c2n/status-panel'
|
|
12
|
+
|
|
13
|
+
/** The element's own public properties, plus every attribute Vue understands on a host element. */
|
|
14
|
+
type C2Props<T> = Partial<Omit<T, keyof HTMLElement>> & HTMLAttributes
|
|
15
|
+
|
|
16
|
+
declare module 'vue' {
|
|
17
|
+
interface GlobalComponents {
|
|
18
|
+
'c2-status-panel': DefineComponent<
|
|
19
|
+
C2Props<StatusPanel> & {
|
|
20
|
+
'heading-level'?: unknown
|
|
21
|
+
}
|
|
22
|
+
>
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare module '@vue/runtime-dom' {
|
|
27
|
+
interface HTMLAttributes {
|
|
28
|
+
/** Vue's own definition omits it, and slotting a plain element into a component needs it. */
|
|
29
|
+
slot?: string
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {}
|
package/vue.js
ADDED