@bluevolt-tech/lumen 1.3.2

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.
Files changed (78) hide show
  1. package/README.md +286 -0
  2. package/assets/fonts/fonts.css +25 -0
  3. package/assets/icons/.gitkeep +0 -0
  4. package/assets/icons/edit.svg +3 -0
  5. package/assets/images/.gitkeep +0 -0
  6. package/assets/images/bluevolt-logo.png +0 -0
  7. package/dist/assets/fonts/fonts.css +25 -0
  8. package/dist/assets/icons/.gitkeep +0 -0
  9. package/dist/assets/icons/edit.svg +3 -0
  10. package/dist/assets/images/.gitkeep +0 -0
  11. package/dist/assets/images/bluevolt-logo.png +0 -0
  12. package/dist/components/bv-avatar/bv-avatar.d.ts +13 -0
  13. package/dist/components/bv-avatar/bv-avatar.js +81 -0
  14. package/dist/components/bv-badge/bv-badge.d.ts +11 -0
  15. package/dist/components/bv-badge/bv-badge.js +58 -0
  16. package/dist/components/bv-button/bv-button.d.ts +23 -0
  17. package/dist/components/bv-button/bv-button.js +395 -0
  18. package/dist/components/bv-category-pill/bv-category-pill.d.ts +11 -0
  19. package/dist/components/bv-category-pill/bv-category-pill.js +61 -0
  20. package/dist/components/bv-checkbox/bv-checkbox.d.ts +14 -0
  21. package/dist/components/bv-checkbox/bv-checkbox.js +89 -0
  22. package/dist/components/bv-chip/bv-chip.d.ts +11 -0
  23. package/dist/components/bv-chip/bv-chip.js +72 -0
  24. package/dist/components/bv-course-detail/bv-course-detail.d.ts +28 -0
  25. package/dist/components/bv-course-detail/bv-course-detail.js +269 -0
  26. package/dist/components/bv-course-detail-modal/bv-course-detail-modal.d.ts +35 -0
  27. package/dist/components/bv-course-detail-modal/bv-course-detail-modal.js +1455 -0
  28. package/dist/components/bv-course-grid-card/bv-course-grid-card.d.ts +12 -0
  29. package/dist/components/bv-course-grid-card/bv-course-grid-card.js +578 -0
  30. package/dist/components/bv-course-list-card/bv-course-list-card.d.ts +12 -0
  31. package/dist/components/bv-course-list-card/bv-course-list-card.js +585 -0
  32. package/dist/components/bv-course-outline/bv-course-outline.d.ts +49 -0
  33. package/dist/components/bv-course-outline/bv-course-outline.js +488 -0
  34. package/dist/components/bv-empty-state/bv-empty-state.d.ts +10 -0
  35. package/dist/components/bv-empty-state/bv-empty-state.js +69 -0
  36. package/dist/components/bv-filter-dropdown/bv-filter-dropdown.d.ts +26 -0
  37. package/dist/components/bv-filter-dropdown/bv-filter-dropdown.js +164 -0
  38. package/dist/components/bv-filter-panel/bv-filter-panel.d.ts +25 -0
  39. package/dist/components/bv-filter-panel/bv-filter-panel.js +222 -0
  40. package/dist/components/bv-icon/bv-icon.d.ts +10 -0
  41. package/dist/components/bv-icon/bv-icon.js +122 -0
  42. package/dist/components/bv-icon/icons.d.ts +3 -0
  43. package/dist/components/bv-modal/bv-modal.d.ts +13 -0
  44. package/dist/components/bv-modal/bv-modal.js +104 -0
  45. package/dist/components/bv-page-title/bv-page-title.d.ts +4 -0
  46. package/dist/components/bv-page-title/bv-page-title.js +33 -0
  47. package/dist/components/bv-pagination/bv-pagination.d.ts +20 -0
  48. package/dist/components/bv-pagination/bv-pagination.js +139 -0
  49. package/dist/components/bv-portal-header/bv-portal-header.d.ts +12 -0
  50. package/dist/components/bv-portal-header/bv-portal-header.js +854 -0
  51. package/dist/components/bv-portal-layout/bv-portal-layout.d.ts +6 -0
  52. package/dist/components/bv-portal-layout/bv-portal-layout.js +39 -0
  53. package/dist/components/bv-progress-bar/bv-progress-bar.d.ts +11 -0
  54. package/dist/components/bv-progress-bar/bv-progress-bar.js +61 -0
  55. package/dist/components/bv-promo-banner/bv-promo-banner.d.ts +12 -0
  56. package/dist/components/bv-promo-banner/bv-promo-banner.js +79 -0
  57. package/dist/components/bv-radio/bv-radio.d.ts +11 -0
  58. package/dist/components/bv-radio/bv-radio.js +78 -0
  59. package/dist/components/bv-searchbox/bv-searchbox.d.ts +10 -0
  60. package/dist/components/bv-searchbox/bv-searchbox.js +68 -0
  61. package/dist/components/bv-star-rating/bv-star-rating.d.ts +11 -0
  62. package/dist/components/bv-star-rating/bv-star-rating.js +67 -0
  63. package/dist/components/bv-table/bv-table.d.ts +5 -0
  64. package/dist/components/bv-table/bv-table.js +72 -0
  65. package/dist/components/bv-toggle/bv-toggle.d.ts +11 -0
  66. package/dist/components/bv-toggle/bv-toggle.js +72 -0
  67. package/dist/components/bv-user-row/bv-user-row.d.ts +12 -0
  68. package/dist/components/bv-user-row/bv-user-row.js +574 -0
  69. package/dist/components/bv-view-switcher/bv-view-switcher.d.ts +11 -0
  70. package/dist/components/bv-view-switcher/bv-view-switcher.js +91 -0
  71. package/dist/preview/index.html +76 -0
  72. package/dist/storybook/stories/screens/course-catalog.data.d.ts +28 -0
  73. package/dist/storybook/stories/screens/course-catalog.data.js +301 -0
  74. package/dist/themes/base.css +66 -0
  75. package/dist/themes/layouts.css +35 -0
  76. package/package.json +181 -0
  77. package/themes/base.css +66 -0
  78. package/themes/layouts.css +35 -0
