@warp-ds/elements 2.8.2-next.5 → 2.9.0-next.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.
- package/dist/custom-elements.json +79 -6
- package/dist/index.d.ts +28 -6
- package/dist/packages/attention/attention.js +506 -233
- package/dist/packages/attention/attention.js.map +4 -4
- package/dist/packages/button/button.d.ts +8 -17
- package/dist/packages/button/button.js +494 -221
- package/dist/packages/button/button.js.map +4 -4
- package/dist/packages/button/button.react.stories.d.ts +1 -1
- package/dist/packages/button/styles/w-button.styles.d.ts +1 -0
- package/dist/packages/button/styles/w-button.styles.js +282 -0
- package/dist/packages/combobox/combobox.hydration.test.js +57 -0
- package/dist/packages/combobox/combobox.js +25 -11
- package/dist/packages/combobox/combobox.js.map +2 -2
- package/dist/packages/datepicker/datepicker.js +8 -15
- package/dist/packages/datepicker/datepicker.js.map +2 -2
- package/dist/packages/datepicker/styles/w-datepicker.styles.js +3 -9
- package/dist/packages/link/link.js +197 -217
- package/dist/packages/link/link.js.map +4 -4
- package/dist/packages/link/link.test.js +0 -14
- package/dist/packages/link/styles/w-link.styles.js +213 -0
- package/dist/packages/slider/slider.js +18 -17
- package/dist/packages/slider/slider.js.map +3 -3
- package/dist/packages/slider/slider.react.stories.js +6 -2
- package/dist/packages/slider/slider.stories.js +18 -12
- package/dist/packages/slider-thumb/slider-thumb.js +12 -12
- package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
- package/dist/web-types.json +27 -11
- package/package.json +1 -1
- package/dist/packages/link/styles.js +0 -236
- /package/dist/packages/link/{styles.d.ts → styles/w-link.styles.d.ts} +0 -0
|
@@ -57,21 +57,15 @@ export const wDatepickerStyles = css `
|
|
|
57
57
|
|
|
58
58
|
/* custom calendar button */
|
|
59
59
|
.w-datepicker-button {
|
|
60
|
+
--padding-x: 14px;
|
|
61
|
+
--padding-y: 14px;
|
|
62
|
+
--border-radius: 2px; /* override to better fit inside the input field */
|
|
60
63
|
position: absolute;
|
|
61
64
|
right: 2px;
|
|
62
65
|
top: 2px;
|
|
63
|
-
height: 44px;
|
|
64
|
-
width: 44px !important;
|
|
65
|
-
border-radius: 2px !important;
|
|
66
|
-
border: none;
|
|
67
|
-
cursor: pointer;
|
|
68
66
|
pointer-events: auto; /* override parent’s none */
|
|
69
67
|
}
|
|
70
68
|
|
|
71
|
-
.w-datepicker-button:not(:hover) {
|
|
72
|
-
background-color: var(--w-s-color-background) !important;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
69
|
input[type='date']::-webkit-inner-spin-button,
|
|
76
70
|
input[type='date']::-webkit-calendar-picker-indicator {
|
|
77
71
|
display: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var e=(n,a,d,i)=>{for(var t=i>1?void 0:i?u(a,d):a,c=n.length-1,l;c>=0;c--)(l=n[c])&&(t=(i?l(a,d,t):l(t))||t);return i&&t&&h(a,d,t),t};import{html as m,LitElement as g,nothing as f}from"lit";import{property as o}from"lit/decorators.js";import{css as s}from"lit";var b=s`
|
|
2
2
|
*,
|
|
3
3
|
:before,
|
|
4
4
|
:after {
|
|
@@ -2437,246 +2437,226 @@ var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var o=(d,n,r,i
|
|
|
2437
2437
|
display: none
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
`;import{css as w}from"lit";var v=w
|
|
2441
|
-
|
|
2442
|
-
|
|
2440
|
+
`;import{css as w}from"lit";var v=w`
|
|
2441
|
+
/* If not a link variant this should look like a button */
|
|
2442
|
+
:host(:not([variant="link"])) {
|
|
2443
2443
|
--_background: var(--background, var(--w-s-color-background));
|
|
2444
|
-
--_background-hover: var(
|
|
2445
|
-
|
|
2444
|
+
--_background-hover: var(
|
|
2445
|
+
--background-hover,
|
|
2446
|
+
var(--w-s-color-background-hover)
|
|
2447
|
+
);
|
|
2448
|
+
--_background-active: var(
|
|
2449
|
+
--background-active,
|
|
2450
|
+
var(--w-s-color-background-active)
|
|
2451
|
+
);
|
|
2446
2452
|
--_text-color: var(--color, var(--w-s-color-text-link));
|
|
2453
|
+
--_text-color-hover: var(--color-hover, var(--w-s-color-text-link));
|
|
2454
|
+
--_text-color-active: var(--color-active, var(--w-s-color-text-link));
|
|
2447
2455
|
--_border-width: var(--border-width, 2px);
|
|
2448
2456
|
--_border: var(--border, var(--w-s-color-border));
|
|
2449
2457
|
--_border-hover: var(--border-hover, var(--w-s-color-border-hover));
|
|
2450
2458
|
--_border-active: var(--border-active, var(--w-s-color-border-active));
|
|
2451
|
-
--_border-radius: var(--w-button-radius-default, 8px);
|
|
2459
|
+
--_border-radius: var(--border-radius, var(--w-button-radius-default, 8px));
|
|
2452
2460
|
--_font-size: var(--font-size, var(--w-font-size-m));
|
|
2453
2461
|
--_line-height: var(--line-height, var(--w-line-height-m));
|
|
2454
2462
|
--_font-weight: var(--font-weight, bold);
|
|
2455
2463
|
--_padding-x: var(--padding-x, 16px);
|
|
2456
2464
|
--_padding-y: var(--padding-y, 13px);
|
|
2465
|
+
}
|
|
2457
2466
|
|
|
2458
|
-
|
|
2467
|
+
:host(:not([variant="link"])) a {
|
|
2459
2468
|
display: inline-flex;
|
|
2460
2469
|
justify-content: center;
|
|
2461
2470
|
align-items: center;
|
|
2462
2471
|
text-align: center;
|
|
2472
|
+
text-decoration: none;
|
|
2463
2473
|
cursor: pointer;
|
|
2464
2474
|
transition:
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2475
|
+
color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
2476
|
+
background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
2477
|
+
border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
2478
|
+
fill 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
2479
|
+
stroke 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
2470
2480
|
|
|
2471
|
-
/* Hook the local vars up to the button stuff */
|
|
2472
2481
|
background-color: var(--_background);
|
|
2473
2482
|
color: var(--_text-color);
|
|
2474
2483
|
border: var(--_border-width) solid var(--_border);
|
|
2475
2484
|
border-radius: var(--_border-radius);
|
|
2476
|
-
padding: calc(var(--_padding-y) - var(--_border-width))
|
|
2485
|
+
padding: calc(var(--_padding-y) - var(--_border-width))
|
|
2486
|
+
calc(var(--_padding-x) - var(--_border-width));
|
|
2477
2487
|
font-size: var(--_font-size);
|
|
2478
2488
|
line-height: var(--_line-height);
|
|
2479
2489
|
font-weight: var(--_font-weight);
|
|
2480
|
-
}
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
.w-button--loading {
|
|
2653
|
-
background-image: linear-gradient(
|
|
2654
|
-
135deg,
|
|
2655
|
-
rgba(0, 0, 0, 0.05) 25%,
|
|
2656
|
-
transparent 25%,
|
|
2657
|
-
transparent 50%,
|
|
2658
|
-
rgba(0, 0, 0, 0.05) 50%,
|
|
2659
|
-
rgba(0, 0, 0, 0.05) 75%,
|
|
2660
|
-
transparent 75%,
|
|
2661
|
-
transparent
|
|
2662
|
-
);
|
|
2663
|
-
background-size: 30px 30px;
|
|
2664
|
-
animation: animate-inprogress 3s linear infinite;
|
|
2665
|
-
}
|
|
2666
|
-
|
|
2667
|
-
@keyframes animate-inprogress {
|
|
2668
|
-
0% {
|
|
2669
|
-
background-position: 0 0;
|
|
2670
|
-
}
|
|
2671
|
-
100% {
|
|
2672
|
-
background-position: 60px 0;
|
|
2673
|
-
}
|
|
2674
|
-
}`;var p=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","quiet","link","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],e=class extends g{constructor(){super(...arguments);this.autofocus=!1;this.small=!1;this.disabled=!1;this.fullWidth=!1}connectedCallback(){if(super.connectedCallback(),this.variant&&!p.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2675
|
-
${p.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){let r=this.variant||"secondary",i={"w-button":r!=="link","w-button--primary":r==="primary","w-button--secondary":r==="secondary"||!this.variant,"w-button--negative":r==="negative","w-button--utility":r==="utility","w-button--quiet":r==="quiet","w-button--negative-quiet":r==="negativeQuiet","w-button--utility-quiet":r==="utilityQuiet","w-button--overlay":r==="overlay","w-button--overlay-inverted":r==="overlayInverted","w-button--overlay-quiet":r==="overlayQuiet","w-button--overlay-inverted-quiet":r==="overlayInvertedQuiet","w-button--small":this.small,"w-button--full-width":this.fullWidth,"w-button--disabled":this.disabled};return m`<a
|
|
2676
|
-
href=${this.href}
|
|
2677
|
-
target=${this.target}
|
|
2678
|
-
rel=${this.target==="_blank"?this.rel||"noopener":void 0}
|
|
2679
|
-
class=${f(i)}>
|
|
2680
|
-
<slot></slot>
|
|
2681
|
-
</a>`}};e.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0},e.styles=[b,v],o([t({type:Boolean,reflect:!0})],e.prototype,"autofocus",2),o([t({reflect:!0})],e.prototype,"variant",2),o([t({type:Boolean,reflect:!0})],e.prototype,"small",2),o([t({reflect:!0})],e.prototype,"href",2),o([t({type:Boolean,reflect:!0})],e.prototype,"disabled",2),o([t({reflect:!0})],e.prototype,"target",2),o([t({reflect:!0})],e.prototype,"rel",2),o([t({attribute:"full-width",type:Boolean,reflect:!0})],e.prototype,"fullWidth",2);customElements.get("w-link")||customElements.define("w-link",e);export{e as WarpLink};
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
:host(:not([variant="link"])) a:hover {
|
|
2493
|
+
background-color: var(--_background-hover);
|
|
2494
|
+
border-color: var(--_border-hover);
|
|
2495
|
+
color: var(--_text-color-hover);
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
:host(:not([variant="link"])) a:active {
|
|
2499
|
+
background-color: var(--_background-active);
|
|
2500
|
+
border-color: var(--_border-active);
|
|
2501
|
+
color: var(--_text-color-active);
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
:host(:not([variant="link"])) a:focus-visible {
|
|
2505
|
+
outline: 2px solid var(--w-s-color-border-focus);
|
|
2506
|
+
outline-offset: var(--w-outline-offset, 1px);
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
/* Variants config */
|
|
2510
|
+
:host([variant="primary"]) {
|
|
2511
|
+
--background: var(--w-s-color-background-primary);
|
|
2512
|
+
--background-hover: var(--w-s-color-background-primary-hover);
|
|
2513
|
+
--background-active: var(--w-s-color-background-primary-active);
|
|
2514
|
+
--color: var(--w-s-color-text-inverted);
|
|
2515
|
+
--color-hover: var(--w-s-color-text-inverted);
|
|
2516
|
+
--color-active: var(--w-s-color-text-inverted);
|
|
2517
|
+
--border-width: 0px;
|
|
2518
|
+
}
|
|
2519
|
+
:host([variant="quiet"]),
|
|
2520
|
+
:host([quiet]) /* deprecated, backwards compatibility, use variant="quiet" */ {
|
|
2521
|
+
--background: transparent;
|
|
2522
|
+
--color: var(--w-s-color-text-link);
|
|
2523
|
+
--color-hover: var(--w-s-color-text-link-hover);
|
|
2524
|
+
--color-active: var(--w-s-color-text-link-active);
|
|
2525
|
+
--border-width: 0px;
|
|
2526
|
+
}
|
|
2527
|
+
:host([variant="negative"]) {
|
|
2528
|
+
--background: var(--w-s-color-background-negative);
|
|
2529
|
+
--background-hover: var(--w-s-color-background-negative-hover);
|
|
2530
|
+
--background-active: var(--w-s-color-background-negative-active);
|
|
2531
|
+
--color: var(--w-s-color-text-inverted);
|
|
2532
|
+
--color-hover: var(--w-s-color-text-inverted);
|
|
2533
|
+
--color-active: var(--w-s-color-text-inverted);
|
|
2534
|
+
--border-width: 0px;
|
|
2535
|
+
}
|
|
2536
|
+
:host([variant="negativeQuiet"]),
|
|
2537
|
+
:host([quiet][variant="negative"]) /* deprecated, backwards compatibility */ {
|
|
2538
|
+
--background: transparent;
|
|
2539
|
+
--background-hover: var(--w-s-color-background-negative-subtle-hover);
|
|
2540
|
+
--background-active: var(--w-s-color-background-negative-subtle-active);
|
|
2541
|
+
--color: var(--w-s-color-text-negative);
|
|
2542
|
+
--color-hover: var(--w-s-color-text-negative);
|
|
2543
|
+
--color-active: var(--w-s-color-text-negative);
|
|
2544
|
+
--border-width: 0px;
|
|
2545
|
+
}
|
|
2546
|
+
:host([variant="utility"]) {
|
|
2547
|
+
--background: var(--w-s-color-background);
|
|
2548
|
+
--background-hover: var(--w-s-color-background-hover);
|
|
2549
|
+
--background-active: var(--w-s-color-background-active);
|
|
2550
|
+
--color: var(--w-s-color-text);
|
|
2551
|
+
--color-hover: var(--w-s-color-text);
|
|
2552
|
+
--color-active: var(--w-s-color-text);
|
|
2553
|
+
--border-radius: var(--w-button-radius-utility, 4px);
|
|
2554
|
+
--border-width: 1px;
|
|
2555
|
+
}
|
|
2556
|
+
:host([variant="utilityQuiet"]),
|
|
2557
|
+
:host([quiet][variant="utility"]) /* deprecated, backwards compatibility */ {
|
|
2558
|
+
--background: transparent;
|
|
2559
|
+
--color: var(--w-s-color-text);
|
|
2560
|
+
--color-hover: var(--w-s-color-text);
|
|
2561
|
+
--color-active: var(--w-s-color-text);
|
|
2562
|
+
--border-width: 0px;
|
|
2563
|
+
}
|
|
2564
|
+
:host([variant="overlay"]) {
|
|
2565
|
+
--background: var(--w-color-background);
|
|
2566
|
+
--background-hover: var(--w-color-background-hover);
|
|
2567
|
+
--background-active: var(--w-color-background-active);
|
|
2568
|
+
--color: var(--w-s-color-text);
|
|
2569
|
+
--color-hover: var(--w-s-color-text);
|
|
2570
|
+
--color-active: var(--w-s-color-text);
|
|
2571
|
+
--border-radius: 9999px;
|
|
2572
|
+
--border-width: 0px;
|
|
2573
|
+
}
|
|
2574
|
+
:host([variant="overlayQuiet"]),
|
|
2575
|
+
:host([quiet][variant="overlay"]) /* deprecated, backwards compatibility */ {
|
|
2576
|
+
--background: transparent;
|
|
2577
|
+
--background-hover: var(--w-s-color-background-hover);
|
|
2578
|
+
--background-active: var(--w-s-color-background-active);
|
|
2579
|
+
--color: var(--w-s-color-text);
|
|
2580
|
+
--color-hover: var(--w-s-color-text);
|
|
2581
|
+
--color-active: var(--w-s-color-text);
|
|
2582
|
+
--border-radius: 9999px;
|
|
2583
|
+
--border-width: 0px;
|
|
2584
|
+
}
|
|
2585
|
+
:host([variant="overlayInverted"]) {
|
|
2586
|
+
--background: var(--w-s-color-background-inverted);
|
|
2587
|
+
--background-hover: var(--w-s-color-background-inverted-hover);
|
|
2588
|
+
--background-active: var(--w-s-color-background-inverted-active);
|
|
2589
|
+
--color: var(--w-s-color-text-inverted);
|
|
2590
|
+
--color-hover: var(--w-s-color-text-inverted);
|
|
2591
|
+
--color-active: var(--w-s-color-text-inverted);
|
|
2592
|
+
--border-radius: 9999px;
|
|
2593
|
+
--border-width: 0px;
|
|
2594
|
+
}
|
|
2595
|
+
:host([variant="overlayInvertedQuiet"]),
|
|
2596
|
+
:host([quiet][variant="overlayInverted"]) /* deprecated, backwards compatibility */ {
|
|
2597
|
+
--background: transparent;
|
|
2598
|
+
--background-hover: var(--w-s-color-background-inverted-hover);
|
|
2599
|
+
--background-active: var(--w-s-color-background-inverted-active);
|
|
2600
|
+
--color: var(--w-s-color-text-inverted);
|
|
2601
|
+
--color-hover: var(--w-s-color-text-inverted);
|
|
2602
|
+
--color-active: var(--w-s-color-text-inverted);
|
|
2603
|
+
--border-radius: 9999px;
|
|
2604
|
+
--border-width: 0px;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
:host([variant="link"]) {
|
|
2608
|
+
--background: none;
|
|
2609
|
+
--background-hover: none;
|
|
2610
|
+
--background-active: none;
|
|
2611
|
+
--border-width: 0px;
|
|
2612
|
+
--font-weight: normal;
|
|
2613
|
+
display: inline;
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
/* States config, selects --loading as well since loading is always supposed to be disabled */
|
|
2617
|
+
:host(:disabled),
|
|
2618
|
+
:host([disabled]) {
|
|
2619
|
+
--background: var(--w-s-color-background-disabled);
|
|
2620
|
+
--background-hover: var(--w-s-color-background-disabled);
|
|
2621
|
+
--background-active: var(--w-s-color-background-disabled);
|
|
2622
|
+
--color: var(--w-s-color-text-inverted);
|
|
2623
|
+
--color-hover: var(--w-s-color-text-inverted);
|
|
2624
|
+
--color-active: var(--w-s-color-text-inverted);
|
|
2625
|
+
--border-width: 0px;
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
:host(:disabled) a,
|
|
2629
|
+
:host([disabled]) a {
|
|
2630
|
+
cursor: not-allowed;
|
|
2631
|
+
pointer-events: none;
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
:host([variant="link"]):hover a {
|
|
2635
|
+
text-decoration: underline;
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
/* Sizes config */
|
|
2639
|
+
:host([small]) {
|
|
2640
|
+
--padding-x: 12px;
|
|
2641
|
+
--padding-y: 8px;
|
|
2642
|
+
--font-size: var(--w-font-size-xs);
|
|
2643
|
+
--line-height: var(--w-line-height-xs);
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
/* Width config */
|
|
2647
|
+
:host([full-width]) a {
|
|
2648
|
+
width: 100%;
|
|
2649
|
+
max-width: 100%;
|
|
2650
|
+
}
|
|
2651
|
+
`;var p=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","quiet","link","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],r=class extends g{constructor(){super(...arguments);this.autofocus=!1;this.small=!1;this.disabled=!1;this.fullWidth=!1}connectedCallback(){if(super.connectedCallback(),this.variant&&!p.includes(this.variant))throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
2652
|
+
${p.join(", ")}.`)}firstUpdated(){this.autofocus&&setTimeout(()=>this.focus(),0)}render(){return m`
|
|
2653
|
+
<a
|
|
2654
|
+
href="${this.href}"
|
|
2655
|
+
target="${this.target}"
|
|
2656
|
+
rel="${this.target==="_blank"?this.rel||"noopener":f}"
|
|
2657
|
+
tabindex="0"
|
|
2658
|
+
>
|
|
2659
|
+
<slot></slot>
|
|
2660
|
+
</a>
|
|
2661
|
+
`}};r.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0},r.styles=[b,v],e([o({type:Boolean,reflect:!0})],r.prototype,"autofocus",2),e([o({reflect:!0})],r.prototype,"variant",2),e([o({type:Boolean,reflect:!0})],r.prototype,"small",2),e([o({reflect:!0})],r.prototype,"href",2),e([o({type:Boolean,reflect:!0})],r.prototype,"disabled",2),e([o({reflect:!0})],r.prototype,"target",2),e([o({reflect:!0})],r.prototype,"rel",2),e([o({attribute:"full-width",type:Boolean,reflect:!0})],r.prototype,"fullWidth",2);customElements.get("w-link")||customElements.define("w-link",r);export{r as WarpLink};
|
|
2682
2662
|
//# sourceMappingURL=link.js.map
|