@skdx/web-components-blocks 0.34.0 → 0.35.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 +5067 -285
- 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/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 +63 -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 +63 -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,147 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import '@skdx/web-components/button';
|
|
3
|
+
import '@skdx/web-components/heading';
|
|
4
|
+
import '@skdx/web-components/skeleton';
|
|
5
|
+
import '@skdx/web-components/time';
|
|
6
|
+
import '../empty-state/index.js';
|
|
7
|
+
/** One entry of a `<skdx-notification-center>` list — a single notification. */
|
|
8
|
+
export interface SkdxNotificationCenterItem {
|
|
9
|
+
/** Identifier carried back in every event detail, naming which notification was acted on. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Headline text rendered as the notification's title. */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Supporting copy rendered below the title. @default undefined — no description renders for this item. */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Instant the notification occurred, rendered into a derived Time. @default undefined — no timestamp renders for this item. */
|
|
16
|
+
timestamp?: Date | string;
|
|
17
|
+
/** Whether the notification has been read, driving `data-read` and the toggle label. @default false */
|
|
18
|
+
read?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** What a `select` event carries: the notification whose body was activated. */
|
|
21
|
+
export interface SkdxNotificationCenterSelectDetail {
|
|
22
|
+
/** The notification the user activated. */
|
|
23
|
+
item: SkdxNotificationCenterItem;
|
|
24
|
+
}
|
|
25
|
+
/** What a `read-change` event carries: the notification and the read state it is moving to. */
|
|
26
|
+
export interface SkdxNotificationCenterReadChangeDetail {
|
|
27
|
+
/** The notification whose toggle was activated. */
|
|
28
|
+
item: SkdxNotificationCenterItem;
|
|
29
|
+
/** The read state the notification is moving to, the opposite of the one it holds. */
|
|
30
|
+
read: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Notification list block: read/unread state, timestamps, a leading visual and
|
|
34
|
+
* per-item and mark-all-read actions, rendered as panel content for a Popover,
|
|
35
|
+
* Drawer, Dialog or page — the block owns no overlay of its own.
|
|
36
|
+
*
|
|
37
|
+
* Renders light DOM, so its parts are classes rather than shadow `::part()`
|
|
38
|
+
* targets: `.skdx-notification-center` on the host, then `__header`,
|
|
39
|
+
* `__title`, `__actions`, `__mark-all-read`, `__loading`, `__empty`, `__list`,
|
|
40
|
+
* `__item`, `__leading`, `__body`, `__item-title`, `__description`, `__time`,
|
|
41
|
+
* `__item-actions` and `__read-toggle`. `data-read` sits on an item that has
|
|
42
|
+
* been read.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```html
|
|
46
|
+
* <skdx-notification-center id="inbox"></skdx-notification-center>
|
|
47
|
+
* <script>
|
|
48
|
+
* const inbox = document.getElementById('inbox');
|
|
49
|
+
* inbox.notifications = [{ id: 'a', title: 'Build finished' }];
|
|
50
|
+
* inbox.addEventListener('select', (event) => open(event.detail.item));
|
|
51
|
+
* </script>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @slot actions - Header controls rendered beside the mark-all-read button.
|
|
55
|
+
* @fires select - Fires with `{ item }` when a notification body is activated; the body is a button only while a `select` listener is bound on this element.
|
|
56
|
+
* @fires read-change - Fires with `{ item, read }` when a per-item toggle is activated; no toggle renders until a `read-change` listener is bound on this element.
|
|
57
|
+
* @fires mark-all-read - Fires when the mark-all-read button is activated; no such button renders until a `mark-all-read` listener is bound on this element.
|
|
58
|
+
*/
|
|
59
|
+
export declare class SkdxNotificationCenter extends LitElement {
|
|
60
|
+
/** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
|
|
61
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
62
|
+
/** The notifications to list, in render order, each with an id, a title and read state. */
|
|
63
|
+
notifications: readonly SkdxNotificationCenterItem[];
|
|
64
|
+
/**
|
|
65
|
+
* Heading text, rendered into a derived Heading that names the section.
|
|
66
|
+
* @default 'Notifications'
|
|
67
|
+
*/
|
|
68
|
+
title: string;
|
|
69
|
+
/**
|
|
70
|
+
* Outline level of the derived title heading, lowered or raised to fit the surrounding outline.
|
|
71
|
+
* @default 2
|
|
72
|
+
*/
|
|
73
|
+
headingLevel: 1 | 2 | 3 | 4 | 5 | 6;
|
|
74
|
+
/**
|
|
75
|
+
* Text of the mark-all-read button, which renders only while the event is listened for.
|
|
76
|
+
* @default 'Mark all as read'
|
|
77
|
+
*/
|
|
78
|
+
markAllReadLabel: string;
|
|
79
|
+
/**
|
|
80
|
+
* Text of a per-item toggle while its notification is unread.
|
|
81
|
+
* @default 'Mark as read'
|
|
82
|
+
*/
|
|
83
|
+
markReadLabel: string;
|
|
84
|
+
/**
|
|
85
|
+
* Text of a per-item toggle while its notification is read.
|
|
86
|
+
* @default 'Mark as unread'
|
|
87
|
+
*/
|
|
88
|
+
markUnreadLabel: string;
|
|
89
|
+
/**
|
|
90
|
+
* Heading text of the derived EmptyState shown when there is nothing to list.
|
|
91
|
+
* @default 'No notifications'
|
|
92
|
+
*/
|
|
93
|
+
emptyTitle: string;
|
|
94
|
+
/**
|
|
95
|
+
* Supporting copy of the derived EmptyState shown when there is nothing to list.
|
|
96
|
+
* @default undefined — the empty state renders its heading alone.
|
|
97
|
+
*/
|
|
98
|
+
emptyDescription?: string | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Swaps the list for a skeleton placeholder region while the notifications load.
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
loading: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Reference instant every item timestamp measures its relative label from.
|
|
106
|
+
* @default undefined — each Time reads the instant once at render.
|
|
107
|
+
*/
|
|
108
|
+
now?: Date | number | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Renders a decorative avatar or icon beside one notification, always `aria-hidden`.
|
|
111
|
+
* @default undefined — no leading region renders.
|
|
112
|
+
*/
|
|
113
|
+
renderLeading?: ((item: SkdxNotificationCenterItem) => unknown) | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Renders extra controls beside one notification's read/unread toggle.
|
|
116
|
+
* @default undefined — no extra per-item controls render.
|
|
117
|
+
*/
|
|
118
|
+
renderActions?: ((item: SkdxNotificationCenterItem) => unknown) | undefined;
|
|
119
|
+
/** Generated title id, published as the section's `aria-labelledby`. */
|
|
120
|
+
private readonly titleId;
|
|
121
|
+
/** How many listeners each gated event holds, so the anatomy it drives renders only while one is bound. */
|
|
122
|
+
private readonly gated;
|
|
123
|
+
/** @internal Standard DOM registration, counted so a listener-gated region knows it has one. */
|
|
124
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
125
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
126
|
+
/** @internal Standard DOM removal, counted so a listener-gated region knows it lost one. */
|
|
127
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, event: HTMLElementEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
128
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
129
|
+
private countListener;
|
|
130
|
+
/** Whether the consumer is listening for `type` on this element, which is what renders its control. */
|
|
131
|
+
private handles;
|
|
132
|
+
connectedCallback(): void;
|
|
133
|
+
private region;
|
|
134
|
+
/** Whether the consumer supplied anything for `name` — still true once it has been moved in. */
|
|
135
|
+
private hasSlotted;
|
|
136
|
+
protected updated(): void;
|
|
137
|
+
private readonly markAllRead;
|
|
138
|
+
private itemBody;
|
|
139
|
+
private notificationRow;
|
|
140
|
+
private content;
|
|
141
|
+
render(): TemplateResult;
|
|
142
|
+
}
|
|
143
|
+
declare global {
|
|
144
|
+
interface HTMLElementTagNameMap {
|
|
145
|
+
'skdx-notification-center': SkdxNotificationCenter;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var u=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var a=(c,d,e,i)=>{for(var t=i>1?void 0:i?v(d,e):d,l=c.length-1,m;l>=0;l--)(m=c[l])&&(t=(i?m(d,e,t):m(t))||t);return i&&t&&u(d,e,t),t};import{html as n,LitElement as h,nothing as o}from"lit";import{property as s}from"lit/decorators.js";import{customElement as k}from"../internal/define.js";import{emit as p}from"../internal/events.js";import{placeSlotted as g}from"../internal/slots.js";import"@skdx/web-components/button";import"@skdx/web-components/heading";import"@skdx/web-components/skeleton";import"@skdx/web-components/time";import"../empty-state/index.js";var b="data-skdx-notification-center-generated",f=["select","read-change","mark-all-read"],L=[0,1,2],x=0,r=class extends h{constructor(){super(...arguments);this.title="Notifications";this.headingLevel=2;this.markAllReadLabel="Mark all as read";this.markReadLabel="Mark as read";this.markUnreadLabel="Mark as unread";this.emptyTitle="No notifications";this.loading=!1;this.titleId=`skdx-notification-center-title-${++x}`;this.gated=new Map;this.markAllRead=()=>{p(this,"mark-all-read")}}createRenderRoot(){return this}addEventListener(e,i,t){super.addEventListener(e,i,t),this.countListener(e,1)}removeEventListener(e,i,t){super.removeEventListener(e,i,t),this.countListener(e,-1)}countListener(e,i){f.includes(e)&&(this.gated.set(e,Math.max(0,(this.gated.get(e)??0)+i)),this.requestUpdate())}handles(e){return(this.gated.get(e)??0)>0}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-labelledby",this.titleId),queueMicrotask(()=>this.requestUpdate())}region(e){return this.querySelector(`.skdx-notification-center__${e}`)}hasSlotted(e){return this.querySelector(`[slot="${e}"]`)!==null}updated(){this.setAttribute("aria-busy",String(this.loading)),g(this,b,{actions:this.region("actions")},null)}itemBody(e){return n`<span class="skdx-notification-center__item-title">${e.title}</span> ${e.description?n`<span class="skdx-notification-center__description">${e.description}</span>`:o}
|
|
2
|
+
${e.timestamp===void 0?o:n`<skdx-time
|
|
3
|
+
class="skdx-notification-center__time"
|
|
4
|
+
relative
|
|
5
|
+
.value=${e.timestamp}
|
|
6
|
+
.now=${this.now}
|
|
7
|
+
></skdx-time>`}`}notificationRow(e){let i=this.handles("select"),t=this.handles("read-change");return n`<li
|
|
8
|
+
class="skdx-notification-center__item"
|
|
9
|
+
?data-read=${e.read===!0}
|
|
10
|
+
>
|
|
11
|
+
${this.renderLeading?n`<div
|
|
12
|
+
class="skdx-notification-center__leading"
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
>
|
|
15
|
+
${this.renderLeading(e)}
|
|
16
|
+
</div>`:o}
|
|
17
|
+
${i?n`<button
|
|
18
|
+
class="skdx-notification-center__body"
|
|
19
|
+
type="button"
|
|
20
|
+
@click=${()=>{p(this,"select",{item:e})}}
|
|
21
|
+
>
|
|
22
|
+
${this.itemBody(e)}
|
|
23
|
+
</button>`:n`<div class="skdx-notification-center__body">${this.itemBody(e)}</div>`}
|
|
24
|
+
${t||this.renderActions?n`<div class="skdx-notification-center__item-actions">
|
|
25
|
+
${this.renderActions?.(e)}
|
|
26
|
+
${t?n`<skdx-button
|
|
27
|
+
class="skdx-notification-center__read-toggle"
|
|
28
|
+
.size=${"sm"}
|
|
29
|
+
.variant=${"ghost"}
|
|
30
|
+
@click=${()=>{p(this,"read-change",{item:e,read:e.read!==!0})}}
|
|
31
|
+
>${e.read===!0?this.markUnreadLabel:this.markReadLabel}</skdx-button
|
|
32
|
+
>`:o}
|
|
33
|
+
</div>`:o}
|
|
34
|
+
</li>`}content(e){return this.loading?n`<div
|
|
35
|
+
class="skdx-notification-center__loading"
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
data-skdx-notification-center-generated
|
|
38
|
+
>
|
|
39
|
+
${L.map(()=>n`<skdx-skeleton .shape=${"line"}></skdx-skeleton>`)}
|
|
40
|
+
</div>`:e.length===0?n`<skdx-empty-state
|
|
41
|
+
class="skdx-notification-center__empty"
|
|
42
|
+
data-skdx-notification-center-generated
|
|
43
|
+
.title=${this.emptyTitle}
|
|
44
|
+
.description=${this.emptyDescription}
|
|
45
|
+
.size=${"sm"}
|
|
46
|
+
></skdx-empty-state>`:n`<ul
|
|
47
|
+
class="skdx-notification-center__list"
|
|
48
|
+
data-skdx-notification-center-generated
|
|
49
|
+
>
|
|
50
|
+
${e.map(i=>this.notificationRow(i))}
|
|
51
|
+
</ul>`}render(){let e=this.notifications??[],i=e.filter(l=>l.read!==!0).length,t=this.handles("mark-all-read");return n`
|
|
52
|
+
<div
|
|
53
|
+
class="skdx-notification-center__header"
|
|
54
|
+
data-skdx-notification-center-generated
|
|
55
|
+
>
|
|
56
|
+
<skdx-heading
|
|
57
|
+
class="skdx-notification-center__title"
|
|
58
|
+
as=${`h${this.headingLevel}`}
|
|
59
|
+
id=${this.titleId}
|
|
60
|
+
>${this.title}</skdx-heading
|
|
61
|
+
>
|
|
62
|
+
${this.hasSlotted("actions")||t?n`<div class="skdx-notification-center__actions">
|
|
63
|
+
${t?n`<skdx-button
|
|
64
|
+
class="skdx-notification-center__mark-all-read"
|
|
65
|
+
.size=${"sm"}
|
|
66
|
+
.variant=${"ghost"}
|
|
67
|
+
?disabled=${i===0}
|
|
68
|
+
@click=${this.markAllRead}
|
|
69
|
+
>${this.markAllReadLabel}</skdx-button
|
|
70
|
+
>`:o}
|
|
71
|
+
</div>`:o}
|
|
72
|
+
</div>
|
|
73
|
+
${this.content(e)}
|
|
74
|
+
`}};a([s({attribute:!1})],r.prototype,"notifications",2),a([s({type:String})],r.prototype,"title",2),a([s({type:Number,attribute:"heading-level"})],r.prototype,"headingLevel",2),a([s({type:String,attribute:"mark-all-read-label"})],r.prototype,"markAllReadLabel",2),a([s({type:String,attribute:"mark-read-label"})],r.prototype,"markReadLabel",2),a([s({type:String,attribute:"mark-unread-label"})],r.prototype,"markUnreadLabel",2),a([s({type:String,attribute:"empty-title"})],r.prototype,"emptyTitle",2),a([s({type:String,attribute:"empty-description"})],r.prototype,"emptyDescription",2),a([s({type:Boolean})],r.prototype,"loading",2),a([s({attribute:!1})],r.prototype,"now",2),a([s({attribute:!1})],r.prototype,"renderLeading",2),a([s({attribute:!1})],r.prototype,"renderActions",2),r=a([k("skdx-notification-center","notification-center","root")],r);export{r as SkdxNotificationCenter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},C=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of d(t))!f.call(e,i)&&i!==o&&n(e,i,{get:()=>t[i],enumerable:!(a=c(t,i))||a.enumerable});return e};var S=e=>C(n({},"__esModule",{value:!0}),e);var k={};x(k,{SkdxNotificationCenter:()=>r.SkdxNotificationCenter});module.exports=S(k);var r=require("./NotificationCenter.cjs");0&&(module.exports={SkdxNotificationCenter});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkdxNotificationCenter, type SkdxNotificationCenterItem, type SkdxNotificationCenterReadChangeDetail, type SkdxNotificationCenterSelectDetail, } from './NotificationCenter.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkdxNotificationCenter, type SkdxNotificationCenterItem, type SkdxNotificationCenterReadChangeDetail, type SkdxNotificationCenterSelectDetail, } from './NotificationCenter.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SkdxNotificationCenter as i}from"./NotificationCenter.js";export{i as SkdxNotificationCenter};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var x=(n,i)=>{for(var e in i)p(n,e,{get:i[e],enumerable:!0})},$=(n,i,e,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of u(i))!k.call(n,a)&&a!==e&&p(n,a,{get:()=>i[a],enumerable:!(s=b(i,a))||s.enumerable});return n};var _=n=>$(p({},"__esModule",{value:!0}),n),o=(n,i,e,s)=>{for(var a=s>1?void 0:s?b(i,e):i,r=n.length-1,c;r>=0;r--)(c=n[r])&&(a=(s?c(i,e,a):c(a))||a);return s&&a&&p(i,e,a),a};var L={};x(L,{SkdxOnboardingChecklist:()=>l});module.exports=_(L);var t=require("lit"),d=require("lit/decorators.js"),m=require("../internal/define.cjs"),g=require("../internal/events.cjs"),I=require("@skdx/web-components/button"),T=require("@skdx/web-components/heading"),R=require("@skdx/web-components/progress"),E=require("@skdx/web-components/text"),M=require("@skdx/web-components/visually-hidden");function v(n,i){return`${n}/${i}`}var y=0,l=class extends t.LitElement{constructor(){super(...arguments);this.headingLevel=2;this.completeLabel="Completed";this.optionalLabel="Optional";this.titleId=`skdx-onboarding-checklist-title-${++y}`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-labelledby",this.titleId)}renderItem(e){let s=e.state??"pending";return t.html`<li
|
|
2
|
+
class="skdx-onboarding-checklist__item"
|
|
3
|
+
data-state=${s}
|
|
4
|
+
aria-current=${s==="active"?"step":t.nothing}
|
|
5
|
+
>
|
|
6
|
+
<span
|
|
7
|
+
class="skdx-onboarding-checklist__indicator"
|
|
8
|
+
aria-hidden="true"
|
|
9
|
+
></span>
|
|
10
|
+
<div class="skdx-onboarding-checklist__body">
|
|
11
|
+
<span class="skdx-onboarding-checklist__item-title"
|
|
12
|
+
>${e.label}${s==="complete"?t.html`<skdx-visually-hidden> ${this.completeLabel}</skdx-visually-hidden>`:t.nothing}</span
|
|
13
|
+
>
|
|
14
|
+
${e.optional?t.html`<span class="skdx-onboarding-checklist__optional">${this.optionalLabel}</span>`:t.nothing}
|
|
15
|
+
${e.description?t.html`<skdx-text
|
|
16
|
+
class="skdx-onboarding-checklist__item-description"
|
|
17
|
+
as="p"
|
|
18
|
+
.tone=${"muted"}
|
|
19
|
+
>${e.description}</skdx-text
|
|
20
|
+
>`:t.nothing}
|
|
21
|
+
</div>
|
|
22
|
+
${e.actionLabel&&s!=="complete"?t.html`<skdx-button
|
|
23
|
+
class="skdx-onboarding-checklist__action"
|
|
24
|
+
.size=${"sm"}
|
|
25
|
+
.variant=${s==="active"?"primary":"secondary"}
|
|
26
|
+
?disabled=${s==="disabled"}
|
|
27
|
+
@click=${()=>{(0,g.emit)(this,"action",e)}}
|
|
28
|
+
>${e.actionLabel}</skdx-button
|
|
29
|
+
>`:t.nothing}
|
|
30
|
+
</li>`}render(){let e=this.items??[],s=e.filter(r=>(r.state??"pending")==="complete").length,a=this.getProgressLabel??v;return t.html`
|
|
31
|
+
<div class="skdx-onboarding-checklist__header">
|
|
32
|
+
<skdx-heading
|
|
33
|
+
class="skdx-onboarding-checklist__title"
|
|
34
|
+
as=${`h${this.headingLevel}`}
|
|
35
|
+
id=${this.titleId}
|
|
36
|
+
>${this.title??""}</skdx-heading
|
|
37
|
+
>
|
|
38
|
+
${this.description?t.html`<skdx-text
|
|
39
|
+
class="skdx-onboarding-checklist__description"
|
|
40
|
+
as="p"
|
|
41
|
+
.tone=${"muted"}
|
|
42
|
+
>${this.description}</skdx-text
|
|
43
|
+
>`:t.nothing}
|
|
44
|
+
${e.length?t.html`<skdx-progress
|
|
45
|
+
class="skdx-onboarding-checklist__progress"
|
|
46
|
+
.value=${s}
|
|
47
|
+
.max=${e.length}
|
|
48
|
+
aria-labelledby=${this.titleId}
|
|
49
|
+
.getValueLabel=${(r,c,h)=>a(r,h)}
|
|
50
|
+
></skdx-progress>`:t.nothing}
|
|
51
|
+
</div>
|
|
52
|
+
<ol class="skdx-onboarding-checklist__list">
|
|
53
|
+
${e.map(r=>this.renderItem(r))}
|
|
54
|
+
</ol>
|
|
55
|
+
`}};o([(0,d.property)({type:String})],l.prototype,"title",2),o([(0,d.property)({type:String})],l.prototype,"description",2),o([(0,d.property)({type:Number,attribute:"heading-level"})],l.prototype,"headingLevel",2),o([(0,d.property)({attribute:!1})],l.prototype,"items",2),o([(0,d.property)({attribute:!1})],l.prototype,"getProgressLabel",2),o([(0,d.property)({type:String,attribute:"complete-label"})],l.prototype,"completeLabel",2),o([(0,d.property)({type:String,attribute:"optional-label"})],l.prototype,"optionalLabel",2),l=o([(0,m.customElement)("skdx-onboarding-checklist","onboarding-checklist","root")],l);0&&(module.exports={SkdxOnboardingChecklist});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import '@skdx/web-components/button';
|
|
3
|
+
import '@skdx/web-components/heading';
|
|
4
|
+
import '@skdx/web-components/progress';
|
|
5
|
+
import '@skdx/web-components/text';
|
|
6
|
+
import '@skdx/web-components/visually-hidden';
|
|
7
|
+
/** Completion state of one `<skdx-onboarding-checklist>` item, mirrored to `data-state`. */
|
|
8
|
+
export type SkdxOnboardingChecklistItemState = 'pending' | 'active' | 'complete' | 'disabled';
|
|
9
|
+
/** One task of a `<skdx-onboarding-checklist>` — a single setup, launch or configuration step. */
|
|
10
|
+
export interface SkdxOnboardingChecklistItem {
|
|
11
|
+
/** Stable identifier carried back in the `action` event's detail. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Text naming the task, rendered as the item's title. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Supporting copy rendered below the label, explaining the task. @default undefined — no item description renders. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Completion state, mirrored to `data-state` and driving the indicator glyph. @default 'pending' */
|
|
18
|
+
state?: SkdxOnboardingChecklistItemState;
|
|
19
|
+
/** Marks the task as skippable, rendering the optional label beside its title. @default false */
|
|
20
|
+
optional?: boolean;
|
|
21
|
+
/** Text of the item's action button, which renders only alongside a non-complete state. @default undefined — no action button renders. */
|
|
22
|
+
actionLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Progress checklist block: a header naming the checklist with an overall
|
|
26
|
+
* Progress meter, above an ordered list of tasks each carrying its own
|
|
27
|
+
* completion state and an optional action.
|
|
28
|
+
*
|
|
29
|
+
* Renders light DOM, so its parts are classes rather than shadow `::part()`
|
|
30
|
+
* targets: `.skdx-onboarding-checklist` on the host, then `__header`,
|
|
31
|
+
* `__title`, `__description`, `__progress`, `__list`, `__item`, `__indicator`,
|
|
32
|
+
* `__body`, `__item-title`, `__optional`, `__item-description` and `__action`.
|
|
33
|
+
* `data-state` sits on each item for the skin to read.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```html
|
|
37
|
+
* <skdx-onboarding-checklist id="setup" title="Get started"></skdx-onboarding-checklist>
|
|
38
|
+
* <script>
|
|
39
|
+
* const list = document.getElementById('setup');
|
|
40
|
+
* list.items = [{ id: 'invite', label: 'Invite a teammate', actionLabel: 'Invite' }];
|
|
41
|
+
* list.addEventListener('action', (event) => console.log(event.detail.id));
|
|
42
|
+
* </script>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @fires action - Fires when an item's action button is activated, carrying the full item that was acted on.
|
|
46
|
+
*/
|
|
47
|
+
export declare class SkdxOnboardingChecklist extends LitElement {
|
|
48
|
+
/** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
|
|
49
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
50
|
+
/** Heading text naming the checklist, rendered into a derived Heading that names the section. */
|
|
51
|
+
title: string;
|
|
52
|
+
/**
|
|
53
|
+
* Supporting copy rendered below the title, explaining what the checklist covers.
|
|
54
|
+
* @default undefined — no description region renders.
|
|
55
|
+
*/
|
|
56
|
+
description?: string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Outline level of the derived title heading, lowered or raised to fit the surrounding outline.
|
|
59
|
+
* @default 2
|
|
60
|
+
*/
|
|
61
|
+
headingLevel: 1 | 2 | 3 | 4 | 5 | 6;
|
|
62
|
+
/** The tasks to complete, in render order, each with its own state, optional flag and action label. */
|
|
63
|
+
items: readonly SkdxOnboardingChecklistItem[];
|
|
64
|
+
/**
|
|
65
|
+
* Formats the overall progress meter's readout from the completed and total item counts.
|
|
66
|
+
* @default defaultGetProgressLabel — reads "1/3".
|
|
67
|
+
*/
|
|
68
|
+
getProgressLabel?: (complete: number, total: number) => string;
|
|
69
|
+
/**
|
|
70
|
+
* Visually hidden text appended after a completed item's title, announcing its completion.
|
|
71
|
+
* @default 'Completed'
|
|
72
|
+
*/
|
|
73
|
+
completeLabel: string;
|
|
74
|
+
/**
|
|
75
|
+
* Text rendered beside an optional item's title.
|
|
76
|
+
* @default 'Optional'
|
|
77
|
+
*/
|
|
78
|
+
optionalLabel: string;
|
|
79
|
+
/** Generated title id, published as the section's `aria-labelledby`. */
|
|
80
|
+
private readonly titleId;
|
|
81
|
+
connectedCallback(): void;
|
|
82
|
+
private renderItem;
|
|
83
|
+
render(): TemplateResult;
|
|
84
|
+
}
|
|
85
|
+
declare global {
|
|
86
|
+
interface HTMLElementTagNameMap {
|
|
87
|
+
'skdx-onboarding-checklist': SkdxOnboardingChecklist;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import '@skdx/web-components/button';
|
|
3
|
+
import '@skdx/web-components/heading';
|
|
4
|
+
import '@skdx/web-components/progress';
|
|
5
|
+
import '@skdx/web-components/text';
|
|
6
|
+
import '@skdx/web-components/visually-hidden';
|
|
7
|
+
/** Completion state of one `<skdx-onboarding-checklist>` item, mirrored to `data-state`. */
|
|
8
|
+
export type SkdxOnboardingChecklistItemState = 'pending' | 'active' | 'complete' | 'disabled';
|
|
9
|
+
/** One task of a `<skdx-onboarding-checklist>` — a single setup, launch or configuration step. */
|
|
10
|
+
export interface SkdxOnboardingChecklistItem {
|
|
11
|
+
/** Stable identifier carried back in the `action` event's detail. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Text naming the task, rendered as the item's title. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Supporting copy rendered below the label, explaining the task. @default undefined — no item description renders. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Completion state, mirrored to `data-state` and driving the indicator glyph. @default 'pending' */
|
|
18
|
+
state?: SkdxOnboardingChecklistItemState;
|
|
19
|
+
/** Marks the task as skippable, rendering the optional label beside its title. @default false */
|
|
20
|
+
optional?: boolean;
|
|
21
|
+
/** Text of the item's action button, which renders only alongside a non-complete state. @default undefined — no action button renders. */
|
|
22
|
+
actionLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Progress checklist block: a header naming the checklist with an overall
|
|
26
|
+
* Progress meter, above an ordered list of tasks each carrying its own
|
|
27
|
+
* completion state and an optional action.
|
|
28
|
+
*
|
|
29
|
+
* Renders light DOM, so its parts are classes rather than shadow `::part()`
|
|
30
|
+
* targets: `.skdx-onboarding-checklist` on the host, then `__header`,
|
|
31
|
+
* `__title`, `__description`, `__progress`, `__list`, `__item`, `__indicator`,
|
|
32
|
+
* `__body`, `__item-title`, `__optional`, `__item-description` and `__action`.
|
|
33
|
+
* `data-state` sits on each item for the skin to read.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```html
|
|
37
|
+
* <skdx-onboarding-checklist id="setup" title="Get started"></skdx-onboarding-checklist>
|
|
38
|
+
* <script>
|
|
39
|
+
* const list = document.getElementById('setup');
|
|
40
|
+
* list.items = [{ id: 'invite', label: 'Invite a teammate', actionLabel: 'Invite' }];
|
|
41
|
+
* list.addEventListener('action', (event) => console.log(event.detail.id));
|
|
42
|
+
* </script>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @fires action - Fires when an item's action button is activated, carrying the full item that was acted on.
|
|
46
|
+
*/
|
|
47
|
+
export declare class SkdxOnboardingChecklist extends LitElement {
|
|
48
|
+
/** Light DOM, so `@skdx/skins` and consumer CSS reach the composed core elements. */
|
|
49
|
+
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
50
|
+
/** Heading text naming the checklist, rendered into a derived Heading that names the section. */
|
|
51
|
+
title: string;
|
|
52
|
+
/**
|
|
53
|
+
* Supporting copy rendered below the title, explaining what the checklist covers.
|
|
54
|
+
* @default undefined — no description region renders.
|
|
55
|
+
*/
|
|
56
|
+
description?: string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Outline level of the derived title heading, lowered or raised to fit the surrounding outline.
|
|
59
|
+
* @default 2
|
|
60
|
+
*/
|
|
61
|
+
headingLevel: 1 | 2 | 3 | 4 | 5 | 6;
|
|
62
|
+
/** The tasks to complete, in render order, each with its own state, optional flag and action label. */
|
|
63
|
+
items: readonly SkdxOnboardingChecklistItem[];
|
|
64
|
+
/**
|
|
65
|
+
* Formats the overall progress meter's readout from the completed and total item counts.
|
|
66
|
+
* @default defaultGetProgressLabel — reads "1/3".
|
|
67
|
+
*/
|
|
68
|
+
getProgressLabel?: (complete: number, total: number) => string;
|
|
69
|
+
/**
|
|
70
|
+
* Visually hidden text appended after a completed item's title, announcing its completion.
|
|
71
|
+
* @default 'Completed'
|
|
72
|
+
*/
|
|
73
|
+
completeLabel: string;
|
|
74
|
+
/**
|
|
75
|
+
* Text rendered beside an optional item's title.
|
|
76
|
+
* @default 'Optional'
|
|
77
|
+
*/
|
|
78
|
+
optionalLabel: string;
|
|
79
|
+
/** Generated title id, published as the section's `aria-labelledby`. */
|
|
80
|
+
private readonly titleId;
|
|
81
|
+
connectedCallback(): void;
|
|
82
|
+
private renderItem;
|
|
83
|
+
render(): TemplateResult;
|
|
84
|
+
}
|
|
85
|
+
declare global {
|
|
86
|
+
interface HTMLElementTagNameMap {
|
|
87
|
+
'skdx-onboarding-checklist': SkdxOnboardingChecklist;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var n=(c,r,e,t)=>{for(var s=t>1?void 0:t?g(r,e):r,a=c.length-1,p;a>=0;a--)(p=c[a])&&(s=(t?p(r,e,s):p(s))||s);return t&&s&&m(r,e,s),s};import{html as l,LitElement as h,nothing as o}from"lit";import{property as d}from"lit/decorators.js";import{customElement as u}from"../internal/define.js";import{emit as k}from"../internal/events.js";import"@skdx/web-components/button";import"@skdx/web-components/heading";import"@skdx/web-components/progress";import"@skdx/web-components/text";import"@skdx/web-components/visually-hidden";function x(c,r){return`${c}/${r}`}var $=0,i=class extends h{constructor(){super(...arguments);this.headingLevel=2;this.completeLabel="Completed";this.optionalLabel="Optional";this.titleId=`skdx-onboarding-checklist-title-${++$}`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-labelledby",this.titleId)}renderItem(e){let t=e.state??"pending";return l`<li
|
|
2
|
+
class="skdx-onboarding-checklist__item"
|
|
3
|
+
data-state=${t}
|
|
4
|
+
aria-current=${t==="active"?"step":o}
|
|
5
|
+
>
|
|
6
|
+
<span
|
|
7
|
+
class="skdx-onboarding-checklist__indicator"
|
|
8
|
+
aria-hidden="true"
|
|
9
|
+
></span>
|
|
10
|
+
<div class="skdx-onboarding-checklist__body">
|
|
11
|
+
<span class="skdx-onboarding-checklist__item-title"
|
|
12
|
+
>${e.label}${t==="complete"?l`<skdx-visually-hidden> ${this.completeLabel}</skdx-visually-hidden>`:o}</span
|
|
13
|
+
>
|
|
14
|
+
${e.optional?l`<span class="skdx-onboarding-checklist__optional">${this.optionalLabel}</span>`:o}
|
|
15
|
+
${e.description?l`<skdx-text
|
|
16
|
+
class="skdx-onboarding-checklist__item-description"
|
|
17
|
+
as="p"
|
|
18
|
+
.tone=${"muted"}
|
|
19
|
+
>${e.description}</skdx-text
|
|
20
|
+
>`:o}
|
|
21
|
+
</div>
|
|
22
|
+
${e.actionLabel&&t!=="complete"?l`<skdx-button
|
|
23
|
+
class="skdx-onboarding-checklist__action"
|
|
24
|
+
.size=${"sm"}
|
|
25
|
+
.variant=${t==="active"?"primary":"secondary"}
|
|
26
|
+
?disabled=${t==="disabled"}
|
|
27
|
+
@click=${()=>{k(this,"action",e)}}
|
|
28
|
+
>${e.actionLabel}</skdx-button
|
|
29
|
+
>`:o}
|
|
30
|
+
</li>`}render(){let e=this.items??[],t=e.filter(a=>(a.state??"pending")==="complete").length,s=this.getProgressLabel??x;return l`
|
|
31
|
+
<div class="skdx-onboarding-checklist__header">
|
|
32
|
+
<skdx-heading
|
|
33
|
+
class="skdx-onboarding-checklist__title"
|
|
34
|
+
as=${`h${this.headingLevel}`}
|
|
35
|
+
id=${this.titleId}
|
|
36
|
+
>${this.title??""}</skdx-heading
|
|
37
|
+
>
|
|
38
|
+
${this.description?l`<skdx-text
|
|
39
|
+
class="skdx-onboarding-checklist__description"
|
|
40
|
+
as="p"
|
|
41
|
+
.tone=${"muted"}
|
|
42
|
+
>${this.description}</skdx-text
|
|
43
|
+
>`:o}
|
|
44
|
+
${e.length?l`<skdx-progress
|
|
45
|
+
class="skdx-onboarding-checklist__progress"
|
|
46
|
+
.value=${t}
|
|
47
|
+
.max=${e.length}
|
|
48
|
+
aria-labelledby=${this.titleId}
|
|
49
|
+
.getValueLabel=${(a,p,b)=>s(a,b)}
|
|
50
|
+
></skdx-progress>`:o}
|
|
51
|
+
</div>
|
|
52
|
+
<ol class="skdx-onboarding-checklist__list">
|
|
53
|
+
${e.map(a=>this.renderItem(a))}
|
|
54
|
+
</ol>
|
|
55
|
+
`}};n([d({type:String})],i.prototype,"title",2),n([d({type:String})],i.prototype,"description",2),n([d({type:Number,attribute:"heading-level"})],i.prototype,"headingLevel",2),n([d({attribute:!1})],i.prototype,"items",2),n([d({attribute:!1})],i.prototype,"getProgressLabel",2),n([d({type:String,attribute:"complete-label"})],i.prototype,"completeLabel",2),n([d({type:String,attribute:"optional-label"})],i.prototype,"optionalLabel",2),i=n([u("skdx-onboarding-checklist","onboarding-checklist","root")],i);export{i as SkdxOnboardingChecklist};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var k=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var i in t)k(e,i,{get:t[i],enumerable:!0})},b=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of a(t))!x.call(e,d)&&d!==i&&k(e,d,{get:()=>t[d],enumerable:!(n=r(t,d))||n.enumerable});return e};var c=e=>b(k({},"__esModule",{value:!0}),e);var g={};S(g,{SkdxOnboardingChecklist:()=>o.SkdxOnboardingChecklist});module.exports=c(g);var o=require("./OnboardingChecklist.cjs");0&&(module.exports={SkdxOnboardingChecklist});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkdxOnboardingChecklist, type SkdxOnboardingChecklistItem, type SkdxOnboardingChecklistItemState, } from './OnboardingChecklist.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkdxOnboardingChecklist, type SkdxOnboardingChecklistItem, type SkdxOnboardingChecklistItemState, } from './OnboardingChecklist.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SkdxOnboardingChecklist as d}from"./OnboardingChecklist.js";export{d as SkdxOnboardingChecklist};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var v=(i,e)=>{for(var t in e)p(i,t,{get:e[t],enumerable:!0})},y=(i,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of x(e))!w.call(i,r)&&r!==t&&p(i,r,{get:()=>e[r],enumerable:!(o=u(e,r))||o.enumerable});return i};var $=i=>y(p({},"__esModule",{value:!0}),i),d=(i,e,t,o)=>{for(var r=o>1?void 0:o?u(e,t):e,l=i.length-1,m;l>=0;l--)(m=i[l])&&(r=(o?m(e,t,r):m(r))||r);return o&&r&&p(e,t,r),r};var C={};v(C,{SkdxResetPasswordPage:()=>a});module.exports=$(C);var s=require("lit"),n=require("lit/decorators.js"),f=require("../internal/define.cjs"),k=require("../internal/events.cjs"),c=require("../internal/slots.cjs"),M=require("@skdx/web-components/alert"),q=require("@skdx/web-components/button"),S=require("@skdx/web-components/field"),T=require("@skdx/web-components/form"),V=require("@skdx/web-components/heading"),N=require("@skdx/web-components/password-input");var h="data-skdx-reset-password-page-generated",_="data-skdx-reset-password-page-content",g="confirmPassword",E=0,a=class extends s.LitElement{constructor(){super(...arguments);this.title="Choose a new password";this.pending=!1;this.passwordLabel="New password";this.passwordMismatchMessage="Passwords do not match";this.submitLabel="Update password";this.titleId=`skdx-reset-password-page-title-${++E}`;this.handleSubmit=t=>{let o=t.target?.closest("skdx-form");if(!o)return;t.preventDefault();let r=b(o,"password")?.value??"",l=b(o,g);if(l&&l.value!==r){l.setCustomValidity(this.passwordMismatchMessage),l.reportValidity();return}(0,k.emit)(this,"reset-password",{password:r})};this.clearMismatch=t=>{t.target.setCustomValidity("")}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-labelledby",this.titleId),this.addEventListener("submit",this.handleSubmit),queueMicrotask(()=>this.requestUpdate())}disconnectedCallback(){this.removeEventListener("submit",this.handleSubmit),super.disconnectedCallback()}hasSlotted(t){return this.querySelector(`[slot="${t}"]`)!==null}region(t){return this.querySelector(`.skdx-reset-password-page__${t}`)}get contentRegion(){return this.querySelector(`[${_}]`)}get hasContent(){return(0,c.hasUnslottedChild)(this,h)||(this.contentRegion?.hasChildNodes()??!1)}updated(){(0,c.placeSlotted)(this,h,{requirements:this.region("requirements"),footer:this.region("footer")},this.contentRegion)}render(){return s.html`
|
|
2
|
+
<div
|
|
3
|
+
class="skdx-reset-password-page__panel"
|
|
4
|
+
data-skdx-reset-password-page-generated
|
|
5
|
+
>
|
|
6
|
+
<skdx-heading
|
|
7
|
+
class="skdx-reset-password-page__title"
|
|
8
|
+
as="h1"
|
|
9
|
+
id=${this.titleId}
|
|
10
|
+
>${this.title}</skdx-heading
|
|
11
|
+
>
|
|
12
|
+
${this.error?s.html`<skdx-alert
|
|
13
|
+
class="skdx-reset-password-page__error"
|
|
14
|
+
.status=${"danger"}
|
|
15
|
+
>${this.error}</skdx-alert
|
|
16
|
+
>`:s.nothing}
|
|
17
|
+
${this.success?s.html`<skdx-alert
|
|
18
|
+
class="skdx-reset-password-page__success"
|
|
19
|
+
.status=${"success"}
|
|
20
|
+
>${this.success}</skdx-alert
|
|
21
|
+
>`:s.html`<skdx-form class="skdx-reset-password-page__form">
|
|
22
|
+
<form>
|
|
23
|
+
<skdx-field
|
|
24
|
+
class="skdx-reset-password-page__field"
|
|
25
|
+
label=${this.passwordLabel}
|
|
26
|
+
required
|
|
27
|
+
>
|
|
28
|
+
<skdx-password-input
|
|
29
|
+
name="password"
|
|
30
|
+
required
|
|
31
|
+
></skdx-password-input>
|
|
32
|
+
${this.hasSlotted("requirements")?s.html`<skdx-field-description
|
|
33
|
+
class="skdx-reset-password-page__requirements"
|
|
34
|
+
></skdx-field-description>`:s.nothing}
|
|
35
|
+
</skdx-field>
|
|
36
|
+
${this.confirmPasswordLabel===void 0?s.nothing:s.html`<skdx-field
|
|
37
|
+
class="skdx-reset-password-page__field"
|
|
38
|
+
label=${this.confirmPasswordLabel}
|
|
39
|
+
required
|
|
40
|
+
>
|
|
41
|
+
<skdx-password-input
|
|
42
|
+
name=${g}
|
|
43
|
+
required
|
|
44
|
+
@value-change=${this.clearMismatch}
|
|
45
|
+
></skdx-password-input>
|
|
46
|
+
</skdx-field>`}
|
|
47
|
+
${this.hasContent?s.html`<div data-skdx-reset-password-page-content></div>`:s.nothing}
|
|
48
|
+
<skdx-button
|
|
49
|
+
class="skdx-reset-password-page__submit"
|
|
50
|
+
type="submit"
|
|
51
|
+
?loading=${this.pending}
|
|
52
|
+
?disabled=${this.pending}
|
|
53
|
+
>${this.submitLabel}</skdx-button
|
|
54
|
+
>
|
|
55
|
+
</form>
|
|
56
|
+
</skdx-form>`}
|
|
57
|
+
${this.hasSlotted("footer")?s.html`<div class="skdx-reset-password-page__footer"></div>`:s.nothing}
|
|
58
|
+
</div>
|
|
59
|
+
`}};d([(0,n.property)({type:String})],a.prototype,"title",2),d([(0,n.property)({type:String})],a.prototype,"error",2),d([(0,n.property)({type:String})],a.prototype,"success",2),d([(0,n.property)({type:Boolean})],a.prototype,"pending",2),d([(0,n.property)({type:String,attribute:"password-label"})],a.prototype,"passwordLabel",2),d([(0,n.property)({type:String,attribute:"confirm-password-label"})],a.prototype,"confirmPasswordLabel",2),d([(0,n.property)({type:String,attribute:"password-mismatch-message"})],a.prototype,"passwordMismatchMessage",2),d([(0,n.property)({type:String,attribute:"submit-label"})],a.prototype,"submitLabel",2),a=d([(0,f.customElement)("skdx-reset-password-page","reset-password-page","root")],a);function b(i,e){return i.querySelector(`[name="${e}"]`)}0&&(module.exports={SkdxResetPasswordPage});
|