@lmvz-ds/components 0.30.0 → 0.31.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/CHANGELOG.md +8 -0
- package/cjs/{ds.constants-D3srqM9m.js → ds.constants-CKeXfK-s.js} +10 -0
- package/cjs/{component-C7cavwmZ.js → element.util-Cq4y-_iX.js} +42 -31
- package/cjs/index.cjs.js +7 -1
- package/cjs/{list-keyboard-controller-CzZdPBeH.js → list-keyboard-controller-StN6Yn8W.js} +13 -8
- package/cjs/lmvz-action-list.cjs.entry.js +79 -0
- package/cjs/lmvz-button-group.cjs.entry.js +43 -47
- package/cjs/lmvz-button_2.cjs.entry.js +10 -8
- package/cjs/lmvz-card.cjs.entry.js +2 -2
- package/cjs/lmvz-checkbox.cjs.entry.js +1 -1
- package/cjs/lmvz-chip.cjs.entry.js +2 -2
- package/cjs/lmvz-components.cjs.js +1 -1
- package/cjs/lmvz-header_2.cjs.entry.js +3 -3
- package/cjs/lmvz-input.cjs.entry.js +5 -5
- package/cjs/lmvz-link.cjs.entry.js +2 -2
- package/cjs/lmvz-menuitem.cjs.entry.js +1 -1
- package/cjs/lmvz-message.cjs.entry.js +1 -1
- package/cjs/lmvz-modal.cjs.entry.js +5 -5
- package/cjs/lmvz-radio.cjs.entry.js +1 -1
- package/cjs/lmvz-select.cjs.entry.js +1 -1
- package/cjs/lmvz-snackbar.cjs.entry.js +1 -1
- package/cjs/lmvz-spinner.cjs.entry.js +1 -1
- package/cjs/lmvz-tab.cjs.entry.js +2 -2
- package/cjs/lmvz-tabs.cjs.entry.js +4 -4
- package/cjs/lmvz-toggle.cjs.entry.js +3 -3
- package/cjs/loader.cjs.js +1 -1
- package/cjs/stencil.util-DzvzXSwk.js +25 -0
- package/collection/collection-manifest.json +1 -0
- package/collection/components/lmvz-action-list/lmvz-action-list.css +93 -0
- package/collection/components/lmvz-action-list/lmvz-action-list.js +104 -0
- package/collection/components/lmvz-button/lmvz-button.css +65 -45
- package/collection/components/lmvz-button/lmvz-button.js +28 -7
- package/collection/components/lmvz-button-group/lmvz-button-group.css +33 -2
- package/collection/components/lmvz-button-group/lmvz-button-group.js +54 -38
- package/collection/components/lmvz-card/lmvz-card.css +58 -45
- package/collection/components/lmvz-card/lmvz-card.js +2 -2
- package/collection/components/lmvz-checkbox/lmvz-checkbox.js +2 -2
- package/collection/components/lmvz-chip/lmvz-chip.js +7 -7
- package/collection/components/lmvz-header/lmvz-header.js +2 -2
- package/collection/components/lmvz-icon/lmvz-icon.js +2 -2
- package/collection/components/lmvz-input/lmvz-input.js +5 -5
- package/collection/components/lmvz-link/lmvz-link.js +3 -3
- package/collection/components/lmvz-menuitem/lmvz-menuitem.js +2 -2
- package/collection/components/lmvz-message/lmvz-message.js +1 -1
- package/collection/components/lmvz-modal/lmvz-modal.css +7 -0
- package/collection/components/lmvz-modal/lmvz-modal.js +3 -3
- package/collection/components/lmvz-radio/lmvz-radio.js +2 -2
- package/collection/components/lmvz-select/lmvz-select.js +2 -2
- package/collection/components/lmvz-snackbar/lmvz-snackbar.js +1 -1
- package/collection/components/lmvz-spinner/lmvz-spinner.js +1 -1
- package/collection/components/lmvz-tab/lmvz-tab.css +7 -0
- package/collection/components/lmvz-tab/lmvz-tab.js +1 -1
- package/collection/components/lmvz-tabs/lmvz-tabs.css +7 -0
- package/collection/components/lmvz-tabs/lmvz-tabs.js +2 -2
- package/collection/components/lmvz-toggle/lmvz-toggle.js +3 -3
- package/collection/index.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/collection/utils/aria/aria.constants.js +53 -0
- package/collection/utils/aria/list-keyboard-controller.js +12 -7
- package/collection/utils/async/async.util.js +62 -0
- package/collection/utils/data/event.utilt.js +19 -0
- package/collection/utils/data/number.util.js +6 -0
- package/collection/utils/data/object.util.js +20 -0
- package/collection/utils/data/time.util.js +3 -0
- package/collection/utils/element/element.util.js +117 -0
- package/collection/utils/{assets.js → stencil/assets.js} +1 -1
- package/collection/utils/stencil/stencil.util.js +12 -0
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.bak +2 -0
- package/components/index.js +1 -1
- package/components/lmvz-action-list.d.ts +11 -0
- package/components/lmvz-action-list.d.ts.bak +11 -0
- package/components/lmvz-action-list.js +1 -0
- package/components/lmvz-button-group.js +1 -1
- package/components/lmvz-button.js +1 -1
- package/components/lmvz-card.js +1 -1
- package/components/lmvz-checkbox.js +1 -1
- package/components/lmvz-chip.js +1 -1
- package/components/lmvz-header.js +1 -1
- package/components/lmvz-icon.js +1 -1
- package/components/lmvz-input.js +1 -1
- package/components/lmvz-link.js +1 -1
- package/components/lmvz-menuitem.js +1 -1
- package/components/lmvz-message.js +1 -1
- package/components/lmvz-modal.js +1 -1
- package/components/lmvz-radio.js +1 -1
- package/components/lmvz-select.js +1 -1
- package/components/lmvz-snackbar.js +1 -1
- package/components/lmvz-spinner.js +1 -1
- package/components/lmvz-tab.js +1 -1
- package/components/lmvz-tabs.js +1 -1
- package/components/lmvz-toggle.js +1 -1
- package/components/p-B0H9qIwE.js +1 -0
- package/components/p-B4m1n4et.js +1 -0
- package/components/p-CJRqhXjK.js +1 -0
- package/components/p-CxfT9IA1.js +1 -0
- package/components/{p-CXakymyP.js → p-DJ90327O.js} +1 -1
- package/components/p-DeO5Vbxh.js +1 -0
- package/components/p-DuEtnKRj.js +1 -0
- package/esm/{ds.constants-BLS5MjIu.js → ds.constants-DuEtnKRj.js} +5 -1
- package/esm/{component-DOTK1OW3.js → element.util-CxfT9IA1.js} +37 -31
- package/esm/index.js +1 -1
- package/esm/{list-keyboard-controller-Coi8XfUH.js → list-keyboard-controller-BKa9Kd2t.js} +12 -7
- package/esm/lmvz-action-list.entry.js +77 -0
- package/esm/lmvz-button-group.entry.js +35 -39
- package/esm/lmvz-button_2.entry.js +9 -7
- package/esm/lmvz-card.entry.js +2 -2
- package/esm/lmvz-checkbox.entry.js +1 -1
- package/esm/lmvz-chip.entry.js +2 -2
- package/esm/lmvz-components.js +1 -1
- package/esm/lmvz-header_2.entry.js +3 -3
- package/esm/lmvz-input.entry.js +4 -4
- package/esm/lmvz-link.entry.js +2 -2
- package/esm/lmvz-menuitem.entry.js +1 -1
- package/esm/lmvz-message.entry.js +1 -1
- package/esm/lmvz-modal.entry.js +3 -3
- package/esm/lmvz-radio.entry.js +1 -1
- package/esm/lmvz-select.entry.js +1 -1
- package/esm/lmvz-snackbar.entry.js +1 -1
- package/esm/lmvz-spinner.entry.js +1 -1
- package/esm/lmvz-tab.entry.js +2 -2
- package/esm/lmvz-tabs.entry.js +4 -4
- package/esm/lmvz-toggle.entry.js +2 -2
- package/esm/loader.js +1 -1
- package/esm/stencil.util-CJRqhXjK.js +23 -0
- package/hydrate/index.js +501 -388
- package/hydrate/index.mjs +501 -388
- package/lmvz-components/index.esm.js +1 -1
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-f3c44dd4.entry.js → p-1ce90ea7.entry.js} +1 -1
- package/lmvz-components/{p-b08db5ad.entry.js → p-24125bcf.entry.js} +1 -1
- package/lmvz-components/p-25a78ead.entry.js +1 -0
- package/lmvz-components/p-4072b2fb.entry.js +1 -0
- package/lmvz-components/p-48109e1d.entry.js +1 -0
- package/lmvz-components/{p-3b3e532f.entry.js → p-582f44ff.entry.js} +1 -1
- package/lmvz-components/p-592d509b.entry.js +1 -0
- package/lmvz-components/{p-d7e99f03.entry.js → p-6f61c24d.entry.js} +1 -1
- package/lmvz-components/{p-58498d43.entry.js → p-703b10b5.entry.js} +1 -1
- package/lmvz-components/p-74c7521c.entry.js +1 -0
- package/lmvz-components/{p-b5254532.entry.js → p-80a26307.entry.js} +1 -1
- package/lmvz-components/{p-c60ab9c9.entry.js → p-8e1f66dd.entry.js} +1 -1
- package/lmvz-components/p-947e1fe6.entry.js +1 -0
- package/lmvz-components/p-B4m1n4et.js +1 -0
- package/lmvz-components/p-CJRqhXjK.js +1 -0
- package/lmvz-components/p-CxfT9IA1.js +1 -0
- package/lmvz-components/p-DuEtnKRj.js +1 -0
- package/lmvz-components/{p-230962c8.entry.js → p-b79af711.entry.js} +1 -1
- package/lmvz-components/p-c00f0d96.entry.js +1 -0
- package/lmvz-components/{p-5c951888.entry.js → p-c0d05a97.entry.js} +1 -1
- package/lmvz-components/{p-c0b1d0af.entry.js → p-c3e8092e.entry.js} +1 -1
- package/lmvz-components/{p-2ca85b7c.entry.js → p-ed3c2b13.entry.js} +1 -1
- package/lmvz-components/{p-35da6bfb.entry.js → p-fa2cd315.entry.js} +1 -1
- package/manifest.json +130 -18
- package/package.json +5 -1
- package/types/api/ds.constants.d.ts +0 -40
- package/types/api/ds.types.d.ts +68 -1
- package/types/components/lmvz-action-list/lmvz-action-list.d.ts +15 -0
- package/types/components/lmvz-button/lmvz-button.d.ts +6 -3
- package/types/components/lmvz-button-group/lmvz-button-group.d.ts +2 -0
- package/types/components/lmvz-checkbox/lmvz-checkbox.d.ts +1 -1
- package/types/components/lmvz-chip/lmvz-chip.d.ts +2 -2
- package/types/components/lmvz-header/lmvz-header.d.ts +1 -1
- package/types/components/lmvz-icon/lmvz-icon.d.ts +1 -1
- package/types/components/lmvz-input/lmvz-input.d.ts +1 -1
- package/types/components/lmvz-link/lmvz-link.d.ts +1 -1
- package/types/components/lmvz-menuitem/lmvz-menuitem.d.ts +1 -1
- package/types/components/lmvz-modal/lmvz-modal.d.ts +1 -1
- package/types/components/lmvz-radio/lmvz-radio.d.ts +1 -1
- package/types/components/lmvz-select/lmvz-select.d.ts +1 -1
- package/types/components/lmvz-tabs/lmvz-tabs.d.ts +1 -1
- package/types/components/lmvz-toggle/lmvz-toggle.d.ts +1 -1
- package/types/components.d.ts +83 -2
- package/types/index.d.ts +1 -1
- package/types/utils/aria/aria-validation-controller.d.ts +3 -3
- package/types/utils/aria/aria.constants.d.ts +1 -0
- package/types/utils/aria/element-activation-controller.d.ts +1 -1
- package/types/utils/aria/list-keyboard-controller.d.ts +4 -1
- package/types/utils/async/async.util.d.ts +8 -0
- package/types/utils/data/event.utilt.d.ts +4 -0
- package/types/utils/data/number.util.d.ts +2 -0
- package/types/utils/data/object.util.d.ts +5 -0
- package/types/utils/data/time.util.d.ts +1 -0
- package/types/utils/element/element.util.d.ts +21 -0
- package/types/utils/radio/radio-group-controller.d.ts +1 -1
- package/types/utils/{reactive-controller-host.d.ts → stencil/reactive-controller-host.d.ts} +1 -1
- package/types/utils/stencil/stencil.util.d.ts +6 -0
- package/collection/utils/component.js +0 -270
- package/collection/utils/http.js +0 -21
- package/collection/utils/http.unit.js +0 -47
- package/components/p-BLS5MjIu.js +0 -1
- package/components/p-C0f2nNPZ.js +0 -1
- package/components/p-CtaMrBNE.js +0 -1
- package/components/p-DGlgVBPj.js +0 -1
- package/components/p-DOTK1OW3.js +0 -1
- package/lmvz-components/p-0d435e7b.entry.js +0 -1
- package/lmvz-components/p-44fea470.entry.js +0 -1
- package/lmvz-components/p-4dc44520.entry.js +0 -1
- package/lmvz-components/p-BLS5MjIu.js +0 -1
- package/lmvz-components/p-CtaMrBNE.js +0 -1
- package/lmvz-components/p-DOTK1OW3.js +0 -1
- package/lmvz-components/p-a4077c9f.entry.js +0 -1
- package/lmvz-components/p-dce6e41d.entry.js +0 -1
- package/lmvz-components/p-e3ce44a3.entry.js +0 -1
- package/types/utils/component.d.ts +0 -33
- package/types/utils/http.d.ts +0 -26
- package/types/utils/http.unit.d.ts +0 -1
- /package/collection/utils/{reactive-controller-host.js → stencil/reactive-controller-host.js} +0 -0
- /package/types/utils/{assets.d.ts → stencil/assets.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as i,h as e,d as o,t as n}from"./p-DGg7OzDl.js";import{t,e as s,p as c}from"./p-CcxjkCOx.js";import{A as r}from"./p-C8znmF2h.js";import{R as a}from"./p-DAMVH-31.js";const l=Symbol.for("LMVZ__iconProviderRegistry"),m={};function v(){return"undefined"==typeof window?m:window[l]??(window[l]={})}function h(i,e){const o=v(),n=i;Object.prototype.hasOwnProperty.call(o,n)&&console.warn(`Icon provider with name "${n}" is already registered. Overwriting existing provider.`),o[n]=e}function d(i){const e=v();if(i)return e[i];const o=Object.keys(e);if(0===o.length)return;o.length>1&&console.warn(`Multiple icon providers registered (${o.join(", ")}). Using the first one: "${o[0]}".`);const n=o[0];return n?e[n]:void 0}function z(i,e){return{iconset:i,icon:e}}const p=i(class extends a{intersectionObserver;ariaValidationController=new r(this);get el(){return this}validationEl;icon;weight="medium";size="md";iconset;iconData;visible=!1;ariaLabel;get ariaHidden(){return!this.ariaLabel}constructor(i){super(!1),!1!==i&&this.__registerHost(),this.addController(this.ariaValidationController)}connectedCallback(){this.waitUntilVisible((()=>{this.visible=!0,this.loadIconPathData()})),super.connectedCallback()}disconnectedCallback(){this.intersectionObserver&&"function"==typeof this.intersectionObserver.disconnect&&this.intersectionObserver.disconnect(),this.intersectionObserver=void 0,super.disconnectedCallback()}async loadIconPathData(){const{icon:i,iconset:e,visible:o}=this;if(!i||!o)return;const n=c(i);this.iconData=n||await async function(i){const{icon:e,iconset:o}=i;return await(async()=>{const i=d(o);if(i)try{const n=await Promise.resolve(i.resolve(e));if(!n?.svg)return void console.warn(`Icon "${e}"${o?` from set "${o}"`:""} not found in provider. Using default icon.`);const s=t(n.svg);if(s)return s}catch(i){return void console.error(`Error resolving icon "${e}" with provider:`,i)}else console.warn(`No icon provider registered. Unable to resolve icon "${e}"${o?` from set "${o}"`:""}. Using default icon.`)})()||(console.error(`Icon "${e}" not found${o?` in set "${o}"`:""}. Using default icon.`),s())}({icon:i,iconset:e})}componentDidRender(){this.validationEl=this.el.querySelector("svg"),this.ariaValidationController.revalidateAria(),super.componentDidRender()}render(){return e(o,{key:"
|
|
1
|
+
import{p as i,h as e,d as o,t as n}from"./p-DGg7OzDl.js";import{t,e as s,p as c}from"./p-CcxjkCOx.js";import{A as r}from"./p-C8znmF2h.js";import{R as a}from"./p-DAMVH-31.js";const l=Symbol.for("LMVZ__iconProviderRegistry"),m={};function v(){return"undefined"==typeof window?m:window[l]??(window[l]={})}function h(i,e){const o=v(),n=i;Object.prototype.hasOwnProperty.call(o,n)&&console.warn(`Icon provider with name "${n}" is already registered. Overwriting existing provider.`),o[n]=e}function d(i){const e=v();if(i)return e[i];const o=Object.keys(e);if(0===o.length)return;o.length>1&&console.warn(`Multiple icon providers registered (${o.join(", ")}). Using the first one: "${o[0]}".`);const n=o[0];return n?e[n]:void 0}function z(i,e){return{iconset:i,icon:e}}const p=i(class extends a{intersectionObserver;ariaValidationController=new r(this);get el(){return this}validationEl;icon;weight="medium";size="md";iconset;iconData;visible=!1;ariaLabel;get ariaHidden(){return!this.ariaLabel}constructor(i){super(!1),!1!==i&&this.__registerHost(),this.addController(this.ariaValidationController)}connectedCallback(){this.waitUntilVisible((()=>{this.visible=!0,this.loadIconPathData()})),super.connectedCallback()}disconnectedCallback(){this.intersectionObserver&&"function"==typeof this.intersectionObserver.disconnect&&this.intersectionObserver.disconnect(),this.intersectionObserver=void 0,super.disconnectedCallback()}async loadIconPathData(){const{icon:i,iconset:e,visible:o}=this;if(!i||!o)return;const n=c(i);this.iconData=n||await async function(i){const{icon:e,iconset:o}=i;return await(async()=>{const i=d(o);if(i)try{const n=await Promise.resolve(i.resolve(e));if(!n?.svg)return void console.warn(`Icon "${e}"${o?` from set "${o}"`:""} not found in provider. Using default icon.`);const s=t(n.svg);if(s)return s}catch(i){return void console.error(`Error resolving icon "${e}" with provider:`,i)}else console.warn(`No icon provider registered. Unable to resolve icon "${e}"${o?` from set "${o}"`:""}. Using default icon.`)})()||(console.error(`Icon "${e}" not found${o?` in set "${o}"`:""}. Using default icon.`),s())}({icon:i,iconset:e})}componentDidRender(){this.validationEl=this.el.querySelector("svg"),this.ariaValidationController.revalidateAria(),super.componentDidRender()}render(){return e(o,{key:"4fba217d573d968951819f12af24d775c8ac62dc",role:"img","aria-hidden":`${this.ariaHidden}`,innerHTML:this.iconData})}waitUntilVisible(i,e=50){"undefined"!=typeof window&&window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver((e=>{e.some((e=>!!e.isIntersecting&&(this.intersectionObserver&&"function"==typeof this.intersectionObserver.disconnect&&this.intersectionObserver.disconnect(),this.intersectionObserver=void 0,i(),!0)))}),{rootMargin:`${e}px`}),this.intersectionObserver.observe(this.el)):i()}static get watchers(){return{icon:[{loadIconPathData:0}],iconset:[{loadIconPathData:0}]}}static get style(){return".sc-lmvz-icon-h{--lmvz-icon-color:var(--lmvz-component-color, var(--lmvz-semantic-color-on-surface-input-primary, #000000));--lmvz-icon-size:var(--lmvz-component-size, var(--lmvz-component-icon-size-md, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)));display:inline-block;line-height:0;svg{display:block;height:var(--lmvz-icon-size);width:auto}svg path{stroke:var(--lmvz-icon-color);fill:none}}[size='xs'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-xs, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))}}[size='sm'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-sm, clamp(0.88rem, 0.84rem + 0.13vw, 1rem))}}[size='md'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-md, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))}}[size='lg'].sc-lmvz-icon-h{svg{--lmvz-icon-size:var(--lmvz-component-icon-size-lg, clamp(1.5rem, 1.44rem + 0.26vw, 1.75rem))}}[size='inherit'].sc-lmvz-icon-h{svg{height:var(--lmvz-component-size, inherit)}}[weight='light'].sc-lmvz-icon-h{svg path{stroke-width:1}}[weight='medium'].sc-lmvz-icon-h{svg path{stroke-width:1.5}}[weight='bold'].sc-lmvz-icon-h{svg path{stroke-width:2}}[weight='filled'].sc-lmvz-icon-h{svg path{stroke-width:2;fill:var(--lmvz-icon-color)}}"}},[514,"lmvz-icon",{icon:[513],weight:[513],size:[513],iconset:[513],ariaLabel:[513,"aria-label"],iconData:[32],visible:[32]},void 0,{icon:[{loadIconPathData:0}],iconset:[{loadIconPathData:0}]}]);function u(){"undefined"!=typeof customElements&&["lmvz-icon"].forEach((i=>{"lmvz-icon"===i&&(customElements.get(n(i))||customElements.define(n(i),p))}))}export{p as L,u as d,d as g,h as r,z as t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t,H as e,h as s,d as i,t as n}from"./p-DGg7OzDl.js";import{a,i as o}from"./p-CdDO7mQa.js";import{v as r}from"./p-DuEtnKRj.js";import{a as c,b as d,c as h,d as l,e as u,f as m,h as f}from"./p-CxfT9IA1.js";const p=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}get el(){return this}actionsSlot;validationMessageCache=[];actionsStateObserver;stacked=!1;get primaryEnabledAction(){return this.enabledButtons.find(c)??this.enabledButtons[0]}get hasActions(){return this.assignedButtons.some((t=>d(t)&&h(t)&&!l(t)))}componentDidLoad(){this.handleActionsSlotChange()}disconnectedCallback(){this.actionsStateObserver?.disconnect()}get assignedElements(){return this.actionsSlot?.assignedElements({flatten:!0})??[]}get assignedButtons(){return this.assignedElements.filter(h)}get visibleButtons(){return this.assignedButtons.filter(d)}get enabledButtons(){return this.visibleButtons.filter((t=l,(...e)=>{const s=t(...e);return a(s)?s.then((t=>!t)):!s}));var t}getActionValidationResult(){if(!this.visibleButtons.length)return[];const t=this.visibleButtons.filter(c),e=this.visibleButtons.filter(u),s=[],i=this.visibleButtons;if(1!==t.length&&s.push("LmvzButtonGroup actions slot should contain exactly one primary action."),e.length>1&&s.push(`LmvzButtonGroup actions slot should contain at most one secondary action (received ${e.length})`),t.length){const n=e[0];0!==i.indexOf(t[0])&&s.push("Primary action should be the first focusable element in the actions slot (i.e. first child of the actions slot)."),n&&1!==i.indexOf(n)&&s.push("Secondary action should be the second focusable element in the actions slot (i.e. immediately after the primary button).")}else e.length&&0!==i.indexOf(e[0])&&s.push("Secondary action should be the first focusable element in the actions slot when no primary action is present (i.e. first child of the actions slot).");return s}handleActionsSlotChange=()=>{this.observeActionState(),this.syncActionsState()};observeActionState(){"undefined"!=typeof MutationObserver&&(this.actionsStateObserver?.disconnect(),this.assignedButtons.length&&(this.actionsStateObserver=new MutationObserver((()=>{this.syncActionsState()})),this.assignedButtons.forEach((t=>{this.actionsStateObserver?.observe(t,{attributes:!0,attributeFilter:["disabled","hidden","variant"]})}))))}syncActionsState(){this.assignedElements.forEach((t=>{["LMVZ-BUTTON","BUTTON"].includes(t.tagName.toUpperCase())||(t.hasAttribute("hidden")||t.setAttribute("hidden",""),"true"!==t.getAttribute("aria-hidden")&&t.setAttribute("aria-hidden","true"))})),this.checkActions();const t=this.visibleButtons,e=t.length>0&&t.some((t=>c(t)||u(t)));t.length>0&&!e?this.el.setAttribute("data-only-tertiary",""):this.el.removeAttribute("data-only-tertiary"),this.visibleButtons.forEach(((t,e)=>{const s=r[e]??"tertiary";t&&(m(t)?t.getAttribute("variant")||t.variant||t.setAttribute("variant",s):t.classList.add(s))}));const s=this.visibleButtons.find((t=>"tertiary"===t.getAttribute("variant")));this.visibleButtons.forEach((t=>{t===s?t.setAttribute("data-first-tertiary",""):t.removeAttribute("data-first-tertiary")})),this.focusPrimaryAction()}focusPrimaryAction(){const t=this.primaryEnabledAction;t&&"undefined"!=typeof window&&window.requestAnimationFrame((()=>{f(t)&&t.focus()}))}checkActions(){if(!o())return;const t=this.getActionValidationResult();t.length&&t.forEach((t=>{this.validationMessageCache.includes(t)||(console.warn(t),this.validationMessageCache.push(t))}))}render(){return s(i,{key:"3e8ce38f7e83e201e47d31579f22161ff36247b1"},s("slot",{key:"bc953d19b333f51c5f5c5ba86be3a85d155a29d1",ref:t=>this.actionsSlot=t,onSlotchange:this.handleActionsSlotChange}))}static get style(){return":host{display:flex;flex-flow:row-reverse wrap;gap:var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));font:var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router);}:host([stacked]){flex-flow:column nowrap;align-items:stretch;padding:0}:host([stacked]) ::slotted(*){display:block;width:100%}::slotted([hidden]){display:none !important}:host(:not([data-only-tertiary],[stacked])) ::slotted([data-first-tertiary]){margin-inline-end:auto}:host([data-only-tertiary]:not([stacked])){justify-content:flex-end}"}},[769,"lmvz-button-group",{stacked:[516],primaryEnabledAction:[2064],hasActions:[2052,"has-actions"]}]);function y(){"undefined"!=typeof customElements&&["lmvz-button-group"].forEach((t=>{"lmvz-button-group"===t&&(customElements.get(n(t))||customElements.define(n(t),p))}))}export{p as L,y as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a=["primary","secondary","tertiary"],s=["small","default","large"],e=["xs","sm","md","lg"],r=[...e,"xl"],l=["text","email","password","tel","url","search","number"],n=["sm","md","lg"],t=s,i=[...e,"inherit"],m=["thin","medium","bold"],o=["active","warning","success","error","neutral"],d=["default","small"],u=["internal","external"],c=["neutral","warning"],g=["success","warning","error"],w=["low","normal","high"],h=["timeout","manual","action","overridden","swallowed"];export{e as a,n as b,t as c,i as d,m as e,o as f,d as g,g as h,l as i,w as j,h as k,u as l,c as m,s,r as t,a as v}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const variants = ['primary', 'secondary', 'tertiary'];
|
|
1
2
|
const scaleValues = ['small', 'default', 'large'];
|
|
2
3
|
const sizes = ['xs', 'sm', 'md', 'lg'];
|
|
3
4
|
const textSizes = [...sizes, 'xl'];
|
|
@@ -10,5 +11,8 @@ const chipTypes = ['active', 'warning', 'success', 'error', 'neutral'];
|
|
|
10
11
|
const chipSizes = ['default', 'small'];
|
|
11
12
|
const linkTypes = ['internal', 'external'];
|
|
12
13
|
const messageTypes = ['neutral', 'warning'];
|
|
14
|
+
const snackbarStatuses = ['success', 'warning', 'error'];
|
|
15
|
+
const snackbarPriorities = ['low', 'normal', 'high'];
|
|
16
|
+
const snackbarDismissReasons = ['timeout', 'manual', 'action', 'overridden', 'swallowed'];
|
|
13
17
|
|
|
14
|
-
export {
|
|
18
|
+
export { sizes as a, inputSizes as b, selectSizes as c, iconSizes as d, iconWeights as e, chipTypes as f, chipSizes as g, snackbarStatuses as h, inputTypes as i, snackbarPriorities as j, snackbarDismissReasons as k, linkTypes as l, messageTypes as m, scaleValues as s, textSizes as t, variants as v };
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
const componentOnReady = (el, callback) => {
|
|
2
|
-
if (el.componentOnReady) {
|
|
3
|
-
el.componentOnReady().then((resolvedEl) => callback(resolvedEl));
|
|
4
|
-
}
|
|
5
|
-
else {
|
|
6
|
-
raf(() => callback(el));
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
const inheritAttributes = (el, attributes = []) => {
|
|
10
|
-
const attributeObject = {};
|
|
11
|
-
attributes.forEach((attr) => {
|
|
12
|
-
if (el.hasAttribute(attr)) {
|
|
13
|
-
const value = el.getAttribute(attr);
|
|
14
|
-
if (value !== null) {
|
|
15
|
-
attributeObject[attr] = el.getAttribute(attr);
|
|
16
|
-
}
|
|
17
|
-
el.removeAttribute(attr);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
return attributeObject;
|
|
21
|
-
};
|
|
22
1
|
const ariaAttributes = [
|
|
23
2
|
'role',
|
|
24
3
|
'aria-activedescendant',
|
|
@@ -72,6 +51,42 @@ const ariaAttributes = [
|
|
|
72
51
|
'aria-valuenow',
|
|
73
52
|
'aria-valuetext',
|
|
74
53
|
];
|
|
54
|
+
|
|
55
|
+
function isActionButton(element) {
|
|
56
|
+
return ['LMVZ-BUTTON', 'BUTTON'].includes(element.tagName.toUpperCase());
|
|
57
|
+
}
|
|
58
|
+
function isLmvzButton(element) {
|
|
59
|
+
return element?.tagName.toUpperCase() === 'LMVZ-BUTTON';
|
|
60
|
+
}
|
|
61
|
+
function isDisabledButton(element) {
|
|
62
|
+
return element.hasAttribute('disabled') || element.disabled === true;
|
|
63
|
+
}
|
|
64
|
+
function isVisible(element) {
|
|
65
|
+
return !element.hasAttribute('hidden');
|
|
66
|
+
}
|
|
67
|
+
function getActionVariant(element) {
|
|
68
|
+
const variant = element.getAttribute('variant') ?? element.variant;
|
|
69
|
+
return variant === 'primary' || variant === 'secondary' || variant === 'tertiary' ? variant : 'secondary';
|
|
70
|
+
}
|
|
71
|
+
function isPrimaryAction(element) {
|
|
72
|
+
return getActionVariant(element) === 'primary';
|
|
73
|
+
}
|
|
74
|
+
function isSecondaryAction(element) {
|
|
75
|
+
return getActionVariant(element) === 'secondary';
|
|
76
|
+
}
|
|
77
|
+
const inheritAttributes = (el, attributes = []) => {
|
|
78
|
+
const attributeObject = {};
|
|
79
|
+
attributes.forEach((attr) => {
|
|
80
|
+
if (el.hasAttribute(attr)) {
|
|
81
|
+
const value = el.getAttribute(attr);
|
|
82
|
+
if (value !== null) {
|
|
83
|
+
attributeObject[attr] = el.getAttribute(attr);
|
|
84
|
+
}
|
|
85
|
+
el.removeAttribute(attr);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return attributeObject;
|
|
89
|
+
};
|
|
75
90
|
const inheritAriaAttributes = (el, ignoreList) => {
|
|
76
91
|
let attributesToInherit = ariaAttributes;
|
|
77
92
|
if (ignoreList && ignoreList.length > 0) {
|
|
@@ -79,15 +94,6 @@ const inheritAriaAttributes = (el, ignoreList) => {
|
|
|
79
94
|
}
|
|
80
95
|
return inheritAttributes(el, attributesToInherit);
|
|
81
96
|
};
|
|
82
|
-
const raf = (h) => {
|
|
83
|
-
if (typeof __zone_symbol__requestAnimationFrame === 'function') {
|
|
84
|
-
return __zone_symbol__requestAnimationFrame(h);
|
|
85
|
-
}
|
|
86
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
87
|
-
return requestAnimationFrame(h);
|
|
88
|
-
}
|
|
89
|
-
return setTimeout(h);
|
|
90
|
-
};
|
|
91
97
|
function getDeepActiveElement(root = document) {
|
|
92
98
|
let activeElement = root.activeElement;
|
|
93
99
|
if (!activeElement) {
|
|
@@ -134,4 +140,4 @@ function findFormByRef(form, el) {
|
|
|
134
140
|
return el.closest('form');
|
|
135
141
|
}
|
|
136
142
|
|
|
137
|
-
export {
|
|
143
|
+
export { isPrimaryAction as a, isVisible as b, isActionButton as c, isDisabledButton as d, isSecondaryAction as e, isLmvzButton as f, getDeepActiveElement as g, canReceiveFocus as h, inheritAriaAttributes as i, findFormByRef as j };
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { A as ARIA_VALIDATION_RUNTIME_CHANGED_EVENT, d as disableAriaValidation, e as enableAriaValidation, i as isAriaValidationEnabled, q as queueValidation, u as useVerboseLogging } from './aria-loader-GfsGHZHY.js';
|
|
2
|
-
export {
|
|
2
|
+
export { g as chipSizes, f as chipTypes, d as iconSizes, e as iconWeights, b as inputSizes, i as inputTypes, l as linkTypes, m as messageTypes, s as scaleValues, c as selectSizes, a as sizes, k as snackbarDismissReasons, j as snackbarPriorities, h as snackbarStatuses, t as textSizes, v as variants } from './ds.constants-DuEtnKRj.js';
|
|
3
3
|
export { g as getRegisteredIconProvider, r as registerIconProvider, t as typedIconFromSet } from './icons-CmuFKDRz.js';
|
|
4
4
|
import './svg-B2YoIRuh.js';
|
|
5
5
|
import './logger-CGmJG63p.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDeepActiveElement } from './
|
|
1
|
+
import { g as getDeepActiveElement } from './element.util-CxfT9IA1.js';
|
|
2
2
|
|
|
3
3
|
const defaultConfig = {
|
|
4
4
|
orientation: 'both',
|
|
@@ -72,8 +72,10 @@ class DirectionalFocusController {
|
|
|
72
72
|
}
|
|
73
73
|
getManagedActiveElement() {
|
|
74
74
|
const activeElement = getDeepActiveElement(this.host.el.ownerDocument ?? document);
|
|
75
|
-
if (activeElement instanceof HTMLElement
|
|
76
|
-
|
|
75
|
+
if (activeElement instanceof HTMLElement) {
|
|
76
|
+
const match = this.elements.find((el) => resolveElement(el) === activeElement);
|
|
77
|
+
if (match && this.canMoveFocusTo(match))
|
|
78
|
+
return match;
|
|
77
79
|
}
|
|
78
80
|
if (this.currentElement && this.elements.includes(this.currentElement) && this.canMoveFocusTo(this.currentElement)) {
|
|
79
81
|
return this.currentElement;
|
|
@@ -161,11 +163,14 @@ class DirectionalFocusController {
|
|
|
161
163
|
if (this.config.isFocusableElement)
|
|
162
164
|
return this.config.isFocusableElement(element);
|
|
163
165
|
const isTabOrderable = this.config.manageTabIndex || element.tabIndex >= 0;
|
|
164
|
-
return
|
|
165
|
-
element.getAttribute('aria-hidden') !== 'true' &&
|
|
166
|
-
(element.checkVisibility?.() ?? true) &&
|
|
167
|
-
element.offsetParent !== null);
|
|
166
|
+
return isTabOrderable && element.getAttribute('aria-hidden') !== 'true' && (element.checkVisibility?.() ?? true) && element.offsetParent !== null;
|
|
168
167
|
}
|
|
169
168
|
}
|
|
169
|
+
function isDirectionalFocusReceiver(el) {
|
|
170
|
+
return typeof el.resolveFocusableElement === 'function';
|
|
171
|
+
}
|
|
172
|
+
function resolveElement(el) {
|
|
173
|
+
return isDirectionalFocusReceiver(el) ? (el.resolveFocusableElement() ?? el) : el;
|
|
174
|
+
}
|
|
170
175
|
|
|
171
176
|
export { DirectionalFocusController as D };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { g as getElement, r as registerInstance, h, H as Host } from './index-BPeerEwm.js';
|
|
2
|
+
import { A as AriaValidationController } from './aria-validation-controller-BnyUKeJ6.js';
|
|
3
|
+
import { D as DirectionalFocusController } from './list-keyboard-controller-BKa9Kd2t.js';
|
|
4
|
+
import { R as ReactiveControllerHost } from './reactive-controller-host-FBuCCcFC.js';
|
|
5
|
+
import './aria-loader-GfsGHZHY.js';
|
|
6
|
+
import './element.util-CxfT9IA1.js';
|
|
7
|
+
|
|
8
|
+
const lmvzActionListCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } hr { height: 0; border: none; margin: var(--lmvz-dimension-4-8, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0; border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0); } } @layer lmvz-ds.components { .lmvz-wrapper-card-sm, .lmvz-wrapper-card-md, .lmvz-wrapper-card-lg { background: var(--lmvz-semantic-color-surface-primary, #ffffff); box-shadow: var(--lmvz-ds-shadow-l3-default-strong, 0 2px 32px 0 rgba(120, 120, 128, 0.11)); } .lmvz-wrapper-card-sm { padding: var(--lmvz-component-wrapper-sm-padding-y, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)) var(--lmvz-component-wrapper-sm-padding-x, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); border-radius: var(--lmvz-component-wrapper-sm-border-radius, 14px); } .lmvz-wrapper-card-md { padding: var(--lmvz-component-wrapper-md-padding-y, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)) var(--lmvz-component-wrapper-md-padding-x, clamp(1rem, 0.88rem + 0.52vw, 1.5rem)); border-radius: var(--lmvz-component-wrapper-md-border-radius, 18px); } .lmvz-wrapper-card-lg { padding: var(--lmvz-component-wrapper-lg-padding-y, clamp(2.25rem, 2.19rem + 0.26vw, 2.5rem)) var(--lmvz-component-wrapper-lg-padding-x, clamp(1.5rem, 1.14rem + 1.55vw, 3rem)); border-radius: var(--lmvz-component-wrapper-lg-border-radius, 18px); } } .sc-lmvz-action-list-h { display: flex; flex-direction: column; gap: 0; lmvz-button, button { --lmvz-button-background-override: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color-override: var(--lmvz-semantic-color-int-on-tertiary, #000000); --lmvz-button-radius-override: var(--lmvz-semantic-border-radius-md, 6px); --lmvz-button-padding-inline-override: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); --lmvz-button-padding-block-override: var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)); width: 100%; display: block; &:hover { --lmvz-button-background-override: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); --lmvz-button-color-override: var(--lmvz-semantic-color-int-on-tertiary-hover, #000000); } &:active { --lmvz-button-background-override: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); --lmvz-button-color-override: var(--lmvz-semantic-color-int-on-tertiary-active, #000000); } } .lmvz-action-list-item--danger { --lmvz-button-color-override: var(--lmvz-semantic-color-status-on-danger, #e52a31); &:hover { --lmvz-button-background-override: var(--lmvz-semantic-color-status-danger, #fdf1f2); --lmvz-button-color-override: var(--lmvz-semantic-color-status-on-danger, #e52a31); } &:active { --lmvz-button-background-override: var(--lmvz-semantic-color-status-on-danger-subtle, #f7bfc2); --lmvz-button-color-override: var(--lmvz-semantic-color-status-on-danger, #e52a31); } } }`;
|
|
9
|
+
|
|
10
|
+
const LmvzActionList = class extends ReactiveControllerHost {
|
|
11
|
+
get el() { return getElement(this); }
|
|
12
|
+
slotEl;
|
|
13
|
+
get validationEl() {
|
|
14
|
+
return this.el;
|
|
15
|
+
}
|
|
16
|
+
get validationSlot() {
|
|
17
|
+
return this.slotEl;
|
|
18
|
+
}
|
|
19
|
+
focusController = new DirectionalFocusController(this, {
|
|
20
|
+
orientation: 'vertical',
|
|
21
|
+
manageTabIndex: true,
|
|
22
|
+
enableHomeAndEnd: true,
|
|
23
|
+
});
|
|
24
|
+
label;
|
|
25
|
+
constructor(hostRef) {
|
|
26
|
+
super();
|
|
27
|
+
registerInstance(this, hostRef);
|
|
28
|
+
this.addController(this.focusController);
|
|
29
|
+
this.addController(new AriaValidationController(this, {
|
|
30
|
+
validationTiming: 'slot',
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
componentDidLoad() {
|
|
34
|
+
this.handleSlotChange();
|
|
35
|
+
super.componentDidLoad();
|
|
36
|
+
}
|
|
37
|
+
handleSlotChange = () => {
|
|
38
|
+
const slot = this.slotEl;
|
|
39
|
+
if (!slot)
|
|
40
|
+
return;
|
|
41
|
+
const assigned = slot.assignedElements();
|
|
42
|
+
const interactive = [];
|
|
43
|
+
for (const el of assigned) {
|
|
44
|
+
collectInteractiveButtonsRecursively(el, interactive);
|
|
45
|
+
}
|
|
46
|
+
this.focusController.updateElements(interactive);
|
|
47
|
+
};
|
|
48
|
+
render() {
|
|
49
|
+
const ariaLabel = this.label || undefined;
|
|
50
|
+
return (h(Host, { key: '79e2d77c9aca02fb3ef2e58d241664598253334b', role: "menu", "aria-label": ariaLabel, class: "lmvz-wrapper-card-sm" }, h("slot", { key: '941b875a5be536c3d0e2ff9287da5af1a416d356', onSlotchange: this.handleSlotChange, ref: (el) => (this.slotEl = el) })));
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
function collectInteractiveButtonsRecursively(el, collection) {
|
|
54
|
+
const tag = el.tagName.toLowerCase();
|
|
55
|
+
if (tag === 'lmvz-button') {
|
|
56
|
+
el.buttonRole = 'menuitem';
|
|
57
|
+
collection.push(el);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (tag === 'button') {
|
|
61
|
+
el.setAttribute('role', 'menuitem');
|
|
62
|
+
collection.push(el);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (tag === 'hr') {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (el.getAttribute('role') === 'group') {
|
|
69
|
+
const children = el.querySelectorAll('lmvz-button, button');
|
|
70
|
+
children.forEach((child) => collectInteractiveButtonsRecursively(child, collection));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
console.warn('Unexpected element encountered in ActionList:', tag);
|
|
74
|
+
}
|
|
75
|
+
LmvzActionList.style = lmvzActionListCss();
|
|
76
|
+
|
|
77
|
+
export { LmvzActionList as lmvz_action_list };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-BPeerEwm.js';
|
|
1
|
+
import { r as registerInstance, g as getElement, h, H as Host } from './index-BPeerEwm.js';
|
|
2
2
|
import { a as isPromise, i as isAriaValidationEnabled } from './aria-loader-GfsGHZHY.js';
|
|
3
|
-
import {
|
|
3
|
+
import { v as variants } from './ds.constants-DuEtnKRj.js';
|
|
4
|
+
import { a as isPrimaryAction, b as isVisible, c as isActionButton, d as isDisabledButton, e as isSecondaryAction, f as isLmvzButton, h as canReceiveFocus } from './element.util-CxfT9IA1.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Returns a function that delegates to the given predicate/filter and negates its result.
|
|
@@ -16,15 +17,17 @@ function negate(delegate) {
|
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
const lmvzButtonGroupCss = () => `:host{display:flex;
|
|
20
|
+
const lmvzButtonGroupCss = () => `:host{display:flex;flex-flow:row-reverse wrap;gap:var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));font:var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router);}:host([stacked]){flex-flow:column nowrap;align-items:stretch;padding:0}:host([stacked]) ::slotted(*){display:block;width:100%}::slotted([hidden]){display:none !important}:host(:not([data-only-tertiary],[stacked])) ::slotted([data-first-tertiary]){margin-inline-end:auto}:host([data-only-tertiary]:not([stacked])){justify-content:flex-end}`;
|
|
20
21
|
|
|
21
22
|
const LmvzButtonGroup = class {
|
|
22
23
|
constructor(hostRef) {
|
|
23
24
|
registerInstance(this, hostRef);
|
|
24
25
|
}
|
|
26
|
+
get el() { return getElement(this); }
|
|
25
27
|
actionsSlot;
|
|
26
28
|
validationMessageCache = [];
|
|
27
29
|
actionsStateObserver;
|
|
30
|
+
stacked = false;
|
|
28
31
|
get primaryEnabledAction() {
|
|
29
32
|
return this.enabledButtons.find(isPrimaryAction) ?? this.enabledButtons[0];
|
|
30
33
|
}
|
|
@@ -56,23 +59,23 @@ const LmvzButtonGroup = class {
|
|
|
56
59
|
const primaryActions = this.visibleButtons.filter(isPrimaryAction);
|
|
57
60
|
const secondaryActions = this.visibleButtons.filter(isSecondaryAction);
|
|
58
61
|
const issues = [];
|
|
59
|
-
const order = this.visibleButtons
|
|
62
|
+
const order = this.visibleButtons;
|
|
60
63
|
if (primaryActions.length !== 1)
|
|
61
|
-
issues.push('
|
|
64
|
+
issues.push('LmvzButtonGroup actions slot should contain exactly one primary action.');
|
|
62
65
|
if (secondaryActions.length > 1)
|
|
63
|
-
issues.push(`
|
|
66
|
+
issues.push(`LmvzButtonGroup actions slot should contain at most one secondary action (received ${secondaryActions.length})`);
|
|
64
67
|
if (primaryActions.length) {
|
|
65
68
|
const primaryAction = primaryActions[0];
|
|
66
69
|
const secondaryAction = secondaryActions[0];
|
|
67
70
|
if (order.indexOf(primaryAction) !== 0)
|
|
68
|
-
issues.push('Primary action
|
|
71
|
+
issues.push('Primary action should be the first focusable element in the actions slot (i.e. first child of the actions slot).');
|
|
69
72
|
if (secondaryAction && order.indexOf(secondaryAction) !== 1)
|
|
70
|
-
issues.push('Secondary action
|
|
73
|
+
issues.push('Secondary action should be the second focusable element in the actions slot (i.e. immediately after the primary button).');
|
|
71
74
|
}
|
|
72
75
|
else if (secondaryActions.length) {
|
|
73
76
|
const secondaryAction = secondaryActions[0];
|
|
74
77
|
if (order.indexOf(secondaryAction) !== 0)
|
|
75
|
-
issues.push('Secondary action
|
|
78
|
+
issues.push('Secondary action should be the first focusable element in the actions slot when no primary action is present (i.e. first child of the actions slot).');
|
|
76
79
|
}
|
|
77
80
|
return issues;
|
|
78
81
|
}
|
|
@@ -110,20 +113,35 @@ const LmvzButtonGroup = class {
|
|
|
110
113
|
}
|
|
111
114
|
});
|
|
112
115
|
this.checkActions();
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
const visibleButtons = this.visibleButtons;
|
|
117
|
+
const hasNonTertiary = visibleButtons.length > 0 && visibleButtons.some((btn) => isPrimaryAction(btn) || isSecondaryAction(btn));
|
|
118
|
+
if (visibleButtons.length > 0 && !hasNonTertiary) {
|
|
119
|
+
this.el.setAttribute('data-only-tertiary', '');
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
this.el.removeAttribute('data-only-tertiary');
|
|
123
|
+
}
|
|
124
|
+
this.visibleButtons.forEach((element, i) => {
|
|
125
|
+
const variant = variants[i] ?? 'tertiary';
|
|
117
126
|
if (!element)
|
|
118
|
-
|
|
127
|
+
return;
|
|
119
128
|
if (isLmvzButton(element)) {
|
|
120
|
-
if (!element.getAttribute('variant'))
|
|
129
|
+
if (!element.getAttribute('variant') && !element.variant)
|
|
121
130
|
element.setAttribute('variant', variant);
|
|
122
131
|
}
|
|
123
132
|
else {
|
|
124
133
|
element.classList.add(variant);
|
|
125
134
|
}
|
|
126
|
-
}
|
|
135
|
+
});
|
|
136
|
+
const firstTertiary = this.visibleButtons.find((btn) => btn.getAttribute('variant') === 'tertiary');
|
|
137
|
+
this.visibleButtons.forEach((btn) => {
|
|
138
|
+
if (btn === firstTertiary) {
|
|
139
|
+
btn.setAttribute('data-first-tertiary', '');
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
btn.removeAttribute('data-first-tertiary');
|
|
143
|
+
}
|
|
144
|
+
});
|
|
127
145
|
this.focusPrimaryAction();
|
|
128
146
|
}
|
|
129
147
|
focusPrimaryAction() {
|
|
@@ -151,31 +169,9 @@ const LmvzButtonGroup = class {
|
|
|
151
169
|
});
|
|
152
170
|
}
|
|
153
171
|
render() {
|
|
154
|
-
return (h(Host, { key: '
|
|
172
|
+
return (h(Host, { key: '3e8ce38f7e83e201e47d31579f22161ff36247b1' }, h("slot", { key: 'bc953d19b333f51c5f5c5ba86be3a85d155a29d1', ref: (element) => (this.actionsSlot = element), onSlotchange: this.handleActionsSlotChange })));
|
|
155
173
|
}
|
|
156
174
|
};
|
|
157
|
-
function isActionButton(element) {
|
|
158
|
-
return ['LMVZ-BUTTON', 'BUTTON'].includes(element.tagName.toUpperCase());
|
|
159
|
-
}
|
|
160
|
-
function isLmvzButton(element) {
|
|
161
|
-
return element?.tagName.toUpperCase() === 'LMVZ-BUTTON';
|
|
162
|
-
}
|
|
163
|
-
function isDisabledButton(element) {
|
|
164
|
-
return element.hasAttribute('disabled') || element.disabled === true;
|
|
165
|
-
}
|
|
166
|
-
function isVisible(element) {
|
|
167
|
-
return !element.hasAttribute('hidden');
|
|
168
|
-
}
|
|
169
|
-
function getActionVariant(element) {
|
|
170
|
-
const variant = element.getAttribute('variant') ?? element.variant;
|
|
171
|
-
return variant === 'primary' || variant === 'secondary' || variant === 'tertiary' ? variant : 'secondary';
|
|
172
|
-
}
|
|
173
|
-
function isPrimaryAction(element) {
|
|
174
|
-
return getActionVariant(element) === 'primary';
|
|
175
|
-
}
|
|
176
|
-
function isSecondaryAction(element) {
|
|
177
|
-
return getActionVariant(element) === 'secondary';
|
|
178
|
-
}
|
|
179
175
|
LmvzButtonGroup.style = lmvzButtonGroupCss();
|
|
180
176
|
|
|
181
177
|
export { LmvzButtonGroup as lmvz_button_group };
|
|
@@ -2,14 +2,14 @@ import { g as getElement, r as registerInstance, c as createEvent, h, H as Host
|
|
|
2
2
|
import { c as classNames } from './index-BfTCfPZ1.js';
|
|
3
3
|
import { A as AriaValidationController } from './aria-validation-controller-BnyUKeJ6.js';
|
|
4
4
|
import { E as ElementActivationController } from './element-activation-controller-CN0JX9-m.js';
|
|
5
|
-
import { i as inheritAriaAttributes,
|
|
5
|
+
import { i as inheritAriaAttributes, j as findFormByRef } from './element.util-CxfT9IA1.js';
|
|
6
6
|
import { R as ReactiveControllerHost } from './reactive-controller-host-FBuCCcFC.js';
|
|
7
7
|
import { p as parseSvgString } from './svg-B2YoIRuh.js';
|
|
8
8
|
import { a as resolveIconSvg } from './icons-CmuFKDRz.js';
|
|
9
9
|
import './aria-loader-GfsGHZHY.js';
|
|
10
10
|
import './logger-CGmJG63p.js';
|
|
11
11
|
|
|
12
|
-
const lmvzButtonCss = () => ` @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } } :host { button {
|
|
12
|
+
const lmvzButtonCss = () => ` @layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } hr { height: 0; border: none; margin: var(--lmvz-dimension-4-8, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0; border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0); } } :host { button { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary, #000000)); --lmvz-button-radius: var(--lmvz-button-radius-override, var(--lmvz-component-input-radius-default, 999px)); --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-body-md-strong, 500 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); min-height: var(--lmvz-button-min-height); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); position: relative; z-index: 1; } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0)); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-active, #d4d4d4)); } button.primary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary, #000000)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); } button.primary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-hover, #2e2e2e)); } button.primary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-active, #545454)); } button.secondary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary, #000000)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary-hover, #000000)); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-active, #d4d4d4)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary-active, #000000)); } button.tertiary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary, #ffffff)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary, #000000)); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-hover, #000000)); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-active, #000000)); } button.small { --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-body-sm-strong, 500 clamp(0.69rem, 0.67rem + 0.06vw, 0.75rem) / 1.5 Router)); } button.large { --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-body-lg-strong, 500 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.5 Router)); } display: inline-block; button { width: 100%; } } button { width: 100%; } ::slotted(*) { --lmvz-component-color: var(--lmvz-button-color); } `;
|
|
13
13
|
|
|
14
14
|
const LmvzButton = class extends ReactiveControllerHost {
|
|
15
15
|
get el() { return getElement(this); }
|
|
@@ -18,8 +18,9 @@ const LmvzButton = class extends ReactiveControllerHost {
|
|
|
18
18
|
formEl = null;
|
|
19
19
|
formButtonEl = null;
|
|
20
20
|
lmvzActivation;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
ti = 0;
|
|
22
|
+
resolveFocusableElement() {
|
|
23
|
+
return this.validationEl;
|
|
23
24
|
}
|
|
24
25
|
scale = 'default';
|
|
25
26
|
variant;
|
|
@@ -29,6 +30,7 @@ const LmvzButton = class extends ReactiveControllerHost {
|
|
|
29
30
|
formMethod;
|
|
30
31
|
name;
|
|
31
32
|
value;
|
|
33
|
+
buttonRole;
|
|
32
34
|
constructor(hostRef) {
|
|
33
35
|
super();
|
|
34
36
|
registerInstance(this, hostRef);
|
|
@@ -40,7 +42,7 @@ const LmvzButton = class extends ReactiveControllerHost {
|
|
|
40
42
|
}));
|
|
41
43
|
}
|
|
42
44
|
connectedCallback() {
|
|
43
|
-
this.inheritedAttributes = inheritAriaAttributes(this.el);
|
|
45
|
+
this.inheritedAttributes = inheritAriaAttributes(this.el, ['role']);
|
|
44
46
|
super.connectedCallback();
|
|
45
47
|
}
|
|
46
48
|
disconnectedCallback() {
|
|
@@ -97,7 +99,7 @@ const LmvzButton = class extends ReactiveControllerHost {
|
|
|
97
99
|
};
|
|
98
100
|
render() {
|
|
99
101
|
this.renderHiddenButton();
|
|
100
|
-
return (h(Host, { key: '
|
|
102
|
+
return (h(Host, { key: 'f3e619dca398c3a8a78e9d2f8c3df4178b2531b2', role: "presentation" }, h("button", { key: 'eb1aac6756a70968d3a72cb40c1d52d96340423e', ref: (e) => (this.validationEl = e), part: "button", role: this.buttonRole, disabled: this.disabled, type: this.type, class: classNames(this.variant ?? 'secondary', { [this.scale ?? '']: !!this.scale, disabled: this.disabled }), ...this.inheritedAttributes }, h("slot", { key: '786ff1c10ae05eda646c77ac8779813be6e51949' }))));
|
|
101
103
|
}
|
|
102
104
|
static get delegatesFocus() { return true; }
|
|
103
105
|
};
|
|
@@ -160,7 +162,7 @@ const LmvzIcon = class extends ReactiveControllerHost {
|
|
|
160
162
|
super.componentDidRender();
|
|
161
163
|
}
|
|
162
164
|
render() {
|
|
163
|
-
return h(Host, { key: '
|
|
165
|
+
return h(Host, { key: '4fba217d573d968951819f12af24d775c8ac62dc', role: "img", "aria-hidden": `${this.ariaHidden}`, innerHTML: this.iconData });
|
|
164
166
|
}
|
|
165
167
|
waitUntilVisible(callback, rootMargin = 50) {
|
|
166
168
|
if (typeof window === 'undefined' || !window.IntersectionObserver) {
|
package/esm/lmvz-card.entry.js
CHANGED
|
@@ -20,7 +20,7 @@ function joinPath(...parts) {
|
|
|
20
20
|
return parts.filter(Boolean).join('/').replace('//', '/').replace('/./', '/');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
const lmvzCardCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } } .sc-lmvz-card-h { button { --lmvz-button-color: var(--lmvz-component-color, var(--lmvz-semantic-color-int-on-secondary, #000000)); --lmvz-button-padding-inline: var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem))); --lmvz-button-padding-block: var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem))); --lmvz-button-gap: var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); --lmvz-button-min-height: var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)); --lmvz-button-font: var(--lmvz-typography-body-md-strong, 500 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); --lmvz-button-radius: var(--lmvz-component-input-radius-default, 999px); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); min-height: var(--lmvz-button-min-height); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); } button.primary { --lmvz-button-background: var(--lmvz-semantic-color-int-primary, #000000); --lmvz-button-color: var(--lmvz-semantic-color-int-on-primary, #ffffff); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; } button.primary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-hover, #2e2e2e); } button.primary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-primary-active, #545454); } button.secondary { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary, #000000); --lmvz-button-border-width: 0; --lmvz-button-border-color: transparent; } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary-hover, #000000); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-secondary-active, #d4d4d4); --lmvz-button-color: var(--lmvz-semantic-color-int-on-secondary-active, #000000); } button.tertiary { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary, #ffffff); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary, #000000); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary-hover, #000000); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0); --lmvz-button-color: var(--lmvz-semantic-color-int-on-tertiary-active, #000000); } button.small { --lmvz-button-padding-inline: var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); --lmvz-button-padding-block: var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem)); --lmvz-button-gap: var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem)); --lmvz-button-min-height: var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)); --lmvz-button-font: var(--lmvz-typography-body-sm-strong, 500 clamp(0.69rem, 0.67rem + 0.06vw, 0.75rem) / 1.5 Router); } button.large { --lmvz-button-padding-inline: var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)); --lmvz-button-padding-block: var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)); --lmvz-button-gap: var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)); --lmvz-button-min-height: var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem)); --lmvz-button-font: var(--lmvz-typography-body-lg-strong, 500 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.5 Router); } display: flex; min-width: var(--lmvz-card-component-card-minwidth, 20.4375rem); max-width: var(--lmvz-card-component-card-maxwidth, 21.6875rem); flex-direction: column; align-items: flex-start; border-radius: var(--lmvz-semantic-border-radius-lg, 14px); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); background: var(--lmvz-semantic-color-surface-primary, #ffffff); } *.sc-lmvz-card { color: var(--lmvz-semantic-color-on-surface-primary, #000000); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); } .top.sc-lmvz-card { display: flex; padding: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); flex-direction: column; justify-content: center; align-items: center; align-self: stretch; } .bottom.sc-lmvz-card { display: flex; min-width: 150px; padding: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)); flex-direction: column; align-items: flex-start; align-self: stretch; } .title.sc-lmvz-card { margin: 0; display: flex; justify-content: center; align-items: center; align-self: stretch; padding-bottom: var(--lmvz-global-s4, 4px); overflow-wrap: break-word; font: var(--lmvz-typography-heading-2xl, 500 clamp(2.25rem, 2.13rem + 0.52vw, 2.75rem) / 1.4 Router); } .description.sc-lmvz-card { display: flex; margin: 0; padding-bottom: var(--lmvz-component-body-sm-padding-bottom, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-items: flex-start; align-self: stretch; white-space: pre-line; font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); } .image-wrapper.sc-lmvz-card { aspect-ratio: 4 / 3; width: 100%; background-size: cover; background-position: center; flex: 1 0 0; align-self: stretch; border-radius: var(--lmvz-semantic-border-radius-md, 6px); } .actions.sc-lmvz-card { margin-top: var(--lmvz-component-form-wrapper-gap-y, clamp(1.13rem, 0.97rem + 0.65vw, 1.75rem)); display: flex; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-self: stretch; } button.primary.sc-lmvz-card, lmvz-button.primary.sc-lmvz-card { display: flex; justify-content: center; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); flex: 1 0 0; }`;
|
|
23
|
+
const lmvzCardCss = () => `@layer lmvz-ds.reset, lmvz-ds.theme, lmvz-ds.components, lmvz-ds.overrides; @layer lmvz-ds.theme { @font-face { font-family: Router; src: local('RouterBook-Regular'), local('Router-Book'), url('/assets/fonts/Router-Book.woff') format('woff'); font-weight: 400; } @font-face { font-family: Router; src: local('RouterMedium-Regular'), local('Router-Medium'), url('/assets/fonts/Router-Medium.woff') format('woff'); font-weight: 500; } @font-face { font-family: Router; src: local('RouterBold-Regular'), local('Router-Bold'), url('/assets/fonts/Router-Bold.woff') format('woff'); font-weight: 700; } } @layer lmvz-ds.reset { body { margin: 0; } h1, h2, h3, h4, h5, h6 { margin: 0; } *[hidden] { display: none !important; } hr { height: 0; border: none; margin: var(--lmvz-dimension-4-8, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)) 0; border-top: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0); } } .sc-lmvz-card-h { button { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary, #000000)); --lmvz-button-radius: var(--lmvz-button-radius-override, var(--lmvz-component-input-radius-default, 999px)); --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-button-padding, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-body-md-strong, 500 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); display: inline-flex; align-items: center; justify-content: center; gap: var(--lmvz-button-gap); padding-block: var(--lmvz-button-padding-block); padding-inline: var(--lmvz-button-padding-inline); min-height: var(--lmvz-button-min-height); border-radius: var(--lmvz-button-radius); border: var(--lmvz-button-border-width) solid var(--lmvz-button-border-color); background-color: var(--lmvz-button-background); color: var(--lmvz-button-color); cursor: pointer; font: var(--lmvz-button-font); text-align: center; text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; } button > * { font: inherit; color: inherit; } button:focus-visible { outline: var(--lmvz-ds-outline, 1px solid #0e7ab4); outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem)); position: relative; z-index: 1; } button:is([disabled], .disabled) { cursor: not-allowed; pointer-events: none; opacity: var(--lmvz-component-input-disabled-opacity, 40%); } button:not([disabled]):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0)); } button:not([disabled]):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-active, #d4d4d4)); } button.primary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary, #000000)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-primary, #ffffff)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); } button.primary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-hover, #2e2e2e)); } button.primary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-active, #545454)); } button.secondary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary, #000000)); --lmvz-button-border-width: var(--lmvz-button-border-width-override, 0); --lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent); } button.secondary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary-hover, #000000)); } button.secondary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-active, #d4d4d4)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary-active, #000000)); } button.tertiary { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary, #ffffff)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary, #000000)); } button.tertiary:not([disabled], .disabled):hover { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-hover, #000000)); } button.tertiary:not([disabled], .disabled):active { --lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0)); --lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-active, #000000)); } button.small { --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-component-input-padding-sm, clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-body-sm-strong, 500 clamp(0.69rem, 0.67rem + 0.06vw, 0.75rem) / 1.5 Router)); } button.large { --lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))); --lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem))); --lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem))); --lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem))); --lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-body-lg-strong, 500 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.5 Router)); } display: flex; min-width: var(--lmvz-card-component-card-minwidth, 20.4375rem); max-width: var(--lmvz-card-component-card-maxwidth, 21.6875rem); flex-direction: column; align-items: flex-start; border-radius: var(--lmvz-semantic-border-radius-lg, 14px); border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-default, #e0e0e0); background: var(--lmvz-semantic-color-surface-primary, #ffffff); } *.sc-lmvz-card { color: var(--lmvz-semantic-color-on-surface-primary, #000000); font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); } .top.sc-lmvz-card { display: flex; padding: var(--lmvz-dimension-8-12, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)); flex-direction: column; justify-content: center; align-items: center; align-self: stretch; } .bottom.sc-lmvz-card { display: flex; min-width: 150px; padding: var(--lmvz-dimension-4-6, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-10-14, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)); flex-direction: column; align-items: flex-start; align-self: stretch; } .title.sc-lmvz-card { margin: 0; display: flex; justify-content: center; align-items: center; align-self: stretch; padding-bottom: var(--lmvz-global-s4, 4px); overflow-wrap: break-word; font: var(--lmvz-typography-heading-2xl, 500 clamp(2.25rem, 2.13rem + 0.52vw, 2.75rem) / 1.4 Router); } .description.sc-lmvz-card { display: flex; margin: 0; padding-bottom: var(--lmvz-component-body-sm-padding-bottom, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-items: flex-start; align-self: stretch; white-space: pre-line; font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router); } .image-wrapper.sc-lmvz-card { aspect-ratio: 4 / 3; width: 100%; background-size: cover; background-position: center; flex: 1 0 0; align-self: stretch; border-radius: var(--lmvz-semantic-border-radius-md, 6px); } .actions.sc-lmvz-card { margin-top: var(--lmvz-component-form-wrapper-gap-y, clamp(1.13rem, 0.97rem + 0.65vw, 1.75rem)); display: flex; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); align-self: stretch; } button.primary.sc-lmvz-card, lmvz-button.primary.sc-lmvz-card { display: flex; justify-content: center; align-items: center; gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem)); flex: 1 0 0; }`;
|
|
24
24
|
|
|
25
25
|
const LmvzCard = class {
|
|
26
26
|
constructor(hostRef) {
|
|
@@ -45,7 +45,7 @@ const LmvzCard = class {
|
|
|
45
45
|
const imgStyle = {
|
|
46
46
|
backgroundImage: `url(${this.imageUrl ?? this.fallbackImage})`,
|
|
47
47
|
};
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '1dd819fd7c752af8d15001c08f7f60c6ea7278b9', role: "article" }, h("div", { key: 'e0cc822e627b6bbe665e4faa705cc46a09bac7c6', class: "top" }, h("div", { key: 'db79cb5a67ebdd6097f985e4b4bd27665b6329ef', class: "image-wrapper", style: imgStyle }, h("div", { key: '90facc8595ddbbf31e3768faa8254a82ab8d3e65', class: "chip-slot" }, h("slot", { key: 'cb2e6a1053aae2b2ca90c52c175e3c4174c89d23', name: "chip" })))), h("div", { key: 'cb11069a329385178677e92d08044e0fe8e5b982', class: "bottom" }, h("header", { key: '1e6076352124ca03de2fb13c17a565b4f492567e' }, h("h2", { key: '73f11099fb751bd4f967dbe49b79763b6a8268f3', class: "title" }, this.cardTitle)), h("p", { key: '36cf87b4c2004bff1e65feedd13e137d67115de3', class: "description" }, this.description), h("div", { key: '6c1d82f4968ce8252307858e6ad0681274f06397', class: "actions" }, h("button", { key: '0366e0caaf9235a3eaf7bfcab116e6a828fb248d', class: "primary", onClick: this._onPrimaryClick.bind(this), "data-testid": "primary" }, this.primaryActionLabel), h("button", { key: '4f435e79d75a621d6fe065471a915b55308ad15d', class: "tertiary", "aria-label": "More actions", onClick: this._onOverflowClick }, h("span", { key: '7dec97e0b0ca58c40fc5308cc7863acafa8c5147', class: "icon-placeholder" }, "..."))))));
|
|
49
49
|
}
|
|
50
50
|
static get assetsDirs() { return ["../../assets"]; }
|
|
51
51
|
};
|
|
@@ -101,7 +101,7 @@ const LmvzCheckbox = class extends ReactiveControllerHost {
|
|
|
101
101
|
this.nativeInput?.click();
|
|
102
102
|
}
|
|
103
103
|
render() {
|
|
104
|
-
return (h(Host, { key: '
|
|
104
|
+
return (h(Host, { key: 'b6b4153dbf80af15cb15799889ca23b621b4ef73' }, h("div", { key: 'f11d6baaa4b04ee74b201be8c4e125ccd5c366aa', class: "pill" }, h("input", { key: 'd61dccfa163ecf4fffa95a5d44be35adbb8ee8ff', type: "checkbox", id: this.checkboxId, checked: this.checkedState, disabled: this.disabled, required: this.required, "aria-required": this.required ? 'true' : 'false', "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": this.ariaDescribedBy, "aria-errormessage": this.error && this.errorId ? this.errorId : undefined, ref: (el) => (this.nativeInput = el), onChange: this.handleChange, autoFocus: this.autofocus }), h("span", { key: '87d62f1e0572e174e6d15f30ff59e37f6a5333cb', class: "box", "aria-hidden": "true" }, this.checkedState && h("span", { key: '74d29a32599f6c1ee8bde0cb6f27e384de7fcc2d', class: "indicator", innerHTML: CHECKMARK_SVG })), h("span", { key: '544990c81b3f7f90b53902d580d2eb2197edfa8b', class: "content" }, h("label", { key: '1884744656a280f85bec91b27315d3a6b70e8238', htmlFor: this.checkboxId }, this.label), this.helperText && (h("span", { key: '6783ff413a884c78dbd52e07cc7b433f5a9dcf29', onClick: this.retargetInnerClicks.bind(this), class: "helper-text", id: this.helperId, role: "status" }, this.helperText)))), this.errorMessage && (h("span", { key: '7c19fe406223a11e25df54cdfa304bc000eb421f', class: "error-text", id: this.errorId, role: "alert" }, this.errorMessage))));
|
|
105
105
|
}
|
|
106
106
|
static get formAssociated() { return true; }
|
|
107
107
|
static get watchers() { return {
|
package/esm/lmvz-chip.entry.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getElement, r as registerInstance, h, H as Host } from './index-BPeerEwm.js';
|
|
2
|
-
import {
|
|
2
|
+
import { f as chipTypes, g as chipSizes } from './ds.constants-DuEtnKRj.js';
|
|
3
3
|
import { A as AriaValidationController } from './aria-validation-controller-BnyUKeJ6.js';
|
|
4
4
|
import { R as ReactiveControllerHost } from './reactive-controller-host-FBuCCcFC.js';
|
|
5
5
|
import { i as isAriaValidationEnabled } from './aria-loader-GfsGHZHY.js';
|
|
@@ -65,7 +65,7 @@ const LmvzChip = class extends ReactiveControllerHost {
|
|
|
65
65
|
}
|
|
66
66
|
}, 500);
|
|
67
67
|
render() {
|
|
68
|
-
return (h(Host, { key: '
|
|
68
|
+
return (h(Host, { key: 'f326ca8e4dba40941db6b9a711ba46989c4cf1b3', type: this.type, size: this.size }, h("slot", { key: 'f9925e107c2e474ecbaca756451dc4249000b0db', name: "before-text", ref: (el) => (this.beforeSlot = el), onSlotchange: () => this.checkContent() }), h("span", { key: '0b6ea980e0b0500d2955a03088d08eb2ca67f64f', class: "content-overflow-wrapper" }, h("slot", { key: '2b7f5c02e9a09128e0a404c7fe35f6278ce1fa61', ref: (el) => (this.defaultSlot = el), onSlotchange: () => this.checkContent() })), h("slot", { key: '929291cdaccf26d332823f9a100c6b6a84dc04f2', name: "after-text", ref: (el) => (this.afterSlot = el), onSlotchange: () => this.checkContent() })));
|
|
69
69
|
}
|
|
70
70
|
static get watchers() { return {
|
|
71
71
|
"type": [{
|