@florid-kit/components 3.2.19 → 3.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/aria.d.ts CHANGED
@@ -15,7 +15,7 @@ export type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;
15
15
  /**
16
16
  * Accessibility Object Model aria attributes.
17
17
  */
18
- export declare const ARIA_ATTRIBUTES: ("aria-label" | "aria-modal" | "aria-hidden" | "aria-expanded" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-description" | "aria-disabled" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-live" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[];
18
+ export declare const ARIA_ATTRIBUTES: ("aria-label" | "aria-modal" | "aria-hidden" | "aria-haspopup" | "aria-expanded" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-description" | "aria-disabled" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-live" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[];
19
19
  /**
20
20
  * Checks if an attribute is one of the AOM aria attributes.
21
21
  *
@@ -11,6 +11,7 @@ declare const OccitaneLink_base: import('../behaviors/mixin.js').MixinReturn<typ
11
11
  export declare class OccitaneLink extends OccitaneLink_base {
12
12
  static styles: import('lit').CSSResult;
13
13
  href: string;
14
+ dataHref: string;
14
15
  target: "_blank" | "_parent" | "_self" | "_top" | "";
15
16
  template: Template;
16
17
  inverse: Inverse;
@@ -19,7 +20,11 @@ export declare class OccitaneLink extends OccitaneLink_base {
19
20
  startIcon: startIcon;
20
21
  iconSize: IconLogicalSize;
21
22
  disabled: Disabled;
23
+ ariaControlsValue: string | null;
24
+ ariaHasPopupValue: string | null;
25
+ roleValue: string | null;
22
26
  private _handleClick;
27
+ private _handleKeydown;
23
28
  render(): import('lit').TemplateResult<1>;
24
29
  }
25
30
  export {};
@@ -1,23 +1,26 @@
1
- import { i as h, m as f, a as d, x as s, t as v } from "../performance-mixin-D7YmSeqN.mjs";
1
+ import { i as f, m as d, a as u, x as a, t as v } from "../performance-mixin-D7YmSeqN.mjs";
2
2
  import { n } from "../property-S_Y9cb04.mjs";
3
- import { o as u } from "../if-defined-j0wE2gL4.mjs";
4
- import { f as g } from "../css-C8WrrxT-.mjs";
3
+ import { o as l } from "../if-defined-j0wE2gL4.mjs";
4
+ import { f as y } from "../css-C8WrrxT-.mjs";
5
5
  import "./icon-button.mjs";
6
- var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor, t = (i, o, l, a) => {
7
- for (var r = a > 1 ? void 0 : a ? y(o, l) : o, c = i.length - 1, p; c >= 0; c--)
8
- (p = i[c]) && (r = (a ? p(o, l, r) : p(r)) || r);
9
- return a && r && m(o, l, r), r;
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--)
8
+ (h = r[p]) && (i = (s ? h(o, c, i) : h(i)) || i);
9
+ return s && i && g(o, c, i), i;
10
10
  };
11
- let e = class extends f(d) {
11
+ let t = class extends d(u) {
12
12
  constructor() {
13
- super(...arguments), this.href = "", this.target = "", this.template = "standard", this.inverse = !1, this.endIcon = !1, this.reverseEndIcon = !1, this.startIcon = !1, this.iconSize = "xsmall", this.disabled = !1;
13
+ super(...arguments), this.href = "", this.dataHref = "", this.target = "", this.template = "standard", this.inverse = !1, this.endIcon = !1, this.reverseEndIcon = !1, this.startIcon = !1, this.iconSize = "xsmall", this.disabled = !1, this.ariaControlsValue = null, this.ariaHasPopupValue = null, this.roleValue = null;
14
14
  }
15
- _handleClick(i) {
16
- (!this.href || this.href === "#") && i.preventDefault();
15
+ _handleClick(r) {
16
+ (!this.href || this.href === "#") && r.preventDefault();
17
+ }
18
+ _handleKeydown(r) {
19
+ r.key === " " && (r.preventDefault(), r.currentTarget.click());
17
20
  }
18
21
  render() {
19
- const i = !!this.href, o = s`
20
- ${this.startIcon ? s`
22
+ const r = !!this.href, o = a`
23
+ ${this.startIcon ? a`
21
24
  <o-icon-button
22
25
  class="link-start-icon"
23
26
  icon="occ-chevron-left"
@@ -27,7 +30,7 @@ let e = class extends f(d) {
27
30
  type="span"
28
31
  ></o-icon-button>
29
32
  ` : null}
30
- ${this.endIcon && this.reverseEndIcon ? s`
33
+ ${this.endIcon && this.reverseEndIcon ? a`
31
34
  <o-icon-button
32
35
  class="link-end-icon"
33
36
  icon="occ-chevron-left"
@@ -38,7 +41,7 @@ let e = class extends f(d) {
38
41
  ></o-icon-button>
39
42
  ` : null}
40
43
  <span class="link-text"><slot></slot></span>
41
- ${this.endIcon && !this.reverseEndIcon ? s`
44
+ ${this.endIcon && !this.reverseEndIcon ? a`
42
45
  <o-icon-button
43
46
  class="link-end-icon"
44
47
  icon="occ-chevron-right"
@@ -49,19 +52,23 @@ let e = class extends f(d) {
49
52
  ></o-icon-button>
50
53
  ` : null}
51
54
  `;
52
- return i ? s`
55
+ return r ? a`
53
56
  <a
54
57
  class="link-wrapper"
55
- href="${this.href}"
56
- target="${u(this.target || void 0)}"
58
+ href="${this.href === "#" && this.dataHref ? `${this.dataHref}#` : this.href || this.dataHref}"
59
+ target="${l(this.target || void 0)}"
60
+ role="${l(this.roleValue ?? void 0)}"
61
+ aria-controls="${l(this.ariaControlsValue ?? void 0)}"
62
+ aria-haspopup="${l(this.ariaHasPopupValue ?? void 0)}"
57
63
  @click="${this._handleClick}"
64
+ @keydown="${this._handleKeydown}"
58
65
  >
59
66
  ${o}
60
67
  </a>
61
- ` : s`<span class="link-wrapper">${o}</span>`;
68
+ ` : a`<span class="link-wrapper">${o}</span>`;
62
69
  }
63
70
  };
64
- e.styles = h`
71
+ t.styles = f`
65
72
  :host {
66
73
  cursor: pointer;
67
74
  /* The host is not the focus target: only the inner <a> is. Without
@@ -135,7 +142,7 @@ e.styles = h`
135
142
  }
136
143
 
137
144
  .link-wrapper:focus-visible {
138
- ${g};
145
+ ${y};
139
146
  }
140
147
 
141
148
  .link-text {
@@ -167,36 +174,48 @@ e.styles = h`
167
174
  }
168
175
  }
169
176
  `;
170
- t([
177
+ e([
171
178
  n({ type: String })
172
- ], e.prototype, "href", 2);
173
- t([
179
+ ], t.prototype, "href", 2);
180
+ e([
181
+ n({ type: String, attribute: "data-href" })
182
+ ], t.prototype, "dataHref", 2);
183
+ e([
174
184
  n({ type: String })
175
- ], e.prototype, "target", 2);
176
- t([
185
+ ], t.prototype, "target", 2);
186
+ e([
177
187
  n({ type: String, reflect: !0 })
178
- ], e.prototype, "template", 2);
179
- t([
188
+ ], t.prototype, "template", 2);
189
+ e([
180
190
  n({ type: Boolean, reflect: !0 })
181
- ], e.prototype, "inverse", 2);
182
- t([
191
+ ], t.prototype, "inverse", 2);
192
+ e([
183
193
  n({ type: Boolean, reflect: !0 })
184
- ], e.prototype, "endIcon", 2);
185
- t([
194
+ ], t.prototype, "endIcon", 2);
195
+ e([
186
196
  n({ type: Boolean, reflect: !0 })
187
- ], e.prototype, "reverseEndIcon", 2);
188
- t([
197
+ ], t.prototype, "reverseEndIcon", 2);
198
+ e([
189
199
  n({ type: Boolean, reflect: !0 })
190
- ], e.prototype, "startIcon", 2);
191
- t([
200
+ ], t.prototype, "startIcon", 2);
201
+ e([
192
202
  n({ type: String })
193
- ], e.prototype, "iconSize", 2);
194
- t([
203
+ ], t.prototype, "iconSize", 2);
204
+ e([
195
205
  n({ type: Boolean, reflect: !0 })
196
- ], e.prototype, "disabled", 2);
197
- e = t([
206
+ ], t.prototype, "disabled", 2);
207
+ e([
208
+ n({ type: String, attribute: "aria-controls" })
209
+ ], t.prototype, "ariaControlsValue", 2);
210
+ e([
211
+ n({ type: String, attribute: "aria-haspopup" })
212
+ ], t.prototype, "ariaHasPopupValue", 2);
213
+ e([
214
+ n({ type: String, attribute: "role" })
215
+ ], t.prototype, "roleValue", 2);
216
+ t = e([
198
217
  v("o-link")
199
- ], e);
218
+ ], t);
200
219
  export {
201
- e as OccitaneLink
220
+ t as OccitaneLink
202
221
  };
package/index.mjs CHANGED
@@ -38,4 +38,4 @@ import "./components/search-input.mjs";
38
38
  import "./components/search-input-dropdown.mjs";
39
39
  import "./components/option-tile.mjs";
40
40
  import "./components/option-tile-group.mjs";
41
- globalThis.__FLORID_KIT__ = "3.2.19";
41
+ globalThis.__FLORID_KIT__ = "3.2.20";
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__ = "3.2.19";
7
+ globalThis.__FLORID_KIT__ = "3.2.20";
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": "3.2.19",
3
+ "version": "3.2.20",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "typings": "index.d.ts",