@bluevolt-tech/lumen 1.5.2 → 2.0.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/components/bv-alert-banner/bv-alert-banner.d.ts +33 -0
- package/dist/components/bv-alert-banner/bv-alert-banner.js +206 -0
- package/dist/components/bv-badge/bv-badge.d.ts +1 -1
- package/dist/components/bv-badge/bv-badge.js +1 -1
- package/dist/components/bv-button/bv-button.d.ts +1 -1
- package/dist/components/bv-button/bv-button.js +1 -1
- package/dist/components/bv-checkbox/bv-checkbox.js +1 -1
- package/dist/components/bv-course-detail-modal/bv-course-detail-modal.js +1 -1
- package/dist/components/bv-course-grid-card/bv-course-grid-card.d.ts +4 -0
- package/dist/components/bv-course-grid-card/bv-course-grid-card.js +75 -18
- package/dist/components/bv-course-list-card/bv-course-list-card.d.ts +4 -0
- package/dist/components/bv-course-list-card/bv-course-list-card.js +75 -18
- package/dist/components/bv-date-range-input/bv-date-range-input.d.ts +23 -0
- package/dist/components/bv-date-range-input/bv-date-range-input.js +950 -0
- package/dist/components/bv-date-range-picker/bv-date-range-picker.d.ts +56 -0
- package/dist/components/bv-date-range-picker/bv-date-range-picker.js +778 -0
- package/dist/components/bv-empty-state/bv-empty-state.js +1 -1
- package/dist/components/bv-filter-dropdown/bv-filter-dropdown.d.ts +20 -5
- package/dist/components/bv-filter-dropdown/bv-filter-dropdown.js +263 -25
- package/dist/components/bv-filter-panel/bv-filter-panel.js +1 -1
- package/dist/components/bv-input/bv-input.d.ts +24 -0
- package/dist/components/bv-input/bv-input.js +148 -0
- package/dist/components/bv-input-dropdown/bv-input-dropdown.d.ts +46 -0
- package/dist/components/bv-input-dropdown/bv-input-dropdown.js +501 -0
- package/dist/components/bv-pagination/bv-pagination.d.ts +13 -1
- package/dist/components/bv-pagination/bv-pagination.js +290 -9
- package/dist/components/bv-portal-header/bv-portal-header.js +2 -2
- package/dist/components/bv-searchbox/bv-searchbox.js +1 -1
- package/dist/components/bv-segmented-control/bv-segmented-control.d.ts +26 -0
- package/dist/components/bv-segmented-control/bv-segmented-control.js +128 -0
- package/dist/components/bv-select/bv-select.d.ts +41 -0
- package/dist/components/bv-select/bv-select.js +240 -0
- package/dist/components/bv-split-button/bv-split-button.d.ts +37 -0
- package/dist/components/bv-split-button/bv-split-button.js +264 -0
- package/dist/components/bv-table/bv-table.d.ts +15 -0
- package/dist/components/bv-table/bv-table.js +260 -33
- package/dist/components/bv-toggle/bv-toggle.d.ts +2 -1
- package/dist/components/bv-toggle/bv-toggle.js +2 -2
- package/dist/components/bv-tooltip/bv-tooltip.d.ts +18 -0
- package/dist/components/bv-tooltip/bv-tooltip.js +144 -0
- package/dist/components/bv-user-row/bv-user-row.js +1 -1
- package/dist/storybook/stories/screens/cet-report.data.d.ts +55 -0
- package/dist/storybook/stories/screens/cet-report.data.js +3697 -0
- package/dist/themes/base.css +15 -1
- package/package.json +42 -1
- package/themes/base.css +15 -1
|
@@ -1,16 +1,205 @@
|
|
|
1
1
|
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-pagination/bv-pagination.css
|
|
2
|
-
var bv_pagination_default =
|
|
2
|
+
var bv_pagination_default = `:host {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.wrap {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
gap: var(--bv-spacing-xl);
|
|
11
|
+
width: 100%;
|
|
12
|
+
font-family: var(--bv-font-family-base);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* \u2500\u2500 Meta section (results count + page-size) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
16
|
+
|
|
17
|
+
.meta {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--bv-spacing-sm);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.results-count {
|
|
24
|
+
font-size: var(--bv-font-size-sm);
|
|
25
|
+
font-weight: var(--bv-font-weight-semibold);
|
|
26
|
+
color: var(--bv-color-neutral-700);
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
margin-right: var(--bv-spacing-sm);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.page-size-wrap {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 6px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.page-size-select {
|
|
38
|
+
height: 36px;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
border: 1px solid var(--bv-color-neutral-300);
|
|
41
|
+
border-radius: var(--bv-radius-lg);
|
|
42
|
+
background-color: var(--bv-color-neutral-0);
|
|
43
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5l5 5 5-5' stroke='%23667085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
44
|
+
background-repeat: no-repeat;
|
|
45
|
+
background-position: right 8px center;
|
|
46
|
+
appearance: none;
|
|
47
|
+
-webkit-appearance: none;
|
|
48
|
+
font-family: inherit;
|
|
49
|
+
font-size: var(--bv-font-size-sm);
|
|
50
|
+
font-weight: var(--bv-font-weight-semibold);
|
|
51
|
+
color: var(--bv-color-neutral-700);
|
|
52
|
+
padding: 0 28px 0 var(--bv-spacing-sm);
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
box-shadow: var(--bv-shadow-sm);
|
|
55
|
+
outline: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.page-size-select:focus {
|
|
59
|
+
border-color: var(--bv-color-primary);
|
|
60
|
+
box-shadow:
|
|
61
|
+
0 0 0 3px var(--bv-color-primary-light),
|
|
62
|
+
0 1px 2px 0 rgba(16, 24, 40, 0.05);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.per-page-label {
|
|
66
|
+
font-size: var(--bv-font-size-sm);
|
|
67
|
+
color: var(--bv-color-neutral-500);
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* \u2500\u2500 Nav section \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
72
|
+
|
|
73
|
+
.nav {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: var(--bv-spacing-xs);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* \u2500\u2500 Shared button base \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
80
|
+
|
|
81
|
+
.btn {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
border: 1px solid transparent;
|
|
86
|
+
border-radius: var(--bv-radius-lg);
|
|
87
|
+
background: transparent;
|
|
88
|
+
font-family: inherit;
|
|
89
|
+
font-size: var(--bv-font-size-sm);
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
transition:
|
|
92
|
+
background var(--bv-transition-fast),
|
|
93
|
+
color var(--bv-transition-fast);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Prev / Next buttons */
|
|
97
|
+
.nav-btn {
|
|
98
|
+
gap: var(--bv-spacing-xs);
|
|
99
|
+
height: 36px;
|
|
100
|
+
padding: 0 var(--bv-spacing-sm);
|
|
101
|
+
border-color: var(--bv-color-neutral-300);
|
|
102
|
+
background: var(--bv-color-neutral-0);
|
|
103
|
+
color: var(--bv-color-neutral-700);
|
|
104
|
+
font-weight: var(--bv-font-weight-semibold);
|
|
105
|
+
box-shadow: var(--bv-shadow-sm);
|
|
106
|
+
white-space: nowrap;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.nav-btn:hover:not(:disabled) {
|
|
110
|
+
background: var(--bv-color-neutral-100);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.nav-btn:disabled {
|
|
114
|
+
opacity: 0.5;
|
|
115
|
+
cursor: not-allowed;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.nav-icon {
|
|
119
|
+
width: 20px;
|
|
120
|
+
height: 20px;
|
|
121
|
+
flex-shrink: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Compact page label \u2014 plain text between Prev / Next */
|
|
125
|
+
.page-label {
|
|
126
|
+
font-size: var(--bv-font-size-sm);
|
|
127
|
+
font-weight: var(--bv-font-weight-semibold);
|
|
128
|
+
color: var(--bv-color-neutral-700);
|
|
129
|
+
white-space: nowrap;
|
|
130
|
+
padding: 0 var(--bv-spacing-md);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* \u2500\u2500 Page number buttons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
134
|
+
|
|
135
|
+
.pages {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
gap: 2px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.page-btn {
|
|
142
|
+
width: 40px;
|
|
143
|
+
height: 40px;
|
|
144
|
+
color: var(--bv-color-neutral-600);
|
|
145
|
+
font-weight: var(--bv-font-weight-medium);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.page-btn:hover:not(.active) {
|
|
149
|
+
background: var(--bv-color-neutral-100);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.page-btn.active {
|
|
153
|
+
background: var(--bv-color-neutral-100);
|
|
154
|
+
color: var(--bv-color-neutral-900);
|
|
155
|
+
cursor: default;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ellipsis {
|
|
159
|
+
display: inline-flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
width: 40px;
|
|
163
|
+
height: 40px;
|
|
164
|
+
font-size: var(--bv-font-size-sm);
|
|
165
|
+
color: var(--bv-color-neutral-400);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* \u2500\u2500 Range label \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
169
|
+
|
|
170
|
+
.range-label {
|
|
171
|
+
font-size: var(--bv-font-size-sm);
|
|
172
|
+
font-weight: var(--bv-font-weight-medium);
|
|
173
|
+
color: var(--bv-color-neutral-600);
|
|
174
|
+
white-space: nowrap;
|
|
175
|
+
margin-left: var(--bv-spacing-xs);
|
|
176
|
+
}
|
|
177
|
+
`;
|
|
3
178
|
|
|
4
179
|
// components/bv-pagination/bv-pagination.ts
|
|
5
180
|
var PREV_ICON = `<svg class="nav-icon" viewBox="0 0 20 20" fill="none"><path d="M12.5 15l-5-5 5-5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
|
|
6
181
|
var NEXT_ICON = `<svg class="nav-icon" viewBox="0 0 20 20" fill="none"><path d="M7.5 5l5 5-5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
|
|
7
182
|
var BvPagination = class extends HTMLElement {
|
|
8
|
-
static observedAttributes = [
|
|
183
|
+
static observedAttributes = [
|
|
184
|
+
"page",
|
|
185
|
+
"total-pages",
|
|
186
|
+
"total",
|
|
187
|
+
"page-size",
|
|
188
|
+
"siblings",
|
|
189
|
+
"show-results",
|
|
190
|
+
"show-page-size",
|
|
191
|
+
"page-size-options",
|
|
192
|
+
"compact"
|
|
193
|
+
];
|
|
9
194
|
_rendered = false;
|
|
10
195
|
_pagesEl = null;
|
|
11
196
|
_prevBtn = null;
|
|
12
197
|
_nextBtn = null;
|
|
13
198
|
_rangeEl = null;
|
|
199
|
+
_resultsEl = null;
|
|
200
|
+
_pageSizeWrapEl = null;
|
|
201
|
+
_pageSizeSelectEl = null;
|
|
202
|
+
_pageLabelEl = null;
|
|
14
203
|
constructor() {
|
|
15
204
|
super();
|
|
16
205
|
this.attachShadow({ mode: "open" });
|
|
@@ -41,6 +230,31 @@ var BvPagination = class extends HTMLElement {
|
|
|
41
230
|
get siblings() {
|
|
42
231
|
return parseInt(this.getAttribute("siblings") ?? "1", 10);
|
|
43
232
|
}
|
|
233
|
+
get showResults() {
|
|
234
|
+
return this.hasAttribute("show-results");
|
|
235
|
+
}
|
|
236
|
+
set showResults(v) {
|
|
237
|
+
if (v) this.setAttribute("show-results", "");
|
|
238
|
+
else this.removeAttribute("show-results");
|
|
239
|
+
}
|
|
240
|
+
get showPageSize() {
|
|
241
|
+
return this.hasAttribute("show-page-size");
|
|
242
|
+
}
|
|
243
|
+
set showPageSize(v) {
|
|
244
|
+
if (v) this.setAttribute("show-page-size", "");
|
|
245
|
+
else this.removeAttribute("show-page-size");
|
|
246
|
+
}
|
|
247
|
+
get compact() {
|
|
248
|
+
return this.hasAttribute("compact");
|
|
249
|
+
}
|
|
250
|
+
set compact(v) {
|
|
251
|
+
if (v) this.setAttribute("compact", "");
|
|
252
|
+
else this.removeAttribute("compact");
|
|
253
|
+
}
|
|
254
|
+
get pageSizeOptions() {
|
|
255
|
+
const raw = this.getAttribute("page-size-options") ?? "10,25,50,100";
|
|
256
|
+
return raw.split(",").map((v) => parseInt(v.trim(), 10)).filter((v) => !isNaN(v));
|
|
257
|
+
}
|
|
44
258
|
_go(p) {
|
|
45
259
|
const { page, totalPages } = this;
|
|
46
260
|
if (p < 1 || p > totalPages || p === page) return;
|
|
@@ -64,17 +278,48 @@ var BvPagination = class extends HTMLElement {
|
|
|
64
278
|
}
|
|
65
279
|
const wrap = document.createElement("div");
|
|
66
280
|
wrap.className = "wrap";
|
|
281
|
+
const metaEl = document.createElement("div");
|
|
282
|
+
metaEl.className = "meta";
|
|
283
|
+
const resultsEl = document.createElement("span");
|
|
284
|
+
resultsEl.className = "results-count";
|
|
285
|
+
this._resultsEl = resultsEl;
|
|
286
|
+
const pageSizeWrap = document.createElement("span");
|
|
287
|
+
pageSizeWrap.className = "page-size-wrap";
|
|
288
|
+
const pageSizeSelect = document.createElement("select");
|
|
289
|
+
pageSizeSelect.className = "page-size-select";
|
|
290
|
+
pageSizeSelect.setAttribute("aria-label", "Per page");
|
|
291
|
+
this._pageSizeSelectEl = pageSizeSelect;
|
|
292
|
+
pageSizeSelect.addEventListener("change", () => {
|
|
293
|
+
const newSize = parseInt(pageSizeSelect.value, 10);
|
|
294
|
+
this.setAttribute("page-size", String(newSize));
|
|
295
|
+
this.dispatchEvent(
|
|
296
|
+
new CustomEvent("bv-page-size-change", {
|
|
297
|
+
bubbles: true,
|
|
298
|
+
composed: true,
|
|
299
|
+
detail: { pageSize: newSize }
|
|
300
|
+
})
|
|
301
|
+
);
|
|
302
|
+
});
|
|
303
|
+
const perPageLabel = document.createElement("span");
|
|
304
|
+
perPageLabel.className = "per-page-label";
|
|
305
|
+
perPageLabel.textContent = "per page";
|
|
306
|
+
pageSizeWrap.append(pageSizeSelect, perPageLabel);
|
|
307
|
+
this._pageSizeWrapEl = pageSizeWrap;
|
|
308
|
+
metaEl.append(resultsEl, pageSizeWrap);
|
|
309
|
+
const navEl = document.createElement("div");
|
|
310
|
+
navEl.className = "nav";
|
|
67
311
|
const prevBtn = document.createElement("button");
|
|
68
312
|
prevBtn.className = "btn nav-btn";
|
|
69
313
|
prevBtn.setAttribute("aria-label", "Previous");
|
|
70
314
|
prevBtn.innerHTML = `${PREV_ICON}<span class="nav-label">Previous</span>`;
|
|
71
315
|
prevBtn.addEventListener("click", () => this._go(this.page - 1));
|
|
72
316
|
this._prevBtn = prevBtn;
|
|
317
|
+
const pageLabelEl = document.createElement("span");
|
|
318
|
+
pageLabelEl.className = "page-label";
|
|
319
|
+
this._pageLabelEl = pageLabelEl;
|
|
73
320
|
const pagesEl = document.createElement("div");
|
|
74
321
|
pagesEl.className = "pages";
|
|
75
322
|
this._pagesEl = pagesEl;
|
|
76
|
-
const rightSection = document.createElement("div");
|
|
77
|
-
rightSection.className = "right-section";
|
|
78
323
|
const rangeEl = document.createElement("span");
|
|
79
324
|
rangeEl.className = "range-label";
|
|
80
325
|
this._rangeEl = rangeEl;
|
|
@@ -84,17 +329,26 @@ var BvPagination = class extends HTMLElement {
|
|
|
84
329
|
nextBtn.innerHTML = `<span class="nav-label">Next</span>${NEXT_ICON}`;
|
|
85
330
|
nextBtn.addEventListener("click", () => this._go(this.page + 1));
|
|
86
331
|
this._nextBtn = nextBtn;
|
|
87
|
-
|
|
88
|
-
wrap.append(
|
|
332
|
+
navEl.append(prevBtn, pageLabelEl, pagesEl, rangeEl, nextBtn);
|
|
333
|
+
wrap.append(metaEl, navEl);
|
|
89
334
|
shadow.appendChild(wrap);
|
|
90
335
|
this._update();
|
|
91
336
|
}
|
|
92
337
|
_update() {
|
|
93
|
-
const { page, totalPages, total, pageSize, siblings } = this;
|
|
338
|
+
const { page, totalPages, total, pageSize, siblings, compact } = this;
|
|
94
339
|
if (this._prevBtn) this._prevBtn.disabled = page <= 1;
|
|
95
340
|
if (this._nextBtn) this._nextBtn.disabled = page >= totalPages;
|
|
341
|
+
if (this._pageLabelEl) {
|
|
342
|
+
this._pageLabelEl.hidden = !compact;
|
|
343
|
+
if (compact) this._pageLabelEl.textContent = `Page ${page} of ${totalPages}`;
|
|
344
|
+
}
|
|
345
|
+
if (this._pagesEl) {
|
|
346
|
+
this._pagesEl.hidden = compact;
|
|
347
|
+
}
|
|
96
348
|
if (this._rangeEl) {
|
|
97
|
-
if (
|
|
349
|
+
if (compact) {
|
|
350
|
+
this._rangeEl.hidden = true;
|
|
351
|
+
} else if (total > 0) {
|
|
98
352
|
const start = (page - 1) * pageSize + 1;
|
|
99
353
|
const end = Math.min(page * pageSize, total);
|
|
100
354
|
this._rangeEl.textContent = `${start} - ${end} of ${total}`;
|
|
@@ -103,7 +357,17 @@ var BvPagination = class extends HTMLElement {
|
|
|
103
357
|
this._rangeEl.hidden = true;
|
|
104
358
|
}
|
|
105
359
|
}
|
|
106
|
-
if (
|
|
360
|
+
if (this._resultsEl) {
|
|
361
|
+
this._resultsEl.textContent = `${total} results`;
|
|
362
|
+
this._resultsEl.hidden = !this.showResults;
|
|
363
|
+
}
|
|
364
|
+
if (this._pageSizeWrapEl) {
|
|
365
|
+
this._pageSizeWrapEl.hidden = !this.showPageSize;
|
|
366
|
+
}
|
|
367
|
+
if (this._pageSizeSelectEl) {
|
|
368
|
+
this._syncPageSizeOptions(pageSize);
|
|
369
|
+
}
|
|
370
|
+
if (!this._pagesEl || compact) return;
|
|
107
371
|
this._pagesEl.innerHTML = "";
|
|
108
372
|
const pages = this._pageRange(page, totalPages, siblings);
|
|
109
373
|
let lastPage = 0;
|
|
@@ -122,6 +386,23 @@ var BvPagination = class extends HTMLElement {
|
|
|
122
386
|
lastPage = p;
|
|
123
387
|
}
|
|
124
388
|
}
|
|
389
|
+
_syncPageSizeOptions(currentSize) {
|
|
390
|
+
if (!this._pageSizeSelectEl) return;
|
|
391
|
+
const options = this.pageSizeOptions;
|
|
392
|
+
const select = this._pageSizeSelectEl;
|
|
393
|
+
const existing = Array.from(select.options).map((o) => parseInt(o.value, 10));
|
|
394
|
+
const needsRebuild = existing.length !== options.length || existing.some((v, i) => v !== options[i]);
|
|
395
|
+
if (needsRebuild) {
|
|
396
|
+
select.innerHTML = "";
|
|
397
|
+
for (const size of options) {
|
|
398
|
+
const opt = document.createElement("option");
|
|
399
|
+
opt.value = String(size);
|
|
400
|
+
opt.textContent = String(size);
|
|
401
|
+
select.appendChild(opt);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
select.value = String(currentSize);
|
|
405
|
+
}
|
|
125
406
|
_pageRange(current, total, siblings) {
|
|
126
407
|
const left = Math.max(2, current - siblings);
|
|
127
408
|
const right = Math.min(total - 1, current + siblings);
|
|
@@ -84,7 +84,7 @@ if (!customElements.get("bv-avatar")) {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-button/bv-button.css
|
|
87
|
-
var bv_button_default = "/* \u2500\u2500 Public theming API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n Apps can override these three properties per-instance:\n\n HTML: <bv-button style=\"--bv-button-bg: #e53e3e;\">\n Angular: <bv-button [style.--bv-button-bg]=\"brandColor\">\n JavaScript: btn.style.setProperty('--bv-button-bg', value)\n\n Hover is auto-computed from the base colors via color-mix().\n Override --bv-button-bg-hover / --bv-button-border-color-hover\n if you need explicit control over the hovered state.\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n:host {\n /* Default values \u2014 map to global tokens (primary variant) */\n --bv-button-bg: var(--bv-color-primary);\n --bv-button-bg-hover: color-mix(in srgb, var(--bv-button-bg) 82%, black);\n --bv-button-color: var(--bv-color-neutral-0);\n --bv-button-border-color: var(--bv-color-primary);\n --bv-button-border-color-hover: color-mix(in srgb, var(--bv-button-border-color) 82%, black);\n --bv-button-font-family: var(--bv-font-family-base);\n --bv-button-font-size: var(--bv-font-size-sm);\n\n display: inline-block;\n font-family: var(--bv-font-family-base);\n}\n\n:host([hidden]) {\n /* `!important` so `hidden` always wins over :host([full-width]) / other display rules. */\n display: none !important;\n}\n\n:host([full-width]) {\n display: block;\n width: 100%;\n}\n\n/* \u2500\u2500 Variant tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n Each variant re-points the component tokens to different global\n tokens. Apps can still override with inline styles \u2014 inline style\n always wins due to higher specificity.\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n:host([variant='secondary']) {\n --bv-button-bg: var(--bv-color-secondary);\n --bv-button-border-color: var(--bv-color-secondary);\n --bv-button-color: var(--bv-color-secondary-foreground);\n}\n\n:host([variant='tertiary']) {\n --bv-button-bg: var(--bv-color-tertiary);\n --bv-button-border-color: var(--bv-color-tertiary);\n}\n\n:host([variant='danger']) {\n --bv-button-bg: var(--bv-color-danger);\n --bv-button-border-color: var(--bv-color-danger);\n}\n\n:host([variant='ghost']) {\n --bv-button-bg: transparent;\n --bv-button-bg-hover: var(--bv-color-primary-light);\n --bv-button-color: var(--bv-color-primary);\n --bv-button-border-color: transparent;\n --bv-button-border-color-hover: transparent;\n}\n\n:host([variant='outline']) {\n --bv-button-bg: transparent;\n --bv-button-bg-hover: var(--bv-color-primary-light);\n --bv-button-color: var(--bv-color-primary);\n --bv-button-border-color: var(--bv-color-primary);\n --bv-button-border-color-hover: var(--bv-color-primary);\n}\n\n/* \u2500\u2500 Base button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n All visual properties read from the component-level tokens above.\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--bv-spacing-xs);\n padding: 10px var(--bv-spacing-md);\n min-height: 40px;\n width: auto;\n font-family: var(--bv-button-font-family);\n font-size: var(--bv-button-font-size);\n font-style: normal;\n font-weight: var(--bv-font-weight-semibold);\n line-height: 20px;\n border: 1px solid var(--bv-button-border-color);\n border-radius: var(--bv-radius-lg);\n cursor: pointer;\n transition:\n background var(--bv-transition-fast),\n color var(--bv-transition-fast),\n border-color var(--bv-transition-fast),\n box-shadow var(--bv-transition-fast),\n opacity var(--bv-transition-fast);\n white-space: nowrap;\n user-select: none;\n text-decoration: none;\n outline: none;\n box-sizing: border-box;\n background: var(--bv-button-bg);\n color: var(--bv-button-color);\n box-shadow: var(--bv-shadow-sm);\n}\n\n:host([full-width]) .btn {\n width: 100%;\n}\n\n.btn:hover:not(:disabled) {\n background: var(--bv-button-bg-hover);\n border-color: var(--bv-button-border-color-hover);\n}\n\n.btn:active:not(:disabled) {\n transform: translateY(1px);\n}\n\n.btn:focus-visible {\n outline: 2px solid var(--bv-button-border-color);\n outline-offset: 2px;\n}\n\n.btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n/* \u2500\u2500 Sizes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500*/\n\n:host([size='sm']) .btn {\n padding: 6px 12px;\n min-height: 32px;\n font-size: var(--bv-font-size-sm);\n}\n\n:host([size='lg']) .btn {\n padding: 12px var(--bv-spacing-lg);\n min-height: 48px;\n font-size: var(--bv-font-size-md);\n}\n\n/* \u2500\u2500 Icon \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500*/\n\n.btn-icon {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n line-height: 0;\n}\n\n/* \u2500\u2500 Count badge \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500*/\n\n.btn-count {\n opacity: 0.8;\n font-weight: var(--bv-font-weight-regular);\n}\n\n/* \u2500\u2500 Loading spinner \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500*/\n\n.spinner {\n display: inline-block;\n width: 1em;\n height: 1em;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n flex-shrink: 0;\n animation: bv-spin 700ms linear infinite;\n}\n\n@keyframes bv-spin {\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
87
|
+
var bv_button_default = "/* \u2500\u2500 Public theming API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n Apps can override these three properties per-instance:\n\n HTML: <bv-button style=\"--bv-button-bg: #e53e3e;\">\n Angular: <bv-button [style.--bv-button-bg]=\"brandColor\">\n JavaScript: btn.style.setProperty('--bv-button-bg', value)\n\n Hover is auto-computed from the base colors via color-mix().\n Override --bv-button-bg-hover / --bv-button-border-color-hover\n if you need explicit control over the hovered state.\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n:host {\n /* Default values \u2014 map to global tokens (primary variant) */\n --bv-button-bg: var(--bv-color-primary);\n --bv-button-bg-hover: color-mix(in srgb, var(--bv-button-bg) 82%, black);\n --bv-button-color: var(--bv-color-neutral-0);\n --bv-button-border-color: var(--bv-color-primary);\n --bv-button-border-color-hover: color-mix(in srgb, var(--bv-button-border-color) 82%, black);\n --bv-button-font-family: var(--bv-font-family-base);\n --bv-button-font-size: var(--bv-font-size-sm);\n\n display: inline-block;\n font-family: var(--bv-font-family-base);\n}\n\n:host([hidden]) {\n /* `!important` so `hidden` always wins over :host([full-width]) / other display rules. */\n display: none !important;\n}\n\n:host([full-width]) {\n display: block;\n width: 100%;\n}\n\n/* \u2500\u2500 Variant tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n Each variant re-points the component tokens to different global\n tokens. Apps can still override with inline styles \u2014 inline style\n always wins due to higher specificity.\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n:host([variant='secondary']) {\n --bv-button-bg: var(--bv-color-secondary);\n --bv-button-border-color: var(--bv-color-secondary);\n --bv-button-color: var(--bv-color-secondary-foreground);\n}\n\n:host([variant='tertiary']) {\n --bv-button-bg: var(--bv-color-tertiary);\n --bv-button-border-color: var(--bv-color-tertiary);\n}\n\n:host([variant='danger']) {\n --bv-button-bg: var(--bv-color-danger);\n --bv-button-border-color: var(--bv-color-danger);\n}\n\n:host([variant='ghost']) {\n --bv-button-bg: transparent;\n --bv-button-bg-hover: var(--bv-color-primary-light);\n --bv-button-color: var(--bv-color-primary);\n --bv-button-border-color: transparent;\n --bv-button-border-color-hover: transparent;\n}\n\n:host([variant='outline']) {\n --bv-button-bg: transparent;\n --bv-button-bg-hover: var(--bv-color-primary-light);\n --bv-button-color: var(--bv-color-primary);\n --bv-button-border-color: var(--bv-color-primary);\n --bv-button-border-color-hover: var(--bv-color-primary);\n}\n\n:host([variant='outline-secondary']) {\n --bv-button-bg: transparent;\n --bv-button-bg-hover: var(--bv-color-neutral-100);\n --bv-button-color: var(--bv-color-neutral-700);\n --bv-button-border-color: var(--bv-color-neutral-300);\n --bv-button-border-color-hover: var(--bv-color-neutral-300);\n}\n\n/* \u2500\u2500 Base button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n All visual properties read from the component-level tokens above.\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--bv-spacing-xs);\n padding: 10px var(--bv-spacing-md);\n min-height: 40px;\n width: auto;\n font-family: var(--bv-button-font-family);\n font-size: var(--bv-button-font-size);\n font-style: normal;\n font-weight: var(--bv-font-weight-semibold);\n line-height: 20px;\n border: 1px solid var(--bv-button-border-color);\n border-radius: var(--bv-radius-lg);\n cursor: pointer;\n transition:\n background var(--bv-transition-fast),\n color var(--bv-transition-fast),\n border-color var(--bv-transition-fast),\n box-shadow var(--bv-transition-fast),\n opacity var(--bv-transition-fast);\n white-space: nowrap;\n user-select: none;\n text-decoration: none;\n outline: none;\n box-sizing: border-box;\n background: var(--bv-button-bg);\n color: var(--bv-button-color);\n box-shadow: var(--bv-shadow-sm);\n}\n\n:host([full-width]) .btn {\n width: 100%;\n}\n\n.btn:hover:not(:disabled) {\n background: var(--bv-button-bg-hover);\n border-color: var(--bv-button-border-color-hover);\n}\n\n.btn:active:not(:disabled) {\n transform: translateY(1px);\n}\n\n.btn:focus-visible {\n outline: 2px solid var(--bv-button-border-color);\n outline-offset: 2px;\n}\n\n.btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n\n/* \u2500\u2500 Sizes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500*/\n\n:host([size='sm']) .btn {\n padding: 6px 12px;\n min-height: 32px;\n font-size: var(--bv-font-size-sm);\n}\n\n:host([size='lg']) .btn {\n padding: 12px var(--bv-spacing-lg);\n min-height: 48px;\n font-size: var(--bv-font-size-md);\n}\n\n/* \u2500\u2500 Icon \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500*/\n\n.btn-icon {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n line-height: 0;\n}\n\n/* \u2500\u2500 Count badge \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500*/\n\n.btn-count {\n opacity: 0.8;\n font-weight: var(--bv-font-weight-regular);\n}\n\n/* \u2500\u2500 Loading spinner \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500*/\n\n.spinner {\n display: inline-block;\n width: 1em;\n height: 1em;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n flex-shrink: 0;\n animation: bv-spin 700ms linear infinite;\n}\n\n@keyframes bv-spin {\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
88
88
|
|
|
89
89
|
// components/bv-icon/icons.ts
|
|
90
90
|
var icons = {
|
|
@@ -590,7 +590,7 @@ if (!customElements.get("bv-promo-banner")) {
|
|
|
590
590
|
}
|
|
591
591
|
|
|
592
592
|
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-searchbox/bv-searchbox.css
|
|
593
|
-
var bv_searchbox_default = ":host {\n display: block;\n width: 100%;\n position: relative;\n font-family: var(--bv-font-family-base);\n}\n\n.search-icon {\n position: absolute;\n left: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--bv-color-neutral-400);\n display: flex;\n pointer-events: none;\n}\n\n.search-input {\n width: 100%;\n box-sizing: border-box;\n height: 40px;\n padding: 0 12px 0 38px;\n font-size: var(--bv-font-size-sm);\n font-family: inherit;\n border: 1px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-lg);\n outline: none;\n color: var(--bv-color-neutral-800);\n background: var(--bv-color-neutral-0);\n transition: border-color var(--bv-transition-fast);\n}\n\n:host([size='sm']) .search-input {\n height: 36px;\n}\n:host([size='lg']) .search-input {\n height: 46px;\n}\n\n.search-input::placeholder {\n color: var(--bv-color-neutral-400);\n}\n\n.search-input:focus {\n border-color: #6fb0d8;\n box-shadow:\n 0px 0px 0px 4px #dbe8ff,\n 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n}\n";
|
|
593
|
+
var bv_searchbox_default = ":host {\n display: block;\n width: 100%;\n position: relative;\n font-family: var(--bv-font-family-base);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.search-icon {\n position: absolute;\n left: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--bv-color-neutral-400);\n display: flex;\n pointer-events: none;\n}\n\n.search-input {\n width: 100%;\n box-sizing: border-box;\n height: 40px;\n padding: 0 12px 0 38px;\n font-size: var(--bv-font-size-sm);\n font-family: inherit;\n border: 1px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-lg);\n outline: none;\n color: var(--bv-color-neutral-800);\n background: var(--bv-color-neutral-0);\n transition: border-color var(--bv-transition-fast);\n}\n\n:host([size='sm']) .search-input {\n height: 36px;\n}\n:host([size='lg']) .search-input {\n height: 46px;\n}\n\n.search-input::placeholder {\n color: var(--bv-color-neutral-400);\n}\n\n.search-input:focus {\n border-color: #6fb0d8;\n box-shadow:\n 0px 0px 0px 4px #dbe8ff,\n 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n}\n";
|
|
594
594
|
|
|
595
595
|
// components/bv-searchbox/bv-searchbox.ts
|
|
596
596
|
var SEARCH_ICON = `<svg width="16" height="16" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-searchbox/bv-searchbox.css
|
|
2
|
-
var bv_searchbox_default = ":host {\n display: block;\n width: 100%;\n position: relative;\n font-family: var(--bv-font-family-base);\n}\n\n.search-icon {\n position: absolute;\n left: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--bv-color-neutral-400);\n display: flex;\n pointer-events: none;\n}\n\n.search-input {\n width: 100%;\n box-sizing: border-box;\n height: 40px;\n padding: 0 12px 0 38px;\n font-size: var(--bv-font-size-sm);\n font-family: inherit;\n border: 1px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-lg);\n outline: none;\n color: var(--bv-color-neutral-800);\n background: var(--bv-color-neutral-0);\n transition: border-color var(--bv-transition-fast);\n}\n\n:host([size='sm']) .search-input {\n height: 36px;\n}\n:host([size='lg']) .search-input {\n height: 46px;\n}\n\n.search-input::placeholder {\n color: var(--bv-color-neutral-400);\n}\n\n.search-input:focus {\n border-color: #6fb0d8;\n box-shadow:\n 0px 0px 0px 4px #dbe8ff,\n 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n}\n";
|
|
2
|
+
var bv_searchbox_default = ":host {\n display: block;\n width: 100%;\n position: relative;\n font-family: var(--bv-font-family-base);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.search-icon {\n position: absolute;\n left: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--bv-color-neutral-400);\n display: flex;\n pointer-events: none;\n}\n\n.search-input {\n width: 100%;\n box-sizing: border-box;\n height: 40px;\n padding: 0 12px 0 38px;\n font-size: var(--bv-font-size-sm);\n font-family: inherit;\n border: 1px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-lg);\n outline: none;\n color: var(--bv-color-neutral-800);\n background: var(--bv-color-neutral-0);\n transition: border-color var(--bv-transition-fast);\n}\n\n:host([size='sm']) .search-input {\n height: 36px;\n}\n:host([size='lg']) .search-input {\n height: 46px;\n}\n\n.search-input::placeholder {\n color: var(--bv-color-neutral-400);\n}\n\n.search-input:focus {\n border-color: #6fb0d8;\n box-shadow:\n 0px 0px 0px 4px #dbe8ff,\n 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n}\n";
|
|
3
3
|
|
|
4
4
|
// components/bv-searchbox/bv-searchbox.ts
|
|
5
5
|
var SEARCH_ICON = `<svg width="16" height="16" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type SegmentedControlOption = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export interface SegmentedControlChangeDetail {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class BvSegmentedControl extends HTMLElement {
|
|
10
|
+
static readonly observedAttributes: readonly ["options", "value", "label", "required"];
|
|
11
|
+
private _rendered;
|
|
12
|
+
private _labelEl;
|
|
13
|
+
private _containerEl;
|
|
14
|
+
private _options;
|
|
15
|
+
constructor();
|
|
16
|
+
get value(): string;
|
|
17
|
+
set value(v: string);
|
|
18
|
+
get required(): boolean;
|
|
19
|
+
set required(v: boolean);
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
attributeChangedCallback(name: string, _old: string | null, _val: string | null): void;
|
|
22
|
+
private _render;
|
|
23
|
+
private _syncLabel;
|
|
24
|
+
private _syncOptions;
|
|
25
|
+
private _syncSelected;
|
|
26
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-segmented-control/bv-segmented-control.css
|
|
2
|
+
var bv_segmented_control_default = ":host {\n display: block;\n font-family: var(--bv-font-family-base);\n}\n\n.field-label {\n display: block;\n font-size: var(--bv-font-size-sm);\n line-height: 20px;\n font-weight: var(--bv-font-weight-semibold);\n color: var(--bv-color-neutral-800);\n margin-bottom: 6px;\n}\n\n.field-label[hidden] {\n display: none;\n}\n\n.required-mark {\n color: var(--bv-color-danger);\n margin-left: 2px;\n}\n\n.container {\n display: flex;\n align-items: center;\n height: 44px;\n box-sizing: border-box;\n background: var(--bv-color-neutral-100);\n border: 1px solid var(--bv-color-neutral-200);\n border-radius: var(--bv-radius-lg);\n padding: 3px;\n gap: 2px;\n}\n\n.pill {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 0 var(--bv-spacing-md);\n border: none;\n border-radius: calc(var(--bv-radius-lg) - 3px);\n background: transparent;\n font-family: inherit;\n font-size: var(--bv-font-size-sm);\n font-weight: var(--bv-font-weight-medium);\n color: var(--bv-color-neutral-500);\n cursor: pointer;\n white-space: nowrap;\n user-select: none;\n transition:\n color var(--bv-transition-fast),\n background var(--bv-transition-fast),\n box-shadow var(--bv-transition-fast);\n}\n\n.pill:hover:not(.selected) {\n color: var(--bv-color-neutral-800);\n}\n\n.pill.selected {\n background: var(--bv-color-neutral-0);\n color: var(--bv-color-neutral-900);\n box-shadow: var(--bv-shadow-sm);\n}\n";
|
|
3
|
+
|
|
4
|
+
// components/bv-segmented-control/bv-segmented-control.ts
|
|
5
|
+
var _sheet = null;
|
|
6
|
+
function getSheet() {
|
|
7
|
+
if (!_sheet) {
|
|
8
|
+
_sheet = new CSSStyleSheet();
|
|
9
|
+
_sheet.replaceSync(bv_segmented_control_default);
|
|
10
|
+
}
|
|
11
|
+
return _sheet;
|
|
12
|
+
}
|
|
13
|
+
var BvSegmentedControl = class extends HTMLElement {
|
|
14
|
+
static observedAttributes = ["options", "value", "label", "required"];
|
|
15
|
+
_rendered = false;
|
|
16
|
+
_labelEl = null;
|
|
17
|
+
_containerEl = null;
|
|
18
|
+
_options = [];
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
22
|
+
if ("adoptedStyleSheets" in ShadowRoot.prototype) {
|
|
23
|
+
shadow.adoptedStyleSheets = [getSheet()];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
get value() {
|
|
27
|
+
return this.getAttribute("value") ?? "";
|
|
28
|
+
}
|
|
29
|
+
set value(v) {
|
|
30
|
+
this.setAttribute("value", v);
|
|
31
|
+
}
|
|
32
|
+
get required() {
|
|
33
|
+
return this.hasAttribute("required");
|
|
34
|
+
}
|
|
35
|
+
set required(v) {
|
|
36
|
+
if (v) this.setAttribute("required", "");
|
|
37
|
+
else this.removeAttribute("required");
|
|
38
|
+
}
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
this._render();
|
|
41
|
+
}
|
|
42
|
+
attributeChangedCallback(name, _old, _val) {
|
|
43
|
+
if (!this._rendered) return;
|
|
44
|
+
if (name === "options") this._syncOptions();
|
|
45
|
+
if (name === "value") this._syncSelected();
|
|
46
|
+
if (name === "label" || name === "required") this._syncLabel();
|
|
47
|
+
}
|
|
48
|
+
_render() {
|
|
49
|
+
if (this._rendered) return;
|
|
50
|
+
this._rendered = true;
|
|
51
|
+
const shadow = this.shadowRoot;
|
|
52
|
+
if (!shadow.adoptedStyleSheets.length) {
|
|
53
|
+
const s = document.createElement("style");
|
|
54
|
+
s.textContent = bv_segmented_control_default;
|
|
55
|
+
shadow.appendChild(s);
|
|
56
|
+
}
|
|
57
|
+
const labelEl = document.createElement("span");
|
|
58
|
+
labelEl.className = "field-label";
|
|
59
|
+
this._labelEl = labelEl;
|
|
60
|
+
const container = document.createElement("div");
|
|
61
|
+
container.className = "container";
|
|
62
|
+
container.setAttribute("role", "group");
|
|
63
|
+
this._containerEl = container;
|
|
64
|
+
shadow.append(labelEl, container);
|
|
65
|
+
this._syncLabel();
|
|
66
|
+
this._syncOptions();
|
|
67
|
+
}
|
|
68
|
+
_syncLabel() {
|
|
69
|
+
if (!this._labelEl || !this._containerEl) return;
|
|
70
|
+
const text = this.getAttribute("label") ?? "";
|
|
71
|
+
this._labelEl.textContent = text;
|
|
72
|
+
if (this.hasAttribute("required")) {
|
|
73
|
+
const mark = document.createElement("span");
|
|
74
|
+
mark.className = "required-mark";
|
|
75
|
+
mark.setAttribute("aria-hidden", "true");
|
|
76
|
+
mark.textContent = "*";
|
|
77
|
+
this._labelEl.appendChild(mark);
|
|
78
|
+
}
|
|
79
|
+
this._labelEl.hidden = !text;
|
|
80
|
+
if (text) this._containerEl.setAttribute("aria-label", text);
|
|
81
|
+
else this._containerEl.removeAttribute("aria-label");
|
|
82
|
+
}
|
|
83
|
+
_syncOptions() {
|
|
84
|
+
if (!this._containerEl) return;
|
|
85
|
+
try {
|
|
86
|
+
this._options = JSON.parse(this.getAttribute("options") ?? "[]");
|
|
87
|
+
} catch {
|
|
88
|
+
this._options = [];
|
|
89
|
+
}
|
|
90
|
+
this._containerEl.innerHTML = "";
|
|
91
|
+
for (const opt of this._options) {
|
|
92
|
+
const btn = document.createElement("button");
|
|
93
|
+
btn.type = "button";
|
|
94
|
+
btn.className = "pill";
|
|
95
|
+
btn.dataset["value"] = opt.value;
|
|
96
|
+
btn.textContent = opt.label;
|
|
97
|
+
btn.setAttribute("aria-pressed", "false");
|
|
98
|
+
btn.addEventListener("click", () => {
|
|
99
|
+
if (this.value === opt.value) return;
|
|
100
|
+
this.value = opt.value;
|
|
101
|
+
this.dispatchEvent(
|
|
102
|
+
new CustomEvent("bv-change", {
|
|
103
|
+
bubbles: true,
|
|
104
|
+
composed: true,
|
|
105
|
+
detail: { value: opt.value, label: opt.label }
|
|
106
|
+
})
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
this._containerEl.appendChild(btn);
|
|
110
|
+
}
|
|
111
|
+
this._syncSelected();
|
|
112
|
+
}
|
|
113
|
+
_syncSelected() {
|
|
114
|
+
if (!this._containerEl) return;
|
|
115
|
+
const current = this.value;
|
|
116
|
+
for (const btn of this._containerEl.querySelectorAll(".pill")) {
|
|
117
|
+
const isSelected = btn.dataset["value"] === current;
|
|
118
|
+
btn.classList.toggle("selected", isSelected);
|
|
119
|
+
btn.setAttribute("aria-pressed", isSelected ? "true" : "false");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
if (!customElements.get("bv-segmented-control")) {
|
|
124
|
+
customElements.define("bv-segmented-control", BvSegmentedControl);
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
BvSegmentedControl
|
|
128
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface SelectOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface SelectChangeDetail {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class BvSelect extends HTMLElement {
|
|
10
|
+
static readonly observedAttributes: readonly ["label", "options", "value", "placeholder", "error", "required", "disabled"];
|
|
11
|
+
private _rendered;
|
|
12
|
+
private _labelEl;
|
|
13
|
+
private _triggerEl;
|
|
14
|
+
private _triggerLabelEl;
|
|
15
|
+
private _panelEl;
|
|
16
|
+
private _errorEl;
|
|
17
|
+
private _options;
|
|
18
|
+
private _value;
|
|
19
|
+
private _offClick;
|
|
20
|
+
constructor();
|
|
21
|
+
get value(): string;
|
|
22
|
+
set value(v: string);
|
|
23
|
+
get disabled(): boolean;
|
|
24
|
+
set disabled(v: boolean);
|
|
25
|
+
get required(): boolean;
|
|
26
|
+
set required(v: boolean);
|
|
27
|
+
connectedCallback(): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
29
|
+
attributeChangedCallback(name: string, _old: string | null, val: string | null): void;
|
|
30
|
+
private _render;
|
|
31
|
+
private _toggle;
|
|
32
|
+
private _open;
|
|
33
|
+
private _close;
|
|
34
|
+
private _syncLabel;
|
|
35
|
+
private _syncTriggerLabel;
|
|
36
|
+
private _renderOptions;
|
|
37
|
+
private _syncSelected;
|
|
38
|
+
private _syncError;
|
|
39
|
+
private _syncDisabled;
|
|
40
|
+
private _select;
|
|
41
|
+
}
|