@florid-kit/components 4.0.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,9 +29,11 @@ export declare class OccitaneButton extends buttonBaseClass implements FormSubmi
29
29
  withbadge: boolean;
30
30
  describedBy: string | null;
31
31
  ariaExpanded: string | null;
32
+ asButton: boolean;
32
33
  private updateDescription;
33
34
  protected updated(): void;
34
35
  private handleClick;
36
+ private handleLinkKeyUp;
35
37
  protected render(): import('lit').TemplateResult<1>;
36
38
  private _unsubOcc?;
37
39
  connectedCallback(): void;
@@ -3,8 +3,8 @@ import { n } from "../property-S_Y9cb04.mjs";
3
3
  import { o as l } from "../if-defined-j0wE2gL4.mjs";
4
4
  import { f as y } from "../css-C8WrrxT-.mjs";
5
5
  import "./icon-button.mjs";
6
- var g = Object.defineProperty, m = Object.getOwnPropertyDescriptor, e = (r, o, c, s) => {
7
- for (var i = s > 1 ? void 0 : s ? m(o, c) : o, p = r.length - 1, h; p >= 0; p--)
6
+ var g = Object.defineProperty, k = Object.getOwnPropertyDescriptor, e = (r, o, c, s) => {
7
+ for (var i = s > 1 ? void 0 : s ? k(o, c) : o, p = r.length - 1, h; p >= 0; p--)
8
8
  (h = r[p]) && (i = (s ? h(o, c, i) : h(i)) || i);
9
9
  return s && i && g(o, c, i), i;
10
10
  };
@@ -141,7 +141,8 @@ t.styles = f`
141
141
  color: inherit;
142
142
  }
143
143
 
144
- .link-wrapper:focus-visible {
144
+ .link-wrapper:focus-visible,
145
+ :host(.a--tabfocus) .link-wrapper {
145
146
  ${y};
146
147
  }
147
148
 
@@ -1,8 +1,8 @@
1
- import { E as b, i as E, a as w, m as C, x as u, t as S } from "../performance-mixin-D7YmSeqN.mjs";
1
+ import { E as b, i as E, a as w, m as C, x as p, t as S } from "../performance-mixin-D7YmSeqN.mjs";
2
2
  import { n as a } from "../property-S_Y9cb04.mjs";
3
3
  import { f as g } from "../css-C8WrrxT-.mjs";
4
4
  import { i as D, m as P } from "../element-internals-Dw7LndlH.mjs";
5
- import { e as $, o as _, a as I } from "../icons-registry.mjs";
5
+ import { e as k, o as _, a as I } from "../icons-registry.mjs";
6
6
  import { g as z } from "../svg-utils-DOL__czZ.mjs";
7
7
  import { o as F } from "../unsafe-svg-BipL_msF.mjs";
8
8
  import "./icon-button.mjs";
@@ -171,7 +171,7 @@ class V extends j {
171
171
  }
172
172
  }
173
173
  }
174
- class X extends V {
174
+ class U extends V {
175
175
  apply(t) {
176
176
  if (!t)
177
177
  return;
@@ -220,11 +220,11 @@ class X extends V {
220
220
  }
221
221
  }
222
222
  }
223
- const k = R(X);
224
- var U = Object.defineProperty, W = Object.getOwnPropertyDescriptor, c = (e, t, o, n) => {
223
+ const $ = R(U);
224
+ var X = Object.defineProperty, W = Object.getOwnPropertyDescriptor, d = (e, t, o, n) => {
225
225
  for (var i = n > 1 ? void 0 : n ? W(t, o) : t, r = e.length - 1, s; r >= 0; r--)
226
226
  (s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
227
- return n && i && U(t, o, i), i;
227
+ return n && i && X(t, o, i), i;
228
228
  };
229
229
  let l = class extends C(w) {
230
230
  constructor() {
@@ -456,9 +456,9 @@ let l = class extends C(w) {
456
456
  }, 500);
457
457
  }
458
458
  render() {
459
- const e = this.showHeader ? u`
459
+ const e = this.showHeader ? p`
460
460
  <div tabindex="-1" part="header" class="header ${this.showDetail ? "detail-view-header" : ""}">
461
- ${this.showHeaderStartIcon ? u`
461
+ ${this.showHeaderStartIcon ? p`
462
462
  <o-icon-button
463
463
  icon="arrowLeft"
464
464
  size="small"
@@ -488,31 +488,31 @@ let l = class extends C(w) {
488
488
  aria-describedby="panel-title"
489
489
  ></o-icon-button>
490
490
  </div>
491
- ` : null, t = this.showFooter ? u`
491
+ ` : null, t = this.showFooter ? p`
492
492
  <div class="footer" part="footer">
493
- ${this.firstButtonVariant && this.firstButtonLabel ? u`
493
+ ${this.firstButtonVariant && this.firstButtonLabel ? p`
494
494
  <o-button
495
495
  .variant=${this.firstButtonVariant}
496
496
  @click=${this.handleFirstClick}
497
497
  @keydown=${this.handleFirstClick}
498
- ${k(this.firstButtonProps)}
498
+ ${$(this.firstButtonProps)}
499
499
  >
500
500
  ${this.firstButtonLabel}
501
501
  </o-button>
502
502
  ` : null}
503
- ${this.secondButtonVariant && this.secondButtonLabel ? u`
503
+ ${this.secondButtonVariant && this.secondButtonLabel ? p`
504
504
  <o-button
505
505
  .variant=${this.secondButtonVariant}
506
506
  @click=${this.handleSecondClick}
507
507
  @keydown=${this.handleSecondClick}
508
- ${k(this.secondButtonProps)}
508
+ ${$(this.secondButtonProps)}
509
509
  >
510
510
  ${this.secondButtonLabel}
511
511
  </o-button>
512
512
  ` : null}
513
513
  </div>
514
514
  ` : null;
515
- return u`
515
+ return p`
516
516
  <div class="overlay" style="z-index: ${this.zIndex}" @click=${this.handleClosePanel}></div>
517
517
  <div
518
518
  class="panel"
@@ -528,7 +528,7 @@ let l = class extends C(w) {
528
528
 
529
529
  <div part="content" class="content ${this.isHidingDetail ? "slide-out-right" : ""} ${this.showDetail ? "with-detail" : ""}">
530
530
 
531
- ${this.showDetail ? u`
531
+ ${this.showDetail ? p`
532
532
  <div class="detail-view">
533
533
  ${e}
534
534
  <div class="detail-content">
@@ -537,7 +537,7 @@ let l = class extends C(w) {
537
537
  </div>
538
538
  </div>
539
539
  </div>
540
- ` : u`<slot></slot>`}
540
+ ` : p`<slot></slot>`}
541
541
  </div>
542
542
 
543
543
  ${this.stickyFooter ? null : t}
@@ -797,90 +797,90 @@ l.shadowRootOptions = {
797
797
  // This helps send focus into the first focusable in shadow when host is focused
798
798
  delegatesFocus: !0
799
799
  };
800
- c([
800
+ d([
801
801
  a({ type: Boolean, reflect: !0 })
802
802
  ], l.prototype, "open", 2);
803
- c([
803
+ d([
804
804
  a({ type: Boolean })
805
805
  ], l.prototype, "showHeader", 2);
806
- c([
806
+ d([
807
807
  a({ type: Boolean })
808
808
  ], l.prototype, "showFooter", 2);
809
- c([
809
+ d([
810
810
  a({ type: Boolean })
811
811
  ], l.prototype, "showHeaderStartIcon", 2);
812
- c([
812
+ d([
813
813
  a({ type: String })
814
814
  ], l.prototype, "headerTitle", 2);
815
- c([
815
+ d([
816
816
  a({ type: String })
817
817
  ], l.prototype, "headerTitleClassName", 2);
818
- c([
818
+ d([
819
819
  a({ type: String })
820
820
  ], l.prototype, "labelDialog", 2);
821
- c([
821
+ d([
822
822
  a({ type: String })
823
823
  ], l.prototype, "labelAriaDialogPanel", 2);
824
- c([
824
+ d([
825
825
  a({ type: String })
826
826
  ], l.prototype, "closeButtonLabel", 2);
827
- c([
827
+ d([
828
828
  a({ type: String })
829
829
  ], l.prototype, "goBackButtonLabel", 2);
830
- c([
830
+ d([
831
831
  a({ type: String })
832
832
  ], l.prototype, "firstButtonLabel", 2);
833
- c([
833
+ d([
834
834
  a({ type: String })
835
835
  ], l.prototype, "firstButtonVariant", 2);
836
- c([
836
+ d([
837
837
  a({ type: Object })
838
838
  ], l.prototype, "firstButtonProps", 2);
839
- c([
839
+ d([
840
840
  a({ type: Boolean })
841
841
  ], l.prototype, "onFirstButtonClickClose", 2);
842
- c([
842
+ d([
843
843
  a({ type: String })
844
844
  ], l.prototype, "secondButtonLabel", 2);
845
- c([
845
+ d([
846
846
  a({ type: String })
847
847
  ], l.prototype, "secondButtonVariant", 2);
848
- c([
848
+ d([
849
849
  a({ type: Object })
850
850
  ], l.prototype, "secondButtonProps", 2);
851
- c([
851
+ d([
852
852
  a({ type: Boolean })
853
853
  ], l.prototype, "onSecondButtonClickClose", 2);
854
- c([
854
+ d([
855
855
  a({ type: Boolean, reflect: !0 })
856
856
  ], l.prototype, "stickyFooter", 2);
857
- c([
857
+ d([
858
858
  a({ type: Boolean })
859
859
  ], l.prototype, "disablePortal", 2);
860
- c([
860
+ d([
861
861
  a({ type: Number })
862
862
  ], l.prototype, "zIndex", 2);
863
- c([
863
+ d([
864
864
  a({ type: Boolean, reflect: !0 })
865
865
  ], l.prototype, "initialized", 2);
866
- c([
866
+ d([
867
867
  a({ type: Boolean })
868
868
  ], l.prototype, "showDetail", 2);
869
- c([
869
+ d([
870
870
  a({ type: Boolean })
871
871
  ], l.prototype, "isHidingDetail", 2);
872
- l = c([
872
+ l = d([
873
873
  S("o-side-panel")
874
874
  ], l);
875
- var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, p = (e, t, o, n) => {
875
+ var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (e, t, o, n) => {
876
876
  for (var i = n > 1 ? void 0 : n ? Q(t, o) : t, r = e.length - 1, s; r >= 0; r--)
877
877
  (s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
878
878
  return n && i && G(t, o, i), i;
879
879
  };
880
880
  const J = C(P(w)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
881
- let d = class extends J {
881
+ let c = class extends J {
882
882
  constructor() {
883
- 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.ctatitle = "", this.underlined = !1, this.withbadge = !1, this.describedBy = null, this.ariaExpanded = null, this.updateDescription = () => {
883
+ 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.ctatitle = "", this.underlined = !1, this.withbadge = !1, this.describedBy = null, this.ariaExpanded = null, this.asButton = !1, this.updateDescription = () => {
884
884
  const e = this.renderRoot.querySelector(".button"), t = this.describedBy || this.getAttribute("aria-describedby");
885
885
  if (!e || !t) return;
886
886
  const o = this.getRootNode();
@@ -900,11 +900,20 @@ let d = class extends J {
900
900
  this.updateDescription();
901
901
  }
902
902
  handleClick(e) {
903
- if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key)) && this.panelTarget) {
904
- const t = document.getElementById(this.panelTarget);
905
- t instanceof l && (t != null && t.openPanel) && typeof t.openPanel == "function" ? (e.preventDefault(), t.openPanel()) : console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`);
903
+ if (!(e instanceof KeyboardEvent && !["Enter", " "].includes(e.key))) {
904
+ if (this.asButton && e instanceof KeyboardEvent && e.key === " ") {
905
+ e.preventDefault();
906
+ return;
907
+ }
908
+ if (this.panelTarget) {
909
+ const t = document.getElementById(this.panelTarget);
910
+ t instanceof l && (t != null && t.openPanel) && typeof t.openPanel == "function" ? (e.preventDefault(), t.openPanel()) : console.warn(`[o-button] No side panel with id="${this.panelTarget}" found or it does not have an openPanel method.`);
911
+ }
906
912
  }
907
913
  }
914
+ handleLinkKeyUp(e) {
915
+ this.asButton && e.key === " " && (e.preventDefault(), e.currentTarget.click());
916
+ }
908
917
  render() {
909
918
  return this.href ? this.renderLink() : this.renderButton();
910
919
  }
@@ -912,7 +921,7 @@ let d = class extends J {
912
921
  var o, n;
913
922
  super.connectedCallback(), this.addEventListener("focusin", this.updateDescription);
914
923
  const e = (o = this.startIconModel) == null ? void 0 : o.startsWith("occ-"), t = (n = this.endIconModel) == null ? void 0 : n.startsWith("occ-");
915
- (e || t) && (e && $(this.startIconModel), t && $(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
924
+ (e || t) && (e && k(this.startIconModel), t && k(this.endIconModel), this._unsubOcc = _(() => this.requestUpdate()));
916
925
  }
917
926
  disconnectedCallback() {
918
927
  var e;
@@ -924,28 +933,29 @@ let d = class extends J {
924
933
  const o = I[t] ?? "";
925
934
  if (!o) return b;
926
935
  const n = z(o);
927
- return u`<span class="${e === "start" ? "icon-start" : "icon-end"}">${F(n)}</span>`;
936
+ return p`<span class="${e === "start" ? "icon-start" : "icon-end"}">${F(n)}</span>`;
928
937
  }
929
938
  renderButton() {
930
939
  const e = this.text || this.textsecond;
931
- return u`
940
+ return p`
932
941
  <button type=${this.type} class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
933
942
  title=${this.ctatitle || b}
934
943
  aria-expanded=${this.ariaExpanded || b} >
935
944
  ${this.startIcon ? this.renderIcon("start") : b}
936
- ${e ? u`
937
- ${this.text ? u`<span class="text">${this.text}</span>` : b}
938
- ${this.textsecond ? u`<span class="text">${this.textsecond}</span>` : b}
939
- ${this.withbadge ? u`<slot></slot>` : b}
940
- ` : u`<slot></slot>`}
945
+ ${e ? p`
946
+ ${this.text ? p`<span class="text">${this.text}</span>` : b}
947
+ ${this.textsecond ? p`<span class="text">${this.textsecond}</span>` : b}
948
+ ${this.withbadge ? p`<slot></slot>` : b}
949
+ ` : p`<slot></slot>`}
941
950
  ${this.endIcon ? this.renderIcon("end") : b}
942
951
  </button>
943
952
  `;
944
953
  }
945
954
  renderLink() {
946
955
  const e = this.text || this.textsecond;
947
- return u`
956
+ return p`
948
957
  <a
958
+ role=${this.asButton ? "button" : b}
949
959
  href=${this.href}
950
960
  target=${this.target || b}
951
961
  title=${this.ctatitle || b}
@@ -953,20 +963,21 @@ let d = class extends J {
953
963
  ?disabled=${this.disabled}
954
964
  @click=${this.handleClick}
955
965
  @keydown=${this.handleClick}
966
+ @keyup=${this.handleLinkKeyUp}
956
967
  >
957
968
  ${this.startIcon ? this.renderIcon("start") : b}
958
- ${e ? u`
959
- ${this.text ? u`<span>${this.text}</span>` : b}
960
- ${this.textsecond ? u`<span>${this.textsecond}</span>` : b}
961
- ` : u`<slot></slot>`}
969
+ ${e ? p`
970
+ ${this.text ? p`<span>${this.text}</span>` : b}
971
+ ${this.textsecond ? p`<span>${this.textsecond}</span>` : b}
972
+ ` : p`<slot></slot>`}
962
973
  ${this.endIcon ? this.renderIcon("end") : b}
963
974
  </a>
964
975
  `;
965
976
  }
966
977
  };
967
- q(d);
968
- d.formAssociated = !0;
969
- d.styles = E`
978
+ q(c);
979
+ c.formAssociated = !0;
980
+ c.styles = E`
970
981
  :host {
971
982
  --button-border: transparent;
972
983
  --badge-outer-width: 19px;
@@ -1221,68 +1232,71 @@ d.styles = E`
1221
1232
  transform: translateX(4px);
1222
1233
  }
1223
1234
  `;
1224
- p([
1235
+ u([
1225
1236
  a()
1226
- ], d.prototype, "type", 2);
1227
- p([
1237
+ ], c.prototype, "type", 2);
1238
+ u([
1228
1239
  a()
1229
- ], d.prototype, "value", 2);
1230
- p([
1240
+ ], c.prototype, "value", 2);
1241
+ u([
1231
1242
  a({ type: String, reflect: !0 })
1232
- ], d.prototype, "variant", 2);
1233
- p([
1243
+ ], c.prototype, "variant", 2);
1244
+ u([
1234
1245
  a({ type: String })
1235
- ], d.prototype, "text", 2);
1236
- p([
1246
+ ], c.prototype, "text", 2);
1247
+ u([
1237
1248
  a({ type: String })
1238
- ], d.prototype, "textsecond", 2);
1239
- p([
1249
+ ], c.prototype, "textsecond", 2);
1250
+ u([
1240
1251
  a({ type: Boolean, reflect: !0 })
1241
- ], d.prototype, "fullwidth", 2);
1242
- p([
1252
+ ], c.prototype, "fullwidth", 2);
1253
+ u([
1243
1254
  a({ type: Boolean, reflect: !0 })
1244
- ], d.prototype, "disabled", 2);
1245
- p([
1255
+ ], c.prototype, "disabled", 2);
1256
+ u([
1246
1257
  a({ type: String })
1247
- ], d.prototype, "startIconModel", 2);
1248
- p([
1258
+ ], c.prototype, "startIconModel", 2);
1259
+ u([
1249
1260
  a({ type: String })
1250
- ], d.prototype, "endIconModel", 2);
1251
- p([
1261
+ ], c.prototype, "endIconModel", 2);
1262
+ u([
1252
1263
  a({ type: Boolean, reflect: !0, attribute: "starticon" })
1253
- ], d.prototype, "startIcon", 2);
1254
- p([
1264
+ ], c.prototype, "startIcon", 2);
1265
+ u([
1255
1266
  a({ type: Boolean, reflect: !0, attribute: "endicon" })
1256
- ], d.prototype, "endIcon", 2);
1257
- p([
1267
+ ], c.prototype, "endIcon", 2);
1268
+ u([
1258
1269
  a({ type: String, attribute: "paneltarget" })
1259
- ], d.prototype, "panelTarget", 2);
1260
- p([
1270
+ ], c.prototype, "panelTarget", 2);
1271
+ u([
1261
1272
  a({ type: String })
1262
- ], d.prototype, "href", 2);
1263
- p([
1273
+ ], c.prototype, "href", 2);
1274
+ u([
1264
1275
  a({ type: String })
1265
- ], d.prototype, "target", 2);
1266
- p([
1276
+ ], c.prototype, "target", 2);
1277
+ u([
1267
1278
  a({ type: String })
1268
- ], d.prototype, "ctatitle", 2);
1269
- p([
1279
+ ], c.prototype, "ctatitle", 2);
1280
+ u([
1270
1281
  a({ type: Boolean, reflect: !0 })
1271
- ], d.prototype, "underlined", 2);
1272
- p([
1282
+ ], c.prototype, "underlined", 2);
1283
+ u([
1273
1284
  a({ type: Boolean, reflect: !0 })
1274
- ], d.prototype, "withbadge", 2);
1275
- p([
1285
+ ], c.prototype, "withbadge", 2);
1286
+ u([
1276
1287
  a({ reflect: !0, attribute: "describedby" })
1277
- ], d.prototype, "describedBy", 2);
1278
- p([
1288
+ ], c.prototype, "describedBy", 2);
1289
+ u([
1279
1290
  a({ reflect: !0, attribute: "expanded" })
1280
- ], d.prototype, "ariaExpanded", 2);
1281
- d = p([
1291
+ ], c.prototype, "ariaExpanded", 2);
1292
+ u([
1293
+ a({ type: Boolean, attribute: "asbutton" })
1294
+ ], c.prototype, "asButton", 2);
1295
+ c = u([
1282
1296
  S("o-button")
1283
- ], d);
1297
+ ], c);
1284
1298
  export {
1285
- d as O,
1299
+ c as O,
1286
1300
  l as OccitaneSidePanel,
1287
1301
  lt as v
1288
1302
  };
package/index.mjs CHANGED
@@ -39,4 +39,4 @@ import "./components/search-input-dropdown.mjs";
39
39
  import "./components/option-tile.mjs";
40
40
  import "./components/option-tile-group.mjs";
41
41
  import "./components/content-push.mjs";
42
- globalThis.__FLORID_KIT__ = "4.0.0";
42
+ globalThis.__FLORID_KIT__ = "4.1.1";
package/loader.mjs CHANGED
@@ -4,7 +4,7 @@ import "./components/link.mjs";
4
4
  import "./components/header-simplify.mjs";
5
5
  import "./components/breadcrumb.mjs";
6
6
  import "./components/breadcrumbs.mjs";
7
- globalThis.__FLORID_KIT__ = "4.0.0";
7
+ globalThis.__FLORID_KIT__ = "4.1.1";
8
8
  const i = {
9
9
  "o-accordion": () => import("./components/accordion.mjs"),
10
10
  "o-accordion-group": () => import("./components/accordion-group.mjs"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@florid-kit/components",
3
- "version": "4.0.0",
3
+ "version": "4.1.1",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "typings": "index.d.ts",