@florid-kit/components 4.1.1 → 4.1.2

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.
@@ -3,6 +3,7 @@ import { FormSubmitter, FormSubmitterType } from '../controllers/form-submitter'
3
3
 
4
4
  declare const buttonBaseClass: import('../behaviors/mixin').MixinReturn<import('../behaviors/mixin').MixinReturn<typeof LitElement, import('../behaviors/element-internals.js').WithElementInternals>>;
5
5
  type ButtonVariant = "primary" | "secondary" | "ghost" | "tertiary" | "link";
6
+ type ButtonLinkTemplate = "standard" | "discret";
6
7
  export declare const variants: string[];
7
8
  export declare class OccitaneButton extends buttonBaseClass implements FormSubmitter {
8
9
  static readonly formAssociated = true;
@@ -13,6 +14,8 @@ export declare class OccitaneButton extends buttonBaseClass implements FormSubmi
13
14
  set name(name: string);
14
15
  get form(): HTMLFormElement | null;
15
16
  variant: ButtonVariant;
17
+ /** Only applies to variant="link" (same templates as o-link). */
18
+ template: ButtonLinkTemplate;
16
19
  text: string;
17
20
  textsecond: string;
18
21
  fullwidth: boolean;
@@ -1,5 +1,5 @@
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
- import { n as a } from "../property-S_Y9cb04.mjs";
1
+ import { E as b, i as E, a as w, m as S, x as p, t as C } from "../performance-mixin-D7YmSeqN.mjs";
2
+ import { n as s } 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
5
  import { e as k, o as _, a as I } from "../icons-registry.mjs";
@@ -17,15 +17,15 @@ function q(e) {
17
17
  e.addInitializer((t) => {
18
18
  const o = t;
19
19
  o.addEventListener("click", async (n) => {
20
- const { type: i, [D]: r } = o, { form: s } = r;
21
- if (!(!s || i === "button") && (await new Promise((h) => {
20
+ const { type: i, [D]: r } = o, { form: a } = r;
21
+ if (!(!a || i === "button") && (await new Promise((h) => {
22
22
  setTimeout(h);
23
23
  }), !n.defaultPrevented)) {
24
24
  if (i === "reset") {
25
- s.reset();
25
+ a.reset();
26
26
  return;
27
27
  }
28
- s.addEventListener(
28
+ a.addEventListener(
29
29
  "submit",
30
30
  (h) => {
31
31
  Object.defineProperty(h, "submitter", {
@@ -35,7 +35,7 @@ function q(e) {
35
35
  });
36
36
  },
37
37
  { capture: !0, once: !0 }
38
- ), r.setFormValue(o.value), s.requestSubmit();
38
+ ), r.setFormValue(o.value), a.requestSubmit();
39
39
  }
40
40
  });
41
41
  });
@@ -180,16 +180,16 @@ class U extends V {
180
180
  const r = t[i];
181
181
  if (r === o[i])
182
182
  continue;
183
- const s = i.slice(1);
183
+ const a = i.slice(1);
184
184
  switch (i[0]) {
185
185
  case "@":
186
- this.eventData[s] = r, this.applyEvent(s, r);
186
+ this.eventData[a] = r, this.applyEvent(a, r);
187
187
  break;
188
188
  case ".":
189
- n[s] = r;
189
+ n[a] = r;
190
190
  break;
191
191
  case "?":
192
- r ? n.setAttribute(s, "") : n.removeAttribute(s);
192
+ r ? n.setAttribute(a, "") : n.removeAttribute(a);
193
193
  break;
194
194
  default:
195
195
  r != null ? n.setAttribute(i, String(r)) : n.removeAttribute(i);
@@ -222,11 +222,11 @@ class U extends V {
222
222
  }
223
223
  const $ = R(U);
224
224
  var X = Object.defineProperty, W = Object.getOwnPropertyDescriptor, d = (e, t, o, n) => {
225
- for (var i = n > 1 ? void 0 : n ? W(t, o) : t, r = e.length - 1, s; r >= 0; r--)
226
- (s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
225
+ for (var i = n > 1 ? void 0 : n ? W(t, o) : t, r = e.length - 1, a; r >= 0; r--)
226
+ (a = e[r]) && (i = (n ? a(t, o, i) : a(i)) || i);
227
227
  return n && i && X(t, o, i), i;
228
228
  };
229
- let l = class extends C(w) {
229
+ let l = class extends S(w) {
230
230
  constructor() {
231
231
  super(...arguments), this.open = !1, this.showHeader = !0, this.showFooter = !1, this.showHeaderStartIcon = !1, this.headerTitle = "", this.headerTitleClassName = "panel-title", this.labelDialog = "", this.labelAriaDialogPanel = "", this.closeButtonLabel = "Close the modal", this.goBackButtonLabel = "Go back to", this.firstButtonLabel = "Close", this.firstButtonVariant = "primary", this.firstButtonProps = {}, this.onFirstButtonClickClose = !1, this.secondButtonLabel = "", this.secondButtonVariant = "secondary", this.secondButtonProps = {}, this.onSecondButtonClickClose = !1, this.stickyFooter = !1, this.disablePortal = !1, this.zIndex = 99, this.initialized = !1, this.showDetail = !1, this.isHidingDetail = !1, this.previousFocusedElement = null, this.previousFocusedSelector = null, this._hideTimeout = null, this._onOpenDetail = async (e) => {
232
232
  var o, n;
@@ -286,7 +286,7 @@ let l = class extends C(w) {
286
286
  document.body.style.overflow = "", document.body.removeAttribute("data-side-panel"), this.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback(), this.removeEventListener("open-detail", this._onOpenDetail);
287
287
  }
288
288
  async focusDetailReturnBtn() {
289
- var i, r, s, h, f;
289
+ var i, r, a, h, f;
290
290
  await this.updateComplete;
291
291
  const e = this.getDeepActiveElement(document);
292
292
  if (e && e !== document.body)
@@ -297,7 +297,7 @@ let l = class extends C(w) {
297
297
  await new Promise(requestAnimationFrame);
298
298
  const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".detail-view .return-btn");
299
299
  if (!t) return;
300
- t.updateComplete && await t.updateComplete, (h = (s = ((r = t.shadowRoot) == null ? void 0 : r.querySelector("button")) ?? t) == null ? void 0 : s.focus) == null || h.call(s, { preventScroll: !0 });
300
+ t.updateComplete && await t.updateComplete, (h = (a = ((r = t.shadowRoot) == null ? void 0 : r.querySelector("button")) ?? t) == null ? void 0 : a.focus) == null || h.call(a, { preventScroll: !0 });
301
301
  const n = (f = this.shadowRoot) == null ? void 0 : f.querySelector('.panel[role="dialog"]');
302
302
  n && (this.labelAriaDialogPanel ? n.setAttribute("aria-label", this.labelAriaDialogPanel) : n.setAttribute("aria-labelledby", "panel-title"));
303
303
  }
@@ -336,7 +336,7 @@ let l = class extends C(w) {
336
336
  return;
337
337
  }
338
338
  if (document.querySelector("#refineandsortpopin")) {
339
- const s = t.querySelector(".close-btn"), h = s ? this.resolveFocusable(s) : null, f = t.querySelector(".js-clear-refinements"), m = f ? this.resolveFocusable(f) : null, x = (A) => {
339
+ const a = t.querySelector(".close-btn"), h = a ? this.resolveFocusable(a) : null, f = t.querySelector(".js-clear-refinements"), m = f ? this.resolveFocusable(f) : null, x = (A) => {
340
340
  e.preventDefault(), e.stopPropagation(), A.focus();
341
341
  };
342
342
  if (h && m) {
@@ -347,11 +347,11 @@ let l = class extends C(w) {
347
347
  const r = this.renderRoot.querySelector(".close-btn");
348
348
  if (!e.shiftKey && r && r.contains(n)) {
349
349
  e.preventDefault();
350
- const s = this.renderRoot.querySelector(
350
+ const a = this.renderRoot.querySelector(
351
351
  ".o-whats-inside--content p"
352
352
  );
353
- if (s) {
354
- s.focus();
353
+ if (a) {
354
+ a.focus();
355
355
  return;
356
356
  }
357
357
  }
@@ -372,8 +372,8 @@ let l = class extends C(w) {
372
372
  const f = this.resolveFocusable(r);
373
373
  f && !this.isUnavailableElement(f) && o.push(f);
374
374
  }
375
- const s = r.tagName.toLowerCase();
376
- if (s === "o-icon-button" || s === "o-button") return;
375
+ const a = r.tagName.toLowerCase();
376
+ if (a === "o-icon-button" || a === "o-button") return;
377
377
  if (r instanceof HTMLSlotElement) {
378
378
  r.assignedElements({ flatten: !0 }).forEach(i);
379
379
  return;
@@ -395,11 +395,11 @@ let l = class extends C(w) {
395
395
  o && o.setAttribute("aria-modal", "true"), this.updateComplete.then(async () => {
396
396
  var i, r;
397
397
  if (this.showHeader && !t) {
398
- const s = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".panel .close-btn");
399
- s != null && s.updateComplete && await s.updateComplete;
400
- const h = this.resolveFocusable(s);
401
- (r = h == null ? void 0 : h.focus) == null || r.call(h, { preventScroll: !0 }), e || (s == null || s.classList.add("no-outline"), h == null || h.addEventListener("focusout", () => {
402
- s == null || s.classList.remove("no-outline");
398
+ const a = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".panel .close-btn");
399
+ a != null && a.updateComplete && await a.updateComplete;
400
+ const h = this.resolveFocusable(a);
401
+ (r = h == null ? void 0 : h.focus) == null || r.call(h, { preventScroll: !0 }), e || (a == null || a.classList.add("no-outline"), h == null || h.addEventListener("focusout", () => {
402
+ a == null || a.classList.remove("no-outline");
403
403
  }, { once: !0 }));
404
404
  } else
405
405
  this.focusFirstInPanel();
@@ -798,89 +798,89 @@ l.shadowRootOptions = {
798
798
  delegatesFocus: !0
799
799
  };
800
800
  d([
801
- a({ type: Boolean, reflect: !0 })
801
+ s({ type: Boolean, reflect: !0 })
802
802
  ], l.prototype, "open", 2);
803
803
  d([
804
- a({ type: Boolean })
804
+ s({ type: Boolean })
805
805
  ], l.prototype, "showHeader", 2);
806
806
  d([
807
- a({ type: Boolean })
807
+ s({ type: Boolean })
808
808
  ], l.prototype, "showFooter", 2);
809
809
  d([
810
- a({ type: Boolean })
810
+ s({ type: Boolean })
811
811
  ], l.prototype, "showHeaderStartIcon", 2);
812
812
  d([
813
- a({ type: String })
813
+ s({ type: String })
814
814
  ], l.prototype, "headerTitle", 2);
815
815
  d([
816
- a({ type: String })
816
+ s({ type: String })
817
817
  ], l.prototype, "headerTitleClassName", 2);
818
818
  d([
819
- a({ type: String })
819
+ s({ type: String })
820
820
  ], l.prototype, "labelDialog", 2);
821
821
  d([
822
- a({ type: String })
822
+ s({ type: String })
823
823
  ], l.prototype, "labelAriaDialogPanel", 2);
824
824
  d([
825
- a({ type: String })
825
+ s({ type: String })
826
826
  ], l.prototype, "closeButtonLabel", 2);
827
827
  d([
828
- a({ type: String })
828
+ s({ type: String })
829
829
  ], l.prototype, "goBackButtonLabel", 2);
830
830
  d([
831
- a({ type: String })
831
+ s({ type: String })
832
832
  ], l.prototype, "firstButtonLabel", 2);
833
833
  d([
834
- a({ type: String })
834
+ s({ type: String })
835
835
  ], l.prototype, "firstButtonVariant", 2);
836
836
  d([
837
- a({ type: Object })
837
+ s({ type: Object })
838
838
  ], l.prototype, "firstButtonProps", 2);
839
839
  d([
840
- a({ type: Boolean })
840
+ s({ type: Boolean })
841
841
  ], l.prototype, "onFirstButtonClickClose", 2);
842
842
  d([
843
- a({ type: String })
843
+ s({ type: String })
844
844
  ], l.prototype, "secondButtonLabel", 2);
845
845
  d([
846
- a({ type: String })
846
+ s({ type: String })
847
847
  ], l.prototype, "secondButtonVariant", 2);
848
848
  d([
849
- a({ type: Object })
849
+ s({ type: Object })
850
850
  ], l.prototype, "secondButtonProps", 2);
851
851
  d([
852
- a({ type: Boolean })
852
+ s({ type: Boolean })
853
853
  ], l.prototype, "onSecondButtonClickClose", 2);
854
854
  d([
855
- a({ type: Boolean, reflect: !0 })
855
+ s({ type: Boolean, reflect: !0 })
856
856
  ], l.prototype, "stickyFooter", 2);
857
857
  d([
858
- a({ type: Boolean })
858
+ s({ type: Boolean })
859
859
  ], l.prototype, "disablePortal", 2);
860
860
  d([
861
- a({ type: Number })
861
+ s({ type: Number })
862
862
  ], l.prototype, "zIndex", 2);
863
863
  d([
864
- a({ type: Boolean, reflect: !0 })
864
+ s({ type: Boolean, reflect: !0 })
865
865
  ], l.prototype, "initialized", 2);
866
866
  d([
867
- a({ type: Boolean })
867
+ s({ type: Boolean })
868
868
  ], l.prototype, "showDetail", 2);
869
869
  d([
870
- a({ type: Boolean })
870
+ s({ type: Boolean })
871
871
  ], l.prototype, "isHidingDetail", 2);
872
872
  l = d([
873
- S("o-side-panel")
873
+ C("o-side-panel")
874
874
  ], l);
875
875
  var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (e, t, o, n) => {
876
- for (var i = n > 1 ? void 0 : n ? Q(t, o) : t, r = e.length - 1, s; r >= 0; r--)
877
- (s = e[r]) && (i = (n ? s(t, o, i) : s(i)) || i);
876
+ for (var i = n > 1 ? void 0 : n ? Q(t, o) : t, r = e.length - 1, a; r >= 0; r--)
877
+ (a = e[r]) && (i = (n ? a(t, o, i) : a(i)) || i);
878
878
  return n && i && G(t, o, i), i;
879
879
  };
880
- const J = C(P(w)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
880
+ const J = S(P(w)), lt = ["primary", "secondary", "ghost", "tertiary", "link"];
881
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.asButton = !1, this.updateDescription = () => {
883
+ super(...arguments), this.type = "submit", this.value = "", this.variant = "primary", this.template = "standard", 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();
@@ -1091,6 +1091,15 @@ c.styles = E`
1091
1091
  opacity: 0;
1092
1092
  }
1093
1093
 
1094
+ :host([variant="link"][template="discret"]) .button,
1095
+ :host([variant="link"][template="discret"]) .button span {
1096
+ font-family: var(--font-family-loccitane-sans);
1097
+ font-size: var(--font-size-150);
1098
+ font-weight: var(--font-weight-400);
1099
+ line-height: var(--line-height-200);
1100
+ letter-spacing: 0;
1101
+ }
1102
+
1094
1103
  :host([disabled]),
1095
1104
  :host([aria-disabled="true"]),
1096
1105
  :host([aria-disabled="true"]:hover) {
@@ -1233,67 +1242,70 @@ c.styles = E`
1233
1242
  }
1234
1243
  `;
1235
1244
  u([
1236
- a()
1245
+ s()
1237
1246
  ], c.prototype, "type", 2);
1238
1247
  u([
1239
- a()
1248
+ s()
1240
1249
  ], c.prototype, "value", 2);
1241
1250
  u([
1242
- a({ type: String, reflect: !0 })
1251
+ s({ type: String, reflect: !0 })
1243
1252
  ], c.prototype, "variant", 2);
1244
1253
  u([
1245
- a({ type: String })
1254
+ s({ type: String, reflect: !0 })
1255
+ ], c.prototype, "template", 2);
1256
+ u([
1257
+ s({ type: String })
1246
1258
  ], c.prototype, "text", 2);
1247
1259
  u([
1248
- a({ type: String })
1260
+ s({ type: String })
1249
1261
  ], c.prototype, "textsecond", 2);
1250
1262
  u([
1251
- a({ type: Boolean, reflect: !0 })
1263
+ s({ type: Boolean, reflect: !0 })
1252
1264
  ], c.prototype, "fullwidth", 2);
1253
1265
  u([
1254
- a({ type: Boolean, reflect: !0 })
1266
+ s({ type: Boolean, reflect: !0 })
1255
1267
  ], c.prototype, "disabled", 2);
1256
1268
  u([
1257
- a({ type: String })
1269
+ s({ type: String })
1258
1270
  ], c.prototype, "startIconModel", 2);
1259
1271
  u([
1260
- a({ type: String })
1272
+ s({ type: String })
1261
1273
  ], c.prototype, "endIconModel", 2);
1262
1274
  u([
1263
- a({ type: Boolean, reflect: !0, attribute: "starticon" })
1275
+ s({ type: Boolean, reflect: !0, attribute: "starticon" })
1264
1276
  ], c.prototype, "startIcon", 2);
1265
1277
  u([
1266
- a({ type: Boolean, reflect: !0, attribute: "endicon" })
1278
+ s({ type: Boolean, reflect: !0, attribute: "endicon" })
1267
1279
  ], c.prototype, "endIcon", 2);
1268
1280
  u([
1269
- a({ type: String, attribute: "paneltarget" })
1281
+ s({ type: String, attribute: "paneltarget" })
1270
1282
  ], c.prototype, "panelTarget", 2);
1271
1283
  u([
1272
- a({ type: String })
1284
+ s({ type: String })
1273
1285
  ], c.prototype, "href", 2);
1274
1286
  u([
1275
- a({ type: String })
1287
+ s({ type: String })
1276
1288
  ], c.prototype, "target", 2);
1277
1289
  u([
1278
- a({ type: String })
1290
+ s({ type: String })
1279
1291
  ], c.prototype, "ctatitle", 2);
1280
1292
  u([
1281
- a({ type: Boolean, reflect: !0 })
1293
+ s({ type: Boolean, reflect: !0 })
1282
1294
  ], c.prototype, "underlined", 2);
1283
1295
  u([
1284
- a({ type: Boolean, reflect: !0 })
1296
+ s({ type: Boolean, reflect: !0 })
1285
1297
  ], c.prototype, "withbadge", 2);
1286
1298
  u([
1287
- a({ reflect: !0, attribute: "describedby" })
1299
+ s({ reflect: !0, attribute: "describedby" })
1288
1300
  ], c.prototype, "describedBy", 2);
1289
1301
  u([
1290
- a({ reflect: !0, attribute: "expanded" })
1302
+ s({ reflect: !0, attribute: "expanded" })
1291
1303
  ], c.prototype, "ariaExpanded", 2);
1292
1304
  u([
1293
- a({ type: Boolean, attribute: "asbutton" })
1305
+ s({ type: Boolean, attribute: "asbutton" })
1294
1306
  ], c.prototype, "asButton", 2);
1295
1307
  c = u([
1296
- S("o-button")
1308
+ C("o-button")
1297
1309
  ], c);
1298
1310
  export {
1299
1311
  c as O,
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.1.1";
42
+ globalThis.__FLORID_KIT__ = "4.1.2";
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.1.1";
7
+ globalThis.__FLORID_KIT__ = "4.1.2";
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.1.1",
3
+ "version": "4.1.2",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "typings": "index.d.ts",