@skdx/web-components-blocks 0.34.0 → 0.36.0
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/custom-elements.json +5076 -294
- package/dist/chat-composer/ChatComposer.cjs +41 -0
- package/dist/chat-composer/ChatComposer.d.cts +125 -0
- package/dist/chat-composer/ChatComposer.d.ts +125 -0
- package/dist/chat-composer/ChatComposer.js +41 -0
- package/dist/chat-composer/index.cjs +1 -0
- package/dist/chat-composer/index.d.cts +1 -0
- package/dist/chat-composer/index.d.ts +1 -0
- package/dist/chat-composer/index.js +1 -0
- package/dist/chat-message/ChatMessage.cjs +26 -0
- package/dist/chat-message/ChatMessage.d.cts +74 -0
- package/dist/chat-message/ChatMessage.d.ts +74 -0
- package/dist/chat-message/ChatMessage.js +26 -0
- package/dist/chat-message/index.cjs +1 -0
- package/dist/chat-message/index.d.cts +1 -0
- package/dist/chat-message/index.d.ts +1 -0
- package/dist/chat-message/index.js +1 -0
- package/dist/comment/Comment.cjs +26 -0
- package/dist/comment/Comment.d.cts +66 -0
- package/dist/comment/Comment.d.ts +66 -0
- package/dist/comment/Comment.js +26 -0
- package/dist/comment/index.cjs +1 -0
- package/dist/comment/index.d.cts +1 -0
- package/dist/comment/index.d.ts +1 -0
- package/dist/comment/index.js +1 -0
- package/dist/comment-thread/CommentThread.cjs +27 -0
- package/dist/comment-thread/CommentThread.d.cts +67 -0
- package/dist/comment-thread/CommentThread.d.ts +67 -0
- package/dist/comment-thread/CommentThread.js +27 -0
- package/dist/comment-thread/index.cjs +1 -0
- package/dist/comment-thread/index.d.cts +1 -0
- package/dist/comment-thread/index.d.ts +1 -0
- package/dist/comment-thread/index.js +1 -0
- package/dist/confirm-dialog/ConfirmDialog.cjs +38 -0
- package/dist/confirm-dialog/ConfirmDialog.d.cts +101 -0
- package/dist/confirm-dialog/ConfirmDialog.d.ts +101 -0
- package/dist/confirm-dialog/ConfirmDialog.js +38 -0
- package/dist/confirm-dialog/index.cjs +1 -0
- package/dist/confirm-dialog/index.d.cts +1 -0
- package/dist/confirm-dialog/index.d.ts +1 -0
- package/dist/confirm-dialog/index.js +1 -0
- package/dist/conversation-list/ConversationList.cjs +52 -0
- package/dist/conversation-list/ConversationList.d.cts +124 -0
- package/dist/conversation-list/ConversationList.d.ts +124 -0
- package/dist/conversation-list/ConversationList.js +52 -0
- package/dist/conversation-list/index.cjs +1 -0
- package/dist/conversation-list/index.d.cts +1 -0
- package/dist/conversation-list/index.d.ts +1 -0
- package/dist/conversation-list/index.js +1 -0
- package/dist/empty-state/EmptyState.cjs +29 -0
- package/dist/empty-state/EmptyState.d.cts +69 -0
- package/dist/empty-state/EmptyState.d.ts +69 -0
- package/dist/empty-state/EmptyState.js +29 -0
- package/dist/empty-state/index.cjs +1 -0
- package/dist/empty-state/index.d.cts +1 -0
- package/dist/empty-state/index.d.ts +1 -0
- package/dist/empty-state/index.js +1 -0
- package/dist/filter-bar/FilterBar.cjs +44 -0
- package/dist/filter-bar/FilterBar.d.cts +110 -0
- package/dist/filter-bar/FilterBar.d.ts +110 -0
- package/dist/filter-bar/FilterBar.js +44 -0
- package/dist/filter-bar/index.cjs +1 -0
- package/dist/filter-bar/index.d.cts +1 -0
- package/dist/filter-bar/index.d.ts +1 -0
- package/dist/filter-bar/index.js +1 -0
- package/dist/forgot-password-page/ForgotPasswordPage.cjs +57 -0
- package/dist/forgot-password-page/ForgotPasswordPage.d.cts +95 -0
- package/dist/forgot-password-page/ForgotPasswordPage.d.ts +95 -0
- package/dist/forgot-password-page/ForgotPasswordPage.js +57 -0
- package/dist/forgot-password-page/index.cjs +1 -0
- package/dist/forgot-password-page/index.d.cts +1 -0
- package/dist/forgot-password-page/index.d.ts +1 -0
- package/dist/forgot-password-page/index.js +1 -0
- package/dist/form-section/FormSection.cjs +28 -0
- package/dist/form-section/FormSection.d.cts +63 -0
- package/dist/form-section/FormSection.d.ts +63 -0
- package/dist/form-section/FormSection.js +28 -0
- package/dist/form-section/index.cjs +1 -0
- package/dist/form-section/index.d.cts +1 -0
- package/dist/form-section/index.d.ts +1 -0
- package/dist/form-section/index.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1 -1
- package/dist/internal/slots.cjs +1 -1
- package/dist/internal/slots.d.cts +2 -0
- package/dist/internal/slots.d.ts +2 -0
- package/dist/internal/slots.js +1 -1
- package/dist/notification-center/NotificationCenter.cjs +74 -0
- package/dist/notification-center/NotificationCenter.d.cts +147 -0
- package/dist/notification-center/NotificationCenter.d.ts +147 -0
- package/dist/notification-center/NotificationCenter.js +74 -0
- package/dist/notification-center/index.cjs +1 -0
- package/dist/notification-center/index.d.cts +1 -0
- package/dist/notification-center/index.d.ts +1 -0
- package/dist/notification-center/index.js +1 -0
- package/dist/onboarding-checklist/OnboardingChecklist.cjs +55 -0
- package/dist/onboarding-checklist/OnboardingChecklist.d.cts +89 -0
- package/dist/onboarding-checklist/OnboardingChecklist.d.ts +89 -0
- package/dist/onboarding-checklist/OnboardingChecklist.js +55 -0
- package/dist/onboarding-checklist/index.cjs +1 -0
- package/dist/onboarding-checklist/index.d.cts +1 -0
- package/dist/onboarding-checklist/index.d.ts +1 -0
- package/dist/onboarding-checklist/index.js +1 -0
- package/dist/page-container/PageContainer.cjs +5 -5
- package/dist/page-container/PageContainer.js +2 -2
- package/dist/reset-password-page/ResetPasswordPage.cjs +59 -0
- package/dist/reset-password-page/ResetPasswordPage.d.cts +104 -0
- package/dist/reset-password-page/ResetPasswordPage.d.ts +104 -0
- package/dist/reset-password-page/ResetPasswordPage.js +59 -0
- package/dist/reset-password-page/index.cjs +1 -0
- package/dist/reset-password-page/index.d.cts +1 -0
- package/dist/reset-password-page/index.d.ts +1 -0
- package/dist/reset-password-page/index.js +1 -0
- package/dist/sign-up-page/SignUpPage.cjs +97 -0
- package/dist/sign-up-page/SignUpPage.d.cts +133 -0
- package/dist/sign-up-page/SignUpPage.d.ts +133 -0
- package/dist/sign-up-page/SignUpPage.js +97 -0
- package/dist/sign-up-page/index.cjs +1 -0
- package/dist/sign-up-page/index.d.cts +1 -0
- package/dist/sign-up-page/index.d.ts +1 -0
- package/dist/sign-up-page/index.js +1 -0
- package/dist/stat-card/StatCard.cjs +61 -0
- package/dist/stat-card/StatCard.d.cts +90 -0
- package/dist/stat-card/StatCard.d.ts +90 -0
- package/dist/stat-card/StatCard.js +61 -0
- package/dist/stat-card/index.cjs +1 -0
- package/dist/stat-card/index.d.cts +1 -0
- package/dist/stat-card/index.d.ts +1 -0
- package/dist/stat-card/index.js +1 -0
- package/dist/usage-card/UsageCard.cjs +42 -0
- package/dist/usage-card/UsageCard.d.cts +81 -0
- package/dist/usage-card/UsageCard.d.ts +81 -0
- package/dist/usage-card/UsageCard.js +42 -0
- package/dist/usage-card/index.cjs +1 -0
- package/dist/usage-card/index.d.cts +1 -0
- package/dist/usage-card/index.d.ts +1 -0
- package/dist/usage-card/index.js +1 -0
- package/dist/usage-card/usage.cjs +1 -0
- package/dist/usage-card/usage.d.cts +18 -0
- package/dist/usage-card/usage.d.ts +18 -0
- package/dist/usage-card/usage.js +1 -0
- package/dist/user-menu/UserMenu.cjs +30 -0
- package/dist/user-menu/UserMenu.d.cts +84 -0
- package/dist/user-menu/UserMenu.d.ts +84 -0
- package/dist/user-menu/UserMenu.js +30 -0
- package/dist/user-menu/index.cjs +1 -0
- package/dist/user-menu/index.d.cts +1 -0
- package/dist/user-menu/index.d.ts +1 -0
- package/dist/user-menu/index.js +1 -0
- package/dist/verification-page/VerificationPage.cjs +61 -0
- package/dist/verification-page/VerificationPage.d.cts +149 -0
- package/dist/verification-page/VerificationPage.d.ts +149 -0
- package/dist/verification-page/VerificationPage.js +61 -0
- package/dist/verification-page/index.cjs +1 -0
- package/dist/verification-page/index.d.cts +1 -0
- package/dist/verification-page/index.d.ts +1 -0
- package/dist/verification-page/index.js +1 -0
- package/dist/workspace-switcher/WorkspaceSwitcher.cjs +69 -0
- package/dist/workspace-switcher/WorkspaceSwitcher.d.cts +165 -0
- package/dist/workspace-switcher/WorkspaceSwitcher.d.ts +165 -0
- package/dist/workspace-switcher/WorkspaceSwitcher.js +69 -0
- package/dist/workspace-switcher/index.cjs +1 -0
- package/dist/workspace-switcher/index.d.cts +1 -0
- package/dist/workspace-switcher/index.d.ts +1 -0
- package/dist/workspace-switcher/index.js +1 -0
- package/package.json +272 -6
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import '@skdx/web-components/time';
|
|
3
|
+
/**
|
|
4
|
+
* One collaboration comment: author, avatar, timestamp, edited indicator,
|
|
5
|
+
* arbitrary content, attachments and actions such as reply, edit and react.
|
|
6
|
+
*
|
|
7
|
+
* Renders light DOM, so its parts are classes rather than shadow `::part()`
|
|
8
|
+
* targets: `.skdx-comment` on the host, then `__avatar`, `__main`, `__header`,
|
|
9
|
+
* `__author`, `__metadata`, `__time`, `__edited`, `__content`, `__attachments`
|
|
10
|
+
* and `__actions`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```html
|
|
14
|
+
* <skdx-comment
|
|
15
|
+
* author="Priya Shah"
|
|
16
|
+
* timestamp="2026-08-10T09:00:00Z"
|
|
17
|
+
* >
|
|
18
|
+
* <skdx-avatar slot="avatar" name="Priya Shah"></skdx-avatar>
|
|
19
|
+
* Looks good to me.
|
|
20
|
+
* <skdx-button slot="actions">Reply</skdx-button>
|
|
21
|
+
* </skdx-comment>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @slot - The comment content, the consumer-supplied body text or markup.
|
|
25
|
+
* @slot avatar - Decorative avatar rendered beside the author, always `aria-hidden`.
|
|
26
|
+
* @slot metadata - Badges or supplementary text rendered beside the author.
|
|
27
|
+
* @slot attachments - Files or links attached to the comment, below the content.
|
|
28
|
+
* @slot actions - Controls such as reply, edit and react, below the attachments.
|
|
29
|
+
*/
|
|
30
|
+
export declare class SkdxComment extends LitElement {
|
|
31
|
+
/** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
|
|
32
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
33
|
+
/** Name of the person or system that wrote the comment, rendered as visible text. */
|
|
34
|
+
author: string;
|
|
35
|
+
/**
|
|
36
|
+
* Instant the comment was posted, rendered through a composed Time.
|
|
37
|
+
* @default undefined — no time region renders.
|
|
38
|
+
*/
|
|
39
|
+
timestamp?: Date | string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Reference instant `timestamp` renders relative to, forwarded to Time.
|
|
42
|
+
* @default undefined — read once at render, since this block starts no timer.
|
|
43
|
+
*/
|
|
44
|
+
now?: Date | number | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Marks the comment as edited since it was first posted.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
edited: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Text of the edited indicator, shown only when `edited` is set.
|
|
52
|
+
* @default 'Edited'
|
|
53
|
+
*/
|
|
54
|
+
editedLabel: string;
|
|
55
|
+
connectedCallback(): void;
|
|
56
|
+
private region;
|
|
57
|
+
/** Whether the consumer supplied anything for `name` — still true once it has been moved in. */
|
|
58
|
+
private hasSlotted;
|
|
59
|
+
protected updated(): void;
|
|
60
|
+
render(): TemplateResult;
|
|
61
|
+
}
|
|
62
|
+
declare global {
|
|
63
|
+
interface HTMLElementTagNameMap {
|
|
64
|
+
'skdx-comment': SkdxComment;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import '@skdx/web-components/time';
|
|
3
|
+
/**
|
|
4
|
+
* One collaboration comment: author, avatar, timestamp, edited indicator,
|
|
5
|
+
* arbitrary content, attachments and actions such as reply, edit and react.
|
|
6
|
+
*
|
|
7
|
+
* Renders light DOM, so its parts are classes rather than shadow `::part()`
|
|
8
|
+
* targets: `.skdx-comment` on the host, then `__avatar`, `__main`, `__header`,
|
|
9
|
+
* `__author`, `__metadata`, `__time`, `__edited`, `__content`, `__attachments`
|
|
10
|
+
* and `__actions`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```html
|
|
14
|
+
* <skdx-comment
|
|
15
|
+
* author="Priya Shah"
|
|
16
|
+
* timestamp="2026-08-10T09:00:00Z"
|
|
17
|
+
* >
|
|
18
|
+
* <skdx-avatar slot="avatar" name="Priya Shah"></skdx-avatar>
|
|
19
|
+
* Looks good to me.
|
|
20
|
+
* <skdx-button slot="actions">Reply</skdx-button>
|
|
21
|
+
* </skdx-comment>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @slot - The comment content, the consumer-supplied body text or markup.
|
|
25
|
+
* @slot avatar - Decorative avatar rendered beside the author, always `aria-hidden`.
|
|
26
|
+
* @slot metadata - Badges or supplementary text rendered beside the author.
|
|
27
|
+
* @slot attachments - Files or links attached to the comment, below the content.
|
|
28
|
+
* @slot actions - Controls such as reply, edit and react, below the attachments.
|
|
29
|
+
*/
|
|
30
|
+
export declare class SkdxComment extends LitElement {
|
|
31
|
+
/** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
|
|
32
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
33
|
+
/** Name of the person or system that wrote the comment, rendered as visible text. */
|
|
34
|
+
author: string;
|
|
35
|
+
/**
|
|
36
|
+
* Instant the comment was posted, rendered through a composed Time.
|
|
37
|
+
* @default undefined — no time region renders.
|
|
38
|
+
*/
|
|
39
|
+
timestamp?: Date | string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Reference instant `timestamp` renders relative to, forwarded to Time.
|
|
42
|
+
* @default undefined — read once at render, since this block starts no timer.
|
|
43
|
+
*/
|
|
44
|
+
now?: Date | number | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Marks the comment as edited since it was first posted.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
edited: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Text of the edited indicator, shown only when `edited` is set.
|
|
52
|
+
* @default 'Edited'
|
|
53
|
+
*/
|
|
54
|
+
editedLabel: string;
|
|
55
|
+
connectedCallback(): void;
|
|
56
|
+
private region;
|
|
57
|
+
/** Whether the consumer supplied anything for `name` — still true once it has been moved in. */
|
|
58
|
+
private hasSlotted;
|
|
59
|
+
protected updated(): void;
|
|
60
|
+
render(): TemplateResult;
|
|
61
|
+
}
|
|
62
|
+
declare global {
|
|
63
|
+
interface HTMLElementTagNameMap {
|
|
64
|
+
'skdx-comment': SkdxComment;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var h=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=(m,d,e,o)=>{for(var a=o>1?void 0:o?p(d,e):d,c=m.length-1,l;c>=0;c--)(l=m[c])&&(a=(o?l(d,e,a):l(a))||a);return o&&a&&h(d,e,a),a};import{html as i,LitElement as u,nothing as n}from"lit";import{property as r}from"lit/decorators.js";import{customElement as v}from"../internal/define.js";import{placeSlotted as _}from"../internal/slots.js";import"@skdx/web-components/time";var g="data-skdx-comment-generated",t=class extends u{constructor(){super(...arguments);this.edited=!1;this.editedLabel="Edited"}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.setAttribute("role","article"),queueMicrotask(()=>this.requestUpdate())}region(e){return this.querySelector(`.skdx-comment__${e}`)}hasSlotted(e){return this.querySelector(`[slot="${e}"], [data-skdx-slot="${e}"]`)!==null}updated(){_(this,g,{avatar:this.region("avatar"),metadata:this.region("metadata"),attachments:this.region("attachments"),actions:this.region("actions")},this.region("content"))}render(){return i`
|
|
2
|
+
${this.hasSlotted("avatar")?i`<div
|
|
3
|
+
class="skdx-comment__avatar"
|
|
4
|
+
aria-hidden="true"
|
|
5
|
+
data-skdx-comment-generated
|
|
6
|
+
></div>`:n}
|
|
7
|
+
<div
|
|
8
|
+
class="skdx-comment__main"
|
|
9
|
+
data-skdx-comment-generated
|
|
10
|
+
>
|
|
11
|
+
<div class="skdx-comment__header">
|
|
12
|
+
<span class="skdx-comment__author">${this.author??""}</span>
|
|
13
|
+
${this.hasSlotted("metadata")?i`<span class="skdx-comment__metadata"></span>`:n}
|
|
14
|
+
${this.timestamp===void 0?n:i`<skdx-time
|
|
15
|
+
class="skdx-comment__time"
|
|
16
|
+
relative
|
|
17
|
+
.value=${this.timestamp}
|
|
18
|
+
.now=${this.now}
|
|
19
|
+
></skdx-time>`}
|
|
20
|
+
${this.edited?i`<span class="skdx-comment__edited">${this.editedLabel}</span>`:n}
|
|
21
|
+
</div>
|
|
22
|
+
<div class="skdx-comment__content"></div>
|
|
23
|
+
${this.hasSlotted("attachments")?i`<div class="skdx-comment__attachments"></div>`:n}
|
|
24
|
+
${this.hasSlotted("actions")?i`<div class="skdx-comment__actions"></div>`:n}
|
|
25
|
+
</div>
|
|
26
|
+
`}};s([r({type:String})],t.prototype,"author",2),s([r({type:String})],t.prototype,"timestamp",2),s([r({attribute:!1})],t.prototype,"now",2),s([r({type:Boolean})],t.prototype,"edited",2),s([r({type:String,attribute:"edited-label"})],t.prototype,"editedLabel",2),t=s([v("skdx-comment","comment","root")],t);export{t as SkdxComment};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var p=(o,m)=>{for(var r in m)t(o,r,{get:m[r],enumerable:!0})},C=(o,m,r,x)=>{if(m&&typeof m=="object"||typeof m=="function")for(let e of k(m))!n.call(o,e)&&e!==r&&t(o,e,{get:()=>m[e],enumerable:!(x=f(m,e))||x.enumerable});return o};var S=o=>C(t({},"__esModule",{value:!0}),o);var a={};p(a,{SkdxComment:()=>d.SkdxComment});module.exports=S(a);var d=require("./Comment.cjs");0&&(module.exports={SkdxComment});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkdxComment } from './Comment.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkdxComment } from './Comment.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SkdxComment as e}from"./Comment.js";export{e as SkdxComment};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var E=(t,o)=>{for(var e in o)i(t,e,{get:o[e],enumerable:!0})},k=(t,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of b(o))!v.call(t,s)&&s!==e&&i(t,s,{get:()=>o[s],enumerable:!(a=m(o,s))||a.enumerable});return t};var f=t=>k(i({},"__esModule",{value:!0}),t),l=(t,o,e,a)=>{for(var s=a>1?void 0:a?m(o,e):o,p=t.length-1,c;p>=0;p--)(c=t[p])&&(s=(a?c(o,e,s):c(s))||s);return a&&s&&i(o,e,s),s};var L={};E(L,{SkdxCommentThread:()=>d});module.exports=f(L);var n=require("lit"),r=require("lit/decorators.js"),u=require("../internal/define.cjs"),g=require("../internal/events.cjs"),x=require("../internal/slots.cjs"),y=require("@skdx/web-components/collapsible"),M=require("@skdx/web-components/primitives/collapsible");var R="data-skdx-comment-thread-generated",h={fromAttribute:t=>t!=="false"};function _(t){t.stopPropagation()}var d=class extends n.LitElement{constructor(){super(...arguments);this.defaultExpanded=!0;this.handleOpenChange=e=>{e.stopPropagation();let a=e.detail;this.uncontrolledExpanded=a,this.requestUpdate(),(0,g.emit)(this,"expanded-change",{expanded:a})}}createRenderRoot(){return this}get isExpanded(){return this.expanded??this.uncontrolledExpanded??this.defaultExpanded}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this.requestUpdate())}region(e){return this.querySelector(`.skdx-comment-thread__${e}`)}hasSlotted(e){return this.querySelector(`[slot="${e}"], [data-skdx-slot="${e}"]`)!==null}updated(){let e=this.isExpanded;this.setAttribute("data-state",e?"expanded":"collapsed");let a=this.querySelector(":scope > skdx-collapsible");a&&(a.open=e),(0,x.placeSlotted)(this,R,{replies:this.region("replies"),"load-more":this.region("load-more"),composer:this.region("composer")},this.region("comment"))}repliesRegion(){if(!this.showRepliesLabel)return n.html`<div
|
|
2
|
+
class="skdx-comment-thread__replies"
|
|
3
|
+
data-skdx-comment-thread-generated
|
|
4
|
+
></div>`;let e=this.isExpanded?this.hideRepliesLabel??this.showRepliesLabel:this.showRepliesLabel;return n.html`<skdx-collapsible
|
|
5
|
+
data-skdx-comment-thread-generated
|
|
6
|
+
@open-change=${this.handleOpenChange}
|
|
7
|
+
@open-change-complete=${_}
|
|
8
|
+
>
|
|
9
|
+
<skdx-collapsible-trigger class="skdx-comment-thread__toggle"
|
|
10
|
+
><span>${e}</span></skdx-collapsible-trigger
|
|
11
|
+
>
|
|
12
|
+
<skdx-collapsible-content class="skdx-comment-thread__replies"></skdx-collapsible-content>
|
|
13
|
+
</skdx-collapsible>`}render(){return n.html`
|
|
14
|
+
<div
|
|
15
|
+
class="skdx-comment-thread__comment"
|
|
16
|
+
data-skdx-comment-thread-generated
|
|
17
|
+
></div>
|
|
18
|
+
${this.hasSlotted("replies")?this.repliesRegion():n.nothing}
|
|
19
|
+
${this.hasSlotted("load-more")?n.html`<div
|
|
20
|
+
class="skdx-comment-thread__load-more"
|
|
21
|
+
data-skdx-comment-thread-generated
|
|
22
|
+
></div>`:n.nothing}
|
|
23
|
+
${this.hasSlotted("composer")?n.html`<div
|
|
24
|
+
class="skdx-comment-thread__composer"
|
|
25
|
+
data-skdx-comment-thread-generated
|
|
26
|
+
></div>`:n.nothing}
|
|
27
|
+
`}};l([(0,r.property)({converter:h})],d.prototype,"expanded",2),l([(0,r.property)({converter:h,attribute:"default-expanded"})],d.prototype,"defaultExpanded",2),l([(0,r.property)({type:String,attribute:"show-replies-label"})],d.prototype,"showRepliesLabel",2),l([(0,r.property)({type:String,attribute:"hide-replies-label"})],d.prototype,"hideRepliesLabel",2),d=l([(0,u.customElement)("skdx-comment-thread","comment-thread","root")],d);0&&(module.exports={SkdxCommentThread});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import '@skdx/web-components/collapsible';
|
|
3
|
+
import '@skdx/web-components/primitives/collapsible';
|
|
4
|
+
/**
|
|
5
|
+
* A root comment with its replies, indented one level, collapsible with the
|
|
6
|
+
* consumer's own labels, plus regions for a load-more control and a composer.
|
|
7
|
+
*
|
|
8
|
+
* Renders light DOM, so its parts are classes rather than shadow `::part()`
|
|
9
|
+
* targets: `.skdx-comment-thread` on the host, then `__comment`, `__toggle`,
|
|
10
|
+
* `__replies`, `__load-more` and `__composer`. `data-state` on the host reads
|
|
11
|
+
* `expanded` or `collapsed`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <skdx-comment-thread show-replies-label="Show 1 reply" hide-replies-label="Hide replies">
|
|
16
|
+
* <skdx-comment author="Priya Shah">Looks good to me.</skdx-comment>
|
|
17
|
+
* <skdx-comment slot="replies" author="Alex">Agreed.</skdx-comment>
|
|
18
|
+
* </skdx-comment-thread>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @slot - The root comment this thread replies to.
|
|
22
|
+
* @slot replies - The reply comments, indented one level below the root comment.
|
|
23
|
+
* @slot load-more - Control that requests more replies, below the replies region.
|
|
24
|
+
* @slot composer - Reply composer rendered at the end of the thread.
|
|
25
|
+
* @fires expanded-change - Fires with the new expanded state whenever the replies toggle is activated.
|
|
26
|
+
*/
|
|
27
|
+
export declare class SkdxCommentThread extends LitElement {
|
|
28
|
+
/** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
|
|
29
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the replies are shown, for controlled usage paired with `expanded-change`.
|
|
32
|
+
* @default undefined — uncontrolled, following `defaultExpanded`.
|
|
33
|
+
*/
|
|
34
|
+
expanded?: boolean | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the replies start shown, used only while uncontrolled.
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
defaultExpanded: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Text of the toggle button while the replies are hidden; a toggle only renders when this is given.
|
|
42
|
+
* @default undefined — no toggle renders and the replies are always shown.
|
|
43
|
+
*/
|
|
44
|
+
showRepliesLabel?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Text of the toggle button while the replies are shown.
|
|
47
|
+
* @default undefined — falls back to the value of `showRepliesLabel`.
|
|
48
|
+
*/
|
|
49
|
+
hideRepliesLabel?: string | undefined;
|
|
50
|
+
/** What the toggle last chose; outranked by `expanded` whenever the consumer controls the state. */
|
|
51
|
+
private uncontrolledExpanded?;
|
|
52
|
+
/** Whether the replies are shown right now, controlled or not. */
|
|
53
|
+
private get isExpanded();
|
|
54
|
+
connectedCallback(): void;
|
|
55
|
+
private region;
|
|
56
|
+
/** Whether the consumer supplied anything for `name` — still true once it has been moved in. */
|
|
57
|
+
private hasSlotted;
|
|
58
|
+
private readonly handleOpenChange;
|
|
59
|
+
protected updated(): void;
|
|
60
|
+
private repliesRegion;
|
|
61
|
+
render(): TemplateResult;
|
|
62
|
+
}
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
'skdx-comment-thread': SkdxCommentThread;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import '@skdx/web-components/collapsible';
|
|
3
|
+
import '@skdx/web-components/primitives/collapsible';
|
|
4
|
+
/**
|
|
5
|
+
* A root comment with its replies, indented one level, collapsible with the
|
|
6
|
+
* consumer's own labels, plus regions for a load-more control and a composer.
|
|
7
|
+
*
|
|
8
|
+
* Renders light DOM, so its parts are classes rather than shadow `::part()`
|
|
9
|
+
* targets: `.skdx-comment-thread` on the host, then `__comment`, `__toggle`,
|
|
10
|
+
* `__replies`, `__load-more` and `__composer`. `data-state` on the host reads
|
|
11
|
+
* `expanded` or `collapsed`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <skdx-comment-thread show-replies-label="Show 1 reply" hide-replies-label="Hide replies">
|
|
16
|
+
* <skdx-comment author="Priya Shah">Looks good to me.</skdx-comment>
|
|
17
|
+
* <skdx-comment slot="replies" author="Alex">Agreed.</skdx-comment>
|
|
18
|
+
* </skdx-comment-thread>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @slot - The root comment this thread replies to.
|
|
22
|
+
* @slot replies - The reply comments, indented one level below the root comment.
|
|
23
|
+
* @slot load-more - Control that requests more replies, below the replies region.
|
|
24
|
+
* @slot composer - Reply composer rendered at the end of the thread.
|
|
25
|
+
* @fires expanded-change - Fires with the new expanded state whenever the replies toggle is activated.
|
|
26
|
+
*/
|
|
27
|
+
export declare class SkdxCommentThread extends LitElement {
|
|
28
|
+
/** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
|
|
29
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the replies are shown, for controlled usage paired with `expanded-change`.
|
|
32
|
+
* @default undefined — uncontrolled, following `defaultExpanded`.
|
|
33
|
+
*/
|
|
34
|
+
expanded?: boolean | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the replies start shown, used only while uncontrolled.
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
defaultExpanded: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Text of the toggle button while the replies are hidden; a toggle only renders when this is given.
|
|
42
|
+
* @default undefined — no toggle renders and the replies are always shown.
|
|
43
|
+
*/
|
|
44
|
+
showRepliesLabel?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Text of the toggle button while the replies are shown.
|
|
47
|
+
* @default undefined — falls back to the value of `showRepliesLabel`.
|
|
48
|
+
*/
|
|
49
|
+
hideRepliesLabel?: string | undefined;
|
|
50
|
+
/** What the toggle last chose; outranked by `expanded` whenever the consumer controls the state. */
|
|
51
|
+
private uncontrolledExpanded?;
|
|
52
|
+
/** Whether the replies are shown right now, controlled or not. */
|
|
53
|
+
private get isExpanded();
|
|
54
|
+
connectedCallback(): void;
|
|
55
|
+
private region;
|
|
56
|
+
/** Whether the consumer supplied anything for `name` — still true once it has been moved in. */
|
|
57
|
+
private hasSlotted;
|
|
58
|
+
private readonly handleOpenChange;
|
|
59
|
+
protected updated(): void;
|
|
60
|
+
private repliesRegion;
|
|
61
|
+
render(): TemplateResult;
|
|
62
|
+
}
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
'skdx-comment-thread': SkdxCommentThread;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var h=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var n=(a,d,e,t)=>{for(var s=t>1?void 0:t?u(d,e):d,i=a.length-1,p;i>=0;i--)(p=a[i])&&(s=(t?p(d,e,s):p(s))||s);return t&&s&&h(d,e,s),s};import{html as l,LitElement as g,nothing as c}from"lit";import{property as r}from"lit/decorators.js";import{customElement as x}from"../internal/define.js";import{emit as b}from"../internal/events.js";import{placeSlotted as v}from"../internal/slots.js";import"@skdx/web-components/collapsible";import"@skdx/web-components/primitives/collapsible";var E="data-skdx-comment-thread-generated",m={fromAttribute:a=>a!=="false"};function k(a){a.stopPropagation()}var o=class extends g{constructor(){super(...arguments);this.defaultExpanded=!0;this.handleOpenChange=e=>{e.stopPropagation();let t=e.detail;this.uncontrolledExpanded=t,this.requestUpdate(),b(this,"expanded-change",{expanded:t})}}createRenderRoot(){return this}get isExpanded(){return this.expanded??this.uncontrolledExpanded??this.defaultExpanded}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this.requestUpdate())}region(e){return this.querySelector(`.skdx-comment-thread__${e}`)}hasSlotted(e){return this.querySelector(`[slot="${e}"], [data-skdx-slot="${e}"]`)!==null}updated(){let e=this.isExpanded;this.setAttribute("data-state",e?"expanded":"collapsed");let t=this.querySelector(":scope > skdx-collapsible");t&&(t.open=e),v(this,E,{replies:this.region("replies"),"load-more":this.region("load-more"),composer:this.region("composer")},this.region("comment"))}repliesRegion(){if(!this.showRepliesLabel)return l`<div
|
|
2
|
+
class="skdx-comment-thread__replies"
|
|
3
|
+
data-skdx-comment-thread-generated
|
|
4
|
+
></div>`;let e=this.isExpanded?this.hideRepliesLabel??this.showRepliesLabel:this.showRepliesLabel;return l`<skdx-collapsible
|
|
5
|
+
data-skdx-comment-thread-generated
|
|
6
|
+
@open-change=${this.handleOpenChange}
|
|
7
|
+
@open-change-complete=${k}
|
|
8
|
+
>
|
|
9
|
+
<skdx-collapsible-trigger class="skdx-comment-thread__toggle"
|
|
10
|
+
><span>${e}</span></skdx-collapsible-trigger
|
|
11
|
+
>
|
|
12
|
+
<skdx-collapsible-content class="skdx-comment-thread__replies"></skdx-collapsible-content>
|
|
13
|
+
</skdx-collapsible>`}render(){return l`
|
|
14
|
+
<div
|
|
15
|
+
class="skdx-comment-thread__comment"
|
|
16
|
+
data-skdx-comment-thread-generated
|
|
17
|
+
></div>
|
|
18
|
+
${this.hasSlotted("replies")?this.repliesRegion():c}
|
|
19
|
+
${this.hasSlotted("load-more")?l`<div
|
|
20
|
+
class="skdx-comment-thread__load-more"
|
|
21
|
+
data-skdx-comment-thread-generated
|
|
22
|
+
></div>`:c}
|
|
23
|
+
${this.hasSlotted("composer")?l`<div
|
|
24
|
+
class="skdx-comment-thread__composer"
|
|
25
|
+
data-skdx-comment-thread-generated
|
|
26
|
+
></div>`:c}
|
|
27
|
+
`}};n([r({converter:m})],o.prototype,"expanded",2),n([r({converter:m,attribute:"default-expanded"})],o.prototype,"defaultExpanded",2),n([r({type:String,attribute:"show-replies-label"})],o.prototype,"showRepliesLabel",2),n([r({type:String,attribute:"hide-replies-label"})],o.prototype,"hideRepliesLabel",2),o=n([x("skdx-comment-thread","comment-thread","root")],o);export{o as SkdxCommentThread};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var k=(m,e)=>{for(var r in e)d(m,r,{get:e[r],enumerable:!0})},n=(m,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of f(e))!h.call(m,o)&&o!==r&&d(m,o,{get:()=>e[o],enumerable:!(t=a(e,o))||t.enumerable});return m};var p=m=>n(d({},"__esModule",{value:!0}),m);var C={};k(C,{SkdxCommentThread:()=>x.SkdxCommentThread});module.exports=p(C);var x=require("./CommentThread.cjs");0&&(module.exports={SkdxCommentThread});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkdxCommentThread } from './CommentThread.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkdxCommentThread } from './CommentThread.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SkdxCommentThread as o}from"./CommentThread.js";export{o as SkdxCommentThread};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var y=(i,e)=>{for(var r in e)n(i,r,{get:e[r],enumerable:!0})},k=(i,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of f(e))!b.call(i,d)&&d!==r&&n(i,d,{get:()=>e[d],enumerable:!(l=u(e,d))||l.enumerable});return i};var v=i=>k(n({},"__esModule",{value:!0}),i),s=(i,e,r,l)=>{for(var d=l>1?void 0:l?u(e,r):e,g=i.length-1,p;g>=0;g--)(p=i[g])&&(d=(l?p(e,r,d):p(d))||d);return l&&d&&n(e,r,d),d};var $={};y($,{SkdxConfirmDialog:()=>t});module.exports=v($);var o=require("lit"),a=require("lit/decorators.js"),m=require("../internal/define.cjs"),c=require("../internal/slots.cjs"),T=require("@skdx/web-components/primitives/dialog");var h="data-skdx-confirm-dialog-generated",x={fromAttribute:i=>i!=="false"},t=class extends o.LitElement{constructor(){super(...arguments);this.defaultOpen=!1;this.confirmLabel="Confirm";this.cancelLabel="Cancel";this.destructive=!1;this.pending=!1;this.disabled=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this.requestUpdate())}region(r){return this.querySelector(`.skdx-confirm-dialog__${r}`)}get hasTrigger(){return this.querySelector('[slot="trigger"], [data-skdx-slot="trigger"]')!==null}get hasBody(){return(0,c.hasUnslottedChild)(this,h)||(this.region("body")?.hasChildNodes()??!1)}updated(){(0,c.placeSlotted)(this,h,{trigger:this.querySelector("skdx-dialog-trigger")},this.region("body"))}render(){return o.html`
|
|
2
|
+
<skdx-dialog-root
|
|
3
|
+
role="alertdialog"
|
|
4
|
+
data-skdx-confirm-dialog-generated
|
|
5
|
+
.open=${this.open}
|
|
6
|
+
?default-open=${this.defaultOpen}
|
|
7
|
+
dismiss=${this.pending?"none":"escape"}
|
|
8
|
+
>
|
|
9
|
+
${this.hasTrigger?o.html`<skdx-dialog-trigger></skdx-dialog-trigger>`:o.nothing}
|
|
10
|
+
<skdx-dialog-overlay></skdx-dialog-overlay>
|
|
11
|
+
<skdx-dialog-content
|
|
12
|
+
.size=${this.size}
|
|
13
|
+
.status=${this.destructive?"danger":void 0}
|
|
14
|
+
>
|
|
15
|
+
<skdx-dialog-title class="skdx-confirm-dialog__title"
|
|
16
|
+
>${this.title??""}</skdx-dialog-title
|
|
17
|
+
>
|
|
18
|
+
${this.description?o.html`<skdx-dialog-description class="skdx-confirm-dialog__description"
|
|
19
|
+
>${this.description}</skdx-dialog-description
|
|
20
|
+
>`:o.nothing}
|
|
21
|
+
${this.hasBody?o.html`<div class="skdx-confirm-dialog__body"></div>`:o.nothing}
|
|
22
|
+
<div class="skdx-confirm-dialog__footer">
|
|
23
|
+
<skdx-dialog-cancel
|
|
24
|
+
class="skdx-confirm-dialog__cancel"
|
|
25
|
+
?disabled=${this.pending}
|
|
26
|
+
>${this.cancelLabel}</skdx-dialog-cancel
|
|
27
|
+
>
|
|
28
|
+
<skdx-dialog-action
|
|
29
|
+
class="skdx-confirm-dialog__confirm"
|
|
30
|
+
data-status=${this.destructive?"danger":o.nothing}
|
|
31
|
+
?data-loading=${this.pending}
|
|
32
|
+
?disabled=${this.pending||this.disabled}
|
|
33
|
+
>${this.confirmLabel}</skdx-dialog-action
|
|
34
|
+
>
|
|
35
|
+
</div>
|
|
36
|
+
</skdx-dialog-content>
|
|
37
|
+
</skdx-dialog-root>
|
|
38
|
+
`}};s([(0,a.property)({converter:x})],t.prototype,"open",2),s([(0,a.property)({type:Boolean,attribute:"default-open"})],t.prototype,"defaultOpen",2),s([(0,a.property)({type:String})],t.prototype,"title",2),s([(0,a.property)({type:String})],t.prototype,"description",2),s([(0,a.property)({type:String,attribute:"confirm-label"})],t.prototype,"confirmLabel",2),s([(0,a.property)({type:String,attribute:"cancel-label"})],t.prototype,"cancelLabel",2),s([(0,a.property)({type:Boolean})],t.prototype,"destructive",2),s([(0,a.property)({type:Boolean})],t.prototype,"pending",2),s([(0,a.property)({type:Boolean})],t.prototype,"disabled",2),s([(0,a.property)({type:String})],t.prototype,"size",2),t=s([(0,m.customElement)("skdx-confirm-dialog","confirm-dialog","root")],t);0&&(module.exports={SkdxConfirmDialog});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import '@skdx/web-components/primitives/dialog';
|
|
3
|
+
/**
|
|
4
|
+
* Confirmation dialog block for a destructive, irreversible or sensitive
|
|
5
|
+
* action, composing the core dialog primitives as an alert dialog with an
|
|
6
|
+
* externally controlled pending state that disables both buttons and blocks
|
|
7
|
+
* dismissal while the confirmed request is in flight.
|
|
8
|
+
*
|
|
9
|
+
* A synchronous confirmation with no pending state is served by the core
|
|
10
|
+
* `<skdx-dialog role="alertdialog">` recipe alone.
|
|
11
|
+
*
|
|
12
|
+
* Renders light DOM, so its parts are classes rather than shadow `::part()`
|
|
13
|
+
* targets: `.skdx-confirm-dialog` on the host, then `__title`,
|
|
14
|
+
* `__description`, `__body`, `__footer`, `__cancel` and `__confirm`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```html
|
|
18
|
+
* <skdx-confirm-dialog
|
|
19
|
+
* title="Delete this project?"
|
|
20
|
+
* description="This cannot be undone."
|
|
21
|
+
* destructive
|
|
22
|
+
* >
|
|
23
|
+
* <span slot="trigger">Delete project</span>
|
|
24
|
+
* </skdx-confirm-dialog>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @slot - Extra content rendered between the description and the footer buttons.
|
|
28
|
+
* @slot trigger - Content of the button that opens the dialog; no trigger renders without it.
|
|
29
|
+
* @fires open-change - Fires with the new open state whenever the dialog opens or closes, controlled or not.
|
|
30
|
+
* @fires open-change-complete - Fires with the new open state once the panel's enter or exit animation has settled.
|
|
31
|
+
* @fires confirm - Fires with the click when the confirm button is activated, before the dialog closes; `preventDefault()` holds the panel open.
|
|
32
|
+
* @fires cancel - Fires with the click when the cancel button is activated, before the dialog closes; `preventDefault()` keeps the panel open.
|
|
33
|
+
* @fires escape-key-down - Fires when Escape is pressed while the panel is open; `preventDefault()` keeps it open.
|
|
34
|
+
* @fires pointer-down-outside - Fires on a pointer-down outside the panel while open; an alert dialog never closes on one.
|
|
35
|
+
* @fires focus-outside - Fires when focus moves outside the panel while open; an alert dialog never closes on one.
|
|
36
|
+
* @fires interact-outside - Fires for either kind of outside interaction, just before the specific event.
|
|
37
|
+
* @fires open-auto-focus - Fires before focus moves into the panel on open; `preventDefault()` leaves focus where it is.
|
|
38
|
+
* @fires close-auto-focus - Fires before focus returns to the trigger on close; `preventDefault()` suppresses that return.
|
|
39
|
+
*/
|
|
40
|
+
export declare class SkdxConfirmDialog extends LitElement {
|
|
41
|
+
/** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
|
|
42
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the dialog is open, for controlled usage; pair it with `open-change`.
|
|
45
|
+
* @default undefined — uncontrolled, following `defaultOpen`.
|
|
46
|
+
*/
|
|
47
|
+
open?: boolean | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the dialog starts open, for uncontrolled usage.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
defaultOpen: boolean;
|
|
53
|
+
/** Heading text rendered into the panel's title, naming and labelling the dialog. */
|
|
54
|
+
title: string;
|
|
55
|
+
/**
|
|
56
|
+
* Supporting sentence rendered into the panel's description, read alongside the title.
|
|
57
|
+
* @default undefined — no description region renders.
|
|
58
|
+
*/
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Text of the button that carries out the confirmed action.
|
|
62
|
+
* @default 'Confirm'
|
|
63
|
+
*/
|
|
64
|
+
confirmLabel: string;
|
|
65
|
+
/**
|
|
66
|
+
* Text of the button that abandons the action.
|
|
67
|
+
* @default 'Cancel'
|
|
68
|
+
*/
|
|
69
|
+
cancelLabel: string;
|
|
70
|
+
/**
|
|
71
|
+
* Colours the confirm button and the panel danger, for an irreversible or destructive action.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
destructive: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Marks the confirmed request as in flight: disables both buttons, marks the confirm button loading, and blocks Escape dismissal until it clears.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
pending: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Disables the confirm button on its own, independent of `pending` — for example until a typed confirmation matches.
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
disabled: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Panel width rung the skin reads, fed to the underlying dialog panel.
|
|
87
|
+
* @default undefined — the skin's own default width.
|
|
88
|
+
*/
|
|
89
|
+
size?: 'sm' | 'md' | 'lg' | (string & {}) | undefined;
|
|
90
|
+
connectedCallback(): void;
|
|
91
|
+
private region;
|
|
92
|
+
private get hasTrigger();
|
|
93
|
+
private get hasBody();
|
|
94
|
+
protected updated(): void;
|
|
95
|
+
render(): TemplateResult;
|
|
96
|
+
}
|
|
97
|
+
declare global {
|
|
98
|
+
interface HTMLElementTagNameMap {
|
|
99
|
+
'skdx-confirm-dialog': SkdxConfirmDialog;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import '@skdx/web-components/primitives/dialog';
|
|
3
|
+
/**
|
|
4
|
+
* Confirmation dialog block for a destructive, irreversible or sensitive
|
|
5
|
+
* action, composing the core dialog primitives as an alert dialog with an
|
|
6
|
+
* externally controlled pending state that disables both buttons and blocks
|
|
7
|
+
* dismissal while the confirmed request is in flight.
|
|
8
|
+
*
|
|
9
|
+
* A synchronous confirmation with no pending state is served by the core
|
|
10
|
+
* `<skdx-dialog role="alertdialog">` recipe alone.
|
|
11
|
+
*
|
|
12
|
+
* Renders light DOM, so its parts are classes rather than shadow `::part()`
|
|
13
|
+
* targets: `.skdx-confirm-dialog` on the host, then `__title`,
|
|
14
|
+
* `__description`, `__body`, `__footer`, `__cancel` and `__confirm`.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```html
|
|
18
|
+
* <skdx-confirm-dialog
|
|
19
|
+
* title="Delete this project?"
|
|
20
|
+
* description="This cannot be undone."
|
|
21
|
+
* destructive
|
|
22
|
+
* >
|
|
23
|
+
* <span slot="trigger">Delete project</span>
|
|
24
|
+
* </skdx-confirm-dialog>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @slot - Extra content rendered between the description and the footer buttons.
|
|
28
|
+
* @slot trigger - Content of the button that opens the dialog; no trigger renders without it.
|
|
29
|
+
* @fires open-change - Fires with the new open state whenever the dialog opens or closes, controlled or not.
|
|
30
|
+
* @fires open-change-complete - Fires with the new open state once the panel's enter or exit animation has settled.
|
|
31
|
+
* @fires confirm - Fires with the click when the confirm button is activated, before the dialog closes; `preventDefault()` holds the panel open.
|
|
32
|
+
* @fires cancel - Fires with the click when the cancel button is activated, before the dialog closes; `preventDefault()` keeps the panel open.
|
|
33
|
+
* @fires escape-key-down - Fires when Escape is pressed while the panel is open; `preventDefault()` keeps it open.
|
|
34
|
+
* @fires pointer-down-outside - Fires on a pointer-down outside the panel while open; an alert dialog never closes on one.
|
|
35
|
+
* @fires focus-outside - Fires when focus moves outside the panel while open; an alert dialog never closes on one.
|
|
36
|
+
* @fires interact-outside - Fires for either kind of outside interaction, just before the specific event.
|
|
37
|
+
* @fires open-auto-focus - Fires before focus moves into the panel on open; `preventDefault()` leaves focus where it is.
|
|
38
|
+
* @fires close-auto-focus - Fires before focus returns to the trigger on close; `preventDefault()` suppresses that return.
|
|
39
|
+
*/
|
|
40
|
+
export declare class SkdxConfirmDialog extends LitElement {
|
|
41
|
+
/** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
|
|
42
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the dialog is open, for controlled usage; pair it with `open-change`.
|
|
45
|
+
* @default undefined — uncontrolled, following `defaultOpen`.
|
|
46
|
+
*/
|
|
47
|
+
open?: boolean | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the dialog starts open, for uncontrolled usage.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
defaultOpen: boolean;
|
|
53
|
+
/** Heading text rendered into the panel's title, naming and labelling the dialog. */
|
|
54
|
+
title: string;
|
|
55
|
+
/**
|
|
56
|
+
* Supporting sentence rendered into the panel's description, read alongside the title.
|
|
57
|
+
* @default undefined — no description region renders.
|
|
58
|
+
*/
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Text of the button that carries out the confirmed action.
|
|
62
|
+
* @default 'Confirm'
|
|
63
|
+
*/
|
|
64
|
+
confirmLabel: string;
|
|
65
|
+
/**
|
|
66
|
+
* Text of the button that abandons the action.
|
|
67
|
+
* @default 'Cancel'
|
|
68
|
+
*/
|
|
69
|
+
cancelLabel: string;
|
|
70
|
+
/**
|
|
71
|
+
* Colours the confirm button and the panel danger, for an irreversible or destructive action.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
destructive: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Marks the confirmed request as in flight: disables both buttons, marks the confirm button loading, and blocks Escape dismissal until it clears.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
pending: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Disables the confirm button on its own, independent of `pending` — for example until a typed confirmation matches.
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
disabled: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Panel width rung the skin reads, fed to the underlying dialog panel.
|
|
87
|
+
* @default undefined — the skin's own default width.
|
|
88
|
+
*/
|
|
89
|
+
size?: 'sm' | 'md' | 'lg' | (string & {}) | undefined;
|
|
90
|
+
connectedCallback(): void;
|
|
91
|
+
private region;
|
|
92
|
+
private get hasTrigger();
|
|
93
|
+
private get hasBody();
|
|
94
|
+
protected updated(): void;
|
|
95
|
+
render(): TemplateResult;
|
|
96
|
+
}
|
|
97
|
+
declare global {
|
|
98
|
+
interface HTMLElementTagNameMap {
|
|
99
|
+
'skdx-confirm-dialog': SkdxConfirmDialog;
|
|
100
|
+
}
|
|
101
|
+
}
|