@florid-kit/components 2.3.2 → 2.3.4
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/aria.d.ts +1 -1
- package/components/button.d.ts +2 -2
- package/index.js +5 -4
- package/index.mjs +8 -7
- package/package.json +1 -1
package/aria.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;
|
|
|
15
15
|
/**
|
|
16
16
|
* Accessibility Object Model aria attributes.
|
|
17
17
|
*/
|
|
18
|
-
export declare const ARIA_ATTRIBUTES: ("aria-label" | "aria-modal" | "aria-
|
|
18
|
+
export declare const ARIA_ATTRIBUTES: ("aria-label" | "aria-modal" | "aria-pressed" | "aria-expanded" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-description" | "aria-disabled" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-live" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-placeholder" | "aria-posinset" | "aria-readonly" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[];
|
|
19
19
|
/**
|
|
20
20
|
* Checks if an attribute is one of the AOM aria attributes.
|
|
21
21
|
*
|
package/components/button.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export declare class OccitaneButton extends buttonBaseClass implements FormSubmi
|
|
|
27
27
|
underlined: boolean;
|
|
28
28
|
withbadge: boolean;
|
|
29
29
|
hideRoleButton: boolean;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
describedBy: string | null;
|
|
31
|
+
ariaExpanded: string | null;
|
|
32
32
|
private handleClick;
|
|
33
33
|
protected render(): import('lit').TemplateResult<1>;
|
|
34
34
|
private renderIcon;
|
package/index.js
CHANGED
|
@@ -1407,9 +1407,9 @@
|
|
|
1407
1407
|
overflow: auto;
|
|
1408
1408
|
box-sizing: border-box;
|
|
1409
1409
|
}
|
|
1410
|
-
`;u.focusablesSelector='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';u.focusablesCustomElementsSelector="o-icon-button, o-button";u.shadowRootOptions={...p.shadowRootOptions,delegatesFocus:!0};b([l({type:Boolean,reflect:!0})],u.prototype,"open",2);b([l({type:Boolean,reflect:!0})],u.prototype,"showHeader",2);b([l({type:Boolean,reflect:!0})],u.prototype,"showFooter",2);b([l({type:Boolean,reflect:!0})],u.prototype,"showHeaderStartIcon",2);b([l({type:String,reflect:!0})],u.prototype,"headerTitle",2);b([l({type:String,reflect:!0})],u.prototype,"headerTitleClassName",2);b([l({type:String,reflect:!0})],u.prototype,"labelDialog",2);b([l({type:String,reflect:!0})],u.prototype,"labelAriaDialogPanel",2);b([l({type:String,reflect:!0})],u.prototype,"addToBagProductCount",2);b([l({type:String,reflect:!0})],u.prototype,"closeButtonLabel",2);b([l({type:String,reflect:!0})],u.prototype,"goBackButtonLabel",2);b([l({type:String,reflect:!0})],u.prototype,"firstButtonLabel",2);b([l({type:String,reflect:!0})],u.prototype,"firstButtonVariant",2);b([l({type:Object,reflect:!0})],u.prototype,"firstButtonProps",2);b([l({type:Boolean,reflect:!0})],u.prototype,"onFirstButtonClickClose",2);b([l({type:String,reflect:!0})],u.prototype,"secondButtonLabel",2);b([l({type:String,reflect:!0})],u.prototype,"secondButtonVariant",2);b([l({type:Object,reflect:!0})],u.prototype,"secondButtonProps",2);b([l({type:Boolean,reflect:!0})],u.prototype,"onSecondButtonClickClose",2);b([l({type:Boolean,reflect:!0})],u.prototype,"disablePortal",2);b([l({type:Number,reflect:!0})],u.prototype,"zIndex",2);b([l({type:Boolean,reflect:!0})],u.prototype,"initialized",2);b([l({type:Boolean})],u.prototype,"showDetail",2);b([l({type:Boolean})],u.prototype,"isHidingDetail",2);u=b([v("o-side-panel")],u);var x5=Object.defineProperty,V5=Object.getOwnPropertyDescriptor,L=(e,t,i,n)=>{for(var o=n>1?void 0:n?V5(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&x5(t,i,o),o};const H5=X1(p);let m=class extends H5{constructor(){super(...arguments),this.type="submit",this.value="",this.variant="primary",this.text="",this.textsecond="",this.fullwidth=!1,this.disabled=!1,this.startIconModel="",this.endIconModel="",this.startIcon=!1,this.endIcon=!1,this.panelTarget="",this.href="",this.target="",this.underlined=!1,this.withbadge=!1,this.hideRoleButton=!1,this.
|
|
1410
|
+
`;u.focusablesSelector='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';u.focusablesCustomElementsSelector="o-icon-button, o-button";u.shadowRootOptions={...p.shadowRootOptions,delegatesFocus:!0};b([l({type:Boolean,reflect:!0})],u.prototype,"open",2);b([l({type:Boolean,reflect:!0})],u.prototype,"showHeader",2);b([l({type:Boolean,reflect:!0})],u.prototype,"showFooter",2);b([l({type:Boolean,reflect:!0})],u.prototype,"showHeaderStartIcon",2);b([l({type:String,reflect:!0})],u.prototype,"headerTitle",2);b([l({type:String,reflect:!0})],u.prototype,"headerTitleClassName",2);b([l({type:String,reflect:!0})],u.prototype,"labelDialog",2);b([l({type:String,reflect:!0})],u.prototype,"labelAriaDialogPanel",2);b([l({type:String,reflect:!0})],u.prototype,"addToBagProductCount",2);b([l({type:String,reflect:!0})],u.prototype,"closeButtonLabel",2);b([l({type:String,reflect:!0})],u.prototype,"goBackButtonLabel",2);b([l({type:String,reflect:!0})],u.prototype,"firstButtonLabel",2);b([l({type:String,reflect:!0})],u.prototype,"firstButtonVariant",2);b([l({type:Object,reflect:!0})],u.prototype,"firstButtonProps",2);b([l({type:Boolean,reflect:!0})],u.prototype,"onFirstButtonClickClose",2);b([l({type:String,reflect:!0})],u.prototype,"secondButtonLabel",2);b([l({type:String,reflect:!0})],u.prototype,"secondButtonVariant",2);b([l({type:Object,reflect:!0})],u.prototype,"secondButtonProps",2);b([l({type:Boolean,reflect:!0})],u.prototype,"onSecondButtonClickClose",2);b([l({type:Boolean,reflect:!0})],u.prototype,"disablePortal",2);b([l({type:Number,reflect:!0})],u.prototype,"zIndex",2);b([l({type:Boolean,reflect:!0})],u.prototype,"initialized",2);b([l({type:Boolean})],u.prototype,"showDetail",2);b([l({type:Boolean})],u.prototype,"isHidingDetail",2);u=b([v("o-side-panel")],u);var x5=Object.defineProperty,V5=Object.getOwnPropertyDescriptor,L=(e,t,i,n)=>{for(var o=n>1?void 0:n?V5(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&x5(t,i,o),o};const H5=X1(p);let m=class extends H5{constructor(){super(...arguments),this.type="submit",this.value="",this.variant="primary",this.text="",this.textsecond="",this.fullwidth=!1,this.disabled=!1,this.startIconModel="",this.endIconModel="",this.startIcon=!1,this.endIcon=!1,this.panelTarget="",this.href="",this.target="",this.underlined=!1,this.withbadge=!1,this.hideRoleButton=!1,this.describedBy=null,this.ariaExpanded=null}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get form(){return this[F1].form}handleClick(e){if(!(e instanceof KeyboardEvent&&!["Enter"," "].includes(e.key))&&this.panelTarget){const t=document.getElementById(this.panelTarget);t instanceof u&&(t!=null&&t.openPanel)&&typeof t.openPanel=="function"?(e.preventDefault(),t.openPanel()):console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`)}}render(){return this.href?this.renderLink():this.renderButton()}renderIcon(e){const t=e==="start"?this.startIconModel:this.endIconModel;if(!t)return d;const i=j1[t].replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return a`<span class="${e==="start"?"icon-start":"icon-end"}">${q(i)}</span>`}renderButton(){const e=this.text||this.textsecond;return a`
|
|
1411
1411
|
<button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
|
|
1412
|
-
aria-describedby=${this.
|
|
1412
|
+
aria-describedby=${this.describedBy||d} aria-expanded=${this.ariaExpanded||d} >
|
|
1413
1413
|
${this.startIcon?this.renderIcon("start"):d}
|
|
1414
1414
|
${e?a`
|
|
1415
1415
|
${this.text?a`<span class="text">${this.text}</span>`:d}
|
|
@@ -1427,7 +1427,7 @@
|
|
|
1427
1427
|
role=${this.hideRoleButton?d:"button"}
|
|
1428
1428
|
@click=${this.handleClick}
|
|
1429
1429
|
@keydown=${this.handleClick}
|
|
1430
|
-
aria-describedby=${this.
|
|
1430
|
+
aria-describedby=${this.describedBy||d}
|
|
1431
1431
|
>
|
|
1432
1432
|
${this.startIcon?this.renderIcon("start"):d}
|
|
1433
1433
|
${e?a`
|
|
@@ -1646,7 +1646,7 @@
|
|
|
1646
1646
|
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
1647
1647
|
transform: translateX(4px);
|
|
1648
1648
|
}
|
|
1649
|
-
`;L([l()],m.prototype,"type",2);L([l()],m.prototype,"value",2);L([l({type:String,reflect:!0})],m.prototype,"variant",2);L([l({type:String})],m.prototype,"text",2);L([l({type:String})],m.prototype,"textsecond",2);L([l({type:Boolean,reflect:!0})],m.prototype,"fullwidth",2);L([l({type:Boolean,reflect:!0})],m.prototype,"disabled",2);L([l({type:String})],m.prototype,"startIconModel",2);L([l({type:String})],m.prototype,"endIconModel",2);L([l({type:Boolean,reflect:!0,attribute:"starticon"})],m.prototype,"startIcon",2);L([l({type:Boolean,reflect:!0,attribute:"endicon"})],m.prototype,"endIcon",2);L([l({type:String,attribute:"paneltarget"})],m.prototype,"panelTarget",2);L([l({type:String})],m.prototype,"href",2);L([l({type:String})],m.prototype,"target",2);L([l({type:Boolean,reflect:!0})],m.prototype,"underlined",2);L([l({type:Boolean,reflect:!0})],m.prototype,"withbadge",2);L([l({type:Boolean,reflect:!0})],m.prototype,"hideRoleButton",2);L([l({reflect:!0,attribute:"
|
|
1649
|
+
`;L([l()],m.prototype,"type",2);L([l()],m.prototype,"value",2);L([l({type:String,reflect:!0})],m.prototype,"variant",2);L([l({type:String})],m.prototype,"text",2);L([l({type:String})],m.prototype,"textsecond",2);L([l({type:Boolean,reflect:!0})],m.prototype,"fullwidth",2);L([l({type:Boolean,reflect:!0})],m.prototype,"disabled",2);L([l({type:String})],m.prototype,"startIconModel",2);L([l({type:String})],m.prototype,"endIconModel",2);L([l({type:Boolean,reflect:!0,attribute:"starticon"})],m.prototype,"startIcon",2);L([l({type:Boolean,reflect:!0,attribute:"endicon"})],m.prototype,"endIcon",2);L([l({type:String,attribute:"paneltarget"})],m.prototype,"panelTarget",2);L([l({type:String})],m.prototype,"href",2);L([l({type:String})],m.prototype,"target",2);L([l({type:Boolean,reflect:!0})],m.prototype,"underlined",2);L([l({type:Boolean,reflect:!0})],m.prototype,"withbadge",2);L([l({type:Boolean,reflect:!0})],m.prototype,"hideRoleButton",2);L([l({reflect:!0,attribute:"describedby"})],m.prototype,"describedBy",2);L([l({reflect:!0,attribute:"expanded"})],m.prototype,"ariaExpanded",2);m=L([v("o-button")],m);var $5=Object.defineProperty,B5=Object.getOwnPropertyDescriptor,$1=(e,t,i,n)=>{for(var o=n>1?void 0:n?B5(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&$5(t,i,o),o};let p1=class extends p{constructor(){super(...arguments),this.status="empty",this.icon="occ-wishlist-outlined",this.bgstyle="none-contrast",this.ariaDescribedBy="a-product-name",this.label="Add to wishlist",this.toggleStatus=()=>{this.status=this.status==="empty"?"filled":"empty",this.icon=this.status==="filled"?"occ-wishlist-filled":"occ-wishlist-outlined",this.bgstyle=this.status==="filled"?"none-contrast":"none-light",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("role","button"),this.setAttribute("aria-pressed",String(this.status==="filled"))}firstUpdated(){this.addEventListener("click",this.toggleStatus),this.addEventListener("keydown",this.handleKeydown)}handleKeydown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.toggleStatus())}render(){const e=j1[this.icon].replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"');return a`
|
|
1650
1650
|
<button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
|
|
1651
1651
|
<span class="sr-only">${this.label}</span>
|
|
1652
1652
|
${q(e)}
|
|
@@ -4213,6 +4213,7 @@
|
|
|
4213
4213
|
<button
|
|
4214
4214
|
id=${this.headerId}
|
|
4215
4215
|
class="header"
|
|
4216
|
+
part="header"
|
|
4216
4217
|
aria-expanded="${this.expanded?"true":"false"}"
|
|
4217
4218
|
aria-controls=${this.panelId}
|
|
4218
4219
|
?disabled=${this.disabled}
|
package/index.mjs
CHANGED
|
@@ -2727,7 +2727,7 @@ var x5 = Object.defineProperty, V5 = Object.getOwnPropertyDescriptor, L = (e, t,
|
|
|
2727
2727
|
const H5 = X1(p);
|
|
2728
2728
|
let m = class extends H5 {
|
|
2729
2729
|
constructor() {
|
|
2730
|
-
super(...arguments), this.type = "submit", this.value = "", this.variant = "primary", this.text = "", this.textsecond = "", this.fullwidth = !1, this.disabled = !1, this.startIconModel = "", this.endIconModel = "", this.startIcon = !1, this.endIcon = !1, this.panelTarget = "", this.href = "", this.target = "", this.underlined = !1, this.withbadge = !1, this.hideRoleButton = !1, this.
|
|
2730
|
+
super(...arguments), this.type = "submit", this.value = "", this.variant = "primary", this.text = "", this.textsecond = "", this.fullwidth = !1, this.disabled = !1, this.startIconModel = "", this.endIconModel = "", this.startIcon = !1, this.endIcon = !1, this.panelTarget = "", this.href = "", this.target = "", this.underlined = !1, this.withbadge = !1, this.hideRoleButton = !1, this.describedBy = null, this.ariaExpanded = null;
|
|
2731
2731
|
}
|
|
2732
2732
|
get name() {
|
|
2733
2733
|
return this.getAttribute("name") ?? "";
|
|
@@ -2760,7 +2760,7 @@ let m = class extends H5 {
|
|
|
2760
2760
|
const e = this.text || this.textsecond;
|
|
2761
2761
|
return a`
|
|
2762
2762
|
<button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
|
|
2763
|
-
aria-describedby=${this.
|
|
2763
|
+
aria-describedby=${this.describedBy || d} aria-expanded=${this.ariaExpanded || d} >
|
|
2764
2764
|
${this.startIcon ? this.renderIcon("start") : d}
|
|
2765
2765
|
${e ? a`
|
|
2766
2766
|
${this.text ? a`<span class="text">${this.text}</span>` : d}
|
|
@@ -2782,7 +2782,7 @@ let m = class extends H5 {
|
|
|
2782
2782
|
role=${this.hideRoleButton ? d : "button"}
|
|
2783
2783
|
@click=${this.handleClick}
|
|
2784
2784
|
@keydown=${this.handleClick}
|
|
2785
|
-
aria-describedby=${this.
|
|
2785
|
+
aria-describedby=${this.describedBy || d}
|
|
2786
2786
|
>
|
|
2787
2787
|
${this.startIcon ? this.renderIcon("start") : d}
|
|
2788
2788
|
${e ? a`
|
|
@@ -3059,11 +3059,11 @@ L([
|
|
|
3059
3059
|
l({ type: Boolean, reflect: !0 })
|
|
3060
3060
|
], m.prototype, "hideRoleButton", 2);
|
|
3061
3061
|
L([
|
|
3062
|
-
l({ reflect: !0, attribute: "
|
|
3063
|
-
], m.prototype, "
|
|
3062
|
+
l({ reflect: !0, attribute: "describedby" })
|
|
3063
|
+
], m.prototype, "describedBy", 2);
|
|
3064
3064
|
L([
|
|
3065
|
-
l({ reflect: !0, attribute: "
|
|
3066
|
-
], m.prototype, "
|
|
3065
|
+
l({ reflect: !0, attribute: "expanded" })
|
|
3066
|
+
], m.prototype, "ariaExpanded", 2);
|
|
3067
3067
|
m = L([
|
|
3068
3068
|
v("o-button")
|
|
3069
3069
|
], m);
|
|
@@ -7130,6 +7130,7 @@ let k6 = 0, H1 = class extends p {
|
|
|
7130
7130
|
<button
|
|
7131
7131
|
id=${this.headerId}
|
|
7132
7132
|
class="header"
|
|
7133
|
+
part="header"
|
|
7133
7134
|
aria-expanded="${this.expanded ? "true" : "false"}"
|
|
7134
7135
|
aria-controls=${this.panelId}
|
|
7135
7136
|
?disabled=${this.disabled}
|