@florid-kit/components 0.9.15 → 0.9.16

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.
Files changed (4) hide show
  1. package/aria.d.ts +1 -1
  2. package/index.js +819 -819
  3. package/index.mjs +1495 -1495
  4. package/package.json +1 -1
package/index.mjs CHANGED
@@ -856,716 +856,451 @@ class Dt extends Bt {
856
856
  }
857
857
  Dt.directiveName = "unsafeSVG", Dt.resultType = 2;
858
858
  const C = Vt(Dt);
859
- var mo = Object.defineProperty, xo = Object.getOwnPropertyDescriptor, x = (o, t, e, n) => {
860
- for (var i = n > 1 ? void 0 : n ? xo(t, e) : t, r = o.length - 1, s; r >= 0; r--)
861
- (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
862
- return n && i && mo(t, e, i), i;
859
+ /**
860
+ * @license
861
+ * Copyright 2020 Google LLC
862
+ * SPDX-License-Identifier: BSD-3-Clause
863
+ */
864
+ const mo = (o) => o.strings === void 0;
865
+ /**
866
+ * @license
867
+ * Copyright 2017 Google LLC
868
+ * SPDX-License-Identifier: BSD-3-Clause
869
+ */
870
+ const dt = (o, t) => {
871
+ var n;
872
+ const e = o._$AN;
873
+ if (e === void 0) return !1;
874
+ for (const i of e) (n = i._$AO) == null || n.call(i, t, !1), dt(i, t);
875
+ return !0;
876
+ }, kt = (o) => {
877
+ let t, e;
878
+ do {
879
+ if ((t = o._$AM) === void 0) break;
880
+ e = t._$AN, e.delete(o), o = t;
881
+ } while ((e == null ? void 0 : e.size) === 0);
882
+ }, be = (o) => {
883
+ for (let t; t = o._$AM; o = t) {
884
+ let e = t._$AN;
885
+ if (e === void 0) t._$AN = e = /* @__PURE__ */ new Set();
886
+ else if (e.has(o)) break;
887
+ e.add(o), $o(t);
888
+ }
889
+ };
890
+ function xo(o) {
891
+ this._$AN !== void 0 ? (kt(this), this._$AM = o, be(this)) : this._$AM = o;
892
+ }
893
+ function wo(o, t = !1, e = 0) {
894
+ const n = this._$AH, i = this._$AN;
895
+ if (i !== void 0 && i.size !== 0) if (t) if (Array.isArray(n)) for (let r = e; r < n.length; r++) dt(n[r], !1), kt(n[r]);
896
+ else n != null && (dt(n, !1), kt(n));
897
+ else dt(this, o);
898
+ }
899
+ const $o = (o) => {
900
+ o.type == Ut.CHILD && (o._$AP ?? (o._$AP = wo), o._$AQ ?? (o._$AQ = xo));
863
901
  };
864
- const wo = Ft(u);
865
- let b = class extends wo {
902
+ class Co extends qt {
866
903
  constructor() {
867
- 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;
868
- }
869
- get name() {
870
- return this.getAttribute("name") ?? "";
904
+ super(...arguments), this._$AN = void 0;
871
905
  }
872
- set name(o) {
873
- this.setAttribute("name", o);
906
+ _$AT(t, e, n) {
907
+ super._$AT(t, e, n), be(this), this.isConnected = t._$AU;
874
908
  }
875
- get form() {
876
- return this[Nt].form;
909
+ _$AO(t, e = !0) {
910
+ var n, i;
911
+ t !== this.isConnected && (this.isConnected = t, t ? (n = this.reconnected) == null || n.call(this) : (i = this.disconnected) == null || i.call(this)), e && (dt(this, t), kt(this));
877
912
  }
878
- handleClick(o) {
879
- if (!(o instanceof KeyboardEvent && !["Enter", " "].includes(o.key)) && this.panelTarget) {
880
- const t = document.getElementById(this.panelTarget);
881
- t != null && t.openPanel && typeof t.openPanel == "function" ? (o.preventDefault(), t.openPanel()) : console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`);
913
+ setValue(t) {
914
+ if (mo(this._$Ct)) this._$Ct._$AI(t, this);
915
+ else {
916
+ const e = [...this._$Ct._$AH];
917
+ e[this._$Ci] = t, this._$Ct._$AI(e, this, 0);
882
918
  }
883
919
  }
884
- render() {
885
- return this.href ? this.renderLink() : this.renderButton();
920
+ disconnected() {
886
921
  }
887
- renderIcon(o) {
888
- const t = o === "start" ? this.startIconModel : this.endIconModel;
889
- if (!t) return d;
890
- const e = N[t].replace(
891
- "<svg",
892
- '<svg aria-hidden="true" focusable="false" part="svg"'
893
- );
894
- return l`<span class="${o === "start" ? "icon-start" : "icon-end"}">${C(e)}</span>`;
922
+ reconnected() {
895
923
  }
896
- renderButton() {
897
- const o = this.text || this.textsecond;
898
- return l`
899
- <button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}>
900
- ${this.startIcon ? this.renderIcon("start") : d}
901
- ${o ? l`
902
- ${this.text ? l`<span class="text">${this.text}</span>` : d}
903
- ${this.textsecond ? l`<span class="text">${this.textsecond}</span>` : d}
904
- ${this.withbadge ? l`<slot></slot>` : d}
905
- ` : l`<slot></slot>`}
906
- ${this.endIcon ? this.renderIcon("end") : d}
907
- </button>
908
- `;
924
+ }
925
+ class _o extends Co {
926
+ constructor() {
927
+ super(...arguments), this.prevData = {};
909
928
  }
910
- renderLink() {
911
- const o = this.text || this.textsecond;
912
- return l`
913
- <a
914
- href=${this.href}
915
- target=${this.target || d}
916
- class="button"
917
- ?disabled=${this.disabled}
918
- role="button"
919
- @click=${this.handleClick}
920
- @keydown=${this.handleClick}
921
- aria-describedby=${this.getAttribute("aria-describedby") || d}
922
- >
923
- ${this.startIcon ? this.renderIcon("start") : d}
924
- ${o ? l`
925
- ${this.text ? l`<span>${this.text}</span>` : d}
926
- ${this.textsecond ? l`<span>${this.textsecond}</span>` : d}
927
- ` : l`<slot></slot>`}
928
- ${this.endIcon ? this.renderIcon("end") : d}
929
- </a>
930
- `;
929
+ render(t) {
930
+ return d;
931
931
  }
932
- };
933
- Re(b);
934
- b.formAssociated = !0;
935
- b.styles = f`
936
- :host {
937
- --button-border: transparent;
938
- --badge-outer-width: 19px;
939
- cursor: pointer;
940
- display: inline-flex;
941
- }
942
-
943
- :host(.a--tabfocus) {
944
- outline: none !important;
945
- }
946
-
947
- :host([fullwidth]) {
948
- width: 100%;
949
- }
950
-
951
- :host([variant="primary"]) {
952
- --button-bg: var(--color-container-action-primary-default);
953
- --button-bg-hover: var(--color-container-action-primary-hover);
954
- --button-bg-pressed: var(--color-container-action-primary-pressed);
955
- --button-text: var(--color-content-action-primary);
956
- --button-text-hover: var(--color-content-action-primary);
957
- --button-border: transparent;
958
- --button-border-width: var(--border-m);
959
- --button-padding: var(--spacing-l, 12px) var(--spacing-3-xl, 24px);
960
- --button-starticon-svg-width: 0px; /* No starticon SVG for primary button */
961
- --button-endicon-svg-width: 0px; /* No endicon SVG for primary button */
932
+ update(t, [e]) {
933
+ var n;
934
+ this.element !== t.element && (this.element = t.element), this.host = ((n = t.options) === null || n === void 0 ? void 0 : n.host) || this.element, this.apply(e), this.groom(e), this.prevData = { ...e };
935
+ }
936
+ apply(t) {
937
+ if (!t)
938
+ return;
939
+ const { prevData: e, element: n } = this;
940
+ for (const i in t) {
941
+ const r = t[i];
942
+ r !== e[i] && (n[i] = r);
962
943
  }
963
-
964
- :host([variant="secondary"]) {
965
- --button-bg: var(--color-container-action-secondary-default);
966
- --button-bg-hover: var(--color-container-action-secondary-hover);
967
- --button-bg-pressed: var(--color-container-action-secondary-pressed);
968
- --button-text: var(--color-content-action-secondary);
969
- --button-text-hover: var(--color-content-action-secondary);
970
- --button-border: var(--color-border-secondary);
971
- --button-border-width: var(--border-m);
972
- --button-padding: var(--spacing-l, 12px) var(--spacing-3-xl, 24px);
973
- --button-starticon-svg-width: 16px;
974
- --button-endicon-svg-width: 0px; /* No endicon SVG for secondary button */
944
+ }
945
+ groom(t) {
946
+ const { prevData: e, element: n } = this;
947
+ if (e)
948
+ for (const i in e)
949
+ (!t || !(i in t) && n[i] === e[i]) && (n[i] = void 0);
950
+ }
951
+ }
952
+ class ko extends _o {
953
+ constructor() {
954
+ super(...arguments), this.eventData = {};
955
+ }
956
+ apply(t) {
957
+ if (t)
958
+ for (const e in t) {
959
+ const n = t[e];
960
+ n !== this.eventData[e] && this.applyEvent(e, n);
961
+ }
962
+ }
963
+ applyEvent(t, e) {
964
+ const { prevData: n, element: i } = this;
965
+ this.eventData[t] = e, n[t] && i.removeEventListener(t, this, e), i.addEventListener(t, this, e);
966
+ }
967
+ groom(t) {
968
+ const { prevData: e, element: n } = this;
969
+ if (e)
970
+ for (const i in e)
971
+ (!t || !(i in t) && n[i] === e[i]) && this.groomEvent(i, e[i]);
972
+ }
973
+ groomEvent(t, e) {
974
+ const { element: n } = this;
975
+ delete this.eventData[t], n.removeEventListener(t, this, e);
976
+ }
977
+ handleEvent(t) {
978
+ const e = this.eventData[t.type];
979
+ typeof e == "function" ? e.call(this.host, t) : e.handleEvent(t);
980
+ }
981
+ disconnected() {
982
+ const { eventData: t, element: e } = this;
983
+ for (const n in t) {
984
+ const i = n.slice(1), r = t[n];
985
+ e.removeEventListener(i, this, r);
975
986
  }
976
-
977
- :host([variant="ghost"]) {
978
- --button-bg: transparent;
979
- --button-bg-hover: var(--color-alpha-dark-lightest);
980
- --button-bg-pressed: var(--color-alpha-dark-lighter);
981
- --button-text: var(--color-content-action-secondary);
982
- --button-text-hover: var(--color-content-action-secondary);
983
- --button-border-width: 0;
984
- --button-padding: var(--spacing-m, 10px) var(--spacing-xl, 16px);
985
- --button-starticon-svg-width: 16px;
986
- --button-endicon-svg-width: 12px;
987
+ }
988
+ reconnected() {
989
+ const { eventData: t, element: e } = this;
990
+ for (const n in t) {
991
+ const i = n.slice(1), r = t[n];
992
+ e.addEventListener(i, this, r);
987
993
  }
988
-
989
- :host([variant="tertiary"]) {
990
- --button-bg: var(--color-container-action-tertiary-default);
991
- --button-bg-hover: var(--color-container-action-tertiary-hover);
992
- --button-bg-pressed: var(--color-container-action-tertiary-pressed);
993
- --button-text: var(--color-content-body);
994
- --button-text-hover: var(--color-content-action-tertiary);
995
- --button-border-width: 0;
996
- --button-padding: var(--spacing-m, 10px) var(--spacing-l, 12px);
997
- --button-starticon-svg-width: 0px; /* No starticon SVG for tertiary button */
998
- --button-endicon-svg-width: 8px;
999
- }
1000
-
1001
- :host([disabled]),
1002
- :host([aria-disabled="true"]),
1003
- :host([aria-disabled="true"]:hover) {
1004
- --button-bg: var(--color-container-disabled);
1005
- --button-text: var(--color-content-disabled);
1006
- --button-border: transparent;
994
+ }
995
+ }
996
+ class So extends ko {
997
+ apply(t) {
998
+ if (!t)
999
+ return;
1000
+ const { prevData: e, element: n } = this;
1001
+ for (const i in t) {
1002
+ const r = t[i];
1003
+ if (r === e[i])
1004
+ continue;
1005
+ const s = i.slice(1);
1006
+ switch (i[0]) {
1007
+ case "@":
1008
+ this.eventData[s] = r, this.applyEvent(s, r);
1009
+ break;
1010
+ case ".":
1011
+ n[s] = r;
1012
+ break;
1013
+ case "?":
1014
+ r ? n.setAttribute(s, "") : n.removeAttribute(s);
1015
+ break;
1016
+ default:
1017
+ r != null ? n.setAttribute(i, String(r)) : n.removeAttribute(i);
1018
+ break;
1019
+ }
1007
1020
  }
1021
+ }
1022
+ groom(t) {
1023
+ const { prevData: e, element: n } = this;
1024
+ if (e)
1025
+ for (const i in e) {
1026
+ const r = i.slice(1);
1027
+ if (!t || !(i in t) && n[r] === e[i])
1028
+ switch (i[0]) {
1029
+ case "@":
1030
+ this.groomEvent(r, e[i]);
1031
+ break;
1032
+ case ".":
1033
+ n[r] = void 0;
1034
+ break;
1035
+ case "?":
1036
+ n.removeAttribute(r);
1037
+ break;
1038
+ default:
1039
+ n.removeAttribute(i);
1040
+ break;
1041
+ }
1042
+ }
1043
+ }
1044
+ }
1045
+ const le = Vt(So);
1046
+ /**
1047
+ * @license
1048
+ * Copyright 2018 Google LLC
1049
+ * SPDX-License-Identifier: BSD-3-Clause
1050
+ */
1051
+ const k = (o) => o ?? d;
1052
+ var Ao = Object.defineProperty, Eo = Object.getOwnPropertyDescriptor, H = (o, t, e, n) => {
1053
+ for (var i = n > 1 ? void 0 : n ? Eo(t, e) : t, r = o.length - 1, s; r >= 0; r--)
1054
+ (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
1055
+ return n && i && Ao(t, e, i), i;
1056
+ };
1057
+ let S = class extends u {
1058
+ constructor() {
1059
+ super(...arguments), this.bgstyle = "background-light", this.size = "medium", this.status = "empty", this.type = "button", this.strokewidth = "1", this.icon = "wishlist", this.disabled = !1, this.showSrLabel = !1, this.srLabel = "";
1060
+ }
1061
+ updated(o) {
1062
+ super.updated(o), this.style.setProperty("--icon-stroke-width", this.strokewidth);
1063
+ }
1064
+ render() {
1065
+ const o = N[this.icon] ?? "", t = `icon-${this.icon}`, e = o.replace("<svg", '<svg aria-hidden="true" focusable="false" part="svg"').replace(/<path\b/g, '<path part="icon-path"').replace(/<g\b/g, '<g part="icon-group"').replace(/<circle\b/g, '<circle part="icon-circle"'), n = this.showSrLabel ? l`<span class="sr-only">${this.srLabel}</span>` : null, i = this.showSrLabel ? null : "icon";
1066
+ return l`
1067
+ ${this.type === "span" ? l`
1068
+ <span class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}" ?disabled="${this.disabled}">
1069
+ ${C(e)}
1070
+ </span>
1071
+ ` : l`
1072
+ <button
1073
+ type="button"
1074
+ aria-label=${k(i)}
1075
+ class="icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}"
1076
+ ?disabled="${this.disabled}"
1077
+ >
1078
+ ${C(e)}
1079
+ ${n}
1080
+ </button>
1081
+ `}
1082
+ `;
1083
+ }
1084
+ };
1085
+ S.styles = f`
1086
+ :host {
1087
+ display: inline-flex;
1088
+ justify-content: center;
1089
+ align-items: center;
1090
+ outline: none !important;
1091
+ }
1008
1092
 
1009
- :host([disabled][variant="secondary"]) {
1010
- --button-border: var(--color-border-secondary);
1011
- }
1093
+ .icon-button {
1094
+ display: flex;
1095
+ justify-content: center;
1096
+ align-items: center;
1097
+ width: 32px;
1098
+ height: 32px;
1099
+ border: transparent;
1100
+ border-radius: var(--radius-full);
1101
+ cursor: pointer;
1102
+ position: relative;
1012
1103
 
1013
- .button {
1014
- display: inline-flex;
1015
- align-items: center;
1016
- justify-content: center;
1017
- width: 100%;
1018
- gap: var(--spacing-s, 8px);
1019
- height: 100%;
1020
- background-color: var(--button-bg);
1021
- color: var(--button-text);
1022
- border: var(--button-border-width, var(--border-m)) solid var(--button-border);
1023
- border-radius: var(--radius-m);
1024
- font-family: var(--font-family-loccitane-sans);
1025
- font-size: var(--font-size-150);
1026
- font-weight: var(--font-weight-400);
1027
- line-height: var(--line-height-200);
1028
- min-width: 64px;
1029
- padding: var(--button-padding);
1030
- text-decoration: none;
1031
- cursor: inherit;
1032
- box-sizing: border-box;
1104
+ &.icon-wishlist {
1105
+ svg {
1106
+ path {
1107
+ stroke: var(--color-content-action-secondary);
1108
+ stroke-width: var(--icon-stroke-width, 1);
1109
+ }
1110
+ }
1111
+ }
1112
+ }
1033
1113
 
1034
- span {
1035
- font-family: var(--font-family-loccitane-sans);
1036
- font-size: var(--font-size-150);
1037
- font-weight: var(--font-weight-400);
1038
- line-height: var(--line-height-200);
1039
- }
1040
- }
1114
+ .icon-button.filled svg {
1115
+ fill: var(--color-content-action-secondary);
1116
+ }
1041
1117
 
1042
- .button:hover:not([disabled]) {
1043
- background-color: var(--button-bg-hover);
1044
- color: var(--button-text-hover);
1045
- }
1118
+ .icon-button.xsmall {
1119
+ width: 20px;
1120
+ height: 20px;
1046
1121
 
1047
- .button:active:not([disabled]) {
1048
- background-color: var(--button-bg-pressed);
1049
- }
1122
+ &:not(.icon-wishlist) {
1123
+ svg {
1124
+ width: 8px;
1125
+ height: 8px;
1126
+ }
1127
+ }
1128
+ }
1050
1129
 
1051
- .button:focus-visible {
1052
- ${at};
1053
- }
1130
+ .icon-button.small {
1131
+ width: 32px;
1132
+ height: 32px;
1054
1133
 
1055
- span.text + span.text::before {
1056
- content: "•";
1057
- margin-right: 8px;
1058
- }
1134
+ &:not(.icon-wishlist) {
1135
+ svg {
1136
+ width: 16px;
1137
+ height: 16px;
1138
+ }
1139
+ }
1140
+ }
1059
1141
 
1060
- .icon-start,
1061
- .icon-end {
1062
- display: inline-flex;
1063
- align-items: center;
1142
+ .icon-button.medium {
1143
+ width: 40px;
1144
+ height: 40px;
1064
1145
 
1065
- svg {
1066
- max-height: 20px;
1067
- }
1068
- svg[x] {
1069
- width: 15px;
1070
- }
1071
- path[fill],
1072
- path[class] {
1073
- fill: var(--button-text) !important;
1074
- }
1075
- path[stroke] {
1076
- stroke: var(--button-text) !important;
1077
- }
1078
- }
1146
+ &:not(.icon-wishlist) {
1147
+ svg {
1148
+ width: 16px;
1149
+ height: 16px;
1150
+ }
1151
+ }
1152
+ }
1079
1153
 
1080
- :host([variant="tertiary"][fullwidth][endIcon]) .button {
1081
- justify-content: space-between;
1082
- }
1154
+ .icon-button.large {
1155
+ width: 40px;
1156
+ height: 40px;
1083
1157
 
1084
- .button span {
1085
- display: inline-flex;
1086
- align-items: center;
1087
- }
1158
+ &:not(.icon-wishlist) {
1159
+ svg {
1160
+ width: 24px;
1161
+ height: 24px;
1162
+ }
1163
+ }
1164
+ }
1088
1165
 
1089
- .button slot {
1090
- display: inline-flex;
1091
- align-items: center;
1092
- }
1093
-
1094
- :host([variant="tertiary"][endIcon]) .button .icon-end {
1095
- width: var(--button-endicon-svg-width, 8px);
1096
- }
1166
+ .icon-button.none-light, .icon-button.none-contrast {
1167
+ background-color: transparent;
1168
+ width: auto;
1169
+ height: auto;
1097
1170
 
1098
- :host([underlined]) span:not([class*="icon-"]),
1099
- :host([underlined]) .text,
1100
- :host([underlined]:not([text])) .button slot {
1101
- position: relative;
1171
+ &.xsmall {
1172
+ svg {
1173
+ width: 8px;
1174
+ height: 8px;
1175
+ }
1176
+ }
1102
1177
 
1103
- &::after {
1104
- content: "";
1105
- display: block;
1106
- position: absolute;
1107
- bottom: 0;
1108
- left: 0;
1109
- width: 100%;
1110
- border-bottom: var(--border-M, 1px) solid var(--button-text);
1111
- }
1112
- }
1178
+ &.small {
1179
+ svg {
1180
+ width: 16px;
1181
+ height: 16px;
1182
+ }
1183
+ }
1113
1184
 
1114
- :host([underlined]:not([text])) .button slot {
1115
- display: inline-flex;
1116
- gap: 8px;
1117
- }
1185
+ &.medium {
1186
+ svg {
1187
+ width: 16px;
1188
+ height: 16px;
1189
+ }
1190
+ }
1118
1191
 
1119
- :host([underlined][withbadge]:not([text])) .button slot {
1120
- &::after {
1121
- width: calc(100% - var(--badge-outer-width, 19px) - var(--spacing-s, 8px))
1122
- }
1123
- }
1124
-
1125
- //Icon movement on hover
1126
- :host([variant="tertiary"][endIcon]) .icon-end {
1127
- display: inline-flex;
1128
- align-items: center;
1129
- }
1192
+ &.large {
1193
+ svg {
1194
+ width: 24px;
1195
+ height: 24px;
1196
+ }
1197
+ }
1130
1198
 
1131
- :host([variant="tertiary"][endIcon]:hover) .icon-end {
1132
- transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
1133
- transform: translateX(4px);
1134
- }
1135
- //End icon movment on hover
1136
- `;
1137
- x([
1138
- a()
1139
- ], b.prototype, "type", 2);
1140
- x([
1141
- a({ reflect: !0 })
1142
- ], b.prototype, "value", 2);
1143
- x([
1144
- a({ type: String, reflect: !0 })
1145
- ], b.prototype, "variant", 2);
1146
- x([
1147
- a({ type: String })
1148
- ], b.prototype, "text", 2);
1149
- x([
1150
- a({ type: String })
1151
- ], b.prototype, "textsecond", 2);
1152
- x([
1153
- a({ type: Boolean, reflect: !0 })
1154
- ], b.prototype, "fullwidth", 2);
1155
- x([
1156
- a({ type: Boolean, reflect: !0 })
1157
- ], b.prototype, "disabled", 2);
1158
- x([
1159
- a({ type: String, reflect: !0 })
1160
- ], b.prototype, "startIconModel", 2);
1161
- x([
1162
- a({ type: String, reflect: !0 })
1163
- ], b.prototype, "endIconModel", 2);
1164
- x([
1165
- a({ type: Boolean, reflect: !0, attribute: "starticon" })
1166
- ], b.prototype, "startIcon", 2);
1167
- x([
1168
- a({ type: Boolean, reflect: !0, attribute: "endicon" })
1169
- ], b.prototype, "endIcon", 2);
1170
- x([
1171
- a({ type: String, attribute: "paneltarget", reflect: !0 })
1172
- ], b.prototype, "panelTarget", 2);
1173
- x([
1174
- a({ type: String })
1175
- ], b.prototype, "href", 2);
1176
- x([
1177
- a({ type: String })
1178
- ], b.prototype, "target", 2);
1179
- x([
1180
- a({ type: Boolean, reflect: !0 })
1181
- ], b.prototype, "underlined", 2);
1182
- x([
1183
- a({ type: Boolean, reflect: !0 })
1184
- ], b.prototype, "withbadge", 2);
1185
- b = x([
1186
- y("o-button")
1187
- ], b);
1188
- var $o = Object.defineProperty, Co = Object.getOwnPropertyDescriptor, At = (o, t, e, n) => {
1189
- for (var i = n > 1 ? void 0 : n ? Co(t, e) : t, r = o.length - 1, s; r >= 0; r--)
1190
- (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
1191
- return n && i && $o(t, e, i), i;
1192
- };
1193
- let rt = class extends u {
1194
- constructor() {
1195
- super(...arguments), this.status = "empty", this.ariaDescribedBy = "a-product-name", this.label = "Add to wishlist", this.toggleStatus = () => {
1196
- this.status = this.status === "empty" ? "filled" : "empty", this.setAttribute("aria-pressed", String(this.status === "filled")), this.dispatchEvent(new CustomEvent("wishlist-toggle", {
1197
- detail: { status: this.status },
1198
- bubbles: !0,
1199
- composed: !0
1200
- }));
1201
- };
1202
- }
1203
- connectedCallback() {
1204
- super.connectedCallback(), this.setAttribute("role", "button"), this.setAttribute("aria-pressed", String(this.status === "filled"));
1205
- }
1206
- firstUpdated() {
1207
- this.addEventListener("click", this.toggleStatus), this.addEventListener("keydown", this.handleKeydown);
1208
- }
1209
- handleKeydown(o) {
1210
- (o.key === "Enter" || o.key === " ") && (o.preventDefault(), this.toggleStatus());
1211
- }
1212
- render() {
1213
- const o = N.wishlist.replace(
1214
- "<svg",
1215
- '<svg aria-hidden="true" focusable="false" part="svg"'
1216
- );
1217
- return l`
1218
- <button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
1219
- <span class="sr-only">${this.label}</span>
1220
- ${C(o)}
1221
- </button>
1222
- `;
1223
- }
1224
- setStatus(o) {
1225
- this.status = o, this.setAttribute("aria-pressed", String(this.status === "filled")), this.requestUpdate();
1226
- }
1227
- setAriaDescribedBy(o) {
1228
- this.ariaDescribedBy = o, this.requestUpdate();
1229
- }
1230
- setLabel(o) {
1231
- this.label = o, this.requestUpdate();
1232
- }
1233
- };
1234
- rt.styles = f`
1235
- :host {
1236
- display: inline-flex;
1237
- justify-content: center;
1238
- align-items: center;
1239
- outline: none !important;
1199
+ &:disabled {
1200
+ background-color: transparent;
1201
+ }
1240
1202
  }
1241
1203
 
1242
- .wishlist-button {
1243
- display: flex;
1244
- justify-content: center;
1245
- align-items: center;
1246
- width: 40px;
1247
- height: 40px;
1248
- border: transparent;
1249
- border-radius: var(--radius-full);
1250
- background-color: var(--color-alpha-light-strong);
1251
- position: relative;
1252
- cursor: pointer;
1204
+ .icon-button.none-light {
1205
+ svg {
1206
+ path {
1207
+ stroke: var(--color-content-action-primary);
1208
+ fill: var(--color-content-action-primary);
1209
+ }
1210
+ }
1253
1211
  }
1254
1212
 
1255
- .wishlist-button:hover {
1256
- background-color: var(--color-alpha-light-stronger);
1213
+ .icon-button.none-light.icon-wishlist svg path {
1214
+ fill: none;
1257
1215
  }
1258
1216
 
1259
- .wishlist-button:active {
1260
- background-color: var(--color-alpha-light-strongest);
1217
+ :host([status="filled"]) .icon-button.none-light.icon-wishlist svg path {
1218
+ fill: var(--color-content-action-primary);
1261
1219
  }
1262
1220
 
1263
- .wishlist-button:focus-visible {
1264
- ${at};
1221
+ .icon-button.background-light {
1222
+ background-color: var(--color-alpha-light-strong);
1223
+
1224
+ &:hover:not(:disabled) {
1225
+ background-color: var(--color-alpha-light-stronger);
1226
+ }
1227
+
1228
+ &:active:not(:disabled) {
1229
+ background-color: var(--color-alpha-light-strongest);
1230
+ }
1265
1231
  }
1266
1232
 
1267
- .wishlist-button:hover svg path {
1268
- fill: var(--color-content-action-secondary);
1233
+ .icon-button.background-contrast {
1234
+ background-color: var(--color-container-action-tertiary-default);
1235
+
1236
+ &:hover:not(:disabled) {
1237
+ background-color: var(--color-container-action-tertiary-hover);
1238
+ }
1239
+
1240
+ &:active:not(:disabled) {
1241
+ background-color: var(--color-container-action-tertiary-pressed);
1242
+ }
1269
1243
  }
1270
1244
 
1271
- :host([status="filled"]) .wishlist-button svg path {
1272
- fill: var(--color-content-action-secondary);
1245
+ .icon-button.ghost-light {
1246
+ background-color: transparent;
1247
+
1248
+ svg {
1249
+ path {
1250
+ stroke: var(--color-content-action-primary);
1251
+ fill: var(--color-content-action-primary);
1252
+ }
1253
+ }
1254
+
1255
+ &:hover:not(:disabled) {
1256
+ background-color: var(--color-alpha-light-lightest);
1257
+ }
1258
+
1259
+ &:active:not(:disabled) {
1260
+ background-color: var(--color-alpha-light-light);
1261
+ }
1273
1262
  }
1274
1263
 
1275
- :host([status="empty"]) .wishlist-button svg path {
1276
- fill: var(--color-alpha-light-strong);
1264
+ .icon-button.ghost-contrast {
1265
+ background-color: transparent;
1266
+
1267
+ &:hover:not(:disabled) {
1268
+ background-color: var(--color-alpha-light-medium);
1269
+ }
1270
+
1271
+ &:active:not(:disabled) {
1272
+ background-color: var(--color-alpha-light-strongest);
1273
+ }
1277
1274
  }
1278
1275
 
1279
- @media (hover: hover) and (pointer: fine) {
1280
- :host([status="empty"]) .wishlist-button:hover svg path {
1281
- fill: var(--color-content-action-secondary);
1276
+ .icon-button:disabled {
1277
+ background-color: var(--color-container-disabled);
1278
+ cursor: default;
1279
+
1280
+ svg {
1281
+ fill: var(--color-content-disabled);
1282
+
1283
+ path {
1284
+ fill: var(--color-content-disabled);
1285
+ }
1282
1286
  }
1283
1287
  }
1284
1288
 
1289
+ .icon-button:focus-visible {
1290
+ ${at}
1291
+ }
1292
+
1285
1293
  .sr-only {
1286
- border: 0 !important;
1287
- clip: rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;
1288
- -webkit-clip-path: inset(50%) !important;
1289
- clip-path: inset(50%) !important;
1290
- height: 0.1rem !important;
1291
- margin: -0.1rem !important;
1292
- overflow: hidden !important;
1293
- padding: 0 !important;
1294
- position: absolute !important;
1295
- width: 0.1rem !important;
1296
- white-space: nowrap !important;
1294
+ display: none;
1297
1295
  }
1298
1296
  `;
1299
- At([
1297
+ H([
1300
1298
  a({ type: String, reflect: !0 })
1301
- ], rt.prototype, "status", 2);
1302
- At([
1299
+ ], S.prototype, "bgstyle", 2);
1300
+ H([
1303
1301
  a({ type: String, reflect: !0 })
1304
- ], rt.prototype, "ariaDescribedBy", 2);
1305
- At([
1306
- a({ type: String, reflect: !0 })
1307
- ], rt.prototype, "label", 2);
1308
- rt = At([
1309
- y("o-wishlist-button")
1310
- ], rt);
1311
- /**
1312
- * @license
1313
- * Copyright 2018 Google LLC
1314
- * SPDX-License-Identifier: BSD-3-Clause
1315
- */
1316
- const k = (o) => o ?? d;
1317
- var _o = Object.defineProperty, ko = Object.getOwnPropertyDescriptor, H = (o, t, e, n) => {
1318
- for (var i = n > 1 ? void 0 : n ? ko(t, e) : t, r = o.length - 1, s; r >= 0; r--)
1319
- (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
1320
- return n && i && _o(t, e, i), i;
1321
- };
1322
- let S = class extends u {
1323
- constructor() {
1324
- super(...arguments), this.bgstyle = "background-light", this.size = "medium", this.status = "empty", this.type = "button", this.strokewidth = "1", this.icon = "wishlist", this.disabled = !1, this.showSrLabel = !1, this.srLabel = "";
1325
- }
1326
- updated(o) {
1327
- super.updated(o), this.style.setProperty("--icon-stroke-width", this.strokewidth);
1328
- }
1329
- render() {
1330
- const o = N[this.icon] ?? "", t = `icon-${this.icon}`, e = o.replace("<svg", '<svg aria-hidden="true" focusable="false" part="svg"').replace(/<path\b/g, '<path part="icon-path"').replace(/<g\b/g, '<g part="icon-group"').replace(/<circle\b/g, '<circle part="icon-circle"'), n = this.showSrLabel ? l`<span class="sr-only">${this.srLabel}</span>` : null, i = this.showSrLabel ? null : "icon";
1331
- return l`
1332
- ${this.type === "span" ? l`
1333
- <span class="icon icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}" ?disabled="${this.disabled}">
1334
- ${C(e)}
1335
- </span>
1336
- ` : l`
1337
- <button
1338
- type="button"
1339
- aria-label=${k(i)}
1340
- class="icon-button ${this.size} ${this.bgstyle} ${this.status} ${t}"
1341
- ?disabled="${this.disabled}"
1342
- >
1343
- ${C(e)}
1344
- ${n}
1345
- </button>
1346
- `}
1347
- `;
1348
- }
1349
- };
1350
- S.styles = f`
1351
- :host {
1352
- display: inline-flex;
1353
- justify-content: center;
1354
- align-items: center;
1355
- outline: none !important;
1356
- }
1357
-
1358
- .icon-button {
1359
- display: flex;
1360
- justify-content: center;
1361
- align-items: center;
1362
- width: 32px;
1363
- height: 32px;
1364
- border: transparent;
1365
- border-radius: var(--radius-full);
1366
- cursor: pointer;
1367
- position: relative;
1368
-
1369
- &.icon-wishlist {
1370
- svg {
1371
- path {
1372
- stroke: var(--color-content-action-secondary);
1373
- stroke-width: var(--icon-stroke-width, 1);
1374
- }
1375
- }
1376
- }
1377
- }
1378
-
1379
- .icon-button.filled svg {
1380
- fill: var(--color-content-action-secondary);
1381
- }
1382
-
1383
- .icon-button.xsmall {
1384
- width: 20px;
1385
- height: 20px;
1386
-
1387
- &:not(.icon-wishlist) {
1388
- svg {
1389
- width: 8px;
1390
- height: 8px;
1391
- }
1392
- }
1393
- }
1394
-
1395
- .icon-button.small {
1396
- width: 32px;
1397
- height: 32px;
1398
-
1399
- &:not(.icon-wishlist) {
1400
- svg {
1401
- width: 16px;
1402
- height: 16px;
1403
- }
1404
- }
1405
- }
1406
-
1407
- .icon-button.medium {
1408
- width: 40px;
1409
- height: 40px;
1410
-
1411
- &:not(.icon-wishlist) {
1412
- svg {
1413
- width: 16px;
1414
- height: 16px;
1415
- }
1416
- }
1417
- }
1418
-
1419
- .icon-button.large {
1420
- width: 40px;
1421
- height: 40px;
1422
-
1423
- &:not(.icon-wishlist) {
1424
- svg {
1425
- width: 24px;
1426
- height: 24px;
1427
- }
1428
- }
1429
- }
1430
-
1431
- .icon-button.none-light, .icon-button.none-contrast {
1432
- background-color: transparent;
1433
- width: auto;
1434
- height: auto;
1435
-
1436
- &.xsmall {
1437
- svg {
1438
- width: 8px;
1439
- height: 8px;
1440
- }
1441
- }
1442
-
1443
- &.small {
1444
- svg {
1445
- width: 16px;
1446
- height: 16px;
1447
- }
1448
- }
1449
-
1450
- &.medium {
1451
- svg {
1452
- width: 16px;
1453
- height: 16px;
1454
- }
1455
- }
1456
-
1457
- &.large {
1458
- svg {
1459
- width: 24px;
1460
- height: 24px;
1461
- }
1462
- }
1463
-
1464
- &:disabled {
1465
- background-color: transparent;
1466
- }
1467
- }
1468
-
1469
- .icon-button.none-light {
1470
- svg {
1471
- path {
1472
- stroke: var(--color-content-action-primary);
1473
- fill: var(--color-content-action-primary);
1474
- }
1475
- }
1476
- }
1477
-
1478
- .icon-button.none-light.icon-wishlist svg path {
1479
- fill: none;
1480
- }
1481
-
1482
- :host([status="filled"]) .icon-button.none-light.icon-wishlist svg path {
1483
- fill: var(--color-content-action-primary);
1484
- }
1485
-
1486
- .icon-button.background-light {
1487
- background-color: var(--color-alpha-light-strong);
1488
-
1489
- &:hover:not(:disabled) {
1490
- background-color: var(--color-alpha-light-stronger);
1491
- }
1492
-
1493
- &:active:not(:disabled) {
1494
- background-color: var(--color-alpha-light-strongest);
1495
- }
1496
- }
1497
-
1498
- .icon-button.background-contrast {
1499
- background-color: var(--color-container-action-tertiary-default);
1500
-
1501
- &:hover:not(:disabled) {
1502
- background-color: var(--color-container-action-tertiary-hover);
1503
- }
1504
-
1505
- &:active:not(:disabled) {
1506
- background-color: var(--color-container-action-tertiary-pressed);
1507
- }
1508
- }
1509
-
1510
- .icon-button.ghost-light {
1511
- background-color: transparent;
1512
-
1513
- svg {
1514
- path {
1515
- stroke: var(--color-content-action-primary);
1516
- fill: var(--color-content-action-primary);
1517
- }
1518
- }
1519
-
1520
- &:hover:not(:disabled) {
1521
- background-color: var(--color-alpha-light-lightest);
1522
- }
1523
-
1524
- &:active:not(:disabled) {
1525
- background-color: var(--color-alpha-light-light);
1526
- }
1527
- }
1528
-
1529
- .icon-button.ghost-contrast {
1530
- background-color: transparent;
1531
-
1532
- &:hover:not(:disabled) {
1533
- background-color: var(--color-alpha-light-medium);
1534
- }
1535
-
1536
- &:active:not(:disabled) {
1537
- background-color: var(--color-alpha-light-strongest);
1538
- }
1539
- }
1540
-
1541
- .icon-button:disabled {
1542
- background-color: var(--color-container-disabled);
1543
- cursor: default;
1544
-
1545
- svg {
1546
- fill: var(--color-content-disabled);
1547
-
1548
- path {
1549
- fill: var(--color-content-disabled);
1550
- }
1551
- }
1552
- }
1553
-
1554
- .icon-button:focus-visible {
1555
- ${at}
1556
- }
1557
-
1558
- .sr-only {
1559
- display: none;
1560
- }
1561
- `;
1562
- H([
1563
- a({ type: String, reflect: !0 })
1564
- ], S.prototype, "bgstyle", 2);
1565
- H([
1566
- a({ type: String, reflect: !0 })
1567
- ], S.prototype, "size", 2);
1568
- H([
1302
+ ], S.prototype, "size", 2);
1303
+ H([
1569
1304
  a({ type: String, reflect: !0 })
1570
1305
  ], S.prototype, "status", 2);
1571
1306
  H([
@@ -1589,940 +1324,1205 @@ H([
1589
1324
  S = H([
1590
1325
  y("o-icon-button")
1591
1326
  ], S);
1592
- var So = Object.defineProperty, Ao = Object.getOwnPropertyDescriptor, ot = (o, t, e, n) => {
1593
- for (var i = n > 1 ? void 0 : n ? Ao(t, e) : t, r = o.length - 1, s; r >= 0; r--)
1327
+ var Lo = Object.defineProperty, Po = Object.getOwnPropertyDescriptor, g = (o, t, e, n) => {
1328
+ for (var i = n > 1 ? void 0 : n ? Po(t, e) : t, r = o.length - 1, s; r >= 0; r--)
1594
1329
  (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
1595
- return n && i && So(t, e, i), i;
1330
+ return n && i && Lo(t, e, i), i;
1596
1331
  };
1597
- let F = class extends u {
1332
+ let p = class extends u {
1598
1333
  constructor() {
1599
- super(...arguments), this.href = "", this.target = "", this.template = "standard", this.inverse = !1, this.endIcon = !1, this.reverseEndIcon = !1;
1600
- }
1601
- _handleClick(o) {
1602
- (!this.href || this.href === "#") && o.preventDefault();
1603
- }
1604
- render() {
1605
- const o = this.href || "#";
1334
+ super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.closeButtonLabel = "Close the modal", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this._onOpenDetail = async (o) => {
1335
+ var e, n;
1336
+ const t = ((e = o.detail) == null ? void 0 : e.origin) ?? document.activeElement;
1337
+ if (this._detailOriginEl = t, this._detailOriginClass = (t == null ? void 0 : t.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
1338
+ const i = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view");
1339
+ i && i.setAttribute("fromelement", this._detailOriginClass);
1340
+ }
1341
+ this._setPriceTabindex(), await this.focusDetailReturnBtn();
1342
+ }, this._detailOriginEl = null, this._detailOriginClass = "", this.handleKeyDown = (o) => {
1343
+ this.open && (o.key === "Escape" ? this.closePanel() : o.key === "Tab" && this.trapFocus(o));
1344
+ }, this.handleClosePanel = (o) => {
1345
+ if (o instanceof KeyboardEvent && o.key !== "Enter" && o.key !== " ")
1346
+ return;
1347
+ o.preventDefault(), o.stopPropagation();
1348
+ const t = o.currentTarget, e = (t == null ? void 0 : t.getAttribute("data-role")) === "back";
1349
+ if (this.showDetail && e) {
1350
+ this.isHidingDetail = !0;
1351
+ const n = this.renderRoot.querySelector(".content"), i = async () => {
1352
+ this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1, await this.updateComplete, this._restoreFocusToOrigin();
1353
+ };
1354
+ if (n) {
1355
+ this.showHeaderStartIcon = !1;
1356
+ const r = () => {
1357
+ this.showDetail = !1, this.isHidingDetail = !1, n.removeEventListener("animationend", r), i();
1358
+ };
1359
+ n.addEventListener("animationend", r);
1360
+ } else
1361
+ this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1;
1362
+ return;
1363
+ }
1364
+ this.closePanel();
1365
+ }, this._onDetailSlotChange = (o) => {
1366
+ const n = o.target.assignedElements({ flatten: !0 }).flatMap((i) => Array.from(i.querySelectorAll("img")))[0];
1367
+ n == null || n.setAttribute("tabindex", "0");
1368
+ };
1369
+ }
1370
+ connectedCallback() {
1371
+ super.connectedCallback(), !this.disablePortal && this.parentElement !== document.body && document.body.appendChild(this), this.addEventListener("keydown", this.handleKeyDown), this.updateComplete.then(() => {
1372
+ this.initialized = !0;
1373
+ }), this.addEventListener("open-detail", this._onOpenDetail);
1374
+ }
1375
+ disconnectedCallback() {
1376
+ document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), this.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback(), this.removeEventListener("open-detail", this._onOpenDetail);
1377
+ }
1378
+ async focusDetailReturnBtn() {
1379
+ var n, i, r, s;
1380
+ await this.updateComplete;
1381
+ const o = this.getDeepActiveElement(document);
1382
+ if (o && o !== document.body)
1383
+ try {
1384
+ o.blur();
1385
+ } catch {
1386
+ }
1387
+ await new Promise(requestAnimationFrame);
1388
+ const t = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view .return-btn");
1389
+ if (!t) return;
1390
+ t.updateComplete && await t.updateComplete, (s = (r = ((i = t.shadowRoot) == null ? void 0 : i.querySelector("button")) ?? t) == null ? void 0 : r.focus) == null || s.call(r, { preventScroll: !0 });
1391
+ }
1392
+ _setPriceTabindex() {
1393
+ var n;
1394
+ const o = (n = this.shadowRoot) == null ? void 0 : n.querySelector('slot[name="detail"]');
1395
+ if (!o) return;
1396
+ const e = o.assignedElements({ flatten: !0 }).flatMap(
1397
+ (i) => Array.from(i.querySelectorAll(".m-product-price-standard"))
1398
+ );
1399
+ for (const i of e)
1400
+ i.hasAttribute("tabindex") || i.setAttribute("tabindex", "0");
1401
+ }
1402
+ _restoreFocusToOrigin() {
1403
+ var t, e;
1404
+ const o = this._detailOriginEl;
1405
+ !o || !document.contains(o) || ((e = (t = document.activeElement) == null ? void 0 : t.blur) == null || e.call(t), requestAnimationFrame(() => {
1406
+ var i;
1407
+ o.classList.add("a--tabfocus"), (((i = o.shadowRoot) == null ? void 0 : i.querySelector('button, .button, [tabindex]:not([tabindex="-1"])')) ?? null ?? o).focus({ preventScroll: !0 });
1408
+ }));
1409
+ }
1410
+ getDeepActiveElement(o = this.shadowRoot) {
1411
+ let t = o.activeElement;
1412
+ for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
1413
+ t = t.shadowRoot.activeElement;
1414
+ return t;
1415
+ }
1416
+ trapFocus(o) {
1417
+ if (o.key !== "Tab") return;
1418
+ const t = this.getDeepActiveElement(), e = this.renderRoot.querySelector(".close-btn");
1419
+ if (!o.shiftKey && e && e.contains(t)) {
1420
+ o.preventDefault();
1421
+ const n = this.renderRoot.querySelector(
1422
+ ".o-whats-inside--content p"
1423
+ );
1424
+ n == null || n.focus();
1425
+ }
1426
+ }
1427
+ getFocusableElements() {
1428
+ const o = this.renderRoot.querySelector(".panel");
1429
+ if (!o) return [];
1430
+ function t(i) {
1431
+ return !(i.disabled || i.hasAttribute("disabled") || i.hasAttribute("tabindex") && i.getAttribute("tabindex") === "-1");
1432
+ }
1433
+ function e(i) {
1434
+ var s;
1435
+ const r = [i.matches(p.focusablesSelector) ? i : []];
1436
+ if (!["o-icon-button", "o-button"].includes(i.tagName.toLowerCase())) {
1437
+ const h = Array.from(
1438
+ i instanceof HTMLSlotElement ? i.assignedElements({ flatten: !0 }) : []
1439
+ ).filter(t).flatMap(e), c = Array.from(
1440
+ ((s = i.shadowRoot) == null ? void 0 : s.querySelectorAll("*")) || []
1441
+ ).filter(t).flatMap(e);
1442
+ r.push(...h, ...c);
1443
+ }
1444
+ return r.flat();
1445
+ }
1446
+ return Array.from(o.querySelectorAll("*")).filter(t).flatMap(e);
1447
+ }
1448
+ openPanel() {
1449
+ this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
1450
+ const o = this.renderRoot.querySelector(".panel");
1451
+ o && o.setAttribute("aria-modal", "true"), this.updateComplete.then(() => {
1452
+ var t, e, n, i;
1453
+ if (this.showHeader) {
1454
+ const r = ((t = this.shadowRoot) == null ? void 0 : t.querySelector(".panel .close-btn")) || null, s = ((e = r == null ? void 0 : r.shadowRoot) == null ? void 0 : e.querySelector("button")) || null;
1455
+ s && ((n = s.focus) == null || n.call(s));
1456
+ } else {
1457
+ const r = this.getFocusableElements()[0];
1458
+ (i = r == null ? void 0 : r.focus) == null || i.call(r);
1459
+ }
1460
+ }), this.dispatchEvent(
1461
+ new CustomEvent("open", { bubbles: !0, composed: !0 })
1462
+ );
1463
+ }
1464
+ closePanel() {
1465
+ var t, e, n, i, r;
1466
+ this.open = !1, this.showDetail = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), ((t = this.previousFocusedElement) == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (i = (n = (e = this.previousFocusedElement.shadowRoot) == null ? void 0 : e.querySelector(".button")) == null ? void 0 : n.focus) == null || i.call(n) : (r = this.previousFocusedElement) == null || r.focus();
1467
+ const o = this.renderRoot.querySelector(".panel");
1468
+ o && o.removeAttribute("aria-modal"), this.dispatchEvent(
1469
+ new CustomEvent("close", { bubbles: !0, composed: !0 })
1470
+ );
1471
+ }
1472
+ handleFirstClick(o) {
1473
+ o instanceof KeyboardEvent && o.key !== "Enter" && o.key !== " " || (o.preventDefault(), o.stopPropagation(), this.onFirstButtonClickClose && this.closePanel(), this.dispatchEvent(
1474
+ new CustomEvent("firstbuttonclick", {
1475
+ bubbles: !0,
1476
+ composed: !0,
1477
+ cancelable: !0,
1478
+ detail: {
1479
+ button: "first",
1480
+ target: o.target
1481
+ }
1482
+ })
1483
+ ));
1484
+ }
1485
+ handleSecondClick(o) {
1486
+ o instanceof KeyboardEvent && o.key !== "Enter" && o.key !== " " || (o.preventDefault(), o.stopPropagation(), this.onSecondButtonClickClose && this.closePanel(), this.dispatchEvent(
1487
+ new CustomEvent("secondbuttonclick", {
1488
+ bubbles: !0,
1489
+ composed: !0,
1490
+ cancelable: !0,
1491
+ detail: {
1492
+ button: "second",
1493
+ target: o.target
1494
+ }
1495
+ })
1496
+ ));
1497
+ }
1498
+ updated() {
1499
+ this.style.setProperty("--z-overlay", `${this.zIndex || 99}`), this.style.setProperty("--z-panel", `${this.zIndex ? this.zIndex + 1 : 99}`), this.open || setTimeout(() => {
1500
+ this.setAttribute("hidden", "hidden");
1501
+ }, 500);
1502
+ }
1503
+ render() {
1504
+ const o = this.showHeader ? l`
1505
+ <div tabindex="-1" class="header">
1506
+ ${this.showHeaderStartIcon ? l`
1507
+ <o-icon-button
1508
+ icon="arrowLeft"
1509
+ size="small"
1510
+ class="return-btn"
1511
+ bgstyle="background-light"
1512
+ data-role="back"
1513
+ @click=${this.handleClosePanel}
1514
+ @keydown=${this.handleClosePanel}
1515
+ aria-label="${this.closeButtonLabel}"
1516
+ srlabel="${this.closeButtonLabel}"
1517
+ showsrlabel="true"
1518
+ ></o-icon-button>
1519
+ ` : null}
1520
+ <p role="heading" aria-level="1" id="panel-title" class="${this.headerTitleClassName}">
1521
+ ${this.headerTitle}
1522
+ </p>
1523
+ <o-icon-button
1524
+ icon="cross"
1525
+ size="small"
1526
+ class="close-btn"
1527
+ bgstyle="background-light"
1528
+ @click=${this.handleClosePanel}
1529
+ @keydown=${this.handleClosePanel}
1530
+ aria-label="${this.closeButtonLabel}"
1531
+ aria-describedby="panel-title"
1532
+ srlabel="${this.closeButtonLabel}"
1533
+ showsrlabel="true"
1534
+ ></o-icon-button>
1535
+ </div>
1536
+ ` : null;
1606
1537
  return l`
1607
- <a
1608
- href="${o}"
1609
- target="${k(this.target || void 0)}"
1610
- @click="${this._handleClick}"
1611
- >
1612
- ${this.endIcon && this.reverseEndIcon ? l`
1613
- <o-icon-button
1614
- icon="chevronLeft"
1615
- bgstyle="${this.inverse ? "none-light" : "none-contrast"}"
1616
- size="xsmall"
1617
- aria-hidden="true"
1618
- type="span"
1619
- ></o-icon-button>
1620
- ` : null}
1621
- <span class="link-text"><slot></slot></span>
1622
- ${this.endIcon && !this.reverseEndIcon ? l`
1623
- <o-icon-button
1624
- icon="chevronRight"
1625
- bgstyle="${this.inverse ? "none-light" : "none-contrast"}"
1626
- size="xsmall"
1627
- aria-hidden="true"
1628
- type="span"
1629
- ></o-icon-button>
1630
- ` : null}
1631
- </a>
1632
- `;
1538
+ <div class="overlay" style="z-index: ${this.zIndex}" @click=${this.handleClosePanel}></div>
1539
+ <div
1540
+ class="panel"
1541
+ role="dialog"
1542
+ aria-modal="true"
1543
+ aria-labelledby="panel-title"
1544
+ style="z-index: ${this.zIndex + 1}"
1545
+ tabindex="-1"
1546
+ >
1547
+ <div role="document">
1548
+ ${o}
1549
+
1550
+ <div class="content ${this.isHidingDetail ? "slide-out-right" : ""} ${this.showDetail ? "with-detail" : ""}">
1551
+
1552
+ ${this.showDetail ? l`
1553
+ <div class="detail-view">
1554
+ ${o}
1555
+ <div class="detail-content">
1556
+ <slot name="detail" @slotchange=${this._onDetailSlotChange}></slot>
1557
+ </div>
1558
+ </div>
1559
+ ` : l`<slot></slot>`}
1560
+ </div>
1561
+
1562
+ ${this.showFooter ? l`
1563
+ <div class="footer">
1564
+ ${this.firstButtonVariant && this.firstButtonLabel ? l`
1565
+ <o-button
1566
+ variant="${this.firstButtonVariant}"
1567
+ @click=${this.handleFirstClick}
1568
+ @keydown=${this.handleFirstClick}
1569
+ ${le(this.firstButtonProps)}
1570
+ >
1571
+ ${this.firstButtonLabel}
1572
+ </o-button>
1573
+ ` : null}
1574
+
1575
+ ${this.secondButtonVariant && this.secondButtonLabel ? l`
1576
+ <o-button
1577
+ variant="${this.secondButtonVariant}"
1578
+ @click=${this.handleSecondClick}
1579
+ @keydown=${this.handleSecondClick}
1580
+ ${le(this.secondButtonProps)}
1581
+ >
1582
+ ${this.secondButtonLabel}
1583
+ </o-button>
1584
+ ` : null}
1585
+ </div>
1586
+ ` : null}
1587
+ </div>
1588
+ </div>
1589
+ `;
1633
1590
  }
1634
1591
  };
1635
- F.styles = f`
1636
- :host([template="standard"]) a {
1637
- color: var(--color-content-action-secondary);
1638
- font-size: var(--font-size-200);
1639
- font-weight: var(--font-weight-400);
1640
- line-height: var(--line-height-240);
1641
- letter-spacing: var(--letter-spacing-400);
1642
- font-family: var(--font-family-loccitane-serif);
1643
- }
1592
+ p.styles = f`
1593
+ :host {
1594
+ --z-overlay: 99;
1595
+ --z-panel: 100;
1596
+ position: fixed;
1597
+ top: 0;
1598
+ right: 0;
1599
+ height: 100%;
1600
+ width: 100%;
1601
+ pointer-events: none;
1602
+ z-index: var(--z-overlay);
1603
+ --side-panel-width: 100%;
1604
+ --side-panel-max-width: 416px;
1605
+ --font-size: var(--font-size-300);
1606
+ --line-height: var(--line-height-240);
1607
+ }
1644
1608
 
1645
- :host([template="discret"]) a {
1646
- color: var(--color-content-action-secondary);
1647
- font-size: var(--font-size-100);
1648
- font-weight: var(--font-weight-400);
1649
- line-height: var(--line-height-160);
1650
- letter-spacing: var(--letter-spacing-400);
1651
- font-family: var(--font-family-loccitane-sans);
1652
- }
1609
+ /* Hide content until it is initialized */
1610
+ :host(:not([initialized])) .content {
1611
+ display: none;
1612
+ }
1653
1613
 
1654
- :host([template="review"]) a {
1655
- color: var(--color-content-action-secondary);
1656
- font-size: var(--font-size-100);
1657
- font-weight: var(--font-weight-500);
1658
- line-height: var(--line-height-160);
1659
- letter-spacing: var(--letter-spacing-400);
1660
- font-family: var(--font-family-loccitane-sans);
1661
- text-transform: uppercase;
1662
- }
1614
+ /* hide the host completely until its initialized */
1615
+ :host(:not([initialized])) {
1616
+ display: none !important;
1617
+ }
1663
1618
 
1664
- :host([inverse]) a {
1665
- color: var(--color-container-action-tertiary-default);
1666
- }
1619
+ .overlay {
1620
+ position: absolute;
1621
+ inset: 0;
1622
+ backdrop-filter: blur(4px);
1623
+ background-color: rgba(0, 0, 0, 0.3);
1624
+ opacity: 0;
1625
+ transition: opacity 0.3s ease;
1626
+ pointer-events: none;
1627
+ z-index: var(--z-overlay);
1628
+ }
1667
1629
 
1668
- :host([endIcon]) a o-icon-button {
1669
- margin-left: 2px;
1670
- transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
1671
- }
1630
+ :host([open]) .overlay {
1631
+ opacity: 1;
1632
+ pointer-events: auto;
1633
+ }
1672
1634
 
1673
- :host([endIcon][reverseEndIcon]) a o-icon-button {
1674
- margin-right: 2px;
1675
- transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
1676
- }
1635
+ .panel {
1636
+ position: absolute;
1637
+ top: 0;
1638
+ right: 0;
1639
+ width: var(--side-panel-width);
1640
+ max-width: var(--side-panel-max-width);
1641
+ height: 100%;
1642
+ background: white;
1643
+ box-shadow: var(--colors-alpha-dark-60);
1644
+ transform: translateX(100%);
1645
+ transition: transform 0.3s ease;
1646
+ display: flex;
1647
+ flex-direction: column;
1648
+ pointer-events: auto;
1649
+ z-index: var(--z-panel);
1650
+ }
1677
1651
 
1678
- :host([endIcon]) a {
1679
- &:hover {
1680
- o-icon-button {
1681
- transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
1682
- :host(:not([reverseEndIcon])) & {
1683
- transform: translateX(4px);
1684
- }
1652
+ :host([open]) .panel {
1653
+ transform: translateX(0%);
1654
+ }
1685
1655
 
1686
- :host([reverseEndIcon]) & {
1687
- transform: translateX(-4px);
1688
- }
1689
- }
1690
- }
1691
- }
1656
+ .header {
1657
+ flex: 0 0 auto;
1658
+ display: flex;
1659
+ justify-content: space-between;
1660
+ padding: 20px 16px;
1661
+ border-bottom: var(--border-050) solid var(--color-border-tertiary);
1692
1662
 
1693
- :host a {
1694
- position: relative;
1695
- text-decoration: none;
1696
- color: inherit;
1697
- }
1663
+ .panel-title {
1664
+ font-family: var(--font-family-loccitane-serif);
1665
+ font-size: var(--font-size);
1666
+ font-weight: var(--font-weight-400);
1667
+ line-height: var(--line-height);
1668
+ font-style: italic;
1669
+ display: -webkit-box;
1670
+ -webkit-line-clamp: 2;
1671
+ -webkit-box-orient: vertical;
1672
+ height: auto;
1673
+ margin-top: auto;
1674
+ margin-bottom: auto;
1675
+ overflow: hidden;
1676
+ width: 100%;
1677
+ color: var(--color-content-heading);
1678
+ }
1698
1679
 
1699
- .link-text {
1700
- position: relative;
1701
- display: inline-block;
1702
- }
1680
+ .close-btn {
1681
+ margin-left: 8px;
1682
+ margin-top: 0;
1683
+ flex-direction: column;
1684
+ justify-content: start;
1685
+ }
1703
1686
 
1704
- .link-text::after {
1705
- content: "";
1706
- position: absolute;
1707
- left: 0;
1708
- bottom: 0;
1709
- width: 100%;
1710
- opacity: 1;
1711
- height: 1px;
1712
- background-color: currentColor;
1713
- transition: opacity 0.3s ease, height 0.3s ease;
1714
- pointer-events: none;
1715
- }
1687
+ .return-btn {
1688
+ margin-right: 8px;
1689
+ }
1690
+ }
1716
1691
 
1717
- :host a:hover .link-text::after {
1718
- opacity: 0;
1719
- height: 1px;
1720
- }
1721
- /* End of underline effect */
1722
- `;
1723
- ot([
1724
- a({ type: String })
1725
- ], F.prototype, "href", 2);
1726
- ot([
1727
- a({ type: String })
1728
- ], F.prototype, "target", 2);
1729
- ot([
1730
- a({ type: String, reflect: !0 })
1731
- ], F.prototype, "template", 2);
1732
- ot([
1733
- a({ type: Boolean, reflect: !0 })
1734
- ], F.prototype, "inverse", 2);
1735
- ot([
1736
- a({ type: Boolean, reflect: !0 })
1737
- ], F.prototype, "endIcon", 2);
1738
- ot([
1739
- a({ type: Boolean, reflect: !0 })
1740
- ], F.prototype, "reverseEndIcon", 2);
1741
- F = ot([
1742
- y("o-link")
1743
- ], F);
1744
- var Eo = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, Et = (o, t, e, n) => {
1745
- for (var i = n > 1 ? void 0 : n ? Lo(t, e) : t, r = o.length - 1, s; r >= 0; r--)
1746
- (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
1747
- return n && i && Eo(t, e, i), i;
1748
- };
1749
- let st = class extends u {
1750
- constructor() {
1751
- super(...arguments), this.rating = 0;
1752
- }
1753
- getStarKeys() {
1754
- const o = [];
1755
- for (let t = 0; t < 5; t++) {
1756
- const e = this.rating - t;
1757
- let n;
1758
- e >= 1 ? n = 100 : e <= 0 ? n = 0 : n = Math.round(e * 100 / 25) * 25, o.push(`star-${n}`);
1759
- }
1760
- return o;
1761
- }
1762
- render() {
1763
- const o = this.getStarKeys();
1764
- return l`
1765
- <div class="rating">
1766
- <div class="stars">
1767
- ${o.map(
1768
- (t) => l`<span class="star">${C(N[t] ?? "")}</span>`
1769
- )}
1770
- </div>
1771
- ${this.reviewCount != null && this.href != null ? l`<o-link template="review" href="${this.href}">${this.reviewCount}</o-link>` : null}
1772
- </div>
1773
- `;
1774
- }
1775
- };
1776
- st.styles = f`
1777
- svg {
1778
- width: 12px;
1779
- height: 12px;
1692
+ .panel:focus-visible,
1693
+ .close-btn:focus-visible {
1694
+ ${at}
1780
1695
  }
1781
- .rating {
1782
- display: flex;
1783
- align-items: center;
1696
+
1697
+ .content {
1698
+ flex: 1 1 auto;
1699
+ overflow-y: auto;
1700
+ overflow-x: hidden;
1701
+ padding: var(--spacing-xl);
1702
+
1703
+ &.with-detail {
1704
+ width: 100%;
1705
+ height: 100%;
1706
+ position: absolute;
1707
+ top: 0;
1708
+ left: 0;
1709
+ background: var(--color-container-bg-white);
1710
+ z-index: 3;
1711
+ padding: var(--spacing-4-xs);
1712
+ }
1784
1713
  }
1785
1714
 
1786
- .stars {
1715
+ .footer {
1716
+ flex: 0 0 auto;
1717
+ padding: var(--spacing-xl);
1718
+ border-top: var(--border-050) solid var(--color-border-tertiary);
1787
1719
  display: flex;
1788
- gap: 2px;
1720
+ flex-direction: column;
1721
+ gap: var(--spacing-l);
1722
+ justify-content: flex-start;
1789
1723
  }
1790
1724
 
1791
- .star {
1792
- display: block;
1725
+ /* Mobile */
1726
+ @media (max-width: 767px) {
1727
+ :host {
1728
+ --side-panel-width: 100%;
1729
+ --side-panel-max-width: none;
1730
+ }
1793
1731
  }
1794
1732
 
1795
- o-link {
1796
- margin-left: 6px;
1797
- font-family: var(--font-family-loccitane-sans);
1798
- font-weight: var(--font-weight-500);
1799
- font-size: var(--font-size-100);
1800
- line-height: var(--line-height-160);
1801
- letter-spacing: var(--letter-spacing-400);
1802
- color: var(--color-content-action-secondary);
1733
+ /* Tablet */
1734
+ @media (min-width: 768px) and (max-width: 1024px) {
1735
+ :host {
1736
+ --side-panel-width: 375px;
1737
+ --side-panel-max-width: 375px;
1738
+ }
1803
1739
  }
1804
1740
 
1805
- .review-link {
1806
- text-decoration: underline;
1807
- cursor: pointer;
1741
+ @media (min-width: 1025px) {
1742
+ :host {
1743
+ --side-panel-width: 100%;
1744
+ --side-panel-max-width: 416px;
1745
+ --font-size: var(--font-size-400);
1746
+ --line-height: var(--line-height-280);
1747
+ }
1808
1748
  }
1809
- `;
1810
- Et([
1811
- a({ type: Number })
1812
- ], st.prototype, "rating", 2);
1813
- Et([
1814
- a({ type: String })
1815
- ], st.prototype, "reviewCount", 2);
1816
- Et([
1817
- a({ type: String })
1818
- ], st.prototype, "href", 2);
1819
- st = Et([
1820
- y("o-rating")
1821
- ], st);
1822
- /**
1823
- * @license
1824
- * Copyright 2020 Google LLC
1825
- * SPDX-License-Identifier: BSD-3-Clause
1826
- */
1827
- const Po = (o) => o.strings === void 0;
1828
- /**
1829
- * @license
1830
- * Copyright 2017 Google LLC
1831
- * SPDX-License-Identifier: BSD-3-Clause
1832
- */
1833
- const dt = (o, t) => {
1834
- var n;
1835
- const e = o._$AN;
1836
- if (e === void 0) return !1;
1837
- for (const i of e) (n = i._$AO) == null || n.call(i, t, !1), dt(i, t);
1838
- return !0;
1839
- }, kt = (o) => {
1840
- let t, e;
1841
- do {
1842
- if ((t = o._$AM) === void 0) break;
1843
- e = t._$AN, e.delete(o), o = t;
1844
- } while ((e == null ? void 0 : e.size) === 0);
1845
- }, be = (o) => {
1846
- for (let t; t = o._$AM; o = t) {
1847
- let e = t._$AN;
1848
- if (e === void 0) t._$AN = e = /* @__PURE__ */ new Set();
1849
- else if (e.has(o)) break;
1850
- e.add(o), zo(t);
1851
- }
1852
- };
1853
- function Io(o) {
1854
- this._$AN !== void 0 ? (kt(this), this._$AM = o, be(this)) : this._$AM = o;
1855
- }
1856
- function Oo(o, t = !1, e = 0) {
1857
- const n = this._$AH, i = this._$AN;
1858
- if (i !== void 0 && i.size !== 0) if (t) if (Array.isArray(n)) for (let r = e; r < n.length; r++) dt(n[r], !1), kt(n[r]);
1859
- else n != null && (dt(n, !1), kt(n));
1860
- else dt(this, o);
1861
- }
1862
- const zo = (o) => {
1863
- o.type == Ut.CHILD && (o._$AP ?? (o._$AP = Oo), o._$AQ ?? (o._$AQ = Io));
1749
+
1750
+ @keyframes slideInRight {
1751
+ from {
1752
+ transform: translateX(100%);
1753
+ }
1754
+ to {
1755
+ transform: translateX(0%);
1756
+ }
1757
+ }
1758
+
1759
+ @keyframes slideOutRight {
1760
+ from {
1761
+ transform: translateX(0%);
1762
+ }
1763
+ to {
1764
+ transform: translateX(100%);
1765
+ }
1766
+ }
1767
+
1768
+ .slide-out-right {
1769
+ animation: slideOutRight 0.3s ease-in forwards;
1770
+ }
1771
+
1772
+ .detail-view {
1773
+ animation: slideInRight 0.3s ease-out both;
1774
+ }
1775
+ .detail-content {
1776
+ padding: var(--spacing-xl);
1777
+ }
1778
+ `;
1779
+ p.focusablesSelector = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';
1780
+ p.focusablesCustomElementsSelector = "o-icon-button, o-button";
1781
+ g([
1782
+ a({ type: Boolean, reflect: !0 })
1783
+ ], p.prototype, "open", 2);
1784
+ g([
1785
+ a({ type: Boolean, reflect: !0 })
1786
+ ], p.prototype, "showHeader", 2);
1787
+ g([
1788
+ a({ type: Boolean, reflect: !0 })
1789
+ ], p.prototype, "showFooter", 2);
1790
+ g([
1791
+ a({ type: Boolean, reflect: !0 })
1792
+ ], p.prototype, "showHeaderStartIcon", 2);
1793
+ g([
1794
+ a({ type: String, reflect: !0 })
1795
+ ], p.prototype, "headerTitle", 2);
1796
+ g([
1797
+ a({ type: String, reflect: !0 })
1798
+ ], p.prototype, "headerTitleClassName", 2);
1799
+ g([
1800
+ a({ type: String, reflect: !0 })
1801
+ ], p.prototype, "closeButtonLabel", 2);
1802
+ g([
1803
+ a({ type: String, reflect: !0 })
1804
+ ], p.prototype, "firstButtonLabel", 2);
1805
+ g([
1806
+ a({ type: String, reflect: !0 })
1807
+ ], p.prototype, "firstButtonVariant", 2);
1808
+ g([
1809
+ a({ type: Object, reflect: !0 })
1810
+ ], p.prototype, "firstButtonProps", 2);
1811
+ g([
1812
+ a({ type: Boolean, reflect: !0 })
1813
+ ], p.prototype, "onFirstButtonClickClose", 2);
1814
+ g([
1815
+ a({ type: String, reflect: !0 })
1816
+ ], p.prototype, "secondButtonLabel", 2);
1817
+ g([
1818
+ a({ type: String, reflect: !0 })
1819
+ ], p.prototype, "secondButtonVariant", 2);
1820
+ g([
1821
+ a({ type: Object, reflect: !0 })
1822
+ ], p.prototype, "secondButtonProps", 2);
1823
+ g([
1824
+ a({ type: Boolean, reflect: !0 })
1825
+ ], p.prototype, "onSecondButtonClickClose", 2);
1826
+ g([
1827
+ a({ type: Boolean, reflect: !0 })
1828
+ ], p.prototype, "disablePortal", 2);
1829
+ g([
1830
+ a({ type: Number, reflect: !0 })
1831
+ ], p.prototype, "zIndex", 2);
1832
+ g([
1833
+ a({ type: Boolean, reflect: !0 })
1834
+ ], p.prototype, "initialized", 2);
1835
+ g([
1836
+ a({ type: Boolean })
1837
+ ], p.prototype, "showDetail", 2);
1838
+ g([
1839
+ a({ type: Boolean })
1840
+ ], p.prototype, "isHidingDetail", 2);
1841
+ p = g([
1842
+ y("o-side-panel")
1843
+ ], p);
1844
+ var Io = Object.defineProperty, Oo = Object.getOwnPropertyDescriptor, x = (o, t, e, n) => {
1845
+ for (var i = n > 1 ? void 0 : n ? Oo(t, e) : t, r = o.length - 1, s; r >= 0; r--)
1846
+ (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
1847
+ return n && i && Io(t, e, i), i;
1864
1848
  };
1865
- class Bo extends qt {
1849
+ const zo = Ft(u);
1850
+ let b = class extends zo {
1866
1851
  constructor() {
1867
- super(...arguments), this._$AN = void 0;
1868
- }
1869
- _$AT(t, e, n) {
1870
- super._$AT(t, e, n), be(this), this.isConnected = t._$AU;
1871
- }
1872
- _$AO(t, e = !0) {
1873
- var n, i;
1874
- t !== this.isConnected && (this.isConnected = t, t ? (n = this.reconnected) == null || n.call(this) : (i = this.disconnected) == null || i.call(this)), e && (dt(this, t), kt(this));
1875
- }
1876
- setValue(t) {
1877
- if (Po(this._$Ct)) this._$Ct._$AI(t, this);
1878
- else {
1879
- const e = [...this._$Ct._$AH];
1880
- e[this._$Ci] = t, this._$Ct._$AI(e, this, 0);
1881
- }
1882
- }
1883
- disconnected() {
1884
- }
1885
- reconnected() {
1852
+ 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;
1886
1853
  }
1887
- }
1888
- class Do extends Bo {
1889
- constructor() {
1890
- super(...arguments), this.prevData = {};
1854
+ get name() {
1855
+ return this.getAttribute("name") ?? "";
1891
1856
  }
1892
- render(t) {
1893
- return d;
1857
+ set name(o) {
1858
+ this.setAttribute("name", o);
1894
1859
  }
1895
- update(t, [e]) {
1896
- var n;
1897
- this.element !== t.element && (this.element = t.element), this.host = ((n = t.options) === null || n === void 0 ? void 0 : n.host) || this.element, this.apply(e), this.groom(e), this.prevData = { ...e };
1860
+ get form() {
1861
+ return this[Nt].form;
1898
1862
  }
1899
- apply(t) {
1900
- if (!t)
1901
- return;
1902
- const { prevData: e, element: n } = this;
1903
- for (const i in t) {
1904
- const r = t[i];
1905
- r !== e[i] && (n[i] = r);
1863
+ handleClick(o) {
1864
+ if (!(o instanceof KeyboardEvent && !["Enter", " "].includes(o.key)) && this.panelTarget) {
1865
+ const t = document.getElementById(this.panelTarget);
1866
+ t instanceof p && (t != null && t.openPanel) && typeof t.openPanel == "function" ? (o.preventDefault(), t.openPanel()) : console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`);
1906
1867
  }
1907
1868
  }
1908
- groom(t) {
1909
- const { prevData: e, element: n } = this;
1910
- if (e)
1911
- for (const i in e)
1912
- (!t || !(i in t) && n[i] === e[i]) && (n[i] = void 0);
1913
- }
1914
- }
1915
- class Ho extends Do {
1916
- constructor() {
1917
- super(...arguments), this.eventData = {};
1918
- }
1919
- apply(t) {
1920
- if (t)
1921
- for (const e in t) {
1922
- const n = t[e];
1923
- n !== this.eventData[e] && this.applyEvent(e, n);
1924
- }
1925
- }
1926
- applyEvent(t, e) {
1927
- const { prevData: n, element: i } = this;
1928
- this.eventData[t] = e, n[t] && i.removeEventListener(t, this, e), i.addEventListener(t, this, e);
1869
+ render() {
1870
+ return this.href ? this.renderLink() : this.renderButton();
1929
1871
  }
1930
- groom(t) {
1931
- const { prevData: e, element: n } = this;
1932
- if (e)
1933
- for (const i in e)
1934
- (!t || !(i in t) && n[i] === e[i]) && this.groomEvent(i, e[i]);
1872
+ renderIcon(o) {
1873
+ const t = o === "start" ? this.startIconModel : this.endIconModel;
1874
+ if (!t) return d;
1875
+ const e = N[t].replace(
1876
+ "<svg",
1877
+ '<svg aria-hidden="true" focusable="false" part="svg"'
1878
+ );
1879
+ return l`<span class="${o === "start" ? "icon-start" : "icon-end"}">${C(e)}</span>`;
1935
1880
  }
1936
- groomEvent(t, e) {
1937
- const { element: n } = this;
1938
- delete this.eventData[t], n.removeEventListener(t, this, e);
1881
+ renderButton() {
1882
+ const o = this.text || this.textsecond;
1883
+ return l`
1884
+ <button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}>
1885
+ ${this.startIcon ? this.renderIcon("start") : d}
1886
+ ${o ? l`
1887
+ ${this.text ? l`<span class="text">${this.text}</span>` : d}
1888
+ ${this.textsecond ? l`<span class="text">${this.textsecond}</span>` : d}
1889
+ ${this.withbadge ? l`<slot></slot>` : d}
1890
+ ` : l`<slot></slot>`}
1891
+ ${this.endIcon ? this.renderIcon("end") : d}
1892
+ </button>
1893
+ `;
1939
1894
  }
1940
- handleEvent(t) {
1941
- const e = this.eventData[t.type];
1942
- typeof e == "function" ? e.call(this.host, t) : e.handleEvent(t);
1895
+ renderLink() {
1896
+ const o = this.text || this.textsecond;
1897
+ return l`
1898
+ <a
1899
+ href=${this.href}
1900
+ target=${this.target || d}
1901
+ class="button"
1902
+ ?disabled=${this.disabled}
1903
+ role="button"
1904
+ @click=${this.handleClick}
1905
+ @keydown=${this.handleClick}
1906
+ aria-describedby=${this.getAttribute("aria-describedby") || d}
1907
+ >
1908
+ ${this.startIcon ? this.renderIcon("start") : d}
1909
+ ${o ? l`
1910
+ ${this.text ? l`<span>${this.text}</span>` : d}
1911
+ ${this.textsecond ? l`<span>${this.textsecond}</span>` : d}
1912
+ ` : l`<slot></slot>`}
1913
+ ${this.endIcon ? this.renderIcon("end") : d}
1914
+ </a>
1915
+ `;
1943
1916
  }
1944
- disconnected() {
1945
- const { eventData: t, element: e } = this;
1946
- for (const n in t) {
1947
- const i = n.slice(1), r = t[n];
1948
- e.removeEventListener(i, this, r);
1917
+ };
1918
+ Re(b);
1919
+ b.formAssociated = !0;
1920
+ b.styles = f`
1921
+ :host {
1922
+ --button-border: transparent;
1923
+ --badge-outer-width: 19px;
1924
+ cursor: pointer;
1925
+ display: inline-flex;
1926
+ }
1927
+
1928
+ :host(.a--tabfocus) {
1929
+ outline: none !important;
1930
+ }
1931
+
1932
+ :host([fullwidth]) {
1933
+ width: 100%;
1934
+ }
1935
+
1936
+ :host([variant="primary"]) {
1937
+ --button-bg: var(--color-container-action-primary-default);
1938
+ --button-bg-hover: var(--color-container-action-primary-hover);
1939
+ --button-bg-pressed: var(--color-container-action-primary-pressed);
1940
+ --button-text: var(--color-content-action-primary);
1941
+ --button-text-hover: var(--color-content-action-primary);
1942
+ --button-border: transparent;
1943
+ --button-border-width: var(--border-m);
1944
+ --button-padding: var(--spacing-l, 12px) var(--spacing-3-xl, 24px);
1945
+ --button-starticon-svg-width: 0px; /* No starticon SVG for primary button */
1946
+ --button-endicon-svg-width: 0px; /* No endicon SVG for primary button */
1947
+ }
1948
+
1949
+ :host([variant="secondary"]) {
1950
+ --button-bg: var(--color-container-action-secondary-default);
1951
+ --button-bg-hover: var(--color-container-action-secondary-hover);
1952
+ --button-bg-pressed: var(--color-container-action-secondary-pressed);
1953
+ --button-text: var(--color-content-action-secondary);
1954
+ --button-text-hover: var(--color-content-action-secondary);
1955
+ --button-border: var(--color-border-secondary);
1956
+ --button-border-width: var(--border-m);
1957
+ --button-padding: var(--spacing-l, 12px) var(--spacing-3-xl, 24px);
1958
+ --button-starticon-svg-width: 16px;
1959
+ --button-endicon-svg-width: 0px; /* No endicon SVG for secondary button */
1960
+ }
1961
+
1962
+ :host([variant="ghost"]) {
1963
+ --button-bg: transparent;
1964
+ --button-bg-hover: var(--color-alpha-dark-lightest);
1965
+ --button-bg-pressed: var(--color-alpha-dark-lighter);
1966
+ --button-text: var(--color-content-action-secondary);
1967
+ --button-text-hover: var(--color-content-action-secondary);
1968
+ --button-border-width: 0;
1969
+ --button-padding: var(--spacing-m, 10px) var(--spacing-xl, 16px);
1970
+ --button-starticon-svg-width: 16px;
1971
+ --button-endicon-svg-width: 12px;
1949
1972
  }
1950
- }
1951
- reconnected() {
1952
- const { eventData: t, element: e } = this;
1953
- for (const n in t) {
1954
- const i = n.slice(1), r = t[n];
1955
- e.addEventListener(i, this, r);
1973
+
1974
+ :host([variant="tertiary"]) {
1975
+ --button-bg: var(--color-container-action-tertiary-default);
1976
+ --button-bg-hover: var(--color-container-action-tertiary-hover);
1977
+ --button-bg-pressed: var(--color-container-action-tertiary-pressed);
1978
+ --button-text: var(--color-content-body);
1979
+ --button-text-hover: var(--color-content-action-tertiary);
1980
+ --button-border-width: 0;
1981
+ --button-padding: var(--spacing-m, 10px) var(--spacing-l, 12px);
1982
+ --button-starticon-svg-width: 0px; /* No starticon SVG for tertiary button */
1983
+ --button-endicon-svg-width: 8px;
1956
1984
  }
1957
- }
1958
- }
1959
- class Mo extends Ho {
1960
- apply(t) {
1961
- if (!t)
1962
- return;
1963
- const { prevData: e, element: n } = this;
1964
- for (const i in t) {
1965
- const r = t[i];
1966
- if (r === e[i])
1967
- continue;
1968
- const s = i.slice(1);
1969
- switch (i[0]) {
1970
- case "@":
1971
- this.eventData[s] = r, this.applyEvent(s, r);
1972
- break;
1973
- case ".":
1974
- n[s] = r;
1975
- break;
1976
- case "?":
1977
- r ? n.setAttribute(s, "") : n.removeAttribute(s);
1978
- break;
1979
- default:
1980
- r != null ? n.setAttribute(i, String(r)) : n.removeAttribute(i);
1981
- break;
1985
+
1986
+ :host([disabled]),
1987
+ :host([aria-disabled="true"]),
1988
+ :host([aria-disabled="true"]:hover) {
1989
+ --button-bg: var(--color-container-disabled);
1990
+ --button-text: var(--color-content-disabled);
1991
+ --button-border: transparent;
1992
+ }
1993
+
1994
+ :host([disabled][variant="secondary"]) {
1995
+ --button-border: var(--color-border-secondary);
1996
+ }
1997
+
1998
+ .button {
1999
+ display: inline-flex;
2000
+ align-items: center;
2001
+ justify-content: center;
2002
+ width: 100%;
2003
+ gap: var(--spacing-s, 8px);
2004
+ height: 100%;
2005
+ background-color: var(--button-bg);
2006
+ color: var(--button-text);
2007
+ border: var(--button-border-width, var(--border-m)) solid var(--button-border);
2008
+ border-radius: var(--radius-m);
2009
+ font-family: var(--font-family-loccitane-sans);
2010
+ font-size: var(--font-size-150);
2011
+ font-weight: var(--font-weight-400);
2012
+ line-height: var(--line-height-200);
2013
+ min-width: 64px;
2014
+ padding: var(--button-padding);
2015
+ text-decoration: none;
2016
+ cursor: inherit;
2017
+ box-sizing: border-box;
2018
+
2019
+ span {
2020
+ font-family: var(--font-family-loccitane-sans);
2021
+ font-size: var(--font-size-150);
2022
+ font-weight: var(--font-weight-400);
2023
+ line-height: var(--line-height-200);
1982
2024
  }
1983
2025
  }
1984
- }
1985
- groom(t) {
1986
- const { prevData: e, element: n } = this;
1987
- if (e)
1988
- for (const i in e) {
1989
- const r = i.slice(1);
1990
- if (!t || !(i in t) && n[r] === e[i])
1991
- switch (i[0]) {
1992
- case "@":
1993
- this.groomEvent(r, e[i]);
1994
- break;
1995
- case ".":
1996
- n[r] = void 0;
1997
- break;
1998
- case "?":
1999
- n.removeAttribute(r);
2000
- break;
2001
- default:
2002
- n.removeAttribute(i);
2003
- break;
2004
- }
2026
+
2027
+ .button:hover:not([disabled]) {
2028
+ background-color: var(--button-bg-hover);
2029
+ color: var(--button-text-hover);
2030
+ }
2031
+
2032
+ .button:active:not([disabled]) {
2033
+ background-color: var(--button-bg-pressed);
2034
+ }
2035
+
2036
+ .button:focus-visible {
2037
+ ${at};
2038
+ }
2039
+
2040
+ span.text + span.text::before {
2041
+ content: "•";
2042
+ margin-right: 8px;
2043
+ }
2044
+
2045
+ .icon-start,
2046
+ .icon-end {
2047
+ display: inline-flex;
2048
+ align-items: center;
2049
+
2050
+ svg {
2051
+ max-height: 20px;
2005
2052
  }
2006
- }
2007
- }
2008
- const le = Vt(Mo);
2009
- var To = Object.defineProperty, jo = Object.getOwnPropertyDescriptor, g = (o, t, e, n) => {
2010
- for (var i = n > 1 ? void 0 : n ? jo(t, e) : t, r = o.length - 1, s; r >= 0; r--)
2011
- (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
2012
- return n && i && To(t, e, i), i;
2013
- };
2014
- let p = class extends u {
2015
- constructor() {
2016
- super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.closeButtonLabel = "Close the modal", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this._onOpenDetail = async (o) => {
2017
- var e, n;
2018
- const t = ((e = o.detail) == null ? void 0 : e.origin) ?? document.activeElement;
2019
- if (this._detailOriginEl = t, this._detailOriginClass = (t == null ? void 0 : t.className) ?? "", this.showDetail = !0, this.showHeaderStartIcon = !0, await this.updateComplete, this._detailOriginClass) {
2020
- const i = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view");
2021
- i && i.setAttribute("fromelement", this._detailOriginClass);
2053
+ svg[x] {
2054
+ width: 15px;
2022
2055
  }
2023
- this._setPriceTabindex(), await this.focusDetailReturnBtn();
2024
- }, this._detailOriginEl = null, this._detailOriginClass = "", this.handleKeyDown = (o) => {
2025
- this.open && (o.key === "Escape" ? this.closePanel() : o.key === "Tab" && this.trapFocus(o));
2026
- }, this.handleClosePanel = (o) => {
2027
- if (o instanceof KeyboardEvent && o.key !== "Enter" && o.key !== " ")
2028
- return;
2029
- o.preventDefault(), o.stopPropagation();
2030
- const t = o.currentTarget, e = (t == null ? void 0 : t.getAttribute("data-role")) === "back";
2031
- if (this.showDetail && e) {
2032
- this.isHidingDetail = !0;
2033
- const n = this.renderRoot.querySelector(".content"), i = async () => {
2034
- this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1, await this.updateComplete, this._restoreFocusToOrigin();
2035
- };
2036
- if (n) {
2037
- this.showHeaderStartIcon = !1;
2038
- const r = () => {
2039
- this.showDetail = !1, this.isHidingDetail = !1, n.removeEventListener("animationend", r), i();
2040
- };
2041
- n.addEventListener("animationend", r);
2042
- } else
2043
- this.showDetail = !1, this.isHidingDetail = !1, this.showHeaderStartIcon = !1;
2044
- return;
2056
+ path[fill],
2057
+ path[class] {
2058
+ fill: var(--button-text) !important;
2045
2059
  }
2046
- this.closePanel();
2047
- }, this._onDetailSlotChange = (o) => {
2048
- const n = o.target.assignedElements({ flatten: !0 }).flatMap((i) => Array.from(i.querySelectorAll("img")))[0];
2049
- n == null || n.setAttribute("tabindex", "0");
2050
- };
2051
- }
2052
- connectedCallback() {
2053
- super.connectedCallback(), !this.disablePortal && this.parentElement !== document.body && document.body.appendChild(this), this.addEventListener("keydown", this.handleKeyDown), this.updateComplete.then(() => {
2054
- this.initialized = !0;
2055
- }), this.addEventListener("open-detail", this._onOpenDetail);
2056
- }
2057
- disconnectedCallback() {
2058
- document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), this.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback(), this.removeEventListener("open-detail", this._onOpenDetail);
2059
- }
2060
- async focusDetailReturnBtn() {
2061
- var n, i, r, s;
2062
- await this.updateComplete;
2063
- const o = this.getDeepActiveElement(document);
2064
- if (o && o !== document.body)
2065
- try {
2066
- o.blur();
2067
- } catch {
2060
+ path[stroke] {
2061
+ stroke: var(--button-text) !important;
2068
2062
  }
2069
- await new Promise(requestAnimationFrame);
2070
- const t = (n = this.shadowRoot) == null ? void 0 : n.querySelector(".detail-view .return-btn");
2071
- if (!t) return;
2072
- t.updateComplete && await t.updateComplete, (s = (r = ((i = t.shadowRoot) == null ? void 0 : i.querySelector("button")) ?? t) == null ? void 0 : r.focus) == null || s.call(r, { preventScroll: !0 });
2073
- }
2074
- _setPriceTabindex() {
2075
- var n;
2076
- const o = (n = this.shadowRoot) == null ? void 0 : n.querySelector('slot[name="detail"]');
2077
- if (!o) return;
2078
- const e = o.assignedElements({ flatten: !0 }).flatMap(
2079
- (i) => Array.from(i.querySelectorAll(".m-product-price-standard"))
2080
- );
2081
- for (const i of e)
2082
- i.hasAttribute("tabindex") || i.setAttribute("tabindex", "0");
2083
- }
2084
- _restoreFocusToOrigin() {
2085
- var t, e;
2086
- const o = this._detailOriginEl;
2087
- !o || !document.contains(o) || ((e = (t = document.activeElement) == null ? void 0 : t.blur) == null || e.call(t), requestAnimationFrame(() => {
2088
- var i;
2089
- o.classList.add("a--tabfocus"), (((i = o.shadowRoot) == null ? void 0 : i.querySelector('button, .button, [tabindex]:not([tabindex="-1"])')) ?? null ?? o).focus({ preventScroll: !0 });
2090
- }));
2091
- }
2092
- getDeepActiveElement(o = this.shadowRoot) {
2093
- let t = o.activeElement;
2094
- for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
2095
- t = t.shadowRoot.activeElement;
2096
- return t;
2097
- }
2098
- trapFocus(o) {
2099
- if (o.key !== "Tab") return;
2100
- const t = this.getDeepActiveElement(), e = this.renderRoot.querySelector(".close-btn");
2101
- if (!o.shiftKey && e && e.contains(t)) {
2102
- o.preventDefault();
2103
- const n = this.renderRoot.querySelector(
2104
- ".o-whats-inside--content p"
2105
- );
2106
- n == null || n.focus();
2107
2063
  }
2108
- }
2109
- getFocusableElements() {
2110
- const o = this.renderRoot.querySelector(".panel");
2111
- if (!o) return [];
2112
- function t(i) {
2113
- return !(i.disabled || i.hasAttribute("disabled") || i.hasAttribute("tabindex") && i.getAttribute("tabindex") === "-1");
2064
+
2065
+ :host([variant="tertiary"][fullwidth][endIcon]) .button {
2066
+ justify-content: space-between;
2067
+ }
2068
+
2069
+ .button span {
2070
+ display: inline-flex;
2071
+ align-items: center;
2072
+ }
2073
+
2074
+ .button slot {
2075
+ display: inline-flex;
2076
+ align-items: center;
2114
2077
  }
2115
- function e(i) {
2116
- var s;
2117
- const r = [i.matches(p.focusablesSelector) ? i : []];
2118
- if (!["o-icon-button", "o-button"].includes(i.tagName.toLowerCase())) {
2119
- const h = Array.from(
2120
- i instanceof HTMLSlotElement ? i.assignedElements({ flatten: !0 }) : []
2121
- ).filter(t).flatMap(e), c = Array.from(
2122
- ((s = i.shadowRoot) == null ? void 0 : s.querySelectorAll("*")) || []
2123
- ).filter(t).flatMap(e);
2124
- r.push(...h, ...c);
2078
+
2079
+ :host([variant="tertiary"][endIcon]) .button .icon-end {
2080
+ width: var(--button-endicon-svg-width, 8px);
2081
+ }
2082
+
2083
+ :host([underlined]) span:not([class*="icon-"]),
2084
+ :host([underlined]) .text,
2085
+ :host([underlined]:not([text])) .button slot {
2086
+ position: relative;
2087
+
2088
+ &::after {
2089
+ content: "";
2090
+ display: block;
2091
+ position: absolute;
2092
+ bottom: 0;
2093
+ left: 0;
2094
+ width: 100%;
2095
+ border-bottom: var(--border-M, 1px) solid var(--button-text);
2125
2096
  }
2126
- return r.flat();
2127
2097
  }
2128
- return Array.from(o.querySelectorAll("*")).filter(t).flatMap(e);
2129
- }
2130
- openPanel() {
2131
- this.removeAttribute("hidden"), this.getBoundingClientRect(), this.previousFocusedElement = document.activeElement, this.open = !0, document.body.style.overflow = "hidden", document.body.setAttribute("data-side-panel", "open");
2132
- const o = this.renderRoot.querySelector(".panel");
2133
- o && o.setAttribute("aria-modal", "true"), this.updateComplete.then(() => {
2134
- var t, e, n, i;
2135
- if (this.showHeader) {
2136
- const r = ((t = this.shadowRoot) == null ? void 0 : t.querySelector(".panel .close-btn")) || null, s = ((e = r == null ? void 0 : r.shadowRoot) == null ? void 0 : e.querySelector("button")) || null;
2137
- s && ((n = s.focus) == null || n.call(s));
2138
- } else {
2139
- const r = this.getFocusableElements()[0];
2140
- (i = r == null ? void 0 : r.focus) == null || i.call(r);
2098
+
2099
+ :host([underlined]:not([text])) .button slot {
2100
+ display: inline-flex;
2101
+ gap: 8px;
2102
+ }
2103
+
2104
+ :host([underlined][withbadge]:not([text])) .button slot {
2105
+ &::after {
2106
+ width: calc(100% - var(--badge-outer-width, 19px) - var(--spacing-s, 8px))
2141
2107
  }
2142
- }), this.dispatchEvent(
2143
- new CustomEvent("open", { bubbles: !0, composed: !0 })
2144
- );
2145
- }
2146
- closePanel() {
2147
- var t, e, n, i, r;
2148
- this.open = !1, this.showDetail = !1, document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), ((t = this.previousFocusedElement) == null ? void 0 : t.tagName.toLowerCase()) === "o-button" ? (i = (n = (e = this.previousFocusedElement.shadowRoot) == null ? void 0 : e.querySelector(".button")) == null ? void 0 : n.focus) == null || i.call(n) : (r = this.previousFocusedElement) == null || r.focus();
2149
- const o = this.renderRoot.querySelector(".panel");
2150
- o && o.removeAttribute("aria-modal"), this.dispatchEvent(
2151
- new CustomEvent("close", { bubbles: !0, composed: !0 })
2152
- );
2153
- }
2154
- handleFirstClick(o) {
2155
- o instanceof KeyboardEvent && o.key !== "Enter" && o.key !== " " || (o.preventDefault(), o.stopPropagation(), this.onFirstButtonClickClose && this.closePanel(), this.dispatchEvent(
2156
- new CustomEvent("firstbuttonclick", {
2157
- bubbles: !0,
2158
- composed: !0,
2159
- cancelable: !0,
2160
- detail: {
2161
- button: "first",
2162
- target: o.target
2163
- }
2164
- })
2165
- ));
2166
- }
2167
- handleSecondClick(o) {
2168
- o instanceof KeyboardEvent && o.key !== "Enter" && o.key !== " " || (o.preventDefault(), o.stopPropagation(), this.onSecondButtonClickClose && this.closePanel(), this.dispatchEvent(
2169
- new CustomEvent("secondbuttonclick", {
2108
+ }
2109
+
2110
+ //Icon movement on hover
2111
+ :host([variant="tertiary"][endIcon]) .icon-end {
2112
+ display: inline-flex;
2113
+ align-items: center;
2114
+ }
2115
+
2116
+ :host([variant="tertiary"][endIcon]:hover) .icon-end {
2117
+ transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
2118
+ transform: translateX(4px);
2119
+ }
2120
+ //End icon movment on hover
2121
+ `;
2122
+ x([
2123
+ a()
2124
+ ], b.prototype, "type", 2);
2125
+ x([
2126
+ a()
2127
+ ], b.prototype, "value", 2);
2128
+ x([
2129
+ a({ type: String, reflect: !0 })
2130
+ ], b.prototype, "variant", 2);
2131
+ x([
2132
+ a({ type: String })
2133
+ ], b.prototype, "text", 2);
2134
+ x([
2135
+ a({ type: String })
2136
+ ], b.prototype, "textsecond", 2);
2137
+ x([
2138
+ a({ type: Boolean, reflect: !0 })
2139
+ ], b.prototype, "fullwidth", 2);
2140
+ x([
2141
+ a({ type: Boolean, reflect: !0 })
2142
+ ], b.prototype, "disabled", 2);
2143
+ x([
2144
+ a({ type: String })
2145
+ ], b.prototype, "startIconModel", 2);
2146
+ x([
2147
+ a({ type: String })
2148
+ ], b.prototype, "endIconModel", 2);
2149
+ x([
2150
+ a({ type: Boolean, reflect: !0, attribute: "starticon" })
2151
+ ], b.prototype, "startIcon", 2);
2152
+ x([
2153
+ a({ type: Boolean, reflect: !0, attribute: "endicon" })
2154
+ ], b.prototype, "endIcon", 2);
2155
+ x([
2156
+ a({ type: String, attribute: "paneltarget" })
2157
+ ], b.prototype, "panelTarget", 2);
2158
+ x([
2159
+ a({ type: String })
2160
+ ], b.prototype, "href", 2);
2161
+ x([
2162
+ a({ type: String })
2163
+ ], b.prototype, "target", 2);
2164
+ x([
2165
+ a({ type: Boolean, reflect: !0 })
2166
+ ], b.prototype, "underlined", 2);
2167
+ x([
2168
+ a({ type: Boolean, reflect: !0 })
2169
+ ], b.prototype, "withbadge", 2);
2170
+ b = x([
2171
+ y("o-button")
2172
+ ], b);
2173
+ var Bo = Object.defineProperty, Do = Object.getOwnPropertyDescriptor, At = (o, t, e, n) => {
2174
+ for (var i = n > 1 ? void 0 : n ? Do(t, e) : t, r = o.length - 1, s; r >= 0; r--)
2175
+ (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
2176
+ return n && i && Bo(t, e, i), i;
2177
+ };
2178
+ let rt = class extends u {
2179
+ constructor() {
2180
+ super(...arguments), this.status = "empty", this.ariaDescribedBy = "a-product-name", this.label = "Add to wishlist", this.toggleStatus = () => {
2181
+ this.status = this.status === "empty" ? "filled" : "empty", this.setAttribute("aria-pressed", String(this.status === "filled")), this.dispatchEvent(new CustomEvent("wishlist-toggle", {
2182
+ detail: { status: this.status },
2170
2183
  bubbles: !0,
2171
- composed: !0,
2172
- cancelable: !0,
2173
- detail: {
2174
- button: "second",
2175
- target: o.target
2176
- }
2177
- })
2178
- ));
2184
+ composed: !0
2185
+ }));
2186
+ };
2179
2187
  }
2180
- updated() {
2181
- this.style.setProperty("--z-overlay", `${this.zIndex || 99}`), this.style.setProperty("--z-panel", `${this.zIndex ? this.zIndex + 1 : 99}`), this.open || setTimeout(() => {
2182
- this.setAttribute("hidden", "hidden");
2183
- }, 500);
2188
+ connectedCallback() {
2189
+ super.connectedCallback(), this.setAttribute("role", "button"), this.setAttribute("aria-pressed", String(this.status === "filled"));
2184
2190
  }
2185
- render() {
2186
- const o = this.showHeader ? l`
2187
- <div tabindex="-1" class="header">
2188
- ${this.showHeaderStartIcon ? l`
2189
- <o-icon-button
2190
- icon="arrowLeft"
2191
- size="small"
2192
- class="return-btn"
2193
- bgstyle="background-light"
2194
- data-role="back"
2195
- @click=${this.handleClosePanel}
2196
- @keydown=${this.handleClosePanel}
2197
- aria-label="${this.closeButtonLabel}"
2198
- srlabel="${this.closeButtonLabel}"
2199
- showsrlabel="true"
2200
- ></o-icon-button>
2201
- ` : null}
2202
- <p role="heading" aria-level="1" id="panel-title" class="${this.headerTitleClassName}">
2203
- ${this.headerTitle}
2204
- </p>
2205
- <o-icon-button
2206
- icon="cross"
2207
- size="small"
2208
- class="close-btn"
2209
- bgstyle="background-light"
2210
- @click=${this.handleClosePanel}
2211
- @keydown=${this.handleClosePanel}
2212
- aria-label="${this.closeButtonLabel}"
2213
- aria-describedby="panel-title"
2214
- srlabel="${this.closeButtonLabel}"
2215
- showsrlabel="true"
2216
- ></o-icon-button>
2217
- </div>
2218
- ` : null;
2219
- return l`
2220
- <div class="overlay" style="z-index: ${this.zIndex}" @click=${this.handleClosePanel}></div>
2221
- <div
2222
- class="panel"
2223
- role="dialog"
2224
- aria-modal="true"
2225
- aria-labelledby="panel-title"
2226
- style="z-index: ${this.zIndex + 1}"
2227
- tabindex="-1"
2228
- >
2229
- <div role="document">
2230
- ${o}
2231
-
2232
- <div class="content ${this.isHidingDetail ? "slide-out-right" : ""} ${this.showDetail ? "with-detail" : ""}">
2233
-
2234
- ${this.showDetail ? l`
2235
- <div class="detail-view">
2236
- ${o}
2237
- <div class="detail-content">
2238
- <slot name="detail" @slotchange=${this._onDetailSlotChange}></slot>
2239
- </div>
2240
- </div>
2241
- ` : l`<slot></slot>`}
2242
- </div>
2243
-
2244
- ${this.showFooter ? l`
2245
- <div class="footer">
2246
- ${this.firstButtonVariant && this.firstButtonLabel ? l`
2247
- <o-button
2248
- variant="${this.firstButtonVariant}"
2249
- @click=${this.handleFirstClick}
2250
- @keydown=${this.handleFirstClick}
2251
- ${le(this.firstButtonProps)}
2252
- >
2253
- ${this.firstButtonLabel}
2254
- </o-button>
2255
- ` : null}
2256
-
2257
- ${this.secondButtonVariant && this.secondButtonLabel ? l`
2258
- <o-button
2259
- variant="${this.secondButtonVariant}"
2260
- @click=${this.handleSecondClick}
2261
- @keydown=${this.handleSecondClick}
2262
- ${le(this.secondButtonProps)}
2263
- >
2264
- ${this.secondButtonLabel}
2265
- </o-button>
2266
- ` : null}
2267
- </div>
2268
- ` : null}
2269
- </div>
2270
- </div>
2191
+ firstUpdated() {
2192
+ this.addEventListener("click", this.toggleStatus), this.addEventListener("keydown", this.handleKeydown);
2193
+ }
2194
+ handleKeydown(o) {
2195
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), this.toggleStatus());
2196
+ }
2197
+ render() {
2198
+ const o = N.wishlist.replace(
2199
+ "<svg",
2200
+ '<svg aria-hidden="true" focusable="false" part="svg"'
2201
+ );
2202
+ return l`
2203
+ <button type="button" aria-describedby="${this.ariaDescribedBy}" class="wishlist-button">
2204
+ <span class="sr-only">${this.label}</span>
2205
+ ${C(o)}
2206
+ </button>
2271
2207
  `;
2272
2208
  }
2209
+ setStatus(o) {
2210
+ this.status = o, this.setAttribute("aria-pressed", String(this.status === "filled")), this.requestUpdate();
2211
+ }
2212
+ setAriaDescribedBy(o) {
2213
+ this.ariaDescribedBy = o, this.requestUpdate();
2214
+ }
2215
+ setLabel(o) {
2216
+ this.label = o, this.requestUpdate();
2217
+ }
2273
2218
  };
2274
- p.styles = f`
2219
+ rt.styles = f`
2275
2220
  :host {
2276
- --z-overlay: 99;
2277
- --z-panel: 100;
2278
- position: fixed;
2279
- top: 0;
2280
- right: 0;
2281
- height: 100%;
2282
- width: 100%;
2283
- pointer-events: none;
2284
- z-index: var(--z-overlay);
2285
- --side-panel-width: 100%;
2286
- --side-panel-max-width: 416px;
2287
- --font-size: var(--font-size-300);
2288
- --line-height: var(--line-height-240);
2221
+ display: inline-flex;
2222
+ justify-content: center;
2223
+ align-items: center;
2224
+ outline: none !important;
2289
2225
  }
2290
2226
 
2291
- /* Hide content until it is initialized */
2292
- :host(:not([initialized])) .content {
2293
- display: none;
2227
+ .wishlist-button {
2228
+ display: flex;
2229
+ justify-content: center;
2230
+ align-items: center;
2231
+ width: 40px;
2232
+ height: 40px;
2233
+ border: transparent;
2234
+ border-radius: var(--radius-full);
2235
+ background-color: var(--color-alpha-light-strong);
2236
+ position: relative;
2237
+ cursor: pointer;
2294
2238
  }
2295
2239
 
2296
- /* hide the host completely until its initialized */
2297
- :host(:not([initialized])) {
2298
- display: none !important;
2240
+ .wishlist-button:hover {
2241
+ background-color: var(--color-alpha-light-stronger);
2299
2242
  }
2300
2243
 
2301
- .overlay {
2302
- position: absolute;
2303
- inset: 0;
2304
- backdrop-filter: blur(4px);
2305
- background-color: rgba(0, 0, 0, 0.3);
2306
- opacity: 0;
2307
- transition: opacity 0.3s ease;
2308
- pointer-events: none;
2309
- z-index: var(--z-overlay);
2244
+ .wishlist-button:active {
2245
+ background-color: var(--color-alpha-light-strongest);
2310
2246
  }
2311
2247
 
2312
- :host([open]) .overlay {
2313
- opacity: 1;
2314
- pointer-events: auto;
2248
+ .wishlist-button:focus-visible {
2249
+ ${at};
2315
2250
  }
2316
2251
 
2317
- .panel {
2318
- position: absolute;
2319
- top: 0;
2320
- right: 0;
2321
- width: var(--side-panel-width);
2322
- max-width: var(--side-panel-max-width);
2323
- height: 100%;
2324
- background: white;
2325
- box-shadow: var(--colors-alpha-dark-60);
2326
- transform: translateX(100%);
2327
- transition: transform 0.3s ease;
2328
- display: flex;
2329
- flex-direction: column;
2330
- pointer-events: auto;
2331
- z-index: var(--z-panel);
2252
+ .wishlist-button:hover svg path {
2253
+ fill: var(--color-content-action-secondary);
2332
2254
  }
2333
2255
 
2334
- :host([open]) .panel {
2335
- transform: translateX(0%);
2256
+ :host([status="filled"]) .wishlist-button svg path {
2257
+ fill: var(--color-content-action-secondary);
2336
2258
  }
2337
2259
 
2338
- .header {
2339
- flex: 0 0 auto;
2340
- display: flex;
2341
- justify-content: space-between;
2342
- padding: 20px 16px;
2343
- border-bottom: var(--border-050) solid var(--color-border-tertiary);
2260
+ :host([status="empty"]) .wishlist-button svg path {
2261
+ fill: var(--color-alpha-light-strong);
2262
+ }
2344
2263
 
2345
- .panel-title {
2346
- font-family: var(--font-family-loccitane-serif);
2347
- font-size: var(--font-size);
2348
- font-weight: var(--font-weight-400);
2349
- line-height: var(--line-height);
2350
- font-style: italic;
2351
- display: -webkit-box;
2352
- -webkit-line-clamp: 2;
2353
- -webkit-box-orient: vertical;
2354
- height: auto;
2355
- margin-top: auto;
2356
- margin-bottom: auto;
2357
- overflow: hidden;
2358
- width: 100%;
2359
- color: var(--color-content-heading);
2264
+ @media (hover: hover) and (pointer: fine) {
2265
+ :host([status="empty"]) .wishlist-button:hover svg path {
2266
+ fill: var(--color-content-action-secondary);
2360
2267
  }
2268
+ }
2361
2269
 
2362
- .close-btn {
2363
- margin-left: 8px;
2364
- margin-top: 0;
2365
- flex-direction: column;
2366
- justify-content: start;
2367
- }
2270
+ .sr-only {
2271
+ border: 0 !important;
2272
+ clip: rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;
2273
+ -webkit-clip-path: inset(50%) !important;
2274
+ clip-path: inset(50%) !important;
2275
+ height: 0.1rem !important;
2276
+ margin: -0.1rem !important;
2277
+ overflow: hidden !important;
2278
+ padding: 0 !important;
2279
+ position: absolute !important;
2280
+ width: 0.1rem !important;
2281
+ white-space: nowrap !important;
2282
+ }
2283
+ `;
2284
+ At([
2285
+ a({ type: String, reflect: !0 })
2286
+ ], rt.prototype, "status", 2);
2287
+ At([
2288
+ a({ type: String, reflect: !0 })
2289
+ ], rt.prototype, "ariaDescribedBy", 2);
2290
+ At([
2291
+ a({ type: String, reflect: !0 })
2292
+ ], rt.prototype, "label", 2);
2293
+ rt = At([
2294
+ y("o-wishlist-button")
2295
+ ], rt);
2296
+ var Ho = Object.defineProperty, Mo = Object.getOwnPropertyDescriptor, ot = (o, t, e, n) => {
2297
+ for (var i = n > 1 ? void 0 : n ? Mo(t, e) : t, r = o.length - 1, s; r >= 0; r--)
2298
+ (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
2299
+ return n && i && Ho(t, e, i), i;
2300
+ };
2301
+ let F = class extends u {
2302
+ constructor() {
2303
+ super(...arguments), this.href = "", this.target = "", this.template = "standard", this.inverse = !1, this.endIcon = !1, this.reverseEndIcon = !1;
2304
+ }
2305
+ _handleClick(o) {
2306
+ (!this.href || this.href === "#") && o.preventDefault();
2307
+ }
2308
+ render() {
2309
+ const o = this.href || "#";
2310
+ return l`
2311
+ <a
2312
+ href="${o}"
2313
+ target="${k(this.target || void 0)}"
2314
+ @click="${this._handleClick}"
2315
+ >
2316
+ ${this.endIcon && this.reverseEndIcon ? l`
2317
+ <o-icon-button
2318
+ icon="chevronLeft"
2319
+ bgstyle="${this.inverse ? "none-light" : "none-contrast"}"
2320
+ size="xsmall"
2321
+ aria-hidden="true"
2322
+ type="span"
2323
+ ></o-icon-button>
2324
+ ` : null}
2325
+ <span class="link-text"><slot></slot></span>
2326
+ ${this.endIcon && !this.reverseEndIcon ? l`
2327
+ <o-icon-button
2328
+ icon="chevronRight"
2329
+ bgstyle="${this.inverse ? "none-light" : "none-contrast"}"
2330
+ size="xsmall"
2331
+ aria-hidden="true"
2332
+ type="span"
2333
+ ></o-icon-button>
2334
+ ` : null}
2335
+ </a>
2336
+ `;
2337
+ }
2338
+ };
2339
+ F.styles = f`
2340
+ :host([template="standard"]) a {
2341
+ color: var(--color-content-action-secondary);
2342
+ font-size: var(--font-size-200);
2343
+ font-weight: var(--font-weight-400);
2344
+ line-height: var(--line-height-240);
2345
+ letter-spacing: var(--letter-spacing-400);
2346
+ font-family: var(--font-family-loccitane-serif);
2347
+ }
2348
+
2349
+ :host([template="discret"]) a {
2350
+ color: var(--color-content-action-secondary);
2351
+ font-size: var(--font-size-100);
2352
+ font-weight: var(--font-weight-400);
2353
+ line-height: var(--line-height-160);
2354
+ letter-spacing: var(--letter-spacing-400);
2355
+ font-family: var(--font-family-loccitane-sans);
2356
+ }
2357
+
2358
+ :host([template="review"]) a {
2359
+ color: var(--color-content-action-secondary);
2360
+ font-size: var(--font-size-100);
2361
+ font-weight: var(--font-weight-500);
2362
+ line-height: var(--line-height-160);
2363
+ letter-spacing: var(--letter-spacing-400);
2364
+ font-family: var(--font-family-loccitane-sans);
2365
+ text-transform: uppercase;
2366
+ }
2367
+
2368
+ :host([inverse]) a {
2369
+ color: var(--color-container-action-tertiary-default);
2370
+ }
2371
+
2372
+ :host([endIcon]) a o-icon-button {
2373
+ margin-left: 2px;
2374
+ transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
2375
+ }
2376
+
2377
+ :host([endIcon][reverseEndIcon]) a o-icon-button {
2378
+ margin-right: 2px;
2379
+ transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
2380
+ }
2381
+
2382
+ :host([endIcon]) a {
2383
+ &:hover {
2384
+ o-icon-button {
2385
+ transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
2386
+ :host(:not([reverseEndIcon])) & {
2387
+ transform: translateX(4px);
2388
+ }
2389
+
2390
+ :host([reverseEndIcon]) & {
2391
+ transform: translateX(-4px);
2392
+ }
2393
+ }
2394
+ }
2395
+ }
2368
2396
 
2369
- .return-btn {
2370
- margin-right: 8px;
2371
- }
2372
- }
2397
+ :host a {
2398
+ position: relative;
2399
+ text-decoration: none;
2400
+ color: inherit;
2401
+ }
2373
2402
 
2374
- .panel:focus-visible,
2375
- .close-btn:focus-visible {
2376
- ${at}
2377
- }
2403
+ .link-text {
2404
+ position: relative;
2405
+ display: inline-block;
2406
+ }
2378
2407
 
2379
- .content {
2380
- flex: 1 1 auto;
2381
- overflow-y: auto;
2382
- overflow-x: hidden;
2383
- padding: var(--spacing-xl);
2408
+ .link-text::after {
2409
+ content: "";
2410
+ position: absolute;
2411
+ left: 0;
2412
+ bottom: 0;
2413
+ width: 100%;
2414
+ opacity: 1;
2415
+ height: 1px;
2416
+ background-color: currentColor;
2417
+ transition: opacity 0.3s ease, height 0.3s ease;
2418
+ pointer-events: none;
2419
+ }
2384
2420
 
2385
- &.with-detail {
2386
- width: 100%;
2387
- height: 100%;
2388
- position: absolute;
2389
- top: 0;
2390
- left: 0;
2391
- background: var(--color-container-bg-white);
2392
- z-index: 3;
2393
- padding: var(--spacing-4-xs);
2394
- }
2421
+ :host a:hover .link-text::after {
2422
+ opacity: 0;
2423
+ height: 1px;
2424
+ }
2425
+ /* End of underline effect */
2426
+ `;
2427
+ ot([
2428
+ a({ type: String })
2429
+ ], F.prototype, "href", 2);
2430
+ ot([
2431
+ a({ type: String })
2432
+ ], F.prototype, "target", 2);
2433
+ ot([
2434
+ a({ type: String, reflect: !0 })
2435
+ ], F.prototype, "template", 2);
2436
+ ot([
2437
+ a({ type: Boolean, reflect: !0 })
2438
+ ], F.prototype, "inverse", 2);
2439
+ ot([
2440
+ a({ type: Boolean, reflect: !0 })
2441
+ ], F.prototype, "endIcon", 2);
2442
+ ot([
2443
+ a({ type: Boolean, reflect: !0 })
2444
+ ], F.prototype, "reverseEndIcon", 2);
2445
+ F = ot([
2446
+ y("o-link")
2447
+ ], F);
2448
+ var To = Object.defineProperty, jo = Object.getOwnPropertyDescriptor, Et = (o, t, e, n) => {
2449
+ for (var i = n > 1 ? void 0 : n ? jo(t, e) : t, r = o.length - 1, s; r >= 0; r--)
2450
+ (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);
2451
+ return n && i && To(t, e, i), i;
2452
+ };
2453
+ let st = class extends u {
2454
+ constructor() {
2455
+ super(...arguments), this.rating = 0;
2456
+ }
2457
+ getStarKeys() {
2458
+ const o = [];
2459
+ for (let t = 0; t < 5; t++) {
2460
+ const e = this.rating - t;
2461
+ let n;
2462
+ e >= 1 ? n = 100 : e <= 0 ? n = 0 : n = Math.round(e * 100 / 25) * 25, o.push(`star-${n}`);
2463
+ }
2464
+ return o;
2465
+ }
2466
+ render() {
2467
+ const o = this.getStarKeys();
2468
+ return l`
2469
+ <div class="rating">
2470
+ <div class="stars">
2471
+ ${o.map(
2472
+ (t) => l`<span class="star">${C(N[t] ?? "")}</span>`
2473
+ )}
2474
+ </div>
2475
+ ${this.reviewCount != null && this.href != null ? l`<o-link template="review" href="${this.href}">${this.reviewCount}</o-link>` : null}
2476
+ </div>
2477
+ `;
2478
+ }
2479
+ };
2480
+ st.styles = f`
2481
+ svg {
2482
+ width: 12px;
2483
+ height: 12px;
2395
2484
  }
2396
-
2397
- .footer {
2398
- flex: 0 0 auto;
2399
- padding: var(--spacing-xl);
2400
- border-top: var(--border-050) solid var(--color-border-tertiary);
2485
+ .rating {
2401
2486
  display: flex;
2402
- flex-direction: column;
2403
- gap: var(--spacing-l);
2404
- justify-content: flex-start;
2487
+ align-items: center;
2405
2488
  }
2406
2489
 
2407
- /* Mobile */
2408
- @media (max-width: 767px) {
2409
- :host {
2410
- --side-panel-width: 100%;
2411
- --side-panel-max-width: none;
2412
- }
2490
+ .stars {
2491
+ display: flex;
2492
+ gap: 2px;
2413
2493
  }
2414
2494
 
2415
- /* Tablet */
2416
- @media (min-width: 768px) and (max-width: 1024px) {
2417
- :host {
2418
- --side-panel-width: 375px;
2419
- --side-panel-max-width: 375px;
2420
- }
2495
+ .star {
2496
+ display: block;
2421
2497
  }
2422
2498
 
2423
- @media (min-width: 1025px) {
2424
- :host {
2425
- --side-panel-width: 100%;
2426
- --side-panel-max-width: 416px;
2427
- --font-size: var(--font-size-400);
2428
- --line-height: var(--line-height-280);
2429
- }
2430
- }
2431
-
2432
- @keyframes slideInRight {
2433
- from {
2434
- transform: translateX(100%);
2435
- }
2436
- to {
2437
- transform: translateX(0%);
2438
- }
2439
- }
2440
-
2441
- @keyframes slideOutRight {
2442
- from {
2443
- transform: translateX(0%);
2444
- }
2445
- to {
2446
- transform: translateX(100%);
2447
- }
2499
+ o-link {
2500
+ margin-left: 6px;
2501
+ font-family: var(--font-family-loccitane-sans);
2502
+ font-weight: var(--font-weight-500);
2503
+ font-size: var(--font-size-100);
2504
+ line-height: var(--line-height-160);
2505
+ letter-spacing: var(--letter-spacing-400);
2506
+ color: var(--color-content-action-secondary);
2448
2507
  }
2449
2508
 
2450
- .slide-out-right {
2451
- animation: slideOutRight 0.3s ease-in forwards;
2452
- }
2453
-
2454
- .detail-view {
2455
- animation: slideInRight 0.3s ease-out both;
2456
- }
2457
- .detail-content {
2458
- padding: var(--spacing-xl);
2509
+ .review-link {
2510
+ text-decoration: underline;
2511
+ cursor: pointer;
2459
2512
  }
2460
2513
  `;
2461
- p.focusablesSelector = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), o-icon-button, o-button';
2462
- p.focusablesCustomElementsSelector = "o-icon-button, o-button";
2463
- g([
2464
- a({ type: Boolean, reflect: !0 })
2465
- ], p.prototype, "open", 2);
2466
- g([
2467
- a({ type: Boolean, reflect: !0 })
2468
- ], p.prototype, "showHeader", 2);
2469
- g([
2470
- a({ type: Boolean, reflect: !0 })
2471
- ], p.prototype, "showFooter", 2);
2472
- g([
2473
- a({ type: Boolean, reflect: !0 })
2474
- ], p.prototype, "showHeaderStartIcon", 2);
2475
- g([
2476
- a({ type: String, reflect: !0 })
2477
- ], p.prototype, "headerTitle", 2);
2478
- g([
2479
- a({ type: String, reflect: !0 })
2480
- ], p.prototype, "headerTitleClassName", 2);
2481
- g([
2482
- a({ type: String, reflect: !0 })
2483
- ], p.prototype, "closeButtonLabel", 2);
2484
- g([
2485
- a({ type: String, reflect: !0 })
2486
- ], p.prototype, "firstButtonLabel", 2);
2487
- g([
2488
- a({ type: String, reflect: !0 })
2489
- ], p.prototype, "firstButtonVariant", 2);
2490
- g([
2491
- a({ type: Object, reflect: !0 })
2492
- ], p.prototype, "firstButtonProps", 2);
2493
- g([
2494
- a({ type: Boolean, reflect: !0 })
2495
- ], p.prototype, "onFirstButtonClickClose", 2);
2496
- g([
2497
- a({ type: String, reflect: !0 })
2498
- ], p.prototype, "secondButtonLabel", 2);
2499
- g([
2500
- a({ type: String, reflect: !0 })
2501
- ], p.prototype, "secondButtonVariant", 2);
2502
- g([
2503
- a({ type: Object, reflect: !0 })
2504
- ], p.prototype, "secondButtonProps", 2);
2505
- g([
2506
- a({ type: Boolean, reflect: !0 })
2507
- ], p.prototype, "onSecondButtonClickClose", 2);
2508
- g([
2509
- a({ type: Boolean, reflect: !0 })
2510
- ], p.prototype, "disablePortal", 2);
2511
- g([
2512
- a({ type: Number, reflect: !0 })
2513
- ], p.prototype, "zIndex", 2);
2514
- g([
2515
- a({ type: Boolean, reflect: !0 })
2516
- ], p.prototype, "initialized", 2);
2517
- g([
2518
- a({ type: Boolean })
2519
- ], p.prototype, "showDetail", 2);
2520
- g([
2521
- a({ type: Boolean })
2522
- ], p.prototype, "isHidingDetail", 2);
2523
- p = g([
2524
- y("o-side-panel")
2525
- ], p);
2514
+ Et([
2515
+ a({ type: Number })
2516
+ ], st.prototype, "rating", 2);
2517
+ Et([
2518
+ a({ type: String })
2519
+ ], st.prototype, "reviewCount", 2);
2520
+ Et([
2521
+ a({ type: String })
2522
+ ], st.prototype, "href", 2);
2523
+ st = Et([
2524
+ y("o-rating")
2525
+ ], st);
2526
2526
  var Ro = Object.defineProperty, No = Object.getOwnPropertyDescriptor, X = (o, t, e, n) => {
2527
2527
  for (var i = n > 1 ? void 0 : n ? No(t, e) : t, r = o.length - 1, s; r >= 0; r--)
2528
2528
  (s = o[r]) && (i = (n ? s(t, e, i) : s(i)) || i);