@telperion/elements 5.0.6 → 5.2.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/.build-manifest.json +1 -1
- package/README.md +2 -1
- package/button/button.element.cjs +26 -13
- package/button/button.element.cjs.map +1 -1
- package/button/button.element.js +26 -13
- package/button/button.element.js.map +1 -1
- package/button/index.d.cts +7 -3
- package/button/index.d.ts +7 -3
- package/fesm/elements.mjs +26 -13
- package/fesm/elements.mjs.map +1 -1
- package/iife/button/index.js +25 -15
- package/iife/button/index.js.map +1 -1
- package/iife/elements.js +22 -12
- package/iife/elements.js.map +1 -1
- package/package.json +1 -1
package/.build-manifest.json
CHANGED
package/README.md
CHANGED
|
@@ -261,7 +261,7 @@ Framework-agnostic, form-associated button built with Lit. Behaves like the nati
|
|
|
261
261
|
- `<tp-button>` — the button itself
|
|
262
262
|
|
|
263
263
|
**Features:**
|
|
264
|
-
-
|
|
264
|
+
- Four variants: `solid` · `outline` · `ghost` · `text` (`ghost` is `outline` without the border)
|
|
265
265
|
- Form-associated via `ElementInternals` — `type="submit"` calls `form.requestSubmit()`, `type="reset"` calls `form.reset()`, and `.form` mirrors `HTMLButtonElement.form`
|
|
266
266
|
- Tab-selectable out of the box (`tabindex="0"`); `disabled` removes the button from the tab order, blocks click/keyboard activation, and sets `aria-disabled`
|
|
267
267
|
- `Space` / `Enter` activation matching native button semantics
|
|
@@ -279,6 +279,7 @@ import "@telperion/elements/button";
|
|
|
279
279
|
```html
|
|
280
280
|
<tp-button>Click me</tp-button>
|
|
281
281
|
<tp-button variant="outline" color="success">Save</tp-button>
|
|
282
|
+
<tp-button variant="ghost" color="primary">Cancel</tp-button>
|
|
282
283
|
<tp-button variant="text" color="danger" disabled>Delete</tp-button>
|
|
283
284
|
|
|
284
285
|
<form>
|
|
@@ -23,7 +23,7 @@ var shadeMixerLitElement = require('../utils/shade-mixer-lit-element.cjs');
|
|
|
23
23
|
*
|
|
24
24
|
* @element tp-button
|
|
25
25
|
*
|
|
26
|
-
* @attr {"solid" | "outline" | "text"} [variant="solid"] - Visual treatment.
|
|
26
|
+
* @attr {"solid" | "outline" | "ghost" | "text"} [variant="solid"] - Visual treatment.
|
|
27
27
|
* @attr {"button" | "submit" | "reset"} [type="button"] - Native button semantics.
|
|
28
28
|
* @attr {boolean} [disabled=false] - Disables interaction and removes the button from the tab order.
|
|
29
29
|
* @attr {string} [color="contrast"] - Palette token (`primary`, `secondary`, `success`, …) inherited from {@link ShadeMixerLitElement}.
|
|
@@ -32,6 +32,9 @@ var shadeMixerLitElement = require('../utils/shade-mixer-lit-element.cjs');
|
|
|
32
32
|
*
|
|
33
33
|
* @cssprop --tp-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
34
34
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
35
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
36
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
37
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
35
38
|
*
|
|
36
39
|
* @example
|
|
37
40
|
* ```html
|
|
@@ -55,6 +58,9 @@ exports.ButtonElement = class ButtonElement extends shadeMixerLitElement.ShadeMi
|
|
|
55
58
|
${shadeMixerLitElement.ShadeMixerLitElement.shadedElementStyles}
|
|
56
59
|
--tp-button-color: var(--tp-calc-element-color);
|
|
57
60
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
61
|
+
--tp-button-active-mixer-color: transparent;
|
|
62
|
+
--tp-button-active-mixer-percentage: 10%;
|
|
63
|
+
--tp-button-active-color: color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
58
64
|
display: inline-block;
|
|
59
65
|
border: 1px solid transparent;
|
|
60
66
|
cursor: pointer;
|
|
@@ -82,28 +88,35 @@ exports.ButtonElement = class ButtonElement extends shadeMixerLitElement.ShadeMi
|
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
&[variant="solid"],
|
|
85
|
-
&[variant="outline"]
|
|
91
|
+
&[variant="outline"],
|
|
92
|
+
&[variant="ghost"] {
|
|
86
93
|
padding-inline: 1em;
|
|
87
94
|
padding-block: 0.5em;
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
background-color: var(--tp-button-active-color);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&[variant="outline"],
|
|
102
|
+
&[variant="ghost"] {
|
|
103
|
+
color: var(--tp-button-color);
|
|
104
|
+
background-color: transparent;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&[variant="solid"],
|
|
108
|
+
&[variant="text"] {
|
|
109
|
+
--tp-button-active-mixer-color: var(--tp-color-black);
|
|
110
|
+
--tp-button-active-mixer-percentage: 80%;
|
|
88
111
|
}
|
|
89
112
|
|
|
90
113
|
&[variant="solid"] {
|
|
91
114
|
background-color: var(--tp-button-color);
|
|
92
115
|
color: var(--tp-button-contrast-color);
|
|
93
|
-
|
|
94
|
-
&:hover {
|
|
95
|
-
background-color: color-mix(in xyz, var(--tp-button-color) 80%, var(--tp-color-black) 20%);
|
|
96
|
-
}
|
|
97
116
|
}
|
|
98
117
|
|
|
99
118
|
&[variant="outline"] {
|
|
100
|
-
color: var(--tp-button-color);
|
|
101
119
|
border-color: var(--tp-button-color);
|
|
102
|
-
background-color: transparent;
|
|
103
|
-
|
|
104
|
-
&:hover {
|
|
105
|
-
background-color: color-mix(in xyz, var(--tp-button-color) 10%, transparent 90%);
|
|
106
|
-
}
|
|
107
120
|
|
|
108
121
|
&:focus-visible {
|
|
109
122
|
outline-color: transparent;
|
|
@@ -115,7 +128,7 @@ exports.ButtonElement = class ButtonElement extends shadeMixerLitElement.ShadeMi
|
|
|
115
128
|
background-color: transparent;
|
|
116
129
|
|
|
117
130
|
&:hover {
|
|
118
|
-
color:
|
|
131
|
+
color: var(--tp-button-active-color);
|
|
119
132
|
text-decoration: underline;
|
|
120
133
|
}
|
|
121
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.element.cjs","sources":["../../../../libs/elements/src/button/button.element.ts"],"sourcesContent":[null],"names":["ButtonElement","ShadeMixerLitElement","css","html","__decorate","property","customElement"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"button.element.cjs","sources":["../../../../libs/elements/src/button/button.element.ts"],"sourcesContent":[null],"names":["ButtonElement","ShadeMixerLitElement","css","html","__decorate","property","customElement"],"mappings":";;;;;;;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AAEUA,qBAAa,GAAnB,MAAM,aAAc,SAAQC,yCAAoB,CAAA;;aAE9C,IAAA,CAAA,cAAc,GAAG,IAAH,CAAQ;aACb,IAAA,CAAA,MAAM,GAAG,CAAC,MAAK;QAC7B,MAAM,KAAK,GAAGC,OAAG,CAAA,CAAA;;;AAGT,UAAA,EAAAD,yCAAoB,CAAC,mBAAmB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+E/C;AAED,QAAA,QAAQ,CAAC,kBAAkB,GAAG,CAAC,GAAG,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,UAAW,CAAC;AAEjF,QAAA,OAAO,KAAK;IACd,CAAC,GAxFqB,CAwFjB;AAoBI,IAAA,UAAU;AAEnB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;AACd,CAAA,EAAAL,qBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAO5BI,gBAAA,CAAA;IADCC,sBAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC1B,CAAA,EAAAL,qBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AA7GNA,qBAAa,GAAAI,gBAAA,CAAA;IADzBE,2BAAa,CAAC,WAAW,CAAC;;AACd,CAAA,EAAAN,qBAAa,CAiLzB;;"}
|
package/button/button.element.js
CHANGED
|
@@ -21,7 +21,7 @@ import { ShadeMixerLitElement } from '../utils/shade-mixer-lit-element.js';
|
|
|
21
21
|
*
|
|
22
22
|
* @element tp-button
|
|
23
23
|
*
|
|
24
|
-
* @attr {"solid" | "outline" | "text"} [variant="solid"] - Visual treatment.
|
|
24
|
+
* @attr {"solid" | "outline" | "ghost" | "text"} [variant="solid"] - Visual treatment.
|
|
25
25
|
* @attr {"button" | "submit" | "reset"} [type="button"] - Native button semantics.
|
|
26
26
|
* @attr {boolean} [disabled=false] - Disables interaction and removes the button from the tab order.
|
|
27
27
|
* @attr {string} [color="contrast"] - Palette token (`primary`, `secondary`, `success`, …) inherited from {@link ShadeMixerLitElement}.
|
|
@@ -30,6 +30,9 @@ import { ShadeMixerLitElement } from '../utils/shade-mixer-lit-element.js';
|
|
|
30
30
|
*
|
|
31
31
|
* @cssprop --tp-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
32
32
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
33
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
34
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
35
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
33
36
|
*
|
|
34
37
|
* @example
|
|
35
38
|
* ```html
|
|
@@ -53,6 +56,9 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
53
56
|
${ShadeMixerLitElement.shadedElementStyles}
|
|
54
57
|
--tp-button-color: var(--tp-calc-element-color);
|
|
55
58
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
59
|
+
--tp-button-active-mixer-color: transparent;
|
|
60
|
+
--tp-button-active-mixer-percentage: 10%;
|
|
61
|
+
--tp-button-active-color: color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
56
62
|
display: inline-block;
|
|
57
63
|
border: 1px solid transparent;
|
|
58
64
|
cursor: pointer;
|
|
@@ -80,28 +86,35 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
&[variant="solid"],
|
|
83
|
-
&[variant="outline"]
|
|
89
|
+
&[variant="outline"],
|
|
90
|
+
&[variant="ghost"] {
|
|
84
91
|
padding-inline: 1em;
|
|
85
92
|
padding-block: 0.5em;
|
|
93
|
+
|
|
94
|
+
&:hover {
|
|
95
|
+
background-color: var(--tp-button-active-color);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&[variant="outline"],
|
|
100
|
+
&[variant="ghost"] {
|
|
101
|
+
color: var(--tp-button-color);
|
|
102
|
+
background-color: transparent;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&[variant="solid"],
|
|
106
|
+
&[variant="text"] {
|
|
107
|
+
--tp-button-active-mixer-color: var(--tp-color-black);
|
|
108
|
+
--tp-button-active-mixer-percentage: 80%;
|
|
86
109
|
}
|
|
87
110
|
|
|
88
111
|
&[variant="solid"] {
|
|
89
112
|
background-color: var(--tp-button-color);
|
|
90
113
|
color: var(--tp-button-contrast-color);
|
|
91
|
-
|
|
92
|
-
&:hover {
|
|
93
|
-
background-color: color-mix(in xyz, var(--tp-button-color) 80%, var(--tp-color-black) 20%);
|
|
94
|
-
}
|
|
95
114
|
}
|
|
96
115
|
|
|
97
116
|
&[variant="outline"] {
|
|
98
|
-
color: var(--tp-button-color);
|
|
99
117
|
border-color: var(--tp-button-color);
|
|
100
|
-
background-color: transparent;
|
|
101
|
-
|
|
102
|
-
&:hover {
|
|
103
|
-
background-color: color-mix(in xyz, var(--tp-button-color) 10%, transparent 90%);
|
|
104
|
-
}
|
|
105
118
|
|
|
106
119
|
&:focus-visible {
|
|
107
120
|
outline-color: transparent;
|
|
@@ -113,7 +126,7 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
113
126
|
background-color: transparent;
|
|
114
127
|
|
|
115
128
|
&:hover {
|
|
116
|
-
color:
|
|
129
|
+
color: var(--tp-button-active-color);
|
|
117
130
|
text-decoration: underline;
|
|
118
131
|
}
|
|
119
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.element.js","sources":["../../../../libs/elements/src/button/button.element.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"button.element.js","sources":["../../../../libs/elements/src/button/button.element.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,oBAAoB,CAAA;;aAE9C,IAAA,CAAA,cAAc,GAAG,IAAH,CAAQ;aACb,IAAA,CAAA,MAAM,GAAG,CAAC,MAAK;QAC7B,MAAM,KAAK,GAAG,GAAG,C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I;IACb;IAEmB,MAAM,GAAA;QACvB,OAAO,IAAI,CAAA,CAAA,CAAE;IACf;;AAlFA,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACT,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAQjC,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AACd,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAO5B,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC1B,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AA7GN,aAAa,GAAA,UAAA,CAAA;IADzB,aAAa,CAAC,WAAW,CAAC;;AACd,CAAA,EAAA,aAAa,CAiLzB;;;;"}
|
package/button/index.d.cts
CHANGED
|
@@ -51,10 +51,11 @@ declare class ShadeMixerLitElement extends LitElement {
|
|
|
51
51
|
* Visual treatment applied by `<tp-button>`.
|
|
52
52
|
*
|
|
53
53
|
* - `solid`: filled background using the resolved color.
|
|
54
|
-
* - `outline`: transparent background with a colored border and text.
|
|
54
|
+
* - `outline`: transparent background with a colored border and text; subtle background tint on hover.
|
|
55
|
+
* - `ghost`: like `outline` but without the border — transparent background with colored text and the same subtle tint on hover.
|
|
55
56
|
* - `text`: no background or border — just colored text with an underline on hover.
|
|
56
57
|
*/
|
|
57
|
-
type ButtonVariant = "solid" | "outline" | "text";
|
|
58
|
+
type ButtonVariant = "solid" | "outline" | "text" | "ghost";
|
|
58
59
|
/**
|
|
59
60
|
* Mirrors the native HTML `<button>` `type` attribute.
|
|
60
61
|
*
|
|
@@ -86,7 +87,7 @@ declare global {
|
|
|
86
87
|
*
|
|
87
88
|
* @element tp-button
|
|
88
89
|
*
|
|
89
|
-
* @attr {"solid" | "outline" | "text"} [variant="solid"] - Visual treatment.
|
|
90
|
+
* @attr {"solid" | "outline" | "ghost" | "text"} [variant="solid"] - Visual treatment.
|
|
90
91
|
* @attr {"button" | "submit" | "reset"} [type="button"] - Native button semantics.
|
|
91
92
|
* @attr {boolean} [disabled=false] - Disables interaction and removes the button from the tab order.
|
|
92
93
|
* @attr {string} [color="contrast"] - Palette token (`primary`, `secondary`, `success`, …) inherited from {@link ShadeMixerLitElement}.
|
|
@@ -95,6 +96,9 @@ declare global {
|
|
|
95
96
|
*
|
|
96
97
|
* @cssprop --tp-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
97
98
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
99
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
100
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
101
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
98
102
|
*
|
|
99
103
|
* @example
|
|
100
104
|
* ```html
|
package/button/index.d.ts
CHANGED
|
@@ -51,10 +51,11 @@ declare class ShadeMixerLitElement extends LitElement {
|
|
|
51
51
|
* Visual treatment applied by `<tp-button>`.
|
|
52
52
|
*
|
|
53
53
|
* - `solid`: filled background using the resolved color.
|
|
54
|
-
* - `outline`: transparent background with a colored border and text.
|
|
54
|
+
* - `outline`: transparent background with a colored border and text; subtle background tint on hover.
|
|
55
|
+
* - `ghost`: like `outline` but without the border — transparent background with colored text and the same subtle tint on hover.
|
|
55
56
|
* - `text`: no background or border — just colored text with an underline on hover.
|
|
56
57
|
*/
|
|
57
|
-
type ButtonVariant = "solid" | "outline" | "text";
|
|
58
|
+
type ButtonVariant = "solid" | "outline" | "text" | "ghost";
|
|
58
59
|
/**
|
|
59
60
|
* Mirrors the native HTML `<button>` `type` attribute.
|
|
60
61
|
*
|
|
@@ -86,7 +87,7 @@ declare global {
|
|
|
86
87
|
*
|
|
87
88
|
* @element tp-button
|
|
88
89
|
*
|
|
89
|
-
* @attr {"solid" | "outline" | "text"} [variant="solid"] - Visual treatment.
|
|
90
|
+
* @attr {"solid" | "outline" | "ghost" | "text"} [variant="solid"] - Visual treatment.
|
|
90
91
|
* @attr {"button" | "submit" | "reset"} [type="button"] - Native button semantics.
|
|
91
92
|
* @attr {boolean} [disabled=false] - Disables interaction and removes the button from the tab order.
|
|
92
93
|
* @attr {string} [color="contrast"] - Palette token (`primary`, `secondary`, `success`, …) inherited from {@link ShadeMixerLitElement}.
|
|
@@ -95,6 +96,9 @@ declare global {
|
|
|
95
96
|
*
|
|
96
97
|
* @cssprop --tp-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
97
98
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
99
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
100
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
101
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
98
102
|
*
|
|
99
103
|
* @example
|
|
100
104
|
* ```html
|
package/fesm/elements.mjs
CHANGED
|
@@ -3430,7 +3430,7 @@ __decorate([
|
|
|
3430
3430
|
*
|
|
3431
3431
|
* @element tp-button
|
|
3432
3432
|
*
|
|
3433
|
-
* @attr {"solid" | "outline" | "text"} [variant="solid"] - Visual treatment.
|
|
3433
|
+
* @attr {"solid" | "outline" | "ghost" | "text"} [variant="solid"] - Visual treatment.
|
|
3434
3434
|
* @attr {"button" | "submit" | "reset"} [type="button"] - Native button semantics.
|
|
3435
3435
|
* @attr {boolean} [disabled=false] - Disables interaction and removes the button from the tab order.
|
|
3436
3436
|
* @attr {string} [color="contrast"] - Palette token (`primary`, `secondary`, `success`, …) inherited from {@link ShadeMixerLitElement}.
|
|
@@ -3439,6 +3439,9 @@ __decorate([
|
|
|
3439
3439
|
*
|
|
3440
3440
|
* @cssprop --tp-button-color - Resolved background/text color (defaults to the calculated palette color).
|
|
3441
3441
|
* @cssprop --tp-button-contrast-color - Resolved contrast color used for `solid` text.
|
|
3442
|
+
* @cssprop --tp-button-active-mixer-color - Color blended into `--tp-button-color` to compute the hover/active color. Defaults to `transparent` for `outline` / `ghost` (subtle tint) and `var(--tp-color-black)` for `solid` / `text` (slight darken).
|
|
3443
|
+
* @cssprop --tp-button-active-mixer-percentage - Amount of `--tp-button-color` retained when blending against the mixer color. Defaults to `10%` for `outline` / `ghost` and `80%` for `solid` / `text`. Lower values produce a stronger hover effect.
|
|
3444
|
+
* @cssprop --tp-button-active-color - Final hover/active color, computed as `color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)))`. Override directly to fully customize the hover color.
|
|
3442
3445
|
*
|
|
3443
3446
|
* @example
|
|
3444
3447
|
* ```html
|
|
@@ -3462,6 +3465,9 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
3462
3465
|
${ShadeMixerLitElement.shadedElementStyles}
|
|
3463
3466
|
--tp-button-color: var(--tp-calc-element-color);
|
|
3464
3467
|
--tp-button-contrast-color: var(--tp-calc-contrast-color);
|
|
3468
|
+
--tp-button-active-mixer-color: transparent;
|
|
3469
|
+
--tp-button-active-mixer-percentage: 10%;
|
|
3470
|
+
--tp-button-active-color: color-mix(in xyz, var(--tp-button-color) var(--tp-button-active-mixer-percentage), var(--tp-button-active-mixer-color) calc(100% - var(--tp-button-active-mixer-percentage)));
|
|
3465
3471
|
display: inline-block;
|
|
3466
3472
|
border: 1px solid transparent;
|
|
3467
3473
|
cursor: pointer;
|
|
@@ -3489,28 +3495,35 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
3489
3495
|
}
|
|
3490
3496
|
|
|
3491
3497
|
&[variant="solid"],
|
|
3492
|
-
&[variant="outline"]
|
|
3498
|
+
&[variant="outline"],
|
|
3499
|
+
&[variant="ghost"] {
|
|
3493
3500
|
padding-inline: 1em;
|
|
3494
3501
|
padding-block: 0.5em;
|
|
3502
|
+
|
|
3503
|
+
&:hover {
|
|
3504
|
+
background-color: var(--tp-button-active-color);
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
&[variant="outline"],
|
|
3509
|
+
&[variant="ghost"] {
|
|
3510
|
+
color: var(--tp-button-color);
|
|
3511
|
+
background-color: transparent;
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
&[variant="solid"],
|
|
3515
|
+
&[variant="text"] {
|
|
3516
|
+
--tp-button-active-mixer-color: var(--tp-color-black);
|
|
3517
|
+
--tp-button-active-mixer-percentage: 80%;
|
|
3495
3518
|
}
|
|
3496
3519
|
|
|
3497
3520
|
&[variant="solid"] {
|
|
3498
3521
|
background-color: var(--tp-button-color);
|
|
3499
3522
|
color: var(--tp-button-contrast-color);
|
|
3500
|
-
|
|
3501
|
-
&:hover {
|
|
3502
|
-
background-color: color-mix(in xyz, var(--tp-button-color) 80%, var(--tp-color-black) 20%);
|
|
3503
|
-
}
|
|
3504
3523
|
}
|
|
3505
3524
|
|
|
3506
3525
|
&[variant="outline"] {
|
|
3507
|
-
color: var(--tp-button-color);
|
|
3508
3526
|
border-color: var(--tp-button-color);
|
|
3509
|
-
background-color: transparent;
|
|
3510
|
-
|
|
3511
|
-
&:hover {
|
|
3512
|
-
background-color: color-mix(in xyz, var(--tp-button-color) 10%, transparent 90%);
|
|
3513
|
-
}
|
|
3514
3527
|
|
|
3515
3528
|
&:focus-visible {
|
|
3516
3529
|
outline-color: transparent;
|
|
@@ -3522,7 +3535,7 @@ let ButtonElement = class ButtonElement extends ShadeMixerLitElement {
|
|
|
3522
3535
|
background-color: transparent;
|
|
3523
3536
|
|
|
3524
3537
|
&:hover {
|
|
3525
|
-
color:
|
|
3538
|
+
color: var(--tp-button-active-color);
|
|
3526
3539
|
text-decoration: underline;
|
|
3527
3540
|
}
|
|
3528
3541
|
}
|