@progressive-development/pd-content 1.0.3 → 1.1.1
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/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/node_modules/.pnpm/@codemirror_autocomplete@6.20.1/node_modules/@codemirror/autocomplete/dist/index.js +550 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js +264 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js +661 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js +44 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js +346 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js +32 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-markdown@6.5.0/node_modules/@codemirror/lang-markdown/dist/index.js +492 -0
- package/dist/node_modules/.pnpm/@codemirror_lang-python@6.2.1/node_modules/@codemirror/lang-python/dist/index.js +308 -0
- package/dist/node_modules/.pnpm/@codemirror_language@6.12.3/node_modules/@codemirror/language/dist/index.js +1572 -0
- package/dist/node_modules/.pnpm/@codemirror_state@6.6.0/node_modules/@codemirror/state/dist/index.js +3881 -0
- package/dist/node_modules/.pnpm/@codemirror_view@6.40.0/node_modules/@codemirror/view/dist/index.js +9657 -0
- package/dist/node_modules/.pnpm/@lezer_common@1.5.1/node_modules/@lezer/common/dist/index.js +2196 -0
- package/dist/node_modules/.pnpm/@lezer_css@1.3.3/node_modules/@lezer/css/dist/index.js +147 -0
- package/dist/node_modules/.pnpm/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js +898 -0
- package/dist/node_modules/.pnpm/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js +349 -0
- package/dist/node_modules/.pnpm/@lezer_java@1.1.3/node_modules/@lezer/java/dist/index.js +67 -0
- package/dist/node_modules/.pnpm/@lezer_javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js +192 -0
- package/dist/node_modules/.pnpm/@lezer_json@1.0.3/node_modules/@lezer/json/dist/index.js +37 -0
- package/dist/node_modules/.pnpm/@lezer_lr@1.4.8/node_modules/@lezer/lr/dist/index.js +1884 -0
- package/dist/node_modules/.pnpm/@lezer_markdown@1.6.3/node_modules/@lezer/markdown/dist/index.js +2335 -0
- package/dist/node_modules/.pnpm/@lezer_python@1.1.18/node_modules/@lezer/python/dist/index.js +326 -0
- package/dist/node_modules/.pnpm/@marijn_find-cluster-break@1.0.2/node_modules/@marijn/find-cluster-break/src/index.js +82 -0
- package/dist/node_modules/.pnpm/style-mod@4.1.3/node_modules/style-mod/src/style-mod.js +174 -0
- package/dist/node_modules/.pnpm/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.js +121 -0
- package/dist/pd-badge-order/PdBadgeItem.d.ts +11 -0
- package/dist/pd-badge-order/PdBadgeItem.d.ts.map +1 -1
- package/dist/pd-badge-order/PdBadgeItem.js +162 -10
- package/dist/pd-badge-order/PdBadgeOrder.d.ts +56 -17
- package/dist/pd-badge-order/PdBadgeOrder.d.ts.map +1 -1
- package/dist/pd-badge-order/PdBadgeOrder.js +308 -153
- package/dist/pd-badge-order/types.js +3 -1
- package/dist/pd-code-snippet/PdCodeSnippet.d.ts +29 -0
- package/dist/pd-code-snippet/PdCodeSnippet.d.ts.map +1 -1
- package/dist/pd-code-snippet/PdCodeSnippet.js +117 -67
- package/dist/pd-code-snippet/codemirror-setup.d.ts +10 -0
- package/dist/pd-code-snippet/codemirror-setup.d.ts.map +1 -0
- package/dist/pd-code-snippet/codemirror-setup.js +101 -0
- package/dist/pd-loading-state/PdLoadingState.d.ts +4 -1
- package/dist/pd-loading-state/PdLoadingState.d.ts.map +1 -1
- package/dist/pd-loading-state/pd-loading-state.d.ts +1 -1
- package/dist/pd-loading-state/pd-loading-state.d.ts.map +1 -1
- package/dist/pd-loading-state/pd-logo-loader.js +2 -2
- package/dist/pd-more-info/PdMoreInfo.d.ts +52 -4
- package/dist/pd-more-info/PdMoreInfo.d.ts.map +1 -1
- package/dist/pd-more-info/PdMoreInfo.js +146 -24
- package/dist/pd-notice-box/PdNoticeBox.d.ts +8 -1
- package/dist/pd-notice-box/PdNoticeBox.d.ts.map +1 -1
- package/dist/pd-notice-box/PdNoticeBox.js +41 -2
- package/dist/pd-panel-viewer/PdPanel.d.ts +3 -0
- package/dist/pd-panel-viewer/PdPanel.d.ts.map +1 -1
- package/dist/pd-panel-viewer/PdPanel.js +8 -1
- package/dist/pd-panel-viewer/PdPanelViewer.d.ts +3 -0
- package/dist/pd-panel-viewer/PdPanelViewer.d.ts.map +1 -1
- package/dist/pd-panel-viewer/PdPanelViewer.js +59 -26
- package/dist/pd-tab/PdTab.d.ts +8 -5
- package/dist/pd-tab/PdTab.d.ts.map +1 -1
- package/dist/pd-tab/PdTab.js +110 -56
- package/dist/pd-timeline/PdTimeline.d.ts +2 -0
- package/dist/pd-timeline/PdTimeline.d.ts.map +1 -1
- package/dist/pd-timeline/PdTimeline.js +50 -19
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +16 -8
- package/dist/pd-gallery/PdGallery.d.ts +0 -72
- package/dist/pd-gallery/PdGallery.d.ts.map +0 -1
- package/dist/pd-gallery/PdGallery.js +0 -660
- package/dist/pd-gallery/PdGalleryLightbox.d.ts +0 -53
- package/dist/pd-gallery/PdGalleryLightbox.d.ts.map +0 -1
- package/dist/pd-gallery/PdGalleryLightbox.js +0 -530
- package/dist/pd-gallery/index.d.ts +0 -4
- package/dist/pd-gallery/index.d.ts.map +0 -1
- package/dist/pd-gallery/pd-gallery-lightbox.d.ts +0 -3
- package/dist/pd-gallery/pd-gallery-lightbox.d.ts.map +0 -1
- package/dist/pd-gallery/pd-gallery.d.ts +0 -3
- package/dist/pd-gallery/pd-gallery.d.ts.map +0 -1
- package/dist/pd-gallery/types.d.ts +0 -23
- package/dist/pd-gallery/types.d.ts.map +0 -1
- package/dist/pd-gallery-lightbox.d.ts +0 -2
- package/dist/pd-gallery-lightbox.js +0 -8
- package/dist/pd-gallery.d.ts +0 -2
- package/dist/pd-gallery.js +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { css, LitElement, html } from 'lit';
|
|
2
|
-
import { state } from 'lit/decorators.js';
|
|
1
|
+
import { css, LitElement, nothing, html } from 'lit';
|
|
2
|
+
import { property, state } from 'lit/decorators.js';
|
|
3
3
|
import { localized, msg } from '@lit/localize';
|
|
4
4
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -15,35 +15,129 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
15
|
let PdMoreInfo = class extends LitElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
+
this.noAutoScroll = false;
|
|
18
19
|
this._lessInfo = true;
|
|
20
|
+
this._fullText = "";
|
|
21
|
+
this._isOverflowing = false;
|
|
19
22
|
}
|
|
20
23
|
render() {
|
|
24
|
+
if (this.maxLength) {
|
|
25
|
+
return this._renderMaxLength();
|
|
26
|
+
}
|
|
27
|
+
if (this.maxLines) {
|
|
28
|
+
return this._renderMaxLines();
|
|
29
|
+
}
|
|
30
|
+
return this._renderLegacy();
|
|
31
|
+
}
|
|
32
|
+
updated() {
|
|
33
|
+
if (this.maxLines && this._lessInfo) {
|
|
34
|
+
this._checkOverflow();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// maxLength mode
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
_renderMaxLength() {
|
|
41
|
+
const needsTruncation = this._fullText.length > this.maxLength;
|
|
42
|
+
const collapsed = this._lessInfo && needsTruncation;
|
|
43
|
+
return html`
|
|
44
|
+
<p>
|
|
45
|
+
<span class=${collapsed ? "slot-hidden" : ""}
|
|
46
|
+
><slot @slotchange=${this._onSlotChange}></slot
|
|
47
|
+
></span>
|
|
48
|
+
${collapsed ? html`${this._truncateText(this._fullText, this.maxLength)}
|
|
49
|
+
${this._moreLink()}` : needsTruncation ? this._lessLink() : nothing}
|
|
50
|
+
</p>
|
|
51
|
+
`;
|
|
52
|
+
}
|
|
53
|
+
_truncateText(text, max) {
|
|
54
|
+
if (text.length <= max) return text;
|
|
55
|
+
const truncated = text.slice(0, max);
|
|
56
|
+
const lastSpace = truncated.lastIndexOf(" ");
|
|
57
|
+
return (lastSpace > 0 ? truncated.slice(0, lastSpace) : truncated) + "…";
|
|
58
|
+
}
|
|
59
|
+
_onSlotChange(e) {
|
|
60
|
+
const slot = e.target;
|
|
61
|
+
const nodes = slot.assignedNodes({ flatten: true });
|
|
62
|
+
const raw = nodes.map((n) => n.textContent ?? "").join("");
|
|
63
|
+
const text = raw.replace(/\s+/g, " ").trim();
|
|
64
|
+
if (text !== this._fullText) {
|
|
65
|
+
this._fullText = text;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
// maxLines mode
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
_renderMaxLines() {
|
|
72
|
+
return html`
|
|
73
|
+
<p>
|
|
74
|
+
<span
|
|
75
|
+
class=${this._lessInfo ? "content-clamped" : ""}
|
|
76
|
+
style=${this._lessInfo ? `-webkit-line-clamp: ${this.maxLines}` : ""}
|
|
77
|
+
>
|
|
78
|
+
<slot @slotchange=${this._onMaxLinesSlotChange}></slot>
|
|
79
|
+
</span>
|
|
80
|
+
${this._lessInfo && this._isOverflowing ? this._moreLink() : !this._lessInfo ? this._lessLink() : nothing}
|
|
81
|
+
</p>
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
_onMaxLinesSlotChange() {
|
|
85
|
+
this.updateComplete.then(() => this._checkOverflow());
|
|
86
|
+
}
|
|
87
|
+
_checkOverflow() {
|
|
88
|
+
const wrapper = this.shadowRoot?.querySelector(
|
|
89
|
+
"p > span"
|
|
90
|
+
);
|
|
91
|
+
if (wrapper) {
|
|
92
|
+
this._isOverflowing = wrapper.scrollHeight > wrapper.clientHeight;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// Legacy mode (named slots)
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
_renderLegacy() {
|
|
21
99
|
return html`
|
|
22
100
|
<p>
|
|
23
101
|
${this._lessInfo ? html`
|
|
24
102
|
<slot name="small-view"></slot>
|
|
25
|
-
|
|
26
|
-
role="button"
|
|
27
|
-
tabindex="0"
|
|
28
|
-
@click=${this._showMoreInfo}
|
|
29
|
-
@keydown=${this._onKeyDown}
|
|
30
|
-
>
|
|
31
|
-
${msg("Mehr Informationen", { id: "pd.moreInfo.more" })}
|
|
32
|
-
</a>
|
|
103
|
+
${this._moreLink()}
|
|
33
104
|
` : html`
|
|
34
105
|
<slot name="large-view"></slot>
|
|
35
|
-
|
|
36
|
-
role="button"
|
|
37
|
-
tabindex="0"
|
|
38
|
-
@click=${this._showLessInfo}
|
|
39
|
-
@keydown=${this._onKeyDown}
|
|
40
|
-
>
|
|
41
|
-
${msg("Text ausblenden", { id: "pd.moreInfo.less" })}
|
|
42
|
-
</a>
|
|
106
|
+
${this._lessLink()}
|
|
43
107
|
`}
|
|
44
108
|
</p>
|
|
45
109
|
`;
|
|
46
110
|
}
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
// Shared toggle links
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
_moreLink() {
|
|
115
|
+
return html`
|
|
116
|
+
<a
|
|
117
|
+
role="button"
|
|
118
|
+
tabindex="0"
|
|
119
|
+
@click=${this._showMoreInfo}
|
|
120
|
+
@keydown=${this._onKeyDown}
|
|
121
|
+
>
|
|
122
|
+
${msg("Mehr Informationen", { id: "pd.moreInfo.more" })}
|
|
123
|
+
</a>
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
_lessLink() {
|
|
127
|
+
return html`
|
|
128
|
+
<a
|
|
129
|
+
role="button"
|
|
130
|
+
tabindex="0"
|
|
131
|
+
@click=${this._showLessInfo}
|
|
132
|
+
@keydown=${this._onKeyDown}
|
|
133
|
+
>
|
|
134
|
+
${msg("Text ausblenden", { id: "pd.moreInfo.less" })}
|
|
135
|
+
</a>
|
|
136
|
+
`;
|
|
137
|
+
}
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
// Event handlers
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
47
141
|
_onKeyDown(e) {
|
|
48
142
|
if (e.key === "Enter" || e.key === " ") {
|
|
49
143
|
e.preventDefault();
|
|
@@ -55,12 +149,14 @@ let PdMoreInfo = class extends LitElement {
|
|
|
55
149
|
}
|
|
56
150
|
_showLessInfo() {
|
|
57
151
|
this._lessInfo = true;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
152
|
+
if (!this.noAutoScroll) {
|
|
153
|
+
const rect = this.getBoundingClientRect();
|
|
154
|
+
window.scrollBy({
|
|
155
|
+
top: rect.top - 150,
|
|
156
|
+
left: 0,
|
|
157
|
+
behavior: "smooth"
|
|
158
|
+
});
|
|
159
|
+
}
|
|
64
160
|
}
|
|
65
161
|
};
|
|
66
162
|
PdMoreInfo.styles = [
|
|
@@ -74,6 +170,7 @@ PdMoreInfo.styles = [
|
|
|
74
170
|
font-family: var(--pd-default-font-content-family);
|
|
75
171
|
font-size: var(--pd-default-font-content-size);
|
|
76
172
|
line-height: var(--pd-default-font-content-line-height, 1.4em);
|
|
173
|
+
margin: 0;
|
|
77
174
|
}
|
|
78
175
|
|
|
79
176
|
a {
|
|
@@ -96,11 +193,36 @@ PdMoreInfo.styles = [
|
|
|
96
193
|
outline-offset: 2px;
|
|
97
194
|
border-radius: 2px;
|
|
98
195
|
}
|
|
196
|
+
|
|
197
|
+
.content-clamped {
|
|
198
|
+
display: -webkit-box;
|
|
199
|
+
-webkit-box-orient: vertical;
|
|
200
|
+
overflow: hidden;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.slot-hidden {
|
|
204
|
+
display: none;
|
|
205
|
+
}
|
|
99
206
|
`
|
|
100
207
|
];
|
|
208
|
+
__decorateClass([
|
|
209
|
+
property({ type: Number, attribute: "max-length" })
|
|
210
|
+
], PdMoreInfo.prototype, "maxLength", 2);
|
|
211
|
+
__decorateClass([
|
|
212
|
+
property({ type: Number, attribute: "max-lines" })
|
|
213
|
+
], PdMoreInfo.prototype, "maxLines", 2);
|
|
214
|
+
__decorateClass([
|
|
215
|
+
property({ type: Boolean, reflect: true })
|
|
216
|
+
], PdMoreInfo.prototype, "noAutoScroll", 2);
|
|
101
217
|
__decorateClass([
|
|
102
218
|
state()
|
|
103
219
|
], PdMoreInfo.prototype, "_lessInfo", 2);
|
|
220
|
+
__decorateClass([
|
|
221
|
+
state()
|
|
222
|
+
], PdMoreInfo.prototype, "_fullText", 2);
|
|
223
|
+
__decorateClass([
|
|
224
|
+
state()
|
|
225
|
+
], PdMoreInfo.prototype, "_isOverflowing", 2);
|
|
104
226
|
PdMoreInfo = __decorateClass([
|
|
105
227
|
localized()
|
|
106
228
|
], PdMoreInfo);
|
|
@@ -3,9 +3,10 @@ import { NoticeType, NoticeVariant } from '../types.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Notice box component for displaying contextual messages.
|
|
5
5
|
*
|
|
6
|
-
* Supports
|
|
6
|
+
* Supports three visual variants:
|
|
7
7
|
* - **box**: Full-width box with icon, colored background (like Confluence info boxes)
|
|
8
8
|
* - **sidebar**: Minimal variant with colored left border only
|
|
9
|
+
* - **compact**: Inline-optimized variant with small icon, subtle tint, and reduced spacing — designed for embedding in other components
|
|
9
10
|
*
|
|
10
11
|
* @tagname pd-notice-box
|
|
11
12
|
* @summary Contextual notice box for info, note, success, warning, and error messages.
|
|
@@ -47,6 +48,11 @@ import { NoticeType, NoticeVariant } from '../types.js';
|
|
|
47
48
|
* This is a warning message.
|
|
48
49
|
* </pd-notice-box>
|
|
49
50
|
*
|
|
51
|
+
* <!-- Compact variant (inline, small) -->
|
|
52
|
+
* <pd-notice-box type="note" variant="compact" icon="aiSparkleIcon">
|
|
53
|
+
* AI-generated suggestion text.
|
|
54
|
+
* </pd-notice-box>
|
|
55
|
+
*
|
|
50
56
|
* <!-- Custom icon -->
|
|
51
57
|
* <pd-notice-box type="success" icon="starIcon" title="Success">
|
|
52
58
|
* Operation completed!
|
|
@@ -67,6 +73,7 @@ export declare class PdNoticeBox extends LitElement {
|
|
|
67
73
|
* Visual variant of the notice box.
|
|
68
74
|
* - `box`: Full box with icon and background color
|
|
69
75
|
* - `sidebar`: Minimal with colored left border
|
|
76
|
+
* - `compact`: Inline-optimized with small icon, subtle tint, reduced spacing
|
|
70
77
|
*/
|
|
71
78
|
variant: NoticeVariant;
|
|
72
79
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdNoticeBox.d.ts","sourceRoot":"","sources":["../../src/pd-notice-box/PdNoticeBox.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAW,MAAM,KAAK,CAAC;AAIrE,OAAO,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAa7D
|
|
1
|
+
{"version":3,"file":"PdNoticeBox.d.ts","sourceRoot":"","sources":["../../src/pd-notice-box/PdNoticeBox.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAW,MAAM,KAAK,CAAC;AAIrE,OAAO,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAa7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,qBAAa,WAAY,SAAQ,UAAU;IACzC;;OAEG;IAEH,IAAI,EAAE,UAAU,CAAU;IAE1B;;;;;OAKG;IAEH,OAAO,EAAE,aAAa,CAAS;IAE/B;;OAEG;IAEH,KAAK,SAAM;IAEX;;;OAGG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,QAAQ,UAAS;IAEjB,OAAgB,MAAM,EAAE,cAAc,CAiMpC;IAEO,MAAM;CAuBhB"}
|
|
@@ -34,7 +34,7 @@ class PdNoticeBox extends LitElement {
|
|
|
34
34
|
:host {
|
|
35
35
|
/* Layout */
|
|
36
36
|
--_width: var(--pd-notice-box-width, 100%);
|
|
37
|
-
--_radius: var(--pd-notice-box-border-radius, var(--pd-radius-
|
|
37
|
+
--_radius: var(--pd-notice-box-border-radius, var(--pd-radius-lg, 8px));
|
|
38
38
|
--_padding: var(--pd-notice-box-padding, var(--pd-spacing-sm, 12px));
|
|
39
39
|
--_gap: var(--pd-notice-box-gap, var(--pd-spacing-sm, 12px));
|
|
40
40
|
|
|
@@ -182,11 +182,50 @@ class PdNoticeBox extends LitElement {
|
|
|
182
182
|
.body ::slotted(*:not(:last-child)) {
|
|
183
183
|
margin-bottom: 0.5em;
|
|
184
184
|
}
|
|
185
|
+
|
|
186
|
+
/* Compact variant – propagate sizing via CSS vars for slotted components (e.g. pd-more-info) */
|
|
187
|
+
:host([variant="compact"]) {
|
|
188
|
+
--pd-default-font-content-size: 0.8rem;
|
|
189
|
+
--pd-default-font-content-line-height: 1.3;
|
|
190
|
+
--pd-default-font-link-size: 0.75rem;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:host([variant="compact"]) .notice-box {
|
|
194
|
+
background-color: color-mix(in srgb, var(--_type-col) 4%, transparent);
|
|
195
|
+
border: none;
|
|
196
|
+
border-left: 3px solid var(--_type-col);
|
|
197
|
+
border-radius: 0;
|
|
198
|
+
padding: 6px 8px;
|
|
199
|
+
gap: 6px;
|
|
200
|
+
font-size: 0.8rem;
|
|
201
|
+
line-height: 1.3;
|
|
202
|
+
align-items: center;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:host([variant="compact"]) .icon-wrapper {
|
|
206
|
+
width: 22px;
|
|
207
|
+
height: 22px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
:host([variant="compact"]) .icon-wrapper pd-icon {
|
|
211
|
+
width: 22px;
|
|
212
|
+
height: 22px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
:host([variant="compact"]) .title {
|
|
216
|
+
display: inline;
|
|
217
|
+
font-size: 0.8rem;
|
|
218
|
+
margin: 0 4px 0 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:host([variant="compact"]) .body {
|
|
222
|
+
line-height: 1.3;
|
|
223
|
+
}
|
|
185
224
|
`
|
|
186
225
|
];
|
|
187
226
|
}
|
|
188
227
|
render() {
|
|
189
|
-
const showIcon = this.variant === "box" && !this.hideIcon;
|
|
228
|
+
const showIcon = (this.variant === "box" || this.variant === "compact") && !this.hideIcon;
|
|
190
229
|
const iconName = this.icon || DEFAULT_ICONS[this.type];
|
|
191
230
|
return html`
|
|
192
231
|
<div class="notice-box" role="note" aria-label="${this.type} notice">
|
|
@@ -6,6 +6,9 @@ import { LitElement } from 'lit';
|
|
|
6
6
|
*
|
|
7
7
|
* @cssprop --pd-panel-bg - Panel background color. Default: `#afc1d2`.
|
|
8
8
|
* @cssprop --pd-panel-border-radius - Panel border radius. Default: `0.2em`.
|
|
9
|
+
* @cssprop --pd-panel-padding - Content padding. Default: `2rem`.
|
|
10
|
+
*
|
|
11
|
+
* @attr {boolean} no-padding - Remove content padding (useful for full-bleed slides).
|
|
9
12
|
*/
|
|
10
13
|
export declare class PdPanel extends LitElement {
|
|
11
14
|
static styles: import('lit').CSSResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdPanel.d.ts","sourceRoot":"","sources":["../../src/pd-panel-viewer/PdPanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,UAAU,EAAO,MAAM,KAAK,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"PdPanel.d.ts","sourceRoot":"","sources":["../../src/pd-panel-viewer/PdPanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,UAAU,EAAO,MAAM,KAAK,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,qBAAa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,MAAM,0BA6BX;IAEF,MAAM;CAOP"}
|
|
@@ -5,6 +5,8 @@ class PdPanel extends LitElement {
|
|
|
5
5
|
this.styles = css`
|
|
6
6
|
:host {
|
|
7
7
|
background: var(--pd-panel-bg, #afc1d2);
|
|
8
|
+
background-size: cover;
|
|
9
|
+
background-position: center;
|
|
8
10
|
border-radius: var(--pd-panel-border-radius, 0.2em);
|
|
9
11
|
}
|
|
10
12
|
|
|
@@ -15,12 +17,17 @@ class PdPanel extends LitElement {
|
|
|
15
17
|
right: 0;
|
|
16
18
|
bottom: 0;
|
|
17
19
|
left: 0;
|
|
18
|
-
padding: 2rem;
|
|
20
|
+
padding: var(--pd-panel-padding, 2rem);
|
|
19
21
|
display: flex;
|
|
20
22
|
flex-direction: column;
|
|
21
23
|
align-items: center;
|
|
22
24
|
justify-content: flex-start;
|
|
23
25
|
}
|
|
26
|
+
|
|
27
|
+
:host([no-padding]) #content {
|
|
28
|
+
padding: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
#content > slot::slotted(*) {
|
|
25
32
|
margin: 0;
|
|
26
33
|
}
|
|
@@ -9,6 +9,7 @@ import { LitElement } from 'lit';
|
|
|
9
9
|
*
|
|
10
10
|
* @cssprop --pd-panel-viewer-bg-col - Viewer background color. Default: `var(--pd-default-col)`.
|
|
11
11
|
* @cssprop --pd-panel-width - Max width of the panel viewer. Default: `1170px`.
|
|
12
|
+
* @attr {boolean} fill - Fill parent height instead of using --pd-panel-height.
|
|
12
13
|
* @cssprop --pd-panel-height - Height of the panel viewer. Default: `60vh`.
|
|
13
14
|
* @cssprop --pd-panel-overflow - Overflow behavior. Default: `hidden`.
|
|
14
15
|
* @cssprop --pd-panel-nav-top - Top position of navigation arrows. Default: `calc(50% - 25px)`.
|
|
@@ -23,6 +24,8 @@ import { LitElement } from 'lit';
|
|
|
23
24
|
*/
|
|
24
25
|
export declare class PdPanelViewer extends LitElement {
|
|
25
26
|
withProgress: boolean;
|
|
27
|
+
/** When true, navigation arrows overlay the content instead of sitting beside it. */
|
|
28
|
+
overlayNav: boolean;
|
|
26
29
|
deltaCalc: number;
|
|
27
30
|
/** @ignore */
|
|
28
31
|
_index: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdPanelViewer.d.ts","sourceRoot":"","sources":["../../src/pd-panel-viewer/PdPanelViewer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAKrD,OAAO,0CAA0C,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"PdPanelViewer.d.ts","sourceRoot":"","sources":["../../src/pd-panel-viewer/PdPanelViewer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAKrD,OAAO,0CAA0C,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAE3C,YAAY,UAAS;IAErB,qFAAqF;IAErF,UAAU,UAAQ;IAGlB,SAAS,SAAK;IAEd,cAAc;IAEd,MAAM,SAAK;IAEX,cAAc;IAEd,QAAQ,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAM;IAEtD,cAAc;IAEd,OAAO,KAAM;IAEb,cAAc;IACd,OAAO,CAAC,eAAe,CAA+B;IACtD,cAAc;IACd,OAAO,CAAC,cAAc,CAAK;IAC3B,cAAc;IACd,OAAO,CAAC,cAAc,CAAK;IAC3B,cAAc;IACd,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,cAAc;IACd,OAAO,CAAC,aAAa,CAAS;IAC9B,cAAc;IACd,OAAO,CAAC,cAAc,CAAK;IAC3B,cAAc;IACd,OAAO,CAAC,iBAAiB,CAAwB;IAEjD,MAAM,CAAC,MAAM,0BAiHX;IAEF,IAAI,KAAK,WAER;IAED,IAAI,KAAK,CAAC,KAAK,QAAA,EASd;IAED,MAAM;IAoFN,YAAY;IAQH,oBAAoB;IAS7B,MAAM,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAK9C;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAsCrB,IAAI;IASJ,QAAQ;IAUR,OAAO,CAAC,cAAc,CAQpB;IAEF,OAAO,CAAC,cAAc,CAqCpB;IAEF,OAAO,CAAC,YAAY,CAWlB;IAEF,OAAO,CAAC,gBAAgB,CAMtB;IAIF,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,kBAAkB;CAY3B"}
|
|
@@ -17,6 +17,7 @@ class PdPanelViewer extends LitElement {
|
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
19
|
this.withProgress = false;
|
|
20
|
+
this.overlayNav = true;
|
|
20
21
|
this.deltaCalc = 3;
|
|
21
22
|
this._index = 0;
|
|
22
23
|
this._panData = {};
|
|
@@ -92,6 +93,7 @@ class PdPanelViewer extends LitElement {
|
|
|
92
93
|
display: flex;
|
|
93
94
|
flex-direction: column;
|
|
94
95
|
width: 100%;
|
|
96
|
+
height: 100%;
|
|
95
97
|
max-width: var(--pd-panel-width, 1170px);
|
|
96
98
|
overflow: var(--pd-panel-overflow, hidden);
|
|
97
99
|
background-color: var(--pd-panel-viewer-bg-col, var(--pd-default-col));
|
|
@@ -139,6 +141,21 @@ class PdPanelViewer extends LitElement {
|
|
|
139
141
|
right: 0;
|
|
140
142
|
}
|
|
141
143
|
|
|
144
|
+
:host([fill]) .panel-container {
|
|
145
|
+
height: 100%;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host([overlayNav]) .panel-container {
|
|
149
|
+
padding: 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([overlayNav]) pd-icon {
|
|
153
|
+
margin: 0 0.25rem;
|
|
154
|
+
--pd-icon-bg-col: rgba(0, 0, 0, 0.15);
|
|
155
|
+
--pd-icon-bg-col-hover: rgba(0, 0, 0, 0.3);
|
|
156
|
+
backdrop-filter: blur(4px);
|
|
157
|
+
}
|
|
158
|
+
|
|
142
159
|
@media (max-width: 768px) {
|
|
143
160
|
.panel-container {
|
|
144
161
|
padding: 0 0.5rem;
|
|
@@ -190,9 +207,14 @@ class PdPanelViewer extends LitElement {
|
|
|
190
207
|
return this._index;
|
|
191
208
|
}
|
|
192
209
|
set index(value) {
|
|
193
|
-
this.
|
|
194
|
-
this.children[value].dispatchEvent(new CustomEvent("entered"));
|
|
210
|
+
const prev = this._index;
|
|
195
211
|
this._index = value;
|
|
212
|
+
this.children[prev].dispatchEvent(
|
|
213
|
+
new CustomEvent("exited", { bubbles: true })
|
|
214
|
+
);
|
|
215
|
+
this.children[value].dispatchEvent(
|
|
216
|
+
new CustomEvent("entered", { bubbles: true })
|
|
217
|
+
);
|
|
196
218
|
}
|
|
197
219
|
render() {
|
|
198
220
|
return html`
|
|
@@ -215,28 +237,36 @@ class PdPanelViewer extends LitElement {
|
|
|
215
237
|
>
|
|
216
238
|
<slot></slot>
|
|
217
239
|
</div>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
${this.children.length > 1 ? html`
|
|
241
|
+
<pd-icon
|
|
242
|
+
id="prev"
|
|
243
|
+
class=${classMap({ round: this.overlayNav })}
|
|
244
|
+
icon="previousArrow"
|
|
245
|
+
?activeIcon="${true}"
|
|
246
|
+
?disabled="${this.index <= 0}"
|
|
247
|
+
aria-label="${msg("Previous panel", {
|
|
248
|
+
id: "pd.panel.viewer.prev"
|
|
249
|
+
})}"
|
|
250
|
+
role="button"
|
|
251
|
+
tabindex="0"
|
|
252
|
+
@click=${this.previous}
|
|
253
|
+
@keydown=${this._onNavKeyDown}
|
|
254
|
+
></pd-icon>
|
|
255
|
+
<pd-icon
|
|
256
|
+
id="next"
|
|
257
|
+
class=${classMap({ round: this.overlayNav })}
|
|
258
|
+
icon="nextArrow"
|
|
259
|
+
?activeIcon="${true}"
|
|
260
|
+
?disabled="${this.index === this.children.length - 1}"
|
|
261
|
+
aria-label="${msg("Next panel", {
|
|
262
|
+
id: "pd.panel.viewer.next"
|
|
263
|
+
})}"
|
|
264
|
+
role="button"
|
|
265
|
+
tabindex="0"
|
|
266
|
+
@click=${this.next}
|
|
267
|
+
@keydown=${this._onNavKeyDown}
|
|
268
|
+
></pd-icon>
|
|
269
|
+
` : nothing}
|
|
240
270
|
</div>
|
|
241
271
|
${this.withProgress ? html` <div
|
|
242
272
|
id="progress"
|
|
@@ -254,7 +284,7 @@ class PdPanelViewer extends LitElement {
|
|
|
254
284
|
id: "pd.panel.viewer.panel"
|
|
255
285
|
})} ${i + 1}"
|
|
256
286
|
@click="${() => {
|
|
257
|
-
this.
|
|
287
|
+
this.index = i;
|
|
258
288
|
}}"
|
|
259
289
|
@keydown="${(e) => this._onProgressKeyDown(e, i)}"
|
|
260
290
|
class=${classMap({ watched: i <= this.index })}
|
|
@@ -340,7 +370,7 @@ class PdPanelViewer extends LitElement {
|
|
|
340
370
|
_onProgressKeyDown(e, index) {
|
|
341
371
|
if (e.key === "Enter" || e.key === " ") {
|
|
342
372
|
e.preventDefault();
|
|
343
|
-
this.
|
|
373
|
+
this.index = index;
|
|
344
374
|
} else if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
345
375
|
e.preventDefault();
|
|
346
376
|
this.next();
|
|
@@ -353,6 +383,9 @@ class PdPanelViewer extends LitElement {
|
|
|
353
383
|
__decorateClass([
|
|
354
384
|
property({ type: Boolean })
|
|
355
385
|
], PdPanelViewer.prototype, "withProgress");
|
|
386
|
+
__decorateClass([
|
|
387
|
+
property({ type: Boolean, reflect: true })
|
|
388
|
+
], PdPanelViewer.prototype, "overlayNav");
|
|
356
389
|
__decorateClass([
|
|
357
390
|
property({ type: Number })
|
|
358
391
|
], PdPanelViewer.prototype, "deltaCalc");
|
package/dist/pd-tab/PdTab.d.ts
CHANGED
|
@@ -3,11 +3,12 @@ import { TabHeader } from '../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Tab navigation component with header tabs and content slots.
|
|
5
5
|
*
|
|
6
|
-
* Supports
|
|
7
|
-
*
|
|
6
|
+
* Supports horizontal (default) and vertical orientation, plus
|
|
7
|
+
* responsive label switching (full -> short labels) when tabs
|
|
8
|
+
* overflow their container.
|
|
8
9
|
*
|
|
9
10
|
* @tagname pd-tab
|
|
10
|
-
* @summary Tab navigation with responsive
|
|
11
|
+
* @summary Tab navigation with horizontal/vertical orientation and responsive labels.
|
|
11
12
|
*
|
|
12
13
|
* @event tab-selected - Fired when a tab is selected. Emits the tab key.
|
|
13
14
|
*
|
|
@@ -18,8 +19,8 @@ import { TabHeader } from '../types';
|
|
|
18
19
|
* @cssprop --pd-tab-font-size-compact - Font size in compact mode. Default: `0.8rem`.
|
|
19
20
|
* @cssprop --pd-tab-text-col - Tab text color.
|
|
20
21
|
* @cssprop --pd-tab-active-text-col - Active tab text color.
|
|
21
|
-
* @cssprop --pd-tab-active-indicator-col - Active tab
|
|
22
|
-
* @cssprop --pd-tab-active-indicator-height - Active tab
|
|
22
|
+
* @cssprop --pd-tab-active-indicator-col - Active tab indicator color.
|
|
23
|
+
* @cssprop --pd-tab-active-indicator-height - Active tab indicator thickness. Default: `2px`.
|
|
23
24
|
* @cssprop --pd-tab-hover-bg-col - Tab hover background.
|
|
24
25
|
* @cssprop --pd-tab-disabled-text-col - Disabled tab text color.
|
|
25
26
|
* @cssprop --pd-tab-icon-size - Icon size in tab headers. Default: `1.125em`.
|
|
@@ -32,6 +33,8 @@ export declare class PdTab extends LitElement {
|
|
|
32
33
|
tabs: TabHeader[];
|
|
33
34
|
/** Key of the initially active tab. */
|
|
34
35
|
defaultTab?: string;
|
|
36
|
+
/** Tab orientation. Default: horizontal. */
|
|
37
|
+
orientation: "horizontal" | "vertical";
|
|
35
38
|
private _activeTab?;
|
|
36
39
|
private _headerContainer;
|
|
37
40
|
private _resizeObserver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdTab.d.ts","sourceRoot":"","sources":["../../src/pd-tab/PdTab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAgB,cAAc,EAAE,MAAM,KAAK,CAAC;AAGrE,OAAO,0CAA0C,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC
|
|
1
|
+
{"version":3,"file":"PdTab.d.ts","sourceRoot":"","sources":["../../src/pd-tab/PdTab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAgB,cAAc,EAAE,MAAM,KAAK,CAAC;AAGrE,OAAO,0CAA0C,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,KAAM,SAAQ,UAAU;IACnC,uCAAuC;IAEvC,IAAI,EAAE,SAAS,EAAE,CAAM;IAEvB,uCAAuC;IAEvC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,4CAA4C;IAE5C,WAAW,EAAE,YAAY,GAAG,UAAU,CAAgB;IAGtD,OAAO,CAAC,UAAU,CAAC,CAAS;IAG5B,OAAO,CAAC,gBAAgB,CAAe;IAEvC,OAAO,CAAC,eAAe,CAA+B;IAEtD,MAAM,CAAC,MAAM,EA6JR,cAAc,CAAC;cAED,UAAU,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;cAMzD,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAMhE,YAAY,IAAI,IAAI;IAKpB,oBAAoB,IAAI,IAAI;IAQrC,MAAM;IA0DN,KAAK;IAQL,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,UAAU;IAiDlB,OAAO,CAAC,YAAY;CAcrB"}
|