@brad-frost-web/eddie-web-components 0.1.0
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/components/EdElement.d.ts +61 -0
- package/components/EdElement.d.ts.map +1 -0
- package/components/EdElement.js +63 -0
- package/components/EdFormElement.d.ts +65 -0
- package/components/EdFormElement.d.ts.map +1 -0
- package/components/EdFormElement.js +46 -0
- package/components/accordion/accordion.d.ts +19 -0
- package/components/accordion/accordion.d.ts.map +1 -0
- package/components/accordion/accordion.js +31 -0
- package/components/accordion-panel/accordion-panel.d.ts +57 -0
- package/components/accordion-panel/accordion-panel.d.ts.map +1 -0
- package/components/accordion-panel/accordion-panel.js +95 -0
- package/components/alert/alert.d.ts +72 -0
- package/components/alert/alert.d.ts.map +1 -0
- package/components/alert/alert.js +77 -0
- package/components/badge/badge.d.ts +29 -0
- package/components/badge/badge.d.ts.map +1 -0
- package/components/badge/badge.js +33 -0
- package/components/band/band.d.ts +24 -0
- package/components/band/band.d.ts.map +1 -0
- package/components/band/band.js +32 -0
- package/components/box/box.d.ts +14 -0
- package/components/box/box.d.ts.map +1 -0
- package/components/box/box.js +20 -0
- package/components/breadcrumbs/breadcrumbs.d.ts +14 -0
- package/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/components/breadcrumbs/breadcrumbs.js +22 -0
- package/components/breadcrumbs-item/breadcrumbs-item.d.ts +31 -0
- package/components/breadcrumbs-item/breadcrumbs-item.d.ts.map +1 -0
- package/components/breadcrumbs-item/breadcrumbs-item.js +36 -0
- package/components/button/button.d.ts +93 -0
- package/components/button/button.d.ts.map +1 -0
- package/components/button/button.js +118 -0
- package/components/button-group/button-group.d.ts +24 -0
- package/components/button-group/button-group.d.ts.map +1 -0
- package/components/button-group/button-group.js +35 -0
- package/components/card/card.d.ts +34 -0
- package/components/card/card.d.ts.map +1 -0
- package/components/card/card.js +43 -0
- package/components/checkbox-field/checkbox-field.d.ts +76 -0
- package/components/checkbox-field/checkbox-field.d.ts.map +1 -0
- package/components/checkbox-field/checkbox-field.js +98 -0
- package/components/checkbox-field-item/checkbox-field-item.d.ts +81 -0
- package/components/checkbox-field-item/checkbox-field-item.d.ts.map +1 -0
- package/components/checkbox-field-item/checkbox-field-item.js +110 -0
- package/components/counter/counter.d.ts +134 -0
- package/components/counter/counter.d.ts.map +1 -0
- package/components/counter/counter.js +176 -0
- package/components/drawer/drawer.d.ts +41 -0
- package/components/drawer/drawer.d.ts.map +1 -0
- package/components/drawer/drawer.js +74 -0
- package/components/feature/feature.d.ts +27 -0
- package/components/feature/feature.d.ts.map +1 -0
- package/components/feature/feature.js +42 -0
- package/components/field-note/field-note.d.ts +33 -0
- package/components/field-note/field-note.d.ts.map +1 -0
- package/components/field-note/field-note.js +44 -0
- package/components/file-upload/file-upload.d.ts +118 -0
- package/components/file-upload/file-upload.d.ts.map +1 -0
- package/components/file-upload/file-upload.js +224 -0
- package/components/file-upload/file-upload.model.d.ts +24 -0
- package/components/file-upload/file-upload.model.d.ts.map +1 -0
- package/components/file-upload.model/file-upload.model.js +11 -0
- package/components/footer/footer.d.ts +16 -0
- package/components/footer/footer.d.ts.map +1 -0
- package/components/footer/footer.js +35 -0
- package/components/global-nav/global-nav.d.ts +14 -0
- package/components/global-nav/global-nav.d.ts.map +1 -0
- package/components/global-nav/global-nav.js +22 -0
- package/components/global-nav-item/global-nav-item.d.ts +80 -0
- package/components/global-nav-item/global-nav-item.d.ts.map +1 -0
- package/components/global-nav-item/global-nav-item.js +128 -0
- package/components/grid/grid.d.ts +51 -0
- package/components/grid/grid.d.ts.map +1 -0
- package/components/grid/grid.js +49 -0
- package/components/grid-item/grid-item.d.ts +14 -0
- package/components/grid-item/grid-item.d.ts.map +1 -0
- package/components/grid-item/grid-item.js +20 -0
- package/components/header/header.d.ts +19 -0
- package/components/header/header.d.ts.map +1 -0
- package/components/header/header.js +49 -0
- package/components/heading/heading.d.ts +44 -0
- package/components/heading/heading.d.ts.map +1 -0
- package/components/heading/heading.js +51 -0
- package/components/hero/hero.d.ts +22 -0
- package/components/hero/hero.d.ts.map +1 -0
- package/components/hero/hero.js +37 -0
- package/components/hr/hr.d.ts +23 -0
- package/components/hr/hr.d.ts.map +1 -0
- package/components/hr/hr.js +27 -0
- package/components/icon/icon.d.ts +51 -0
- package/components/icon/icon.d.ts.map +1 -0
- package/components/icon/icon.js +66 -0
- package/components/icon-link-list/icon-link-list.d.ts +19 -0
- package/components/icon-link-list/icon-link-list.d.ts.map +1 -0
- package/components/icon-link-list/icon-link-list.js +31 -0
- package/components/icon-link-list-item/icon-link-list-item.d.ts +23 -0
- package/components/icon-link-list-item/icon-link-list-item.d.ts.map +1 -0
- package/components/icon-link-list-item/icon-link-list-item.js +39 -0
- package/components/index.browser.js +4 -0
- package/components/inline-checkbox/inline-checkbox.d.ts +73 -0
- package/components/inline-checkbox/inline-checkbox.d.ts.map +1 -0
- package/components/inline-checkbox/inline-checkbox.js +114 -0
- package/components/key-value-table/key-value-table.d.ts +19 -0
- package/components/key-value-table/key-value-table.d.ts.map +1 -0
- package/components/key-value-table/key-value-table.js +33 -0
- package/components/key-value-table-row/key-value-table-row.d.ts +30 -0
- package/components/key-value-table-row/key-value-table-row.d.ts.map +1 -0
- package/components/key-value-table-row/key-value-table-row.js +38 -0
- package/components/layout/layout.d.ts +50 -0
- package/components/layout/layout.d.ts.map +1 -0
- package/components/layout/layout.js +43 -0
- package/components/layout-container/layout-container.d.ts +14 -0
- package/components/layout-container/layout-container.d.ts.map +1 -0
- package/components/layout-container/layout-container.js +20 -0
- package/components/layout-section/layout-section.d.ts +28 -0
- package/components/layout-section/layout-section.d.ts.map +1 -0
- package/components/layout-section/layout-section.js +37 -0
- package/components/linelength-container/linelength-container.d.ts +14 -0
- package/components/linelength-container/linelength-container.d.ts.map +1 -0
- package/components/linelength-container/linelength-container.js +20 -0
- package/components/link-list/link-list.d.ts +56 -0
- package/components/link-list/link-list.d.ts.map +1 -0
- package/components/link-list/link-list.js +48 -0
- package/components/link-list-item/link-list-item.d.ts +26 -0
- package/components/link-list-item/link-list-item.d.ts.map +1 -0
- package/components/link-list-item/link-list-item.js +41 -0
- package/components/list/list.d.ts +33 -0
- package/components/list/list.d.ts.map +1 -0
- package/components/list/list.js +36 -0
- package/components/list-item/list-item.d.ts +14 -0
- package/components/list-item/list-item.d.ts.map +1 -0
- package/components/list-item/list-item.js +20 -0
- package/components/loading-indicator/loading-indicator.d.ts +14 -0
- package/components/loading-indicator/loading-indicator.d.ts.map +1 -0
- package/components/loading-indicator/loading-indicator.js +20 -0
- package/components/logo/logo.d.ts +18 -0
- package/components/logo/logo.d.ts.map +1 -0
- package/components/logo/logo.js +29 -0
- package/components/main/main.d.ts +14 -0
- package/components/main/main.d.ts.map +1 -0
- package/components/main/main.js +16 -0
- package/components/media-block/media-block.d.ts +24 -0
- package/components/media-block/media-block.d.ts.map +1 -0
- package/components/media-block/media-block.js +37 -0
- package/components/modal/modal.d.ts +37 -0
- package/components/modal/modal.d.ts.map +1 -0
- package/components/modal/modal.js +67 -0
- package/components/nav-container/nav-container.d.ts +14 -0
- package/components/nav-container/nav-container.d.ts.map +1 -0
- package/components/nav-container/nav-container.js +20 -0
- package/components/page-header/page-header.d.ts +18 -0
- package/components/page-header/page-header.d.ts.map +1 -0
- package/components/page-header/page-header.js +39 -0
- package/components/pagination/pagination.d.ts +38 -0
- package/components/pagination/pagination.d.ts.map +1 -0
- package/components/pagination/pagination.js +52 -0
- package/components/pagination-item/pagination-item.d.ts +35 -0
- package/components/pagination-item/pagination-item.d.ts.map +1 -0
- package/components/pagination-item/pagination-item.js +52 -0
- package/components/primary-nav/primary-nav.d.ts +23 -0
- package/components/primary-nav/primary-nav.d.ts.map +1 -0
- package/components/primary-nav/primary-nav.js +33 -0
- package/components/primary-nav-item/primary-nav-item.d.ts +70 -0
- package/components/primary-nav-item/primary-nav-item.d.ts.map +1 -0
- package/components/primary-nav-item/primary-nav-item.js +121 -0
- package/components/radio-field/radio-field.d.ts +84 -0
- package/components/radio-field/radio-field.d.ts.map +1 -0
- package/components/radio-field/radio-field.js +108 -0
- package/components/radio-field-item/radio-field-item.d.ts +100 -0
- package/components/radio-field-item/radio-field-item.d.ts.map +1 -0
- package/components/radio-field-item/radio-field-item.js +142 -0
- package/components/search-form/search-form.d.ts +91 -0
- package/components/search-form/search-form.d.ts.map +1 -0
- package/components/search-form/search-form.js +131 -0
- package/components/section/section.d.ts +16 -0
- package/components/section/section.d.ts.map +1 -0
- package/components/section/section.js +27 -0
- package/components/select-field/select-field.d.ts +94 -0
- package/components/select-field/select-field.d.ts.map +1 -0
- package/components/select-field/select-field.js +123 -0
- package/components/show-hide/show-hide.d.ts +61 -0
- package/components/show-hide/show-hide.d.ts.map +1 -0
- package/components/show-hide/show-hide.js +72 -0
- package/components/show-more/show-more.d.ts +33 -0
- package/components/show-more/show-more.d.ts.map +1 -0
- package/components/show-more/show-more.js +63 -0
- package/components/skeleton/skeleton.d.ts +31 -0
- package/components/skeleton/skeleton.d.ts.map +1 -0
- package/components/skeleton/skeleton.js +33 -0
- package/components/tab/tab.d.ts +45 -0
- package/components/tab/tab.d.ts.map +1 -0
- package/components/tab/tab.js +47 -0
- package/components/table/table.d.ts +33 -0
- package/components/table/table.d.ts.map +1 -0
- package/components/table/table.js +39 -0
- package/components/table-body/table-body.d.ts +14 -0
- package/components/table-body/table-body.d.ts.map +1 -0
- package/components/table-body/table-body.js +20 -0
- package/components/table-cell/table-cell.d.ts +38 -0
- package/components/table-cell/table-cell.d.ts.map +1 -0
- package/components/table-cell/table-cell.js +36 -0
- package/components/table-header/table-header.d.ts +14 -0
- package/components/table-header/table-header.d.ts.map +1 -0
- package/components/table-header/table-header.js +20 -0
- package/components/table-header-cell/table-header-cell.d.ts +62 -0
- package/components/table-header-cell/table-header-cell.d.ts.map +1 -0
- package/components/table-header-cell/table-header-cell.js +62 -0
- package/components/table-object/table-object.d.ts +66 -0
- package/components/table-object/table-object.d.ts.map +1 -0
- package/components/table-object/table-object.js +96 -0
- package/components/table-row/table-row.d.ts +14 -0
- package/components/table-row/table-row.d.ts.map +1 -0
- package/components/table-row/table-row.js +20 -0
- package/components/tabs/tabs.d.ts +101 -0
- package/components/tabs/tabs.d.ts.map +1 -0
- package/components/tabs/tabs.js +184 -0
- package/components/tag/tag.d.ts +27 -0
- package/components/tag/tag.d.ts.map +1 -0
- package/components/tag/tag.js +41 -0
- package/components/tag-list/tag-list.d.ts +14 -0
- package/components/tag-list/tag-list.d.ts.map +1 -0
- package/components/tag-list/tag-list.js +20 -0
- package/components/text-field/text-field.d.ts +89 -0
- package/components/text-field/text-field.d.ts.map +1 -0
- package/components/text-field/text-field.js +124 -0
- package/components/text-link/text-link.d.ts +42 -0
- package/components/text-link/text-link.d.ts.map +1 -0
- package/components/text-link/text-link.js +47 -0
- package/components/text-passage/text-passage.d.ts +38 -0
- package/components/text-passage/text-passage.d.ts.map +1 -0
- package/components/text-passage/text-passage.js +57 -0
- package/components/textarea-field/textarea-field.d.ts +82 -0
- package/components/textarea-field/textarea-field.d.ts.map +1 -0
- package/components/textarea-field/textarea-field.js +111 -0
- package/components/toggle/toggle.d.ts +89 -0
- package/components/toggle/toggle.d.ts.map +1 -0
- package/components/toggle/toggle.js +132 -0
- package/components/toolbar/toolbar.d.ts +32 -0
- package/components/toolbar/toolbar.d.ts.map +1 -0
- package/components/toolbar/toolbar.js +40 -0
- package/components/tooltip/tooltip.d.ts +15 -0
- package/components/tooltip/tooltip.d.ts.map +1 -0
- package/components/tooltip/tooltip.js +35 -0
- package/components/tooltip-trigger/tooltip-trigger.d.ts +46 -0
- package/components/tooltip-trigger/tooltip-trigger.d.ts.map +1 -0
- package/components/tooltip-trigger/tooltip-trigger.js +100 -0
- package/components/utility-nav/utility-nav.d.ts +14 -0
- package/components/utility-nav/utility-nav.d.ts.map +1 -0
- package/components/utility-nav/utility-nav.js +22 -0
- package/components/utility-nav-item/utility-nav-item.d.ts +38 -0
- package/components/utility-nav-item/utility-nav-item.d.ts.map +1 -0
- package/components/utility-nav-item/utility-nav-item.js +57 -0
- package/package.json +49 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { E as b } from "../EdElement.js";
|
|
2
|
+
import u from "classnames";
|
|
3
|
+
import { unsafeCSS as m, html as n } from "lit";
|
|
4
|
+
import { property as l, state as c } from "lit/decorators.js";
|
|
5
|
+
import { n as v } from "../index.browser.js";
|
|
6
|
+
import "../tab/tab.js";
|
|
7
|
+
const f = ':root,:host{--size-base-unit: .5rem}*,::slotted(*),*:before,*:after{box-sizing:border-box}h1,h2,h3,h4,h5,h6{margin:0}.ed-c-tabs__header{position:relative;display:flex;flex-direction:column;overflow:hidden}.ed-c-tabs:not(.ed-is-start) .ed-c-tabs__header:before{content:"";display:block;position:absolute;pointer-events:none;background:linear-gradient(to right,var(--ed-tabs-header-before-background, var(--ed-theme-color-inverted)),rgba(255,255,255,.001) 30%);height:100%;top:0;left:0;width:3rem;z-index:1}.ed-c-tabs:not(.ed-is-end) .ed-c-tabs__header:after{content:"";display:block;position:absolute;pointer-events:none;background:linear-gradient(to right,rgba(255,255,255,.001) 30%,var(--ed-tabs-header-after-background, var(--ed-theme-color-inverted)));height:100%;top:0;right:0;width:3rem;z-index:1}.ed-c-tabs--inverted.ed-c-tabs:not(.ed-is-start) .ed-c-tabs__header:before{background:linear-gradient(to right,var(--ed-tabs-inverted-header-before-background, var(--ed-theme-color-neutral-dark)),rgba(255,255,255,.001) 30%)}.ed-c-tabs--inverted.ed-c-tabs:not(.ed-is-end) .ed-c-tabs__header:after{background:linear-gradient(to right,rgba(255,255,255,.001) 30%,var(--ed-tabs-inverted-header-after-background, var(--ed-theme-color-neutral-dark)))}@media all and (min-width:48rem){.ed-c-tabs__header{flex-direction:row;align-items:baseline}}.ed-c-tabs__list{display:flex;overflow:auto;width:100%;margin:0;padding:0 0 1rem;position:relative;order:2}.ed-c-tabs--inverted .ed-c-tabs__list{background:var(--ed-tabs-inverted-list-background, var(--ed-theme-color-core-text))}@media all and (min-width:48rem){.ed-c-tabs--align-center .ed-c-tabs__list{justify-content:center}}@media all and (min-width:48rem){.ed-c-tabs--align-right .ed-c-tabs__list{justify-content:flex-end}}@media all and (min-width:48rem){.ed-c-tabs__list{order:1}}.ed-c-tabs__after{order:1;margin-bottom:1rem}@media all and (min-width:48rem){.ed-c-tabs__after{order:2;margin-left:1rem}}.ed-c-tabs__item{display:block;margin:0;flex-shrink:0}.ed-c-tabs__button{display:block;font-family:var(--ed-theme-typography-label-default-font-family);font-weight:var(--ed-theme-typography-label-default-font-weight);font-size:var(--ed-theme-typography-label-default-font-size);line-height:var(--ed-theme-typography-label-default-line-height);letter-spacing:var(--ed-theme-typography-label-default-letter-spacing);text-transform:var(--ed-theme-typography-label-default-text-transform);-webkit-appearance:none;appearance:none;border:none;padding:.5rem;cursor:pointer;color:var(--ed-theme-color-content-default);text-decoration:none;background:none;transition:background var(--ed-theme-animation-fade-quick) var(--ed-theme-animation-ease)}.ed-c-tabs__button:hover,.ed-c-tabs__button *:focus{background:var(--ed-theme-color-background-subtle)}.ed-c-tabs--inverted .ed-c-tabs__button{color:var(--ed-theme-color-content-knockout)}.ed-c-tabs--inverted .ed-c-tabs__button:hover,.ed-c-tabs--inverted .ed-c-tabs__button *:focus{background:var(--ed-theme-color-background-brand)}.ed-c-tabs__item.ed-is-active .ed-c-tabs__button{background:var(--ed-theme-color-background-brand);color:var(--ed-theme-color-content-knockout)}.ed-c-tabs__body{text-align:left}';
|
|
8
|
+
var p = Object.defineProperty, o = (d, t, e, r) => {
|
|
9
|
+
for (var a = void 0, i = d.length - 1, h; i >= 0; i--)
|
|
10
|
+
(h = d[i]) && (a = h(t, e, a) || a);
|
|
11
|
+
return a && p(t, e, a), a;
|
|
12
|
+
};
|
|
13
|
+
class s extends b {
|
|
14
|
+
/**
|
|
15
|
+
* Initialize
|
|
16
|
+
* 1) Activate the first tab, by default
|
|
17
|
+
*/
|
|
18
|
+
constructor() {
|
|
19
|
+
super(), this.inverted = !1, this.isStart = !0, this.isEnd = !1, this.onScroll = this.onScroll.bind(this), this.onResize = this.onResize.bind(this), this.setIsStart = this.setIsStart.bind(this), this.setIsEnd = this.setIsEnd.bind(this);
|
|
20
|
+
}
|
|
21
|
+
static get styles() {
|
|
22
|
+
return m(f);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A handler to select a new active tab
|
|
26
|
+
* 1) If tabItem doesn't exist, return
|
|
27
|
+
* 2) On tab select, remove hidden attribute from selected tab
|
|
28
|
+
* 3) Hide other tabs
|
|
29
|
+
* 4) Set the active tab to the tab item selected
|
|
30
|
+
* 5) Focus on the active tab panel of content
|
|
31
|
+
*/
|
|
32
|
+
activateTab(t, e = !1, r) {
|
|
33
|
+
if (r && r.preventDefault(), !t)
|
|
34
|
+
return;
|
|
35
|
+
[...this.querySelectorAll(":scope > ed-tab")].forEach((i) => {
|
|
36
|
+
i === t ? (i.removeAttribute("aria-hidden"), i.style.removeProperty("--ed-tab-hidden")) : (i.setAttribute("aria-hidden", ""), i.style.setProperty("--ed-tab-hidden", "none"));
|
|
37
|
+
}), this.activeTab = t, e && t.focus();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A handler to proxy key presses on a tabitem
|
|
41
|
+
* 1) Use left and right arrows to select previous/next item
|
|
42
|
+
*/
|
|
43
|
+
async handleKeyUp(t) {
|
|
44
|
+
const e = t.code;
|
|
45
|
+
if (e === "ArrowLeft" || e === "ArrowUp") {
|
|
46
|
+
const a = this.activeTab?.previousElementSibling;
|
|
47
|
+
this.activateTab(a, !0, void 0);
|
|
48
|
+
} else if (e === "ArrowRight" || e === "ArrowDown") {
|
|
49
|
+
const a = this.activeTab?.nextElementSibling;
|
|
50
|
+
this.activateTab(a, !0, void 0);
|
|
51
|
+
}
|
|
52
|
+
await this.updateComplete;
|
|
53
|
+
const r = this.shadowRoot?.querySelector(".ed-c-tabs__item.ed-is-active .ed-c-tabs__button");
|
|
54
|
+
r && r.focus();
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check if last overflow list item is in the viewport
|
|
58
|
+
* 1) Get children of the overflow list inner container and get bounding client rectangle of last child
|
|
59
|
+
* 2) Return true if the left property is greater than or equal to 0 and if the right property is less
|
|
60
|
+
* than or equal to the window inner width or document client width
|
|
61
|
+
*/
|
|
62
|
+
isInViewport() {
|
|
63
|
+
const t = this.shadowRoot.querySelector(".ed-c-tabs__list").children, e = t[t.length - 1].querySelector(":first-child").getBoundingClientRect();
|
|
64
|
+
return e.left >= 0 && e.right <= (globalThis.innerWidth || document.documentElement.clientWidth);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* On overflow list inner scroll
|
|
68
|
+
* 1) On scroll, if position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
|
|
69
|
+
* 2) On scroll, If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
|
|
70
|
+
*/
|
|
71
|
+
onScroll() {
|
|
72
|
+
this.setIsStart(), this.setIsEnd();
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Set isStart state
|
|
76
|
+
* 1) If position from left is greater than 0, set isStart to false. Otherwise set isStart to true.
|
|
77
|
+
*/
|
|
78
|
+
setIsStart() {
|
|
79
|
+
this.shadowRoot.querySelector(".ed-c-tabs__list").scrollLeft > 0 ? this.isStart = !1 : this.isStart = !0;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Set isEnd state
|
|
83
|
+
* 1) If last child is fully in the viewport, set isEnd to true. Otherwise, set isEnd to false.
|
|
84
|
+
*/
|
|
85
|
+
setIsEnd() {
|
|
86
|
+
this.isInViewport() === !0 ? this.isEnd = !0 : this.isEnd = !1;
|
|
87
|
+
}
|
|
88
|
+
onResize() {
|
|
89
|
+
this.setIsStart(), this.setIsEnd();
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Initialize tabs
|
|
93
|
+
* 1) Set the active tab if activeIndex is defined. Otherwise, set the first tab as active by default
|
|
94
|
+
* 2) Auto set the `aria-labelledby` prop for accessible tabs if user doesn't define the `ariaLabelledBy` prop
|
|
95
|
+
*/
|
|
96
|
+
connectedCallback() {
|
|
97
|
+
super.connectedCallback(), setTimeout(() => {
|
|
98
|
+
this.setIsStart(), this.setIsEnd();
|
|
99
|
+
}, 1), globalThis.addEventListener("resize", this.onResize);
|
|
100
|
+
const t = this.querySelectorAll("ed-tab");
|
|
101
|
+
this.activeIndex ? this.activateTab(t[this.activeIndex], !1, void 0) : this.activateTab(this.querySelector("ed-tab"), !1, void 0), [...t].map((e) => {
|
|
102
|
+
e.ariaLabelledBy = e.ariaLabelledBy || v();
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Disconnected callback lifecycle
|
|
107
|
+
* 1) Remove window resize event listener
|
|
108
|
+
*/
|
|
109
|
+
disconnectedCallback() {
|
|
110
|
+
globalThis.removeEventListener("resize", this.onResize), super.disconnectedCallback();
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A render block for the tab list items
|
|
114
|
+
* 1) For all tab items, render a list item with a trigger inside
|
|
115
|
+
*/
|
|
116
|
+
renderTabListItems() {
|
|
117
|
+
return [...this.querySelectorAll("ed-tab")].map((e) => n`<li
|
|
118
|
+
class=${u("ed-c-tabs__item", {
|
|
119
|
+
"ed-is-active": e === this.activeTab
|
|
120
|
+
})}
|
|
121
|
+
role="presentation"
|
|
122
|
+
>
|
|
123
|
+
<a
|
|
124
|
+
class="ed-c-tabs__button"
|
|
125
|
+
@keyup=${(r) => this.handleKeyUp(r)}
|
|
126
|
+
@click=${(r) => this.activateTab(e, !0, r)}
|
|
127
|
+
tabindex=${e === this.activeTab ? 0 : -1}
|
|
128
|
+
id=${e.ariaLabelledBy}
|
|
129
|
+
href=${"#" + e.href}
|
|
130
|
+
role="tab"
|
|
131
|
+
aria-selected=${e === this.activeTab}
|
|
132
|
+
aria-controls=${e.href}
|
|
133
|
+
>
|
|
134
|
+
${e.label}
|
|
135
|
+
</a>
|
|
136
|
+
</li>`);
|
|
137
|
+
}
|
|
138
|
+
render() {
|
|
139
|
+
const t = this.componentClassNames("ed-c-tabs", {
|
|
140
|
+
"ed-c-tabs--inverted": this.inverted === !0,
|
|
141
|
+
"ed-c-tabs--align-center": this.align === "center",
|
|
142
|
+
"ed-c-tabs--align-right": this.align === "right",
|
|
143
|
+
"ed-is-start": this.isStart === !0,
|
|
144
|
+
"ed-is-end": this.isEnd === !0
|
|
145
|
+
});
|
|
146
|
+
return n`
|
|
147
|
+
<div class="${t}">
|
|
148
|
+
<header class="ed-c-tabs__header">
|
|
149
|
+
<ul class="ed-c-tabs__list" role="tablist" @scroll=${this.onScroll}>
|
|
150
|
+
${this.renderTabListItems()}
|
|
151
|
+
</ul>
|
|
152
|
+
${this.slotNotEmpty("tabsAfter") && n`<div class="ed-c-tabs__after">
|
|
153
|
+
<slot name="tabsAfter"></slot>
|
|
154
|
+
</div>`}
|
|
155
|
+
</header>
|
|
156
|
+
<div class="ed-c-tabs__body">
|
|
157
|
+
<slot></slot>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
`;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
o([
|
|
164
|
+
l({ type: Boolean })
|
|
165
|
+
], s.prototype, "inverted");
|
|
166
|
+
o([
|
|
167
|
+
l({ type: Number })
|
|
168
|
+
], s.prototype, "activeIndex");
|
|
169
|
+
o([
|
|
170
|
+
c()
|
|
171
|
+
], s.prototype, "activeTab");
|
|
172
|
+
o([
|
|
173
|
+
c()
|
|
174
|
+
], s.prototype, "isStart");
|
|
175
|
+
o([
|
|
176
|
+
c()
|
|
177
|
+
], s.prototype, "isEnd");
|
|
178
|
+
o([
|
|
179
|
+
l()
|
|
180
|
+
], s.prototype, "align");
|
|
181
|
+
customElements.get("ed-tabs") === void 0 && customElements.define("ed-tabs", s);
|
|
182
|
+
export {
|
|
183
|
+
s as EdTabs
|
|
184
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EdElement } from '@brad-frost-web/eddie-web-components/components/EdElement';
|
|
2
|
+
/**
|
|
3
|
+
* @slot - The component content
|
|
4
|
+
*/
|
|
5
|
+
export declare class EdTag extends EdElement {
|
|
6
|
+
static get styles(): import('lit').CSSResult;
|
|
7
|
+
/**
|
|
8
|
+
* Dismissed state
|
|
9
|
+
*/
|
|
10
|
+
dismissed: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Dismissible toggle
|
|
13
|
+
* 1) Show that the tag is dismissible
|
|
14
|
+
*/
|
|
15
|
+
text: string;
|
|
16
|
+
/**
|
|
17
|
+
* Handle button click
|
|
18
|
+
*/
|
|
19
|
+
handleClick(): void;
|
|
20
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
'ed-tag': EdTag;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../packages/eddie-web-components/components/tag/tag.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2DAA2D,CAAC;AAGtF;;GAEG;AACH,qBAAa,KAAM,SAAQ,SAAS;IAClC,MAAM,KAAK,MAAM,4BAEhB;IAED;;OAEG;IAEH,SAAS,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IAEH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW;IAIX,MAAM;CAaP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,KAAK,CAAC;KACjB;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { unsafeCSS as l, html as m } from "lit";
|
|
2
|
+
import { property as d } from "lit/decorators.js";
|
|
3
|
+
import { E as c } from "../EdElement.js";
|
|
4
|
+
const h = ":root,:host{--size-base-unit: .5rem}*,::slotted(*),*:before,*:after{box-sizing:border-box}h1,h2,h3,h4,h5,h6{margin:0}.ed-c-tag__button{font-family:var(--ed-theme-typography-label-default-font-family);font-weight:var(--ed-theme-typography-label-default-font-weight);font-size:var(--ed-theme-typography-label-default-font-size);line-height:var(--ed-theme-typography-label-default-line-height);letter-spacing:var(--ed-theme-typography-label-default-letter-spacing);text-transform:var(--ed-theme-typography-label-default-text-transform);display:inline-flex;align-items:center;appearance:none;border-radius:var(--ed-theme-border-radius-md);padding:.25rem .75rem;border:var(--ed-theme-border-width-sm) solid var(--ed-theme-color-content-subtle);background:var(--ed-theme-color-background-brand-knockout);color:var(--ed-theme-color-content-knockout);cursor:pointer;transition:all var(--ed-theme-animation-fade-quick) var(--ed-theme-animation-ease)}.ed-c-tag__button:hover,.ed-c-tag__button:focus{background:var(--ed-theme-color-background-subtle-hover)}ed-icon{--ed-icon-height: .625rem ;--ed-icon-width: .625rem ;margin-left:.5rem}";
|
|
5
|
+
var p = Object.defineProperty, i = (a, t, n, g) => {
|
|
6
|
+
for (var e = void 0, o = a.length - 1, s; o >= 0; o--)
|
|
7
|
+
(s = a[o]) && (e = s(t, n, e) || e);
|
|
8
|
+
return e && p(t, n, e), e;
|
|
9
|
+
};
|
|
10
|
+
class r extends c {
|
|
11
|
+
static get styles() {
|
|
12
|
+
return l(h.toString());
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Handle button click
|
|
16
|
+
*/
|
|
17
|
+
handleClick() {
|
|
18
|
+
this.dismissed = !this.dismissed;
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const t = this.componentClassNames("ed-c-tag", {});
|
|
22
|
+
return this.dismissed ? null : m`
|
|
23
|
+
<li class="${t}">
|
|
24
|
+
<button class="ed-c-tag__button" @click=${this.handleClick}>
|
|
25
|
+
<span class="ed-c-tag__text">${this.text}</span>
|
|
26
|
+
<ed-icon class="ed-c-tag__icon" name="close"></ed-icon>
|
|
27
|
+
</button>
|
|
28
|
+
</li>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
i([
|
|
33
|
+
d({ type: Boolean })
|
|
34
|
+
], r.prototype, "dismissed");
|
|
35
|
+
i([
|
|
36
|
+
d()
|
|
37
|
+
], r.prototype, "text");
|
|
38
|
+
customElements.get("ed-tag") === void 0 && customElements.define("ed-tag", r);
|
|
39
|
+
export {
|
|
40
|
+
r as EdTag
|
|
41
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EdElement } from '@brad-frost-web/eddie-web-components/components/EdElement';
|
|
2
|
+
/**
|
|
3
|
+
* @slot - The component content
|
|
4
|
+
*/
|
|
5
|
+
export declare class EdTagList extends EdElement {
|
|
6
|
+
static get styles(): import('lit').CSSResult;
|
|
7
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
'ed-tag-list': EdTagList;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=tag-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-list.d.ts","sourceRoot":"","sources":["../../../../packages/eddie-web-components/components/tag-list/tag-list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2DAA2D,CAAC;AAGtF;;GAEG;AACH,qBAAa,SAAU,SAAQ,SAAS;IACtC,MAAM,KAAK,MAAM,4BAEhB;IAED,MAAM;CASP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,SAAS,CAAC;KAC1B;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { unsafeCSS as e, html as s } from "lit";
|
|
2
|
+
import { E as o } from "../EdElement.js";
|
|
3
|
+
const r = ":root,:host{--size-base-unit: .5rem}*,::slotted(*),*:before,*:after{box-sizing:border-box}h1,h2,h3,h4,h5,h6{margin:0}.ed-c-tag-list{display:flex;margin:-.5rem 0 0 -.5rem;padding:0;list-style:none}::slotted(ed-tag){margin-left:.5rem;margin-top:.5rem}";
|
|
4
|
+
class l extends o {
|
|
5
|
+
static get styles() {
|
|
6
|
+
return e(r.toString());
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
const t = this.componentClassNames("ed-c-tag-list", {});
|
|
10
|
+
return s`
|
|
11
|
+
<ul class="${t}">
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</ul>
|
|
14
|
+
`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
customElements.get("ed-tag-list") === void 0 && customElements.define("ed-tag-list", l);
|
|
18
|
+
export {
|
|
19
|
+
l as EdTagList
|
|
20
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { EdFormElement } from '@brad-frost-web/eddie-web-components/components/EdFormElement';
|
|
2
|
+
export declare class EdTextField extends EdFormElement {
|
|
3
|
+
static get styles(): import('lit').CSSResult;
|
|
4
|
+
/**
|
|
5
|
+
* The unique id of the field
|
|
6
|
+
*/
|
|
7
|
+
fieldId: string;
|
|
8
|
+
/**
|
|
9
|
+
* The form field's label
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* Text fields name attribute property
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* Fieldnote text
|
|
18
|
+
*/
|
|
19
|
+
fieldNote?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Aria describedby
|
|
22
|
+
* 1) Used to connect the field note in select field to the select menu for accessibility
|
|
23
|
+
*/
|
|
24
|
+
ariaDescribedBy?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Required attribute
|
|
27
|
+
*/
|
|
28
|
+
required: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Disabled attribute
|
|
31
|
+
*/
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Type variants
|
|
35
|
+
* <ed-text-passage size="sm">
|
|
36
|
+
* <ul>
|
|
37
|
+
* <li>**text** renders a standar text input</li>
|
|
38
|
+
* <li>**email** renders a text input specificall for an email format.</li>
|
|
39
|
+
* <li>**number** renders an input for number values only</li>
|
|
40
|
+
* <li>**url** renders an input for urls only</li>
|
|
41
|
+
* <li>**tel** renders an input for telephone number values only</li>
|
|
42
|
+
* </ul>
|
|
43
|
+
* </ed-text-passage>
|
|
44
|
+
*/
|
|
45
|
+
type: 'text' | 'email' | 'number' | 'url' | 'tel';
|
|
46
|
+
/**
|
|
47
|
+
* Inverted variant
|
|
48
|
+
* 1) Used for dark backgrounds
|
|
49
|
+
*/
|
|
50
|
+
inverted?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Placeholder text
|
|
53
|
+
*/
|
|
54
|
+
placeholder?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Error state
|
|
57
|
+
*/
|
|
58
|
+
isError?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Success state
|
|
61
|
+
*/
|
|
62
|
+
isSuccess?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Field note icon name
|
|
65
|
+
*/
|
|
66
|
+
iconName?: string;
|
|
67
|
+
field: HTMLInputElement;
|
|
68
|
+
connectedCallback(): void;
|
|
69
|
+
handleInput(event: Event): void;
|
|
70
|
+
/**
|
|
71
|
+
* Handles implicit form submission
|
|
72
|
+
* 1) By dispatching a 'submit' event on the form element. This is because calling the submit method on the form element does not trigger the submit event.
|
|
73
|
+
* 2) Calling the submit method on the form.
|
|
74
|
+
* @returns void
|
|
75
|
+
*/
|
|
76
|
+
handleImplicitFormSubmission(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Handle keydown event
|
|
79
|
+
* 1) Run implicit form submission on keybdown of Enter
|
|
80
|
+
*/
|
|
81
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
82
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
83
|
+
}
|
|
84
|
+
declare global {
|
|
85
|
+
interface HTMLElementTagNameMap {
|
|
86
|
+
'ed-text-field': EdTextField;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=text-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../packages/eddie-web-components/components/text-field/text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+DAA+D,CAAC;AAK9F,OAAO,0BAA0B,CAAC;AAGlC,qBAAa,WAAY,SAAQ,aAAa;IAC5C,MAAM,KAAK,MAAM,4BAEhB;IAED;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAW;IAExB;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IAEH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IAEH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IAEH,QAAQ,EAAE,OAAO,CAAS;IAE1B;;OAEG;IAEH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;;;OAWG;IAEH,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAU;IAE3D;;;OAGG;IAEH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IAEH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IAEH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IAEH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IAEH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,KAAK,EAAG,gBAAgB,CAAC;IAEzB,iBAAiB;IAQjB,WAAW,CAAC,KAAK,EAAE,KAAK;IAKxB;;;;;OAKG;IACH,4BAA4B;IAM5B;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,aAAa;IAMlC,MAAM;CAsCP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,WAAW,CAAC;KAC9B;CACF"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { E as f } from "../EdFormElement.js";
|
|
2
|
+
import { unsafeCSS as u, html as n } from "lit";
|
|
3
|
+
import { property as o, query as m } from "lit/decorators.js";
|
|
4
|
+
import { ifDefined as i } from "lit-html/directives/if-defined.js";
|
|
5
|
+
import { n as h } from "../index.browser.js";
|
|
6
|
+
import "../field-note/field-note.js";
|
|
7
|
+
const p = ":root,:host{--size-base-unit: .5rem}*,::slotted(*),*:before,*:after{box-sizing:border-box}h1,h2,h3,h4,h5,h6{margin:0}.ed-c-text-field__label{font-family:var(--ed-theme-typography-label-default-font-family);font-weight:var(--ed-theme-typography-label-default-font-weight);font-size:var(--ed-theme-typography-label-default-font-size);line-height:var(--ed-theme-typography-label-default-line-height);letter-spacing:var(--ed-theme-typography-label-default-letter-spacing);text-transform:var(--ed-theme-typography-label-default-text-transform);display:block;margin-bottom:.5rem}.ed-c-text-field--inverted .ed-c-text-field__label{color:var(--ed-theme-color-content-knockout)}.ed-c-text-field.ed-is-error .ed-c-text-field__label{color:var(--ed-theme-color-content-utility-error)}.ed-c-text-field.ed-is-success .ed-c-text-field__label{color:var(--ed-theme-color-content-utility-success)}.ed-c-text-field__input{-webkit-appearance:none;width:100%;border-width:var(--ed-theme-border-width-sm);border-style:solid;border-color:var(--ed-theme-form-color-border-default);border-radius:var(--ed-theme-border-radius-sm);outline:none;padding:.8125rem .5rem;font-family:var(--ed-theme-typography-body-default-font-family);font-weight:var(--ed-theme-typography-body-default-font-weight);font-size:var(--ed-theme-typography-body-default-font-size);line-height:var(--ed-theme-typography-body-default-line-height);letter-spacing:var(--ed-theme-typography-body-default-letter-spacing);text-transform:var(--ed-theme-typography-body-default-text-transform);color:var(--ed-theme-form-color-content-default);background-color:var(--ed-theme-form-color-background-default);transition:border-color var(--ed-theme-animation-fade-quick) var(--ed-theme-animation-ease),background-color var(--ed-theme-animation-fade-quick) var(--ed-theme-animation-ease),box-shadow var(--ed-theme-animation-fade-quick) var(--ed-theme-animation-ease)}.ed-c-text-field__input:hover{border-color:var(--ed-theme-color-border-brand);background-color:var(--ed-theme-form-color-background-hover)}.ed-c-text-field__input:focus:not(:disabled){border-color:var(--ed-theme-form-color-border-focus)}.ed-c-text-field__input:not(:placeholder-shown):focus:not(:disabled){border-color:var(--ed-theme-form-color-border-focus);background-color:var(--ed-theme-form-color-background-hover)}.ed-is-error .ed-c-text-field__input:not(:placeholder-shown):focus:not(:disabled){background-color:var(--ed-theme-color-background-utility-error)}.ed-is-success .ed-c-text-field__input:not(:placeholder-shown):focus:not(:disabled){background-color:var(--ed-theme-color-background-utility-success)}.ed-c-text-field__input:active:not(:disabled){border-color:var(--ed-theme-form-color-border)}.ed-c-text-field__input:disabled{background-color:var(--ed-theme-color-background-subtle);border-color:var(--ed-theme-color-border-disabled);color:var(--ed-theme-color-content-disabled);cursor:not-allowed}.ed-c-text-field__input:disabled~.ed-c-text-field__label,.ed-c-text-field__input:disabled:hover~.ed-c-text-field__label,.ed-c-text-field__input:disabled::placeholder{color:var(--ed-theme-color-content-disabled)}.ed-c-text-field__input:focus-visible{outline:var(--ed-theme-border-width-lg) solid var(--ed-theme-focus-ring-color-border-default);outline-offset:var(--ed-theme-offset-focus-ring, .25rem )}.ed-c-text-field__input::placeholder{font-family:var(--ed-theme-typography-body-sm-font-family);font-weight:var(--ed-theme-typography-body-sm-font-weight);font-size:var(--ed-theme-typography-body-sm-font-size);line-height:var(--ed-theme-typography-body-sm-line-height);letter-spacing:var(--ed-theme-typography-body-sm-letter-spacing);text-transform:var(--ed-theme-typography-body-sm-text-transform);color:var(--ed-theme-color-content-subtle);transition:color var(--ed-theme-animation-fade-quick) var(--ed-theme-animation-ease)}.ed-is-error .ed-c-text-field__input::placeholder{color:var(--ed-theme-color-content-utility-error)}.ed-is-error .ed-c-text-field__input:hover::placeholder{color:var(--ed-theme-color-content-utility-error-hover)}.ed-is-error .ed-c-text-field__input{color:var(--ed-theme-color-content-default);border-color:var(--ed-theme-color-border-utility-error);background-color:var(--ed-theme-color-background-utility-error)}.ed-is-error .ed-c-text-field__input:hover,.ed-is-error .ed-c-text-field__input:focus{background-color:var(--ed-theme-color-background-utility-error)}.ed-is-error .ed-c-text-field__input:not(:focus){color:var(--ed-theme-color-content-default)}.ed-is-success .ed-c-text-field__input{color:var(--ed-theme-color-content-default);border-color:var(--ed-theme-color-border-utility-success);background-color:var(--ed-theme-color-background-utility-success)}.ed-is-success .ed-c-text-field__input:hover,.ed-is-success .ed-c-text-field__input:focus{background-color:var(--ed-theme-color-background-utility-success)}.ed-c-text-field__input{width:100%}.ed-c-text-field--inverted .ed-c-text-field__input{border-color:var(--ed-theme-color-border-subtle)}";
|
|
8
|
+
var b = Object.defineProperty, t = (l, r, s, y) => {
|
|
9
|
+
for (var d = void 0, a = l.length - 1, c; a >= 0; a--)
|
|
10
|
+
(c = l[a]) && (d = c(r, s, d) || d);
|
|
11
|
+
return d && b(r, s, d), d;
|
|
12
|
+
};
|
|
13
|
+
class e extends f {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.label = "Label", this.required = !1, this.type = "text";
|
|
16
|
+
}
|
|
17
|
+
static get styles() {
|
|
18
|
+
return u(p);
|
|
19
|
+
}
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
super.connectedCallback(), this.fieldId = this.fieldId || h(), this.fieldNote && (this.ariaDescribedBy = this.ariaDescribedBy || h());
|
|
22
|
+
}
|
|
23
|
+
handleInput(r) {
|
|
24
|
+
this.value = r.target.value, this.internals.setFormValue(this.value);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Handles implicit form submission
|
|
28
|
+
* 1) By dispatching a 'submit' event on the form element. This is because calling the submit method on the form element does not trigger the submit event.
|
|
29
|
+
* 2) Calling the submit method on the form.
|
|
30
|
+
* @returns void
|
|
31
|
+
*/
|
|
32
|
+
handleImplicitFormSubmission() {
|
|
33
|
+
this.internals.form && (this.internals.form.dispatchEvent(new Event("submit", { bubbles: !0, composed: !0 })), this.internals.form.submit());
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Handle keydown event
|
|
37
|
+
* 1) Run implicit form submission on keybdown of Enter
|
|
38
|
+
*/
|
|
39
|
+
handleKeydown(r) {
|
|
40
|
+
r.key === "Enter" && this.handleImplicitFormSubmission();
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
const r = this.componentClassNames("ed-c-text-field", {
|
|
44
|
+
"ed-c-text-field--inverted": this.inverted === !0,
|
|
45
|
+
"ed-is-error": this.isError,
|
|
46
|
+
"ed-is-success": this.isSuccess
|
|
47
|
+
});
|
|
48
|
+
return n`
|
|
49
|
+
<div class="${r}">
|
|
50
|
+
<label class="ed-c-text-field__label" for="${this.fieldId}">${this.label}</label>
|
|
51
|
+
<div class="ed-c-text-field__body">
|
|
52
|
+
<input
|
|
53
|
+
class="ed-c-text-field__input"
|
|
54
|
+
type="${this.type}"
|
|
55
|
+
id="${this.fieldId}"
|
|
56
|
+
name="${i(this.name)}"
|
|
57
|
+
value="${i(this.value)}"
|
|
58
|
+
@keydown="${this.handleKeydown}"
|
|
59
|
+
@input="${this.handleInput}"
|
|
60
|
+
?required="${this.required}"
|
|
61
|
+
?disabled="${this.disabled}"
|
|
62
|
+
aria-describedby="${i(this.ariaDescribedBy)}"
|
|
63
|
+
placeholder="${i(this.placeholder)}"
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
${this.fieldNote && n`<ed-field-note
|
|
67
|
+
?inverted=${this.inverted}
|
|
68
|
+
id=${i(this.ariaDescribedBy)}
|
|
69
|
+
iconName=${i(this.iconName)}
|
|
70
|
+
?isSuccess=${this.isSuccess}
|
|
71
|
+
?isError=${this.isError}
|
|
72
|
+
>
|
|
73
|
+
${this.fieldNote}
|
|
74
|
+
</ed-field-note>`}
|
|
75
|
+
</div>
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
t([
|
|
80
|
+
o()
|
|
81
|
+
], e.prototype, "fieldId");
|
|
82
|
+
t([
|
|
83
|
+
o()
|
|
84
|
+
], e.prototype, "label");
|
|
85
|
+
t([
|
|
86
|
+
o()
|
|
87
|
+
], e.prototype, "name");
|
|
88
|
+
t([
|
|
89
|
+
o()
|
|
90
|
+
], e.prototype, "fieldNote");
|
|
91
|
+
t([
|
|
92
|
+
o()
|
|
93
|
+
], e.prototype, "ariaDescribedBy");
|
|
94
|
+
t([
|
|
95
|
+
o({ type: Boolean })
|
|
96
|
+
], e.prototype, "required");
|
|
97
|
+
t([
|
|
98
|
+
o({ type: Boolean })
|
|
99
|
+
], e.prototype, "disabled");
|
|
100
|
+
t([
|
|
101
|
+
o()
|
|
102
|
+
], e.prototype, "type");
|
|
103
|
+
t([
|
|
104
|
+
o({ type: Boolean })
|
|
105
|
+
], e.prototype, "inverted");
|
|
106
|
+
t([
|
|
107
|
+
o()
|
|
108
|
+
], e.prototype, "placeholder");
|
|
109
|
+
t([
|
|
110
|
+
o({ type: Boolean })
|
|
111
|
+
], e.prototype, "isError");
|
|
112
|
+
t([
|
|
113
|
+
o({ type: Boolean })
|
|
114
|
+
], e.prototype, "isSuccess");
|
|
115
|
+
t([
|
|
116
|
+
o()
|
|
117
|
+
], e.prototype, "iconName");
|
|
118
|
+
t([
|
|
119
|
+
m("input")
|
|
120
|
+
], e.prototype, "field");
|
|
121
|
+
customElements.get("ed-text-field") === void 0 && customElements.define("ed-text-field", e);
|
|
122
|
+
export {
|
|
123
|
+
e as EdTextField
|
|
124
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { EdElement } from '@brad-frost-web/eddie-web-components/components/EdElement';
|
|
2
|
+
/**
|
|
3
|
+
* @slot - The component content
|
|
4
|
+
*/
|
|
5
|
+
export declare class EdTextLink extends EdElement {
|
|
6
|
+
static get styles(): import('lit').CSSResult;
|
|
7
|
+
/**
|
|
8
|
+
* The link URL
|
|
9
|
+
*/
|
|
10
|
+
href?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Style variant
|
|
13
|
+
* <ed-text-passage size="sm">
|
|
14
|
+
* <ul>
|
|
15
|
+
* <li> **display** applies display treatment to the text link (e.g. article title link)</li>
|
|
16
|
+
* <li> **secondary** applies secondary treatment to the text link (e.g. non-prominent links)</li>
|
|
17
|
+
* </ul>
|
|
18
|
+
* </ed-text-passage>
|
|
19
|
+
*/
|
|
20
|
+
variant?: 'display' | 'secondary';
|
|
21
|
+
/**
|
|
22
|
+
* Size variant
|
|
23
|
+
* <ed-text-passage size="sm">
|
|
24
|
+
* <ul>
|
|
25
|
+
* <li> **sm** renders a smaller typography preset than the default</li>
|
|
26
|
+
* </ul>
|
|
27
|
+
* </ed-text-passage>
|
|
28
|
+
*/
|
|
29
|
+
size?: 'sm';
|
|
30
|
+
/**
|
|
31
|
+
* Inverted variant
|
|
32
|
+
* 1) Used for dark backgrounds
|
|
33
|
+
*/
|
|
34
|
+
inverted?: boolean;
|
|
35
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
36
|
+
}
|
|
37
|
+
declare global {
|
|
38
|
+
interface HTMLElementTagNameMap {
|
|
39
|
+
'ed-text-link': EdTextLink;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=text-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-link.d.ts","sourceRoot":"","sources":["../../../../packages/eddie-web-components/components/text-link/text-link.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,2DAA2D,CAAC;AAGtF;;GAEG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,MAAM,KAAK,MAAM,4BAEhB;IAED;;OAEG;IAEH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;OAQG;IAEH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAElC;;;;;;;OAOG;IAEH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;;OAGG;IAEH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM;CAkBP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,UAAU,CAAC;KAC5B;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { unsafeCSS as h, html as s } from "lit";
|
|
2
|
+
import { ifDefined as m } from "lit-html/directives/if-defined.js";
|
|
3
|
+
import { property as r } from "lit/decorators.js";
|
|
4
|
+
import { E as c } from "../EdElement.js";
|
|
5
|
+
const y = ":root,:host{--size-base-unit: .5rem}*,::slotted(*),*:before,*:after{box-sizing:border-box}h1,h2,h3,h4,h5,h6{margin:0}.ed-c-text-link{font-family:var(--ed-theme-typography-body-default-font-family);font-weight:var(--ed-theme-typography-body-default-font-weight);font-size:var(--ed-theme-typography-body-default-font-size);line-height:var(--ed-theme-typography-body-default-line-height);letter-spacing:var(--ed-theme-typography-body-default-letter-spacing);text-transform:var(--ed-theme-typography-body-default-text-transform);display:inline-flex;text-decoration:none;color:var(--ed-theme-link-color-content-default)}.ed-c-text-link:hover,.ed-c-text-link:focus{text-decoration:underline;color:var(--ed-theme-link-color-content-hover)}.ed-c-text-link:active{color:var(--ed-theme-link-color-content-active)}.ed-c-text-link:visited{color:var(--ed-theme-link-color-content-visited)}.ed-c-text-link--secondary{color:var(--ed-theme-color-content-subtle)}.ed-c-text-link--inverted{color:var(--ed-theme-color-content-knockout)}.ed-c-text-link--sm{font-family:var(--ed-theme-typography-body-sm-font-family);font-weight:var(--ed-theme-typography-body-sm-font-weight);font-size:var(--ed-theme-typography-body-sm-font-size);line-height:var(--ed-theme-typography-body-sm-line-height);letter-spacing:var(--ed-theme-typography-body-sm-letter-spacing);text-transform:var(--ed-theme-typography-body-sm-text-transform)}.ed-c-text-link__after{margin-left:.5rem}";
|
|
6
|
+
var f = Object.defineProperty, n = (i, o, d, p) => {
|
|
7
|
+
for (var e = void 0, a = i.length - 1, l; a >= 0; a--)
|
|
8
|
+
(l = i[a]) && (e = l(o, d, e) || e);
|
|
9
|
+
return e && f(o, d, e), e;
|
|
10
|
+
};
|
|
11
|
+
class t extends c {
|
|
12
|
+
static get styles() {
|
|
13
|
+
return h(y.toString());
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
const o = this.componentClassNames("ed-c-text-link", {
|
|
17
|
+
"ed-c-text-link--inverted": this.inverted === !0,
|
|
18
|
+
"ed-c-text-link--display": this.variant === "display",
|
|
19
|
+
"ed-c-text-link--secondary": this.variant === "secondary",
|
|
20
|
+
"ed-c-text-link--sm": this.size === "sm"
|
|
21
|
+
});
|
|
22
|
+
return s`
|
|
23
|
+
<a href="${m(this.href)}" class="${o}">
|
|
24
|
+
<slot></slot>
|
|
25
|
+
${this.slotNotEmpty("linkAfter") && s`<div class="ed-c-text-link__after">
|
|
26
|
+
<slot name="linkAfter"></slot>
|
|
27
|
+
</div>`}
|
|
28
|
+
</a>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
n([
|
|
33
|
+
r()
|
|
34
|
+
], t.prototype, "href");
|
|
35
|
+
n([
|
|
36
|
+
r()
|
|
37
|
+
], t.prototype, "variant");
|
|
38
|
+
n([
|
|
39
|
+
r()
|
|
40
|
+
], t.prototype, "size");
|
|
41
|
+
n([
|
|
42
|
+
r({ type: Boolean })
|
|
43
|
+
], t.prototype, "inverted");
|
|
44
|
+
customElements.get("ed-text-link") === void 0 && customElements.define("ed-text-link", t);
|
|
45
|
+
export {
|
|
46
|
+
t as EdTextLink
|
|
47
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EdElement } from '@brad-frost-web/eddie-web-components/components/EdElement';
|
|
2
|
+
/**
|
|
3
|
+
* @slot - The text passage content
|
|
4
|
+
*/
|
|
5
|
+
export declare class EdTextPassage extends EdElement {
|
|
6
|
+
static get styles(): import('lit').CSSResult;
|
|
7
|
+
/**
|
|
8
|
+
* Inverted variant
|
|
9
|
+
* 1) Used for dark backgrounds
|
|
10
|
+
*/
|
|
11
|
+
inverted?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Size variant
|
|
14
|
+
* <ed-text-passage size="sm">
|
|
15
|
+
* <ul>
|
|
16
|
+
* <li> **xs** renders smaller typography than the `sm` variant</li>
|
|
17
|
+
* <li> **sm** renders smaller typography than the default</li>
|
|
18
|
+
* </ul>
|
|
19
|
+
* </ed-text-passage>
|
|
20
|
+
*/
|
|
21
|
+
size: 'xs' | 'sm';
|
|
22
|
+
/**
|
|
23
|
+
* Cap linelength
|
|
24
|
+
* 1) Applies linelength-container to the text passage
|
|
25
|
+
*/
|
|
26
|
+
capLinelength: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Add the light dom styles when this component is connected to a page
|
|
29
|
+
*/
|
|
30
|
+
connectedCallback(): void;
|
|
31
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
32
|
+
}
|
|
33
|
+
declare global {
|
|
34
|
+
interface HTMLElementTagNameMap {
|
|
35
|
+
'ed-text-passage': EdTextPassage;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=text-passage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-passage.d.ts","sourceRoot":"","sources":["../../../../packages/eddie-web-components/components/text-passage/text-passage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2DAA2D,CAAC;AAItF;;GAEG;AACH,qBAAa,aAAc,SAAQ,SAAS;IAC1C,MAAM,KAAK,MAAM,4BAEhB;IAED;;;OAGG;IAEH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;OAQG;IAEH,IAAI,EAAE,IAAI,GAAG,IAAI,CAAa;IAE9B;;;OAGG;IAEH,aAAa,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,iBAAiB;IAYjB,MAAM;CAuBP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
|