@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/components/index.umd.js
CHANGED
|
@@ -4383,7 +4383,7 @@
|
|
|
4383
4383
|
});
|
|
4384
4384
|
}
|
|
4385
4385
|
|
|
4386
|
-
var css_248z$1f = 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}}`;
|
|
4386
|
+
var css_248z$1f = 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}}`;
|
|
4387
4387
|
|
|
4388
4388
|
/**
|
|
4389
4389
|
* @cssprop --sgds-{stateColor} - State colors in hexadecimal value
|
|
@@ -13558,7 +13558,7 @@
|
|
|
13558
13558
|
property({ type: Boolean, reflect: true })
|
|
13559
13559
|
], SgdsButton.prototype, "fullWidth", void 0);
|
|
13560
13560
|
|
|
13561
|
-
var css_248z$Y = 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-
|
|
13561
|
+
var css_248z$Y = 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)}`;
|
|
13562
13562
|
|
|
13563
13563
|
var css_248z$X = 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}`;
|
|
13564
13564
|
|
|
@@ -13573,7 +13573,8 @@
|
|
|
13573
13573
|
class CardElement extends SgdsElement {
|
|
13574
13574
|
constructor() {
|
|
13575
13575
|
super(...arguments);
|
|
13576
|
-
/** Extends the link passed in
|
|
13576
|
+
/** 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.
|
|
13577
|
+
*/
|
|
13577
13578
|
this.stretchedLink = false;
|
|
13578
13579
|
/** Disables the card */
|
|
13579
13580
|
this.disabled = false;
|
|
@@ -13597,14 +13598,6 @@
|
|
|
13597
13598
|
if (childNodes.length > 1) {
|
|
13598
13599
|
return console.error("Multiple elements passed into SgdsCard's link slot");
|
|
13599
13600
|
}
|
|
13600
|
-
if (!this.stretchedLink)
|
|
13601
|
-
return;
|
|
13602
|
-
if (childNodes[0] instanceof HTMLAnchorElement || childNodes[0] instanceof SgdsLink) {
|
|
13603
|
-
const hyperlink = (childNodes[0].querySelector("a") || childNodes[0]);
|
|
13604
|
-
this.card.setAttribute("href", hyperlink.href);
|
|
13605
|
-
const linkSlot = this.shadowRoot.querySelector("slot[name='link']");
|
|
13606
|
-
linkSlot.style.display = "none";
|
|
13607
|
-
}
|
|
13608
13601
|
}
|
|
13609
13602
|
}
|
|
13610
13603
|
CardElement.styles = [...SgdsElement.styles, css_248z$X, css_248z$W, css_248z$V, css_248z$U, css_248z$T, css_248z$Y];
|
|
@@ -13640,7 +13633,9 @@
|
|
|
13640
13633
|
* @slot title - The title of the card
|
|
13641
13634
|
* @slot description - The paragrapher text of the card
|
|
13642
13635
|
* @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.
|
|
13643
|
-
* @slot
|
|
13636
|
+
* @slot footer - Footer area of the card. Accepts links, actions, or any custom content.
|
|
13637
|
+
* @slot link - (@deprecated) Deprecated since 3.3.2 in favour of `footer` slot.
|
|
13638
|
+
* Legacy slot for anchor elements. Use `footer` instead.
|
|
13644
13639
|
*/
|
|
13645
13640
|
class SgdsCard extends CardElement {
|
|
13646
13641
|
constructor() {
|
|
@@ -13649,21 +13644,45 @@
|
|
|
13649
13644
|
this.imagePosition = "before";
|
|
13650
13645
|
/** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */
|
|
13651
13646
|
this.imageAdjustment = "default";
|
|
13652
|
-
this.hasSlotController = new HasSlotController(this, "image", "icon", "menu"
|
|
13647
|
+
this.hasSlotController = new HasSlotController(this, "image", "icon", "menu");
|
|
13648
|
+
}
|
|
13649
|
+
get linkSlotItems() {
|
|
13650
|
+
if (!this.linkNode || this.linkNode.length === 0)
|
|
13651
|
+
return null;
|
|
13652
|
+
const element = this.linkNode[0];
|
|
13653
|
+
return (element.querySelector("a") || element);
|
|
13654
|
+
}
|
|
13655
|
+
get footerSlotItems() {
|
|
13656
|
+
if (!this.footerNode || this.footerNode.length === 0)
|
|
13657
|
+
return null;
|
|
13658
|
+
const element = this.footerNode[0];
|
|
13659
|
+
return (element.querySelector("a") || element);
|
|
13660
|
+
}
|
|
13661
|
+
firstUpdated() {
|
|
13662
|
+
var _a, _b;
|
|
13663
|
+
if (this.stretchedLink) {
|
|
13664
|
+
const footerHref = (_a = this.footerSlotItems) === null || _a === void 0 ? void 0 : _a.href;
|
|
13665
|
+
const linkHref = (_b = this.linkSlotItems) === null || _b === void 0 ? void 0 : _b.href;
|
|
13666
|
+
if (footerHref) {
|
|
13667
|
+
this.card.setAttribute("href", footerHref);
|
|
13668
|
+
}
|
|
13669
|
+
else if (linkHref) {
|
|
13670
|
+
this.card.setAttribute("href", linkHref);
|
|
13671
|
+
}
|
|
13672
|
+
}
|
|
13653
13673
|
}
|
|
13654
13674
|
handleImgSlotChange(e) {
|
|
13655
13675
|
const childNodes = e.target.assignedNodes({ flatten: true });
|
|
13656
13676
|
if (childNodes.length > 1) {
|
|
13657
13677
|
console.error("Multiple elements passed into SgdsCard's image slot");
|
|
13658
13678
|
}
|
|
13659
|
-
if (this.hasSlotController.test("icon") && this.hasSlotController.test("
|
|
13679
|
+
if (this.hasSlotController.test("icon") && this.hasSlotController.test("image")) {
|
|
13660
13680
|
console.error("Both image and icon slots cannot be used together in SgdsCard");
|
|
13661
13681
|
}
|
|
13662
13682
|
}
|
|
13663
13683
|
render() {
|
|
13664
13684
|
const tag = this.stretchedLink ? literal `a` : literal `div`;
|
|
13665
13685
|
const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;
|
|
13666
|
-
const hasDescriptionSlot = this.hasSlotController.test("description");
|
|
13667
13686
|
const hasImageSlot = this.hasSlotController.test("image");
|
|
13668
13687
|
const hasIconSlot = this.hasSlotController.test("icon");
|
|
13669
13688
|
const hasMenuSlot = this.hasSlotController.test("menu");
|
|
@@ -13678,7 +13697,10 @@
|
|
|
13678
13697
|
<div class="card-tinted-bg"></div>
|
|
13679
13698
|
|
|
13680
13699
|
${hasMenuSlot ? html ` <slot name="menu"></slot> ` : nothing}
|
|
13681
|
-
<div class=${classMap({
|
|
13700
|
+
<div class=${classMap({
|
|
13701
|
+
"card-image": hasImageSlot,
|
|
13702
|
+
"card-media": hasIconSlot || hasUpperSlot
|
|
13703
|
+
})}>
|
|
13682
13704
|
<slot name="upper">
|
|
13683
13705
|
${hasImageSlot ? html ` <slot name="image" @slotchange=${this.handleImgSlotChange}></slot> ` : nothing}
|
|
13684
13706
|
${hasIconSlot ? html ` <slot name="icon"></slot> ` : nothing}
|
|
@@ -13693,19 +13715,23 @@
|
|
|
13693
13715
|
</div>
|
|
13694
13716
|
<slot></slot>
|
|
13695
13717
|
</div>
|
|
13696
|
-
|
|
13697
|
-
? html `<p class="card-text">
|
|
13698
|
-
<slot name="description"></slot>
|
|
13699
|
-
</p>`
|
|
13700
|
-
: nothing}
|
|
13718
|
+
<slot name="description"></slot>
|
|
13701
13719
|
<slot name="lower"></slot>
|
|
13702
|
-
<slot name="
|
|
13720
|
+
<slot name="footer">
|
|
13721
|
+
<slot name="link" @slotchange=${this.handleLinkSlotChange}></slot>
|
|
13722
|
+
</slot>
|
|
13703
13723
|
</div>
|
|
13704
13724
|
</${tag}>
|
|
13705
13725
|
`;
|
|
13706
13726
|
}
|
|
13707
13727
|
}
|
|
13708
13728
|
SgdsCard.styles = [...CardElement.styles, css_248z$S];
|
|
13729
|
+
__decorate([
|
|
13730
|
+
queryAssignedElements({ slot: "footer" })
|
|
13731
|
+
], SgdsCard.prototype, "footerNode", void 0);
|
|
13732
|
+
__decorate([
|
|
13733
|
+
queryAssignedElements({ slot: "link" })
|
|
13734
|
+
], SgdsCard.prototype, "linkNode", void 0);
|
|
13709
13735
|
__decorate([
|
|
13710
13736
|
property({ type: String, reflect: true })
|
|
13711
13737
|
], SgdsCard.prototype, "imagePosition", void 0);
|
|
@@ -14817,7 +14843,10 @@
|
|
|
14817
14843
|
* @slot icon - slot for form control icon to be displayed on the right of the input box.
|
|
14818
14844
|
*
|
|
14819
14845
|
* @event sgds-select - Emitted when the combo box's selected value changes.
|
|
14846
|
+
* @event sgds-change - Emitted when the combo box's value changes.
|
|
14820
14847
|
* @event sgds-input - Emitted when user input is received and its value changes.
|
|
14848
|
+
* @event sgds-focus - Emitted when user input is focused.
|
|
14849
|
+
* @event sgds-blur - Emitted when user input is blurred.
|
|
14821
14850
|
*/
|
|
14822
14851
|
class SgdsComboBox extends SelectElement {
|
|
14823
14852
|
constructor() {
|
|
@@ -14954,8 +14983,12 @@
|
|
|
14954
14983
|
}
|
|
14955
14984
|
}
|
|
14956
14985
|
}
|
|
14986
|
+
_handleFocus() {
|
|
14987
|
+
this.emit("sgds-focus");
|
|
14988
|
+
}
|
|
14957
14989
|
async _handleInputBlur(e) {
|
|
14958
14990
|
e.preventDefault();
|
|
14991
|
+
this.emit("sgds-blur");
|
|
14959
14992
|
if (this.multiSelect) {
|
|
14960
14993
|
const displayValueMatchedSelectedItems = this.selectedItems.filter(({ label }) => this.displayValue === label);
|
|
14961
14994
|
if (displayValueMatchedSelectedItems.length <= 0) {
|
|
@@ -15057,6 +15090,7 @@
|
|
|
15057
15090
|
.value=${this.displayValue}
|
|
15058
15091
|
@input=${this._handleInputChange}
|
|
15059
15092
|
@blur=${this._handleInputBlur}
|
|
15093
|
+
@focus=${this._handleFocus}
|
|
15060
15094
|
aria-describedby=${ifDefined(this.invalid && this.hasFeedback ? `${this._controlId}-invalid` : undefined)}
|
|
15061
15095
|
aria-labelledby="${this._labelId} ${this._controlId}Help ${this.invalid && this.hasFeedback
|
|
15062
15096
|
? `${this._controlId}-invalid`
|
|
@@ -26277,7 +26311,7 @@
|
|
|
26277
26311
|
}
|
|
26278
26312
|
}
|
|
26279
26313
|
|
|
26280
|
-
var css_248z$z = 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);
|
|
26314
|
+
var css_248z$z = 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)}}`;
|
|
26281
26315
|
|
|
26282
26316
|
/**
|
|
26283
26317
|
* @summary Drawers slide in from a container to expose additional options and information.
|
|
@@ -26285,6 +26319,7 @@
|
|
|
26285
26319
|
* @slot default - The drawer's main content
|
|
26286
26320
|
* @slot title - The title of the drawer
|
|
26287
26321
|
* @slot description - The description of the drawer
|
|
26322
|
+
* @slot footer - The footer of the drawer
|
|
26288
26323
|
*
|
|
26289
26324
|
* @event sgds-show - Emitted when the drawer opens.
|
|
26290
26325
|
* @event sgds-after-show - Emitted after the drawer opens and all animations are complete.
|
|
@@ -26306,6 +26341,13 @@
|
|
|
26306
26341
|
* use the `show()` and `hide()` methods and this attribute will reflect the drawer's open state.
|
|
26307
26342
|
*/
|
|
26308
26343
|
this.open = false;
|
|
26344
|
+
/**
|
|
26345
|
+
* Defines the size of the drawer panel.
|
|
26346
|
+
* For drawers placed on the left or right (`start`/`end`), this controls the drawer's width.
|
|
26347
|
+
* For drawers placed on the top or bottom, this controls the drawer's height.
|
|
26348
|
+
* Accepts `small`, `medium`, or `large`. Defaults to `small`.
|
|
26349
|
+
*/
|
|
26350
|
+
this.size = "sm";
|
|
26309
26351
|
/** The direction from which the drawer will open. */
|
|
26310
26352
|
this.placement = "end";
|
|
26311
26353
|
/**
|
|
@@ -26321,7 +26363,6 @@
|
|
|
26321
26363
|
};
|
|
26322
26364
|
}
|
|
26323
26365
|
firstUpdated() {
|
|
26324
|
-
this.drawer.hidden = !this.open;
|
|
26325
26366
|
if (this.open) {
|
|
26326
26367
|
this.addOpenListeners();
|
|
26327
26368
|
if (!this.contained) {
|
|
@@ -26459,11 +26500,12 @@
|
|
|
26459
26500
|
return waitForEvent(this, "sgds-after-hide");
|
|
26460
26501
|
}
|
|
26461
26502
|
render() {
|
|
26503
|
+
const isHydrated = this.hasUpdated;
|
|
26504
|
+
const shouldHide = !this.open && !isHydrated;
|
|
26462
26505
|
return html$1 `
|
|
26463
26506
|
<div
|
|
26464
26507
|
class=${classMap({
|
|
26465
26508
|
drawer: true,
|
|
26466
|
-
"drawer-open": this.open,
|
|
26467
26509
|
"drawer-top": this.placement === "top",
|
|
26468
26510
|
"drawer-end": this.placement === "end",
|
|
26469
26511
|
"drawer-bottom": this.placement === "bottom",
|
|
@@ -26471,6 +26513,7 @@
|
|
|
26471
26513
|
"drawer-contained": this.contained,
|
|
26472
26514
|
"drawer-fixed": !this.contained
|
|
26473
26515
|
})}
|
|
26516
|
+
?hidden=${shouldHide}
|
|
26474
26517
|
>
|
|
26475
26518
|
<div class="drawer-overlay" @click=${() => this.requestClose("overlay")} tabindex="-1"></div>
|
|
26476
26519
|
|
|
@@ -26491,6 +26534,7 @@
|
|
|
26491
26534
|
></sgds-close-button>
|
|
26492
26535
|
</header>
|
|
26493
26536
|
<slot class="drawer-body"></slot>
|
|
26537
|
+
<slot name="footer"></slot>
|
|
26494
26538
|
</div>
|
|
26495
26539
|
</div>
|
|
26496
26540
|
`;
|
|
@@ -26513,6 +26557,9 @@
|
|
|
26513
26557
|
__decorate([
|
|
26514
26558
|
property({ type: Boolean, reflect: true })
|
|
26515
26559
|
], SgdsDrawer.prototype, "open", void 0);
|
|
26560
|
+
__decorate([
|
|
26561
|
+
property({ type: String, reflect: true })
|
|
26562
|
+
], SgdsDrawer.prototype, "size", void 0);
|
|
26516
26563
|
__decorate([
|
|
26517
26564
|
property({ type: String, reflect: true })
|
|
26518
26565
|
], SgdsDrawer.prototype, "placement", void 0);
|
|
@@ -26946,16 +26993,30 @@
|
|
|
26946
26993
|
* @slot title - The title of the card
|
|
26947
26994
|
* @slot description - The paragrapher text of the card
|
|
26948
26995
|
* @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.
|
|
26949
|
-
* @slot
|
|
26996
|
+
* @slot footer - Footer area of the card. Accepts links, actions, or any custom content.
|
|
26997
|
+
* @slot link - (@deprecated) Deprecated since 3.3.2 in favour of `footer` slot.
|
|
26998
|
+
* Legacy slot for anchor elements. Use `footer` instead.
|
|
26950
26999
|
*/
|
|
26951
27000
|
class SgdsIconCard extends CardElement {
|
|
26952
27001
|
constructor() {
|
|
26953
27002
|
super(...arguments);
|
|
26954
27003
|
/** Removes the card's internal padding when set to true. */
|
|
26955
27004
|
this.noPadding = false;
|
|
26956
|
-
|
|
27005
|
+
}
|
|
27006
|
+
get linkSlotItems() {
|
|
27007
|
+
if (!this.linkNode || this.linkNode.length === 0)
|
|
27008
|
+
return null;
|
|
27009
|
+
const element = this.linkNode[0];
|
|
27010
|
+
return (element.querySelector("a") || element);
|
|
27011
|
+
}
|
|
27012
|
+
get footerSlotItems() {
|
|
27013
|
+
if (!this.footerNode || this.footerNode.length === 0)
|
|
27014
|
+
return null;
|
|
27015
|
+
const element = this.footerNode[0];
|
|
27016
|
+
return (element.querySelector("a") || element);
|
|
26957
27017
|
}
|
|
26958
27018
|
firstUpdated() {
|
|
27019
|
+
var _a, _b;
|
|
26959
27020
|
if (this._iconNode.length === 0) {
|
|
26960
27021
|
if ((this.orientation === "vertical" && this._upperNode.length === 0) || this.orientation === "horizontal") {
|
|
26961
27022
|
const media = this.shadowRoot.querySelector(".card-media");
|
|
@@ -26965,14 +27026,24 @@
|
|
|
26965
27026
|
body.style.padding = "0px";
|
|
26966
27027
|
}
|
|
26967
27028
|
}
|
|
27029
|
+
if (this.stretchedLink) {
|
|
27030
|
+
const footerHref = (_a = this.footerSlotItems) === null || _a === void 0 ? void 0 : _a.href;
|
|
27031
|
+
const linkHref = (_b = this.linkSlotItems) === null || _b === void 0 ? void 0 : _b.href;
|
|
27032
|
+
if (footerHref) {
|
|
27033
|
+
this.card.setAttribute("href", footerHref);
|
|
27034
|
+
}
|
|
27035
|
+
else if (linkHref) {
|
|
27036
|
+
this.card.setAttribute("href", linkHref);
|
|
27037
|
+
}
|
|
27038
|
+
}
|
|
26968
27039
|
}
|
|
26969
27040
|
render() {
|
|
26970
27041
|
const tag = this.stretchedLink ? literal `a` : literal `div`;
|
|
26971
27042
|
const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;
|
|
26972
|
-
const hasDescriptionSlot = this.hasSlotController.test("description");
|
|
26973
27043
|
return html `
|
|
26974
27044
|
<${tag}
|
|
26975
|
-
class="
|
|
27045
|
+
class="${classMap({
|
|
27046
|
+
card: true,
|
|
26976
27047
|
disabled: this.disabled
|
|
26977
27048
|
})}"
|
|
26978
27049
|
tabindex=${cardTabIndex}
|
|
@@ -26991,13 +27062,11 @@
|
|
|
26991
27062
|
</div>
|
|
26992
27063
|
<slot></slot>
|
|
26993
27064
|
</div>
|
|
26994
|
-
|
|
26995
|
-
? html `<p class="card-text">
|
|
26996
|
-
<slot name="description"></slot>
|
|
26997
|
-
</p>`
|
|
26998
|
-
: nothing}
|
|
27065
|
+
<slot name="description"></slot>
|
|
26999
27066
|
<slot name="lower"></slot>
|
|
27000
|
-
<slot name="
|
|
27067
|
+
<slot name="footer">
|
|
27068
|
+
<slot name="link" @slotchange=${this.handleLinkSlotChange}></slot>
|
|
27069
|
+
</slot>
|
|
27001
27070
|
</div>
|
|
27002
27071
|
</${tag}>
|
|
27003
27072
|
`;
|
|
@@ -27010,6 +27079,12 @@
|
|
|
27010
27079
|
__decorate([
|
|
27011
27080
|
queryAssignedNodes({ slot: "upper", flatten: true })
|
|
27012
27081
|
], SgdsIconCard.prototype, "_upperNode", void 0);
|
|
27082
|
+
__decorate([
|
|
27083
|
+
queryAssignedElements({ slot: "footer" })
|
|
27084
|
+
], SgdsIconCard.prototype, "footerNode", void 0);
|
|
27085
|
+
__decorate([
|
|
27086
|
+
queryAssignedElements({ slot: "link" })
|
|
27087
|
+
], SgdsIconCard.prototype, "linkNode", void 0);
|
|
27013
27088
|
__decorate([
|
|
27014
27089
|
property({ type: Boolean, reflect: true })
|
|
27015
27090
|
], SgdsIconCard.prototype, "noPadding", void 0);
|
|
@@ -27058,7 +27133,9 @@
|
|
|
27058
27133
|
* @slot title - The title of the card
|
|
27059
27134
|
* @slot description - The paragrapher text of the card
|
|
27060
27135
|
* @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.
|
|
27061
|
-
* @slot
|
|
27136
|
+
* @slot footer - Footer area of the card. Accepts links, actions, or any custom content.
|
|
27137
|
+
* @slot link - (@deprecated) Deprecated since 3.3.2 in favour of `footer` slot.
|
|
27138
|
+
* Legacy slot for anchor elements. Use `footer` instead.
|
|
27062
27139
|
*/
|
|
27063
27140
|
class SgdsImageCard extends CardElement {
|
|
27064
27141
|
constructor() {
|
|
@@ -27069,9 +27146,21 @@
|
|
|
27069
27146
|
this.imagePosition = "before";
|
|
27070
27147
|
/** Controls how the image is sized and aligned within the card. Available options: `default`, `padding around`, `aspect ratio` */
|
|
27071
27148
|
this.imageAdjustment = "default";
|
|
27072
|
-
|
|
27149
|
+
}
|
|
27150
|
+
get linkSlotItems() {
|
|
27151
|
+
if (!this.linkNode || this.linkNode.length === 0)
|
|
27152
|
+
return null;
|
|
27153
|
+
const element = this.linkNode[0];
|
|
27154
|
+
return (element.querySelector("a") || element);
|
|
27155
|
+
}
|
|
27156
|
+
get footerSlotItems() {
|
|
27157
|
+
if (!this.footerNode || this.footerNode.length === 0)
|
|
27158
|
+
return null;
|
|
27159
|
+
const element = this.footerNode[0];
|
|
27160
|
+
return (element.querySelector("a") || element);
|
|
27073
27161
|
}
|
|
27074
27162
|
firstUpdated() {
|
|
27163
|
+
var _a, _b;
|
|
27075
27164
|
if (this._imageNode.length === 0) {
|
|
27076
27165
|
const image = this.shadowRoot.querySelector(".card-image");
|
|
27077
27166
|
const body = this.shadowRoot.querySelector(".card-body");
|
|
@@ -27079,6 +27168,16 @@
|
|
|
27079
27168
|
if (this.noPadding)
|
|
27080
27169
|
body.style.padding = "0px";
|
|
27081
27170
|
}
|
|
27171
|
+
if (this.stretchedLink) {
|
|
27172
|
+
const footerHref = (_a = this.footerSlotItems) === null || _a === void 0 ? void 0 : _a.href;
|
|
27173
|
+
const linkHref = (_b = this.linkSlotItems) === null || _b === void 0 ? void 0 : _b.href;
|
|
27174
|
+
if (footerHref) {
|
|
27175
|
+
this.card.setAttribute("href", footerHref);
|
|
27176
|
+
}
|
|
27177
|
+
else if (linkHref) {
|
|
27178
|
+
this.card.setAttribute("href", linkHref);
|
|
27179
|
+
}
|
|
27180
|
+
}
|
|
27082
27181
|
}
|
|
27083
27182
|
handleImgSlotChange(e) {
|
|
27084
27183
|
const childNodes = e.target.assignedNodes({ flatten: true });
|
|
@@ -27089,7 +27188,6 @@
|
|
|
27089
27188
|
render() {
|
|
27090
27189
|
const tag = this.stretchedLink ? literal `a` : literal `div`;
|
|
27091
27190
|
const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;
|
|
27092
|
-
const hasDescriptionSlot = this.hasSlotController.test("description");
|
|
27093
27191
|
return html `
|
|
27094
27192
|
<${tag}
|
|
27095
27193
|
class="card ${classMap({
|
|
@@ -27112,13 +27210,11 @@
|
|
|
27112
27210
|
</div>
|
|
27113
27211
|
<slot></slot>
|
|
27114
27212
|
</div>
|
|
27115
|
-
|
|
27116
|
-
? html `<p class="card-text">
|
|
27117
|
-
<slot name="description"></slot>
|
|
27118
|
-
</p>`
|
|
27119
|
-
: nothing}
|
|
27213
|
+
<slot name="description"></slot>
|
|
27120
27214
|
<slot name="lower"></slot>
|
|
27121
|
-
<slot name="
|
|
27215
|
+
<slot name="footer">
|
|
27216
|
+
<slot name="link" @slotchange=${this.handleLinkSlotChange}></slot>
|
|
27217
|
+
</slot>
|
|
27122
27218
|
</div>
|
|
27123
27219
|
</${tag}>
|
|
27124
27220
|
`;
|
|
@@ -27128,6 +27224,12 @@
|
|
|
27128
27224
|
__decorate([
|
|
27129
27225
|
queryAssignedNodes({ slot: "image", flatten: true })
|
|
27130
27226
|
], SgdsImageCard.prototype, "_imageNode", void 0);
|
|
27227
|
+
__decorate([
|
|
27228
|
+
queryAssignedElements({ slot: "footer" })
|
|
27229
|
+
], SgdsImageCard.prototype, "footerNode", void 0);
|
|
27230
|
+
__decorate([
|
|
27231
|
+
queryAssignedElements({ slot: "link" })
|
|
27232
|
+
], SgdsImageCard.prototype, "linkNode", void 0);
|
|
27131
27233
|
__decorate([
|
|
27132
27234
|
property({ type: Boolean, reflect: true })
|
|
27133
27235
|
], SgdsImageCard.prototype, "noPadding", void 0);
|
|
@@ -27627,7 +27729,8 @@
|
|
|
27627
27729
|
const XL_BREAKPOINT = 1280;
|
|
27628
27730
|
const XXL_BREAKPOINT = 1440;
|
|
27629
27731
|
|
|
27630
|
-
const
|
|
27732
|
+
const MainnavBreakpointContext = createContext("mainnav-context");
|
|
27733
|
+
const MainnavExpandedContext = createContext("mainnav-expanded-context");
|
|
27631
27734
|
|
|
27632
27735
|
var css_248z$t = 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}`;
|
|
27633
27736
|
|
|
@@ -27658,6 +27761,10 @@
|
|
|
27658
27761
|
constructor() {
|
|
27659
27762
|
super();
|
|
27660
27763
|
this._breakpointReached = false;
|
|
27764
|
+
/** Indicates if mobile menu is open or closed */
|
|
27765
|
+
this.expanded = false;
|
|
27766
|
+
/** Denotes the transition state of mobile mainnav menu opening */
|
|
27767
|
+
this.expanding = false;
|
|
27661
27768
|
/** The href link for brand logo */
|
|
27662
27769
|
this.brandHref = "";
|
|
27663
27770
|
this.collapseId = genId("mainnav", "collapse");
|
|
@@ -27665,8 +27772,6 @@
|
|
|
27665
27772
|
this.expand = "lg";
|
|
27666
27773
|
/** @internal */
|
|
27667
27774
|
this.breakpointReached = false;
|
|
27668
|
-
/** @internal */
|
|
27669
|
-
this.expanded = false;
|
|
27670
27775
|
window.addEventListener("resize", () => {
|
|
27671
27776
|
const newBreakpointReachedValue = window.innerWidth < SIZES[this.expand];
|
|
27672
27777
|
if (newBreakpointReachedValue !== this.breakpointReached) {
|
|
@@ -27674,7 +27779,8 @@
|
|
|
27674
27779
|
}
|
|
27675
27780
|
else {
|
|
27676
27781
|
this.body ? (this.body.hidden = true) : null;
|
|
27677
|
-
this.expanded = false;
|
|
27782
|
+
// this.expanded = false;
|
|
27783
|
+
this.expanding = false;
|
|
27678
27784
|
}
|
|
27679
27785
|
if (newBreakpointReachedValue) {
|
|
27680
27786
|
this._handleMobileNav();
|
|
@@ -27699,20 +27805,10 @@
|
|
|
27699
27805
|
connectedCallback() {
|
|
27700
27806
|
super.connectedCallback();
|
|
27701
27807
|
this.addEventListener("click", (event) => this._handleClickOutOfElement(event, this.body));
|
|
27702
|
-
this.addEventListener("sgds-mainnav-close", () => {
|
|
27703
|
-
if (this.breakpointReached) {
|
|
27704
|
-
this.hide();
|
|
27705
|
-
}
|
|
27706
|
-
});
|
|
27707
27808
|
}
|
|
27708
27809
|
disconnectedCallback() {
|
|
27709
27810
|
super.disconnectedCallback();
|
|
27710
27811
|
this.removeEventListener("click", (event) => this._handleClickOutOfElement(event, this.body));
|
|
27711
|
-
this.removeEventListener("sgds-mainnav-close", () => {
|
|
27712
|
-
if (this.breakpointReached) {
|
|
27713
|
-
this.hide();
|
|
27714
|
-
}
|
|
27715
|
-
});
|
|
27716
27812
|
}
|
|
27717
27813
|
firstUpdated() {
|
|
27718
27814
|
if (this.breakpointReached && this.body) {
|
|
@@ -27739,7 +27835,6 @@
|
|
|
27739
27835
|
document.querySelector("body").style.overflow = "hidden";
|
|
27740
27836
|
this.show();
|
|
27741
27837
|
}
|
|
27742
|
-
this.header.focus();
|
|
27743
27838
|
}
|
|
27744
27839
|
async _handleMobileNav() {
|
|
27745
27840
|
if (!this.nav)
|
|
@@ -27759,6 +27854,7 @@
|
|
|
27759
27854
|
async _animateToShow() {
|
|
27760
27855
|
const sgdsShow = this.emit("sgds-show", { cancelable: true });
|
|
27761
27856
|
if (sgdsShow.defaultPrevented) {
|
|
27857
|
+
this.expanding = false;
|
|
27762
27858
|
this.expanded = false;
|
|
27763
27859
|
return;
|
|
27764
27860
|
}
|
|
@@ -27772,6 +27868,7 @@
|
|
|
27772
27868
|
async _animateToHide() {
|
|
27773
27869
|
const slHide = this.emit("sgds-hide", { cancelable: true });
|
|
27774
27870
|
if (slHide.defaultPrevented) {
|
|
27871
|
+
this.expanding = false;
|
|
27775
27872
|
this.expanded = true;
|
|
27776
27873
|
return;
|
|
27777
27874
|
}
|
|
@@ -27783,13 +27880,16 @@
|
|
|
27783
27880
|
this.emit("sgds-after-hide");
|
|
27784
27881
|
}
|
|
27785
27882
|
async handleOpenChange() {
|
|
27786
|
-
if (this.
|
|
27883
|
+
if (this.expanding) {
|
|
27787
27884
|
// Show
|
|
27788
|
-
this._animateToShow();
|
|
27885
|
+
await this._animateToShow();
|
|
27886
|
+
this.expanded = true;
|
|
27789
27887
|
}
|
|
27790
27888
|
else {
|
|
27889
|
+
this.header.focus();
|
|
27791
27890
|
// Hide
|
|
27792
|
-
this._animateToHide();
|
|
27891
|
+
await this._animateToHide();
|
|
27892
|
+
this.expanded = false;
|
|
27793
27893
|
}
|
|
27794
27894
|
}
|
|
27795
27895
|
/** Shows the menu. For when mainnav is in the collapsed form */
|
|
@@ -27797,7 +27897,7 @@
|
|
|
27797
27897
|
if (this.expanded) {
|
|
27798
27898
|
return;
|
|
27799
27899
|
}
|
|
27800
|
-
this.
|
|
27900
|
+
this.expanding = true;
|
|
27801
27901
|
return waitForEvent(this, "sgds-after-show");
|
|
27802
27902
|
}
|
|
27803
27903
|
/** Hide the menu. For when mainnav is in the collapsed form */
|
|
@@ -27805,11 +27905,8 @@
|
|
|
27805
27905
|
if (!this.expanded) {
|
|
27806
27906
|
return;
|
|
27807
27907
|
}
|
|
27808
|
-
this.
|
|
27908
|
+
this.expanding = false;
|
|
27809
27909
|
document.querySelector("body").style.removeProperty("overflow");
|
|
27810
|
-
setTimeout(() => {
|
|
27811
|
-
this.emit("close-dropdown-menu");
|
|
27812
|
-
}, 200);
|
|
27813
27910
|
return waitForEvent(this, "sgds-after-hide");
|
|
27814
27911
|
}
|
|
27815
27912
|
// assigning name attribute to elements added in slot="end", to use wildcard css selector to assign styles only to *-mainnav-item
|
|
@@ -27869,9 +27966,16 @@
|
|
|
27869
27966
|
"sgds-icon-button": SgdsIconButton
|
|
27870
27967
|
};
|
|
27871
27968
|
__decorate([
|
|
27872
|
-
provide({ context:
|
|
27969
|
+
provide({ context: MainnavBreakpointContext }),
|
|
27873
27970
|
state()
|
|
27874
27971
|
], SgdsMainnav.prototype, "_breakpointReached", void 0);
|
|
27972
|
+
__decorate([
|
|
27973
|
+
provide({ context: MainnavExpandedContext }),
|
|
27974
|
+
state()
|
|
27975
|
+
], SgdsMainnav.prototype, "expanded", void 0);
|
|
27976
|
+
__decorate([
|
|
27977
|
+
state()
|
|
27978
|
+
], SgdsMainnav.prototype, "expanding", void 0);
|
|
27875
27979
|
__decorate([
|
|
27876
27980
|
query("nav")
|
|
27877
27981
|
], SgdsMainnav.prototype, "nav", void 0);
|
|
@@ -27899,9 +28003,6 @@
|
|
|
27899
28003
|
__decorate([
|
|
27900
28004
|
state()
|
|
27901
28005
|
], SgdsMainnav.prototype, "breakpointReached", void 0);
|
|
27902
|
-
__decorate([
|
|
27903
|
-
state()
|
|
27904
|
-
], SgdsMainnav.prototype, "expanded", void 0);
|
|
27905
28006
|
__decorate([
|
|
27906
28007
|
queryAssignedElements()
|
|
27907
28008
|
], SgdsMainnav.prototype, "defaultNodes", void 0);
|
|
@@ -27909,7 +28010,7 @@
|
|
|
27909
28010
|
queryAssignedElements({ slot: "end" })
|
|
27910
28011
|
], SgdsMainnav.prototype, "endNodes", void 0);
|
|
27911
28012
|
__decorate([
|
|
27912
|
-
watch("
|
|
28013
|
+
watch("expanding", { waitUntilFirstUpdate: true })
|
|
27913
28014
|
], SgdsMainnav.prototype, "handleOpenChange", null);
|
|
27914
28015
|
setDefaultAnimation("mainnav.show", {
|
|
27915
28016
|
keyframes: [
|
|
@@ -27938,6 +28039,7 @@
|
|
|
27938
28039
|
class SgdsMainnavDropdown extends SgdsElement {
|
|
27939
28040
|
constructor() {
|
|
27940
28041
|
super(...arguments);
|
|
28042
|
+
this._breakpointReached = true;
|
|
27941
28043
|
/** @internal Forwards value to id attribute of toggle button of Dropdown. An unique id generated by default */
|
|
27942
28044
|
this.togglerId = genId("dropdown", "button");
|
|
27943
28045
|
/** When true, applies active styles on the dropdown button */
|
|
@@ -27949,30 +28051,6 @@
|
|
|
27949
28051
|
get defaultSlotItems() {
|
|
27950
28052
|
return [...(this.defaultNodes || [])].filter((node) => typeof node.tagName !== "undefined");
|
|
27951
28053
|
}
|
|
27952
|
-
connectedCallback() {
|
|
27953
|
-
super.connectedCallback();
|
|
27954
|
-
document.addEventListener("close-dropdown-menu", () => {
|
|
27955
|
-
this._resetDropdownMenu();
|
|
27956
|
-
this._hideDropdownMenuItems();
|
|
27957
|
-
});
|
|
27958
|
-
}
|
|
27959
|
-
disconnectedCallback() {
|
|
27960
|
-
super.disconnectedCallback();
|
|
27961
|
-
// Clean up the event listener when the element is removed from the DOM
|
|
27962
|
-
document.removeEventListener("close-dropdown-menu", () => {
|
|
27963
|
-
this._resetDropdownMenu();
|
|
27964
|
-
this._hideDropdownMenuItems();
|
|
27965
|
-
});
|
|
27966
|
-
}
|
|
27967
|
-
willUpdate(changedProperties) {
|
|
27968
|
-
super.willUpdate(changedProperties);
|
|
27969
|
-
if (!this.shadowRoot) {
|
|
27970
|
-
return;
|
|
27971
|
-
}
|
|
27972
|
-
if (this._breakpointReached) {
|
|
27973
|
-
this.shadowRoot.adoptedStyleSheets = [css_248z$14.styleSheet, css_248z$s.styleSheet];
|
|
27974
|
-
}
|
|
27975
|
-
}
|
|
27976
28054
|
updated() {
|
|
27977
28055
|
if (this._breakpointReached) {
|
|
27978
28056
|
this._copyTextToMenu();
|
|
@@ -27994,8 +28072,10 @@
|
|
|
27994
28072
|
link.setAttribute("tabindex", "-1");
|
|
27995
28073
|
}
|
|
27996
28074
|
else {
|
|
27997
|
-
link.addEventListener("click", () => {
|
|
27998
|
-
|
|
28075
|
+
link.addEventListener("click", (e) => {
|
|
28076
|
+
const target = e.target;
|
|
28077
|
+
const mainnav = target.closest("sgds-mainnav");
|
|
28078
|
+
mainnav.hide();
|
|
27999
28079
|
});
|
|
28000
28080
|
}
|
|
28001
28081
|
});
|
|
@@ -28114,12 +28194,9 @@
|
|
|
28114
28194
|
}
|
|
28115
28195
|
}
|
|
28116
28196
|
_closeMenu() {
|
|
28117
|
-
// 200ms delay as the transform transition is set to this timing
|
|
28118
28197
|
this._resetDropdownMenu();
|
|
28119
|
-
|
|
28120
|
-
|
|
28121
|
-
this.navLink.focus();
|
|
28122
|
-
}, 200);
|
|
28198
|
+
this._hideDropdownMenuItems();
|
|
28199
|
+
this.navLink.focus();
|
|
28123
28200
|
}
|
|
28124
28201
|
render() {
|
|
28125
28202
|
const mobileView = html$1 `
|
|
@@ -28185,9 +28262,13 @@
|
|
|
28185
28262
|
"sgds-icon": SgdsIcon
|
|
28186
28263
|
};
|
|
28187
28264
|
__decorate([
|
|
28188
|
-
consume({ context:
|
|
28265
|
+
consume({ context: MainnavBreakpointContext, subscribe: true }),
|
|
28189
28266
|
state()
|
|
28190
28267
|
], SgdsMainnavDropdown.prototype, "_breakpointReached", void 0);
|
|
28268
|
+
__decorate([
|
|
28269
|
+
consume({ context: MainnavExpandedContext, subscribe: true }),
|
|
28270
|
+
state()
|
|
28271
|
+
], SgdsMainnavDropdown.prototype, "expanded", void 0);
|
|
28191
28272
|
__decorate([
|
|
28192
28273
|
query(".nav-link")
|
|
28193
28274
|
], SgdsMainnavDropdown.prototype, "navLink", void 0);
|
|
@@ -28258,8 +28339,10 @@
|
|
|
28258
28339
|
anchor.setAttribute("tabindex", "-1");
|
|
28259
28340
|
return;
|
|
28260
28341
|
}
|
|
28261
|
-
anchor.addEventListener("click", () => {
|
|
28262
|
-
|
|
28342
|
+
anchor.addEventListener("click", (e) => {
|
|
28343
|
+
const target = e.target;
|
|
28344
|
+
const mainnav = target.closest("sgds-mainnav");
|
|
28345
|
+
mainnav.hide();
|
|
28263
28346
|
});
|
|
28264
28347
|
}
|
|
28265
28348
|
}
|
|
@@ -30068,6 +30151,10 @@
|
|
|
30068
30151
|
* @summary Select is used to make one selection from a list through keyboard or mouse actions
|
|
30069
30152
|
*
|
|
30070
30153
|
* @event sgds-select - Emitted when an option is selected and the value of select is updated
|
|
30154
|
+
* @event sgds-change - Emitted when the select value changes.
|
|
30155
|
+
* @event sgds-focus - Emitted when user input is focused.
|
|
30156
|
+
* @event sgds-blur - Emitted when user input is blurred.
|
|
30157
|
+
*
|
|
30071
30158
|
*/
|
|
30072
30159
|
class SgdsSelect extends SelectElement {
|
|
30073
30160
|
connectedCallback() {
|
|
@@ -30092,6 +30179,8 @@
|
|
|
30092
30179
|
}
|
|
30093
30180
|
}
|
|
30094
30181
|
async _handleValueChange() {
|
|
30182
|
+
// when value change, always emit a change event
|
|
30183
|
+
this.emit("sgds-change");
|
|
30095
30184
|
if (this.value) {
|
|
30096
30185
|
this.emit("sgds-select");
|
|
30097
30186
|
}
|
|
@@ -30116,8 +30205,12 @@
|
|
|
30116
30205
|
this.displayValue = this.selectedItems[0].label;
|
|
30117
30206
|
this.hideMenu();
|
|
30118
30207
|
}
|
|
30208
|
+
_handleFocus() {
|
|
30209
|
+
this.emit("sgds-focus");
|
|
30210
|
+
}
|
|
30119
30211
|
async _handleInputBlur(e) {
|
|
30120
30212
|
e.preventDefault();
|
|
30213
|
+
this.emit("sgds-blur");
|
|
30121
30214
|
if (this.selectedItems.length > 0) {
|
|
30122
30215
|
this.displayValue = this.selectedItems[0].label;
|
|
30123
30216
|
}
|
|
@@ -30175,6 +30268,7 @@
|
|
|
30175
30268
|
?required=${this.required}
|
|
30176
30269
|
.value=${this.displayValue}
|
|
30177
30270
|
@blur=${this._handleInputBlur}
|
|
30271
|
+
@focus=${this._handleFocus}
|
|
30178
30272
|
aria-describedby=${ifDefined(this.invalid && this.hasFeedback ? `${this._controlId}-invalid` : undefined)}
|
|
30179
30273
|
aria-labelledby="${this._labelId} ${this._controlId}Help ${this.invalid && this.hasFeedback
|
|
30180
30274
|
? `${this._controlId}-invalid`
|
|
@@ -31901,7 +31995,7 @@
|
|
|
31901
31995
|
watch("value", { waitUntilFirstUpdate: true })
|
|
31902
31996
|
], SgdsTextarea.prototype, "_handleValueChange", null);
|
|
31903
31997
|
|
|
31904
|
-
var css_248z$2 = 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:
|
|
31998
|
+
var css_248z$2 = 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%}`;
|
|
31905
31999
|
|
|
31906
32000
|
/**
|
|
31907
32001
|
* @summary Thumbnail cards can be used for headers and footers, a wide variety of content, contain contextual background colors and images.
|
|
@@ -31912,19 +32006,31 @@
|
|
|
31912
32006
|
* @slot title - The title of the card
|
|
31913
32007
|
* @slot description - The paragrapher text of the card
|
|
31914
32008
|
* @slot lower - Accepts any additional content to be displayed below the card description, such as badges, metadata, or supplementary information.
|
|
31915
|
-
* @slot
|
|
32009
|
+
* @slot footer - Footer area of the card. Accepts links, actions, or any custom content.
|
|
32010
|
+
* @slot link - (@deprecated) Deprecated since 3.3.2 in favour of `footer` slot.
|
|
32011
|
+
* Legacy slot for anchor elements. Use `footer` instead.
|
|
31916
32012
|
*/
|
|
31917
32013
|
class SgdsThumbnailCard extends CardElement {
|
|
31918
32014
|
constructor() {
|
|
31919
32015
|
super(...arguments);
|
|
31920
32016
|
/** Removes the card's internal padding when set to true. */
|
|
31921
32017
|
this.noPadding = false;
|
|
31922
|
-
|
|
32018
|
+
}
|
|
32019
|
+
get linkSlotItems() {
|
|
32020
|
+
if (!this.linkNode || this.linkNode.length === 0)
|
|
32021
|
+
return null;
|
|
32022
|
+
const element = this.linkNode[0];
|
|
32023
|
+
return (element.querySelector("a") || element);
|
|
32024
|
+
}
|
|
32025
|
+
get footerSlotItems() {
|
|
32026
|
+
if (!this.footerNode || this.footerNode.length === 0)
|
|
32027
|
+
return null;
|
|
32028
|
+
const element = this.footerNode[0];
|
|
32029
|
+
return (element.querySelector("a") || element);
|
|
31923
32030
|
}
|
|
31924
32031
|
firstUpdated() {
|
|
32032
|
+
var _a, _b;
|
|
31925
32033
|
if (this._thumbnailNode.length === 0) {
|
|
31926
|
-
const thumbnail = this.shadowRoot.querySelector(".card-thumbnail");
|
|
31927
|
-
thumbnail.style.display = "none";
|
|
31928
32034
|
if ((this.orientation === "vertical" && this._upperNode.length === 0) || this.orientation === "horizontal") {
|
|
31929
32035
|
const media = this.shadowRoot.querySelector(".card-media");
|
|
31930
32036
|
media.style.display = "none";
|
|
@@ -31933,11 +32039,20 @@
|
|
|
31933
32039
|
body.style.padding = "0px";
|
|
31934
32040
|
}
|
|
31935
32041
|
}
|
|
32042
|
+
if (this.stretchedLink) {
|
|
32043
|
+
const footerHref = (_a = this.footerSlotItems) === null || _a === void 0 ? void 0 : _a.href;
|
|
32044
|
+
const linkHref = (_b = this.linkSlotItems) === null || _b === void 0 ? void 0 : _b.href;
|
|
32045
|
+
if (footerHref) {
|
|
32046
|
+
this.card.setAttribute("href", footerHref);
|
|
32047
|
+
}
|
|
32048
|
+
else if (linkHref) {
|
|
32049
|
+
this.card.setAttribute("href", linkHref);
|
|
32050
|
+
}
|
|
32051
|
+
}
|
|
31936
32052
|
}
|
|
31937
32053
|
render() {
|
|
31938
32054
|
const tag = this.stretchedLink ? literal `a` : literal `div`;
|
|
31939
32055
|
const cardTabIndex = !this.stretchedLink || this.disabled ? -1 : 0;
|
|
31940
|
-
const hasDescriptionSlot = this.hasSlotController.test("description");
|
|
31941
32056
|
return html `
|
|
31942
32057
|
<${tag}
|
|
31943
32058
|
class="card ${classMap({
|
|
@@ -31947,9 +32062,7 @@
|
|
|
31947
32062
|
>
|
|
31948
32063
|
${this.tinted && !this.noPadding ? html `<div class="card-tinted-bg"></div>` : nothing}
|
|
31949
32064
|
<div class="card-media">
|
|
31950
|
-
|
|
31951
|
-
<slot name="thumbnail"></slot>
|
|
31952
|
-
</div>
|
|
32065
|
+
<slot name="thumbnail"></slot>
|
|
31953
32066
|
${this.orientation === "vertical" ? html `<slot name="upper"></slot>` : nothing}
|
|
31954
32067
|
</div>
|
|
31955
32068
|
<div class="card-body">
|
|
@@ -31961,13 +32074,11 @@
|
|
|
31961
32074
|
</div>
|
|
31962
32075
|
<slot></slot>
|
|
31963
32076
|
</div>
|
|
31964
|
-
|
|
31965
|
-
? html `<p class="card-text">
|
|
31966
|
-
<slot name="description"></slot>
|
|
31967
|
-
</p>`
|
|
31968
|
-
: nothing}
|
|
32077
|
+
<slot name="description"></slot>
|
|
31969
32078
|
<slot name="lower"></slot>
|
|
31970
|
-
<slot name="
|
|
32079
|
+
<slot name="footer">
|
|
32080
|
+
<slot name="link" @slotchange=${this.handleLinkSlotChange}></slot>
|
|
32081
|
+
</slot>
|
|
31971
32082
|
</div>
|
|
31972
32083
|
</${tag}>
|
|
31973
32084
|
`;
|
|
@@ -31980,6 +32091,12 @@
|
|
|
31980
32091
|
__decorate([
|
|
31981
32092
|
queryAssignedNodes({ slot: "upper", flatten: true })
|
|
31982
32093
|
], SgdsThumbnailCard.prototype, "_upperNode", void 0);
|
|
32094
|
+
__decorate([
|
|
32095
|
+
queryAssignedElements({ slot: "footer" })
|
|
32096
|
+
], SgdsThumbnailCard.prototype, "footerNode", void 0);
|
|
32097
|
+
__decorate([
|
|
32098
|
+
queryAssignedElements({ slot: "link" })
|
|
32099
|
+
], SgdsThumbnailCard.prototype, "linkNode", void 0);
|
|
31983
32100
|
__decorate([
|
|
31984
32101
|
property({ type: Boolean, reflect: true })
|
|
31985
32102
|
], SgdsThumbnailCard.prototype, "noPadding", void 0);
|