@skdx/web-components-blocks 0.36.0 → 0.38.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.
@@ -1,38 +0,0 @@
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});
@@ -1,101 +0,0 @@
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
- }
@@ -1,101 +0,0 @@
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
- }
@@ -1,38 +0,0 @@
1
- var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var t=(s,o,a,r)=>{for(var d=r>1?void 0:r?h(o,a):o,c=s.length-1,g;c>=0;c--)(g=s[c])&&(d=(r?g(o,a,d):g(d))||d);return r&&d&&u(o,a,d),d};import{html as l,LitElement as m,nothing as n}from"lit";import{property as i}from"lit/decorators.js";import{customElement as f}from"../internal/define.js";import{hasUnslottedChild as b,placeSlotted as y}from"../internal/slots.js";import"@skdx/web-components/primitives/dialog";var p="data-skdx-confirm-dialog-generated",k={fromAttribute:s=>s!=="false"},e=class extends m{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(a){return this.querySelector(`.skdx-confirm-dialog__${a}`)}get hasTrigger(){return this.querySelector('[slot="trigger"], [data-skdx-slot="trigger"]')!==null}get hasBody(){return b(this,p)||(this.region("body")?.hasChildNodes()??!1)}updated(){y(this,p,{trigger:this.querySelector("skdx-dialog-trigger")},this.region("body"))}render(){return l`
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?l`<skdx-dialog-trigger></skdx-dialog-trigger>`:n}
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?l`<skdx-dialog-description class="skdx-confirm-dialog__description"
19
- >${this.description}</skdx-dialog-description
20
- >`:n}
21
- ${this.hasBody?l`<div class="skdx-confirm-dialog__body"></div>`:n}
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":n}
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
- `}};t([i({converter:k})],e.prototype,"open",2),t([i({type:Boolean,attribute:"default-open"})],e.prototype,"defaultOpen",2),t([i({type:String})],e.prototype,"title",2),t([i({type:String})],e.prototype,"description",2),t([i({type:String,attribute:"confirm-label"})],e.prototype,"confirmLabel",2),t([i({type:String,attribute:"cancel-label"})],e.prototype,"cancelLabel",2),t([i({type:Boolean})],e.prototype,"destructive",2),t([i({type:Boolean})],e.prototype,"pending",2),t([i({type:Boolean})],e.prototype,"disabled",2),t([i({type:String})],e.prototype,"size",2),e=t([f("skdx-confirm-dialog","confirm-dialog","root")],e);export{e as SkdxConfirmDialog};
@@ -1 +0,0 @@
1
- "use strict";var m=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var e=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var k=(r,o)=>{for(var i in o)m(r,i,{get:o[i],enumerable:!0})},l=(r,o,i,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let f of e(o))!g.call(r,f)&&f!==i&&m(r,f,{get:()=>o[f],enumerable:!(x=d(o,f))||x.enumerable});return r};var n=r=>l(m({},"__esModule",{value:!0}),r);var p={};k(p,{SkdxConfirmDialog:()=>a.SkdxConfirmDialog});module.exports=n(p);var a=require("./ConfirmDialog.cjs");0&&(module.exports={SkdxConfirmDialog});
@@ -1 +0,0 @@
1
- export { SkdxConfirmDialog } from './ConfirmDialog.cjs';
@@ -1 +0,0 @@
1
- export { SkdxConfirmDialog } from './ConfirmDialog.js';
@@ -1 +0,0 @@
1
- import{SkdxConfirmDialog as f}from"./ConfirmDialog.js";export{f as SkdxConfirmDialog};