@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.
Files changed (30) hide show
  1. package/dist/custom-elements.json +79 -6
  2. package/dist/index.d.ts +28 -6
  3. package/dist/packages/attention/attention.js +506 -233
  4. package/dist/packages/attention/attention.js.map +4 -4
  5. package/dist/packages/button/button.d.ts +8 -17
  6. package/dist/packages/button/button.js +494 -221
  7. package/dist/packages/button/button.js.map +4 -4
  8. package/dist/packages/button/button.react.stories.d.ts +1 -1
  9. package/dist/packages/button/styles/w-button.styles.d.ts +1 -0
  10. package/dist/packages/button/styles/w-button.styles.js +282 -0
  11. package/dist/packages/combobox/combobox.hydration.test.js +57 -0
  12. package/dist/packages/combobox/combobox.js +25 -11
  13. package/dist/packages/combobox/combobox.js.map +2 -2
  14. package/dist/packages/datepicker/datepicker.js +8 -15
  15. package/dist/packages/datepicker/datepicker.js.map +2 -2
  16. package/dist/packages/datepicker/styles/w-datepicker.styles.js +3 -9
  17. package/dist/packages/link/link.js +197 -217
  18. package/dist/packages/link/link.js.map +4 -4
  19. package/dist/packages/link/link.test.js +0 -14
  20. package/dist/packages/link/styles/w-link.styles.js +213 -0
  21. package/dist/packages/slider/slider.js +18 -17
  22. package/dist/packages/slider/slider.js.map +3 -3
  23. package/dist/packages/slider/slider.react.stories.js +6 -2
  24. package/dist/packages/slider/slider.stories.js +18 -12
  25. package/dist/packages/slider-thumb/slider-thumb.js +12 -12
  26. package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
  27. package/dist/web-types.json +27 -11
  28. package/package.json +1 -1
  29. package/dist/packages/link/styles.js +0 -236
  30. /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 u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var o=(d,n,r,i)=>{for(var a=i>1?void 0:i?h(n,r):n,c=d.length-1,l;c>=0;c--)(l=d[c])&&(a=(i?l(n,r,a):l(a))||a);return i&&a&&u(n,r,a),a};import{html as m,LitElement as g}from"lit";import{property as t}from"lit/decorators.js";import{classMap as f}from"lit/directives/class-map.js";import{css as s}from"lit";var b=s`
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`.w-button,
2441
- .w-button--secondary {
2442
- /* Local scoped variables, given the default button (the secondary variant) as a default */
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(--background-hover, var(--w-s-color-background-hover));
2445
- --_background-active: var(--background-active, var(--w-s-color-background-active));
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
- /* Base setup for all buttons */
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
- color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2466
- background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2467
- border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
2468
- fill 150ms cubic-bezier(0.4, 0, 0.2, 1),
2469
- stroke 150ms cubic-bezier(0.4, 0, 0.2, 1);
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)) calc(var(--_padding-x) - 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
- .w-button:hover {
2483
- background-color: var(--_background-hover);
2484
- border-color: var(--_border-hover);
2485
- }
2486
-
2487
- .w-button:active {
2488
- background-color: var(--_background-active);
2489
- border-color: var(--_border-active);
2490
- }
2491
-
2492
- .w-button:focus-visible {
2493
- outline: 2px solid var(--w-s-color-border-focus);
2494
- outline-offset: var(--w-outline-offset, 1px);
2495
- }
2496
-
2497
- /* Variants config */
2498
- .w-button--primary {
2499
- --background: var(--w-color-button-primary-background);
2500
- --background-hover: var(--w-color-button-primary-background-hover);
2501
- --background-active: var(--w-color-button-primary-background-active);
2502
- --color: var(--w-s-color-text-inverted);
2503
- --border-width: 0px;
2504
- }
2505
- .w-button--negative {
2506
- --background: var(--w-s-color-background-negative);
2507
- --background-hover: var(--w-s-color-background-negative-hover);
2508
- --background-active: var(--w-s-color-background-negative-active);
2509
- --color: var(--w-s-color-text-inverted);
2510
- --border-width: 0px;
2511
- }
2512
- .w-button--negative-quiet {
2513
- --background: transparent;
2514
- --background-hover: var(--w-s-color-background-negative-subtle-hover);
2515
- --background-active: var(--w-s-color-background-negative-subtle-active);
2516
- --color: var(--w-s-color-text-negative);
2517
- --border-width: 0px;
2518
- }
2519
- .w-button--utility {
2520
- --background: var(--w-s-color-background);
2521
- --background-hover: var(--w-s-color-background-hover);
2522
- --background-active: var(--w-s-color-background-active);
2523
- --color: var(--w-s-color-text);
2524
- --border-radius: var(--w-button-radius-utility, 4px);
2525
- --border-width: 1px;
2526
- }
2527
- .w-button--utility-quiet {
2528
- --background: transparent;
2529
- --color: var(--w-s-color-text);
2530
- --border-width: 0px;
2531
- }
2532
- .w-button--quiet {
2533
- --background: transparent;
2534
- --border-width: 0px;
2535
- }
2536
- .w-button--overlay {
2537
- --background: var(--w-color-background);
2538
- --background-hover: var(--w-color-background-hover);
2539
- --background-active: var(--w-color-background-active);
2540
- --color: var(--w-s-color-text);
2541
- --border-radius: 9999px;
2542
- --border-width: 0px;
2543
- }
2544
- .w-button--overlay-quiet {
2545
- --background: transparent;
2546
- --background-hover: var(--w-s-color-background-hover);
2547
- --background-active: var(--w-s-color-background-active);
2548
- --color: var(--w-s-color-text);
2549
- --border-radius: 9999px;
2550
- --border-width: 0px;
2551
- }
2552
- .w-button--overlay-inverted {
2553
- --background: var(--w-s-color-background-inverted);
2554
- --background-hover: var(--w-s-color-background-inverted-hover);
2555
- --background-active: var(--w-s-color-background-inverted-active);
2556
- --color: var(--w-s-color-text-inverted);
2557
- --border-radius: 9999px;
2558
- --border-width: 0px;
2559
- }
2560
- .w-button--overlay-inverted-quiet {
2561
- --background: transparent;
2562
- --background-hover: var(--w-s-color-background-inverted-hover);
2563
- --background-active: var(--w-s-color-background-inverted-active);
2564
- --color: var(--w-s-color-text-inverted);
2565
- --border-radius: 9999px;
2566
- --border-width: 0px;
2567
- }
2568
-
2569
- .w-button--link {
2570
- --background: none;
2571
- --background-hover: none;
2572
- --background-active: none;
2573
- --border-width: 0;
2574
- --font-weight: normal;
2575
- display: inline;
2576
- }
2577
- .w-button--overlay {
2578
- --background: var(--w-color-background);
2579
- --background-hover: var(--w-color-background-hover);
2580
- --background-active: var(--w-color-background-active);
2581
- --color: var(--w-s-color-text);
2582
- --border-radius: 9999px;
2583
- --border-width: 0px;
2584
- }
2585
- .w-button--overlay-quiet {
2586
- --background: transparent;
2587
- --background-hover: var(--w-s-color-background-hover);
2588
- --background-active: var(--w-s-color-background-active);
2589
- --color: var(--w-s-color-text);
2590
- --border-radius: 9999px;
2591
- --border-width: 0px;
2592
- }
2593
- .w-button--overlay-inverted {
2594
- --background: var(--w-s-color-background-inverted);
2595
- --background-hover: var(--w-s-color-background-inverted-hover);
2596
- --background-active: var(--w-s-color-background-inverted-active);
2597
- --color: var(--w-s-color-text-inverted);
2598
- --border-radius: 9999px;
2599
- --border-width: 0px;
2600
- }
2601
- .w-button--overlay-inverted-quiet {
2602
- --background: transparent;
2603
- --background-hover: var(--w-s-color-background-inverted-hover);
2604
- --background-active: var(--w-s-color-background-inverted-active);
2605
- --color: var(--w-s-color-text-inverted);
2606
- --border-radius: 9999px;
2607
- --border-width: 0px;
2608
- }
2609
-
2610
- /* States config, selects --loading as well since loading is always supposed to be disabled */
2611
- .w-button:disabled,
2612
- .w-button--disabled,
2613
- .w-button--loading {
2614
- --background: var(--w-s-color-background-disabled);
2615
- --background-hover: var(--w-s-color-background-disabled);
2616
- --background-active: var(--w-s-color-background-disabled);
2617
- --color: var(--w-s-color-text-inverted);
2618
- --border-width: 0px;
2619
- pointer-events: none;
2620
- }
2621
-
2622
- .w-button--link:hover {
2623
- text-decoration: underline;
2624
- }
2625
-
2626
- /* Sizes config */
2627
- .w-button--small {
2628
- --padding-x: 12px;
2629
- --padding-y: 8px;
2630
- --font-size: var(--w-font-size-xs);
2631
- --line-height: var(--w-line-height-xs);
2632
- }
2633
-
2634
- /* Width config */
2635
- .w-button--full-width {
2636
- width: 100%;
2637
- max-width: 100%;
2638
- }
2639
-
2640
- .w-button--has-icon-only {
2641
- width: auto;
2642
- max-width: none;
2643
- --_padding-x: var(--_padding-y);
2644
- aspect-ratio: 1 / 1;
2645
- }
2646
-
2647
- a.w-button {
2648
- text-decoration: none !important;
2649
- }
2650
-
2651
- /* Copy of loading animation from warp */
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