@lmvz-ds/components 0.40.0 → 0.41.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 +6 -0
- package/cjs/{ds.constants-C6eKRAEu.js → ds.constants-pI-qkOYv.js} +2 -0
- package/cjs/index.cjs.js +2 -1
- package/cjs/lmvz-button-group.cjs.entry.js +1 -1
- package/cjs/lmvz-button_2.cjs.entry.js +1 -1
- package/cjs/lmvz-card.cjs.entry.js +58 -14
- 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-datepicker.cjs.entry.js +2 -2
- package/cjs/lmvz-header_2.cjs.entry.js +1 -1
- package/cjs/lmvz-input.cjs.entry.js +2 -2
- 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 +1 -1
- package/cjs/lmvz-popover.cjs.entry.js +1 -1
- 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 +1 -1
- package/cjs/lmvz-tabs.cjs.entry.js +1 -1
- package/cjs/lmvz-toggle.cjs.entry.js +1 -1
- package/cjs/loader.cjs.js +1 -1
- package/collection/api/ds.constants.js +1 -0
- package/collection/components/lmvz-card/lmvz-card.css +82 -194
- package/collection/components/lmvz-card/lmvz-card.js +131 -38
- package/collection/components/lmvz-checkbox/lmvz-checkbox.js +1 -1
- package/collection/components/lmvz-chip/lmvz-chip.js +1 -1
- package/collection/components/lmvz-datepicker/lmvz-datepicker.js +2 -2
- package/collection/components/lmvz-header/lmvz-header.js +1 -1
- package/collection/components/lmvz-icon/lmvz-icon.js +1 -1
- package/collection/components/lmvz-input/lmvz-input.js +2 -2
- package/collection/components/lmvz-link/lmvz-link.js +1 -1
- package/collection/components/lmvz-menuitem/lmvz-menuitem.js +1 -1
- package/collection/components/lmvz-message/lmvz-message.js +1 -1
- package/collection/components/lmvz-modal/lmvz-modal.js +1 -1
- package/collection/components/lmvz-popover/lmvz-popover.js +1 -1
- package/collection/components/lmvz-radio/lmvz-radio.js +1 -1
- package/collection/components/lmvz-select/lmvz-select.js +1 -1
- 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.js +1 -1
- package/collection/components/lmvz-tabs/lmvz-tabs.js +1 -1
- package/collection/components/lmvz-toggle/lmvz-toggle.js +1 -1
- package/collection/integration/header-integration/header-integration.js +1 -1
- package/components/index.js +1 -1
- package/components/lmvz-button-group.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-datepicker.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-popover.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-Buw_s-9k.js +1 -0
- package/components/{p-DSDBThqb.js → p-ChNEjbnY.js} +1 -1
- package/components/{p-niXjuPxe.js → p-DMdV-cnt.js} +1 -1
- package/components/{p-Bc5MM0zh.js → p-D_sr5Z0Q.js} +1 -1
- package/components/{p-D_mff3n7.js → p-qLAod5PR.js} +1 -1
- package/components/{p-DXhP6UeF.js → p-sJgTdXHR.js} +1 -1
- package/esm/{ds.constants-0ctLESas.js → ds.constants-Buw_s-9k.js} +2 -1
- package/esm/index.js +1 -1
- package/esm/lmvz-button-group.entry.js +1 -1
- package/esm/lmvz-button_2.entry.js +1 -1
- package/esm/lmvz-card.entry.js +59 -15
- 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-datepicker.entry.js +2 -2
- package/esm/lmvz-header_2.entry.js +1 -1
- package/esm/lmvz-input.entry.js +2 -2
- 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 +1 -1
- package/esm/lmvz-popover.entry.js +1 -1
- 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 +1 -1
- package/esm/lmvz-tabs.entry.js +1 -1
- package/esm/lmvz-toggle.entry.js +1 -1
- package/esm/loader.js +1 -1
- package/hydrate/index.js +83 -38
- package/hydrate/index.mjs +83 -38
- package/lmvz-components/index.esm.js +1 -1
- package/lmvz-components/lmvz-components.esm.js +1 -1
- package/lmvz-components/{p-f24f5207.entry.js → p-170dea97.entry.js} +1 -1
- package/lmvz-components/{p-efd9d50e.entry.js → p-18a894e4.entry.js} +1 -1
- package/lmvz-components/{p-f911691c.entry.js → p-19c9f747.entry.js} +1 -1
- package/lmvz-components/{p-87f21ac9.entry.js → p-377c45a7.entry.js} +1 -1
- package/lmvz-components/{p-773e9d95.entry.js → p-6292da52.entry.js} +1 -1
- package/lmvz-components/{p-ebad823c.entry.js → p-65efa76e.entry.js} +1 -1
- package/lmvz-components/{p-27e8b4fa.entry.js → p-67b86084.entry.js} +1 -1
- package/lmvz-components/{p-7cbfbc88.entry.js → p-6ffd9391.entry.js} +1 -1
- package/lmvz-components/{p-304c7554.entry.js → p-77fd3ce2.entry.js} +1 -1
- package/lmvz-components/{p-e35f49a1.entry.js → p-96764fa9.entry.js} +1 -1
- package/lmvz-components/p-Buw_s-9k.js +1 -0
- package/lmvz-components/{p-6aae1df9.entry.js → p-a70079b6.entry.js} +1 -1
- package/lmvz-components/p-aa643b58.entry.js +1 -0
- package/lmvz-components/{p-335b3867.entry.js → p-b14966a6.entry.js} +1 -1
- package/lmvz-components/{p-8ba6ec19.entry.js → p-b9d29e90.entry.js} +1 -1
- package/lmvz-components/{p-41286514.entry.js → p-bf728ef8.entry.js} +1 -1
- package/lmvz-components/{p-143e9621.entry.js → p-c6309d6c.entry.js} +1 -1
- package/lmvz-components/{p-220e455e.entry.js → p-d466fe8f.entry.js} +1 -1
- package/lmvz-components/{p-edec4d09.entry.js → p-dd4a62e1.entry.js} +1 -1
- package/lmvz-components/{p-d73bb7fd.entry.js → p-e1c75def.entry.js} +1 -1
- package/lmvz-components/{p-93b781ca.entry.js → p-fd29789f.entry.js} +1 -1
- package/manifest.json +133 -35
- package/package.json +1 -1
- package/types/api/ds.constants.d.ts +1 -0
- package/types/api/ds.types.d.ts +4 -0
- package/types/components/lmvz-card/lmvz-card.d.ts +17 -6
- package/types/components.d.ts +51 -19
- package/components/p-0ctLESas.js +0 -1
- package/lmvz-components/p-0ctLESas.js +0 -1
- package/lmvz-components/p-c884c76e.entry.js +0 -1
package/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["lmvz-datepicker.cjs",[[593,"lmvz-datepicker",{"value":[6145],"visibleMonth":[6145,"visible-month"],"min":[1],"max":[1],"locale":[1],"firstDayOfWeek":[2,"first-day-of-week"],"disabled":[516],"readonly":[516],"required":[516],"name":[513],"label":[1],"placeholder":[1],"helperText":[1,"helper-text"],"errorMessage":[1,"error-message"],"open":[1540],"displayFormat":[1,"display-format"],"focusedDate":[32],"valueDate":[32],"visibleMonthDate":[32],"inputText":[32],"hasUnparseableInput":[32],"isInvalid":[32],"nativeError":[32],"checkValidity":[64],"reportValidity":[64]},[[0,"keydown","handleKeydown"],[0,"focusin","handleInputFocus"],[0,"click","handleInputFocus"],[0,"invalid","handleInvalid"]],{"required":[{"handleValidityRelevantPropChange":0}],"min":[{"handleValidityRelevantPropChange":0}],"max":[{"handleValidityRelevantPropChange":0}],"locale":[{"handleDisplayFormatChange":0}],"displayFormat":[{"handleDisplayFormatChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-modal.cjs",[[769,"lmvz-modal",{"open":[1540],"closeLabel":[1,"close-label"],"hasHeader":[32]},[[0,"submit","handleFormDialogSubmit"]],{"open":[{"handleOpenChange":0}]}]]],["lmvz-message.cjs",[[769,"lmvz-message",{"type":[513],"live":[1],"leadingIcon":[4,"leading-icon"],"dismissible":[4],"closeLabel":[1,"close-label"],"actionLabel":[1,"action-label"]}]]],["lmvz-select.cjs",[[838,"lmvz-select",{"value":[1025],"multiple":[516],"values":[1040],"label":[1],"helperText":[1,"helper-text"],"error":[6660],"errorMessage":[1,"error-message"],"disabled":[516],"required":[516],"name":[513],"size":[513],"nativeError":[32],"selectedLabel":[32],"selectedId":[32],"activeId":[32],"isOpen":[32],"optionGroups":[32],"focusTrigger":[64],"blurTrigger":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64]},[[0,"invalid","handleInvalid"]],{"value":[{"handleValueChange":0}],"values":[{"handleValuesChange":0}],"required":[{"handleRequiredChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-snackbar.cjs",[[513,"lmvz-snackbar",{"status":[1537],"message":[1025],"duration":[1026],"priority":[1025],"actionLabel":[1025,"action-label"],"animationClass":[32],"show":[64],"hide":[64]},null,{"status":[{"onStatusChange":0}]}]]],["lmvz-link.cjs",[[785,"lmvz-link",{"href":[513],"target":[513],"rel":[1],"type":[1537],"externalLabel":[1,"external-label"]},null,{"type":[{"normalizeType":0}]}]]],["lmvz-header_2.cjs",[[769,"lmvz-header",{"role":[2561],"lmvzActiveNav":[1,"lmvz-active-nav"],"initFocus":[64]},null,{"lmvzActiveNav":[{"handleActiveNavChange":0}]}],[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-action.cjs",[[257,"lmvz-action"]]],["lmvz-action-list.cjs",[[774,"lmvz-action-list",{"label":[1],"initFocus":[64]}]]],["lmvz-
|
|
9
|
+
return index.bootstrapLazy([["lmvz-datepicker.cjs",[[593,"lmvz-datepicker",{"value":[6145],"visibleMonth":[6145,"visible-month"],"min":[1],"max":[1],"locale":[1],"firstDayOfWeek":[2,"first-day-of-week"],"disabled":[516],"readonly":[516],"required":[516],"name":[513],"label":[1],"placeholder":[1],"helperText":[1,"helper-text"],"errorMessage":[1,"error-message"],"open":[1540],"displayFormat":[1,"display-format"],"focusedDate":[32],"valueDate":[32],"visibleMonthDate":[32],"inputText":[32],"hasUnparseableInput":[32],"isInvalid":[32],"nativeError":[32],"checkValidity":[64],"reportValidity":[64]},[[0,"keydown","handleKeydown"],[0,"focusin","handleInputFocus"],[0,"click","handleInputFocus"],[0,"invalid","handleInvalid"]],{"required":[{"handleValidityRelevantPropChange":0}],"min":[{"handleValidityRelevantPropChange":0}],"max":[{"handleValidityRelevantPropChange":0}],"locale":[{"handleDisplayFormatChange":0}],"displayFormat":[{"handleDisplayFormatChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-modal.cjs",[[769,"lmvz-modal",{"open":[1540],"closeLabel":[1,"close-label"],"hasHeader":[32]},[[0,"submit","handleFormDialogSubmit"]],{"open":[{"handleOpenChange":0}]}]]],["lmvz-message.cjs",[[769,"lmvz-message",{"type":[513],"live":[1],"leadingIcon":[4,"leading-icon"],"dismissible":[4],"closeLabel":[1,"close-label"],"actionLabel":[1,"action-label"]}]]],["lmvz-select.cjs",[[838,"lmvz-select",{"value":[1025],"multiple":[516],"values":[1040],"label":[1],"helperText":[1,"helper-text"],"error":[6660],"errorMessage":[1,"error-message"],"disabled":[516],"required":[516],"name":[513],"size":[513],"nativeError":[32],"selectedLabel":[32],"selectedId":[32],"activeId":[32],"isOpen":[32],"optionGroups":[32],"focusTrigger":[64],"blurTrigger":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64]},[[0,"invalid","handleInvalid"]],{"value":[{"handleValueChange":0}],"values":[{"handleValuesChange":0}],"required":[{"handleRequiredChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-snackbar.cjs",[[513,"lmvz-snackbar",{"status":[1537],"message":[1025],"duration":[1026],"priority":[1025],"actionLabel":[1025,"action-label"],"animationClass":[32],"show":[64],"hide":[64]},null,{"status":[{"onStatusChange":0}]}]]],["lmvz-card.cjs",[[769,"lmvz-card",{"size":[1537],"cardTitle":[1,"card-title"],"description":[1],"imageUrl":[1,"image-url"],"imageAlt":[1,"image-alt"],"actionLabel":[1,"action-label"]},null,{"size":[{"normalizeSize":0}]}]]],["lmvz-link.cjs",[[785,"lmvz-link",{"href":[513],"target":[513],"rel":[1],"type":[1537],"externalLabel":[1,"external-label"]},null,{"type":[{"normalizeType":0}]}]]],["lmvz-header_2.cjs",[[769,"lmvz-header",{"role":[2561],"lmvzActiveNav":[1,"lmvz-active-nav"],"initFocus":[64]},null,{"lmvzActiveNav":[{"handleActiveNavChange":0}]}],[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-action.cjs",[[257,"lmvz-action"]]],["lmvz-action-list.cjs",[[774,"lmvz-action-list",{"label":[1],"initFocus":[64]}]]],["lmvz-checkbox.cjs",[[578,"lmvz-checkbox",{"label":[1],"checked":[1540],"value":[1],"name":[513],"disabled":[516],"required":[516],"error":[6660],"errorMessage":[1,"error-message"],"helperText":[1,"helper-text"],"form":[1],"autofocus":[4],"nativeError":[32],"checkedState":[32],"focusInput":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64]},[[0,"invalid","handleInvalid"]],{"checked":[{"handleCheckedChange":0}],"required":[{"handleRequiredChange":0}]}]]],["lmvz-menuitem.cjs",[[774,"lmvz-menuitem",{"role":[2561],"ti":[2562,"tabindex"]}]]],["lmvz-radio.cjs",[[578,"lmvz-radio",{"label":[1],"checked":[1540],"value":[1],"name":[513],"disabled":[516],"required":[516],"error":[6660],"helperText":[1,"helper-text"],"form":[513],"autofocus":[4],"nativeError":[32],"focusInput":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64]},[[0,"invalid","handleInvalid"],[0,"keydown","handleKeydown"]],{"checked":[{"handleCheckedChange":0}],"required":[{"handleRequiredChange":0}],"value":[{"handleValueChange":0}],"label":[{"handleLabelChange":0}]}]]],["lmvz-spinner.cjs",[[513,"lmvz-spinner",{"size":[513],"ariaLabel":[513,"aria-label"]}]]],["lmvz-tab.cjs",[[785,"lmvz-tab",{"value":[513],"disabled":[516],"selected":[516],"panel":[513]}]]],["lmvz-tabs.cjs",[[769,"lmvz-tabs",{"value":[1537],"resolvedValue":[32],"initFocus":[64],"activateTab":[64],"getTabElements":[64],"setTabPanelIds":[64]},[[0,"slotchange","handleSlotChangeEvent"]],{"value":[{"handleValueChange":0}]}]]],["lmvz-toggle.cjs",[[578,"lmvz-toggle",{"label":[1],"checked":[1540],"disabled":[516],"required":[516],"name":[1],"value":[1],"form":[1],"focusToggle":[64],"blurToggle":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64],"getInputElement":[64]},null,{"checked":[{"handleCheckedChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-button-group.cjs",[[769,"lmvz-button-group",{"stacked":[516],"primaryEnabledAction":[2064],"hasActions":[2052,"has-actions"]}]]],["lmvz-chip.cjs",[[769,"lmvz-chip",{"type":[1537],"size":[1537]},null,{"type":[{"normalizeType":0}],"size":[{"normalizeSize":0}]}]]],["lmvz-input.cjs",[[838,"lmvz-input",{"value":[1025],"label":[1],"helperText":[1,"helper-text"],"placeholder":[1],"disabled":[516],"readonly":[516],"required":[516],"name":[1],"type":[1],"errorMessage":[1,"error-message"],"autocomplete":[1],"inputmode":[1],"autocorrect":[1],"autocapitalize":[1],"spellcheck":[4],"autofocus":[4],"minlength":[2],"maxlength":[2],"pattern":[1],"min":[8],"max":[8],"step":[8],"form":[1],"size":[513],"error":[6660],"nativeError":[32],"setValue":[64],"focusInput":[64],"blurInput":[64],"select":[64],"checkValidity":[64],"reportValidity":[64],"getValidationMessage":[64],"getInputElement":[64]},null,{"value":[{"handleValueChange":0}],"disabled":[{"handleDisabledChange":0}]}]]],["lmvz-popover.cjs",[[769,"lmvz-popover",{"open":[1540],"anchor":[1],"placement":[1],"size":[1],"autoFocus":[4,"auto-focus"],"containerRole":[1,"container-role"],"label":[1],"anchorEl":[32],"show":[64],"hide":[64],"toggle":[64]},null,{"open":[{"handleOpenChange":0}],"anchor":[{"handleAnchorChange":1}]}]]],["lmvz-button_2.cjs",[[785,"lmvz-button",{"ti":[514,"tabindex"],"scale":[513],"variant":[513],"disabled":[516],"type":[1],"form":[1],"formMethod":[1,"form-method"],"name":[1],"value":[1],"buttonRole":[1,"button-role"]}],[514,"lmvz-icon",{"icon":[513],"weight":[513],"size":[513],"iconset":[513],"ariaLabel":[513,"aria-label"],"iconData":[32],"visible":[32]},null,{"icon":[{"loadIconPathData":0}],"iconset":[{"loadIconPathData":0}]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -9,6 +9,7 @@ export const iconSizes = [...sizes, 'inherit'];
|
|
|
9
9
|
export const iconWeights = ['thin', 'medium', 'bold'];
|
|
10
10
|
export const chipTypes = ['active', 'warning', 'success', 'error', 'neutral'];
|
|
11
11
|
export const chipSizes = ['default', 'small'];
|
|
12
|
+
export const cardSizes = ['large', 'small'];
|
|
12
13
|
export const linkTypes = ['internal', 'external'];
|
|
13
14
|
export const messageTypes = ['neutral', 'warning'];
|
|
14
15
|
export const snackbarStatuses = ['success', 'warning', 'error'];
|
|
@@ -75,234 +75,122 @@ legend {
|
|
|
75
75
|
|
|
76
76
|
}
|
|
77
77
|
:host {
|
|
78
|
-
|
|
79
|
-
/*
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
* This fragment is meant to be reusable in multiple component types.
|
|
85
|
-
* CAUTION: always wrap the import in a tag selector (ususally button)!
|
|
86
|
-
*/
|
|
87
|
-
& {
|
|
88
|
-
/* the (invalid nested) import will be handled by postcss */
|
|
89
|
-
/* stylelint-disable-next-line no-invalid-position-at-import-rule */
|
|
90
|
-
/* stylelint-disable nesting-selector-no-missing-scoping-root */
|
|
91
|
-
& {
|
|
92
|
-
/* variables are declared on :host
|
|
93
|
-
so that outer ::slotted(lmvz-button) overrides are inherited correctly via shadow inheritance.
|
|
94
|
-
They are also declared here so that non-shadow consumers have the default values in scope. */
|
|
95
|
-
|
|
96
|
-
/* secondary styling is default, primary is explicit */
|
|
97
|
-
|
|
98
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary, #f0f0f0));
|
|
99
|
-
--lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-secondary, #000000));
|
|
100
|
-
--lmvz-button-radius: var(--lmvz-button-radius-override, var(--lmvz-component-input-radius-default, 999px));
|
|
101
|
-
--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))));
|
|
102
|
-
--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))));
|
|
103
|
-
--lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)));
|
|
104
|
-
--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)));
|
|
105
|
-
--lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-label-md-strong, normal 700 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5
|
|
106
|
-
Router));
|
|
107
|
-
--lmvz-button-border-width: var(--lmvz-button-border-width-override, 0);
|
|
108
|
-
--lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent);
|
|
109
|
-
|
|
110
|
-
display: inline-flex;
|
|
111
|
-
align-items: center;
|
|
112
|
-
justify-content: var(--lmvz-button-content-justification, center);
|
|
113
|
-
gap: var(--lmvz-button-gap, var(--lmvz-component-input-gap-md, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem)));
|
|
114
|
-
|
|
115
|
-
box-sizing: border-box; /* to inlclude paddings & border in min-height */
|
|
116
|
-
padding-block: var(--lmvz-button-padding-block, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)));
|
|
117
|
-
padding-inline: var(--lmvz-button-padding-inline, var(--lmvz-component-input-padding-md, clamp(0.88rem, 0.84rem + 0.13vw, 1rem)));
|
|
118
|
-
min-height: var(--lmvz-button-min-height, var(--lmvz-component-input-size-md, clamp(2.5rem, 2.44rem + 0.26vw, 2.75rem)));
|
|
119
|
-
border: var(--lmvz-button-border-width, 0) solid var(--lmvz-button-border-color, transparent);
|
|
120
|
-
border-radius: var(--lmvz-button-radius, var(--lmvz-component-input-radius-default, 999px));
|
|
121
|
-
|
|
122
|
-
background-color: var(--lmvz-button-background);
|
|
123
|
-
color: var(--lmvz-button-color);
|
|
124
|
-
cursor: pointer;
|
|
125
|
-
font: var(--lmvz-button-font);
|
|
126
|
-
text-decoration: none;
|
|
127
|
-
white-space: nowrap;
|
|
128
|
-
transition:
|
|
129
|
-
background-color 0.15s ease,
|
|
130
|
-
color 0.15s ease,
|
|
131
|
-
border-color 0.15s ease,
|
|
132
|
-
box-shadow 0.15s ease;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
& > * {
|
|
137
|
-
font: inherit;
|
|
138
|
-
color: inherit;
|
|
139
|
-
}
|
|
140
|
-
&:focus-visible {
|
|
141
|
-
outline: var(--lmvz-ds-outline, 1px solid #0e7ab4);
|
|
142
|
-
outline-offset: var(--lmvz-ds-outline-offset, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem));
|
|
143
|
-
position: relative;
|
|
144
|
-
z-index: 1;
|
|
145
|
-
}
|
|
146
|
-
&:is([disabled], .disabled) {
|
|
147
|
-
cursor: not-allowed;
|
|
148
|
-
pointer-events: none;
|
|
149
|
-
/* } */
|
|
150
|
-
|
|
151
|
-
/* button:is(:is([disabled], .disabled):not(.secondary):not(.tertiary), .primary:is([disabled], .disabled)) { */
|
|
152
|
-
/* button:is([disabled], .disabled) { */
|
|
153
|
-
/* --lmvz-button-background: var(--lmvz-global-color-neutral-500); */
|
|
154
|
-
/* --lmvz-button-color: var(--lmvz-global-color-neutral-white); */
|
|
155
|
-
opacity: var(--lmvz-component-input-disabled-opacity, 40%);
|
|
156
|
-
}
|
|
157
|
-
&:not([disabled]):hover {
|
|
158
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-hover, #e0e0e0));
|
|
159
|
-
}
|
|
160
|
-
&:not([disabled]):active {
|
|
161
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-secondary-active, #d4d4d4));
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/* secondary styling is default, primary is explicit */
|
|
165
|
-
|
|
166
|
-
&.primary {
|
|
167
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary, #000000));
|
|
168
|
-
--lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-primary, #ffffff));
|
|
169
|
-
--lmvz-button-border-width: var(--lmvz-button-border-width-override, 0);
|
|
170
|
-
--lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent);
|
|
171
|
-
}
|
|
172
|
-
&.primary:not([disabled], .disabled):hover {
|
|
173
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-hover, #2e2e2e));
|
|
174
|
-
}
|
|
175
|
-
&.primary:not([disabled], .disabled):active {
|
|
176
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-primary-active, #545454));
|
|
177
|
-
}
|
|
178
|
-
&.danger {
|
|
179
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary, #ffffff));
|
|
180
|
-
--lmvz-button-border-color: var(--lmvz-button-border-color-override, transparent);
|
|
181
|
-
--lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-status-on-danger, #a31419));
|
|
182
|
-
}
|
|
183
|
-
&.danger:not([disabled], .disabled):hover {
|
|
184
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-status-danger, #fbdfe0));
|
|
185
|
-
--lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-status-on-danger, #a31419));
|
|
186
|
-
}
|
|
187
|
-
&.danger:not([disabled], .disabled):active {
|
|
188
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-status-on-danger-subtle, #e8454b));
|
|
189
|
-
--lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-status-on-danger, #a31419));
|
|
190
|
-
}
|
|
191
|
-
&.tertiary {
|
|
192
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary, #ffffff));
|
|
193
|
-
--lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary, #000000));
|
|
194
|
-
}
|
|
195
|
-
&.tertiary:not([disabled], .disabled):hover {
|
|
196
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-hover, #f0f0f0));
|
|
197
|
-
--lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-hover, #000000));
|
|
198
|
-
}
|
|
199
|
-
&.tertiary:not([disabled], .disabled):active {
|
|
200
|
-
--lmvz-button-background: var(--lmvz-button-background-override, var(--lmvz-semantic-color-int-tertiary-active, #e0e0e0));
|
|
201
|
-
--lmvz-button-color: var(--lmvz-button-color-override, var(--lmvz-semantic-color-int-on-tertiary-active, #000000));
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
&.small {
|
|
205
|
-
--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)));
|
|
206
|
-
--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)));
|
|
207
|
-
--lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-sm, clamp(0.38rem, 0.31rem + 0.26vw, 0.63rem)));
|
|
208
|
-
--lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-sm, clamp(2rem, 1.94rem + 0.26vw, 2.25rem)));
|
|
209
|
-
--lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-label-sm-strong, normal 700 clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem) / 1.5
|
|
210
|
-
Router));
|
|
211
|
-
}
|
|
212
|
-
&.large {
|
|
213
|
-
--lmvz-button-padding-inline: var(--lmvz-button-padding-inline-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)));
|
|
214
|
-
--lmvz-button-padding-block: var(--lmvz-button-padding-block-override, var(--lmvz-component-input-padding-lg, clamp(1rem, 0.94rem + 0.26vw, 1.25rem)));
|
|
215
|
-
--lmvz-button-gap: var(--lmvz-button-gap-override, var(--lmvz-component-input-gap-lg, clamp(0.75rem, 0.69rem + 0.26vw, 1rem)));
|
|
216
|
-
--lmvz-button-min-height: var(--lmvz-button-min-height-override, var(--lmvz-component-input-size-lg, clamp(2.75rem, 2.69rem + 0.26vw, 3rem)));
|
|
217
|
-
--lmvz-button-font: var(--lmvz-button-font-override, var(--lmvz-typography-label-lg-strong, normal 700 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.5
|
|
218
|
-
Router));
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
78
|
+
/* Card-local width custom properties. */
|
|
79
|
+
/* TODO(token-gap): 320px/360px awaiting Supernova correction of --lmvz-card-component-card-minwidth/-maxwidth, see checklist T10 */
|
|
80
|
+
--lmvz-card-local-min-width: 320px;
|
|
81
|
+
--lmvz-card-local-max-width: 360px;
|
|
82
|
+
/* TODO(token-gap): 232px awaiting promotion of figma-only/card/card-sm-max-width to a real token, see checklist T10 */
|
|
83
|
+
--lmvz-card-local-sm-width: 232px;
|
|
222
84
|
|
|
223
85
|
display: flex;
|
|
224
|
-
min-width: var(--lmvz-card-component-card-minwidth, 20.4375rem);
|
|
225
|
-
max-width: var(--lmvz-card-component-card-maxwidth, 21.6875rem);
|
|
226
86
|
flex-direction: column;
|
|
227
87
|
align-items: flex-start;
|
|
88
|
+
min-width: var(--lmvz-card-local-min-width);
|
|
89
|
+
max-width: var(--lmvz-card-local-max-width);
|
|
228
90
|
|
|
229
|
-
border-radius: var(--lmvz-
|
|
230
|
-
border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-
|
|
91
|
+
border-radius: var(--lmvz-component-wrapper-md-border-radius, 18px);
|
|
92
|
+
border: var(--lmvz-semantic-border-width-default, 1px) solid var(--lmvz-semantic-color-border-subtle, #f0f0f0);
|
|
231
93
|
background: var(--lmvz-semantic-color-surface-primary, #ffffff);
|
|
94
|
+
box-shadow: 0 var(--lmvz-semantic-shadow-l1-1-position-y, 2px) var(--lmvz-semantic-shadow-l1-1-blur, 4px) 0 var(--lmvz-semantic-color-shadow-l1-default, rgba(120, 120, 128, 0.08));
|
|
95
|
+
margin-bottom: var(--lmvz-component-card-lg-margin-bottom, clamp(1rem, 0.88rem + 0.52vw, 1.5rem));
|
|
96
|
+
}
|
|
97
|
+
:host([size='small']) {
|
|
98
|
+
width: var(--lmvz-card-local-sm-width);
|
|
99
|
+
min-width: 0;
|
|
100
|
+
max-width: none;
|
|
101
|
+
border-radius: var(--lmvz-component-wrapper-sm-border-radius, 14px);
|
|
102
|
+
margin-bottom: var(--lmvz-component-card-sm-margin-bottom, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));
|
|
232
103
|
}
|
|
233
104
|
* {
|
|
234
105
|
color: var(--lmvz-semantic-color-on-surface-primary, #000000);
|
|
235
106
|
font: var(--lmvz-typography-body-md, 400 clamp(0.88rem, 0.84rem + 0.13vw, 1rem) / 1.5 Router);
|
|
236
107
|
}
|
|
237
|
-
.
|
|
108
|
+
.image {
|
|
109
|
+
width: 100%;
|
|
110
|
+
aspect-ratio: 4 / 3;
|
|
111
|
+
object-fit: cover;
|
|
112
|
+
align-self: stretch;
|
|
113
|
+
border-top-left-radius: var(--lmvz-component-wrapper-md-border-radius, 18px);
|
|
114
|
+
border-top-right-radius: var(--lmvz-component-wrapper-md-border-radius, 18px);
|
|
115
|
+
}
|
|
116
|
+
:host([size='small']) .image {
|
|
117
|
+
border-top-left-radius: var(--lmvz-component-wrapper-sm-border-radius, 14px);
|
|
118
|
+
border-top-right-radius: var(--lmvz-component-wrapper-sm-border-radius, 14px);
|
|
119
|
+
}
|
|
120
|
+
.content {
|
|
238
121
|
display: flex;
|
|
239
|
-
padding: var(--lmvz-dimension-12-8, clamp(0.5rem, 0.44rem + 0.26vw, 0.75rem));
|
|
240
122
|
flex-direction: column;
|
|
241
|
-
|
|
242
|
-
align-items: center;
|
|
123
|
+
align-items: flex-start;
|
|
243
124
|
align-self: stretch;
|
|
125
|
+
gap: var(--lmvz-component-spacing-xs, clamp(0.25rem, 0.19rem + 0.26vw, 0.5rem));
|
|
126
|
+
|
|
127
|
+
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));
|
|
128
|
+
}
|
|
129
|
+
:host([size='small']) .content {
|
|
130
|
+
gap: var(--lmvz-component-spacing-2xs, clamp(0.13rem, 0.09rem + 0.13vw, 0.25rem));
|
|
131
|
+
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));
|
|
244
132
|
}
|
|
245
|
-
.
|
|
133
|
+
.title-block {
|
|
246
134
|
display: flex;
|
|
247
|
-
min-width: 150px;
|
|
248
|
-
padding: var(--lmvz-dimension-6-4, clamp(0.25rem, 0.22rem + 0.13vw, 0.38rem)) var(--lmvz-dimension-14-10, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-14-10, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem)) var(--lmvz-dimension-14-10, clamp(0.63rem, 0.56rem + 0.26vw, 0.88rem));
|
|
249
135
|
flex-direction: column;
|
|
250
136
|
align-items: flex-start;
|
|
251
137
|
align-self: stretch;
|
|
138
|
+
gap: var(--lmvz-component-spacing-2xs, clamp(0.13rem, 0.09rem + 0.13vw, 0.25rem));
|
|
139
|
+
}
|
|
140
|
+
/*
|
|
141
|
+
* Title typography applies identically to the fallback <h3> and any slotted heading (h2-h5); the level is the
|
|
142
|
+
* consumer's choice, the styling is the card's.
|
|
143
|
+
*
|
|
144
|
+
* The fallback <h3> (.card-default-title) lives in the shadow root and is styled directly below.
|
|
145
|
+
* Slotted headings are consumer-supplied light-DOM children; `::slotted()` is the correct selector
|
|
146
|
+
* to reach them from within the shadow stylesheet.
|
|
147
|
+
*/
|
|
148
|
+
.card-default-title {
|
|
149
|
+
margin: 0;
|
|
150
|
+
overflow-wrap: break-word;
|
|
151
|
+
font: var(--lmvz-typography-heading-lg, 500 clamp(1.13rem, 1.03rem + 0.39vw, 1.5rem) / 1.5
|
|
152
|
+
Router);
|
|
252
153
|
}
|
|
253
|
-
.title {
|
|
154
|
+
:host([size='small']) .card-default-title {
|
|
155
|
+
font: var(--lmvz-typography-body-lg-strong, 500 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.5
|
|
156
|
+
Router);
|
|
157
|
+
}
|
|
158
|
+
/* Slotted heading typography — large (default) */
|
|
159
|
+
::slotted([slot='card-title']) {
|
|
254
160
|
margin: 0;
|
|
255
|
-
display: flex;
|
|
256
|
-
justify-content: center;
|
|
257
|
-
align-items: center;
|
|
258
|
-
align-self: stretch;
|
|
259
|
-
|
|
260
|
-
padding-bottom: var(--lmvz-global-s4, 4px);
|
|
261
161
|
overflow-wrap: break-word;
|
|
262
|
-
|
|
162
|
+
}
|
|
163
|
+
/* Slotted heading typography — small */
|
|
164
|
+
:host([size='small']) ::slotted([slot='card-title']) {
|
|
165
|
+
font: var(--lmvz-typography-body-lg-strong, 500 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.5
|
|
263
166
|
Router);
|
|
264
167
|
}
|
|
265
168
|
.description {
|
|
266
|
-
display: flex;
|
|
267
169
|
margin: 0;
|
|
268
|
-
padding-bottom: var(--lmvz-component-body-sm-padding-bottom, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
269
|
-
align-items: flex-start;
|
|
270
170
|
align-self: stretch;
|
|
271
171
|
white-space: pre-line;
|
|
272
|
-
font: var(--lmvz-typography-body-
|
|
172
|
+
font: var(--lmvz-typography-body-lg, 400 clamp(1rem, 0.97rem + 0.13vw, 1.13rem) / 1.5 Router);
|
|
273
173
|
}
|
|
274
|
-
.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
174
|
+
:host([size='small']) .description {
|
|
175
|
+
font: var(--lmvz-typography-body-sm, 400 clamp(0.75rem, 0.72rem + 0.13vw, 0.88rem) / 1.5 Router);
|
|
176
|
+
}
|
|
177
|
+
/*
|
|
178
|
+
* Chip slot: under shadow: true, an empty <slot> is a real flex item in .content's flex column and
|
|
179
|
+
* would introduce a phantom gap even when nothing is slotted. `display: contents` collapses the
|
|
180
|
+
* slot element's own box so it contributes no spacing when empty, while still allowing slotted
|
|
181
|
+
* content to participate in the flex layout normally.
|
|
182
|
+
*/
|
|
183
|
+
slot[name='chip'] {
|
|
184
|
+
display: contents;
|
|
282
185
|
}
|
|
283
186
|
.actions {
|
|
284
|
-
margin-top: var(--lmvz-component-form-wrapper-gap-y, clamp(1.13rem, 0.97rem + 0.65vw, 1.75rem));
|
|
285
187
|
display: flex;
|
|
286
188
|
align-items: center;
|
|
287
|
-
gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
288
189
|
align-self: stretch;
|
|
190
|
+
/* Button-row top padding is a separate Figma-specified value (Visual primitives: Button-row top padding, both sizes) that intentionally stacks on .content's flex gap — not an accidental double-count. */
|
|
191
|
+
padding-top: var(--lmvz-component-spacing-md, clamp(0.75rem, 0.69rem + 0.26vw, 1rem));
|
|
289
192
|
}
|
|
290
|
-
button.
|
|
291
|
-
lmvz-button.
|
|
292
|
-
display: flex;
|
|
293
|
-
justify-content: center;
|
|
294
|
-
align-items: center;
|
|
295
|
-
gap: var(--lmvz-component-input-md-gap-x, clamp(0.25rem, 0.16rem + 0.39vw, 0.63rem));
|
|
193
|
+
/* Sizing (padding/gap/min-height/font) is fully driven by lmvz-button's own `scale` prop (default/small), set in the render method - no local overrides needed here. */
|
|
194
|
+
lmvz-button.action {
|
|
296
195
|
flex: 1 0 0;
|
|
297
196
|
}
|
|
298
|
-
/* .overflow-button {
|
|
299
|
-
anchor-name: --overflow-button;
|
|
300
|
-
} */
|
|
301
|
-
/* menu {
|
|
302
|
-
position: fixed;
|
|
303
|
-
position-anchor: --overflow-button;
|
|
304
|
-
|
|
305
|
-
inset-block-start: anchor(end);
|
|
306
|
-
inset-inline-end: anchor(self-end);
|
|
307
|
-
margin: 5px 0 0 5px;
|
|
308
|
-
} */
|
|
@@ -1,28 +1,67 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { cardSizes } from "../../api/ds.constants";
|
|
3
|
+
import { isAriaValidationEnabled } from "../../utils/aria/aria-validation-controller";
|
|
2
4
|
import { createAssetUrlSafely } from "../../utils/stencil/assets";
|
|
5
|
+
const HEADING_TAGS = new Set(['HEADER', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6']);
|
|
3
6
|
export class LmvzCard {
|
|
7
|
+
el;
|
|
8
|
+
titleSlotElement;
|
|
9
|
+
warnedCases = new Set();
|
|
10
|
+
size = 'large';
|
|
4
11
|
cardTitle;
|
|
5
|
-
imageUrl;
|
|
6
12
|
description;
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
imageUrl;
|
|
14
|
+
imageAlt = '';
|
|
15
|
+
actionLabel;
|
|
16
|
+
lmvzCardAction;
|
|
17
|
+
normalizeSize(value) {
|
|
18
|
+
const normalizedSize = cardSizes.includes(value) ? value : 'large';
|
|
19
|
+
if (normalizedSize !== this.size) {
|
|
20
|
+
this.size = normalizedSize;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
componentWillLoad() {
|
|
24
|
+
this.normalizeSize(this.size);
|
|
25
|
+
}
|
|
26
|
+
componentDidLoad() {
|
|
27
|
+
const titleSlot = this.el.shadowRoot?.querySelector('slot[name="card-title"]');
|
|
28
|
+
titleSlot?.addEventListener('slotchange', () => this.checkTitleContent());
|
|
29
|
+
this.checkTitleContent();
|
|
30
|
+
}
|
|
9
31
|
get fallbackImage() {
|
|
10
|
-
return createAssetUrlSafely('card-placeholder.svg');
|
|
32
|
+
return String(createAssetUrlSafely('card-placeholder.svg'));
|
|
33
|
+
}
|
|
34
|
+
handleActionClick = () => {
|
|
35
|
+
this.lmvzCardAction.emit();
|
|
36
|
+
};
|
|
37
|
+
get slottedTitleElement() {
|
|
38
|
+
return this.titleSlotElement?.assignedElements()?.at(0);
|
|
11
39
|
}
|
|
12
|
-
|
|
13
|
-
|
|
40
|
+
checkTitleContent() {
|
|
41
|
+
if (!isAriaValidationEnabled())
|
|
42
|
+
return;
|
|
43
|
+
const slotted = this.slottedTitleElement;
|
|
44
|
+
if (slotted) {
|
|
45
|
+
const tag = slotted.tagName;
|
|
46
|
+
if (!HEADING_TAGS.has(tag)) {
|
|
47
|
+
this.warnOnce(`non-heading:${tag}`, `[lmvz-card] Element <${tag.toLowerCase()}> slotted into "card-title" is not a heading. Slot a heading element (h2-h5) instead.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else if (!this.cardTitle) {
|
|
51
|
+
this.warnOnce('missing-title', '[lmvz-card] Neither a "card-title" slotted heading nor a non-empty "cardTitle" prop was supplied.');
|
|
52
|
+
}
|
|
14
53
|
}
|
|
15
|
-
|
|
16
|
-
|
|
54
|
+
warnOnce(key, message) {
|
|
55
|
+
if (this.warnedCases.has(key))
|
|
56
|
+
return;
|
|
57
|
+
this.warnedCases.add(key);
|
|
58
|
+
console.warn(message);
|
|
17
59
|
}
|
|
18
60
|
render() {
|
|
19
|
-
|
|
20
|
-
backgroundImage: `url(${this.imageUrl ?? this.fallbackImage})`,
|
|
21
|
-
};
|
|
22
|
-
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" }, "..."))))));
|
|
61
|
+
return (h(Host, { key: '21ac0a567bb88d05d247cc3150bf2e7ce26972c5', role: "article" }, h("img", { key: '6cea11ee015059d5537ab64c7cbb1655ac984cb1', class: "image", src: this.imageUrl ?? this.fallbackImage, alt: this.imageAlt, loading: "lazy", decoding: "async" }), h("div", { key: 'cd29132d8268fb5a025cde5c33a858982c8eaaed', class: "content" }, h("div", { key: '0d353a46cae60d81417e5280b39020b2234ad304', class: "title-block" }, h("slot", { key: '4f2734a257ef877d258a717e23855f521c5132a6', name: "card-title", ref: (el) => (this.titleSlotElement = el) }, this.cardTitle && (h("header", { key: '7d526caba45dde6b13bee023e60943711347258a', role: "heading", class: "card-default-title" }, this.cardTitle))), this.description && h("p", { key: '18c3eac26562a592baa29d75674737d11f57beac', class: "description" }, this.description)), h("slot", { key: 'd0d9c40ca8501b0fdfa9d589eeb05692892316a2', name: "chip" }), this.actionLabel && (h("div", { key: '4bd5d9233c0ba1dcda6bebdeff89adbbfe37e4b1', class: "actions" }, h("lmvz-button", { key: '6cefc7ad2859d457ad11b3f4edb1300ba664ef63', class: "action", variant: "secondary", scale: this.size === 'small' ? 'small' : 'default', onLmvzActivation: this.handleActionClick }, this.actionLabel))))));
|
|
23
62
|
}
|
|
24
63
|
static get is() { return "lmvz-card"; }
|
|
25
|
-
static get encapsulation() { return "
|
|
64
|
+
static get encapsulation() { return "shadow"; }
|
|
26
65
|
static get originalStyleUrls() {
|
|
27
66
|
return {
|
|
28
67
|
"$": ["lmvz-card.css"]
|
|
@@ -36,26 +75,56 @@ export class LmvzCard {
|
|
|
36
75
|
static get assetsDirs() { return ["../../assets"]; }
|
|
37
76
|
static get properties() {
|
|
38
77
|
return {
|
|
78
|
+
"size": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"mutable": true,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "Card.Size",
|
|
83
|
+
"resolved": "\"large\" | \"small\"",
|
|
84
|
+
"references": {
|
|
85
|
+
"Card": {
|
|
86
|
+
"location": "import",
|
|
87
|
+
"path": "../../api/ds.types",
|
|
88
|
+
"id": "src/api/ds.types.d.ts::Card",
|
|
89
|
+
"referenceLocation": "Card"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"required": false,
|
|
94
|
+
"optional": false,
|
|
95
|
+
"docs": {
|
|
96
|
+
"tags": [{
|
|
97
|
+
"name": "default",
|
|
98
|
+
"text": "'large'"
|
|
99
|
+
}],
|
|
100
|
+
"text": "Size variant of the card.\nInvalid values are normalized to `large` at runtime."
|
|
101
|
+
},
|
|
102
|
+
"getter": false,
|
|
103
|
+
"setter": false,
|
|
104
|
+
"reflect": true,
|
|
105
|
+
"attribute": "size",
|
|
106
|
+
"defaultValue": "'large'"
|
|
107
|
+
},
|
|
39
108
|
"cardTitle": {
|
|
40
109
|
"type": "string",
|
|
41
110
|
"mutable": false,
|
|
42
111
|
"complexType": {
|
|
43
112
|
"original": "string",
|
|
44
|
-
"resolved": "string",
|
|
113
|
+
"resolved": "string | undefined",
|
|
45
114
|
"references": {}
|
|
46
115
|
},
|
|
47
|
-
"required":
|
|
48
|
-
"optional":
|
|
116
|
+
"required": false,
|
|
117
|
+
"optional": true,
|
|
49
118
|
"docs": {
|
|
50
119
|
"tags": [],
|
|
51
|
-
"text": "Card title
|
|
120
|
+
"text": "Card title text, rendered as the fallback `<h3>` for the `card-title` slot.\nIgnored when a heading is slotted into `card-title`. One of `cardTitle` or a slotted heading should be supplied."
|
|
52
121
|
},
|
|
53
122
|
"getter": false,
|
|
54
123
|
"setter": false,
|
|
55
124
|
"reflect": false,
|
|
56
125
|
"attribute": "card-title"
|
|
57
126
|
},
|
|
58
|
-
"
|
|
127
|
+
"description": {
|
|
59
128
|
"type": "string",
|
|
60
129
|
"mutable": false,
|
|
61
130
|
"complexType": {
|
|
@@ -67,14 +136,14 @@ export class LmvzCard {
|
|
|
67
136
|
"optional": true,
|
|
68
137
|
"docs": {
|
|
69
138
|
"tags": [],
|
|
70
|
-
"text": "Optional
|
|
139
|
+
"text": "Optional description text."
|
|
71
140
|
},
|
|
72
141
|
"getter": false,
|
|
73
142
|
"setter": false,
|
|
74
143
|
"reflect": false,
|
|
75
|
-
"attribute": "
|
|
144
|
+
"attribute": "description"
|
|
76
145
|
},
|
|
77
|
-
"
|
|
146
|
+
"imageUrl": {
|
|
78
147
|
"type": "string",
|
|
79
148
|
"mutable": false,
|
|
80
149
|
"complexType": {
|
|
@@ -86,14 +155,14 @@ export class LmvzCard {
|
|
|
86
155
|
"optional": true,
|
|
87
156
|
"docs": {
|
|
88
157
|
"tags": [],
|
|
89
|
-
"text": "Optional
|
|
158
|
+
"text": "Optional image URL; falls back to a bundled placeholder graphic when unset."
|
|
90
159
|
},
|
|
91
160
|
"getter": false,
|
|
92
161
|
"setter": false,
|
|
93
162
|
"reflect": false,
|
|
94
|
-
"attribute": "
|
|
163
|
+
"attribute": "image-url"
|
|
95
164
|
},
|
|
96
|
-
"
|
|
165
|
+
"imageAlt": {
|
|
97
166
|
"type": "string",
|
|
98
167
|
"mutable": false,
|
|
99
168
|
"complexType": {
|
|
@@ -104,38 +173,62 @@ export class LmvzCard {
|
|
|
104
173
|
"required": false,
|
|
105
174
|
"optional": false,
|
|
106
175
|
"docs": {
|
|
107
|
-
"tags": [
|
|
108
|
-
|
|
176
|
+
"tags": [{
|
|
177
|
+
"name": "default",
|
|
178
|
+
"text": "''"
|
|
179
|
+
}],
|
|
180
|
+
"text": "Accessible alt text for the image."
|
|
109
181
|
},
|
|
110
182
|
"getter": false,
|
|
111
183
|
"setter": false,
|
|
112
184
|
"reflect": false,
|
|
113
|
-
"attribute": "
|
|
185
|
+
"attribute": "image-alt",
|
|
114
186
|
"defaultValue": "''"
|
|
187
|
+
},
|
|
188
|
+
"actionLabel": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"mutable": false,
|
|
191
|
+
"complexType": {
|
|
192
|
+
"original": "string",
|
|
193
|
+
"resolved": "string | undefined",
|
|
194
|
+
"references": {}
|
|
195
|
+
},
|
|
196
|
+
"required": false,
|
|
197
|
+
"optional": true,
|
|
198
|
+
"docs": {
|
|
199
|
+
"tags": [],
|
|
200
|
+
"text": "Label for the card's single action button. The action row renders only when this is a non-empty string."
|
|
201
|
+
},
|
|
202
|
+
"getter": false,
|
|
203
|
+
"setter": false,
|
|
204
|
+
"reflect": false,
|
|
205
|
+
"attribute": "action-label"
|
|
115
206
|
}
|
|
116
207
|
};
|
|
117
208
|
}
|
|
118
209
|
static get events() {
|
|
119
210
|
return [{
|
|
120
|
-
"method": "
|
|
121
|
-
"name": "
|
|
211
|
+
"method": "lmvzCardAction",
|
|
212
|
+
"name": "lmvzCardAction",
|
|
122
213
|
"bubbles": true,
|
|
123
214
|
"cancelable": true,
|
|
124
215
|
"composed": true,
|
|
125
216
|
"docs": {
|
|
126
217
|
"tags": [],
|
|
127
|
-
"text": "
|
|
218
|
+
"text": "Emitted once per activation of the action button."
|
|
128
219
|
},
|
|
129
220
|
"complexType": {
|
|
130
|
-
"original": "
|
|
131
|
-
"resolved": "
|
|
132
|
-
"references": {
|
|
133
|
-
"PointerEvent": {
|
|
134
|
-
"location": "global",
|
|
135
|
-
"id": "global::PointerEvent"
|
|
136
|
-
}
|
|
137
|
-
}
|
|
221
|
+
"original": "void",
|
|
222
|
+
"resolved": "void",
|
|
223
|
+
"references": {}
|
|
138
224
|
}
|
|
139
225
|
}];
|
|
140
226
|
}
|
|
227
|
+
static get elementRef() { return "el"; }
|
|
228
|
+
static get watchers() {
|
|
229
|
+
return [{
|
|
230
|
+
"propName": "size",
|
|
231
|
+
"methodName": "normalizeSize"
|
|
232
|
+
}];
|
|
233
|
+
}
|
|
141
234
|
}
|