@fluid-topics/ftds-popover 2.2.7 → 2.2.9

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.
@@ -20,7 +20,7 @@ export class FtdsPopover extends FtLitElement {
20
20
  super(...arguments);
21
21
  this.closeButtonLabel = "close info";
22
22
  this.openButtonIcon = FtdsIcons.QUESTION;
23
- this.openButtonIconVariant = FtdsIconVariants.solid;
23
+ this.openButtonIconVariant = FtdsIconVariants.regular;
24
24
  this.openButtonLabel = "more info";
25
25
  this.openButtonTooltipPosition = "bottom";
26
26
  this.opened = false;
@@ -107,11 +107,15 @@ export class FtdsPopover extends FtLitElement {
107
107
  <ftds-button @focusin=${this.close}
108
108
  secondary
109
109
  part="opening-button"
110
- icon="${this.openButtonIcon}"
111
- variant="${this.openButtonIconVariant}"
112
- size="${this.openButtonSize}" family="${this.openButtonFamily}"
113
- label="${this.openButtonLabel}" tooltipposition="${this.openButtonTooltipPosition}"
114
- aria-haspopup="true" aria-expanded="${this.opened}" aria-controls="${this.wrapperId}"
110
+ .icon=${this.openButtonIcon}
111
+ .iconVariant=${this.openButtonIconVariant}
112
+ .family=${this.openButtonFamily}
113
+ .label=${this.openButtonLabel}
114
+ .tooltipPosition=${this.openButtonTooltipPosition}
115
+ size="${this.openButtonSize}"
116
+ aria-haspopup="true"
117
+ aria-expanded="${this.opened}"
118
+ aria-controls="${this.wrapperId}"
115
119
  @click=${this.open}>
116
120
  </ftds-button>
117
121
  `;
@@ -236,10 +240,10 @@ __decorate([
236
240
  property()
237
241
  ], FtdsPopover.prototype, "closeButtonLabel", void 0);
238
242
  __decorate([
239
- property()
243
+ property({ type: FtdsIcons })
240
244
  ], FtdsPopover.prototype, "openButtonIcon", void 0);
241
245
  __decorate([
242
- property()
246
+ property({ type: FtdsIconVariants })
243
247
  ], FtdsPopover.prototype, "openButtonIconVariant", void 0);
244
248
  __decorate([
245
249
  property()
@@ -2093,7 +2093,7 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
2093
2093
  .hidden {
2094
2094
  display: none;
2095
2095
  }
2096
- `;var ii=E(Cr());var Q=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},B=class extends hr.FtLitElement{constructor(){super(...arguments),this.closeButtonLabel="close info",this.openButtonIcon=p.QUESTION,this.openButtonIconVariant=u.solid,this.openButtonLabel="more info",this.openButtonTooltipPosition="bottom",this.opened=!1,this.hidden=!1,this.openButtonFamily=Je.info,this.isTriggerSlotAssigned=!1,this.heading="",this.margins=rn.default,this.wrapperId="ftds-popover-wrapper",this.headingId="ftds-popover-heading",this.contentId="ftds-popover-content",this.maxWidth=G.maxWidth,this.openButtonSize=Be.small,this.onTriggerSlotChange=()=>{var t,n;let o=(n=(t=this.triggerSlot)===null||t===void 0?void 0:t.assignedElements())!==null&&n!==void 0?n:[];this.isTriggerSlotAssigned=o.length>0},this.onTriggerKeydown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.open())},this.watchFocusIn=t=>{this.popoverWrapper&&!t.composedPath().includes(this.popoverWrapper)&&this.close()},this.watchEscapeKey=t=>{var n;t.key==="Escape"&&(this.close(),(n=this.openingElement)===null||n===void 0||n.focus())}}get openingElement(){var t;let n=(t=this.triggerSlot)===null||t===void 0?void 0:t.assignedElements();return n?.length&&n[0]instanceof HTMLElement?n[0]:this.openingButton}render(){let t={opened:this.opened};return this.hidden?_e.nothing:_e.html`
2096
+ `;var ii=E(Cr());var Q=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},B=class extends hr.FtLitElement{constructor(){super(...arguments),this.closeButtonLabel="close info",this.openButtonIcon=p.QUESTION,this.openButtonIconVariant=u.regular,this.openButtonLabel="more info",this.openButtonTooltipPosition="bottom",this.opened=!1,this.hidden=!1,this.openButtonFamily=Je.info,this.isTriggerSlotAssigned=!1,this.heading="",this.margins=rn.default,this.wrapperId="ftds-popover-wrapper",this.headingId="ftds-popover-heading",this.contentId="ftds-popover-content",this.maxWidth=G.maxWidth,this.openButtonSize=Be.small,this.onTriggerSlotChange=()=>{var t,n;let o=(n=(t=this.triggerSlot)===null||t===void 0?void 0:t.assignedElements())!==null&&n!==void 0?n:[];this.isTriggerSlotAssigned=o.length>0},this.onTriggerKeydown=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this.open())},this.watchFocusIn=t=>{this.popoverWrapper&&!t.composedPath().includes(this.popoverWrapper)&&this.close()},this.watchEscapeKey=t=>{var n;t.key==="Escape"&&(this.close(),(n=this.openingElement)===null||n===void 0||n.focus())}}get openingElement(){var t;let n=(t=this.triggerSlot)===null||t===void 0?void 0:t.assignedElements();return n?.length&&n[0]instanceof HTMLElement?n[0]:this.openingButton}render(){let t={opened:this.opened};return this.hidden?_e.nothing:_e.html`
2097
2097
  <div part="root-container" class="${(0,ii.classMap)(t)}">
2098
2098
  <slot name="trigger"
2099
2099
  @slotchange=${this.onTriggerSlotChange}
@@ -2121,11 +2121,15 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
2121
2121
  <ftds-button @focusin=${this.close}
2122
2122
  secondary
2123
2123
  part="opening-button"
2124
- icon="${this.openButtonIcon}"
2125
- variant="${this.openButtonIconVariant}"
2126
- size="${this.openButtonSize}" family="${this.openButtonFamily}"
2127
- label="${this.openButtonLabel}" tooltipposition="${this.openButtonTooltipPosition}"
2128
- aria-haspopup="true" aria-expanded="${this.opened}" aria-controls="${this.wrapperId}"
2124
+ .icon=${this.openButtonIcon}
2125
+ .iconVariant=${this.openButtonIconVariant}
2126
+ .family=${this.openButtonFamily}
2127
+ .label=${this.openButtonLabel}
2128
+ .tooltipPosition=${this.openButtonTooltipPosition}
2129
+ size="${this.openButtonSize}"
2130
+ aria-haspopup="true"
2131
+ aria-expanded="${this.opened}"
2132
+ aria-controls="${this.wrapperId}"
2129
2133
  @click=${this.open}>
2130
2134
  </ftds-button>
2131
2135
  `}renderClosingButton(){return _e.html`
@@ -2160,7 +2164,7 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
2160
2164
  <div part="popover-sections">
2161
2165
  <slot name="sections" part="popover-sections-slot"></slot>
2162
2166
  </div>
2163
- `}hideUnusedSlots(){var t,n,o;(t=this.popoverLinkTypography)===null||t===void 0||t.classList.toggle("hidden",this.hasEmptySlot(this.slottedLinkContent)),(n=this.popoverContentDiv)===null||n===void 0||n.classList.toggle("hidden",this.hasEmptySlot(this.popoverContentSlot)),(o=this.popoverSectionsDiv)===null||o===void 0||o.classList.toggle("hidden",this.hasEmptySlot(this.popoverSectionsSlot))}hasEmptySlot(t){return(0,hr.unslotText)(t).trim().length===0}updated(t){super.updated(t),t.has("opened")&&(this.opened?setTimeout(()=>{this.positionWrapper(),document.addEventListener("keydown",this.watchEscapeKey),document.addEventListener("focusin",this.watchFocusIn)},0):(document.removeEventListener("keydown",this.watchEscapeKey),document.removeEventListener("focusin",this.watchFocusIn)))}close(){this.opened=!1,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!1}}))}open(){this.opened=!0,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!0}}))}closeAndFocusOpeningButton(){var t;this.close(),(t=this.openingElement)===null||t===void 0||t.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation&&this.openingElement instanceof U&&this.openingElement.showTooltip()}async positionWrapper(){var t,n;if(this.popoverWrapper){if(this.popoverWrapper.classList.remove("positioned"),this.popoverWrapper.style.left="",this.popoverWrapper.style.top="",this.openingElement){let i={placement:"bottom-start",allowedPlacements:["bottom-start","right-start","bottom-end","right-end","left-start","left-end","top-start","top-end"],maxWidthCssVariable:this.maxWidth},{x:s,y:l}=await(0,hr.computeOffsetAutoPosition)(this.openingElement,this.popoverWrapper,i);this.popoverWrapper.style.left=`${s}px`,this.popoverWrapper.style.top=`${l}px`}this.popoverWrapper.classList.add("positioned")}this.hideUnusedSlots(),(t=this.closingButton)===null||t===void 0||t.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation&&((n=this.closingButton)===null||n===void 0||n.showTooltip())}};B.styles=C0;B.elementDefinitions={"ftds-typography":me,"ftds-button":U};Q([(0,K.property)()],B.prototype,"closeButtonLabel",void 0);Q([(0,K.property)()],B.prototype,"openButtonIcon",void 0);Q([(0,K.property)()],B.prototype,"openButtonIconVariant",void 0);Q([(0,K.property)()],B.prototype,"openButtonLabel",void 0);Q([(0,K.property)()],B.prototype,"openButtonTooltipPosition",void 0);Q([(0,K.property)({type:Boolean})],B.prototype,"opened",void 0);Q([(0,K.property)({type:Boolean})],B.prototype,"hidden",void 0);Q([(0,K.property)({type:Je})],B.prototype,"openButtonFamily",void 0);Q([(0,K.state)()],B.prototype,"isTriggerSlotAssigned",void 0);Q([(0,K.property)()],B.prototype,"heading",void 0);Q([(0,K.property)()],B.prototype,"margins",void 0);Q([(0,K.query)('[part="wrapper"]')],B.prototype,"popoverWrapper",void 0);Q([(0,K.query)('slot[name="trigger"]')],B.prototype,"triggerSlot",void 0);Q([(0,K.query)('[part="opening-button"]')],B.prototype,"openingButton",void 0);Q([(0,K.query)('[part="closing-button"]')],B.prototype,"closingButton",void 0);Q([(0,K.query)('[part="content"]')],B.prototype,"popoverContentDiv",void 0);Q([(0,K.query)('[part="popover-content-slot"]')],B.prototype,"popoverContentSlot",void 0);Q([(0,K.query)('[part="popover-link"]')],B.prototype,"slottedLinkContent",void 0);Q([(0,K.query)('[part="popover-link-typography"]')],B.prototype,"popoverLinkTypography",void 0);Q([(0,K.query)('[part="popover-sections"]')],B.prototype,"popoverSectionsDiv",void 0);Q([(0,K.query)('[part="popover-sections-slot"]')],B.prototype,"popoverSectionsSlot",void 0);var nn=E(q()),on=E(ce()),Lo=E(P());var E0=E(q());var L0=E0.css`
2167
+ `}hideUnusedSlots(){var t,n,o;(t=this.popoverLinkTypography)===null||t===void 0||t.classList.toggle("hidden",this.hasEmptySlot(this.slottedLinkContent)),(n=this.popoverContentDiv)===null||n===void 0||n.classList.toggle("hidden",this.hasEmptySlot(this.popoverContentSlot)),(o=this.popoverSectionsDiv)===null||o===void 0||o.classList.toggle("hidden",this.hasEmptySlot(this.popoverSectionsSlot))}hasEmptySlot(t){return(0,hr.unslotText)(t).trim().length===0}updated(t){super.updated(t),t.has("opened")&&(this.opened?setTimeout(()=>{this.positionWrapper(),document.addEventListener("keydown",this.watchEscapeKey),document.addEventListener("focusin",this.watchFocusIn)},0):(document.removeEventListener("keydown",this.watchEscapeKey),document.removeEventListener("focusin",this.watchFocusIn)))}close(){this.opened=!1,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!1}}))}open(){this.opened=!0,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!0}}))}closeAndFocusOpeningButton(){var t;this.close(),(t=this.openingElement)===null||t===void 0||t.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation&&this.openingElement instanceof U&&this.openingElement.showTooltip()}async positionWrapper(){var t,n;if(this.popoverWrapper){if(this.popoverWrapper.classList.remove("positioned"),this.popoverWrapper.style.left="",this.popoverWrapper.style.top="",this.openingElement){let i={placement:"bottom-start",allowedPlacements:["bottom-start","right-start","bottom-end","right-end","left-start","left-end","top-start","top-end"],maxWidthCssVariable:this.maxWidth},{x:s,y:l}=await(0,hr.computeOffsetAutoPosition)(this.openingElement,this.popoverWrapper,i);this.popoverWrapper.style.left=`${s}px`,this.popoverWrapper.style.top=`${l}px`}this.popoverWrapper.classList.add("positioned")}this.hideUnusedSlots(),(t=this.closingButton)===null||t===void 0||t.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation&&((n=this.closingButton)===null||n===void 0||n.showTooltip())}};B.styles=C0;B.elementDefinitions={"ftds-typography":me,"ftds-button":U};Q([(0,K.property)()],B.prototype,"closeButtonLabel",void 0);Q([(0,K.property)({type:p})],B.prototype,"openButtonIcon",void 0);Q([(0,K.property)({type:u})],B.prototype,"openButtonIconVariant",void 0);Q([(0,K.property)()],B.prototype,"openButtonLabel",void 0);Q([(0,K.property)()],B.prototype,"openButtonTooltipPosition",void 0);Q([(0,K.property)({type:Boolean})],B.prototype,"opened",void 0);Q([(0,K.property)({type:Boolean})],B.prototype,"hidden",void 0);Q([(0,K.property)({type:Je})],B.prototype,"openButtonFamily",void 0);Q([(0,K.state)()],B.prototype,"isTriggerSlotAssigned",void 0);Q([(0,K.property)()],B.prototype,"heading",void 0);Q([(0,K.property)()],B.prototype,"margins",void 0);Q([(0,K.query)('[part="wrapper"]')],B.prototype,"popoverWrapper",void 0);Q([(0,K.query)('slot[name="trigger"]')],B.prototype,"triggerSlot",void 0);Q([(0,K.query)('[part="opening-button"]')],B.prototype,"openingButton",void 0);Q([(0,K.query)('[part="closing-button"]')],B.prototype,"closingButton",void 0);Q([(0,K.query)('[part="content"]')],B.prototype,"popoverContentDiv",void 0);Q([(0,K.query)('[part="popover-content-slot"]')],B.prototype,"popoverContentSlot",void 0);Q([(0,K.query)('[part="popover-link"]')],B.prototype,"slottedLinkContent",void 0);Q([(0,K.query)('[part="popover-link-typography"]')],B.prototype,"popoverLinkTypography",void 0);Q([(0,K.query)('[part="popover-sections"]')],B.prototype,"popoverSectionsDiv",void 0);Q([(0,K.query)('[part="popover-sections-slot"]')],B.prototype,"popoverSectionsSlot",void 0);var nn=E(q()),on=E(ce()),Lo=E(P());var E0=E(q());var L0=E0.css`
2164
2168
  .ftds-popover-section--heading ftds-typography {
2165
2169
  flex-grow: 1;
2166
2170
  flex-shrink: 1;
@@ -2173,7 +2173,7 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
2173
2173
  .hidden {
2174
2174
  display: none;
2175
2175
  }
2176
- `;var ie=function(t,e,r,o){var a=arguments.length,i=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Z=class extends q{constructor(){super(...arguments),this.closeButtonLabel="close info",this.openButtonIcon=h.QUESTION,this.openButtonIconVariant=p.solid,this.openButtonLabel="more info",this.openButtonTooltipPosition="bottom",this.opened=!1,this.hidden=!1,this.openButtonFamily=Fe.info,this.isTriggerSlotAssigned=!1,this.heading="",this.margins=Po.default,this.wrapperId="ftds-popover-wrapper",this.headingId="ftds-popover-heading",this.contentId="ftds-popover-content",this.maxWidth=X.maxWidth,this.openButtonSize=ke.small,this.onTriggerSlotChange=()=>{var e,r;let o=(r=(e=this.triggerSlot)===null||e===void 0?void 0:e.assignedElements())!==null&&r!==void 0?r:[];this.isTriggerSlotAssigned=o.length>0},this.onTriggerKeydown=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.open())},this.watchFocusIn=e=>{this.popoverWrapper&&!e.composedPath().includes(this.popoverWrapper)&&this.close()},this.watchEscapeKey=e=>{var r;e.key==="Escape"&&(this.close(),(r=this.openingElement)===null||r===void 0||r.focus())}}get openingElement(){var e;let r=(e=this.triggerSlot)===null||e===void 0?void 0:e.assignedElements();return r?.length&&r[0]instanceof HTMLElement?r[0]:this.openingButton}render(){let e={opened:this.opened};return this.hidden?j:W`
2176
+ `;var ie=function(t,e,r,o){var a=arguments.length,i=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Z=class extends q{constructor(){super(...arguments),this.closeButtonLabel="close info",this.openButtonIcon=h.QUESTION,this.openButtonIconVariant=p.regular,this.openButtonLabel="more info",this.openButtonTooltipPosition="bottom",this.opened=!1,this.hidden=!1,this.openButtonFamily=Fe.info,this.isTriggerSlotAssigned=!1,this.heading="",this.margins=Po.default,this.wrapperId="ftds-popover-wrapper",this.headingId="ftds-popover-heading",this.contentId="ftds-popover-content",this.maxWidth=X.maxWidth,this.openButtonSize=ke.small,this.onTriggerSlotChange=()=>{var e,r;let o=(r=(e=this.triggerSlot)===null||e===void 0?void 0:e.assignedElements())!==null&&r!==void 0?r:[];this.isTriggerSlotAssigned=o.length>0},this.onTriggerKeydown=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.open())},this.watchFocusIn=e=>{this.popoverWrapper&&!e.composedPath().includes(this.popoverWrapper)&&this.close()},this.watchEscapeKey=e=>{var r;e.key==="Escape"&&(this.close(),(r=this.openingElement)===null||r===void 0||r.focus())}}get openingElement(){var e;let r=(e=this.triggerSlot)===null||e===void 0?void 0:e.assignedElements();return r?.length&&r[0]instanceof HTMLElement?r[0]:this.openingButton}render(){let e={opened:this.opened};return this.hidden?j:W`
2177
2177
  <div part="root-container" class="${De(e)}">
2178
2178
  <slot name="trigger"
2179
2179
  @slotchange=${this.onTriggerSlotChange}
@@ -2201,11 +2201,15 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
2201
2201
  <ftds-button @focusin=${this.close}
2202
2202
  secondary
2203
2203
  part="opening-button"
2204
- icon="${this.openButtonIcon}"
2205
- variant="${this.openButtonIconVariant}"
2206
- size="${this.openButtonSize}" family="${this.openButtonFamily}"
2207
- label="${this.openButtonLabel}" tooltipposition="${this.openButtonTooltipPosition}"
2208
- aria-haspopup="true" aria-expanded="${this.opened}" aria-controls="${this.wrapperId}"
2204
+ .icon=${this.openButtonIcon}
2205
+ .iconVariant=${this.openButtonIconVariant}
2206
+ .family=${this.openButtonFamily}
2207
+ .label=${this.openButtonLabel}
2208
+ .tooltipPosition=${this.openButtonTooltipPosition}
2209
+ size="${this.openButtonSize}"
2210
+ aria-haspopup="true"
2211
+ aria-expanded="${this.opened}"
2212
+ aria-controls="${this.wrapperId}"
2209
2213
  @click=${this.open}>
2210
2214
  </ftds-button>
2211
2215
  `}renderClosingButton(){return W`
@@ -2240,7 +2244,7 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a
2240
2244
  <div part="popover-sections">
2241
2245
  <slot name="sections" part="popover-sections-slot"></slot>
2242
2246
  </div>
2243
- `}hideUnusedSlots(){var e,r,o;(e=this.popoverLinkTypography)===null||e===void 0||e.classList.toggle("hidden",this.hasEmptySlot(this.slottedLinkContent)),(r=this.popoverContentDiv)===null||r===void 0||r.classList.toggle("hidden",this.hasEmptySlot(this.popoverContentSlot)),(o=this.popoverSectionsDiv)===null||o===void 0||o.classList.toggle("hidden",this.hasEmptySlot(this.popoverSectionsSlot))}hasEmptySlot(e){return gt(e).trim().length===0}updated(e){super.updated(e),e.has("opened")&&(this.opened?setTimeout(()=>{this.positionWrapper(),document.addEventListener("keydown",this.watchEscapeKey),document.addEventListener("focusin",this.watchFocusIn)},0):(document.removeEventListener("keydown",this.watchEscapeKey),document.removeEventListener("focusin",this.watchFocusIn)))}close(){this.opened=!1,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!1}}))}open(){this.opened=!0,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!0}}))}closeAndFocusOpeningButton(){var e;this.close(),(e=this.openingElement)===null||e===void 0||e.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation&&this.openingElement instanceof K&&this.openingElement.showTooltip()}async positionWrapper(){var e,r;if(this.popoverWrapper){if(this.popoverWrapper.classList.remove("positioned"),this.popoverWrapper.style.left="",this.popoverWrapper.style.top="",this.openingElement){let i={placement:"bottom-start",allowedPlacements:["bottom-start","right-start","bottom-end","right-end","left-start","left-end","top-start","top-end"],maxWidthCssVariable:this.maxWidth},{x:s,y:c}=await xi(this.openingElement,this.popoverWrapper,i);this.popoverWrapper.style.left=`${s}px`,this.popoverWrapper.style.top=`${c}px`}this.popoverWrapper.classList.add("positioned")}this.hideUnusedSlots(),(e=this.closingButton)===null||e===void 0||e.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation&&((r=this.closingButton)===null||r===void 0||r.showTooltip())}};Z.styles=X0;Z.elementDefinitions={"ftds-typography":we,"ftds-button":K};ie([A()],Z.prototype,"closeButtonLabel",void 0);ie([A()],Z.prototype,"openButtonIcon",void 0);ie([A()],Z.prototype,"openButtonIconVariant",void 0);ie([A()],Z.prototype,"openButtonLabel",void 0);ie([A()],Z.prototype,"openButtonTooltipPosition",void 0);ie([A({type:Boolean})],Z.prototype,"opened",void 0);ie([A({type:Boolean})],Z.prototype,"hidden",void 0);ie([A({type:Fe})],Z.prototype,"openButtonFamily",void 0);ie([Q()],Z.prototype,"isTriggerSlotAssigned",void 0);ie([A()],Z.prototype,"heading",void 0);ie([A()],Z.prototype,"margins",void 0);ie([Y('[part="wrapper"]')],Z.prototype,"popoverWrapper",void 0);ie([Y('slot[name="trigger"]')],Z.prototype,"triggerSlot",void 0);ie([Y('[part="opening-button"]')],Z.prototype,"openingButton",void 0);ie([Y('[part="closing-button"]')],Z.prototype,"closingButton",void 0);ie([Y('[part="content"]')],Z.prototype,"popoverContentDiv",void 0);ie([Y('[part="popover-content-slot"]')],Z.prototype,"popoverContentSlot",void 0);ie([Y('[part="popover-link"]')],Z.prototype,"slottedLinkContent",void 0);ie([Y('[part="popover-link-typography"]')],Z.prototype,"popoverLinkTypography",void 0);ie([Y('[part="popover-sections"]')],Z.prototype,"popoverSectionsDiv",void 0);ie([Y('[part="popover-sections-slot"]')],Z.prototype,"popoverSectionsSlot",void 0);var Q0=F`
2247
+ `}hideUnusedSlots(){var e,r,o;(e=this.popoverLinkTypography)===null||e===void 0||e.classList.toggle("hidden",this.hasEmptySlot(this.slottedLinkContent)),(r=this.popoverContentDiv)===null||r===void 0||r.classList.toggle("hidden",this.hasEmptySlot(this.popoverContentSlot)),(o=this.popoverSectionsDiv)===null||o===void 0||o.classList.toggle("hidden",this.hasEmptySlot(this.popoverSectionsSlot))}hasEmptySlot(e){return gt(e).trim().length===0}updated(e){super.updated(e),e.has("opened")&&(this.opened?setTimeout(()=>{this.positionWrapper(),document.addEventListener("keydown",this.watchEscapeKey),document.addEventListener("focusin",this.watchFocusIn)},0):(document.removeEventListener("keydown",this.watchEscapeKey),document.removeEventListener("focusin",this.watchFocusIn)))}close(){this.opened=!1,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!1}}))}open(){this.opened=!0,this.dispatchEvent(new CustomEvent("opened-changed",{detail:{opened:!0}}))}closeAndFocusOpeningButton(){var e;this.close(),(e=this.openingElement)===null||e===void 0||e.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation&&this.openingElement instanceof K&&this.openingElement.showTooltip()}async positionWrapper(){var e,r;if(this.popoverWrapper){if(this.popoverWrapper.classList.remove("positioned"),this.popoverWrapper.style.left="",this.popoverWrapper.style.top="",this.openingElement){let i={placement:"bottom-start",allowedPlacements:["bottom-start","right-start","bottom-end","right-end","left-start","left-end","top-start","top-end"],maxWidthCssVariable:this.maxWidth},{x:s,y:c}=await xi(this.openingElement,this.popoverWrapper,i);this.popoverWrapper.style.left=`${s}px`,this.popoverWrapper.style.top=`${c}px`}this.popoverWrapper.classList.add("positioned")}this.hideUnusedSlots(),(e=this.closingButton)===null||e===void 0||e.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation&&((r=this.closingButton)===null||r===void 0||r.showTooltip())}};Z.styles=X0;Z.elementDefinitions={"ftds-typography":we,"ftds-button":K};ie([A()],Z.prototype,"closeButtonLabel",void 0);ie([A({type:h})],Z.prototype,"openButtonIcon",void 0);ie([A({type:p})],Z.prototype,"openButtonIconVariant",void 0);ie([A()],Z.prototype,"openButtonLabel",void 0);ie([A()],Z.prototype,"openButtonTooltipPosition",void 0);ie([A({type:Boolean})],Z.prototype,"opened",void 0);ie([A({type:Boolean})],Z.prototype,"hidden",void 0);ie([A({type:Fe})],Z.prototype,"openButtonFamily",void 0);ie([Q()],Z.prototype,"isTriggerSlotAssigned",void 0);ie([A()],Z.prototype,"heading",void 0);ie([A()],Z.prototype,"margins",void 0);ie([Y('[part="wrapper"]')],Z.prototype,"popoverWrapper",void 0);ie([Y('slot[name="trigger"]')],Z.prototype,"triggerSlot",void 0);ie([Y('[part="opening-button"]')],Z.prototype,"openingButton",void 0);ie([Y('[part="closing-button"]')],Z.prototype,"closingButton",void 0);ie([Y('[part="content"]')],Z.prototype,"popoverContentDiv",void 0);ie([Y('[part="popover-content-slot"]')],Z.prototype,"popoverContentSlot",void 0);ie([Y('[part="popover-link"]')],Z.prototype,"slottedLinkContent",void 0);ie([Y('[part="popover-link-typography"]')],Z.prototype,"popoverLinkTypography",void 0);ie([Y('[part="popover-sections"]')],Z.prototype,"popoverSectionsDiv",void 0);ie([Y('[part="popover-sections-slot"]')],Z.prototype,"popoverSectionsSlot",void 0);var Q0=F`
2244
2248
  .ftds-popover-section--heading ftds-typography {
2245
2249
  flex-grow: 1;
2246
2250
  flex-shrink: 1;
@@ -1,4 +1,6 @@
1
1
  import { Position } from "@fluid-topics/ft-tooltip";
2
+ import { FtdsIcons, FtdsIconVariants } from "@fluid-topics/ftds-icon";
3
+ import { DesignSystemFamily } from "@fluid-topics/design-system-variables";
2
4
  export interface FtdsPopoverProperties {
3
5
  heading?: string;
4
6
  opened?: boolean;
@@ -7,6 +9,9 @@ export interface FtdsPopoverProperties {
7
9
  openButtonLabel?: string;
8
10
  openButtonTooltipPosition?: Position;
9
11
  margins?: FtdsPopoverMargins;
12
+ openButtonIcon?: FtdsIcons;
13
+ openButtonIconVariant?: FtdsIconVariants;
14
+ openButtonFamily?: DesignSystemFamily;
10
15
  }
11
16
  export declare enum FtdsPopoverMargins {
12
17
  default = "default",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ftds-popover",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "description": "The design system popover component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -21,15 +21,15 @@
21
21
  "dependencies": {
22
22
  "@floating-ui/dom": "1.8.0",
23
23
  "@fluid-topics/design-system-variables": "3.8.0",
24
- "@fluid-topics/ft-tooltip": "2.2.7",
25
- "@fluid-topics/ft-wc-utils": "2.2.7",
26
- "@fluid-topics/ftds-button": "2.2.7",
27
- "@fluid-topics/ftds-icon": "2.2.7",
28
- "@fluid-topics/ftds-typography": "2.2.7",
24
+ "@fluid-topics/ft-tooltip": "2.2.9",
25
+ "@fluid-topics/ft-wc-utils": "2.2.9",
26
+ "@fluid-topics/ftds-button": "2.2.9",
27
+ "@fluid-topics/ftds-icon": "2.2.9",
28
+ "@fluid-topics/ftds-typography": "2.2.9",
29
29
  "lit": "3.3.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@fluid-topics/ft-wc-test-utils": "2.2.7"
32
+ "@fluid-topics/ft-wc-test-utils": "2.2.9"
33
33
  },
34
- "gitHead": "dff67505fe1e41bc42e0bdfafc7060ca40f8dc9d"
34
+ "gitHead": "e12bf480f5ee00623f87caff8c918fccae85585c"
35
35
  }