@@ -0,0 +1,488 @@
1
+ // css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-course-outline/bv-course-outline.css
2
+ var bv_course_outline_default = ":host {\n display: block;\n font-family: var(--bv-font-family-base);\n}\n\n/* \u2500\u2500 Outer container \u2500\u2500 */\n\n.container {\n border: 0.5px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-xl);\n overflow: hidden;\n}\n\n.container-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n background: #f9fafb;\n border-bottom: 0.5px solid var(--bv-color-neutral-300);\n}\n\n.container-title {\n font-size: var(--bv-font-size-2xl);\n font-weight: var(--bv-font-weight-medium);\n color: var(--bv-color-neutral-700);\n line-height: 32px;\n}\n\n.expand-all-btn {\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: var(--bv-font-family-base);\n font-size: var(--bv-font-size-md);\n font-weight: var(--bv-font-weight-bold);\n color: var(--bv-color-primary);\n line-height: 24px;\n white-space: nowrap;\n}\n\n.expand-all-btn:hover {\n text-decoration: underline;\n}\n\n.outline {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 24px;\n background: var(--bv-color-neutral-0);\n}\n\n/* \u2500\u2500 Section \u2500\u2500 */\n\n.section {\n background: var(--bv-color-neutral-0);\n border: 0.5px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-xl);\n overflow: hidden;\n}\n\n.section-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n padding: 20px;\n cursor: pointer;\n user-select: none;\n}\n\n.section-header:hover {\n background: linear-gradient(90deg, #fff, #f9fafb 15% 85%, #fff);\n}\n\n.section-header:focus-visible {\n outline: 2px solid var(--bv-color-primary);\n outline-offset: -2px;\n border-radius: var(--bv-radius-xl);\n}\n\n.section-header-left {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n flex: 1;\n min-width: 0;\n gap: 12px;\n}\n\n.section-title-row {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n}\n\n.section-title {\n font-size: var(--bv-font-size-lg);\n font-weight: var(--bv-font-weight-medium);\n color: var(--bv-color-neutral-900);\n line-height: 28px;\n}\n\n.section-badge {\n display: inline-flex;\n align-items: center;\n padding: 0 8px;\n border: 1px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-full);\n font-size: 10px;\n font-weight: var(--bv-font-weight-regular);\n color: var(--bv-color-neutral-500);\n line-height: 18px;\n white-space: nowrap;\n}\n\n.section-chevron {\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n color: var(--bv-color-neutral-500);\n transition: transform var(--bv-transition-fast);\n}\n\n.section-chevron svg {\n width: 100%;\n height: 100%;\n}\n\n.section--expanded .section-chevron {\n transform: rotate(180deg);\n}\n\n/* \u2500\u2500 Section body \u2500\u2500 */\n\n.section-body {\n display: none;\n border-top: 0.5px solid var(--bv-color-neutral-300);\n}\n\n.section--expanded .section-body {\n display: block;\n}\n\n/* \u2500\u2500 Description \u2500\u2500 */\n\n.section-desc-wrap {\n padding: 16px 20px 20px;\n}\n\n.section-desc {\n margin: 0 0 4px;\n font-size: var(--bv-font-size-md);\n font-weight: var(--bv-font-weight-regular);\n color: var(--bv-color-neutral-700);\n line-height: 24px;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n\n.section-desc-wrap--expanded .section-desc {\n -webkit-line-clamp: unset;\n}\n\n.read-more {\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: var(--bv-font-family-base);\n font-size: var(--bv-font-size-md);\n font-weight: var(--bv-font-weight-semibold);\n color: var(--bv-color-primary);\n line-height: 24px;\n}\n\n.read-more:hover {\n text-decoration: underline;\n}\n\n/* \u2500\u2500 Module list \u2500\u2500 */\n\n.module-list {\n padding-left: 20px;\n padding-right: 20px;\n}\n\n.module-sep {\n height: 0;\n border-top: 0.5px solid var(--bv-color-neutral-300);\n margin-left: 20px;\n}\n\n.desc-sep {\n height: 0;\n border-top: 0.5px solid var(--bv-color-neutral-300);\n margin: 0 20px;\n}\n\n.module-row {\n display: flex;\n align-items: center;\n gap: 12px;\n min-height: 72px;\n padding: 0 0 0 20px;\n}\n\n.module-row:hover {\n background: linear-gradient(90deg, #fff, #f9fafb 15% 85%, #fff);\n}\n\n/* \u2500\u2500 Module icon \u2500\u2500 */\n\n.module-icon {\n flex-shrink: 0;\n width: 34px;\n height: 34px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.module-icon svg {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n/* \u2500\u2500 Module content \u2500\u2500 */\n\n.module-content {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.module-title-row {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.module-type-icon {\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n color: var(--bv-color-neutral-500);\n display: flex;\n align-items: center;\n}\n\n.module-type-icon svg {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n.module-title {\n flex: 1;\n min-width: 0;\n font-size: var(--bv-font-size-md);\n font-weight: var(--bv-font-weight-medium);\n color: var(--bv-color-neutral-700);\n line-height: 24px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* \u2500\u2500 Module status \u2500\u2500 */\n\n.module-status {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: var(--bv-font-size-sm);\n font-weight: var(--bv-font-weight-bold);\n line-height: 20px;\n}\n\n.module-status span {\n white-space: nowrap;\n}\n\n.status-icon {\n width: 18px;\n height: 18px;\n flex-shrink: 0;\n}\n\n.module-status--completed,\n.module-status--viewed,\n.module-status--pending-review {\n color: var(--bv-color-success-dark);\n}\n\n.module-status--in-progress,\n.module-status--not-started {\n color: var(--bv-color-neutral-700);\n}\n\n.module-status--max-retakes,\n.module-status--rejected {\n color: #f04438;\n}\n\n.module-status--seat-time {\n color: var(--bv-color-primary);\n}\n\n/* \u2500\u2500 Module actions \u2500\u2500 */\n\n.module-actions {\n display: flex;\n align-items: center;\n gap: 16px;\n flex-shrink: 0;\n}\n\n.module-action-btn {\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-family: var(--bv-font-family-base);\n font-size: var(--bv-font-size-sm);\n font-weight: var(--bv-font-weight-bold);\n color: var(--bv-color-primary);\n line-height: 20px;\n white-space: nowrap;\n}\n\n.module-action-btn:hover {\n text-decoration: underline;\n}\n\n/* \u2500\u2500 Pre-enrollment section \u2500\u2500 */\n\n.section--pre-enrollment .section-header {\n align-items: flex-start;\n}\n\n.pre-title-row {\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n}\n\n.section-count-text {\n flex-shrink: 0;\n font-size: var(--bv-font-size-sm);\n font-weight: var(--bv-font-weight-regular);\n color: var(--bv-color-neutral-500);\n line-height: 20px;\n white-space: nowrap;\n}\n\n.section--pre-enrollment .section-chevron {\n margin-top: 2px;\n}\n\n.pre-section-desc-wrap {\n width: 100%;\n}\n\n/* \u2500\u2500 Pre-enrollment module list \u2500\u2500 */\n\n.pre-module-list {\n display: flex;\n flex-direction: column;\n padding: 0 20px;\n}\n\n.pre-module-list .module-sep {\n margin-left: 0;\n}\n\n.pre-module-wrap {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.pre-module-row {\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: 24px;\n padding: 16px 0;\n}\n\n.pre-module-list > .pre-module-wrap:first-child .pre-module-row {\n padding-top: 16px;\n}\n.pre-module-list > .pre-module-wrap:last-child .pre-module-row {\n padding-bottom: 16px;\n}\n\n.pre-module-row:hover {\n background: linear-gradient(90deg, #fff, #f9fafb 15% 85%, #fff);\n}\n\n.pre-module-title-group {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n min-width: 0;\n}\n\n.pre-module-title {\n min-width: 0;\n font-size: var(--bv-font-size-md);\n font-weight: var(--bv-font-weight-medium);\n color: var(--bv-color-neutral-700);\n line-height: 24px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.pre-module-badges {\n display: flex;\n gap: 4px;\n align-items: center;\n flex-shrink: 0;\n}\n\n.pre-badge {\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: var(--bv-radius-full);\n font-size: var(--bv-font-size-xs);\n font-weight: var(--bv-font-weight-medium);\n line-height: 18px;\n white-space: nowrap;\n}\n\n.pre-badge--inactive {\n background: var(--bv-color-neutral-700);\n color: var(--bv-color-neutral-0);\n}\n\n.pre-badge--optional {\n background: var(--bv-color-neutral-100);\n color: var(--bv-color-neutral-700);\n}\n\n.pre-module-toggle {\n flex-shrink: 0;\n width: 24px;\n height: 24px;\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n color: var(--bv-color-neutral-700);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.pre-module-toggle:hover {\n color: var(--bv-color-primary);\n}\n\n.pre-module-toggle svg {\n width: 100%;\n height: 100%;\n}\n\n.pre-module-wrap--expanded .pre-module-row {\n padding-bottom: 0;\n}\n\n.pre-module-desc {\n padding: 0 0 16px;\n margin: 0;\n font-size: var(--bv-font-size-sm);\n color: var(--bv-color-neutral-700);\n line-height: 20px;\n}\n\n/* Empty state */\n.pre-section-empty {\n padding: 20px;\n margin: 0;\n font-size: var(--bv-font-size-md);\n color: var(--bv-color-neutral-500);\n line-height: 24px;\n}\n";
3
+
4
+ // components/bv-course-outline/bv-course-outline.ts
5
+ var BvCourseOutline = class extends HTMLElement {
6
+ static observedAttributes = ["sections", "mode"];
7
+ _sections = [];
8
+ _rendered = false;
9
+ _listEl = null;
10
+ _expandBtn = null;
11
+ _mode = "enrolled";
12
+ get sections() {
13
+ return this._sections;
14
+ }
15
+ set sections(val) {
16
+ this._sections = val;
17
+ if (this._rendered) this._flush();
18
+ }
19
+ get mode() {
20
+ return this._mode;
21
+ }
22
+ set mode(v) {
23
+ this._mode = v;
24
+ this.setAttribute("mode", v);
25
+ if (this._rendered) this._flush();
26
+ }
27
+ constructor() {
28
+ super();
29
+ this.attachShadow({ mode: "open" });
30
+ if ("replaceSync" in CSSStyleSheet.prototype) {
31
+ const sheet = new CSSStyleSheet();
32
+ sheet.replaceSync(bv_course_outline_default);
33
+ this.shadowRoot.adoptedStyleSheets = [sheet];
34
+ }
35
+ }
36
+ connectedCallback() {
37
+ this._render();
38
+ }
39
+ attributeChangedCallback(name, _old, val) {
40
+ if (name === "sections") {
41
+ try {
42
+ this._sections = JSON.parse(val ?? "[]");
43
+ } catch {
44
+ this._sections = [];
45
+ }
46
+ if (this._rendered) this._flush();
47
+ }
48
+ if (name === "mode") {
49
+ this._mode = val === "pre-enrollment" ? "pre-enrollment" : "enrolled";
50
+ if (this._rendered) this._flush();
51
+ }
52
+ }
53
+ _render() {
54
+ if (this._rendered) return;
55
+ this._rendered = true;
56
+ const shadow = this.shadowRoot;
57
+ if (!shadow.adoptedStyleSheets.length) {
58
+ const s = document.createElement("style");
59
+ s.textContent = bv_course_outline_default;
60
+ shadow.appendChild(s);
61
+ }
62
+ const attr = this.getAttribute("sections");
63
+ if (attr !== null) {
64
+ try {
65
+ this._sections = JSON.parse(attr);
66
+ } catch {
67
+ this._sections = [];
68
+ }
69
+ }
70
+ const modeAttr = this.getAttribute("mode");
71
+ if (modeAttr === "pre-enrollment") this._mode = "pre-enrollment";
72
+ const container = document.createElement("div");
73
+ container.className = "container";
74
+ const containerHeader = document.createElement("div");
75
+ containerHeader.className = "container-header";
76
+ const containerTitle = document.createElement("span");
77
+ containerTitle.className = "container-title";
78
+ containerTitle.textContent = "Course Outline";
79
+ this._expandBtn = document.createElement("button");
80
+ this._expandBtn.className = "expand-all-btn";
81
+ this._expandBtn.addEventListener("click", () => this._toggleAll());
82
+ this._updateExpandBtn();
83
+ containerHeader.append(containerTitle, this._expandBtn);
84
+ container.appendChild(containerHeader);
85
+ const list = document.createElement("div");
86
+ list.className = "outline";
87
+ this._listEl = list;
88
+ this._flush();
89
+ container.appendChild(list);
90
+ shadow.appendChild(container);
91
+ }
92
+ _updateExpandBtn() {
93
+ if (!this._expandBtn) return;
94
+ const allExpanded = this._sections.length > 0 && this._sections.every((s) => s.expanded);
95
+ this._expandBtn.textContent = allExpanded ? "Collapse All" : "Expand All";
96
+ }
97
+ _toggleAll() {
98
+ const allExpanded = this._sections.every((s) => s.expanded);
99
+ this._sections.forEach((s) => {
100
+ s.expanded = !allExpanded;
101
+ });
102
+ this._flush();
103
+ this._updateExpandBtn();
104
+ this.dispatchEvent(
105
+ new CustomEvent("bv-expand-all", {
106
+ bubbles: true,
107
+ composed: true,
108
+ detail: { expanded: !allExpanded }
109
+ })
110
+ );
111
+ }
112
+ _flush() {
113
+ const el = this._listEl;
114
+ el.innerHTML = "";
115
+ this._sections.forEach((sec, i) => el.appendChild(this._buildSection(sec, i)));
116
+ this._updateExpandBtn();
117
+ }
118
+ // ── Section ────────────────────────────────────────────────────────────────
119
+ _buildSection(sec, sIdx) {
120
+ var _a, _b;
121
+ if (this._mode === "pre-enrollment") return this._buildPreEnrollSection(sec, sIdx);
122
+ const wrap = document.createElement("div");
123
+ wrap.className = "section" + (sec.expanded ? " section--expanded" : "");
124
+ const header = document.createElement("div");
125
+ header.className = "section-header";
126
+ header.setAttribute("role", "button");
127
+ header.setAttribute("tabindex", "0");
128
+ header.setAttribute("aria-expanded", String(!!sec.expanded));
129
+ const left = document.createElement("div");
130
+ left.className = "section-header-left";
131
+ const titleEl = document.createElement("span");
132
+ titleEl.className = "section-title";
133
+ titleEl.textContent = sec.title;
134
+ const badge = document.createElement("span");
135
+ badge.className = "section-badge";
136
+ badge.textContent = `${((_a = sec.modules) == null ? void 0 : _a.length) ?? 0} Modules`;
137
+ const titleRow = document.createElement("div");
138
+ titleRow.className = "section-title-row";
139
+ titleRow.append(titleEl, badge);
140
+ left.appendChild(titleRow);
141
+ if (sec.description) {
142
+ const descWrap = document.createElement("div");
143
+ descWrap.className = "section-desc-wrap";
144
+ const desc = document.createElement("p");
145
+ desc.className = "section-desc";
146
+ desc.textContent = sec.description;
147
+ const readMore = document.createElement("button");
148
+ readMore.className = "read-more";
149
+ readMore.textContent = "Read More";
150
+ readMore.hidden = true;
151
+ readMore.addEventListener("click", (e) => {
152
+ e.stopPropagation();
153
+ const expanded = descWrap.classList.toggle("section-desc-wrap--expanded");
154
+ readMore.textContent = expanded ? "Read Less" : "Read More";
155
+ this.dispatchEvent(
156
+ new CustomEvent("bv-read-more", {
157
+ bubbles: true,
158
+ composed: true,
159
+ detail: { sectionIndex: sIdx }
160
+ })
161
+ );
162
+ });
163
+ requestAnimationFrame(() => {
164
+ readMore.hidden = desc.scrollHeight <= desc.clientHeight;
165
+ });
166
+ descWrap.append(desc, readMore);
167
+ left.appendChild(descWrap);
168
+ }
169
+ const chevron = document.createElement("div");
170
+ chevron.className = "section-chevron";
171
+ chevron.innerHTML = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>`;
172
+ header.append(left, chevron);
173
+ const toggle = () => {
174
+ sec.expanded = !sec.expanded;
175
+ wrap.classList.toggle("section--expanded", sec.expanded);
176
+ header.setAttribute("aria-expanded", String(sec.expanded));
177
+ this._updateExpandBtn();
178
+ this.dispatchEvent(
179
+ new CustomEvent("bv-section-toggle", {
180
+ bubbles: true,
181
+ composed: true,
182
+ detail: { sectionIndex: sIdx, expanded: sec.expanded }
183
+ })
184
+ );
185
+ };
186
+ header.addEventListener("click", toggle);
187
+ header.addEventListener("keydown", (e) => {
188
+ if (e.key === "Enter" || e.key === " ") {
189
+ e.preventDefault();
190
+ toggle();
191
+ }
192
+ });
193
+ wrap.appendChild(header);
194
+ if ((_b = sec.modules) == null ? void 0 : _b.length) {
195
+ const body = document.createElement("div");
196
+ body.className = "section-body";
197
+ const moduleList = document.createElement("div");
198
+ moduleList.className = "module-list";
199
+ sec.modules.forEach((mod, mIdx) => {
200
+ if (mIdx > 0) {
201
+ const sep = document.createElement("div");
202
+ sep.className = "module-sep";
203
+ moduleList.appendChild(sep);
204
+ }
205
+ moduleList.appendChild(this._buildModule(mod, sIdx, mIdx));
206
+ });
207
+ body.appendChild(moduleList);
208
+ wrap.appendChild(body);
209
+ }
210
+ return wrap;
211
+ }
212
+ // ── Module row ─────────────────────────────────────────────────────────────
213
+ _buildModule(mod, sIdx, mIdx) {
214
+ const row = document.createElement("div");
215
+ row.className = "module-row";
216
+ const typeIcon = document.createElement("div");
217
+ typeIcon.className = "module-icon";
218
+ typeIcon.innerHTML = this._bigIcon(mod.type, mod.status ?? "not-started");
219
+ const content = document.createElement("div");
220
+ content.className = "module-content";
221
+ const titleRow = document.createElement("div");
222
+ titleRow.className = "module-title-row";
223
+ const smallIcon = document.createElement("span");
224
+ smallIcon.className = "module-type-icon";
225
+ smallIcon.innerHTML = this._smallIcon(mod.type);
226
+ const titleEl = document.createElement("span");
227
+ titleEl.className = "module-title";
228
+ titleEl.textContent = mod.title;
229
+ titleRow.append(smallIcon, titleEl);
230
+ const status = mod.status ?? "not-started";
231
+ const statusEl = this._buildStatusEl(status, mod.statusLabel);
232
+ content.append(titleRow, statusEl);
233
+ const actionsEl = document.createElement("div");
234
+ actionsEl.className = "module-actions";
235
+ (mod.actions ?? []).forEach((action) => {
236
+ const btn = document.createElement("button");
237
+ btn.className = "module-action-btn";
238
+ btn.textContent = action.label;
239
+ btn.addEventListener("click", (e) => {
240
+ e.stopPropagation();
241
+ this.dispatchEvent(
242
+ new CustomEvent("bv-module-action", {
243
+ bubbles: true,
244
+ composed: true,
245
+ detail: { sectionIndex: sIdx, moduleIndex: mIdx, action: action.key }
246
+ })
247
+ );
248
+ });
249
+ actionsEl.appendChild(btn);
250
+ });
251
+ row.append(typeIcon, content, actionsEl);
252
+ return row;
253
+ }
254
+ // ── Status element ─────────────────────────────────────────────────────────
255
+ _buildStatusEl(status, label) {
256
+ const checkSvg = `<svg class="status-icon" viewBox="0 0 18 13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17 1L6 12L1 7"/></svg>`;
257
+ const clockSvg = `<svg class="status-icon" viewBox="0 0 22 22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 5V11L15 13M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z"/></svg>`;
258
+ const defaults = {
259
+ completed: "Completed",
260
+ viewed: "Viewed",
261
+ "in-progress": "In Progress",
262
+ "not-started": "Not Started",
263
+ "max-retakes": "Maximum retakes reached",
264
+ rejected: "Rejected",
265
+ "pending-review": "Pending Review",
266
+ "seat-time": "Seat time required"
267
+ };
268
+ const el = document.createElement("div");
269
+ el.className = `module-status module-status--${status}`;
270
+ const span = document.createElement("span");
271
+ span.textContent = label ?? defaults[status] ?? status;
272
+ el.appendChild(span);
273
+ if (status === "completed" || status === "viewed") {
274
+ el.insertAdjacentHTML("beforeend", checkSvg);
275
+ } else if (status === "pending-review") {
276
+ el.insertAdjacentHTML("beforeend", clockSvg);
277
+ }
278
+ return el;
279
+ }
280
+ // ── Icons ──────────────────────────────────────────────────────────────────
281
+ _bigIcon(type, status) {
282
+ const inactive = status === "completed" || status === "viewed" || status === "max-retakes";
283
+ const primary = "var(--bv-color-primary)";
284
+ if (type === "download") {
285
+ return `<svg viewBox="0 0 34 34" fill="none" aria-hidden="true"><path d="M17 34C26.3888 34 34 26.3888 34 17C34 7.61116 26.3888 0 17 0C7.61116 0 0 7.61116 0 17C0 26.3888 7.61116 34 17 34Z" fill="${primary}"/><path d="M23.8 17L17 23.8L10.2 17M17 23.8V10.2" stroke="white" stroke-width="2.83333" stroke-linecap="round" stroke-linejoin="round"/><circle cx="17" cy="17" r="14.5" stroke="${primary}"/></svg>`;
286
+ }
287
+ if (type === "upload") {
288
+ return `<svg viewBox="0 0 34 34" fill="none" aria-hidden="true"><path d="M17 34C26.3888 34 34 26.3888 34 17C34 7.61116 26.3888 0 17 0C7.61116 0 0 7.61116 0 17C0 26.3888 7.61116 34 17 34Z" fill="${primary}"/><path d="M10.2 17L17 10.2L23.8 17M17 10.2V23.8" stroke="white" stroke-width="2.83333" stroke-linecap="round" stroke-linejoin="round"/><circle cx="17" cy="17" r="14.5" stroke="${primary}"/></svg>`;
289
+ }
290
+ if (type === "link") {
291
+ return `<svg viewBox="0 0 36.8338 36.8338" fill="none" aria-hidden="true"><path d="M29.6472 5.65447C22.5987 -0.547875 11.8568 0.138072 5.65446 7.18657C-0.547874 14.2351 0.138072 24.977 7.18657 31.1793C14.2351 37.3817 24.977 36.6957 31.1793 29.6472C37.3817 22.5987 36.6957 11.8568 29.6472 5.65447Z" fill="${primary}"/><path d="M22.909 13.3119L13.3119 13.9248M22.909 13.3119L23.5219 22.909M22.909 13.3119L13.2216 12.511M7.39696 27.9929L17.3883 17.4428M17.3534 17.481L21.8455 12.3761" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
292
+ }
293
+ const playPath = `M13 20.6775C13 21.3934 13 21.7514 13.1496 21.9512C13.28 22.1254 13.4796 22.2343 13.6966 22.2498C13.9456 22.2676 14.2467 22.074 14.8489 21.6869L21.9298 17.1349C22.4524 16.7989 22.7137 16.631 22.8039 16.4174C22.8828 16.2308 22.8828 16.0202 22.8039 15.8336C22.7137 15.62 22.4524 15.452 21.9298 15.1161L14.8489 10.5641C14.2467 10.1769 13.9456 9.98334 13.6966 10.0011C13.4796 10.0166 13.28 10.1256 13.1496 10.2997C13 10.4996 13 10.8575 13 11.5735L13 20.6775Z`;
294
+ const opacity = inactive ? ' opacity="0.2"' : "";
295
+ return `<svg viewBox="0 0 32 32" fill="none" aria-hidden="true"><g${opacity}><rect x="1" y="1" width="30" height="30" rx="15" stroke="${primary}" stroke-width="2"/><circle cx="16" cy="16" r="14" fill="${primary}"/><path d="${playPath}" fill="white" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></g></svg>`;
296
+ }
297
+ _smallIcon(type) {
298
+ const icons = {
299
+ scorm: `<svg viewBox="0 0 15.03 16.28" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.9014 4.60034L7.51368 8.14201M7.51368 8.14201L1.126 4.60034M7.51368 8.14201L7.5137 15.267M14.2771 11.1859V5.09812C14.2771 4.84113 14.2771 4.71264 14.2392 4.59804C14.2056 4.49666 14.1508 4.4036 14.0783 4.32508C13.9963 4.23633 13.8838 4.17393 13.6587 4.04913L8.09763 0.965793C7.88451 0.847624 7.77794 0.78854 7.66509 0.765376C7.56521 0.744875 7.46219 0.744875 7.36231 0.765376C7.24946 0.78854 7.1429 0.847624 6.92977 0.965793L1.36873 4.04913C1.14364 4.17393 1.0311 4.23633 0.949147 4.32508C0.876647 4.4036 0.82178 4.49666 0.788217 4.59804C0.750278 4.71264 0.750278 4.84113 0.750278 5.09812V11.1859C0.750278 11.4429 0.750278 11.5714 0.788217 11.686C0.82178 11.7874 0.876647 11.8805 0.949147 11.959C1.0311 12.0477 1.14364 12.1101 1.36873 12.2349L6.92977 15.3183C7.1429 15.4364 7.24946 15.4955 7.36231 15.5187C7.46219 15.5392 7.56521 15.5392 7.66509 15.5187C7.77794 15.4955 7.88451 15.4364 8.09763 15.3183L13.6587 12.2349C13.8838 12.1101 13.9963 12.0477 14.0783 11.959C14.1508 11.8805 14.2056 11.7874 14.2392 11.686C14.2771 11.5714 14.2771 11.4429 14.2771 11.1859Z"/></svg>`,
300
+ assessment: `<svg viewBox="0 0 13.72 16.13" fill="none" stroke="currentColor" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12.507 6.1875V4.1625C12.507 2.90238 12.507 2.27232 12.2629 1.79102C12.0482 1.36766 11.7056 1.02345 11.2841 0.807736C10.8051 0.5625 10.1779 0.5625 8.92364 0.5625H4.14585C2.89156 0.5625 2.26441 0.5625 1.78534 0.807736C1.36393 1.02345 1.02132 1.36766 0.806601 1.79102C0.5625 2.27232 0.5625 2.90238 0.5625 4.1625V11.9625C0.5625 13.2226 0.5625 13.8527 0.806601 14.334C1.02132 14.7573 1.36393 15.1015 1.78534 15.3173C2.26441 15.5625 2.89156 15.5625 4.14585 15.5625H8.0278M8.0278 7.3125H3.54862M5.04168 10.3125H3.54862M9.52086 4.3125H3.54862M9.89413 10.3142C10.0257 9.93852 10.2853 9.62175 10.627 9.41998C10.9688 9.21821 11.3705 9.14445 11.7612 9.21178C12.1519 9.2791 12.5062 9.48315 12.7615 9.7878C13.0168 10.0925 13.1565 10.478 13.1559 10.8763C13.1559 12.0004 11.4775 12.5625 11.4775 12.5625M11.4991 14.8125H11.5066"/></svg>`,
301
+ survey: `<svg viewBox="0 0 14.56 11.63" fill="none" stroke="currentColor" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 5.8125L5.04168 5.8125M14 1.3125L5.04168 1.3125M14 10.3125L5.04168 10.3125M2.05556 5.8125C2.05556 6.22671 1.72133 6.5625 1.30903 6.5625C0.896733 6.5625 0.5625 6.22671 0.5625 5.8125C0.5625 5.39829 0.896733 5.0625 1.30903 5.0625C1.72133 5.0625 2.05556 5.39829 2.05556 5.8125ZM2.05556 1.3125C2.05556 1.72671 1.72133 2.0625 1.30903 2.0625C0.896733 2.0625 0.5625 1.72671 0.5625 1.3125C0.5625 0.898286 0.896733 0.5625 1.30903 0.5625C1.72133 0.5625 2.05556 0.898286 2.05556 1.3125ZM2.05556 10.3125C2.05556 10.7267 1.72133 11.0625 1.30903 11.0625C0.896733 11.0625 0.5625 10.7267 0.5625 10.3125C0.5625 9.89829 0.896733 9.5625 1.30903 9.5625C1.72133 9.5625 2.05556 9.89829 2.05556 10.3125Z"/></svg>`,
302
+ download: `<svg viewBox="0 0 16.06 14.63" fill="none" stroke="currentColor" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8.77433 3.56259L7.94155 1.88928C7.70187 1.40769 7.58202 1.16689 7.40323 0.990961C7.24512 0.835387 7.05457 0.717069 6.84535 0.644571C6.60877 0.562589 6.3408 0.562589 5.80485 0.562589H2.9514C2.1152 0.562589 1.69711 0.562589 1.37773 0.726079C1.09679 0.869889 0.868379 1.09936 0.725234 1.3816C0.562501 1.70247 0.562501 2.12251 0.562501 2.96259V3.56259M0.562501 3.56259H11.9098C13.164 3.56259 13.7912 3.56259 14.2703 3.80782C14.6917 4.02354 15.0343 4.36775 15.249 4.79111C15.4931 5.27241 15.4931 5.90247 15.4931 7.16259V10.4626C15.4931 11.7227 15.4931 12.3528 15.249 12.8341C15.0343 13.2574 14.6917 13.6016 14.2703 13.8174C13.7912 14.0626 13.164 14.0626 11.9098 14.0626H4.14585C2.89156 14.0626 2.26441 14.0626 1.78534 13.8174C1.36393 13.6016 1.02132 13.2574 0.806601 12.8341C0.562501 12.3528 0.562501 11.7227 0.562501 10.4626V3.56259ZM10.2674 8.81259L8.0278 11.0626L5.78821 8.81259M8.0278 11.0626V6.56259"/></svg>`,
303
+ link: `<svg viewBox="0 0 15.97 16.03" fill="none" stroke="currentColor" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.49261 8.76267C6.81321 9.19327 7.22223 9.54956 7.69194 9.80737C8.16166 10.0652 8.68106 10.2185 9.21494 10.2569C9.74882 10.2953 10.2847 10.2179 10.7862 10.03C11.2876 9.84207 11.743 9.54797 12.1214 9.16767L14.361 6.91767C15.041 6.21041 15.4172 5.26315 15.4087 4.27991C15.4002 3.29668 15.0076 2.35613 14.3156 1.66085C13.6235 0.965569 12.6873 0.571186 11.7086 0.562642C10.7299 0.554098 9.78705 0.932077 9.08307 1.61517L7.79903 2.89767M9.47873 7.26267C9.15813 6.83207 8.7491 6.47578 8.27939 6.21796C7.80968 5.96015 7.29027 5.80683 6.75639 5.76842C6.22252 5.73001 5.68666 5.80739 5.18517 5.99533C4.68369 6.18327 4.2283 6.47737 3.84989 6.85767L1.6103 9.10767C0.930367 9.81493 0.554137 10.7622 0.562641 11.7454C0.571146 12.7287 0.963705 13.6692 1.65577 14.3645C2.34783 15.0598 3.28403 15.4542 4.26272 15.4627C5.24141 15.4712 6.18428 15.0933 6.88827 14.4102L8.16483 13.1277"/></svg>`,
304
+ "adobe-connect": `<svg viewBox="0 0 16.06 14.63" fill="none" stroke="currentColor" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11.7605 0.56252L8.0278 3.56252L4.29515 0.56252M4.14585 14.0625H11.9098C13.164 14.0625 13.7912 14.0625 14.2703 13.8173C14.6917 13.6016 15.0343 13.2574 15.249 12.834C15.4931 12.3527 15.4931 11.7226 15.4931 10.4625V7.16252C15.4931 5.9024 15.4931 5.27234 15.249 4.79104C15.0343 4.36768 14.6917 4.02347 14.2703 3.80776C13.7912 3.56252 13.164 3.56252 11.9098 3.56252H4.14585C2.89156 3.56252 2.26441 3.56252 1.78534 3.80776C1.36393 4.02347 1.02132 4.36768 0.806601 4.79104C0.5625 5.27234 0.5625 5.9024 0.5625 7.16252V10.4625C0.5625 11.7226 0.5625 12.3527 0.806601 12.834C1.02132 13.2574 1.36393 13.6016 1.78534 13.8173C2.26441 14.0625 2.89156 14.0625 4.14585 14.0625Z"/></svg>`,
305
+ video: `<svg viewBox="0 0 16.06 11.63" fill="none" stroke="currentColor" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.4931 3.51103C15.4931 3.05667 15.4931 2.82949 15.4037 2.72429C15.3261 2.63301 15.2097 2.58457 15.0906 2.59399C14.9533 2.60484 14.7934 2.76548 14.4736 3.08676L11.7605 5.8125L14.4736 8.53824C14.7934 8.85952 14.9533 9.02016 15.0906 9.03101C15.2097 9.04043 15.3261 8.99199 15.4037 8.90071C15.4931 8.79552 15.4931 8.56833 15.4931 8.11397V3.51103ZM0.5625 4.1625C0.5625 2.90238 0.5625 2.27232 0.806601 1.79102C1.02132 1.36766 1.36393 1.02345 1.78534 0.807736C2.26441 0.5625 2.89156 0.5625 4.14585 0.5625H8.17711C9.4314 0.5625 10.0585 0.5625 10.5376 0.807736C10.959 1.02345 11.3016 1.36766 11.5164 1.79102C11.7605 2.27232 11.7605 2.90238 11.7605 4.1625V7.4625C11.7605 8.72262 11.7605 9.35268 11.5164 9.83398C11.3016 10.2573 10.959 10.6015 10.5376 10.8173C10.0585 11.0625 9.4314 11.0625 8.17711 11.0625H4.14584C2.89156 11.0625 2.26441 11.0625 1.78534 10.8173C1.36393 10.6015 1.02132 10.2573 0.806601 9.83398C0.5625 9.35268 0.5625 8.72262 0.5625 7.4625V4.1625Z"/></svg>`,
306
+ upload: `<svg viewBox="0 0 14.75 16.13" fill="none" stroke="currentColor" stroke-width="1.125" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.39 4.3125V4.1625C13.39 2.90238 13.39 2.27232 13.1278 1.79102C12.8972 1.36766 12.5293 1.02345 12.0767 0.807736C11.5622 0.5625 10.8887 0.5625 9.54172 0.5625H4.41074C3.06373 0.5625 2.39022 0.5625 1.87573 0.807736C1.42318 1.02345 1.05524 1.36766 0.824646 1.79102C0.5625 2.27232 0.5625 2.90238 0.5625 4.1625V11.9625C0.5625 13.2226 0.5625 13.8527 0.824646 14.334C1.05524 14.7573 1.42318 15.1015 1.87573 15.3173C2.39022 15.5625 3.06373 15.5625 4.41074 15.5625H7.37709M7.37709 7.3125H3.76936M6.57537 10.3125H3.76936M10.1831 4.3125H3.76936M11.7865 12.5625V8.4375C11.7865 7.81618 12.3249 7.3125 12.9891 7.3125C13.6533 7.3125 14.1917 7.81618 14.1917 8.4375V12.5625C14.1917 13.8051 13.1149 14.8125 11.7865 14.8125C10.4582 14.8125 9.38138 13.8051 9.38138 12.5625V9.5625"/></svg>`
307
+ };
308
+ return icons[type] ?? icons["scorm"];
309
+ }
310
+ // ── Pre-enrollment section ─────────────────────────────────────────────────
311
+ _buildPreEnrollSection(sec, sIdx) {
312
+ var _a;
313
+ const wrap = document.createElement("div");
314
+ wrap.className = "section section--pre-enrollment" + (sec.expanded ? " section--expanded" : "");
315
+ const header = document.createElement("div");
316
+ header.className = "section-header";
317
+ header.setAttribute("role", "button");
318
+ header.setAttribute("tabindex", "0");
319
+ header.setAttribute("aria-expanded", String(!!sec.expanded));
320
+ const left = document.createElement("div");
321
+ left.className = "section-header-left";
322
+ const titleRow = document.createElement("div");
323
+ titleRow.className = "pre-title-row";
324
+ const titleEl = document.createElement("span");
325
+ titleEl.className = "section-title";
326
+ titleEl.textContent = sec.title;
327
+ const count = ((_a = sec.modules) == null ? void 0 : _a.length) ?? 0;
328
+ let countEl = null;
329
+ if (count > 0) {
330
+ countEl = document.createElement("span");
331
+ countEl.className = "section-badge";
332
+ countEl.textContent = `${count} Modules`;
333
+ titleRow.append(titleEl, countEl);
334
+ } else {
335
+ titleRow.appendChild(titleEl);
336
+ }
337
+ left.appendChild(titleRow);
338
+ if (sec.description) {
339
+ const descWrap = document.createElement("div");
340
+ descWrap.className = "pre-section-desc-wrap";
341
+ const desc = document.createElement("p");
342
+ desc.className = "section-desc";
343
+ desc.textContent = sec.description;
344
+ const readMore = document.createElement("button");
345
+ readMore.className = "read-more";
346
+ readMore.textContent = "Read More";
347
+ readMore.hidden = true;
348
+ readMore.addEventListener("click", (e) => {
349
+ e.stopPropagation();
350
+ const expanded = descWrap.classList.toggle("section-desc-wrap--expanded");
351
+ readMore.textContent = expanded ? "Read Less" : "Read More";
352
+ this.dispatchEvent(
353
+ new CustomEvent("bv-read-more", {
354
+ bubbles: true,
355
+ composed: true,
356
+ detail: { sectionIndex: sIdx }
357
+ })
358
+ );
359
+ });
360
+ requestAnimationFrame(() => {
361
+ readMore.hidden = desc.scrollHeight <= desc.clientHeight;
362
+ });
363
+ descWrap.append(desc, readMore);
364
+ left.appendChild(descWrap);
365
+ }
366
+ const chevron = document.createElement("div");
367
+ chevron.className = "section-chevron";
368
+ chevron.setAttribute("aria-hidden", "true");
369
+ chevron.innerHTML = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>`;
370
+ header.append(left, chevron);
371
+ const toggle = () => {
372
+ sec.expanded = !sec.expanded;
373
+ wrap.classList.toggle("section--expanded", sec.expanded);
374
+ header.setAttribute("aria-expanded", String(sec.expanded));
375
+ this._updateExpandBtn();
376
+ this.dispatchEvent(
377
+ new CustomEvent("bv-section-toggle", {
378
+ bubbles: true,
379
+ composed: true,
380
+ detail: { sectionIndex: sIdx, expanded: sec.expanded }
381
+ })
382
+ );
383
+ };
384
+ header.addEventListener("click", toggle);
385
+ header.addEventListener("keydown", (e) => {
386
+ if (e.key === "Enter" || e.key === " ") {
387
+ e.preventDefault();
388
+ toggle();
389
+ }
390
+ });
391
+ wrap.appendChild(header);
392
+ const body = document.createElement("div");
393
+ body.className = "section-body";
394
+ if (!count) {
395
+ const empty = document.createElement("p");
396
+ empty.className = "pre-section-empty";
397
+ empty.textContent = "There are no modules in this section yet.";
398
+ body.appendChild(empty);
399
+ } else {
400
+ const moduleList = document.createElement("div");
401
+ moduleList.className = "pre-module-list";
402
+ sec.modules.forEach((mod, mIdx) => {
403
+ if (mIdx > 0) {
404
+ const sep = document.createElement("div");
405
+ sep.className = "module-sep";
406
+ moduleList.appendChild(sep);
407
+ }
408
+ moduleList.appendChild(this._buildPreEnrollModule(mod, sIdx, mIdx));
409
+ });
410
+ body.appendChild(moduleList);
411
+ }
412
+ wrap.appendChild(body);
413
+ return wrap;
414
+ }
415
+ // ── Pre-enrollment module row ──────────────────────────────────────────────
416
+ _buildPreEnrollModule(mod, sIdx, mIdx) {
417
+ const plusSvg = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>`;
418
+ const minusSvg = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="5" y1="12" x2="19" y2="12"/></svg>`;
419
+ const wrap = document.createElement("div");
420
+ wrap.className = "pre-module-wrap";
421
+ const row = document.createElement("div");
422
+ row.className = "pre-module-row";
423
+ const typeIcon = document.createElement("span");
424
+ typeIcon.className = "module-type-icon";
425
+ typeIcon.innerHTML = this._smallIcon(mod.type);
426
+ const titleEl = document.createElement("span");
427
+ titleEl.className = "pre-module-title";
428
+ titleEl.textContent = mod.title;
429
+ const badges = document.createElement("div");
430
+ badges.className = "pre-module-badges";
431
+ if (mod.inactive) {
432
+ const b = document.createElement("span");
433
+ b.className = "pre-badge pre-badge--inactive";
434
+ b.textContent = "Inactive";
435
+ badges.appendChild(b);
436
+ }
437
+ if (mod.optional) {
438
+ const b = document.createElement("span");
439
+ b.className = "pre-badge pre-badge--optional";
440
+ b.textContent = "Optional";
441
+ badges.appendChild(b);
442
+ }
443
+ let descEl = null;
444
+ if (mod.description) {
445
+ descEl = document.createElement("p");
446
+ descEl.className = "pre-module-desc";
447
+ descEl.textContent = mod.description;
448
+ descEl.hidden = true;
449
+ }
450
+ const titleGroup = document.createElement("div");
451
+ titleGroup.className = "pre-module-title-group";
452
+ titleGroup.append(titleEl, badges);
453
+ row.append(typeIcon, titleGroup);
454
+ if (descEl) {
455
+ const toggleBtn = document.createElement("button");
456
+ toggleBtn.className = "pre-module-toggle";
457
+ toggleBtn.setAttribute("aria-expanded", "false");
458
+ toggleBtn.innerHTML = plusSvg;
459
+ toggleBtn.addEventListener("click", (e) => {
460
+ e.stopPropagation();
461
+ const nowExpanded = toggleBtn.getAttribute("aria-expanded") !== "true";
462
+ toggleBtn.setAttribute("aria-expanded", String(nowExpanded));
463
+ toggleBtn.innerHTML = nowExpanded ? minusSvg : plusSvg;
464
+ descEl.hidden = !nowExpanded;
465
+ wrap.classList.toggle("pre-module-wrap--expanded", nowExpanded);
466
+ this.dispatchEvent(
467
+ new CustomEvent("bv-module-toggle", {
468
+ bubbles: true,
469
+ composed: true,
470
+ detail: { sectionIndex: sIdx, moduleIndex: mIdx, expanded: nowExpanded }
471
+ })
472
+ );
473
+ });
474
+ row.appendChild(toggleBtn);
475
+ wrap.appendChild(row);
476
+ wrap.appendChild(descEl);
477
+ } else {
478
+ wrap.appendChild(row);
479
+ }
480
+ return wrap;
481
+ }
482
+ };
483
+ if (!customElements.get("bv-course-outline")) {
484
+ customElements.define("bv-course-outline", BvCourseOutline);
485
+ }
486
+ export {
487
+ BvCourseOutline
488
+ };
@@ -0,0 +1,10 @@
1
+ export declare class BvEmptyState extends HTMLElement {
2
+ static readonly observedAttributes: string[];
3
+ private _rendered;
4
+ private _titleEl;
5
+ private _descEl;
6
+ constructor();
7
+ connectedCallback(): void;
8
+ attributeChangedCallback(name: string, _old: string | null, val: string | null): void;
9
+ private _render;
10
+ }
@@ -0,0 +1,69 @@
1
+ // css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-empty-state/bv-empty-state.css
2
+ var bv_empty_state_default = ":host {\n display: flex;\n width: 100%;\n}\n\n.wrap {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 48px 24px;\n gap: 16px;\n width: 100%;\n font-family: var(--bv-font-family-base);\n}\n\n.icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border-radius: var(--bv-radius-lg);\n background: var(--bv-color-neutral-100);\n color: var(--bv-color-neutral-500);\n}\n\n.text {\n display: flex;\n flex-direction: column;\n gap: 4px;\n max-width: 360px;\n}\n\n.title {\n font-size: var(--bv-font-size-md);\n font-weight: var(--bv-font-weight-semibold);\n color: var(--bv-color-neutral-800);\n margin: 0;\n line-height: 24px;\n}\n\n.description {\n font-size: var(--bv-font-size-sm);\n color: var(--bv-color-neutral-500);\n margin: 0;\n line-height: 20px;\n}\n\n.action ::slotted(*) {\n margin-top: 4px;\n}\n";
3
+
4
+ // components/bv-empty-state/bv-empty-state.ts
5
+ var BvEmptyState = class extends HTMLElement {
6
+ static observedAttributes = ["title", "description"];
7
+ _rendered = false;
8
+ _titleEl = null;
9
+ _descEl = null;
10
+ constructor() {
11
+ super();
12
+ this.attachShadow({ mode: "open" });
13
+ if ("replaceSync" in CSSStyleSheet.prototype) {
14
+ const sheet = new CSSStyleSheet();
15
+ sheet.replaceSync(bv_empty_state_default);
16
+ this.shadowRoot.adoptedStyleSheets = [sheet];
17
+ }
18
+ }
19
+ connectedCallback() {
20
+ this._render();
21
+ }
22
+ attributeChangedCallback(name, _old, val) {
23
+ if (!this._rendered) return;
24
+ if (name === "title" && this._titleEl) this._titleEl.textContent = val ?? "";
25
+ if (name === "description" && this._descEl) this._descEl.textContent = val ?? "";
26
+ }
27
+ _render() {
28
+ if (this._rendered) return;
29
+ this._rendered = true;
30
+ const shadow = this.shadowRoot;
31
+ if (!shadow.adoptedStyleSheets.length) {
32
+ const s = document.createElement("style");
33
+ s.textContent = bv_empty_state_default;
34
+ shadow.appendChild(s);
35
+ }
36
+ const wrap = document.createElement("div");
37
+ wrap.className = "wrap";
38
+ const iconWrap = document.createElement("div");
39
+ iconWrap.className = "icon";
40
+ const iconSlot = document.createElement("slot");
41
+ iconSlot.name = "icon";
42
+ iconSlot.innerHTML = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
43
+ <path d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
44
+ </svg>`;
45
+ iconWrap.appendChild(iconSlot);
46
+ const textWrap = document.createElement("div");
47
+ textWrap.className = "text";
48
+ this._titleEl = document.createElement("p");
49
+ this._titleEl.className = "title";
50
+ this._titleEl.textContent = this.getAttribute("title") ?? "";
51
+ this._descEl = document.createElement("p");
52
+ this._descEl.className = "description";
53
+ this._descEl.textContent = this.getAttribute("description") ?? "";
54
+ textWrap.append(this._titleEl, this._descEl);
55
+ const actionWrap = document.createElement("div");
56
+ actionWrap.className = "action";
57
+ const actionSlot = document.createElement("slot");
58
+ actionSlot.name = "action";
59
+ actionWrap.appendChild(actionSlot);
60
+ wrap.append(iconWrap, textWrap, actionWrap);
61
+ shadow.appendChild(wrap);
62
+ }
63
+ };
64
+ if (!customElements.get("bv-empty-state")) {
65
+ customElements.define("bv-empty-state", BvEmptyState);
66
+ }
67
+ export {
68
+ BvEmptyState
69
+ };
@@ -0,0 +1,26 @@
1
+ export interface FilterDropdownOption {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ export declare class BvFilterDropdown extends HTMLElement {
6
+ static readonly observedAttributes: string[];
7
+ private _rendered;
8
+ private _labelEl;
9
+ private _panelEl;
10
+ private _options;
11
+ private _value;
12
+ private _offClick;
13
+ constructor();
14
+ connectedCallback(): void;
15
+ disconnectedCallback(): void;
16
+ get value(): string;
17
+ attributeChangedCallback(name: string, _old: string | null, val: string | null): void;
18
+ private _render;
19
+ private _toggle;
20
+ private _open;
21
+ private _close;
22
+ private _syncLabel;
23
+ private _renderOptions;
24
+ private _syncSelected;
25
+ private _select;
26
+ }