@vialiq/web-components 0.23.0 → 0.24.0

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/index.d.ts CHANGED
@@ -48,4 +48,5 @@ export { ViDatePickerInput } from './date-picker/vi-date-picker-input.js';
48
48
  export type { DatePickerMode, DatePickerChangeDetail } from './date-picker/types.js';
49
49
  export { ViLabel } from './label/vi-label.js';
50
50
  export type { LabelSize } from './label/vi-label.js';
51
+ export { ViLink } from './link/index.js';
51
52
  //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -28,3 +28,4 @@ export { ViComboboxItem } from './combobox/vi-combobox-item.js';
28
28
  export { VIALIQ_CHANGE, ViDatePicker } from './date-picker/vi-date-picker.js';
29
29
  export { ViDatePickerInput } from './date-picker/vi-date-picker-input.js';
30
30
  export { ViLabel } from './label/vi-label.js';
31
+ export { ViLink } from './link/vi-link.js';
@@ -0,0 +1,2 @@
1
+ export { ViLink } from './vi-link.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"}
package/link/index.js ADDED
@@ -0,0 +1 @@
1
+ export { ViLink } from './vi-link.js';
@@ -0,0 +1,30 @@
1
+ import { nothing } from 'lit';
2
+ import { ViElement } from '../base/vi-element.js';
3
+ type LinkVariant = 'primary' | 'secondary' | 'muted';
4
+ type LinkSize = 'inherit' | 'sm' | 'md' | 'lg';
5
+ type LinkUnderline = 'always' | 'hover' | 'none';
6
+ declare const ViLink_base: typeof ViElement & (new (...args: any[]) => import('../base/focusable-mixin.js').FocusableInterface);
7
+ export declare class ViLink extends ViLink_base {
8
+ static styles: import('lit').CSSResult;
9
+ accessor href: string;
10
+ accessor target: string;
11
+ accessor rel: string;
12
+ accessor download: string;
13
+ accessor variant: LinkVariant;
14
+ accessor size: LinkSize;
15
+ accessor underline: LinkUnderline;
16
+ accessor disabled: boolean;
17
+ accessor external: boolean;
18
+ protected get _focusableElement(): HTMLElement;
19
+ protected get _effectiveTarget(): string;
20
+ protected get _effectiveRel(): string | typeof nothing;
21
+ accessor ariaLabel: string | null;
22
+ render(): import('lit-html').TemplateResult<1>;
23
+ }
24
+ declare global {
25
+ interface HTMLElementTagNameMap {
26
+ 'vi-link': ViLink;
27
+ }
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=vi-link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vi-link.d.ts","sourceRoot":"","sources":["../../../../libs/web-components/src/link/vi-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAa,MAAM,KAAK,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,qBAAqB,CAAC;AAG7B,KAAK,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AACrD,KAAK,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,KAAK,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;;AAEjD,qBACa,MAAO,SAAQ,WAAyB;IACnD,OAAgB,MAAM,0BAEpB;IAE0B,QAAQ,CAAC,IAAI,SAAM;IACnB,QAAQ,CAAC,MAAM,SAAW;IAC1B,QAAQ,CAAC,GAAG,SAAM;IAClB,QAAQ,CAAC,QAAQ,SAAM;IACR,QAAQ,CAAC,OAAO,EAAE,WAAW,CAC5D;IACgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAa;IACpC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAW;IAC5B,QAAQ,CAAC,QAAQ,UAAS;IACzC,QAAQ,CAAC,QAAQ,UAAS;IAEvD,cAAuB,iBAAiB,IACQ,WAAW,CAC1D;IAED,SAAS,KAAK,gBAAgB,WAE7B;IAED,SAAS,KAAK,aAAa,4BAS1B;IAEsC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEvE,MAAM;CA8BhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
@@ -0,0 +1,590 @@
1
+ import { unsafeCSS, css, nothing, html } from 'lit';
2
+ import { customElement, property } from 'lit/decorators.js';
3
+ import { V as ViElement } from '../vi-element-C6GfDPs3.js';
4
+ import { F as FocusableMixin } from '../focusable-mixin-CmxOyPX5.js';
5
+ import '../icons/vi-icon.js';
6
+
7
+ const linkStyles = "@charset \"UTF-8\";@layer reset,components,utilities;:host{display:inline-block}.link{color:var(--vi-link-color, var(--vi-link-color, var(--vi-color-primary, #3676d0)));text-decoration-thickness:1px;text-underline-offset:var(--vi-link-underline-offset, 2px);cursor:pointer;transition:color .2s ease,text-decoration-color .2s ease;outline:none;text-decoration:underline}.link.underline-none,.link.underline-hover{text-decoration:none}.link.underline-hover:hover{text-decoration:underline}.link.size-inherit{font-size:inherit}.link.size-sm{font-size:var(--vi-font-size-sm, var(--vi-font-size-sm, 14px))}.link.size-md{font-size:var(--vi-font-size-base, var(--vi-font-size-base, 16px))}.link.size-lg{font-size:var(--vi-font-size-lg, var(--vi-font-size-lg, 18px))}.link.variant-secondary{--vi-link-color: var(--vi-link-color-secondary, var(--vi-link-color-secondary, var(--vi-color-grey-700, #616161)));--vi-link-color-hover: var(--vi-link-color-secondary-hover, var(--vi-color-grey-800, #424242));--vi-link-color-active: var(--vi-link-color-secondary-active, var(--vi-color-grey-900, #212121));--vi-link-color-visited: var(--vi-link-color-secondary-visited, var(--vi-color-grey-700, #616161))}.link.variant-muted{--vi-link-color: var(--vi-link-color-muted, var(--vi-link-color-muted, var(--vi-color-grey-500, #9e9e9e)));--vi-link-color-hover: var(--vi-link-color-muted-hover, var(--vi-color-grey-600, #757575));--vi-link-color-active: var(--vi-link-color-muted-active, var(--vi-color-grey-700, #616161));--vi-link-color-visited: var(--vi-link-color-muted-visited, var(--vi-color-grey-500, #9e9e9e))}.link:visited{color:var(--vi-link-color-visited, var(--vi-link-color-visited, var(--vi-color-purple-600, #6507c9)))}.link:hover{color:var(--vi-link-color-hover, var(--vi-link-color-hover, var(--vi-color-blue-800, #2d5fa8)))}.link:active{color:var(--vi-link-color-active, var(--vi-link-color-active, var(--vi-color-blue-900, #254882)))}.link:focus-visible{outline:var(--vi-border-width-base, 2px) solid var(--vi-focus-ring-color, var(--vi-link-color, var(--vi-color-primary, #3676d0)));outline-offset:0;box-shadow:0 0 0 3px var(--vi-focus-ring-glow, transparent)}.link[aria-disabled=true],.link.disabled{color:var(--vi-link-color-disabled, var(--vi-link-color-disabled, var(--vi-color-grey-400, #bdbdbd)));pointer-events:none;cursor:not-allowed;text-decoration:none}.link{display:inline-flex;align-items:center}::slotted([slot=icon]){display:inline-flex;margin-inline-end:.25rem}[part=external-icon]{display:inline-flex;align-items:center;margin-inline-start:.25rem}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}";
8
+
9
+ function applyDecs2203RFactory() {
10
+ function createAddInitializerMethod(initializers, decoratorFinishedRef) {
11
+ return function addInitializer(initializer) {
12
+ assertNotFinished(decoratorFinishedRef, "addInitializer");
13
+ assertCallable(initializer, "An initializer");
14
+ initializers.push(initializer);
15
+ };
16
+ }
17
+ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
18
+ var kindStr;
19
+ switch(kind){
20
+ case 1:
21
+ kindStr = "accessor";
22
+ break;
23
+ case 2:
24
+ kindStr = "method";
25
+ break;
26
+ case 3:
27
+ kindStr = "getter";
28
+ break;
29
+ case 4:
30
+ kindStr = "setter";
31
+ break;
32
+ default:
33
+ kindStr = "field";
34
+ }
35
+ var ctx = {
36
+ kind: kindStr,
37
+ name: isPrivate ? "#" + name : name,
38
+ static: isStatic,
39
+ private: isPrivate,
40
+ metadata: metadata
41
+ };
42
+ var decoratorFinishedRef = {
43
+ v: false
44
+ };
45
+ ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
46
+ var get, set;
47
+ if (kind === 0) {
48
+ if (isPrivate) {
49
+ get = desc.get;
50
+ set = desc.set;
51
+ } else {
52
+ get = function() {
53
+ return this[name];
54
+ };
55
+ set = function(v) {
56
+ this[name] = v;
57
+ };
58
+ }
59
+ } else if (kind === 2) {
60
+ get = function() {
61
+ return desc.value;
62
+ };
63
+ } else {
64
+ if (kind === 1 || kind === 3) {
65
+ get = function() {
66
+ return desc.get.call(this);
67
+ };
68
+ }
69
+ if (kind === 1 || kind === 4) {
70
+ set = function(v) {
71
+ desc.set.call(this, v);
72
+ };
73
+ }
74
+ }
75
+ ctx.access = get && set ? {
76
+ get: get,
77
+ set: set
78
+ } : get ? {
79
+ get: get
80
+ } : {
81
+ set: set
82
+ };
83
+ try {
84
+ return dec(value, ctx);
85
+ } finally{
86
+ decoratorFinishedRef.v = true;
87
+ }
88
+ }
89
+ function assertNotFinished(decoratorFinishedRef, fnName) {
90
+ if (decoratorFinishedRef.v) {
91
+ throw new Error("attempted to call " + fnName + " after decoration was finished");
92
+ }
93
+ }
94
+ function assertCallable(fn, hint) {
95
+ if (typeof fn !== "function") {
96
+ throw new TypeError(hint + " must be a function");
97
+ }
98
+ }
99
+ function assertValidReturnValue(kind, value) {
100
+ var type = typeof value;
101
+ if (kind === 1) {
102
+ if (type !== "object" || value === null) {
103
+ throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
104
+ }
105
+ if (value.get !== undefined) {
106
+ assertCallable(value.get, "accessor.get");
107
+ }
108
+ if (value.set !== undefined) {
109
+ assertCallable(value.set, "accessor.set");
110
+ }
111
+ if (value.init !== undefined) {
112
+ assertCallable(value.init, "accessor.init");
113
+ }
114
+ } else if (type !== "function") {
115
+ var hint;
116
+ if (kind === 0) {
117
+ hint = "field";
118
+ } else if (kind === 10) {
119
+ hint = "class";
120
+ } else {
121
+ hint = "method";
122
+ }
123
+ throw new TypeError(hint + " decorators must return a function or void 0");
124
+ }
125
+ }
126
+ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
127
+ var decs = decInfo[0];
128
+ var desc, init, value;
129
+ if (isPrivate) {
130
+ if (kind === 0 || kind === 1) {
131
+ desc = {
132
+ get: decInfo[3],
133
+ set: decInfo[4]
134
+ };
135
+ } else if (kind === 3) {
136
+ desc = {
137
+ get: decInfo[3]
138
+ };
139
+ } else if (kind === 4) {
140
+ desc = {
141
+ set: decInfo[3]
142
+ };
143
+ } else {
144
+ desc = {
145
+ value: decInfo[3]
146
+ };
147
+ }
148
+ } else if (kind !== 0) {
149
+ desc = Object.getOwnPropertyDescriptor(base, name);
150
+ }
151
+ if (kind === 1) {
152
+ value = {
153
+ get: desc.get,
154
+ set: desc.set
155
+ };
156
+ } else if (kind === 2) {
157
+ value = desc.value;
158
+ } else if (kind === 3) {
159
+ value = desc.get;
160
+ } else if (kind === 4) {
161
+ value = desc.set;
162
+ }
163
+ var newValue, get, set;
164
+ if (typeof decs === "function") {
165
+ newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
166
+ if (newValue !== void 0) {
167
+ assertValidReturnValue(kind, newValue);
168
+ if (kind === 0) {
169
+ init = newValue;
170
+ } else if (kind === 1) {
171
+ init = newValue.init;
172
+ get = newValue.get || value.get;
173
+ set = newValue.set || value.set;
174
+ value = {
175
+ get: get,
176
+ set: set
177
+ };
178
+ } else {
179
+ value = newValue;
180
+ }
181
+ }
182
+ } else {
183
+ for(var i = decs.length - 1; i >= 0; i--){
184
+ var dec = decs[i];
185
+ newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
186
+ if (newValue !== void 0) {
187
+ assertValidReturnValue(kind, newValue);
188
+ var newInit;
189
+ if (kind === 0) {
190
+ newInit = newValue;
191
+ } else if (kind === 1) {
192
+ newInit = newValue.init;
193
+ get = newValue.get || value.get;
194
+ set = newValue.set || value.set;
195
+ value = {
196
+ get: get,
197
+ set: set
198
+ };
199
+ } else {
200
+ value = newValue;
201
+ }
202
+ if (newInit !== void 0) {
203
+ if (init === void 0) {
204
+ init = newInit;
205
+ } else if (typeof init === "function") {
206
+ init = [
207
+ init,
208
+ newInit
209
+ ];
210
+ } else {
211
+ init.push(newInit);
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+ if (kind === 0 || kind === 1) {
218
+ if (init === void 0) {
219
+ init = function(instance, init) {
220
+ return init;
221
+ };
222
+ } else if (typeof init !== "function") {
223
+ var ownInitializers = init;
224
+ init = function(instance, init) {
225
+ var value = init;
226
+ for(var i = 0; i < ownInitializers.length; i++){
227
+ value = ownInitializers[i].call(instance, value);
228
+ }
229
+ return value;
230
+ };
231
+ } else {
232
+ var originalInitializer = init;
233
+ init = function(instance, init) {
234
+ return originalInitializer.call(instance, init);
235
+ };
236
+ }
237
+ ret.push(init);
238
+ }
239
+ if (kind !== 0) {
240
+ if (kind === 1) {
241
+ desc.get = value.get;
242
+ desc.set = value.set;
243
+ } else if (kind === 2) {
244
+ desc.value = value;
245
+ } else if (kind === 3) {
246
+ desc.get = value;
247
+ } else if (kind === 4) {
248
+ desc.set = value;
249
+ }
250
+ if (isPrivate) {
251
+ if (kind === 1) {
252
+ ret.push(function(instance, args) {
253
+ return value.get.call(instance, args);
254
+ });
255
+ ret.push(function(instance, args) {
256
+ return value.set.call(instance, args);
257
+ });
258
+ } else if (kind === 2) {
259
+ ret.push(value);
260
+ } else {
261
+ ret.push(function(instance, args) {
262
+ return value.call(instance, args);
263
+ });
264
+ }
265
+ } else {
266
+ Object.defineProperty(base, name, desc);
267
+ }
268
+ }
269
+ }
270
+ function applyMemberDecs(Class, decInfos, metadata) {
271
+ var ret = [];
272
+ var protoInitializers;
273
+ var staticInitializers;
274
+ var existingProtoNonFields = new Map();
275
+ var existingStaticNonFields = new Map();
276
+ for(var i = 0; i < decInfos.length; i++){
277
+ var decInfo = decInfos[i];
278
+ if (!Array.isArray(decInfo)) continue;
279
+ var kind = decInfo[1];
280
+ var name = decInfo[2];
281
+ var isPrivate = decInfo.length > 3;
282
+ var isStatic = kind >= 5;
283
+ var base;
284
+ var initializers;
285
+ if (isStatic) {
286
+ base = Class;
287
+ kind = kind - 5;
288
+ staticInitializers = staticInitializers || [];
289
+ initializers = staticInitializers;
290
+ } else {
291
+ base = Class.prototype;
292
+ protoInitializers = protoInitializers || [];
293
+ initializers = protoInitializers;
294
+ }
295
+ if (kind !== 0 && !isPrivate) {
296
+ var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
297
+ var existingKind = existingNonFields.get(name) || 0;
298
+ if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
299
+ throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
300
+ } else if (!existingKind && kind > 2) {
301
+ existingNonFields.set(name, kind);
302
+ } else {
303
+ existingNonFields.set(name, true);
304
+ }
305
+ }
306
+ applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
307
+ }
308
+ pushInitializers(ret, protoInitializers);
309
+ pushInitializers(ret, staticInitializers);
310
+ return ret;
311
+ }
312
+ function pushInitializers(ret, initializers) {
313
+ if (initializers) {
314
+ ret.push(function(instance) {
315
+ for(var i = 0; i < initializers.length; i++){
316
+ initializers[i].call(instance);
317
+ }
318
+ return instance;
319
+ });
320
+ }
321
+ }
322
+ function applyClassDecs(targetClass, classDecs, metadata) {
323
+ if (classDecs.length > 0) {
324
+ var initializers = [];
325
+ var newClass = targetClass;
326
+ var name = targetClass.name;
327
+ for(var i = classDecs.length - 1; i >= 0; i--){
328
+ var decoratorFinishedRef = {
329
+ v: false
330
+ };
331
+ try {
332
+ var nextNewClass = classDecs[i](newClass, {
333
+ kind: "class",
334
+ name: name,
335
+ addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
336
+ metadata
337
+ });
338
+ } finally{
339
+ decoratorFinishedRef.v = true;
340
+ }
341
+ if (nextNewClass !== undefined) {
342
+ assertValidReturnValue(10, nextNewClass);
343
+ newClass = nextNewClass;
344
+ }
345
+ }
346
+ return [
347
+ defineMetadata(newClass, metadata),
348
+ function() {
349
+ for(var i = 0; i < initializers.length; i++){
350
+ initializers[i].call(newClass);
351
+ }
352
+ }
353
+ ];
354
+ }
355
+ }
356
+ function defineMetadata(Class, metadata) {
357
+ return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
358
+ configurable: true,
359
+ enumerable: true,
360
+ value: metadata
361
+ });
362
+ }
363
+ return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
364
+ if (parentClass !== void 0) {
365
+ var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
366
+ }
367
+ var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
368
+ var e = applyMemberDecs(targetClass, memberDecs, metadata);
369
+ if (!classDecs.length) defineMetadata(targetClass, metadata);
370
+ return {
371
+ e: e,
372
+ get c () {
373
+ return applyClassDecs(targetClass, classDecs, metadata);
374
+ }
375
+ };
376
+ };
377
+ }
378
+ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
379
+ return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
380
+ }
381
+ function _identity(x) {
382
+ return x;
383
+ }
384
+ var _dec, _initClass, _FocusableMixin, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _init_href, _init_target, _init_rel, _init_download, _init_variant, _init_size, _init_underline, _init_disabled, _init_external, _init_ariaLabel, _initProto;
385
+ let _ViLink;
386
+ _dec = customElement('vi-link'), _dec1 = property({
387
+ type: String
388
+ }), _dec2 = property({
389
+ type: String
390
+ }), _dec3 = property({
391
+ type: String
392
+ }), _dec4 = property({
393
+ type: String
394
+ }), _dec5 = property({
395
+ type: String,
396
+ reflect: true
397
+ }), _dec6 = property({
398
+ type: String
399
+ }), _dec7 = property({
400
+ type: String
401
+ }), _dec8 = property({
402
+ type: Boolean,
403
+ reflect: true
404
+ }), _dec9 = property({
405
+ type: Boolean
406
+ }), _dec10 = property({
407
+ attribute: 'aria-label'
408
+ });
409
+ new class extends _identity {
410
+ constructor(){
411
+ super(_ViLink), _initClass();
412
+ }
413
+ static{
414
+ class ViLink extends (_FocusableMixin = FocusableMixin(ViElement)) {
415
+ static{
416
+ ({ e: [_init_href, _init_target, _init_rel, _init_download, _init_variant, _init_size, _init_underline, _init_disabled, _init_external, _init_ariaLabel, _initProto], c: [_ViLink, _initClass] } = _apply_decs_2203_r(this, [
417
+ [
418
+ _dec1,
419
+ 1,
420
+ "href"
421
+ ],
422
+ [
423
+ _dec2,
424
+ 1,
425
+ "target"
426
+ ],
427
+ [
428
+ _dec3,
429
+ 1,
430
+ "rel"
431
+ ],
432
+ [
433
+ _dec4,
434
+ 1,
435
+ "download"
436
+ ],
437
+ [
438
+ _dec5,
439
+ 1,
440
+ "variant"
441
+ ],
442
+ [
443
+ _dec6,
444
+ 1,
445
+ "size"
446
+ ],
447
+ [
448
+ _dec7,
449
+ 1,
450
+ "underline"
451
+ ],
452
+ [
453
+ _dec8,
454
+ 1,
455
+ "disabled"
456
+ ],
457
+ [
458
+ _dec9,
459
+ 1,
460
+ "external"
461
+ ],
462
+ [
463
+ _dec10,
464
+ 1,
465
+ "ariaLabel"
466
+ ]
467
+ ], [
468
+ _dec
469
+ ], _FocusableMixin));
470
+ }
471
+ static styles = css`
472
+ ${unsafeCSS(linkStyles)}
473
+ `;
474
+ #___private_href_1 = (_initProto(this), _init_href(this, ''));
475
+ get href() {
476
+ return this.#___private_href_1;
477
+ }
478
+ set href(_v) {
479
+ this.#___private_href_1 = _v;
480
+ }
481
+ #___private_target_2 = _init_target(this, '_self');
482
+ get target() {
483
+ return this.#___private_target_2;
484
+ }
485
+ set target(_v) {
486
+ this.#___private_target_2 = _v;
487
+ }
488
+ #___private_rel_3 = _init_rel(this, '');
489
+ get rel() {
490
+ return this.#___private_rel_3;
491
+ }
492
+ set rel(_v) {
493
+ this.#___private_rel_3 = _v;
494
+ }
495
+ #___private_download_4 = _init_download(this, '');
496
+ get download() {
497
+ return this.#___private_download_4;
498
+ }
499
+ set download(_v) {
500
+ this.#___private_download_4 = _v;
501
+ }
502
+ #___private_variant_5 = _init_variant(this, 'primary');
503
+ get variant() {
504
+ return this.#___private_variant_5;
505
+ }
506
+ set variant(_v) {
507
+ this.#___private_variant_5 = _v;
508
+ }
509
+ #___private_size_6 = _init_size(this, 'inherit');
510
+ get size() {
511
+ return this.#___private_size_6;
512
+ }
513
+ set size(_v) {
514
+ this.#___private_size_6 = _v;
515
+ }
516
+ #___private_underline_7 = _init_underline(this, 'hover');
517
+ get underline() {
518
+ return this.#___private_underline_7;
519
+ }
520
+ set underline(_v) {
521
+ this.#___private_underline_7 = _v;
522
+ }
523
+ #___private_disabled_8 = _init_disabled(this, false);
524
+ get disabled() {
525
+ return this.#___private_disabled_8;
526
+ }
527
+ set disabled(_v) {
528
+ this.#___private_disabled_8 = _v;
529
+ }
530
+ #___private_external_9 = _init_external(this, false);
531
+ get external() {
532
+ return this.#___private_external_9;
533
+ }
534
+ set external(_v) {
535
+ this.#___private_external_9 = _v;
536
+ }
537
+ get _focusableElement() {
538
+ return this.shadowRoot?.querySelector('a');
539
+ }
540
+ get _effectiveTarget() {
541
+ return this.external ? '_blank' : this.target;
542
+ }
543
+ get _effectiveRel() {
544
+ const isExternal = this.external || this.target === '_blank';
545
+ if (!isExternal) {
546
+ return this.rel || nothing;
547
+ }
548
+ const rels = new Set((this.rel || '').split(' ').filter(Boolean));
549
+ rels.add('noopener');
550
+ rels.add('noreferrer');
551
+ return Array.from(rels).join(' ');
552
+ }
553
+ #___private_ariaLabel_10 = _init_ariaLabel(this, null);
554
+ get ariaLabel() {
555
+ return this.#___private_ariaLabel_10;
556
+ }
557
+ set ariaLabel(_v) {
558
+ this.#___private_ariaLabel_10 = _v;
559
+ }
560
+ render() {
561
+ const effectiveTarget = this._effectiveTarget;
562
+ const effectiveRel = this._effectiveRel;
563
+ const ariaDisabled = this.disabled ? 'true' : null;
564
+ const href = this.disabled || !this.href ? nothing : this.href;
565
+ const ariaLabel = this.ariaLabel ?? nothing;
566
+ return html`
567
+ <a
568
+ part="link"
569
+ class="link ${this.disabled ? 'disabled' : ''} variant-${this.variant} size-${this.size} underline-${this.underline}"
570
+ href=${href}
571
+ target=${effectiveTarget}
572
+ rel=${effectiveRel}
573
+ download=${this.download || nothing}
574
+ aria-disabled=${ariaDisabled}
575
+ aria-label=${ariaLabel}
576
+ tabindex=${this.disabled ? '-1' : '0'}
577
+ >
578
+ <slot name="icon" part="icon"></slot>
579
+ <slot></slot>
580
+ ${this.external ? html`<span part="external-icon">
581
+ <vi-icon name="external-link" size="14"></vi-icon>
582
+ <span class="sr-only">(opens in new tab)</span>
583
+ </span>` : nothing}
584
+ `;
585
+ }
586
+ }
587
+ }
588
+ }();
589
+
590
+ export { _ViLink as ViLink };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vialiq/web-components",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -119,11 +119,19 @@
119
119
  "./label/vi-label": {
120
120
  "types": "./label/vi-label.d.ts",
121
121
  "default": "./label/vi-label.js"
122
+ },
123
+ "./link": {
124
+ "types": "./link/index.d.ts",
125
+ "default": "./link/index.js"
126
+ },
127
+ "./link/vi-link": {
128
+ "types": "./link/vi-link.d.ts",
129
+ "default": "./link/vi-link.js"
122
130
  }
123
131
  },
124
132
  "peerDependencies": {
125
133
  "@floating-ui/dom": ">=1.0.0",
126
- "@vialiq/flux-ui": ">=0.0.4 <0.1.0",
134
+ "@vialiq/flux-ui": "^0.19.0",
127
135
  "@vialiq/icons": ">=0.0.3 <0.1.0",
128
136
  "flatpickr": ">=4.6.0",
129
137
  "lit": "^3.0.0"
@@ -149,6 +157,7 @@
149
157
  "badge/",
150
158
  "date-picker/",
151
159
  "label/",
160
+ "link/",
152
161
  "README.md"
153
162
  ],
154
163
  "peerDependenciesMeta": {