@florid-kit/components 0.3.22 → 0.3.25
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/index.js +3 -2
- package/index.mjs +5 -4
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
display: inline-flex;
|
|
439
439
|
align-items: center;
|
|
440
440
|
}
|
|
441
|
-
`;v([l()],u.prototype,"type",2);v([l({reflect:!0})],u.prototype,"value",2);v([l({type:String,reflect:!0})],u.prototype,"variant",2);v([l({type:String})],u.prototype,"text",2);v([l({type:String})],u.prototype,"textsecond",2);v([l({type:Boolean,reflect:!0})],u.prototype,"fullwidth",2);v([l({type:Boolean,reflect:!0})],u.prototype,"disabled",2);v([l({type:String,attribute:"iconstrokewidth"})],u.prototype,"iconstrokewidth",2);v([l({type:String})],u.prototype,"icon",2);v([l({type:Boolean,reflect:!0,attribute:"starticon"})],u.prototype,"startIcon",2);v([l({type:Boolean,reflect:!0,attribute:"endicon"})],u.prototype,"endIcon",2);v([l({type:String,reflect:!0,attribute:"iconsize"})],u.prototype,"iconSize",2);v([l({type:String,attribute:"paneltarget"})],u.prototype,"panelTarget",2);v([l({type:String})],u.prototype,"href",2);v([l({type:String})],u.prototype,"target",2);u=v([U("o-button")],u);var me=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Q=(o,t,e,s)=>{for(var n=s>1?void 0:s?we(t,e):t,r=o.length-1,i;r>=0;r--)(i=o[r])&&(n=(s?i(t,e,n):i(n))||n);return s&&n&&me(t,e,n),n};let T=class extends ${constructor(){super(...arguments),this.status="empty",this.ariaDescribedBy="a-product-name",this.label="Add to wishlist",this.toggleStatus=()=>{this.status=this.status==="empty"?"filled":"empty",this.setAttribute("aria-pressed",String(this.status==="filled")),this.dispatchEvent(new CustomEvent("wishlist-toggle",{detail:{status:this.status},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-pressed",String(this.status==="filled"))}firstUpdated(){this.addEventListener("click",this.toggleStatus),this.addEventListener("keydown",this.handleKeydown)}handleKeydown(o){(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),this.toggleStatus())}render(){const o=pt.wishlist.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return d`
|
|
441
|
+
`;v([l()],u.prototype,"type",2);v([l({reflect:!0})],u.prototype,"value",2);v([l({type:String,reflect:!0})],u.prototype,"variant",2);v([l({type:String})],u.prototype,"text",2);v([l({type:String})],u.prototype,"textsecond",2);v([l({type:Boolean,reflect:!0})],u.prototype,"fullwidth",2);v([l({type:Boolean,reflect:!0})],u.prototype,"disabled",2);v([l({type:String,attribute:"iconstrokewidth"})],u.prototype,"iconstrokewidth",2);v([l({type:String})],u.prototype,"icon",2);v([l({type:Boolean,reflect:!0,attribute:"starticon"})],u.prototype,"startIcon",2);v([l({type:Boolean,reflect:!0,attribute:"endicon"})],u.prototype,"endIcon",2);v([l({type:String,reflect:!0,attribute:"iconsize"})],u.prototype,"iconSize",2);v([l({type:String,attribute:"paneltarget",reflect:!0})],u.prototype,"panelTarget",2);v([l({type:String})],u.prototype,"href",2);v([l({type:String})],u.prototype,"target",2);u=v([U("o-button")],u);var me=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Q=(o,t,e,s)=>{for(var n=s>1?void 0:s?we(t,e):t,r=o.length-1,i;r>=0;r--)(i=o[r])&&(n=(s?i(t,e,n):i(n))||n);return s&&n&&me(t,e,n),n};let T=class extends ${constructor(){super(...arguments),this.status="empty",this.ariaDescribedBy="a-product-name",this.label="Add to wishlist",this.toggleStatus=()=>{this.status=this.status==="empty"?"filled":"empty",this.setAttribute("aria-pressed",String(this.status==="filled")),this.dispatchEvent(new CustomEvent("wishlist-toggle",{detail:{status:this.status},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-pressed",String(this.status==="filled"))}firstUpdated(){this.addEventListener("click",this.toggleStatus),this.addEventListener("keydown",this.handleKeydown)}handleKeydown(o){(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),this.toggleStatus())}render(){const o=pt.wishlist.replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return d`
|
|
442
442
|
<button
|
|
443
443
|
type="button"
|
|
444
444
|
aria-describedby="${this.ariaDescribedBy}"
|
|
@@ -656,7 +656,7 @@
|
|
|
656
656
|
text-decoration: underline;
|
|
657
657
|
cursor: pointer;
|
|
658
658
|
}
|
|
659
|
-
`;Y([l({type:Number})],z.prototype,"rating",2);Y([l({type:String})],z.prototype,"reviewCount",2);Y([l({type:String})],z.prototype,"href",2);z=Y([U("o-rating")],z);var Ee=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,y=(o,t,e,s)=>{for(var n=s>1?void 0:s?Ce(t,e):t,r=o.length-1,i;r>=0;r--)(i=o[r])&&(n=(s?i(t,e,n):i(n))||n);return s&&n&&Ee(t,e,n),n};let b=class extends ${constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.headerTitle="",this.closeButtonLabel="Close the modal",this.firstButtonLabel="Close",this.firstButtonVariant="primary",this.secondaryButtonLabel="",this.secondaryButtonVariant="secondary",this.previousFocusedElement=null,this.handleKeyDown=o=>{this.open&&(o.key==="Escape"?this.closePanel():o.key==="Tab"&&this.trapFocus(o))}}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){document.body.style.overflow="",window.removeEventListener("keydown",this.handleKeyDown),super.disconnectedCallback()}trapFocus(o){const t=this.getFocusableElements();if(t.length===0)return;const e=t[0],s=t[t.length-1];o.shiftKey&&document.activeElement===e?(o.preventDefault(),s.focus()):!o.shiftKey&&document.activeElement===s&&(o.preventDefault(),e.focus())}getFocusableElements(){const o=this.renderRoot.querySelector(".panel");return o?Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(t=>!t.hasAttribute("disabled")):[]}openPanel(){this.previousFocusedElement=document.activeElement,this.open=!0,document.body.style.overflow="hidden",this.updateComplete.then(()=>{const o=this.getFocusableElements()[0];o==null||o.focus()})}closePanel(){var o;this.open=!1,document.body.style.overflow="",(o=this.previousFocusedElement)==null||o.focus(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}handleFirstClick(){typeof this.onFirstButtonClick=="function"&&this.onFirstButtonClick(),this.closePanel()}handleSecondaryClick(){typeof this.onSecondaryButtonClick=="function"&&this.onSecondaryButtonClick(),this.closePanel()}render(){return d`
|
|
659
|
+
`;Y([l({type:Number})],z.prototype,"rating",2);Y([l({type:String})],z.prototype,"reviewCount",2);Y([l({type:String})],z.prototype,"href",2);z=Y([U("o-rating")],z);var Ee=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,y=(o,t,e,s)=>{for(var n=s>1?void 0:s?Ce(t,e):t,r=o.length-1,i;r>=0;r--)(i=o[r])&&(n=(s?i(t,e,n):i(n))||n);return s&&n&&Ee(t,e,n),n};let b=class extends ${constructor(){super(...arguments),this.open=!1,this.showHeader=!0,this.showFooter=!1,this.headerTitle="",this.closeButtonLabel="Close the modal",this.firstButtonLabel="Close",this.firstButtonVariant="primary",this.secondaryButtonLabel="",this.secondaryButtonVariant="secondary",this.previousFocusedElement=null,this.handleKeyDown=o=>{this.open&&(o.key==="Escape"?this.closePanel():o.key==="Tab"&&this.trapFocus(o))}}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),window.removeEventListener("keydown",this.handleKeyDown),super.disconnectedCallback()}trapFocus(o){const t=this.getFocusableElements();if(t.length===0)return;const e=t[0],s=t[t.length-1];o.shiftKey&&document.activeElement===e?(o.preventDefault(),s.focus()):!o.shiftKey&&document.activeElement===s&&(o.preventDefault(),e.focus())}getFocusableElements(){const o=this.renderRoot.querySelector(".panel");return o?Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(t=>!t.hasAttribute("disabled")):[]}openPanel(){this.previousFocusedElement=document.activeElement,this.open=!0,document.body.style.overflow="hidden",document.body.setAttribute("data-side-panel","open"),this.updateComplete.then(()=>{const o=this.getFocusableElements()[0];o==null||o.focus()})}closePanel(){var o;this.open=!1,document.body.style.overflow="",document.body.removeAttribute("data-side-panel"),(o=this.previousFocusedElement)==null||o.focus(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}handleFirstClick(){typeof this.onFirstButtonClick=="function"&&this.onFirstButtonClick(),this.closePanel()}handleSecondaryClick(){typeof this.onSecondaryButtonClick=="function"&&this.onSecondaryButtonClick(),this.closePanel()}render(){return d`
|
|
660
660
|
<div class="overlay" @click=${this.closePanel}></div>
|
|
661
661
|
<div
|
|
662
662
|
class="panel"
|
|
@@ -762,6 +762,7 @@
|
|
|
762
762
|
.content {
|
|
763
763
|
flex: 1 1 auto;
|
|
764
764
|
overflow-y: auto;
|
|
765
|
+
overflow-x: hidden;
|
|
765
766
|
padding: 16px;
|
|
766
767
|
}
|
|
767
768
|
|
package/index.mjs
CHANGED
|
@@ -1224,7 +1224,7 @@ v([
|
|
|
1224
1224
|
l({ type: String, reflect: !0, attribute: "iconsize" })
|
|
1225
1225
|
], u.prototype, "iconSize", 2);
|
|
1226
1226
|
v([
|
|
1227
|
-
l({ type: String, attribute: "paneltarget" })
|
|
1227
|
+
l({ type: String, attribute: "paneltarget", reflect: !0 })
|
|
1228
1228
|
], u.prototype, "panelTarget", 2);
|
|
1229
1229
|
v([
|
|
1230
1230
|
l({ type: String })
|
|
@@ -1595,7 +1595,7 @@ let b = class extends $ {
|
|
|
1595
1595
|
super.connectedCallback(), window.addEventListener("keydown", this.handleKeyDown);
|
|
1596
1596
|
}
|
|
1597
1597
|
disconnectedCallback() {
|
|
1598
|
-
document.body.style.overflow = "", window.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback();
|
|
1598
|
+
document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), window.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback();
|
|
1599
1599
|
}
|
|
1600
1600
|
trapFocus(o) {
|
|
1601
1601
|
const t = this.getFocusableElements();
|
|
@@ -1612,14 +1612,14 @@ let b = class extends $ {
|
|
|
1612
1612
|
).filter((t) => !t.hasAttribute("disabled")) : [];
|
|
1613
1613
|
}
|
|
1614
1614
|
openPanel() {
|
|
1615
|
-
this.previousFocusedElement = document.activeElement, this.open = !0, document.body.style.overflow = "hidden", this.updateComplete.then(() => {
|
|
1615
|
+
this.previousFocusedElement = document.activeElement, this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open"), this.updateComplete.then(() => {
|
|
1616
1616
|
const o = this.getFocusableElements()[0];
|
|
1617
1617
|
o == null || o.focus();
|
|
1618
1618
|
});
|
|
1619
1619
|
}
|
|
1620
1620
|
closePanel() {
|
|
1621
1621
|
var o;
|
|
1622
|
-
this.open = !1, document.body.style.overflow = "", (o = this.previousFocusedElement) == null || o.focus(), this.dispatchEvent(
|
|
1622
|
+
this.open = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), (o = this.previousFocusedElement) == null || o.focus(), this.dispatchEvent(
|
|
1623
1623
|
new CustomEvent("close", { bubbles: !0, composed: !0 })
|
|
1624
1624
|
);
|
|
1625
1625
|
}
|
|
@@ -1739,6 +1739,7 @@ b.styles = E`
|
|
|
1739
1739
|
.content {
|
|
1740
1740
|
flex: 1 1 auto;
|
|
1741
1741
|
overflow-y: auto;
|
|
1742
|
+
overflow-x: hidden;
|
|
1742
1743
|
padding: 16px;
|
|
1743
1744
|
}
|
|
1744
1745
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@florid-kit/components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.25",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "index.mjs",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"description": "This library was generated with [Nx](https://nx.dev).",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@florid-kit/tokens": "^0.1.
|
|
9
|
+
"@florid-kit/tokens": "^0.1.6"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@storybook/addon-a11y": "8.6.14",
|