bareframe 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/dist/bareframe.min.js +33 -17
- package/dist/components/action-list.js +0 -3
- package/dist/components/anchor.js +0 -3
- package/dist/components/bottom-navigation.js +0 -3
- package/dist/components/breadcrumb.js +0 -4
- package/dist/components/button.js +2 -2
- package/dist/components/calendar.js +0 -3
- package/dist/components/canvas.js +0 -3
- package/dist/components/card.js +0 -3
- package/dist/components/carousel.js +0 -3
- package/dist/components/combobox.js +0 -3
- package/dist/components/command-palette.js +0 -3
- package/dist/components/countdown.js +0 -3
- package/dist/components/data-grid.js +0 -3
- package/dist/components/date-picker.js +0 -3
- package/dist/components/date-range-picker.js +0 -3
- package/dist/components/dialog.js +0 -3
- package/dist/components/drawer.js +0 -3
- package/dist/components/dropdown.js +0 -3
- package/dist/components/edge.js +0 -3
- package/dist/components/editor.css +111 -0
- package/dist/components/editor.js +173 -0
- package/dist/components/empty-state.js +0 -3
- package/dist/components/error-summary.js +0 -3
- package/dist/components/fab.js +0 -3
- package/dist/components/filter-bar.js +0 -3
- package/dist/components/form-field.js +0 -3
- package/dist/components/grid.js +0 -3
- package/dist/components/hero.js +0 -3
- package/dist/components/icon.js +0 -3
- package/dist/components/image.js +0 -3
- package/dist/components/key-value-list.js +0 -3
- package/dist/components/link.js +0 -3
- package/dist/components/list.js +0 -3
- package/dist/components/loading-indicator.js +0 -3
- package/dist/components/map.js +0 -3
- package/dist/components/menu.js +0 -3
- package/dist/components/message.js +0 -3
- package/dist/components/metric-card.js +0 -3
- package/dist/components/modal.js +0 -3
- package/dist/components/nav.js +0 -3
- package/dist/components/number-field.js +0 -3
- package/dist/components/otp-input.js +0 -3
- package/dist/components/pagination.js +0 -3
- package/dist/components/quick-actions.js +0 -3
- package/dist/components/search.js +0 -3
- package/dist/components/segmented-control.js +0 -3
- package/dist/components/split-button.js +0 -3
- package/dist/components/splitter.js +0 -3
- package/dist/components/stack.js +0 -3
- package/dist/components/tab.js +0 -3
- package/dist/components/table.js +0 -3
- package/dist/components/tag.js +0 -3
- package/dist/components/timeline.js +0 -3
- package/dist/components/toast.js +0 -3
- package/dist/components/toggle.js +0 -3
- package/dist/components/toolbar.js +0 -3
- package/dist/components/tree-view.js +0 -3
- package/dist/components/video-player.js +0 -3
- package/dist/components/virtual-list.js +0 -3
- package/dist/index.js +153 -225
- package/dist/manifest.json +3 -4
- package/package.json +5 -3
- package/dist/components/code-block.css +0 -30
- package/dist/components/code-block.js +0 -31
- package/dist/components/textarea.css +0 -30
- package/dist/components/textarea.js +0 -31
package/dist/index.js
CHANGED
|
@@ -150,9 +150,6 @@ var BfActionList = class extends HTMLElement {
|
|
|
150
150
|
root.className = "root";
|
|
151
151
|
root.setAttribute("part", "root");
|
|
152
152
|
root.innerHTML = "<slot></slot>";
|
|
153
|
-
if (!this.innerHTML.trim()) {
|
|
154
|
-
root.textContent = "action list";
|
|
155
|
-
}
|
|
156
153
|
this.shadowRoot.replaceChildren(link, root);
|
|
157
154
|
}
|
|
158
155
|
};
|
|
@@ -177,9 +174,6 @@ var BfAnchor = class extends HTMLElement {
|
|
|
177
174
|
root.className = "root";
|
|
178
175
|
root.setAttribute("part", "root");
|
|
179
176
|
root.innerHTML = "<slot></slot>";
|
|
180
|
-
if (!this.innerHTML.trim()) {
|
|
181
|
-
root.textContent = "anchor";
|
|
182
|
-
}
|
|
183
177
|
this.shadowRoot.replaceChildren(link, root);
|
|
184
178
|
}
|
|
185
179
|
};
|
|
@@ -473,9 +467,6 @@ var BfBottomNavigation = class extends HTMLElement {
|
|
|
473
467
|
root.className = "root";
|
|
474
468
|
root.setAttribute("part", "root");
|
|
475
469
|
root.innerHTML = "<slot></slot>";
|
|
476
|
-
if (!this.innerHTML.trim()) {
|
|
477
|
-
root.textContent = "bottom navigation";
|
|
478
|
-
}
|
|
479
470
|
this.shadowRoot.replaceChildren(link, root);
|
|
480
471
|
}
|
|
481
472
|
};
|
|
@@ -592,10 +583,6 @@ var BfBreadcrumb = class extends HTMLElement {
|
|
|
592
583
|
this._root.setAttribute("data-variant", this._variant());
|
|
593
584
|
this._list.replaceChildren();
|
|
594
585
|
if (!items.length) {
|
|
595
|
-
const fallback = document.createElement("li");
|
|
596
|
-
fallback.className = "item";
|
|
597
|
-
fallback.textContent = "breadcrumb";
|
|
598
|
-
this._list.append(fallback);
|
|
599
586
|
return;
|
|
600
587
|
}
|
|
601
588
|
items.forEach((item, index) => {
|
|
@@ -646,7 +633,7 @@ var BfButton = class extends HTMLElement {
|
|
|
646
633
|
return;
|
|
647
634
|
}
|
|
648
635
|
this._initialized = true;
|
|
649
|
-
const label = this.getAttribute("label") || "
|
|
636
|
+
const label = this.getAttribute("label") || "";
|
|
650
637
|
const cssUrl = new URL("data:text/css;charset=utf-8,%3Ahost%20%7B%0A%09--bf-button-font%3A%20var(--bf-theme-font-family%2C%20inherit)%3B%0A%09--bf-button-border-width%3A%20var(--bf-theme-border-width%2C%201px)%3B%0A%09--bf-button-border-style%3A%20var(--bf-theme-border-style%2C%20solid)%3B%0A%09--bf-button-border-radius%3A%20var(--bf-theme-radius-md%2C%206px)%3B%0A%09--bf-button-padding-y%3A%20var(--bf-theme-space-2%2C%200.5rem)%3B%0A%09--bf-button-padding-x%3A%20var(--bf-theme-space-3%2C%200.9rem)%3B%0A%09--bf-button-cursor%3A%20var(--bf-theme-cursor-button%2C%20pointer)%3B%0A%09--bf-button-opacity-hover%3A%20var(--bf-theme-opacity-hover%2C%200.95)%3B%0A%09--bf-button-active-translate-y%3A%20var(--bf-theme-active-translate-y%2C%201px)%3B%0A%09--bf-button-focus-outline-width%3A%20var(--bf-theme-focus-ring-width%2C%202px)%3B%0A%09--bf-button-focus-outline-style%3A%20var(--bf-theme-focus-ring-style%2C%20solid)%3B%0A%09--bf-button-focus-outline-color%3A%20var(--bf-theme-focus-ring-color%2C%20%2393c5fd)%3B%0A%09--bf-button-focus-outline-offset%3A%20var(--bf-theme-focus-ring-offset%2C%202px)%3B%0A%09--bf-button-transition%3A%0A%09%09var(--bf-theme-transition-transform%2C%20transform%20120ms%20ease)%2C%0A%09%09var(--bf-theme-transition-opacity%2C%20opacity%20120ms%20ease)%2C%0A%09%09var(--bf-theme-transition-bg%2C%20background-color%20120ms%20ease)%2C%0A%09%09var(--bf-theme-transition-color%2C%20color%20120ms%20ease)%2C%0A%09%09var(--bf-theme-transition-border%2C%20border-color%20120ms%20ease)%3B%0A%0A%09--bf-button-primary-bg%3A%20var(--bf-theme-button-primary-bg%2C%20%231d4ed8)%3B%0A%09--bf-button-primary-color%3A%20var(--bf-theme-button-primary-color%2C%20%23ffffff)%3B%0A%09--bf-button-primary-border-color%3A%20var(%0A%09%09--bf-theme-button-primary-border-color%2C%0A%09%09transparent%0A%09)%3B%0A%09--bf-button-primary-hover-bg%3A%20var(--bf-button-primary-bg)%3B%0A%09--bf-button-primary-hover-color%3A%20var(--bf-button-primary-color)%3B%0A%09--bf-button-primary-hover-border-color%3A%20var(--bf-button-primary-border-color)%3B%0A%09--bf-button-primary-active-bg%3A%20var(--bf-button-primary-bg)%3B%0A%09--bf-button-primary-active-color%3A%20var(--bf-button-primary-color)%3B%0A%09--bf-button-primary-active-border-color%3A%20var(%0A%09%09--bf-button-primary-border-color%0A%09)%3B%0A%0A%09--bf-button-secondary-bg%3A%20var(--bf-theme-button-secondary-bg%2C%20%23ffffff)%3B%0A%09--bf-button-secondary-color%3A%20var(--bf-theme-button-secondary-color%2C%20%231d4ed8)%3B%0A%09--bf-button-secondary-border-color%3A%20var(%0A%09%09--bf-theme-button-secondary-border-color%2C%0A%09%09%231d4ed8%0A%09)%3B%0A%09--bf-button-secondary-hover-bg%3A%20var(--bf-button-secondary-bg)%3B%0A%09--bf-button-secondary-hover-color%3A%20var(--bf-button-secondary-color)%3B%0A%09--bf-button-secondary-hover-border-color%3A%20var(%0A%09%09--bf-button-secondary-border-color%0A%09)%3B%0A%09--bf-button-secondary-active-bg%3A%20var(--bf-button-secondary-bg)%3B%0A%09--bf-button-secondary-active-color%3A%20var(--bf-button-secondary-color)%3B%0A%09--bf-button-secondary-active-border-color%3A%20var(%0A%09%09--bf-button-secondary-border-color%0A%09)%3B%0A%0A%09display%3A%20inline-block%3B%0A%7D%0A%0Abutton%20%7B%0A%09--_bf-button-bg%3A%20var(--bf-button-primary-bg)%3B%0A%09--_bf-button-color%3A%20var(--bf-button-primary-color)%3B%0A%09--_bf-button-border-color%3A%20var(--bf-button-primary-border-color)%3B%0A%09--_bf-button-hover-bg%3A%20var(--bf-button-primary-hover-bg)%3B%0A%09--_bf-button-hover-color%3A%20var(--bf-button-primary-hover-color)%3B%0A%09--_bf-button-hover-border-color%3A%20var(--bf-button-primary-hover-border-color)%3B%0A%09--_bf-button-active-bg%3A%20var(--bf-button-primary-active-bg)%3B%0A%09--_bf-button-active-color%3A%20var(--bf-button-primary-active-color)%3B%0A%09--_bf-button-active-border-color%3A%20var(%0A%09%09--bf-button-primary-active-border-color%0A%09)%3B%0A%0A%09font%3A%20var(--bf-button-font)%3B%0A%09border-width%3A%20var(--bf-button-border-width)%3B%0A%09border-style%3A%20var(--bf-button-border-style)%3B%0A%09border-color%3A%20var(--_bf-button-border-color)%3B%0A%09border-radius%3A%20var(--bf-button-border-radius)%3B%0A%09cursor%3A%20var(--bf-button-cursor)%3B%0A%09padding%3A%20var(--bf-button-padding-y)%20var(--bf-button-padding-x)%3B%0A%09transition%3A%20var(--bf-button-transition)%3B%0A%09background%3A%20var(--_bf-button-bg)%3B%0A%09color%3A%20var(--_bf-button-color)%3B%0A%7D%0A%0Abutton%3Ahover%20%7B%0A%09opacity%3A%20var(--bf-button-opacity-hover)%3B%0A%09background%3A%20var(--_bf-button-hover-bg)%3B%0A%09color%3A%20var(--_bf-button-hover-color)%3B%0A%09border-color%3A%20var(--_bf-button-hover-border-color)%3B%0A%7D%0A%0Abutton%3Aactive%20%7B%0A%09transform%3A%20translateY(var(--bf-button-active-translate-y))%3B%0A%09background%3A%20var(--_bf-button-active-bg)%3B%0A%09color%3A%20var(--_bf-button-active-color)%3B%0A%09border-color%3A%20var(--_bf-button-active-border-color)%3B%0A%7D%0A%0Abutton%3Afocus-visible%20%7B%0A%09outline-width%3A%20var(--bf-button-focus-outline-width)%3B%0A%09outline-style%3A%20var(--bf-button-focus-outline-style)%3B%0A%09outline-color%3A%20var(--bf-button-focus-outline-color)%3B%0A%09outline-offset%3A%20var(--bf-button-focus-outline-offset)%3B%0A%7D%0A%0Abutton%3Adisabled%20%7B%0A%09opacity%3A%20var(--bf-button-disabled-opacity%2C%200.55)%3B%0A%09cursor%3A%20var(--bf-button-disabled-cursor%2C%20not-allowed)%3B%0A%7D%0A%0Abutton.primary%20%7B%0A%09--_bf-button-bg%3A%20var(--bf-button-primary-bg)%3B%0A%09--_bf-button-color%3A%20var(--bf-button-primary-color)%3B%0A%09--_bf-button-border-color%3A%20var(--bf-button-primary-border-color)%3B%0A%09--_bf-button-hover-bg%3A%20var(--bf-button-primary-hover-bg)%3B%0A%09--_bf-button-hover-color%3A%20var(--bf-button-primary-hover-color)%3B%0A%09--_bf-button-hover-border-color%3A%20var(--bf-button-primary-hover-border-color)%3B%0A%09--_bf-button-active-bg%3A%20var(--bf-button-primary-active-bg)%3B%0A%09--_bf-button-active-color%3A%20var(--bf-button-primary-active-color)%3B%0A%09--_bf-button-active-border-color%3A%20var(%0A%09%09--bf-button-primary-active-border-color%0A%09)%3B%0A%7D%0A%0Abutton.secondary%20%7B%0A%09--_bf-button-bg%3A%20var(--bf-button-secondary-bg)%3B%0A%09--_bf-button-color%3A%20var(--bf-button-secondary-color)%3B%0A%09--_bf-button-border-color%3A%20var(--bf-button-secondary-border-color)%3B%0A%09--_bf-button-hover-bg%3A%20var(--bf-button-secondary-hover-bg)%3B%0A%09--_bf-button-hover-color%3A%20var(--bf-button-secondary-hover-color)%3B%0A%09--_bf-button-hover-border-color%3A%20var(%0A%09%09--bf-button-secondary-hover-border-color%0A%09)%3B%0A%09--_bf-button-active-bg%3A%20var(--bf-button-secondary-active-bg)%3B%0A%09--_bf-button-active-color%3A%20var(--bf-button-secondary-active-color)%3B%0A%09--_bf-button-active-border-color%3A%20var(%0A%09%09--bf-button-secondary-active-border-color%0A%09)%3B%0A%7D%0A%0Abutton.is-selected%20%7B%0A%09box-shadow%3A%20inset%200%200%200%202px%20var(--bf-theme-focus-ring-color%2C%20%2393c5fd)%3B%0A%7D%0A", import.meta.url);
|
|
651
638
|
this.shadowRoot.innerHTML = "";
|
|
652
639
|
const link = document.createElement("link");
|
|
@@ -677,7 +664,7 @@ var BfButton = class extends HTMLElement {
|
|
|
677
664
|
}
|
|
678
665
|
_onClick() {
|
|
679
666
|
this._applyGroupSelection();
|
|
680
|
-
const label = this.getAttribute("label") || "
|
|
667
|
+
const label = this.getAttribute("label") || "";
|
|
681
668
|
const variant = this.getAttribute("variant") || "primary";
|
|
682
669
|
this.dispatchEvent(
|
|
683
670
|
new CustomEvent("bf-click", {
|
|
@@ -759,9 +746,6 @@ var BfCalendar = class extends HTMLElement {
|
|
|
759
746
|
root.className = "root";
|
|
760
747
|
root.setAttribute("part", "root");
|
|
761
748
|
root.innerHTML = "<slot></slot>";
|
|
762
|
-
if (!this.innerHTML.trim()) {
|
|
763
|
-
root.textContent = "calendar";
|
|
764
|
-
}
|
|
765
749
|
this.shadowRoot.replaceChildren(link, root);
|
|
766
750
|
}
|
|
767
751
|
};
|
|
@@ -786,9 +770,6 @@ var BfCanvas = class extends HTMLElement {
|
|
|
786
770
|
root.className = "root";
|
|
787
771
|
root.setAttribute("part", "root");
|
|
788
772
|
root.innerHTML = "<slot></slot>";
|
|
789
|
-
if (!this.innerHTML.trim()) {
|
|
790
|
-
root.textContent = "canvas";
|
|
791
|
-
}
|
|
792
773
|
this.shadowRoot.replaceChildren(link, root);
|
|
793
774
|
}
|
|
794
775
|
};
|
|
@@ -813,9 +794,6 @@ var BfCard = class extends HTMLElement {
|
|
|
813
794
|
root.className = "root";
|
|
814
795
|
root.setAttribute("part", "root");
|
|
815
796
|
root.innerHTML = "<slot></slot>";
|
|
816
|
-
if (!this.innerHTML.trim()) {
|
|
817
|
-
root.textContent = "card";
|
|
818
|
-
}
|
|
819
797
|
this.shadowRoot.replaceChildren(link, root);
|
|
820
798
|
}
|
|
821
799
|
};
|
|
@@ -840,9 +818,6 @@ var BfCarousel = class extends HTMLElement {
|
|
|
840
818
|
root.className = "root";
|
|
841
819
|
root.setAttribute("part", "root");
|
|
842
820
|
root.innerHTML = "<slot></slot>";
|
|
843
|
-
if (!this.innerHTML.trim()) {
|
|
844
|
-
root.textContent = "carousel";
|
|
845
|
-
}
|
|
846
821
|
this.shadowRoot.replaceChildren(link, root);
|
|
847
822
|
}
|
|
848
823
|
};
|
|
@@ -1037,33 +1012,6 @@ var BfCheckbox = class extends HTMLElement {
|
|
|
1037
1012
|
__publicField(BfCheckbox, "observedAttributes", ["checked", "disabled", "label", "value"]);
|
|
1038
1013
|
customElements.define("bf-checkbox", BfCheckbox);
|
|
1039
1014
|
|
|
1040
|
-
// src/code-block/code-block.js
|
|
1041
|
-
var BfCodeBlock = class extends HTMLElement {
|
|
1042
|
-
constructor() {
|
|
1043
|
-
super();
|
|
1044
|
-
this.attachShadow({ mode: "open" });
|
|
1045
|
-
}
|
|
1046
|
-
connectedCallback() {
|
|
1047
|
-
if (this._initialized) {
|
|
1048
|
-
return;
|
|
1049
|
-
}
|
|
1050
|
-
this._initialized = true;
|
|
1051
|
-
const cssUrl = new URL("data:text/css;charset=utf-8,%3Ahost%20%7B%0A%09--bf-code-block-font%3A%20var(--bf-theme-font-family%2C%20inherit)%3B%0A%09--bf-code-block-radius%3A%20var(--bf-theme-radius-md%2C%208px)%3B%0A%09--bf-code-block-border-width%3A%20var(--bf-theme-border-width%2C%201px)%3B%0A%09--bf-code-block-border-style%3A%20var(--bf-theme-border-style%2C%20solid)%3B%0A%09--bf-code-block-border-color%3A%20var(--bf-theme-code-block-border-color%2C%20var(--bf-theme-border-1%2C%20%23cbd5e1))%3B%0A%09--bf-code-block-bg%3A%20var(--bf-theme-code-block-bg%2C%20var(--bf-theme-surface-1%2C%20%23ffffff))%3B%0A%09--bf-code-block-color%3A%20var(--bf-theme-code-block-color%2C%20var(--bf-theme-text-1%2C%20%230f172a))%3B%0A%09--bf-code-block-padding-y%3A%20var(--bf-theme-space-2%2C%200.6rem)%3B%0A%09--bf-code-block-padding-x%3A%20var(--bf-theme-space-3%2C%200.9rem)%3B%0A%09--bf-code-block-transition%3A%0A%09%09var(--bf-theme-transition-bg%2C%20background-color%20120ms%20ease)%2C%0A%09%09var(--bf-theme-transition-color%2C%20color%20120ms%20ease)%2C%0A%09%09var(--bf-theme-transition-border%2C%20border-color%20120ms%20ease)%3B%0A%0A%09display%3A%20block%3B%0A%09font%3A%20var(--bf-code-block-font)%3B%0A%09color%3A%20var(--bf-code-block-color)%3B%0A%7D%0A%0A.root%20%7B%0A%09background%3A%20var(--bf-code-block-bg)%3B%0A%09color%3A%20var(--bf-code-block-color)%3B%0A%09border-width%3A%20var(--bf-code-block-border-width)%3B%0A%09border-style%3A%20var(--bf-code-block-border-style)%3B%0A%09border-color%3A%20var(--bf-code-block-border-color)%3B%0A%09border-radius%3A%20var(--bf-code-block-radius)%3B%0A%09padding%3A%20var(--bf-code-block-padding-y)%20var(--bf-code-block-padding-x)%3B%0A%09transition%3A%20var(--bf-code-block-transition)%3B%0A%7D%0A", import.meta.url);
|
|
1052
|
-
const link = document.createElement("link");
|
|
1053
|
-
link.rel = "stylesheet";
|
|
1054
|
-
link.href = cssUrl.href;
|
|
1055
|
-
const root = document.createElement("div");
|
|
1056
|
-
root.className = "root";
|
|
1057
|
-
root.setAttribute("part", "root");
|
|
1058
|
-
root.innerHTML = "<slot></slot>";
|
|
1059
|
-
if (!this.innerHTML.trim()) {
|
|
1060
|
-
root.textContent = "code block";
|
|
1061
|
-
}
|
|
1062
|
-
this.shadowRoot.replaceChildren(link, root);
|
|
1063
|
-
}
|
|
1064
|
-
};
|
|
1065
|
-
customElements.define("bf-code-block", BfCodeBlock);
|
|
1066
|
-
|
|
1067
1015
|
// src/combobox/combobox.js
|
|
1068
1016
|
var BfCombobox = class extends HTMLElement {
|
|
1069
1017
|
constructor() {
|
|
@@ -1083,9 +1031,6 @@ var BfCombobox = class extends HTMLElement {
|
|
|
1083
1031
|
root.className = "root";
|
|
1084
1032
|
root.setAttribute("part", "root");
|
|
1085
1033
|
root.innerHTML = "<slot></slot>";
|
|
1086
|
-
if (!this.innerHTML.trim()) {
|
|
1087
|
-
root.textContent = "combobox";
|
|
1088
|
-
}
|
|
1089
1034
|
this.shadowRoot.replaceChildren(link, root);
|
|
1090
1035
|
}
|
|
1091
1036
|
};
|
|
@@ -1110,9 +1055,6 @@ var BfCommandPalette = class extends HTMLElement {
|
|
|
1110
1055
|
root.className = "root";
|
|
1111
1056
|
root.setAttribute("part", "root");
|
|
1112
1057
|
root.innerHTML = "<slot></slot>";
|
|
1113
|
-
if (!this.innerHTML.trim()) {
|
|
1114
|
-
root.textContent = "command palette";
|
|
1115
|
-
}
|
|
1116
1058
|
this.shadowRoot.replaceChildren(link, root);
|
|
1117
1059
|
}
|
|
1118
1060
|
};
|
|
@@ -1137,9 +1079,6 @@ var BfCountdown = class extends HTMLElement {
|
|
|
1137
1079
|
root.className = "root";
|
|
1138
1080
|
root.setAttribute("part", "root");
|
|
1139
1081
|
root.innerHTML = "<slot></slot>";
|
|
1140
|
-
if (!this.innerHTML.trim()) {
|
|
1141
|
-
root.textContent = "countdown";
|
|
1142
|
-
}
|
|
1143
1082
|
this.shadowRoot.replaceChildren(link, root);
|
|
1144
1083
|
}
|
|
1145
1084
|
};
|
|
@@ -1164,9 +1103,6 @@ var BfDataGrid = class extends HTMLElement {
|
|
|
1164
1103
|
root.className = "root";
|
|
1165
1104
|
root.setAttribute("part", "root");
|
|
1166
1105
|
root.innerHTML = "<slot></slot>";
|
|
1167
|
-
if (!this.innerHTML.trim()) {
|
|
1168
|
-
root.textContent = "data grid";
|
|
1169
|
-
}
|
|
1170
1106
|
this.shadowRoot.replaceChildren(link, root);
|
|
1171
1107
|
}
|
|
1172
1108
|
};
|
|
@@ -1191,9 +1127,6 @@ var BfDatePicker = class extends HTMLElement {
|
|
|
1191
1127
|
root.className = "root";
|
|
1192
1128
|
root.setAttribute("part", "root");
|
|
1193
1129
|
root.innerHTML = "<slot></slot>";
|
|
1194
|
-
if (!this.innerHTML.trim()) {
|
|
1195
|
-
root.textContent = "date picker";
|
|
1196
|
-
}
|
|
1197
1130
|
this.shadowRoot.replaceChildren(link, root);
|
|
1198
1131
|
}
|
|
1199
1132
|
};
|
|
@@ -1218,9 +1151,6 @@ var BfDateRangePicker = class extends HTMLElement {
|
|
|
1218
1151
|
root.className = "root";
|
|
1219
1152
|
root.setAttribute("part", "root");
|
|
1220
1153
|
root.innerHTML = "<slot></slot>";
|
|
1221
|
-
if (!this.innerHTML.trim()) {
|
|
1222
|
-
root.textContent = "date range picker";
|
|
1223
|
-
}
|
|
1224
1154
|
this.shadowRoot.replaceChildren(link, root);
|
|
1225
1155
|
}
|
|
1226
1156
|
};
|
|
@@ -1255,9 +1185,6 @@ var BfDialog = class extends HTMLElement {
|
|
|
1255
1185
|
this._backdrop = root.querySelector(".backdrop");
|
|
1256
1186
|
this._panel = root.querySelector(".panel");
|
|
1257
1187
|
this._backdrop.addEventListener("click", this._onBackdropClick);
|
|
1258
|
-
if (!this.textContent?.trim()) {
|
|
1259
|
-
this.textContent = "dialog";
|
|
1260
|
-
}
|
|
1261
1188
|
this._sync();
|
|
1262
1189
|
}
|
|
1263
1190
|
attributeChangedCallback() {
|
|
@@ -1478,9 +1405,6 @@ var BfDrawer = class extends HTMLElement {
|
|
|
1478
1405
|
this._root = root;
|
|
1479
1406
|
this._backdrop = root.querySelector(".backdrop");
|
|
1480
1407
|
this._backdrop.addEventListener("click", this._onBackdropClick);
|
|
1481
|
-
if (!this.textContent?.trim()) {
|
|
1482
|
-
this.textContent = "drawer";
|
|
1483
|
-
}
|
|
1484
1408
|
this._sync();
|
|
1485
1409
|
}
|
|
1486
1410
|
attributeChangedCallback() {
|
|
@@ -1565,9 +1489,6 @@ var BfDropdown = class extends HTMLElement {
|
|
|
1565
1489
|
root.className = "root";
|
|
1566
1490
|
root.setAttribute("part", "root");
|
|
1567
1491
|
root.innerHTML = "<slot></slot>";
|
|
1568
|
-
if (!this.innerHTML.trim()) {
|
|
1569
|
-
root.textContent = "dropdown";
|
|
1570
|
-
}
|
|
1571
1492
|
this.shadowRoot.replaceChildren(link, root);
|
|
1572
1493
|
}
|
|
1573
1494
|
};
|
|
@@ -1593,9 +1514,6 @@ var BfEdge = class extends HTMLElement {
|
|
|
1593
1514
|
root.className = "root";
|
|
1594
1515
|
root.setAttribute("part", "root");
|
|
1595
1516
|
root.innerHTML = "<slot></slot>";
|
|
1596
|
-
if (!this.innerHTML.trim()) {
|
|
1597
|
-
root.textContent = "edge";
|
|
1598
|
-
}
|
|
1599
1517
|
this.shadowRoot.replaceChildren(link, root);
|
|
1600
1518
|
this._syncPosition();
|
|
1601
1519
|
}
|
|
@@ -1620,6 +1538,157 @@ var BfEdge = class extends HTMLElement {
|
|
|
1620
1538
|
__publicField(BfEdge, "observedAttributes", ["position", "sticky", "fixed", "header", "footer"]);
|
|
1621
1539
|
customElements.define("bf-edge", BfEdge);
|
|
1622
1540
|
|
|
1541
|
+
// src/editor/editor.js
|
|
1542
|
+
var BfEditor = class extends HTMLElement {
|
|
1543
|
+
constructor() {
|
|
1544
|
+
super();
|
|
1545
|
+
this.attachShadow({ mode: "open" });
|
|
1546
|
+
this._onInput = this._onInput.bind(this);
|
|
1547
|
+
this._onToolbarClick = this._onToolbarClick.bind(this);
|
|
1548
|
+
}
|
|
1549
|
+
connectedCallback() {
|
|
1550
|
+
if (this._initialized) {
|
|
1551
|
+
this._sync();
|
|
1552
|
+
return;
|
|
1553
|
+
}
|
|
1554
|
+
this._initialized = true;
|
|
1555
|
+
const cssUrl = new URL("data:text/css;charset=utf-8,%3Ahost%20%7B%0A%09--bf-editor-font%3A%20var(--bf-theme-font-family%2C%20inherit)%3B%0A%09--bf-editor-radius%3A%20var(--bf-theme-radius-md%2C%208px)%3B%0A%09--bf-editor-border-width%3A%20var(--bf-theme-border-width%2C%201px)%3B%0A%09--bf-editor-border-style%3A%20var(--bf-theme-border-style%2C%20solid)%3B%0A%09--bf-editor-border-color%3A%20var(--bf-theme-editor-border-color%2C%20var(--bf-theme-border-1%2C%20%23cbd5e1))%3B%0A%09--bf-editor-bg%3A%20var(--bf-theme-editor-bg%2C%20var(--bf-theme-surface-1%2C%20%23ffffff))%3B%0A%09--bf-editor-color%3A%20var(--bf-theme-editor-color%2C%20var(--bf-theme-text-1%2C%20%230f172a))%3B%0A%09--bf-editor-muted%3A%20var(--bf-theme-text-2%2C%20%2364748b)%3B%0A%09--bf-editor-code-bg%3A%20color-mix(in%20srgb%2C%20var(--bf-editor-bg)%2086%25%2C%20%230f172a%2014%25)%3B%0A%09--bf-editor-code-color%3A%20%23e2e8f0%3B%0A%0A%09display%3A%20block%3B%0A%09font%3A%20var(--bf-editor-font)%3B%0A%09color%3A%20var(--bf-editor-color)%3B%0A%7D%0A%0A.root%20%7B%0A%09background%3A%20var(--bf-editor-bg)%3B%0A%09color%3A%20var(--bf-editor-color)%3B%0A%09border-width%3A%20var(--bf-editor-border-width)%3B%0A%09border-style%3A%20var(--bf-editor-border-style)%3B%0A%09border-color%3A%20var(--bf-editor-border-color)%3B%0A%09border-radius%3A%20var(--bf-editor-radius)%3B%0A%09overflow%3A%20hidden%3B%0A%7D%0A%0A.toolbar%20%7B%0A%09display%3A%20none%3B%0A%09gap%3A%200.35rem%3B%0A%09padding%3A%200.5rem%3B%0A%09border-bottom%3A%201px%20solid%20var(--bf-editor-border-color)%3B%0A%09background%3A%20color-mix(in%20srgb%2C%20var(--bf-editor-bg)%2092%25%2C%20var(--bf-editor-border-color))%3B%0A%7D%0A%0A.toolbar%20button%20%7B%0A%09border%3A%201px%20solid%20var(--bf-editor-border-color)%3B%0A%09background%3A%20var(--bf-editor-bg)%3B%0A%09color%3A%20var(--bf-editor-color)%3B%0A%09border-radius%3A%206px%3B%0A%09padding%3A%200.22rem%200.45rem%3B%0A%09cursor%3A%20pointer%3B%0A%09font%3A%20inherit%3B%0A%09font-size%3A%200.85rem%3B%0A%7D%0A%0A.code-wrap%20%7B%0A%09display%3A%20grid%3B%0A%09grid-template-columns%3A%20auto%201fr%3B%0A%09min-height%3A%20220px%3B%0A%09background%3A%20var(--bf-editor-code-bg)%3B%0A%7D%0A%0A.line-numbers%20%7B%0A%09padding%3A%200.8rem%200.55rem%3B%0A%09margin%3A%200%3B%0A%09white-space%3A%20pre%3B%0A%09line-height%3A%201.45%3B%0A%09font-family%3A%20ui-monospace%2C%20SFMono-Regular%2C%20Menlo%2C%20Monaco%2C%20Consolas%2C%20'Liberation%20Mono'%2C%20'Courier%20New'%2C%20monospace%3B%0A%09font-size%3A%200.85rem%3B%0A%09color%3A%20color-mix(in%20srgb%2C%20var(--bf-editor-code-color)%2055%25%2C%20transparent)%3B%0A%09border-right%3A%201px%20solid%20color-mix(in%20srgb%2C%20var(--bf-editor-border-color)%2080%25%2C%20transparent)%3B%0A%09user-select%3A%20none%3B%0A%7D%0A%0A.code%20%7B%0A%09width%3A%20100%25%3B%0A%09min-height%3A%20220px%3B%0A%09resize%3A%20vertical%3B%0A%09padding%3A%200.8rem%3B%0A%09border%3A%200%3B%0A%09outline%3A%200%3B%0A%09background%3A%20transparent%3B%0A%09color%3A%20var(--bf-editor-code-color)%3B%0A%09font-family%3A%20ui-monospace%2C%20SFMono-Regular%2C%20Menlo%2C%20Monaco%2C%20Consolas%2C%20'Liberation%20Mono'%2C%20'Courier%20New'%2C%20monospace%3B%0A%09font-size%3A%200.9rem%3B%0A%09line-height%3A%201.45%3B%0A%7D%0A%0A.rich%20%7B%0A%09display%3A%20none%3B%0A%09min-height%3A%20220px%3B%0A%09padding%3A%200.8rem%3B%0A%09outline%3A%20none%3B%0A%09line-height%3A%201.5%3B%0A%7D%0A%0A.rich%3Aempty%3A%3Abefore%20%7B%0A%09content%3A%20attr(data-placeholder)%3B%0A%09color%3A%20var(--bf-editor-muted)%3B%0A%7D%0A%0A.root%5Bdata-variant%3D'richtext'%5D%20.toolbar%20%7B%0A%09display%3A%20flex%3B%0A%7D%0A%0A.root%5Bdata-variant%3D'richtext'%5D%20.code-wrap%20%7B%0A%09display%3A%20none%3B%0A%7D%0A%0A.root%5Bdata-variant%3D'richtext'%5D%20.rich%20%7B%0A%09display%3A%20block%3B%0A%7D%0A%0A%3Ahost(%5Bdisabled%5D)%20%7B%0A%09opacity%3A%200.72%3B%0A%7D%0A%0A%3Ahost(%5Bdisabled%5D)%20.toolbar%20button%20%7B%0A%09cursor%3A%20not-allowed%3B%0A%7D%0A", import.meta.url);
|
|
1556
|
+
const link = document.createElement("link");
|
|
1557
|
+
link.rel = "stylesheet";
|
|
1558
|
+
link.href = cssUrl.href;
|
|
1559
|
+
const root = document.createElement("div");
|
|
1560
|
+
root.className = "root";
|
|
1561
|
+
root.setAttribute("part", "root");
|
|
1562
|
+
root.innerHTML = `
|
|
1563
|
+
<div class="toolbar" part="toolbar">
|
|
1564
|
+
<button type="button" data-cmd="bold" title="Bold"><b>B</b></button>
|
|
1565
|
+
<button type="button" data-cmd="italic" title="Italic"><i>I</i></button>
|
|
1566
|
+
<button type="button" data-cmd="underline" title="Underline"><u>U</u></button>
|
|
1567
|
+
<button type="button" data-cmd="insertUnorderedList" title="Bullet List">\u2022 List</button>
|
|
1568
|
+
<button type="button" data-cmd="insertOrderedList" title="Numbered List">1. List</button>
|
|
1569
|
+
</div>
|
|
1570
|
+
<div class="code-wrap" part="code-wrap">
|
|
1571
|
+
<div class="line-numbers" part="line-numbers"></div>
|
|
1572
|
+
<textarea class="code" part="code"></textarea>
|
|
1573
|
+
</div>
|
|
1574
|
+
<div class="rich" part="rich" contenteditable="true"></div>
|
|
1575
|
+
</div>
|
|
1576
|
+
`;
|
|
1577
|
+
this.shadowRoot.replaceChildren(link, root);
|
|
1578
|
+
this._root = root;
|
|
1579
|
+
this._toolbar = root.querySelector(".toolbar");
|
|
1580
|
+
this._codeWrap = root.querySelector(".code-wrap");
|
|
1581
|
+
this._lineNumbers = root.querySelector(".line-numbers");
|
|
1582
|
+
this._code = root.querySelector(".code");
|
|
1583
|
+
this._rich = root.querySelector(".rich");
|
|
1584
|
+
this._code.addEventListener("input", this._onInput);
|
|
1585
|
+
this._rich.addEventListener("input", this._onInput);
|
|
1586
|
+
this._toolbar.addEventListener("click", this._onToolbarClick);
|
|
1587
|
+
this._sync();
|
|
1588
|
+
}
|
|
1589
|
+
disconnectedCallback() {
|
|
1590
|
+
if (!this._code || !this._rich || !this._toolbar) {
|
|
1591
|
+
return;
|
|
1592
|
+
}
|
|
1593
|
+
this._code.removeEventListener("input", this._onInput);
|
|
1594
|
+
this._rich.removeEventListener("input", this._onInput);
|
|
1595
|
+
this._toolbar.removeEventListener("click", this._onToolbarClick);
|
|
1596
|
+
}
|
|
1597
|
+
attributeChangedCallback() {
|
|
1598
|
+
this._sync();
|
|
1599
|
+
}
|
|
1600
|
+
_variant() {
|
|
1601
|
+
const explicit = (this.getAttribute("variant") || "").toLowerCase();
|
|
1602
|
+
if (explicit === "richtext" || this.hasAttribute("richtext")) {
|
|
1603
|
+
return "richtext";
|
|
1604
|
+
}
|
|
1605
|
+
if (explicit === "code" || this.hasAttribute("code")) {
|
|
1606
|
+
return "code";
|
|
1607
|
+
}
|
|
1608
|
+
return "code";
|
|
1609
|
+
}
|
|
1610
|
+
_sync() {
|
|
1611
|
+
if (!this._root || !this._code || !this._rich || !this._toolbar) {
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1614
|
+
const variant = this._variant();
|
|
1615
|
+
this._root.dataset.variant = variant;
|
|
1616
|
+
const disabled = this.hasAttribute("disabled");
|
|
1617
|
+
this._code.disabled = disabled;
|
|
1618
|
+
this._rich.setAttribute("contenteditable", disabled ? "false" : "true");
|
|
1619
|
+
const placeholder = this.getAttribute("placeholder") || (variant === "richtext" ? "Write rich content\u2026" : "Write code\u2026");
|
|
1620
|
+
this._code.placeholder = placeholder;
|
|
1621
|
+
this._rich.dataset.placeholder = placeholder;
|
|
1622
|
+
const value = this.getAttribute("value");
|
|
1623
|
+
if (value != null && this._lastSyncedValue !== value) {
|
|
1624
|
+
if (variant === "richtext") {
|
|
1625
|
+
this._rich.innerHTML = value;
|
|
1626
|
+
} else {
|
|
1627
|
+
this._code.value = value;
|
|
1628
|
+
this._renderLineNumbers();
|
|
1629
|
+
}
|
|
1630
|
+
this._lastSyncedValue = value;
|
|
1631
|
+
} else if (value == null && !this._hasUserInput) {
|
|
1632
|
+
const initial = this.textContent.trim();
|
|
1633
|
+
if (initial) {
|
|
1634
|
+
if (variant === "richtext") {
|
|
1635
|
+
this._rich.innerHTML = initial;
|
|
1636
|
+
} else {
|
|
1637
|
+
this._code.value = initial;
|
|
1638
|
+
this._renderLineNumbers();
|
|
1639
|
+
}
|
|
1640
|
+
this._hasUserInput = true;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
if (variant === "code") {
|
|
1644
|
+
this._renderLineNumbers();
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
_onInput() {
|
|
1648
|
+
const variant = this._variant();
|
|
1649
|
+
this._hasUserInput = true;
|
|
1650
|
+
if (variant === "code") {
|
|
1651
|
+
this._renderLineNumbers();
|
|
1652
|
+
this.setAttribute("value", this._code.value);
|
|
1653
|
+
this._lastSyncedValue = this._code.value;
|
|
1654
|
+
this._emitChange(this._code.value, "code");
|
|
1655
|
+
return;
|
|
1656
|
+
}
|
|
1657
|
+
this.setAttribute("value", this._rich.innerHTML);
|
|
1658
|
+
this._lastSyncedValue = this._rich.innerHTML;
|
|
1659
|
+
this._emitChange(this._rich.innerHTML, "richtext");
|
|
1660
|
+
}
|
|
1661
|
+
_renderLineNumbers() {
|
|
1662
|
+
const lineCount = Math.max(1, this._code.value.split("\n").length);
|
|
1663
|
+
const text = Array.from({ length: lineCount }, (_, i) => String(i + 1)).join("\n");
|
|
1664
|
+
this._lineNumbers.textContent = text;
|
|
1665
|
+
}
|
|
1666
|
+
_onToolbarClick(event) {
|
|
1667
|
+
const button = event.target instanceof Element ? event.target.closest("button[data-cmd]") : null;
|
|
1668
|
+
if (!button || this._variant() !== "richtext" || this.hasAttribute("disabled")) {
|
|
1669
|
+
return;
|
|
1670
|
+
}
|
|
1671
|
+
const command = button.getAttribute("data-cmd");
|
|
1672
|
+
if (!command) {
|
|
1673
|
+
return;
|
|
1674
|
+
}
|
|
1675
|
+
this._rich.focus();
|
|
1676
|
+
document.execCommand(command, false);
|
|
1677
|
+
this._onInput();
|
|
1678
|
+
}
|
|
1679
|
+
_emitChange(value, mode) {
|
|
1680
|
+
this.dispatchEvent(
|
|
1681
|
+
new CustomEvent("bf-change", {
|
|
1682
|
+
bubbles: true,
|
|
1683
|
+
composed: true,
|
|
1684
|
+
detail: { value, mode }
|
|
1685
|
+
})
|
|
1686
|
+
);
|
|
1687
|
+
}
|
|
1688
|
+
};
|
|
1689
|
+
__publicField(BfEditor, "observedAttributes", ["variant", "code", "richtext", "placeholder", "value", "disabled"]);
|
|
1690
|
+
customElements.define("bf-editor", BfEditor);
|
|
1691
|
+
|
|
1623
1692
|
// src/empty-state/empty-state.js
|
|
1624
1693
|
var BfEmptyState = class extends HTMLElement {
|
|
1625
1694
|
constructor() {
|
|
@@ -1639,9 +1708,6 @@ var BfEmptyState = class extends HTMLElement {
|
|
|
1639
1708
|
root.className = "root";
|
|
1640
1709
|
root.setAttribute("part", "root");
|
|
1641
1710
|
root.innerHTML = "<slot></slot>";
|
|
1642
|
-
if (!this.innerHTML.trim()) {
|
|
1643
|
-
root.textContent = "empty state";
|
|
1644
|
-
}
|
|
1645
1711
|
this.shadowRoot.replaceChildren(link, root);
|
|
1646
1712
|
}
|
|
1647
1713
|
};
|
|
@@ -1666,9 +1732,6 @@ var BfErrorSummary = class extends HTMLElement {
|
|
|
1666
1732
|
root.className = "root";
|
|
1667
1733
|
root.setAttribute("part", "root");
|
|
1668
1734
|
root.innerHTML = "<slot></slot>";
|
|
1669
|
-
if (!this.innerHTML.trim()) {
|
|
1670
|
-
root.textContent = "error summary";
|
|
1671
|
-
}
|
|
1672
1735
|
this.shadowRoot.replaceChildren(link, root);
|
|
1673
1736
|
}
|
|
1674
1737
|
};
|
|
@@ -1693,9 +1756,6 @@ var BfFab = class extends HTMLElement {
|
|
|
1693
1756
|
root.className = "root";
|
|
1694
1757
|
root.setAttribute("part", "root");
|
|
1695
1758
|
root.innerHTML = "<slot></slot>";
|
|
1696
|
-
if (!this.innerHTML.trim()) {
|
|
1697
|
-
root.textContent = "fab";
|
|
1698
|
-
}
|
|
1699
1759
|
this.shadowRoot.replaceChildren(link, root);
|
|
1700
1760
|
}
|
|
1701
1761
|
};
|
|
@@ -1894,9 +1954,6 @@ var BfFilterBar = class extends HTMLElement {
|
|
|
1894
1954
|
root.className = "root";
|
|
1895
1955
|
root.setAttribute("part", "root");
|
|
1896
1956
|
root.innerHTML = "<slot></slot>";
|
|
1897
|
-
if (!this.innerHTML.trim()) {
|
|
1898
|
-
root.textContent = "filter bar";
|
|
1899
|
-
}
|
|
1900
1957
|
this.shadowRoot.replaceChildren(link, root);
|
|
1901
1958
|
}
|
|
1902
1959
|
};
|
|
@@ -1921,9 +1978,6 @@ var BfFormField = class extends HTMLElement {
|
|
|
1921
1978
|
root.className = "root";
|
|
1922
1979
|
root.setAttribute("part", "root");
|
|
1923
1980
|
root.innerHTML = "<slot></slot>";
|
|
1924
|
-
if (!this.innerHTML.trim()) {
|
|
1925
|
-
root.textContent = "form field";
|
|
1926
|
-
}
|
|
1927
1981
|
this.shadowRoot.replaceChildren(link, root);
|
|
1928
1982
|
}
|
|
1929
1983
|
};
|
|
@@ -1948,9 +2002,6 @@ var BfGrid = class extends HTMLElement {
|
|
|
1948
2002
|
root.className = "root";
|
|
1949
2003
|
root.setAttribute("part", "root");
|
|
1950
2004
|
root.innerHTML = "<slot></slot>";
|
|
1951
|
-
if (!this.innerHTML.trim()) {
|
|
1952
|
-
root.textContent = "grid";
|
|
1953
|
-
}
|
|
1954
2005
|
this.shadowRoot.replaceChildren(link, root);
|
|
1955
2006
|
}
|
|
1956
2007
|
};
|
|
@@ -1975,9 +2026,6 @@ var BfHero = class extends HTMLElement {
|
|
|
1975
2026
|
root.className = "root";
|
|
1976
2027
|
root.setAttribute("part", "root");
|
|
1977
2028
|
root.innerHTML = "<slot></slot>";
|
|
1978
|
-
if (!this.innerHTML.trim()) {
|
|
1979
|
-
root.textContent = "hero";
|
|
1980
|
-
}
|
|
1981
2029
|
this.shadowRoot.replaceChildren(link, root);
|
|
1982
2030
|
}
|
|
1983
2031
|
};
|
|
@@ -2002,9 +2050,6 @@ var BfIcon = class extends HTMLElement {
|
|
|
2002
2050
|
root.className = "root";
|
|
2003
2051
|
root.setAttribute("part", "root");
|
|
2004
2052
|
root.innerHTML = "<slot></slot>";
|
|
2005
|
-
if (!this.innerHTML.trim()) {
|
|
2006
|
-
root.textContent = "icon";
|
|
2007
|
-
}
|
|
2008
2053
|
this.shadowRoot.replaceChildren(link, root);
|
|
2009
2054
|
}
|
|
2010
2055
|
};
|
|
@@ -2029,9 +2074,6 @@ var BfImage = class extends HTMLElement {
|
|
|
2029
2074
|
root.className = "root";
|
|
2030
2075
|
root.setAttribute("part", "root");
|
|
2031
2076
|
root.innerHTML = "<slot></slot>";
|
|
2032
|
-
if (!this.innerHTML.trim()) {
|
|
2033
|
-
root.textContent = "image";
|
|
2034
|
-
}
|
|
2035
2077
|
this.shadowRoot.replaceChildren(link, root);
|
|
2036
2078
|
}
|
|
2037
2079
|
};
|
|
@@ -2411,9 +2453,6 @@ var BfKeyValueList = class extends HTMLElement {
|
|
|
2411
2453
|
root.className = "root";
|
|
2412
2454
|
root.setAttribute("part", "root");
|
|
2413
2455
|
root.innerHTML = "<slot></slot>";
|
|
2414
|
-
if (!this.innerHTML.trim()) {
|
|
2415
|
-
root.textContent = "key-value list";
|
|
2416
|
-
}
|
|
2417
2456
|
this.shadowRoot.replaceChildren(link, root);
|
|
2418
2457
|
}
|
|
2419
2458
|
};
|
|
@@ -2438,9 +2477,6 @@ var BfLink = class extends HTMLElement {
|
|
|
2438
2477
|
root.className = "root";
|
|
2439
2478
|
root.setAttribute("part", "root");
|
|
2440
2479
|
root.innerHTML = "<slot></slot>";
|
|
2441
|
-
if (!this.innerHTML.trim()) {
|
|
2442
|
-
root.textContent = "link";
|
|
2443
|
-
}
|
|
2444
2480
|
this.shadowRoot.replaceChildren(link, root);
|
|
2445
2481
|
}
|
|
2446
2482
|
};
|
|
@@ -2466,9 +2502,6 @@ var BfList = class extends HTMLElement {
|
|
|
2466
2502
|
root.className = "root";
|
|
2467
2503
|
root.setAttribute("part", "root");
|
|
2468
2504
|
root.innerHTML = "<slot></slot>";
|
|
2469
|
-
if (!this.innerHTML.trim()) {
|
|
2470
|
-
root.textContent = "list";
|
|
2471
|
-
}
|
|
2472
2505
|
this.shadowRoot.replaceChildren(link, root);
|
|
2473
2506
|
this._slot = root.querySelector("slot");
|
|
2474
2507
|
this._slot.addEventListener("slotchange", this._onSlotChange);
|
|
@@ -2532,9 +2565,6 @@ var BfLoadingIndicator = class extends HTMLElement {
|
|
|
2532
2565
|
root.className = "root";
|
|
2533
2566
|
root.setAttribute("part", "root");
|
|
2534
2567
|
root.innerHTML = "<slot></slot>";
|
|
2535
|
-
if (!this.innerHTML.trim()) {
|
|
2536
|
-
root.textContent = "loading indicator";
|
|
2537
|
-
}
|
|
2538
2568
|
this.shadowRoot.replaceChildren(link, root);
|
|
2539
2569
|
}
|
|
2540
2570
|
};
|
|
@@ -2559,9 +2589,6 @@ var BfMap = class extends HTMLElement {
|
|
|
2559
2589
|
root.className = "root";
|
|
2560
2590
|
root.setAttribute("part", "root");
|
|
2561
2591
|
root.innerHTML = "<slot></slot>";
|
|
2562
|
-
if (!this.innerHTML.trim()) {
|
|
2563
|
-
root.textContent = "map";
|
|
2564
|
-
}
|
|
2565
2592
|
this.shadowRoot.replaceChildren(link, root);
|
|
2566
2593
|
}
|
|
2567
2594
|
};
|
|
@@ -2590,9 +2617,6 @@ var BfMenu = class extends HTMLElement {
|
|
|
2590
2617
|
root.className = "root";
|
|
2591
2618
|
root.setAttribute("part", "root");
|
|
2592
2619
|
root.innerHTML = "<slot></slot>";
|
|
2593
|
-
if (!this.innerHTML.trim()) {
|
|
2594
|
-
root.textContent = "menu";
|
|
2595
|
-
}
|
|
2596
2620
|
this.shadowRoot.replaceChildren(link, root);
|
|
2597
2621
|
this._root = root;
|
|
2598
2622
|
this._slot = root.querySelector("slot");
|
|
@@ -2742,9 +2766,6 @@ var BfMessage = class extends HTMLElement {
|
|
|
2742
2766
|
root.className = "root";
|
|
2743
2767
|
root.setAttribute("part", "root");
|
|
2744
2768
|
root.innerHTML = "<slot></slot>";
|
|
2745
|
-
if (!this.innerHTML.trim()) {
|
|
2746
|
-
root.textContent = "message";
|
|
2747
|
-
}
|
|
2748
2769
|
this.shadowRoot.replaceChildren(link, root);
|
|
2749
2770
|
}
|
|
2750
2771
|
};
|
|
@@ -2769,9 +2790,6 @@ var BfMetricCard = class extends HTMLElement {
|
|
|
2769
2790
|
root.className = "root";
|
|
2770
2791
|
root.setAttribute("part", "root");
|
|
2771
2792
|
root.innerHTML = "<slot></slot>";
|
|
2772
|
-
if (!this.innerHTML.trim()) {
|
|
2773
|
-
root.textContent = "metric card";
|
|
2774
|
-
}
|
|
2775
2793
|
this.shadowRoot.replaceChildren(link, root);
|
|
2776
2794
|
}
|
|
2777
2795
|
};
|
|
@@ -2805,9 +2823,6 @@ var BfModal = class extends HTMLElement {
|
|
|
2805
2823
|
this._root = root;
|
|
2806
2824
|
this._backdrop = root.querySelector(".backdrop");
|
|
2807
2825
|
this._backdrop.addEventListener("click", this._onBackdropClick);
|
|
2808
|
-
if (!this.textContent?.trim()) {
|
|
2809
|
-
this.textContent = "modal";
|
|
2810
|
-
}
|
|
2811
2826
|
this._sync();
|
|
2812
2827
|
}
|
|
2813
2828
|
attributeChangedCallback() {
|
|
@@ -2876,9 +2891,6 @@ var BfNav = class extends HTMLElement {
|
|
|
2876
2891
|
root.className = "root";
|
|
2877
2892
|
root.setAttribute("part", "root");
|
|
2878
2893
|
root.innerHTML = "<slot></slot>";
|
|
2879
|
-
if (!this.innerHTML.trim()) {
|
|
2880
|
-
root.textContent = "nav";
|
|
2881
|
-
}
|
|
2882
2894
|
this.shadowRoot.replaceChildren(link, root);
|
|
2883
2895
|
}
|
|
2884
2896
|
};
|
|
@@ -2903,9 +2915,6 @@ var BfNumberField = class extends HTMLElement {
|
|
|
2903
2915
|
root.className = "root";
|
|
2904
2916
|
root.setAttribute("part", "root");
|
|
2905
2917
|
root.innerHTML = "<slot></slot>";
|
|
2906
|
-
if (!this.innerHTML.trim()) {
|
|
2907
|
-
root.textContent = "number field";
|
|
2908
|
-
}
|
|
2909
2918
|
this.shadowRoot.replaceChildren(link, root);
|
|
2910
2919
|
}
|
|
2911
2920
|
};
|
|
@@ -2930,9 +2939,6 @@ var BfOtpInput = class extends HTMLElement {
|
|
|
2930
2939
|
root.className = "root";
|
|
2931
2940
|
root.setAttribute("part", "root");
|
|
2932
2941
|
root.innerHTML = "<slot></slot>";
|
|
2933
|
-
if (!this.innerHTML.trim()) {
|
|
2934
|
-
root.textContent = "otp input";
|
|
2935
|
-
}
|
|
2936
2942
|
this.shadowRoot.replaceChildren(link, root);
|
|
2937
2943
|
}
|
|
2938
2944
|
};
|
|
@@ -2957,9 +2963,6 @@ var BfPagination = class extends HTMLElement {
|
|
|
2957
2963
|
root.className = "root";
|
|
2958
2964
|
root.setAttribute("part", "root");
|
|
2959
2965
|
root.innerHTML = "<slot></slot>";
|
|
2960
|
-
if (!this.innerHTML.trim()) {
|
|
2961
|
-
root.textContent = "pagination";
|
|
2962
|
-
}
|
|
2963
2966
|
this.shadowRoot.replaceChildren(link, root);
|
|
2964
2967
|
}
|
|
2965
2968
|
};
|
|
@@ -3253,9 +3256,6 @@ var BfQuickActions = class extends HTMLElement {
|
|
|
3253
3256
|
root.className = "root";
|
|
3254
3257
|
root.setAttribute("part", "root");
|
|
3255
3258
|
root.innerHTML = "<slot></slot>";
|
|
3256
|
-
if (!this.innerHTML.trim()) {
|
|
3257
|
-
root.textContent = "quick actions";
|
|
3258
|
-
}
|
|
3259
3259
|
this.shadowRoot.replaceChildren(link, root);
|
|
3260
3260
|
}
|
|
3261
3261
|
};
|
|
@@ -3597,9 +3597,6 @@ var BfSearch = class extends HTMLElement {
|
|
|
3597
3597
|
root.className = "root";
|
|
3598
3598
|
root.setAttribute("part", "root");
|
|
3599
3599
|
root.innerHTML = "<slot></slot>";
|
|
3600
|
-
if (!this.innerHTML.trim()) {
|
|
3601
|
-
root.textContent = "search";
|
|
3602
|
-
}
|
|
3603
3600
|
this.shadowRoot.replaceChildren(link, root);
|
|
3604
3601
|
}
|
|
3605
3602
|
};
|
|
@@ -3624,9 +3621,6 @@ var BfSegmentedControl = class extends HTMLElement {
|
|
|
3624
3621
|
root.className = "root";
|
|
3625
3622
|
root.setAttribute("part", "root");
|
|
3626
3623
|
root.innerHTML = "<slot></slot>";
|
|
3627
|
-
if (!this.innerHTML.trim()) {
|
|
3628
|
-
root.textContent = "segmented control";
|
|
3629
|
-
}
|
|
3630
3624
|
this.shadowRoot.replaceChildren(link, root);
|
|
3631
3625
|
}
|
|
3632
3626
|
};
|
|
@@ -3969,9 +3963,6 @@ var BfSplitButton = class extends HTMLElement {
|
|
|
3969
3963
|
root.className = "root";
|
|
3970
3964
|
root.setAttribute("part", "root");
|
|
3971
3965
|
root.innerHTML = "<slot></slot>";
|
|
3972
|
-
if (!this.innerHTML.trim()) {
|
|
3973
|
-
root.textContent = "split button";
|
|
3974
|
-
}
|
|
3975
3966
|
this.shadowRoot.replaceChildren(link, root);
|
|
3976
3967
|
}
|
|
3977
3968
|
};
|
|
@@ -3996,9 +3987,6 @@ var BfSplitter = class extends HTMLElement {
|
|
|
3996
3987
|
root.className = "root";
|
|
3997
3988
|
root.setAttribute("part", "root");
|
|
3998
3989
|
root.innerHTML = "<slot></slot>";
|
|
3999
|
-
if (!this.innerHTML.trim()) {
|
|
4000
|
-
root.textContent = "splitter";
|
|
4001
|
-
}
|
|
4002
3990
|
this.shadowRoot.replaceChildren(link, root);
|
|
4003
3991
|
}
|
|
4004
3992
|
};
|
|
@@ -4023,9 +4011,6 @@ var BfStack = class extends HTMLElement {
|
|
|
4023
4011
|
root.className = "root";
|
|
4024
4012
|
root.setAttribute("part", "root");
|
|
4025
4013
|
root.innerHTML = "<slot></slot>";
|
|
4026
|
-
if (!this.innerHTML.trim()) {
|
|
4027
|
-
root.textContent = "stack";
|
|
4028
|
-
}
|
|
4029
4014
|
this.shadowRoot.replaceChildren(link, root);
|
|
4030
4015
|
}
|
|
4031
4016
|
};
|
|
@@ -4053,9 +4038,6 @@ var BfTab = class extends HTMLElement {
|
|
|
4053
4038
|
root.setAttribute("part", "root");
|
|
4054
4039
|
root.type = "button";
|
|
4055
4040
|
root.innerHTML = "<slot></slot>";
|
|
4056
|
-
if (!this.innerHTML.trim()) {
|
|
4057
|
-
root.textContent = "tab";
|
|
4058
|
-
}
|
|
4059
4041
|
this.shadowRoot.replaceChildren(link, root);
|
|
4060
4042
|
this._button = root;
|
|
4061
4043
|
root.addEventListener("click", this._onClick);
|
|
@@ -4134,9 +4116,6 @@ var BfTable = class extends HTMLElement {
|
|
|
4134
4116
|
root.className = "root";
|
|
4135
4117
|
root.setAttribute("part", "root");
|
|
4136
4118
|
root.innerHTML = "<slot></slot>";
|
|
4137
|
-
if (!this.innerHTML.trim()) {
|
|
4138
|
-
root.textContent = "table";
|
|
4139
|
-
}
|
|
4140
4119
|
this.shadowRoot.replaceChildren(link, root);
|
|
4141
4120
|
}
|
|
4142
4121
|
};
|
|
@@ -4162,9 +4141,6 @@ var BfTag = class extends HTMLElement {
|
|
|
4162
4141
|
root.className = "root";
|
|
4163
4142
|
root.setAttribute("part", "root");
|
|
4164
4143
|
root.innerHTML = "<slot></slot>";
|
|
4165
|
-
if (!this.innerHTML.trim()) {
|
|
4166
|
-
root.textContent = "tag";
|
|
4167
|
-
}
|
|
4168
4144
|
this.shadowRoot.replaceChildren(link, root);
|
|
4169
4145
|
this._root = root;
|
|
4170
4146
|
this._sync();
|
|
@@ -4195,33 +4171,6 @@ var BfTag = class extends HTMLElement {
|
|
|
4195
4171
|
__publicField(BfTag, "observedAttributes", ["variant", "badge", "chip", "pill", "size"]);
|
|
4196
4172
|
customElements.define("bf-tag", BfTag);
|
|
4197
4173
|
|
|
4198
|
-
// src/textarea/textarea.js
|
|
4199
|
-
var BfTextarea = class extends HTMLElement {
|
|
4200
|
-
constructor() {
|
|
4201
|
-
super();
|
|
4202
|
-
this.attachShadow({ mode: "open" });
|
|
4203
|
-
}
|
|
4204
|
-
connectedCallback() {
|
|
4205
|
-
if (this._initialized) {
|
|
4206
|
-
return;
|
|
4207
|
-
}
|
|
4208
|
-
this._initialized = true;
|
|
4209
|
-
const cssUrl = new URL("data:text/css;charset=utf-8,%3Ahost%20%7B%0A%09--bf-textarea-font%3A%20var(--bf-theme-font-family%2C%20inherit)%3B%0A%09--bf-textarea-radius%3A%20var(--bf-theme-radius-md%2C%208px)%3B%0A%09--bf-textarea-border-width%3A%20var(--bf-theme-border-width%2C%201px)%3B%0A%09--bf-textarea-border-style%3A%20var(--bf-theme-border-style%2C%20solid)%3B%0A%09--bf-textarea-border-color%3A%20var(--bf-theme-textarea-border-color%2C%20var(--bf-theme-border-1%2C%20%23cbd5e1))%3B%0A%09--bf-textarea-bg%3A%20var(--bf-theme-textarea-bg%2C%20var(--bf-theme-surface-1%2C%20%23ffffff))%3B%0A%09--bf-textarea-color%3A%20var(--bf-theme-textarea-color%2C%20var(--bf-theme-text-1%2C%20%230f172a))%3B%0A%09--bf-textarea-padding-y%3A%20var(--bf-theme-space-2%2C%200.6rem)%3B%0A%09--bf-textarea-padding-x%3A%20var(--bf-theme-space-3%2C%200.9rem)%3B%0A%09--bf-textarea-transition%3A%0A%09%09var(--bf-theme-transition-bg%2C%20background-color%20120ms%20ease)%2C%0A%09%09var(--bf-theme-transition-color%2C%20color%20120ms%20ease)%2C%0A%09%09var(--bf-theme-transition-border%2C%20border-color%20120ms%20ease)%3B%0A%0A%09display%3A%20block%3B%0A%09font%3A%20var(--bf-textarea-font)%3B%0A%09color%3A%20var(--bf-textarea-color)%3B%0A%7D%0A%0A.root%20%7B%0A%09background%3A%20var(--bf-textarea-bg)%3B%0A%09color%3A%20var(--bf-textarea-color)%3B%0A%09border-width%3A%20var(--bf-textarea-border-width)%3B%0A%09border-style%3A%20var(--bf-textarea-border-style)%3B%0A%09border-color%3A%20var(--bf-textarea-border-color)%3B%0A%09border-radius%3A%20var(--bf-textarea-radius)%3B%0A%09padding%3A%20var(--bf-textarea-padding-y)%20var(--bf-textarea-padding-x)%3B%0A%09transition%3A%20var(--bf-textarea-transition)%3B%0A%7D%0A", import.meta.url);
|
|
4210
|
-
const link = document.createElement("link");
|
|
4211
|
-
link.rel = "stylesheet";
|
|
4212
|
-
link.href = cssUrl.href;
|
|
4213
|
-
const root = document.createElement("div");
|
|
4214
|
-
root.className = "root";
|
|
4215
|
-
root.setAttribute("part", "root");
|
|
4216
|
-
root.innerHTML = "<slot></slot>";
|
|
4217
|
-
if (!this.innerHTML.trim()) {
|
|
4218
|
-
root.textContent = "textarea";
|
|
4219
|
-
}
|
|
4220
|
-
this.shadowRoot.replaceChildren(link, root);
|
|
4221
|
-
}
|
|
4222
|
-
};
|
|
4223
|
-
customElements.define("bf-textarea", BfTextarea);
|
|
4224
|
-
|
|
4225
4174
|
// src/timeline/timeline.js
|
|
4226
4175
|
var BfTimeline = class extends HTMLElement {
|
|
4227
4176
|
constructor() {
|
|
@@ -4241,9 +4190,6 @@ var BfTimeline = class extends HTMLElement {
|
|
|
4241
4190
|
root.className = "root";
|
|
4242
4191
|
root.setAttribute("part", "root");
|
|
4243
4192
|
root.innerHTML = "<slot></slot>";
|
|
4244
|
-
if (!this.innerHTML.trim()) {
|
|
4245
|
-
root.textContent = "timeline";
|
|
4246
|
-
}
|
|
4247
4193
|
this.shadowRoot.replaceChildren(link, root);
|
|
4248
4194
|
}
|
|
4249
4195
|
};
|
|
@@ -4279,9 +4225,6 @@ var BfToast = class extends HTMLElement {
|
|
|
4279
4225
|
this._icon = root.querySelector(".icon");
|
|
4280
4226
|
this._close = root.querySelector(".close");
|
|
4281
4227
|
this._close.addEventListener("click", this._onCloseClick);
|
|
4282
|
-
if (!this.textContent?.trim()) {
|
|
4283
|
-
this.textContent = "toast";
|
|
4284
|
-
}
|
|
4285
4228
|
this._syncState();
|
|
4286
4229
|
}
|
|
4287
4230
|
disconnectedCallback() {
|
|
@@ -4521,9 +4464,6 @@ var BfToggle = class extends HTMLElement {
|
|
|
4521
4464
|
this._root = root;
|
|
4522
4465
|
this._text = root.querySelector(".text");
|
|
4523
4466
|
this._root.addEventListener("click", this._onClick);
|
|
4524
|
-
if (!this.textContent?.trim()) {
|
|
4525
|
-
this.textContent = "toggle";
|
|
4526
|
-
}
|
|
4527
4467
|
this._sync();
|
|
4528
4468
|
}
|
|
4529
4469
|
attributeChangedCallback() {
|
|
@@ -4600,9 +4540,6 @@ var BfToolbar = class extends HTMLElement {
|
|
|
4600
4540
|
root.className = "root";
|
|
4601
4541
|
root.setAttribute("part", "root");
|
|
4602
4542
|
root.innerHTML = "<slot></slot>";
|
|
4603
|
-
if (!this.innerHTML.trim()) {
|
|
4604
|
-
root.textContent = "toolbar";
|
|
4605
|
-
}
|
|
4606
4543
|
this.shadowRoot.replaceChildren(link, root);
|
|
4607
4544
|
}
|
|
4608
4545
|
};
|
|
@@ -4627,9 +4564,6 @@ var BfTreeView = class extends HTMLElement {
|
|
|
4627
4564
|
root.className = "root";
|
|
4628
4565
|
root.setAttribute("part", "root");
|
|
4629
4566
|
root.innerHTML = "<slot></slot>";
|
|
4630
|
-
if (!this.innerHTML.trim()) {
|
|
4631
|
-
root.textContent = "tree view";
|
|
4632
|
-
}
|
|
4633
4567
|
this.shadowRoot.replaceChildren(link, root);
|
|
4634
4568
|
}
|
|
4635
4569
|
};
|
|
@@ -4654,9 +4588,6 @@ var BfVideoPlayer = class extends HTMLElement {
|
|
|
4654
4588
|
root.className = "root";
|
|
4655
4589
|
root.setAttribute("part", "root");
|
|
4656
4590
|
root.innerHTML = "<slot></slot>";
|
|
4657
|
-
if (!this.innerHTML.trim()) {
|
|
4658
|
-
root.textContent = "video player";
|
|
4659
|
-
}
|
|
4660
4591
|
this.shadowRoot.replaceChildren(link, root);
|
|
4661
4592
|
}
|
|
4662
4593
|
};
|
|
@@ -4681,9 +4612,6 @@ var BfVirtualList = class extends HTMLElement {
|
|
|
4681
4612
|
root.className = "root";
|
|
4682
4613
|
root.setAttribute("part", "root");
|
|
4683
4614
|
root.innerHTML = "<slot></slot>";
|
|
4684
|
-
if (!this.innerHTML.trim()) {
|
|
4685
|
-
root.textContent = "virtual list";
|
|
4686
|
-
}
|
|
4687
4615
|
this.shadowRoot.replaceChildren(link, root);
|
|
4688
4616
|
}
|
|
4689
4617
|
};
|