@krollins/blueprint 0.1.12 → 0.1.14
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/README.md +9 -3
- package/README.npm.md +9 -3
- package/dist/components/accordion.js +393 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert.js +213 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/avatar.js +237 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge.js +144 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.js +481 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button.js +192 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/card.js +223 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/checkbox.js +336 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/code-block/code-block.d.ts +143 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/code-block/code-block.style.d.ts +2 -0
- package/dist/components/code-block/code-block.style.d.ts.map +1 -0
- package/dist/components/code-block.js +587 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker.js +1660 -0
- package/dist/components/color-picker.js.map +1 -0
- package/dist/components/combobox.js +595 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/date-picker.js +726 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/divider.js +214 -0
- package/dist/components/divider.js.map +1 -0
- package/dist/components/drawer.js +568 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown.js +377 -0
- package/dist/components/dropdown.js.map +1 -0
- package/dist/components/file-upload.js +669 -0
- package/dist/components/file-upload.js.map +1 -0
- package/dist/components/heading.js +161 -0
- package/dist/components/heading.js.map +1 -0
- package/dist/components/icon.js +599 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input.js +363 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/link.js +178 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/menu.js +331 -0
- package/dist/components/menu.js.map +1 -0
- package/dist/components/modal.js +317 -0
- package/dist/components/modal.js.map +1 -0
- package/dist/components/multi-select.js +642 -0
- package/dist/components/multi-select.js.map +1 -0
- package/dist/components/notification.js +429 -0
- package/dist/components/notification.js.map +1 -0
- package/dist/components/number-input.js +556 -0
- package/dist/components/number-input.js.map +1 -0
- package/dist/components/pagination.js +320 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.js +597 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.js +219 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio.js +321 -0
- package/dist/components/radio.js.map +1 -0
- package/dist/components/select.js +498 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/skeleton.js +240 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.js +9 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/spinner.js +133 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stepper.js +812 -0
- package/dist/components/stepper.js.map +1 -0
- package/dist/components/switch.js +379 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.js +642 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.js +547 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tag/tag.d.ts.map +1 -1
- package/dist/components/tag.js +291 -0
- package/dist/components/tag.js.map +1 -0
- package/dist/components/text.js +278 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/textarea.js +380 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/time-picker.js +457 -0
- package/dist/components/time-picker.js.map +1 -0
- package/dist/components/tooltip.js +239 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/tree.js +582 -0
- package/dist/components/tree.js.map +1 -0
- package/dist/index.js +96 -17799
- package/dist/index.js.map +1 -1
- package/dist/shared/boolean-converter-XDGfS9LC.js +12 -0
- package/dist/shared/boolean-converter-XDGfS9LC.js.map +1 -0
- package/dist/shared/debounce-BckY30Sf.js +23 -0
- package/dist/shared/debounce-BckY30Sf.js.map +1 -0
- package/dist/shared/memoize-DlOFy-92.js +16 -0
- package/dist/shared/memoize-DlOFy-92.js.map +1 -0
- package/dist/shared/slider-BNt5TITl.js +484 -0
- package/dist/shared/slider-BNt5TITl.js.map +1 -0
- package/dist/utilities/memoize.d.ts.map +1 -1
- package/package.json +44 -2
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { css as d, LitElement as v, html as l } from "lit";
|
|
2
|
+
import { property as p, customElement as f } from "lit/decorators.js";
|
|
3
|
+
import { repeat as _ } from "lit/directives/repeat.js";
|
|
4
|
+
import { b as c } from "../shared/boolean-converter-XDGfS9LC.js";
|
|
5
|
+
const m = d`
|
|
6
|
+
/* Base styles */
|
|
7
|
+
:host {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.pagination {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: var(--bp-spacing-sm);
|
|
15
|
+
font-family: var(--bp-font-sans);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pagination__button {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
min-width: var(--bp-spacing-10);
|
|
23
|
+
height: var(--bp-spacing-10);
|
|
24
|
+
padding: var(--bp-spacing-xs) var(--bp-spacing-sm);
|
|
25
|
+
border: var(--bp-border-width) solid var(--bp-color-border);
|
|
26
|
+
border-radius: var(--bp-border-radius-md);
|
|
27
|
+
background-color: var(--bp-color-background);
|
|
28
|
+
color: var(--bp-color-text);
|
|
29
|
+
font-family: var(--bp-font-sans);
|
|
30
|
+
font-size: var(--bp-font-size-base);
|
|
31
|
+
font-weight: var(--bp-font-weight-medium);
|
|
32
|
+
line-height: var(--bp-line-height-tight);
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
transition:
|
|
35
|
+
background-color var(--bp-transition-fast),
|
|
36
|
+
border-color var(--bp-transition-fast),
|
|
37
|
+
color var(--bp-transition-fast),
|
|
38
|
+
transform var(--bp-transition-fast);
|
|
39
|
+
user-select: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.pagination__button:hover:not(:disabled) {
|
|
43
|
+
background-color: var(--bp-color-surface);
|
|
44
|
+
border-color: var(--bp-color-border-strong);
|
|
45
|
+
color: var(--bp-color-text);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pagination__button:active:not(:disabled) {
|
|
49
|
+
background-color: var(--bp-color-surface);
|
|
50
|
+
border-color: var(--bp-color-border-strong);
|
|
51
|
+
transform: translateY(1px) scale(0.98);
|
|
52
|
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pagination__button:focus-visible {
|
|
56
|
+
outline: var(--bp-border-width) solid var(--bp-color-primary);
|
|
57
|
+
outline-offset: var(--bp-spacing-0-5);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pagination__button:disabled {
|
|
61
|
+
opacity: 0.5;
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.pagination__button--active {
|
|
66
|
+
background-color: var(--bp-color-primary);
|
|
67
|
+
border-color: var(--bp-color-primary);
|
|
68
|
+
color: var(--bp-color-text-inverse);
|
|
69
|
+
font-weight: var(--bp-font-weight-semibold);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.pagination__button--active:hover:not(:disabled) {
|
|
73
|
+
background-color: var(--bp-color-primary-hover);
|
|
74
|
+
border-color: var(--bp-color-primary-hover);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.pagination__button--active:focus-visible {
|
|
78
|
+
outline: 2px solid var(--bp-color-text-inverse);
|
|
79
|
+
outline-offset: 2px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Navigation buttons (first, last, prev, next) - ghost style for visual hierarchy */
|
|
83
|
+
.pagination__button--first,
|
|
84
|
+
.pagination__button--last,
|
|
85
|
+
.pagination__button--prev,
|
|
86
|
+
.pagination__button--next {
|
|
87
|
+
color: var(--bp-color-text-muted);
|
|
88
|
+
background-color: transparent;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.pagination__button--first:hover:not(:disabled),
|
|
92
|
+
.pagination__button--last:hover:not(:disabled),
|
|
93
|
+
.pagination__button--prev:hover:not(:disabled),
|
|
94
|
+
.pagination__button--next:hover:not(:disabled) {
|
|
95
|
+
color: var(--bp-color-text);
|
|
96
|
+
background-color: var(--bp-color-surface);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.pagination__ellipsis {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
align-items: end;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
min-width: var(--bp-spacing-2xl);
|
|
104
|
+
height: var(--bp-spacing-2xl);
|
|
105
|
+
color: var(--bp-color-text-muted);
|
|
106
|
+
font-size: var(--bp-font-size-base);
|
|
107
|
+
user-select: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.pagination__info {
|
|
111
|
+
margin-left: var(--bp-spacing-lg);
|
|
112
|
+
color: var(--bp-color-text-muted);
|
|
113
|
+
font-size: var(--bp-font-size-sm);
|
|
114
|
+
white-space: nowrap;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Sizes */
|
|
118
|
+
.pagination--sm .pagination__button {
|
|
119
|
+
min-width: var(--bp-spacing-xl);
|
|
120
|
+
height: var(--bp-spacing-xl);
|
|
121
|
+
padding: var(--bp-spacing-2xs) var(--bp-spacing-xs);
|
|
122
|
+
font-size: var(--bp-font-size-sm);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.pagination--sm .pagination__ellipsis {
|
|
126
|
+
min-width: var(--bp-spacing-xl);
|
|
127
|
+
height: var(--bp-spacing-xl);
|
|
128
|
+
font-size: var(--bp-font-size-sm);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.pagination--sm .pagination__info {
|
|
132
|
+
font-size: var(--bp-font-size-xs);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.pagination--lg .pagination__button {
|
|
136
|
+
min-width: var(--bp-spacing-2xl);
|
|
137
|
+
height: var(--bp-spacing-2xl);
|
|
138
|
+
padding: var(--bp-spacing-sm) var(--bp-spacing-md);
|
|
139
|
+
font-size: var(--bp-font-size-lg);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.pagination--lg .pagination__ellipsis {
|
|
143
|
+
min-width: var(--bp-spacing-2xl);
|
|
144
|
+
height: var(--bp-spacing-2xl);
|
|
145
|
+
font-size: var(--bp-font-size-lg);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.pagination--lg .pagination__info {
|
|
149
|
+
font-size: var(--bp-font-size-base);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.pagination--lg {
|
|
153
|
+
gap: var(--bp-spacing-md);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* Touch target size: ensure 44x44px minimum on touch devices */
|
|
157
|
+
@media (pointer: coarse) {
|
|
158
|
+
.pagination__button {
|
|
159
|
+
min-width: 44px;
|
|
160
|
+
min-height: 44px;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
`;
|
|
164
|
+
var x = Object.defineProperty, y = Object.getOwnPropertyDescriptor, r = (t, n, s, a) => {
|
|
165
|
+
for (var i = a > 1 ? void 0 : a ? y(n, s) : n, b = t.length - 1, g; b >= 0; b--)
|
|
166
|
+
(g = t[b]) && (i = (a ? g(n, s, i) : g(i)) || i);
|
|
167
|
+
return a && i && x(n, s, i), i;
|
|
168
|
+
};
|
|
169
|
+
let e = class extends v {
|
|
170
|
+
constructor() {
|
|
171
|
+
super(), this.currentPage = 1, this.totalPages = 1, this.siblingCount = 1, this.boundaryCount = 1, this.showFirstLast = !0, this.showPrevNext = !0, this.showInfo = !1, this.disabled = !1, this.size = "md";
|
|
172
|
+
}
|
|
173
|
+
handlePageChange(t) {
|
|
174
|
+
this.disabled || t < 1 || t > this.totalPages || t === this.currentPage || (this.currentPage = t, this.dispatchEvent(
|
|
175
|
+
new CustomEvent("bp-page-change", {
|
|
176
|
+
detail: { page: t },
|
|
177
|
+
bubbles: !0,
|
|
178
|
+
composed: !0
|
|
179
|
+
})
|
|
180
|
+
));
|
|
181
|
+
}
|
|
182
|
+
getPageNumbers() {
|
|
183
|
+
const t = [], n = this.totalPages, s = this.currentPage, a = this.siblingCount, i = this.boundaryCount, b = Math.max(1, s - a), g = Math.min(n, s + a);
|
|
184
|
+
for (let o = 1; o <= Math.min(i, n); o++)
|
|
185
|
+
t.push(o);
|
|
186
|
+
b > i + 1 && t.push("ellipsis");
|
|
187
|
+
for (let o = b; o <= g; o++)
|
|
188
|
+
o > i && o <= n - i && t.push(o);
|
|
189
|
+
g < n - i && t.push("ellipsis");
|
|
190
|
+
for (let o = Math.max(n - i + 1, i + 1); o <= n; o++)
|
|
191
|
+
t.includes(o) || t.push(o);
|
|
192
|
+
return t.filter((o, u, h) => h.indexOf(o) === u);
|
|
193
|
+
}
|
|
194
|
+
render() {
|
|
195
|
+
const t = this.getPageNumbers(), n = this.currentPage === 1, s = this.currentPage === this.totalPages;
|
|
196
|
+
return l`
|
|
197
|
+
<nav
|
|
198
|
+
class="pagination pagination--${this.size}"
|
|
199
|
+
part="container"
|
|
200
|
+
aria-label="Pagination"
|
|
201
|
+
>
|
|
202
|
+
${this.showFirstLast ? l`
|
|
203
|
+
<button
|
|
204
|
+
class="pagination__button pagination__button--first"
|
|
205
|
+
part="button button-first"
|
|
206
|
+
?disabled=${this.disabled || n}
|
|
207
|
+
@click=${() => this.handlePageChange(1)}
|
|
208
|
+
aria-label="First page"
|
|
209
|
+
>
|
|
210
|
+
«
|
|
211
|
+
</button>
|
|
212
|
+
` : ""}
|
|
213
|
+
${this.showPrevNext ? l`
|
|
214
|
+
<button
|
|
215
|
+
class="pagination__button pagination__button--prev"
|
|
216
|
+
part="button button-prev"
|
|
217
|
+
?disabled=${this.disabled || n}
|
|
218
|
+
@click=${() => this.handlePageChange(this.currentPage - 1)}
|
|
219
|
+
aria-label="Previous page"
|
|
220
|
+
>
|
|
221
|
+
‹
|
|
222
|
+
</button>
|
|
223
|
+
` : ""}
|
|
224
|
+
${_(
|
|
225
|
+
t,
|
|
226
|
+
(a, i) => a === "ellipsis" ? `ellipsis-${i}` : a,
|
|
227
|
+
(a) => a === "ellipsis" ? l`
|
|
228
|
+
<span
|
|
229
|
+
class="pagination__ellipsis"
|
|
230
|
+
part="button-ellipsis"
|
|
231
|
+
aria-hidden="true"
|
|
232
|
+
>…</span
|
|
233
|
+
>
|
|
234
|
+
` : l`
|
|
235
|
+
<button
|
|
236
|
+
class="pagination__button pagination__button--page ${a === this.currentPage ? "pagination__button--active" : ""}"
|
|
237
|
+
part="button button-page"
|
|
238
|
+
?disabled=${this.disabled}
|
|
239
|
+
@click=${() => this.handlePageChange(a)}
|
|
240
|
+
aria-label="Page ${a}"
|
|
241
|
+
aria-current=${a === this.currentPage ? "page" : "false"}
|
|
242
|
+
>
|
|
243
|
+
${a}
|
|
244
|
+
</button>
|
|
245
|
+
`
|
|
246
|
+
)}
|
|
247
|
+
${this.showPrevNext ? l`
|
|
248
|
+
<button
|
|
249
|
+
class="pagination__button pagination__button--next"
|
|
250
|
+
part="button button-next"
|
|
251
|
+
?disabled=${this.disabled || s}
|
|
252
|
+
@click=${() => this.handlePageChange(this.currentPage + 1)}
|
|
253
|
+
aria-label="Next page"
|
|
254
|
+
>
|
|
255
|
+
›
|
|
256
|
+
</button>
|
|
257
|
+
` : ""}
|
|
258
|
+
${this.showFirstLast ? l`
|
|
259
|
+
<button
|
|
260
|
+
class="pagination__button pagination__button--last"
|
|
261
|
+
part="button button-last"
|
|
262
|
+
?disabled=${this.disabled || s}
|
|
263
|
+
@click=${() => this.handlePageChange(this.totalPages)}
|
|
264
|
+
aria-label="Last page"
|
|
265
|
+
>
|
|
266
|
+
»
|
|
267
|
+
</button>
|
|
268
|
+
` : ""}
|
|
269
|
+
${this.showInfo ? l`
|
|
270
|
+
<span class="pagination__info" part="info" aria-live="polite">
|
|
271
|
+
Page ${this.currentPage} of ${this.totalPages}
|
|
272
|
+
</span>
|
|
273
|
+
` : ""}
|
|
274
|
+
</nav>
|
|
275
|
+
`;
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
e.styles = [m];
|
|
279
|
+
r([
|
|
280
|
+
p({ type: Number, attribute: "current-page" })
|
|
281
|
+
], e.prototype, "currentPage", 2);
|
|
282
|
+
r([
|
|
283
|
+
p({ type: Number, attribute: "total-pages" })
|
|
284
|
+
], e.prototype, "totalPages", 2);
|
|
285
|
+
r([
|
|
286
|
+
p({ type: Number, attribute: "sibling-count" })
|
|
287
|
+
], e.prototype, "siblingCount", 2);
|
|
288
|
+
r([
|
|
289
|
+
p({ type: Number, attribute: "boundary-count" })
|
|
290
|
+
], e.prototype, "boundaryCount", 2);
|
|
291
|
+
r([
|
|
292
|
+
p({
|
|
293
|
+
converter: c,
|
|
294
|
+
reflect: !0,
|
|
295
|
+
attribute: "show-first-last"
|
|
296
|
+
})
|
|
297
|
+
], e.prototype, "showFirstLast", 2);
|
|
298
|
+
r([
|
|
299
|
+
p({
|
|
300
|
+
converter: c,
|
|
301
|
+
reflect: !0,
|
|
302
|
+
attribute: "show-prev-next"
|
|
303
|
+
})
|
|
304
|
+
], e.prototype, "showPrevNext", 2);
|
|
305
|
+
r([
|
|
306
|
+
p({ type: Boolean, attribute: "show-info" })
|
|
307
|
+
], e.prototype, "showInfo", 2);
|
|
308
|
+
r([
|
|
309
|
+
p({ type: Boolean })
|
|
310
|
+
], e.prototype, "disabled", 2);
|
|
311
|
+
r([
|
|
312
|
+
p({ type: String })
|
|
313
|
+
], e.prototype, "size", 2);
|
|
314
|
+
e = r([
|
|
315
|
+
f("bp-pagination")
|
|
316
|
+
], e);
|
|
317
|
+
export {
|
|
318
|
+
e as BpPagination
|
|
319
|
+
};
|
|
320
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sources":["../../source/components/pagination/pagination.style.ts","../../source/components/pagination/pagination.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const paginationStyles = css`\n /* Base styles */\n :host {\n display: inline-block;\n }\n\n .pagination {\n display: flex;\n align-items: center;\n gap: var(--bp-spacing-sm);\n font-family: var(--bp-font-sans);\n }\n\n .pagination__button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--bp-spacing-10);\n height: var(--bp-spacing-10);\n padding: var(--bp-spacing-xs) var(--bp-spacing-sm);\n border: var(--bp-border-width) solid var(--bp-color-border);\n border-radius: var(--bp-border-radius-md);\n background-color: var(--bp-color-background);\n color: var(--bp-color-text);\n font-family: var(--bp-font-sans);\n font-size: var(--bp-font-size-base);\n font-weight: var(--bp-font-weight-medium);\n line-height: var(--bp-line-height-tight);\n cursor: pointer;\n transition:\n background-color var(--bp-transition-fast),\n border-color var(--bp-transition-fast),\n color var(--bp-transition-fast),\n transform var(--bp-transition-fast);\n user-select: none;\n }\n\n .pagination__button:hover:not(:disabled) {\n background-color: var(--bp-color-surface);\n border-color: var(--bp-color-border-strong);\n color: var(--bp-color-text);\n }\n\n .pagination__button:active:not(:disabled) {\n background-color: var(--bp-color-surface);\n border-color: var(--bp-color-border-strong);\n transform: translateY(1px) scale(0.98);\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n\n .pagination__button:focus-visible {\n outline: var(--bp-border-width) solid var(--bp-color-primary);\n outline-offset: var(--bp-spacing-0-5);\n }\n\n .pagination__button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .pagination__button--active {\n background-color: var(--bp-color-primary);\n border-color: var(--bp-color-primary);\n color: var(--bp-color-text-inverse);\n font-weight: var(--bp-font-weight-semibold);\n }\n\n .pagination__button--active:hover:not(:disabled) {\n background-color: var(--bp-color-primary-hover);\n border-color: var(--bp-color-primary-hover);\n }\n\n .pagination__button--active:focus-visible {\n outline: 2px solid var(--bp-color-text-inverse);\n outline-offset: 2px;\n }\n\n /* Navigation buttons (first, last, prev, next) - ghost style for visual hierarchy */\n .pagination__button--first,\n .pagination__button--last,\n .pagination__button--prev,\n .pagination__button--next {\n color: var(--bp-color-text-muted);\n background-color: transparent;\n }\n\n .pagination__button--first:hover:not(:disabled),\n .pagination__button--last:hover:not(:disabled),\n .pagination__button--prev:hover:not(:disabled),\n .pagination__button--next:hover:not(:disabled) {\n color: var(--bp-color-text);\n background-color: var(--bp-color-surface);\n }\n\n .pagination__ellipsis {\n display: inline-flex;\n align-items: end;\n justify-content: center;\n min-width: var(--bp-spacing-2xl);\n height: var(--bp-spacing-2xl);\n color: var(--bp-color-text-muted);\n font-size: var(--bp-font-size-base);\n user-select: none;\n }\n\n .pagination__info {\n margin-left: var(--bp-spacing-lg);\n color: var(--bp-color-text-muted);\n font-size: var(--bp-font-size-sm);\n white-space: nowrap;\n }\n\n /* Sizes */\n .pagination--sm .pagination__button {\n min-width: var(--bp-spacing-xl);\n height: var(--bp-spacing-xl);\n padding: var(--bp-spacing-2xs) var(--bp-spacing-xs);\n font-size: var(--bp-font-size-sm);\n }\n\n .pagination--sm .pagination__ellipsis {\n min-width: var(--bp-spacing-xl);\n height: var(--bp-spacing-xl);\n font-size: var(--bp-font-size-sm);\n }\n\n .pagination--sm .pagination__info {\n font-size: var(--bp-font-size-xs);\n }\n\n .pagination--lg .pagination__button {\n min-width: var(--bp-spacing-2xl);\n height: var(--bp-spacing-2xl);\n padding: var(--bp-spacing-sm) var(--bp-spacing-md);\n font-size: var(--bp-font-size-lg);\n }\n\n .pagination--lg .pagination__ellipsis {\n min-width: var(--bp-spacing-2xl);\n height: var(--bp-spacing-2xl);\n font-size: var(--bp-font-size-lg);\n }\n\n .pagination--lg .pagination__info {\n font-size: var(--bp-font-size-base);\n }\n\n .pagination--lg {\n gap: var(--bp-spacing-md);\n }\n\n /* Touch target size: ensure 44x44px minimum on touch devices */\n @media (pointer: coarse) {\n .pagination__button {\n min-width: 44px;\n min-height: 44px;\n }\n }\n`;\n","import { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { paginationStyles } from './pagination.style.js';\nimport { booleanConverter } from '../../utilities/boolean-converter.js';\n\n/**\n * A pagination component for navigating through multiple pages of content.\n *\n * @fires bp-page-change - Dispatched when the page changes\n *\n * @slot - Default slot for custom content (not typically used)\n *\n * @csspart container - The main pagination container\n * @csspart button - All pagination buttons\n * @csspart button-first - The first page button\n * @csspart button-prev - The previous page button\n * @csspart button-next - The next page button\n * @csspart button-last - The last page button\n * @csspart button-page - Individual page number buttons\n * @csspart button-ellipsis - Ellipsis indicators\n * @csspart info - The page info text\n */\n@customElement('bp-pagination')\nexport class BpPagination extends LitElement {\n /** Current page number (1-indexed) */\n @property({ type: Number, attribute: 'current-page' })\n declare currentPage: number;\n\n /** Total number of pages */\n @property({ type: Number, attribute: 'total-pages' })\n declare totalPages: number;\n\n /** Number of page buttons to show around the current page */\n @property({ type: Number, attribute: 'sibling-count' })\n declare siblingCount: number;\n\n /** Number of page buttons to show at the start and end */\n @property({ type: Number, attribute: 'boundary-count' })\n declare boundaryCount: number;\n\n /** Show first/last page buttons */\n @property({\n converter: booleanConverter,\n reflect: true,\n attribute: 'show-first-last',\n })\n declare showFirstLast: boolean;\n\n /** Show previous/next page buttons */\n @property({\n converter: booleanConverter,\n reflect: true,\n attribute: 'show-prev-next',\n })\n declare showPrevNext: boolean;\n\n /** Show page info text (e.g., \"Page 1 of 10\") */\n @property({ type: Boolean, attribute: 'show-info' })\n declare showInfo: boolean;\n\n /** Disable all pagination controls */\n @property({ type: Boolean }) declare disabled: boolean;\n\n /** Size variant */\n @property({ type: String }) declare size: 'sm' | 'md' | 'lg';\n\n static styles = [paginationStyles];\n\n constructor() {\n super();\n this.currentPage = 1;\n this.totalPages = 1;\n this.siblingCount = 1;\n this.boundaryCount = 1;\n this.showFirstLast = true;\n this.showPrevNext = true;\n this.showInfo = false;\n this.disabled = false;\n this.size = 'md';\n }\n\n private handlePageChange(newPage: number) {\n if (\n this.disabled ||\n newPage < 1 ||\n newPage > this.totalPages ||\n newPage === this.currentPage\n ) {\n return;\n }\n\n this.currentPage = newPage;\n this.dispatchEvent(\n new CustomEvent('bp-page-change', {\n detail: { page: newPage },\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private getPageNumbers(): (number | 'ellipsis')[] {\n const pages: (number | 'ellipsis')[] = [];\n const totalCount = this.totalPages;\n const currentPageNum = this.currentPage;\n const siblingCountNum = this.siblingCount;\n const boundaryCountNum = this.boundaryCount;\n\n // Calculate range around current page\n const startPage = Math.max(1, currentPageNum - siblingCountNum);\n const endPage = Math.min(totalCount, currentPageNum + siblingCountNum);\n\n // Add boundary pages at start\n for (let i = 1; i <= Math.min(boundaryCountNum, totalCount); i++) {\n pages.push(i);\n }\n\n // Add ellipsis after boundary if needed\n if (startPage > boundaryCountNum + 1) {\n pages.push('ellipsis');\n }\n\n // Add pages around current page\n for (let i = startPage; i <= endPage; i++) {\n if (i > boundaryCountNum && i <= totalCount - boundaryCountNum) {\n pages.push(i);\n }\n }\n\n // Add ellipsis before end boundary if needed\n if (endPage < totalCount - boundaryCountNum) {\n pages.push('ellipsis');\n }\n\n // Add boundary pages at end\n for (\n let i = Math.max(totalCount - boundaryCountNum + 1, boundaryCountNum + 1);\n i <= totalCount;\n i++\n ) {\n if (!pages.includes(i)) {\n pages.push(i);\n }\n }\n\n // Remove duplicates while preserving order\n return pages.filter((page, index, self) => self.indexOf(page) === index);\n }\n\n render() {\n const pageNumbers = this.getPageNumbers();\n const isFirstPage = this.currentPage === 1;\n const isLastPage = this.currentPage === this.totalPages;\n\n return html`\n <nav\n class=\"pagination pagination--${this.size}\"\n part=\"container\"\n aria-label=\"Pagination\"\n >\n ${this.showFirstLast\n ? html`\n <button\n class=\"pagination__button pagination__button--first\"\n part=\"button button-first\"\n ?disabled=${this.disabled || isFirstPage}\n @click=${() => this.handlePageChange(1)}\n aria-label=\"First page\"\n >\n «\n </button>\n `\n : ''}\n ${this.showPrevNext\n ? html`\n <button\n class=\"pagination__button pagination__button--prev\"\n part=\"button button-prev\"\n ?disabled=${this.disabled || isFirstPage}\n @click=${() => this.handlePageChange(this.currentPage - 1)}\n aria-label=\"Previous page\"\n >\n ‹\n </button>\n `\n : ''}\n ${repeat(\n pageNumbers,\n (page, index) => (page === 'ellipsis' ? `ellipsis-${index}` : page),\n (page) =>\n page === 'ellipsis'\n ? html`\n <span\n class=\"pagination__ellipsis\"\n part=\"button-ellipsis\"\n aria-hidden=\"true\"\n >…</span\n >\n `\n : html`\n <button\n class=\"pagination__button pagination__button--page ${page ===\n this.currentPage\n ? 'pagination__button--active'\n : ''}\"\n part=\"button button-page\"\n ?disabled=${this.disabled}\n @click=${() => this.handlePageChange(page)}\n aria-label=\"Page ${page}\"\n aria-current=${page === this.currentPage ? 'page' : 'false'}\n >\n ${page}\n </button>\n `\n )}\n ${this.showPrevNext\n ? html`\n <button\n class=\"pagination__button pagination__button--next\"\n part=\"button button-next\"\n ?disabled=${this.disabled || isLastPage}\n @click=${() => this.handlePageChange(this.currentPage + 1)}\n aria-label=\"Next page\"\n >\n ›\n </button>\n `\n : ''}\n ${this.showFirstLast\n ? html`\n <button\n class=\"pagination__button pagination__button--last\"\n part=\"button button-last\"\n ?disabled=${this.disabled || isLastPage}\n @click=${() => this.handlePageChange(this.totalPages)}\n aria-label=\"Last page\"\n >\n »\n </button>\n `\n : ''}\n ${this.showInfo\n ? html`\n <span class=\"pagination__info\" part=\"info\" aria-live=\"polite\">\n Page ${this.currentPage} of ${this.totalPages}\n </span>\n `\n : ''}\n </nav>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bp-pagination': BpPagination;\n }\n}\n"],"names":["paginationStyles","css","BpPagination","LitElement","newPage","pages","totalCount","currentPageNum","siblingCountNum","boundaryCountNum","startPage","endPage","i","page","index","self","pageNumbers","isFirstPage","isLastPage","html","repeat","__decorateClass","property","booleanConverter","customElement"],"mappings":";;;;AAEO,MAAMA,IAAmBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;ACsBzB,IAAMC,IAAN,cAA2BC,EAAW;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