@govtechsg/sgds-web-component 3.3.3-rc.2 → 3.4.0-rc.1
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/Masthead/index.js +1 -1
- package/base/card-element.d.ts +2 -1
- package/base/card-element.js +2 -10
- package/base/card-element.js.map +1 -1
- package/base/card.js +1 -1
- package/base/sgds-element2.js +1 -1
- package/components/Accordion/index.umd.js +1 -1
- package/components/Alert/index.umd.js +1 -1
- package/components/Badge/index.umd.js +1 -1
- package/components/Breadcrumb/index.umd.js +1 -1
- package/components/Button/index.umd.js +1 -1
- package/components/Card/index.umd.js +3716 -3705
- package/components/Card/index.umd.js.map +1 -1
- package/components/Card/sgds-card.d.ts +8 -1
- package/components/Card/sgds-card.js +47 -14
- package/components/Card/sgds-card.js.map +1 -1
- package/components/Checkbox/index.umd.js +1 -1
- package/components/ComboBox/index.umd.js +9 -1
- package/components/ComboBox/index.umd.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.d.ts +4 -0
- package/components/ComboBox/sgds-combo-box.js +8 -0
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/index.umd.js +1 -1
- package/components/DescriptionList/index.umd.js +1 -1
- package/components/Divider/index.umd.js +1 -1
- package/components/Drawer/drawer.js +1 -1
- package/components/Drawer/index.umd.js +17 -4
- package/components/Drawer/index.umd.js.map +1 -1
- package/components/Drawer/sgds-drawer.d.ts +8 -0
- package/components/Drawer/sgds-drawer.js +15 -2
- package/components/Drawer/sgds-drawer.js.map +1 -1
- package/components/Dropdown/index.umd.js +1 -1
- package/components/FileUpload/index.umd.js +1 -1
- package/components/Footer/index.umd.js +1 -1
- package/components/Icon/index.umd.js +1 -1
- package/components/IconButton/index.umd.js +1 -1
- package/components/IconCard/index.umd.js +93 -137
- package/components/IconCard/index.umd.js.map +1 -1
- package/components/IconCard/sgds-icon-card.d.ts +7 -2
- package/components/IconCard/sgds-icon-card.js +39 -12
- package/components/IconCard/sgds-icon-card.js.map +1 -1
- package/components/IconList/index.umd.js +1 -1
- package/components/ImageCard/index.umd.js +91 -136
- package/components/ImageCard/index.umd.js.map +1 -1
- package/components/ImageCard/sgds-image-card.d.ts +7 -2
- package/components/ImageCard/sgds-image-card.js +37 -11
- package/components/ImageCard/sgds-image-card.js.map +1 -1
- package/components/Input/index.umd.js +1 -1
- package/components/Link/index.umd.js +1 -1
- package/components/Mainnav/index.umd.js +44 -63
- package/components/Mainnav/index.umd.js.map +1 -1
- package/components/Mainnav/mainnav-context.d.ts +4 -1
- package/components/Mainnav/mainnav-context.js +3 -2
- package/components/Mainnav/mainnav-context.js.map +1 -1
- package/components/Mainnav/sgds-mainnav-dropdown.d.ts +1 -3
- package/components/Mainnav/sgds-mainnav-dropdown.js +13 -33
- package/components/Mainnav/sgds-mainnav-dropdown.js.map +1 -1
- package/components/Mainnav/sgds-mainnav-item.js +4 -2
- package/components/Mainnav/sgds-mainnav-item.js.map +1 -1
- package/components/Mainnav/sgds-mainnav.d.ts +4 -2
- package/components/Mainnav/sgds-mainnav.js +26 -28
- package/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/components/Masthead/index.umd.js +1 -1
- package/components/Modal/index.umd.js +1 -1
- package/components/OverflowMenu/index.umd.js +1 -1
- package/components/Pagination/index.umd.js +1 -1
- package/components/ProgressBar/index.umd.js +1 -1
- package/components/QuantityToggle/index.umd.js +1 -1
- package/components/Radio/index.umd.js +1 -1
- package/components/Select/index.umd.js +12 -1
- package/components/Select/index.umd.js.map +1 -1
- package/components/Select/sgds-select.d.ts +5 -0
- package/components/Select/sgds-select.js +11 -0
- package/components/Select/sgds-select.js.map +1 -1
- package/components/Sidenav/index.umd.js +1 -1
- package/components/Skeleton/index.umd.js +1 -1
- package/components/Spinner/index.umd.js +1 -1
- package/components/Stepper/index.umd.js +1 -1
- package/components/Subnav/index.umd.js +1 -1
- package/components/Switch/index.umd.js +1 -1
- package/components/Tab/index.umd.js +1 -1
- package/components/Table/index.umd.js +1 -1
- package/components/TableOfContents/index.umd.js +1 -1
- package/components/Textarea/index.umd.js +1 -1
- package/components/ThumbnailCard/index.umd.js +93 -142
- package/components/ThumbnailCard/index.umd.js.map +1 -1
- package/components/ThumbnailCard/sgds-thumbnail-card.d.ts +7 -2
- package/components/ThumbnailCard/sgds-thumbnail-card.js +38 -16
- package/components/ThumbnailCard/sgds-thumbnail-card.js.map +1 -1
- package/components/ThumbnailCard/thumbnail-card.js +1 -1
- package/components/Toast/index.umd.js +1 -1
- package/components/Tooltip/index.umd.js +1 -1
- package/components/index.umd.js +238 -121
- package/components/index.umd.js.map +1 -1
- package/index.umd.js +238 -121
- package/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/react/base/card-element.cjs.js +2 -10
- package/react/base/card-element.cjs.js.map +1 -1
- package/react/base/card-element.js +2 -10
- package/react/base/card-element.js.map +1 -1
- package/react/base/card.cjs.js +1 -1
- package/react/base/card.js +1 -1
- package/react/base/sgds-element.cjs2.js +1 -1
- package/react/base/sgds-element2.js +1 -1
- package/react/combo-box/index.cjs.js +3 -0
- package/react/combo-box/index.cjs.js.map +1 -1
- package/react/combo-box/index.js +3 -0
- package/react/combo-box/index.js.map +1 -1
- package/react/components/Card/sgds-card.cjs.js +46 -13
- package/react/components/Card/sgds-card.cjs.js.map +1 -1
- package/react/components/Card/sgds-card.js +47 -14
- package/react/components/Card/sgds-card.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +8 -0
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +8 -0
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Drawer/drawer.cjs.js +1 -1
- package/react/components/Drawer/drawer.js +1 -1
- package/react/components/Drawer/sgds-drawer.cjs.js +15 -2
- package/react/components/Drawer/sgds-drawer.cjs.js.map +1 -1
- package/react/components/Drawer/sgds-drawer.js +15 -2
- package/react/components/Drawer/sgds-drawer.js.map +1 -1
- package/react/components/IconCard/sgds-icon-card.cjs.js +38 -11
- package/react/components/IconCard/sgds-icon-card.cjs.js.map +1 -1
- package/react/components/IconCard/sgds-icon-card.js +39 -12
- package/react/components/IconCard/sgds-icon-card.js.map +1 -1
- package/react/components/ImageCard/sgds-image-card.cjs.js +36 -10
- package/react/components/ImageCard/sgds-image-card.cjs.js.map +1 -1
- package/react/components/ImageCard/sgds-image-card.js +37 -11
- package/react/components/ImageCard/sgds-image-card.js.map +1 -1
- package/react/components/Mainnav/mainnav-context.cjs.js +4 -2
- package/react/components/Mainnav/mainnav-context.cjs.js.map +1 -1
- package/react/components/Mainnav/mainnav-context.js +3 -2
- package/react/components/Mainnav/mainnav-context.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav-dropdown.cjs.js +12 -32
- package/react/components/Mainnav/sgds-mainnav-dropdown.cjs.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav-dropdown.js +13 -33
- package/react/components/Mainnav/sgds-mainnav-dropdown.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav-item.cjs.js +4 -2
- package/react/components/Mainnav/sgds-mainnav-item.cjs.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav-item.js +4 -2
- package/react/components/Mainnav/sgds-mainnav-item.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav.cjs.js +25 -27
- package/react/components/Mainnav/sgds-mainnav.cjs.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav.js +26 -28
- package/react/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/react/components/Select/sgds-select.cjs.js +11 -0
- package/react/components/Select/sgds-select.cjs.js.map +1 -1
- package/react/components/Select/sgds-select.js +11 -0
- package/react/components/Select/sgds-select.js.map +1 -1
- package/react/components/ThumbnailCard/sgds-thumbnail-card.cjs.js +37 -15
- package/react/components/ThumbnailCard/sgds-thumbnail-card.cjs.js.map +1 -1
- package/react/components/ThumbnailCard/sgds-thumbnail-card.js +38 -16
- package/react/components/ThumbnailCard/sgds-thumbnail-card.js.map +1 -1
- package/react/components/ThumbnailCard/thumbnail-card.cjs.js +1 -1
- package/react/components/ThumbnailCard/thumbnail-card.js +1 -1
- package/react/select/index.cjs.js +3 -0
- package/react/select/index.cjs.js.map +1 -1
- package/react/select/index.js +3 -0
- package/react/select/index.js.map +1 -1
package/index.umd.js
CHANGED
|
@@ -4382,7 +4382,7 @@
|
|
|
4382
4382
|
});
|
|
4383
4383
|
}
|
|
4384
4384
|
|
|
4385
|
-
var css_248z$1k = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-body);margin:0;*,:after,:before{box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:var(--sgds-icon-size-lg);margin-left:.25rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:bottom;width:var(--sgds-icon-size-lg)}::slotted(svg){vertical-align:middle}}`;
|
|
4385
|
+
var css_248z$1k = css`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-body);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:var(--sgds-icon-size-lg);margin-left:.25rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:bottom;width:var(--sgds-icon-size-lg)}::slotted(svg){vertical-align:middle}}`;
|
|
4386
4386
|
|
|
4387
4387
|
/**
|
|
4388
4388
|
* @cssprop --sgds-{stateColor} - State colors in hexadecimal value
|
|
@@ -13575,7 +13575,7 @@
|
|
|
13575
13575
|
|
|
13576
13576
|
register("sgds-button", SgdsButton);
|
|
13577
13577
|
|
|
13578
|
-
var css_248z$11 = css`:host([disabled]){cursor:not-allowed}:host([orientation=horizontal]) .card{flex-direction:row}:host(:not([hideBorder])) .card{border:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}:host([orientation=horizontal]) .card-body{flex:1}:host([orientation=horizontal]) .card-media{padding:var(--sgds-padding-xl) var(--sgds-padding-none) var(--sgds-padding-xl) var(--sgds-padding-xl)}:host([orientation=horizontal]) .card-image{width:40%}:host([imagePosition=after]) .card-image{order:1}:host([orientation=vertical][imagePosition=after]) slot[name=image]::slotted(img){border-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1));border-top-left-radius:var(--sgds-border-radius-none);border-top-right-radius:var(--sgds-border-radius-none)}:host([orientation=horizontal][imagePosition=after]) slot[name=image]::slotted(img){border-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1));border-bottom-left-radius:var(--sgds-border-radius-none);border-top-left-radius:var(--sgds-border-radius-none)}:host([orientation=horizontal]) slot[name=image]::slotted(img){border-bottom-left-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1));border-top-right-radius:var(--sgds-border-radius-none);height:100%;object-fit:cover}:host([orientation=vertical][imageAdjustment="padding around"]) .card-image{margin:var(--sgds-margin-sm) var(--sgds-margin-sm) var(--sgds-padding-none)}:host([orientation=vertical][imageAdjustment="padding around"][imagePosition=after]) .card-image{margin:var(--sgds-margin-none) var(--sgds-margin-sm) var(--sgds-margin-sm)}:host([orientation=horizontal][imageAdjustment="padding around"]) .card-image{margin:var(--sgds-margin-sm) var(--sgds-margin-none) var(--sgds-margin-sm) var(--sgds-margin-sm)}:host([orientation=horizontal][imageAdjustment="padding around"][imagePosition=after]) .card-image{margin:var(--sgds-margin-sm) var(--sgds-margin-sm) var(--sgds-margin-sm) var(--sgds-margin-none)}:host([orientation][imageAdjustment="padding around"]) slot[name=image]::slotted(img){border-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1))}:host([orientation=vertical]:not([imageAdjustment="aspect ratio"])) slot[name=image]::slotted(img){height:auto}:host([orientation=vertical][imageAdjustment="aspect ratio"]) slot[name=image]::slotted(img){object-fit:cover}.card{word-wrap:break-word;background-clip:border-box;background-color:var(--sgds-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-md);box-shadow:none;display:flex;flex-direction:column;height:100%;min-width:0;position:relative;transition:box-shadow .3s ease}a.card{color:initial;text-decoration:none}@media (prefers-reduced-motion:reduce){.card{transition:none}}.card.disabled{opacity:var(--sgds-opacity-50);pointer-events:none}a.card:focus{outline:0}a.card:not(.disabled):focus-visible{box-shadow:var(--sgds-box-shadow-focus)}.card-tinted-bg{border-radius:var(--sgds-border-radius-md);bottom:0;left:0;opacity:var(--sgds-opacity-0);position:absolute;right:0;top:0}.card-image{flex:1;position:relative}.card-media{align-items:flex-start;display:flex;justify-content:space-between;line-height:0;padding:var(--sgds-padding-xl) var(--sgds-padding-xl) var(--sgds-padding-none)}.card-
|
|
13578
|
+
var css_248z$11 = css`:host([disabled]){cursor:not-allowed}:host([stretchedLink]) slot[name=footer]::slotted(a),:host([stretchedLink]) slot[name=footer]::slotted(sgds-link),:host([stretchedLink]) slot[name=link]::slotted(a),:host([stretchedLink]) slot[name=link]::slotted(sgds-link){display:none}:host([orientation=horizontal]) .card{flex-direction:row}:host(:not([hideBorder])) .card{border:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}:host([orientation=horizontal]) .card-body{flex:1}:host([orientation=horizontal]) .card-media{padding:var(--sgds-padding-xl) var(--sgds-padding-none) var(--sgds-padding-xl) var(--sgds-padding-xl)}:host([orientation=horizontal]) .card-image{width:40%}:host([imagePosition=after]) .card-image{order:1}:host([orientation=vertical][imagePosition=after]) slot[name=image]::slotted(img){border-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1));border-top-left-radius:var(--sgds-border-radius-none);border-top-right-radius:var(--sgds-border-radius-none)}:host([orientation=horizontal][imagePosition=after]) slot[name=image]::slotted(img){border-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1));border-bottom-left-radius:var(--sgds-border-radius-none);border-top-left-radius:var(--sgds-border-radius-none)}:host([orientation=horizontal]) slot[name=image]::slotted(img){border-bottom-left-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1));border-top-right-radius:var(--sgds-border-radius-none);height:100%;object-fit:cover}:host([orientation=vertical][imageAdjustment="padding around"]) .card-image{margin:var(--sgds-margin-sm) var(--sgds-margin-sm) var(--sgds-padding-none)}:host([orientation=vertical][imageAdjustment="padding around"][imagePosition=after]) .card-image{margin:var(--sgds-margin-none) var(--sgds-margin-sm) var(--sgds-margin-sm)}:host([orientation=horizontal][imageAdjustment="padding around"]) .card-image{margin:var(--sgds-margin-sm) var(--sgds-margin-none) var(--sgds-margin-sm) var(--sgds-margin-sm)}:host([orientation=horizontal][imageAdjustment="padding around"][imagePosition=after]) .card-image{margin:var(--sgds-margin-sm) var(--sgds-margin-sm) var(--sgds-margin-sm) var(--sgds-margin-none)}:host([orientation][imageAdjustment="padding around"]) slot[name=image]::slotted(img){border-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1))}:host([orientation=vertical]:not([imageAdjustment="aspect ratio"])) slot[name=image]::slotted(img){height:auto}:host([orientation=vertical][imageAdjustment="aspect ratio"]) slot[name=image]::slotted(img){object-fit:cover}.card{word-wrap:break-word;background-clip:border-box;background-color:var(--sgds-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-md);box-shadow:none;display:flex;flex-direction:column;height:100%;min-width:0;position:relative;transition:box-shadow .3s ease}a.card{color:initial;text-decoration:none}@media (prefers-reduced-motion:reduce){.card{transition:none}}.card.disabled{opacity:var(--sgds-opacity-50);pointer-events:none}a.card:focus{outline:0}a.card:not(.disabled):focus-visible{box-shadow:var(--sgds-box-shadow-focus)}.card-tinted-bg{border-radius:var(--sgds-border-radius-md);bottom:0;left:0;opacity:var(--sgds-opacity-0);position:absolute;right:0;top:0}.card-image{flex:1;position:relative}.card-media{align-items:flex-start;display:flex;justify-content:space-between;line-height:0;padding:var(--sgds-padding-xl) var(--sgds-padding-xl) var(--sgds-padding-none)}.card-body{color:var(--sgds-body-color-default);display:flex;flex:1 1 auto;flex-direction:column;gap:var(--sgds-gap-xl);padding:var(--sgds-padding-xl);z-index:1}.card-header-container{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}.card-header{display:flex;flex-direction:column;gap:var(--sgds-gap-xs)}.card-title{--sgds-font-size-5:var(--sgds-font-size-4);--sgds-font-size-6:var(--sgds-font-size-4);--sgds-margin-2-xs:var(--sgds-margin-none);--sgds-font-weight-bold:var(--sgds-font-weight-semibold);color:var(--sgds-body-color-default);font-size:var(--sgds-font-size-4);font-weight:var(--sgds-font-weight-semibold);margin-bottom:var(--sgds-margin-none)}slot[name=subtitle]::slotted(*){--sgds-margin-2-xs:var(--sgds-margin-none);--sgds-margin-xs:var(--sgds-margin-none);--sgds-font-size-4:var(--sgds-font-size-1);--sgds-font-size-5:var(--sgds-font-size-1);--sgds-font-size-6:var(--sgds-font-size-1);--sgds-font-weight-bold:var(--sgds-font-weight-semibold);--sgds-line-height-heading:var(--sgds-line-height-min);--sgds-letter-spacing-tight:var(--sgds-letter-spacing-wide);color:var(--sgds-color-subtle);font-size:var(--sgds-font-size-1);font-weight:var(--sgds-font-weight-semibold);letter-spacing:var(--sgds-letter-spacing-wide);line-height:var(--sgds-line-height-min);margin:var(--sgds-margin-none);text-transform:uppercase}slot[name=title]::slotted(a){--sgds-font-size-2:var(--sgds-font-size-4);--sgds-font-weight-regular:var(--sgds-font-weight-semibold);color:var(--sgds-link-color-default);font-size:var(--sgds-font-size-4);font-weight:var(--sgds-font-weight-semibold);text-decoration:none!important}slot[name=description]::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none);color:var(--sgds-color-subtle);margin-bottom:var(--sgds-paragraph-spacing-xl,--sgds-margin-none)}slot[name=image]::slotted(img){border-top-left-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1));border-top-right-radius:calc(var(--sgds-border-radius-md) - var(--sgds-border-width-1));display:block;width:100%}slot[name=footer]::slotted(*),slot[name=link]::slotted(*){margin-top:auto;padding-top:var(--sgds-padding-sm);width:fit-content}slot[name=footer]::slotted(a),slot[name=link]::slotted(a){color:var(--sgds-link-color-default);height:auto!important;text-decoration:none!important}slot[name=footer]::slotted(a:focus),slot[name=footer]::slotted(a:hover),slot[name=link]::slotted(a:focus),slot[name=link]::slotted(a:hover),slot[name=title]::slotted(a:focus),slot[name=title]::slotted(a:hover){color:var(--sgds-link-color-emphasis)}slot[name=footer]::slotted(a:focus),slot[name=link]::slotted(a:focus),slot[name=title]::slotted(a:focus){outline:0}slot[name=footer]::slotted(a:focus-visible),slot[name=link]::slotted(a:focus-visible),slot[name=title]::slotted(a:focus-visible){box-shadow:var(--sgds-box-shadow-focus)}`;
|
|
13579
13579
|
|
|
13580
13580
|
var css_248z$10 = css`.text-primary{color:var(--sgds-primary-rgb)!important}.text-secondary{color:var(--sgds-secondary-rgb)!important}.text-success{color:var(--sgds-success-rgb)!important}.text-info{color:var(--sgds-info-rgb)!important}.text-warning{color:var(--sgds-warning-rgb)!important}.text-danger{color:var(--sgds-danger-rgb)!important}.text-light{color:var(--sgds-light-rgb)!important}.text-dark{color:var(--sgds-dark-rgb)!important}.text-muted{color:var(--sgds-secondary-color)!important}`;
|
|
13581
13581
|
|
|
@@ -13590,7 +13590,8 @@
|
|
|
13590
13590
|
class CardElement extends SgdsElement {
|
|
13591
13591
|
constructor() {
|
|
13592
13592
|
super(...arguments);
|
|
13593
|
-
/** Extends the link passed in
|
|
13593
|
+
/** Extends the link passed in the `link` slot to the entire card. Prefer using the `footer` slot for links going forward. The `link` slot is still supported for backward compatibility, but is **deprecated** and will be removed in a future release.
|
|
13594
|
+
*/
|
|
13594
13595
|
this.stretchedLink = false;
|
|
13595
13596
|
/** Disables the card */
|
|
13596
13597
|
this.disabled = false;
|
|
@@ -13614,14 +13615,6 @@
|
|
|
13614
13615
|
if (childNodes.length > 1) {
|
|
13615
13616
|
return console.error("Multiple elements passed into SgdsCard's link slot");
|
|
13616
13617
|
}
|
|
13617
|
-
if (!this.stretchedLink)
|
|
13618
|
-
return;
|
|
13619
|
-
if (childNodes[0] instanceof HTMLAnchorElement || childNodes[0] instanceof SgdsLink) {
|
|
13620
|
-
const hyperlink = (childNodes[0].querySelector("a") || childNodes[0]);
|
|
13621
|
-
this.card.setAttribute("href", hyperlink.href);
|
|
13622
|
-
const linkSlot = this.shadowRoot.querySelector("slot[name='link']");
|
|
13623
|
-
linkSlot.style.display = "none";
|
|
13624
|
-
}
|
|
13625
13618
|
}
|
|
13626
13619
|
}
|
|
13627
13620
|
CardElement.styles = [...SgdsElement.styles, css_248z$10, css_248z$$, css_248z$_, css_248z$Z, css_248z$Y, css_248z$11];
|
|
@@ -13657,7 +13650,9 @@
|
|
|
13657
13650
|
* @slot title - The title of the card
|
|
13658
13651
|
* @slot description - The paragrapher text of the card
|
|
13659
13652
|
* @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.
|
|
13660
|
-
* @slot
|
|
13653
|
+
* @slot footer - Footer area of the card. Accepts links, actions, or any custom content.
|
|
13654
|
+
* @slot link - (@deprecated) Deprecated since 3.3.2 in favour of `footer` slot.
|
|
13655
|
+
* Legacy slot for anchor elements. Use `footer` instead.
|
|
13661
13656
|
*/
|
|
13662
13657
|
class SgdsCard extends CardElement {
|
|
13663
13658
|
constructor() {
|
|
@@ -13666,21 +13661,45 @@
|
|
|
13666
13661
|
this.imagePosition = "before";
|
|
13667
13662
|
/** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */
|
|
13668
13663
|
this.imageAdjustment = "default";
|
|
13669
|
-
this.hasSlotController = new HasSlotController(this, "image", "icon", "menu"
|
|
13664
|
+
this.hasSlotController = new HasSlotController(this, "image", "icon", "menu");
|
|
13665
|
+
}
|
|
13666
|
+
get linkSlotItems() {
|
|
13667
|
+
if (!this.linkNode || this.linkNode.length === 0)
|
|
13668
|
+
return null;
|
|
13669
|
+
const element = this.linkNode[0];
|
|
13670
|
+
return (element.querySelector("a") || element);
|
|
13671
|
+
}
|
|
13672
|
+
get footerSlotItems() {
|
|
13673
|
+
if (!this.footerNode || this.footerNode.length === 0)
|
|
13674
|
+
return null;
|
|
13675
|
+
const element = this.footerNode[0];
|
|
13676
|
+
return (element.querySelector("a") || element);
|
|
13677
|
+
}
|
|
13678
|
+
firstUpdated() {
|
|
13679
|
+
var _a, _b;
|
|
13680
|
+
if (this.stretchedLink) {
|
|
13681
|
+
const footerHref = (_a = this.footerSlotItems) === null || _a === void 0 ? void 0 : _a.href;
|
|
13682
|
+
const linkHref = (_b = this.linkSlotItems) === null || _b === void 0 ? void 0 : _b.href;
|
|
13683
|
+
if (footerHref) {
|
|
13684
|
+
this.card.setAttribute("href", footerHref);
|
|
13685
|
+
}
|
|
13686
|
+
else if (linkHref) {
|
|
13687
|
+
this.card.setAttribute("href", linkHref);
|
|
13688
|
+
}
|
|
13689
|
+
}
|
|
13670
13690
|
}
|
|
13671
13691
|
handleImgSlotChange(e) {
|
|
13672
13692
|
const childNodes = e.target.assignedNodes({ flatten: true });
|
|
13673
13693
|
if (childNodes.length > 1) {
|
|
13674
13694
|
console.error("Multiple elements passed into SgdsCard's image slot");
|
|
13675
13695
|
}
|
|
13676
|
-
if (this.hasSlotController.test("icon") && this.hasSlotController.test("
|
|
13696
|
+
if (this.hasSlotController.test("icon") && this.hasSlotController.test("image")) {
|
|
13677
13697
|
console.error("Both image and icon slots cannot be used together in SgdsCard");
|
|
13678
13698
|
}
|
|
13679
13699
|
}
|
|
13680
13700
|
render() {
|
|
13681
13701
|
const tag = this.stretchedLink ? literal `a` : literal `div`;
|
|
13682
13702
|
const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;
|
|
13683
|
-
const hasDescriptionSlot = this.hasSlotController.test("description");
|
|
13684
13703
|
const hasImageSlot = this.hasSlotController.test("image");
|
|
13685
13704
|
const hasIconSlot = this.hasSlotController.test("icon");
|
|
13686
13705
|
const hasMenuSlot = this.hasSlotController.test("menu");
|
|
@@ -13695,7 +13714,10 @@
|
|
|
13695
13714
|
<div class="card-tinted-bg"></div>
|
|
13696
13715
|
|
|
13697
13716
|
${hasMenuSlot ? html ` <slot name="menu"></slot> ` : nothing}
|
|
13698
|
-
<div class=${classMap({
|
|
13717
|
+
<div class=${classMap({
|
|
13718
|
+
"card-image": hasImageSlot,
|
|
13719
|
+
"card-media": hasIconSlot || hasUpperSlot
|
|
13720
|
+
})}>
|
|
13699
13721
|
<slot name="upper">
|
|
13700
13722
|
${hasImageSlot ? html ` <slot name="image" @slotchange=${this.handleImgSlotChange}></slot> ` : nothing}
|
|
13701
13723
|
${hasIconSlot ? html ` <slot name="icon"></slot> ` : nothing}
|
|
@@ -13710,19 +13732,23 @@
|
|
|
13710
13732
|
</div>
|
|
13711
13733
|
<slot></slot>
|
|
13712
13734
|
</div>
|
|
13713
|
-
|
|
13714
|
-
? html `<p class="card-text">
|
|
13715
|
-
<slot name="description"></slot>
|
|
13716
|
-
</p>`
|
|
13717
|
-
: nothing}
|
|
13735
|
+
<slot name="description"></slot>
|
|
13718
13736
|
<slot name="lower"></slot>
|
|
13719
|
-
<slot name="
|
|
13737
|
+
<slot name="footer">
|
|
13738
|
+
<slot name="link" @slotchange=${this.handleLinkSlotChange}></slot>
|
|
13739
|
+
</slot>
|
|
13720
13740
|
</div>
|
|
13721
13741
|
</${tag}>
|
|
13722
13742
|
`;
|
|
13723
13743
|
}
|
|
13724
13744
|
}
|
|
13725
13745
|
SgdsCard.styles = [...CardElement.styles, css_248z$X];
|
|
13746
|
+
__decorate([
|
|
13747
|
+
queryAssignedElements({ slot: "footer" })
|
|
13748
|
+
], SgdsCard.prototype, "footerNode", void 0);
|
|
13749
|
+
__decorate([
|
|
13750
|
+
queryAssignedElements({ slot: "link" })
|
|
13751
|
+
], SgdsCard.prototype, "linkNode", void 0);
|
|
13726
13752
|
__decorate([
|
|
13727
13753
|
property({ type: String, reflect: true })
|
|
13728
13754
|
], SgdsCard.prototype, "imagePosition", void 0);
|
|
@@ -14594,7 +14620,10 @@
|
|
|
14594
14620
|
* @slot icon - slot for form control icon to be displayed on the right of the input box.
|
|
14595
14621
|
*
|
|
14596
14622
|
* @event sgds-select - Emitted when the combo box's selected value changes.
|
|
14623
|
+
* @event sgds-change - Emitted when the combo box's value changes.
|
|
14597
14624
|
* @event sgds-input - Emitted when user input is received and its value changes.
|
|
14625
|
+
* @event sgds-focus - Emitted when user input is focused.
|
|
14626
|
+
* @event sgds-blur - Emitted when user input is blurred.
|
|
14598
14627
|
*/
|
|
14599
14628
|
class SgdsComboBox extends SelectElement {
|
|
14600
14629
|
constructor() {
|
|
@@ -14731,8 +14760,12 @@
|
|
|
14731
14760
|
}
|
|
14732
14761
|
}
|
|
14733
14762
|
}
|
|
14763
|
+
_handleFocus() {
|
|
14764
|
+
this.emit("sgds-focus");
|
|
14765
|
+
}
|
|
14734
14766
|
async _handleInputBlur(e) {
|
|
14735
14767
|
e.preventDefault();
|
|
14768
|
+
this.emit("sgds-blur");
|
|
14736
14769
|
if (this.multiSelect) {
|
|
14737
14770
|
const displayValueMatchedSelectedItems = this.selectedItems.filter(({ label }) => this.displayValue === label);
|
|
14738
14771
|
if (displayValueMatchedSelectedItems.length <= 0) {
|
|
@@ -14834,6 +14867,7 @@
|
|
|
14834
14867
|
.value=${this.displayValue}
|
|
14835
14868
|
@input=${this._handleInputChange}
|
|
14836
14869
|
@blur=${this._handleInputBlur}
|
|
14870
|
+
@focus=${this._handleFocus}
|
|
14837
14871
|
aria-describedby=${ifDefined(this.invalid && this.hasFeedback ? `${this._controlId}-invalid` : undefined)}
|
|
14838
14872
|
aria-labelledby="${this._labelId} ${this._controlId}Help ${this.invalid && this.hasFeedback
|
|
14839
14873
|
? `${this._controlId}-invalid`
|
|
@@ -26308,7 +26342,7 @@
|
|
|
26308
26342
|
}
|
|
26309
26343
|
}
|
|
26310
26344
|
|
|
26311
|
-
var css_248z$E = css`:host{display:contents}.drawer{height:100%;inset-inline-start:0;overflow:hidden;pointer-events:none;top:0;width:100%}.drawer-fixed{position:fixed;z-index:1100}.drawer-panel{background-color:var(--sgds-surface-default);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);
|
|
26345
|
+
var css_248z$E = css`:host{display:contents}:host([size=md]) .drawer-end .drawer-panel,:host([size=md]) .drawer-start .drawer-panel{max-width:var(--sgds-dimension-768)}:host([size=md]) .drawer-bottom .drawer-panel,:host([size=md]) .drawer-top .drawer-panel{max-height:var(--sgds-dimension-768)}:host([size=lg]) .drawer-end .drawer-panel,:host([size=lg]) .drawer-start .drawer-panel{max-width:var(--sgds-dimension-1024)}:host([size=lg]) .drawer-bottom .drawer-panel,:host([size=lg]) .drawer-top .drawer-panel{max-height:var(--sgds-dimension-1024)}.drawer{height:100%;inset-inline-start:0;overflow:hidden;pointer-events:none;top:0;width:100%}.drawer-fixed{position:fixed;z-index:1100}.drawer-panel{background-color:var(--sgds-surface-default);display:flex;flex-direction:column;gap:var(--sgds-gap-2-xl);overflow:auto;padding:var(--sgds-padding-lg);pointer-events:all;position:absolute;z-index:2}.drawer-panel:focus{outline:none}.drawer-top .drawer-panel{bottom:auto;height:80%;inset-inline-end:auto;inset-inline-start:0;max-height:var(--sgds-dimension-512);top:0;width:100%}.drawer-end .drawer-panel{bottom:auto;height:100%;inset-inline-end:0;inset-inline-start:auto;max-width:var(--sgds-dimension-512);top:0;width:80%}.drawer-bottom .drawer-panel{bottom:0;height:80%;inset-inline-end:auto;inset-inline-start:0;max-height:var(--sgds-dimension-512);top:auto;width:100%}.drawer-start .drawer-panel{bottom:auto;height:100%;inset-inline-end:auto;inset-inline-start:0;max-width:var(--sgds-dimension-512);top:0;width:80%}.drawer-header{display:flex;flex-direction:column;gap:var(--sgds-gap-sm)}slot[name=title]::slotted(*){--sgds-margin-2-xs:var(--sgds-margin-none);--sgds-margin-xs:var(--sgds-margin-none);--sgds-font-size-6:var(--sgds-font-size-4);--sgds-font-size-7:var(--sgds-font-size-4);color:var(--sgds-color-default)!important;font-size:var(--sgds-font-size-6,var(--sgds-font-size-4));margin-bottom:var(--sgds-margin-2-xs,var(--sgds-margin-none))}slot[name=description]::slotted(*){--sgds-paragraph-spacing-xl:var(--sgds-margin-none);color:var(--sgds-color-subtle);margin-bottom:var(--sgds-paragraph-spacing-xl,var(--sgds-margin-none))}slot[name=footer]::slotted(*){box-shadow:0 -2px 2px 0 hsla(0,0%,5%,.08);margin:var(--sgds-margin-none) calc(var(--sgds-margin-xs)*-1);padding:var(--sgds-padding-lg) var(--sgds-padding-lg) var(--sgds-padding-none)}sgds-close-button{position:absolute;right:8px;top:8px}.drawer-body{-webkit-overflow-scrolling:touch;display:block;flex:1 1 auto;overflow:auto}.drawer-overlay{background-color:var(--sgds-bg-overlay);bottom:0;display:block;left:0;pointer-events:all;position:fixed;right:0;top:0}.drawer-contained .drawer-overlay{display:none}@media screen and (min-width:512px){.drawer-panel{padding:var(--sgds-padding-2-xl)}slot[name=footer]::slotted(*){margin:var(--sgds-margin-none) calc(var(--sgds-margin-md)*-1);padding:var(--sgds-padding-2-xl) var(--sgds-padding-2-xl) var(--sgds-padding-none)}}`;
|
|
26312
26346
|
|
|
26313
26347
|
/**
|
|
26314
26348
|
* @summary Drawers slide in from a container to expose additional options and information.
|
|
@@ -26316,6 +26350,7 @@
|
|
|
26316
26350
|
* @slot default - The drawer's main content
|
|
26317
26351
|
* @slot title - The title of the drawer
|
|
26318
26352
|
* @slot description - The description of the drawer
|
|
26353
|
+
* @slot footer - The footer of the drawer
|
|
26319
26354
|
*
|
|
26320
26355
|
* @event sgds-show - Emitted when the drawer opens.
|
|
26321
26356
|
* @event sgds-after-show - Emitted after the drawer opens and all animations are complete.
|
|
@@ -26337,6 +26372,13 @@
|
|
|
26337
26372
|
* use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.
|
|
26338
26373
|
*/
|
|
26339
26374
|
this.open = false;
|
|
26375
|
+
/**
|
|
26376
|
+
* Defines the size of the drawer panel.
|
|
26377
|
+
* For drawers placed on the left or right (`start`/`end`), this controls the drawer's width.
|
|
26378
|
+
* For drawers placed on the top or bottom, this controls the drawer's height.
|
|
26379
|
+
* Accepts `small`, `medium`, or `large`. Defaults to `small`.
|
|
26380
|
+
*/
|
|
26381
|
+
this.size = "sm";
|
|
26340
26382
|
/** The direction from which the drawer will open. */
|
|
26341
26383
|
this.placement = "end";
|
|
26342
26384
|
/**
|
|
@@ -26352,7 +26394,6 @@
|
|
|
26352
26394
|
};
|
|
26353
26395
|
}
|
|
26354
26396
|
firstUpdated() {
|
|
26355
|
-
this.drawer.hidden = !this.open;
|
|
26356
26397
|
if (this.open) {
|
|
26357
26398
|
this.addOpenListeners();
|
|
26358
26399
|
if (!this.contained) {
|
|
@@ -26490,11 +26531,12 @@
|
|
|
26490
26531
|
return waitForEvent(this, "sgds-after-hide");
|
|
26491
26532
|
}
|
|
26492
26533
|
render() {
|
|
26534
|
+
const isHydrated = this.hasUpdated;
|
|
26535
|
+
const shouldHide = !this.open && !isHydrated;
|
|
26493
26536
|
return html$1 `
|
|
26494
26537
|
<div
|
|
26495
26538
|
class=${classMap({
|
|
26496
26539
|
drawer: true,
|
|
26497
|
-
"drawer-open": this.open,
|
|
26498
26540
|
"drawer-top": this.placement === "top",
|
|
26499
26541
|
"drawer-end": this.placement === "end",
|
|
26500
26542
|
"drawer-bottom": this.placement === "bottom",
|
|
@@ -26502,6 +26544,7 @@
|
|
|
26502
26544
|
"drawer-contained": this.contained,
|
|
26503
26545
|
"drawer-fixed": !this.contained
|
|
26504
26546
|
})}
|
|
26547
|
+
?hidden=${shouldHide}
|
|
26505
26548
|
>
|
|
26506
26549
|
<div class="drawer-overlay" @click=${() => this.requestClose("overlay")} tabindex="-1"></div>
|
|
26507
26550
|
|
|
@@ -26522,6 +26565,7 @@
|
|
|
26522
26565
|
></sgds-close-button>
|
|
26523
26566
|
</header>
|
|
26524
26567
|
<slot class="drawer-body"></slot>
|
|
26568
|
+
<slot name="footer"></slot>
|
|
26525
26569
|
</div>
|
|
26526
26570
|
</div>
|
|
26527
26571
|
`;
|
|
@@ -26544,6 +26588,9 @@
|
|
|
26544
26588
|
__decorate([
|
|
26545
26589
|
property({ type: Boolean, reflect: true })
|
|
26546
26590
|
], SgdsDrawer.prototype, "open", void 0);
|
|
26591
|
+
__decorate([
|
|
26592
|
+
property({ type: String, reflect: true })
|
|
26593
|
+
], SgdsDrawer.prototype, "size", void 0);
|
|
26547
26594
|
__decorate([
|
|
26548
26595
|
property({ type: String, reflect: true })
|
|
26549
26596
|
], SgdsDrawer.prototype, "placement", void 0);
|
|
@@ -27529,7 +27576,8 @@
|
|
|
27529
27576
|
const XL_BREAKPOINT = 1280;
|
|
27530
27577
|
const XXL_BREAKPOINT = 1440;
|
|
27531
27578
|
|
|
27532
|
-
const
|
|
27579
|
+
const MainnavBreakpointContext = createContext("mainnav-context");
|
|
27580
|
+
const MainnavExpandedContext = createContext("mainnav-expanded-context");
|
|
27533
27581
|
|
|
27534
27582
|
var css_248z$z = css`:host{z-index:1200}nav{background-color:var(--sgds-surface-default);box-shadow:0 2px 2px 0 hsla(0,0%,5%,.08)}.navbar{align-items:stretch;display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs);justify-content:space-between;margin:auto;max-width:var(--sgds-mainnav-max-width);min-height:80px;padding:0 var(--sgds-mainnav-padding-x);position:relative;width:100%}@media screen and (max-width:768px){.navbar{padding:0 var(--sgds-mainnav-mobile-padding-x)}}.navbar-brand{align-items:center;display:flex;text-decoration:none;white-space:nowrap}.navbar-brand:focus,.navbar-brand:focus-visible{outline:0}.navbar-brand:focus-visible{box-shadow:var(--sgds-box-shadow-focus)}.navbar-nav{display:flex;flex-direction:column;height:100%;margin-bottom:0;margin-top:0;width:100%}nav>.navbar-body{background-color:var(--sgds-surface-default);border-top:var(--sgds-border-width-1) solid var(--sgds-border-color-translucent);bottom:0;box-shadow:0 2px 2px 0 hsla(0,0%,5%,.08);padding:var(--sgds-padding-md) 0;position:absolute;transition:transform .2s ease-in-out;width:100%;z-index:2000}nav>.navbar-body slot::slotted(:not(sgds-mainnav-item):not(sgds-mainnav-dropdown)){padding:var(--sgds-padding-sm) var(--sgds-mainnav-padding-x)}@media screen and (max-width:768px){nav>.navbar-body slot::slotted(:not(sgds-mainnav-item):not(sgds-mainnav-dropdown)){padding:var(--sgds-padding-sm) var(--sgds-mainnav-mobile-padding-x)}}.navbar-collapse{align-items:center;flex-basis:100%;flex-grow:1}.navbar-toggler{align-self:center}@media (prefers-reduced-motion:reduce){.navbar-toggler{transition:none}}.navbar-nav-scroll{overflow-y:auto}@media (min-width:576px){.navbar-expand-sm{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (min-width:768px){.navbar-expand-md{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (min-width:1024px){.navbar-expand-lg{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (min-width:1280px){.navbar-expand-xl{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .nav-link{padding-left:var(--mainnav-nav-link-padding-x);padding-right:var(--mainnav-nav-link-padding-x)}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}@media (min-width:1440px){.navbar-expand-xxl{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand-xxl .navbar-nav{flex-direction:row}.navbar-expand-xxl .navbar-nav-scroll{overflow:visible}.navbar-expand-xxl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xxl .navbar-toggler{display:none}}.navbar-expand{flex-wrap:nowrap;gap:var(--sgds-gap-xl);justify-content:flex-start}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}slot[name=non-collapsible]{align-items:center;display:flex;gap:var(--sgds-spacer-4);margin-left:auto}.slot-end{align-items:stretch;display:flex;gap:var(--sgds-gap-xs);margin-left:auto}.slot-end::slotted(:not([name$=-mainnav-item]):not([name$=-mainnav-dropdown])){align-self:center}`;
|
|
27535
27583
|
|
|
@@ -27560,6 +27608,10 @@
|
|
|
27560
27608
|
constructor() {
|
|
27561
27609
|
super();
|
|
27562
27610
|
this._breakpointReached = false;
|
|
27611
|
+
/** Indicates if mobile menu is open or closed */
|
|
27612
|
+
this.expanded = false;
|
|
27613
|
+
/** Denotes the transition state of mobile mainnav menu opening */
|
|
27614
|
+
this.expanding = false;
|
|
27563
27615
|
/** The href link for brand logo */
|
|
27564
27616
|
this.brandHref = "";
|
|
27565
27617
|
this.collapseId = genId("mainnav", "collapse");
|
|
@@ -27567,8 +27619,6 @@
|
|
|
27567
27619
|
this.expand = "lg";
|
|
27568
27620
|
/** @internal */
|
|
27569
27621
|
this.breakpointReached = false;
|
|
27570
|
-
/** @internal */
|
|
27571
|
-
this.expanded = false;
|
|
27572
27622
|
window.addEventListener("resize", () => {
|
|
27573
27623
|
const newBreakpointReachedValue = window.innerWidth < SIZES[this.expand];
|
|
27574
27624
|
if (newBreakpointReachedValue !== this.breakpointReached) {
|
|
@@ -27576,7 +27626,8 @@
|
|
|
27576
27626
|
}
|
|
27577
27627
|
else {
|
|
27578
27628
|
this.body ? (this.body.hidden = true) : null;
|
|
27579
|
-
this.expanded = false;
|
|
27629
|
+
// this.expanded = false;
|
|
27630
|
+
this.expanding = false;
|
|
27580
27631
|
}
|
|
27581
27632
|
if (newBreakpointReachedValue) {
|
|
27582
27633
|
this._handleMobileNav();
|
|
@@ -27601,20 +27652,10 @@
|
|
|
27601
27652
|
connectedCallback() {
|
|
27602
27653
|
super.connectedCallback();
|
|
27603
27654
|
this.addEventListener("click", (event) => this._handleClickOutOfElement(event, this.body));
|
|
27604
|
-
this.addEventListener("sgds-mainnav-close", () => {
|
|
27605
|
-
if (this.breakpointReached) {
|
|
27606
|
-
this.hide();
|
|
27607
|
-
}
|
|
27608
|
-
});
|
|
27609
27655
|
}
|
|
27610
27656
|
disconnectedCallback() {
|
|
27611
27657
|
super.disconnectedCallback();
|
|
27612
27658
|
this.removeEventListener("click", (event) => this._handleClickOutOfElement(event, this.body));
|
|
27613
|
-
this.removeEventListener("sgds-mainnav-close", () => {
|
|
27614
|
-
if (this.breakpointReached) {
|
|
27615
|
-
this.hide();
|
|
27616
|
-
}
|
|
27617
|
-
});
|
|
27618
27659
|
}
|
|
27619
27660
|
firstUpdated() {
|
|
27620
27661
|
if (this.breakpointReached && this.body) {
|
|
@@ -27641,7 +27682,6 @@
|
|
|
27641
27682
|
document.querySelector("body").style.overflow = "hidden";
|
|
27642
27683
|
this.show();
|
|
27643
27684
|
}
|
|
27644
|
-
this.header.focus();
|
|
27645
27685
|
}
|
|
27646
27686
|
async _handleMobileNav() {
|
|
27647
27687
|
if (!this.nav)
|
|
@@ -27661,6 +27701,7 @@
|
|
|
27661
27701
|
async _animateToShow() {
|
|
27662
27702
|
const sgdsShow = this.emit("sgds-show", { cancelable: true });
|
|
27663
27703
|
if (sgdsShow.defaultPrevented) {
|
|
27704
|
+
this.expanding = false;
|
|
27664
27705
|
this.expanded = false;
|
|
27665
27706
|
return;
|
|
27666
27707
|
}
|
|
@@ -27674,6 +27715,7 @@
|
|
|
27674
27715
|
async _animateToHide() {
|
|
27675
27716
|
const slHide = this.emit("sgds-hide", { cancelable: true });
|
|
27676
27717
|
if (slHide.defaultPrevented) {
|
|
27718
|
+
this.expanding = false;
|
|
27677
27719
|
this.expanded = true;
|
|
27678
27720
|
return;
|
|
27679
27721
|
}
|
|
@@ -27685,13 +27727,16 @@
|
|
|
27685
27727
|
this.emit("sgds-after-hide");
|
|
27686
27728
|
}
|
|
27687
27729
|
async handleOpenChange() {
|
|
27688
|
-
if (this.
|
|
27730
|
+
if (this.expanding) {
|
|
27689
27731
|
// Show
|
|
27690
|
-
this._animateToShow();
|
|
27732
|
+
await this._animateToShow();
|
|
27733
|
+
this.expanded = true;
|
|
27691
27734
|
}
|
|
27692
27735
|
else {
|
|
27736
|
+
this.header.focus();
|
|
27693
27737
|
// Hide
|
|
27694
|
-
this._animateToHide();
|
|
27738
|
+
await this._animateToHide();
|
|
27739
|
+
this.expanded = false;
|
|
27695
27740
|
}
|
|
27696
27741
|
}
|
|
27697
27742
|
/** Shows the menu. For when mainnav is in the collapsed form */
|
|
@@ -27699,7 +27744,7 @@
|
|
|
27699
27744
|
if (this.expanded) {
|
|
27700
27745
|
return;
|
|
27701
27746
|
}
|
|
27702
|
-
this.
|
|
27747
|
+
this.expanding = true;
|
|
27703
27748
|
return waitForEvent(this, "sgds-after-show");
|
|
27704
27749
|
}
|
|
27705
27750
|
/** Hide the menu. For when mainnav is in the collapsed form */
|
|
@@ -27707,11 +27752,8 @@
|
|
|
27707
27752
|
if (!this.expanded) {
|
|
27708
27753
|
return;
|
|
27709
27754
|
}
|
|
27710
|
-
this.
|
|
27755
|
+
this.expanding = false;
|
|
27711
27756
|
document.querySelector("body").style.removeProperty("overflow");
|
|
27712
|
-
setTimeout(() => {
|
|
27713
|
-
this.emit("close-dropdown-menu");
|
|
27714
|
-
}, 200);
|
|
27715
27757
|
return waitForEvent(this, "sgds-after-hide");
|
|
27716
27758
|
}
|
|
27717
27759
|
// assigning name attribute to elements added in slot="end", to use wildcard css selector to assign styles only to *-mainnav-item
|
|
@@ -27771,9 +27813,16 @@
|
|
|
27771
27813
|
"sgds-icon-button": SgdsIconButton
|
|
27772
27814
|
};
|
|
27773
27815
|
__decorate([
|
|
27774
|
-
provide({ context:
|
|
27816
|
+
provide({ context: MainnavBreakpointContext }),
|
|
27775
27817
|
state()
|
|
27776
27818
|
], SgdsMainnav.prototype, "_breakpointReached", void 0);
|
|
27819
|
+
__decorate([
|
|
27820
|
+
provide({ context: MainnavExpandedContext }),
|
|
27821
|
+
state()
|
|
27822
|
+
], SgdsMainnav.prototype, "expanded", void 0);
|
|
27823
|
+
__decorate([
|
|
27824
|
+
state()
|
|
27825
|
+
], SgdsMainnav.prototype, "expanding", void 0);
|
|
27777
27826
|
__decorate([
|
|
27778
27827
|
query("nav")
|
|
27779
27828
|
], SgdsMainnav.prototype, "nav", void 0);
|
|
@@ -27801,9 +27850,6 @@
|
|
|
27801
27850
|
__decorate([
|
|
27802
27851
|
state()
|
|
27803
27852
|
], SgdsMainnav.prototype, "breakpointReached", void 0);
|
|
27804
|
-
__decorate([
|
|
27805
|
-
state()
|
|
27806
|
-
], SgdsMainnav.prototype, "expanded", void 0);
|
|
27807
27853
|
__decorate([
|
|
27808
27854
|
queryAssignedElements()
|
|
27809
27855
|
], SgdsMainnav.prototype, "defaultNodes", void 0);
|
|
@@ -27811,7 +27857,7 @@
|
|
|
27811
27857
|
queryAssignedElements({ slot: "end" })
|
|
27812
27858
|
], SgdsMainnav.prototype, "endNodes", void 0);
|
|
27813
27859
|
__decorate([
|
|
27814
|
-
watch("
|
|
27860
|
+
watch("expanding", { waitUntilFirstUpdate: true })
|
|
27815
27861
|
], SgdsMainnav.prototype, "handleOpenChange", null);
|
|
27816
27862
|
setDefaultAnimation("mainnav.show", {
|
|
27817
27863
|
keyframes: [
|
|
@@ -27840,6 +27886,7 @@
|
|
|
27840
27886
|
class SgdsMainnavDropdown extends SgdsElement {
|
|
27841
27887
|
constructor() {
|
|
27842
27888
|
super(...arguments);
|
|
27889
|
+
this._breakpointReached = true;
|
|
27843
27890
|
/** @internal Forwards value to id attribute of toggle button of Dropdown. An unique id generated by default */
|
|
27844
27891
|
this.togglerId = genId("dropdown", "button");
|
|
27845
27892
|
/** When true, applies active styles on the dropdown button */
|
|
@@ -27851,30 +27898,6 @@
|
|
|
27851
27898
|
get defaultSlotItems() {
|
|
27852
27899
|
return [...(this.defaultNodes || [])].filter((node) => typeof node.tagName !== "undefined");
|
|
27853
27900
|
}
|
|
27854
|
-
connectedCallback() {
|
|
27855
|
-
super.connectedCallback();
|
|
27856
|
-
document.addEventListener("close-dropdown-menu", () => {
|
|
27857
|
-
this._resetDropdownMenu();
|
|
27858
|
-
this._hideDropdownMenuItems();
|
|
27859
|
-
});
|
|
27860
|
-
}
|
|
27861
|
-
disconnectedCallback() {
|
|
27862
|
-
super.disconnectedCallback();
|
|
27863
|
-
// Clean up the event listener when the element is removed from the DOM
|
|
27864
|
-
document.removeEventListener("close-dropdown-menu", () => {
|
|
27865
|
-
this._resetDropdownMenu();
|
|
27866
|
-
this._hideDropdownMenuItems();
|
|
27867
|
-
});
|
|
27868
|
-
}
|
|
27869
|
-
willUpdate(changedProperties) {
|
|
27870
|
-
super.willUpdate(changedProperties);
|
|
27871
|
-
if (!this.shadowRoot) {
|
|
27872
|
-
return;
|
|
27873
|
-
}
|
|
27874
|
-
if (this._breakpointReached) {
|
|
27875
|
-
this.shadowRoot.adoptedStyleSheets = [css_248z$19.styleSheet, css_248z$y.styleSheet];
|
|
27876
|
-
}
|
|
27877
|
-
}
|
|
27878
27901
|
updated() {
|
|
27879
27902
|
if (this._breakpointReached) {
|
|
27880
27903
|
this._copyTextToMenu();
|
|
@@ -27896,8 +27919,10 @@
|
|
|
27896
27919
|
link.setAttribute("tabindex", "-1");
|
|
27897
27920
|
}
|
|
27898
27921
|
else {
|
|
27899
|
-
link.addEventListener("click", () => {
|
|
27900
|
-
|
|
27922
|
+
link.addEventListener("click", (e) => {
|
|
27923
|
+
const target = e.target;
|
|
27924
|
+
const mainnav = target.closest("sgds-mainnav");
|
|
27925
|
+
mainnav.hide();
|
|
27901
27926
|
});
|
|
27902
27927
|
}
|
|
27903
27928
|
});
|
|
@@ -28016,12 +28041,9 @@
|
|
|
28016
28041
|
}
|
|
28017
28042
|
}
|
|
28018
28043
|
_closeMenu() {
|
|
28019
|
-
// 200ms delay as the transform transition is set to this timing
|
|
28020
28044
|
this._resetDropdownMenu();
|
|
28021
|
-
|
|
28022
|
-
|
|
28023
|
-
this.navLink.focus();
|
|
28024
|
-
}, 200);
|
|
28045
|
+
this._hideDropdownMenuItems();
|
|
28046
|
+
this.navLink.focus();
|
|
28025
28047
|
}
|
|
28026
28048
|
render() {
|
|
28027
28049
|
const mobileView = html$1 `
|
|
@@ -28087,9 +28109,13 @@
|
|
|
28087
28109
|
"sgds-icon": SgdsIcon
|
|
28088
28110
|
};
|
|
28089
28111
|
__decorate([
|
|
28090
|
-
consume({ context:
|
|
28112
|
+
consume({ context: MainnavBreakpointContext, subscribe: true }),
|
|
28091
28113
|
state()
|
|
28092
28114
|
], SgdsMainnavDropdown.prototype, "_breakpointReached", void 0);
|
|
28115
|
+
__decorate([
|
|
28116
|
+
consume({ context: MainnavExpandedContext, subscribe: true }),
|
|
28117
|
+
state()
|
|
28118
|
+
], SgdsMainnavDropdown.prototype, "expanded", void 0);
|
|
28093
28119
|
__decorate([
|
|
28094
28120
|
query(".nav-link")
|
|
28095
28121
|
], SgdsMainnavDropdown.prototype, "navLink", void 0);
|
|
@@ -28160,8 +28186,10 @@
|
|
|
28160
28186
|
anchor.setAttribute("tabindex", "-1");
|
|
28161
28187
|
return;
|
|
28162
28188
|
}
|
|
28163
|
-
anchor.addEventListener("click", () => {
|
|
28164
|
-
|
|
28189
|
+
anchor.addEventListener("click", (e) => {
|
|
28190
|
+
const target = e.target;
|
|
28191
|
+
const mainnav = target.closest("sgds-mainnav");
|
|
28192
|
+
mainnav.hide();
|
|
28165
28193
|
});
|
|
28166
28194
|
}
|
|
28167
28195
|
}
|
|
@@ -32035,6 +32063,10 @@
|
|
|
32035
32063
|
* @summary Select is used to make one selection from a list through keyboard or mouse actions
|
|
32036
32064
|
*
|
|
32037
32065
|
* @event sgds-select - Emitted when an option is selected and the value of select is updated
|
|
32066
|
+
* @event sgds-change - Emitted when the select value changes.
|
|
32067
|
+
* @event sgds-focus - Emitted when user input is focused.
|
|
32068
|
+
* @event sgds-blur - Emitted when user input is blurred.
|
|
32069
|
+
*
|
|
32038
32070
|
*/
|
|
32039
32071
|
class SgdsSelect extends SelectElement {
|
|
32040
32072
|
connectedCallback() {
|
|
@@ -32059,6 +32091,8 @@
|
|
|
32059
32091
|
}
|
|
32060
32092
|
}
|
|
32061
32093
|
async _handleValueChange() {
|
|
32094
|
+
// when value change, always emit a change event
|
|
32095
|
+
this.emit("sgds-change");
|
|
32062
32096
|
if (this.value) {
|
|
32063
32097
|
this.emit("sgds-select");
|
|
32064
32098
|
}
|
|
@@ -32083,8 +32117,12 @@
|
|
|
32083
32117
|
this.displayValue = this.selectedItems[0].label;
|
|
32084
32118
|
this.hideMenu();
|
|
32085
32119
|
}
|
|
32120
|
+
_handleFocus() {
|
|
32121
|
+
this.emit("sgds-focus");
|
|
32122
|
+
}
|
|
32086
32123
|
async _handleInputBlur(e) {
|
|
32087
32124
|
e.preventDefault();
|
|
32125
|
+
this.emit("sgds-blur");
|
|
32088
32126
|
if (this.selectedItems.length > 0) {
|
|
32089
32127
|
this.displayValue = this.selectedItems[0].label;
|
|
32090
32128
|
}
|
|
@@ -32142,6 +32180,7 @@
|
|
|
32142
32180
|
?required=${this.required}
|
|
32143
32181
|
.value=${this.displayValue}
|
|
32144
32182
|
@blur=${this._handleInputBlur}
|
|
32183
|
+
@focus=${this._handleFocus}
|
|
32145
32184
|
aria-describedby=${ifDefined(this.invalid && this.hasFeedback ? `${this._controlId}-invalid` : undefined)}
|
|
32146
32185
|
aria-labelledby="${this._labelId} ${this._controlId}Help ${this.invalid && this.hasFeedback
|
|
32147
32186
|
? `${this._controlId}-invalid`
|
|
@@ -32191,7 +32230,9 @@
|
|
|
32191
32230
|
* @slot title - The title of the card
|
|
32192
32231
|
* @slot description - The paragrapher text of the card
|
|
32193
32232
|
* @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.
|
|
32194
|
-
* @slot
|
|
32233
|
+
* @slot footer - Footer area of the card. Accepts links, actions, or any custom content.
|
|
32234
|
+
* @slot link - (@deprecated) Deprecated since 3.3.2 in favour of `footer` slot.
|
|
32235
|
+
* Legacy slot for anchor elements. Use `footer` instead.
|
|
32195
32236
|
*/
|
|
32196
32237
|
class SgdsImageCard extends CardElement {
|
|
32197
32238
|
constructor() {
|
|
@@ -32202,9 +32243,21 @@
|
|
|
32202
32243
|
this.imagePosition = "before";
|
|
32203
32244
|
/** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */
|
|
32204
32245
|
this.imageAdjustment = "default";
|
|
32205
|
-
|
|
32246
|
+
}
|
|
32247
|
+
get linkSlotItems() {
|
|
32248
|
+
if (!this.linkNode || this.linkNode.length === 0)
|
|
32249
|
+
return null;
|
|
32250
|
+
const element = this.linkNode[0];
|
|
32251
|
+
return (element.querySelector("a") || element);
|
|
32252
|
+
}
|
|
32253
|
+
get footerSlotItems() {
|
|
32254
|
+
if (!this.footerNode || this.footerNode.length === 0)
|
|
32255
|
+
return null;
|
|
32256
|
+
const element = this.footerNode[0];
|
|
32257
|
+
return (element.querySelector("a") || element);
|
|
32206
32258
|
}
|
|
32207
32259
|
firstUpdated() {
|
|
32260
|
+
var _a, _b;
|
|
32208
32261
|
if (this._imageNode.length === 0) {
|
|
32209
32262
|
const image = this.shadowRoot.querySelector(".card-image");
|
|
32210
32263
|
const body = this.shadowRoot.querySelector(".card-body");
|
|
@@ -32212,6 +32265,16 @@
|
|
|
32212
32265
|
if (this.noPadding)
|
|
32213
32266
|
body.style.padding = "0px";
|
|
32214
32267
|
}
|
|
32268
|
+
if (this.stretchedLink) {
|
|
32269
|
+
const footerHref = (_a = this.footerSlotItems) === null || _a === void 0 ? void 0 : _a.href;
|
|
32270
|
+
const linkHref = (_b = this.linkSlotItems) === null || _b === void 0 ? void 0 : _b.href;
|
|
32271
|
+
if (footerHref) {
|
|
32272
|
+
this.card.setAttribute("href", footerHref);
|
|
32273
|
+
}
|
|
32274
|
+
else if (linkHref) {
|
|
32275
|
+
this.card.setAttribute("href", linkHref);
|
|
32276
|
+
}
|
|
32277
|
+
}
|
|
32215
32278
|
}
|
|
32216
32279
|
handleImgSlotChange(e) {
|
|
32217
32280
|
const childNodes = e.target.assignedNodes({ flatten: true });
|
|
@@ -32222,7 +32285,6 @@
|
|
|
32222
32285
|
render() {
|
|
32223
32286
|
const tag = this.stretchedLink ? literal `a` : literal `div`;
|
|
32224
32287
|
const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;
|
|
32225
|
-
const hasDescriptionSlot = this.hasSlotController.test("description");
|
|
32226
32288
|
return html `
|
|
32227
32289
|
<${tag}
|
|
32228
32290
|
class="card ${classMap({
|
|
@@ -32245,13 +32307,11 @@
|
|
|
32245
32307
|
</div>
|
|
32246
32308
|
<slot></slot>
|
|
32247
32309
|
</div>
|
|
32248
|
-
|
|
32249
|
-
? html `<p class="card-text">
|
|
32250
|
-
<slot name="description"></slot>
|
|
32251
|
-
</p>`
|
|
32252
|
-
: nothing}
|
|
32310
|
+
<slot name="description"></slot>
|
|
32253
32311
|
<slot name="lower"></slot>
|
|
32254
|
-
<slot name="
|
|
32312
|
+
<slot name="footer">
|
|
32313
|
+
<slot name="link" @slotchange=${this.handleLinkSlotChange}></slot>
|
|
32314
|
+
</slot>
|
|
32255
32315
|
</div>
|
|
32256
32316
|
</${tag}>
|
|
32257
32317
|
`;
|
|
@@ -32261,6 +32321,12 @@
|
|
|
32261
32321
|
__decorate([
|
|
32262
32322
|
queryAssignedNodes({ slot: "image", flatten: true })
|
|
32263
32323
|
], SgdsImageCard.prototype, "_imageNode", void 0);
|
|
32324
|
+
__decorate([
|
|
32325
|
+
queryAssignedElements({ slot: "footer" })
|
|
32326
|
+
], SgdsImageCard.prototype, "footerNode", void 0);
|
|
32327
|
+
__decorate([
|
|
32328
|
+
queryAssignedElements({ slot: "link" })
|
|
32329
|
+
], SgdsImageCard.prototype, "linkNode", void 0);
|
|
32264
32330
|
__decorate([
|
|
32265
32331
|
property({ type: Boolean, reflect: true })
|
|
32266
32332
|
], SgdsImageCard.prototype, "noPadding", void 0);
|
|
@@ -32273,7 +32339,7 @@
|
|
|
32273
32339
|
|
|
32274
32340
|
customElements.define("sgds-image-card", SgdsImageCard);
|
|
32275
32341
|
|
|
32276
|
-
var css_248z$1 = css`:host([noPadding]) .card{border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent)}:host(:not([noPadding])) .card:not(.disabled):hover{box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 8px 16px 0 hsla(0,0%,5%,.12)}:host([orientation=vertical][noPadding]) .card-body{padding:var(--sgds-padding-xl) var(--sgds-padding-none) var(--sgds-padding-none) var(--sgds-padding-none)}:host([orientation=vertical][imagePosition=after][noPadding]) .card-body{padding:var(--sgds-padding-none) var(--sgds-padding-none) var(--sgds-padding-xl) var(--sgds-padding-none)}:host([orientation=horizontal][noPadding]) .card-body{padding:var(--sgds-padding-none) var(--sgds-padding-none) var(--sgds-padding-none) var(--sgds-padding-xl)}:host([orientation=horizontal][imagePosition=after][noPadding]) .card-body{padding:var(--sgds-padding-none) var(--sgds-padding-xl) var(--sgds-padding-none) var(--sgds-padding-none)}:host([tinted]:not([noPadding])) .card-tinted-bg{background-color:var(--sgds-bg-translucent-subtle);opacity:var(--sgds-opacity-50)}:host([orientation][noPadding]) .card-media{padding:var(--sgds-padding-none)}slot[name=thumbnail]::slotted(*){height:
|
|
32342
|
+
var css_248z$1 = css`:host([noPadding]) .card{border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent)}:host(:not([noPadding])) .card:not(.disabled):hover{box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 8px 16px 0 hsla(0,0%,5%,.12)}:host([orientation=vertical][noPadding]) .card-body{padding:var(--sgds-padding-xl) var(--sgds-padding-none) var(--sgds-padding-none) var(--sgds-padding-none)}:host([orientation=vertical][imagePosition=after][noPadding]) .card-body{padding:var(--sgds-padding-none) var(--sgds-padding-none) var(--sgds-padding-xl) var(--sgds-padding-none)}:host([orientation=horizontal][noPadding]) .card-body{padding:var(--sgds-padding-none) var(--sgds-padding-none) var(--sgds-padding-none) var(--sgds-padding-xl)}:host([orientation=horizontal][imagePosition=after][noPadding]) .card-body{padding:var(--sgds-padding-none) var(--sgds-padding-xl) var(--sgds-padding-none) var(--sgds-padding-none)}:host([tinted]:not([noPadding])) .card-tinted-bg{background-color:var(--sgds-bg-translucent-subtle);opacity:var(--sgds-opacity-50)}:host([orientation][noPadding]) .card-media{padding:var(--sgds-padding-none)}slot[name=thumbnail]::slotted(*){height:64px!important;max-width:128px!important;min-width:64px!important;object-fit:contain;object-position:left;width:100%}`;
|
|
32277
32343
|
|
|
32278
32344
|
/**
|
|
32279
32345
|
* @summary Thumbnail cards can be used for headers and footers, a wide variety of content, contain contextual background colors and images.
|
|
@@ -32284,19 +32350,31 @@
|
|
|
32284
32350
|
* @slot title - The title of the card
|
|
32285
32351
|
* @slot description - The paragrapher text of the card
|
|
32286
32352
|
* @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.
|
|
32287
|
-
* @slot
|
|
32353
|
+
* @slot footer - Footer area of the card. Accepts links, actions, or any custom content.
|
|
32354
|
+
* @slot link - (@deprecated) Deprecated since 3.3.2 in favour of `footer` slot.
|
|
32355
|
+
* Legacy slot for anchor elements. Use `footer` instead.
|
|
32288
32356
|
*/
|
|
32289
32357
|
class SgdsThumbnailCard extends CardElement {
|
|
32290
32358
|
constructor() {
|
|
32291
32359
|
super(...arguments);
|
|
32292
32360
|
/** Removes the card's internal padding when set to true. */
|
|
32293
32361
|
this.noPadding = false;
|
|
32294
|
-
|
|
32362
|
+
}
|
|
32363
|
+
get linkSlotItems() {
|
|
32364
|
+
if (!this.linkNode || this.linkNode.length === 0)
|
|
32365
|
+
return null;
|
|
32366
|
+
const element = this.linkNode[0];
|
|
32367
|
+
return (element.querySelector("a") || element);
|
|
32368
|
+
}
|
|
32369
|
+
get footerSlotItems() {
|
|
32370
|
+
if (!this.footerNode || this.footerNode.length === 0)
|
|
32371
|
+
return null;
|
|
32372
|
+
const element = this.footerNode[0];
|
|
32373
|
+
return (element.querySelector("a") || element);
|
|
32295
32374
|
}
|
|
32296
32375
|
firstUpdated() {
|
|
32376
|
+
var _a, _b;
|
|
32297
32377
|
if (this._thumbnailNode.length === 0) {
|
|
32298
|
-
const thumbnail = this.shadowRoot.querySelector(".card-thumbnail");
|
|
32299
|
-
thumbnail.style.display = "none";
|
|
32300
32378
|
if ((this.orientation === "vertical" && this._upperNode.length === 0) || this.orientation === "horizontal") {
|
|
32301
32379
|
const media = this.shadowRoot.querySelector(".card-media");
|
|
32302
32380
|
media.style.display = "none";
|
|
@@ -32305,11 +32383,20 @@
|
|
|
32305
32383
|
body.style.padding = "0px";
|
|
32306
32384
|
}
|
|
32307
32385
|
}
|
|
32386
|
+
if (this.stretchedLink) {
|
|
32387
|
+
const footerHref = (_a = this.footerSlotItems) === null || _a === void 0 ? void 0 : _a.href;
|
|
32388
|
+
const linkHref = (_b = this.linkSlotItems) === null || _b === void 0 ? void 0 : _b.href;
|
|
32389
|
+
if (footerHref) {
|
|
32390
|
+
this.card.setAttribute("href", footerHref);
|
|
32391
|
+
}
|
|
32392
|
+
else if (linkHref) {
|
|
32393
|
+
this.card.setAttribute("href", linkHref);
|
|
32394
|
+
}
|
|
32395
|
+
}
|
|
32308
32396
|
}
|
|
32309
32397
|
render() {
|
|
32310
32398
|
const tag = this.stretchedLink ? literal `a` : literal `div`;
|
|
32311
32399
|
const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;
|
|
32312
|
-
const hasDescriptionSlot = this.hasSlotController.test("description");
|
|
32313
32400
|
return html `
|
|
32314
32401
|
<${tag}
|
|
32315
32402
|
class="card ${classMap({
|
|
@@ -32319,9 +32406,7 @@
|
|
|
32319
32406
|
>
|
|
32320
32407
|
${this.tinted && !this.noPadding ? html `<div class="card-tinted-bg"></div>` : nothing}
|
|
32321
32408
|
<div class="card-media">
|
|
32322
|
-
|
|
32323
|
-
<slot name="thumbnail"></slot>
|
|
32324
|
-
</div>
|
|
32409
|
+
<slot name="thumbnail"></slot>
|
|
32325
32410
|
${this.orientation === "vertical" ? html `<slot name="upper"></slot>` : nothing}
|
|
32326
32411
|
</div>
|
|
32327
32412
|
<div class="card-body">
|
|
@@ -32333,13 +32418,11 @@
|
|
|
32333
32418
|
</div>
|
|
32334
32419
|
<slot></slot>
|
|
32335
32420
|
</div>
|
|
32336
|
-
|
|
32337
|
-
? html `<p class="card-text">
|
|
32338
|
-
<slot name="description"></slot>
|
|
32339
|
-
</p>`
|
|
32340
|
-
: nothing}
|
|
32421
|
+
<slot name="description"></slot>
|
|
32341
32422
|
<slot name="lower"></slot>
|
|
32342
|
-
<slot name="
|
|
32423
|
+
<slot name="footer">
|
|
32424
|
+
<slot name="link" @slotchange=${this.handleLinkSlotChange}></slot>
|
|
32425
|
+
</slot>
|
|
32343
32426
|
</div>
|
|
32344
32427
|
</${tag}>
|
|
32345
32428
|
`;
|
|
@@ -32352,6 +32435,12 @@
|
|
|
32352
32435
|
__decorate([
|
|
32353
32436
|
queryAssignedNodes({ slot: "upper", flatten: true })
|
|
32354
32437
|
], SgdsThumbnailCard.prototype, "_upperNode", void 0);
|
|
32438
|
+
__decorate([
|
|
32439
|
+
queryAssignedElements({ slot: "footer" })
|
|
32440
|
+
], SgdsThumbnailCard.prototype, "footerNode", void 0);
|
|
32441
|
+
__decorate([
|
|
32442
|
+
queryAssignedElements({ slot: "link" })
|
|
32443
|
+
], SgdsThumbnailCard.prototype, "linkNode", void 0);
|
|
32355
32444
|
__decorate([
|
|
32356
32445
|
property({ type: Boolean, reflect: true })
|
|
32357
32446
|
], SgdsThumbnailCard.prototype, "noPadding", void 0);
|
|
@@ -32369,16 +32458,30 @@
|
|
|
32369
32458
|
* @slot title - The title of the card
|
|
32370
32459
|
* @slot description - The paragrapher text of the card
|
|
32371
32460
|
* @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.
|
|
32372
|
-
* @slot
|
|
32461
|
+
* @slot footer - Footer area of the card. Accepts links, actions, or any custom content.
|
|
32462
|
+
* @slot link - (@deprecated) Deprecated since 3.3.2 in favour of `footer` slot.
|
|
32463
|
+
* Legacy slot for anchor elements. Use `footer` instead.
|
|
32373
32464
|
*/
|
|
32374
32465
|
class SgdsIconCard extends CardElement {
|
|
32375
32466
|
constructor() {
|
|
32376
32467
|
super(...arguments);
|
|
32377
32468
|
/** Removes the card's internal padding when set to true. */
|
|
32378
32469
|
this.noPadding = false;
|
|
32379
|
-
|
|
32470
|
+
}
|
|
32471
|
+
get linkSlotItems() {
|
|
32472
|
+
if (!this.linkNode || this.linkNode.length === 0)
|
|
32473
|
+
return null;
|
|
32474
|
+
const element = this.linkNode[0];
|
|
32475
|
+
return (element.querySelector("a") || element);
|
|
32476
|
+
}
|
|
32477
|
+
get footerSlotItems() {
|
|
32478
|
+
if (!this.footerNode || this.footerNode.length === 0)
|
|
32479
|
+
return null;
|
|
32480
|
+
const element = this.footerNode[0];
|
|
32481
|
+
return (element.querySelector("a") || element);
|
|
32380
32482
|
}
|
|
32381
32483
|
firstUpdated() {
|
|
32484
|
+
var _a, _b;
|
|
32382
32485
|
if (this._iconNode.length === 0) {
|
|
32383
32486
|
if ((this.orientation === "vertical" && this._upperNode.length === 0) || this.orientation === "horizontal") {
|
|
32384
32487
|
const media = this.shadowRoot.querySelector(".card-media");
|
|
@@ -32388,14 +32491,24 @@
|
|
|
32388
32491
|
body.style.padding = "0px";
|
|
32389
32492
|
}
|
|
32390
32493
|
}
|
|
32494
|
+
if (this.stretchedLink) {
|
|
32495
|
+
const footerHref = (_a = this.footerSlotItems) === null || _a === void 0 ? void 0 : _a.href;
|
|
32496
|
+
const linkHref = (_b = this.linkSlotItems) === null || _b === void 0 ? void 0 : _b.href;
|
|
32497
|
+
if (footerHref) {
|
|
32498
|
+
this.card.setAttribute("href", footerHref);
|
|
32499
|
+
}
|
|
32500
|
+
else if (linkHref) {
|
|
32501
|
+
this.card.setAttribute("href", linkHref);
|
|
32502
|
+
}
|
|
32503
|
+
}
|
|
32391
32504
|
}
|
|
32392
32505
|
render() {
|
|
32393
32506
|
const tag = this.stretchedLink ? literal `a` : literal `div`;
|
|
32394
32507
|
const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;
|
|
32395
|
-
const hasDescriptionSlot = this.hasSlotController.test("description");
|
|
32396
32508
|
return html `
|
|
32397
32509
|
<${tag}
|
|
32398
|
-
class="
|
|
32510
|
+
class="${classMap({
|
|
32511
|
+
card: true,
|
|
32399
32512
|
disabled: this.disabled
|
|
32400
32513
|
})}"
|
|
32401
32514
|
tabindex=${cardTabIndex}
|
|
@@ -32414,13 +32527,11 @@
|
|
|
32414
32527
|
</div>
|
|
32415
32528
|
<slot></slot>
|
|
32416
32529
|
</div>
|
|
32417
|
-
|
|
32418
|
-
? html `<p class="card-text">
|
|
32419
|
-
<slot name="description"></slot>
|
|
32420
|
-
</p>`
|
|
32421
|
-
: nothing}
|
|
32530
|
+
<slot name="description"></slot>
|
|
32422
32531
|
<slot name="lower"></slot>
|
|
32423
|
-
<slot name="
|
|
32532
|
+
<slot name="footer">
|
|
32533
|
+
<slot name="link" @slotchange=${this.handleLinkSlotChange}></slot>
|
|
32534
|
+
</slot>
|
|
32424
32535
|
</div>
|
|
32425
32536
|
</${tag}>
|
|
32426
32537
|
`;
|
|
@@ -32433,6 +32544,12 @@
|
|
|
32433
32544
|
__decorate([
|
|
32434
32545
|
queryAssignedNodes({ slot: "upper", flatten: true })
|
|
32435
32546
|
], SgdsIconCard.prototype, "_upperNode", void 0);
|
|
32547
|
+
__decorate([
|
|
32548
|
+
queryAssignedElements({ slot: "footer" })
|
|
32549
|
+
], SgdsIconCard.prototype, "footerNode", void 0);
|
|
32550
|
+
__decorate([
|
|
32551
|
+
queryAssignedElements({ slot: "link" })
|
|
32552
|
+
], SgdsIconCard.prototype, "linkNode", void 0);
|
|
32436
32553
|
__decorate([
|
|
32437
32554
|
property({ type: Boolean, reflect: true })
|
|
32438
32555
|
], SgdsIconCard.prototype, "noPadding", void 0);
|