@warp-ds/elements 2.3.0-next.29 → 2.3.0-next.30
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 +4 -65
- package/dist/index.d.ts +0 -14
- package/dist/packages/attention/index.js +56 -20
- package/dist/packages/attention/index.js.map +3 -3
- package/dist/packages/button/button.react.stories.d.ts +1 -1
- package/dist/packages/button/index.js +46 -10
- package/dist/packages/button/index.js.map +3 -3
- package/dist/packages/link/index.d.ts +2 -8
- package/dist/packages/link/index.js +43 -7
- package/dist/packages/link/index.js.map +4 -4
- package/dist/packages/link/link.react.stories.d.ts +6 -3
- package/dist/packages/link/link.react.stories.js +27 -10
- package/dist/packages/link/link.stories.d.ts +5 -2
- package/dist/packages/link/link.stories.js +27 -10
- package/dist/packages/link/styles.js +36 -0
- package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
- package/dist/web-types.json +7 -14
- package/package.json +1 -1
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
type ButtonVariant = 'primary' | 'secondary' | 'negative' | 'negativeQuiet' | 'utility' | '
|
|
3
|
-
declare const WarpLink_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
|
|
2
|
+
type ButtonVariant = 'primary' | 'secondary' | 'negative' | 'negativeQuiet' | 'utility' | 'link' | 'quiet' | 'utilityQuiet' | 'overlay' | 'overlayInverted' | 'overlayQuiet' | 'overlayInvertedQuiet';
|
|
4
3
|
/**
|
|
5
4
|
* Buttons are used to perform actions, with different visuals for different needs.
|
|
6
5
|
*
|
|
7
6
|
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/buttons-link--docs)
|
|
8
7
|
*/
|
|
9
|
-
declare class WarpLink extends
|
|
8
|
+
declare class WarpLink extends LitElement {
|
|
10
9
|
static shadowRootOptions: {
|
|
11
10
|
delegatesFocus: boolean;
|
|
12
11
|
mode: ShadowRootMode;
|
|
@@ -15,18 +14,13 @@ declare class WarpLink extends WarpLink_base {
|
|
|
15
14
|
};
|
|
16
15
|
autofocus: boolean;
|
|
17
16
|
variant: ButtonVariant;
|
|
18
|
-
quiet: boolean;
|
|
19
17
|
small: boolean;
|
|
20
18
|
href: string;
|
|
21
19
|
disabled: boolean;
|
|
22
20
|
target: string;
|
|
23
21
|
rel: string;
|
|
24
22
|
fullWidth: boolean;
|
|
25
|
-
buttonClass: string;
|
|
26
|
-
name: string;
|
|
27
|
-
classes: string;
|
|
28
23
|
static styles: import("lit").CSSResult[];
|
|
29
|
-
constructor();
|
|
30
24
|
connectedCallback(): void;
|
|
31
25
|
firstUpdated(): void;
|
|
32
26
|
render(): import("lit").TemplateResult<1>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var e=(d,a,i,n)=>{for(var t=n>1?void 0:n?h(a,i):a,c=d.length-1,l;c>=0;c--)(l=d[c])&&(t=(n?l(a,i,t):l(t))||t);return n&&t&&u(a,i,t),t};import{html as m,LitElement as g}from"lit";import{property as o}from"lit/decorators.js";import{classMap as f}from"lit/directives/class-map.js";import{css as s}from"lit";var b=s`
|
|
2
2
|
*,
|
|
3
3
|
:before,
|
|
4
4
|
:after {
|
|
@@ -271,7 +271,7 @@ var N=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var h=(b,e,l,a
|
|
|
271
271
|
svg {
|
|
272
272
|
pointer-events: none;
|
|
273
273
|
}
|
|
274
|
-
`,
|
|
274
|
+
`,y=s`*, :before, :after {
|
|
275
275
|
--w-rotate: 0;
|
|
276
276
|
--w-rotate-x: 0;
|
|
277
277
|
--w-rotate-y: 0;
|
|
@@ -2437,7 +2437,7 @@ var N=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var h=(b,e,l,a
|
|
|
2437
2437
|
display: none
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
`;import{css as
|
|
2440
|
+
`;import{css as w}from"lit";var v=w`.w-button,
|
|
2441
2441
|
.w-button--secondary {
|
|
2442
2442
|
/* Local scoped variables, given the default button (the secondary variant) as a default */
|
|
2443
2443
|
--_background: var(--background, var(--w-s-color-background));
|
|
@@ -2529,6 +2529,10 @@ var N=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var h=(b,e,l,a
|
|
|
2529
2529
|
--color: var(--w-s-color-text);
|
|
2530
2530
|
--border-width: 0px;
|
|
2531
2531
|
}
|
|
2532
|
+
.w-button--quiet {
|
|
2533
|
+
--background: transparent;
|
|
2534
|
+
--border-width: 0px;
|
|
2535
|
+
}
|
|
2532
2536
|
.w-button--overlay {
|
|
2533
2537
|
--background: var(--w-color-background);
|
|
2534
2538
|
--background-hover: var(--w-color-background-hover);
|
|
@@ -2570,6 +2574,38 @@ var N=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var h=(b,e,l,a
|
|
|
2570
2574
|
--font-weight: normal;
|
|
2571
2575
|
display: inline;
|
|
2572
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
|
+
}
|
|
2573
2609
|
|
|
2574
2610
|
/* States config, selects --loading as well since loading is always supposed to be disabled */
|
|
2575
2611
|
.w-button:disabled,
|
|
@@ -2635,12 +2671,12 @@ var N=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var h=(b,e,l,a
|
|
|
2635
2671
|
100% {
|
|
2636
2672
|
background-position: 60px 0;
|
|
2637
2673
|
}
|
|
2638
|
-
}`;var
|
|
2639
|
-
${
|
|
2674
|
+
}`;var p=["primary","secondary","negative","negativeQuiet","utility","utilityQuiet","link","overlay","overlayInverted","overlayQuiet","overlayInvertedQuiet"],r=class extends g{constructor(){super(...arguments);this.variant="secondary"}connectedCallback(){if(super.connectedCallback(),!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 i={"w-button":this.variant!=="link","w-button--primary":this.variant==="primary","w-button--secondary":this.variant==="secondary","w-button--negative":this.variant==="negative","w-button--utility":this.variant==="utility","w-button--quiet":this.variant==="quiet","w-button--negative-quiet":this.variant==="negativeQuiet","w-button--utility-quiet":this.variant==="utilityQuiet","w-button--overlay":this.variant==="overlay","w-button--overlay-inverted":this.variant==="overlayInverted","w-button--overlay-quiet":this.variant==="overlayQuiet","w-button--overlay-inverted-quiet":this.variant==="overlayInvertedQuiet","w-button--small":this.small,"w-button--full-width":this.fullWidth,"w-button--disabled":this.disabled};return m`<a
|
|
2640
2676
|
href=${this.href}
|
|
2641
2677
|
target=${this.target}
|
|
2642
2678
|
rel=${this.target==="_blank"?this.rel||"noopener":void 0}
|
|
2643
|
-
class=${
|
|
2679
|
+
class=${f(i)}>
|
|
2644
2680
|
<slot></slot>
|
|
2645
|
-
</a>`}};
|
|
2681
|
+
</a>`}};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};
|
|
2646
2682
|
//# sourceMappingURL=index.js.map
|