vira 28.19.7 → 29.0.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/dist/elements/pop-up/vira-menu.element.js +2 -4
- package/dist/elements/pop-up/vira-pop-up-menu.element.js +3 -4
- package/dist/elements/vira-button.element.d.ts +5 -2
- package/dist/elements/vira-button.element.js +54 -18
- package/dist/elements/vira-card.element.d.ts +1 -1
- package/dist/elements/vira-card.element.js +15 -6
- package/dist/elements/vira-checkbox.element.d.ts +9 -5
- package/dist/elements/vira-checkbox.element.js +45 -15
- package/dist/elements/vira-dropdown.element.js +1 -2
- package/dist/elements/vira-error.element.js +1 -1
- package/dist/elements/vira-input.element.d.ts +1 -1
- package/dist/elements/vira-input.element.js +9 -16
- package/dist/elements/vira-link.element.d.ts +1 -1
- package/dist/elements/vira-link.element.js +7 -6
- package/dist/elements/vira-modal.element.d.ts +1 -1
- package/dist/elements/vira-modal.element.js +7 -9
- package/dist/elements/vira-progress.element.d.ts +1 -1
- package/dist/elements/vira-progress.element.js +3 -4
- package/dist/elements/vira-select.element.js +5 -4
- package/dist/styles/focus.d.ts +0 -13
- package/dist/styles/focus.js +3 -17
- package/dist/styles/form-styles.d.ts +114 -11
- package/dist/styles/form-styles.js +117 -12
- package/dist/styles/index.d.ts +0 -1
- package/dist/styles/index.js +0 -1
- package/dist/styles/native-styles.js +0 -1
- package/dist/styles/vira-color-palette.d.ts +86 -84
- package/dist/styles/vira-color-palette.js +86 -84
- package/dist/styles/vira-color-theme.d.ts +456 -60
- package/dist/styles/vira-color-theme.js +471 -93
- package/package.json +3 -3
- package/dist/styles/border.d.ts +0 -9
- package/dist/styles/border.js +0 -10
|
@@ -64,8 +64,7 @@ export const ViraMenu = defineViraElement()({
|
|
|
64
64
|
baseSelector: '.menu-item:not(.disabled):not(.selected)',
|
|
65
65
|
navValue: NavValue.Active,
|
|
66
66
|
})}, .menu-item:not(.disabled):not(.selected):hover {
|
|
67
|
-
background-color: ${viraFormCssVars['vira-form-selection-hover-
|
|
68
|
-
.value};
|
|
67
|
+
background-color: ${viraFormCssVars['vira-form-selection-hover-color'].value};
|
|
69
68
|
outline: none;
|
|
70
69
|
}
|
|
71
70
|
|
|
@@ -80,8 +79,7 @@ export const ViraMenu = defineViraElement()({
|
|
|
80
79
|
navValue: NavValue.Active,
|
|
81
80
|
})},
|
|
82
81
|
.menu-item:not(.disabled):hover {
|
|
83
|
-
background-color: ${viraFormCssVars['vira-form-selection-hover-
|
|
84
|
-
.value};
|
|
82
|
+
background-color: ${viraFormCssVars['vira-form-selection-hover-color'].value};
|
|
85
83
|
outline: none;
|
|
86
84
|
}
|
|
87
85
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { css, html } from 'element-vir';
|
|
2
|
-
import { viraBorders } from '../../styles/border.js';
|
|
3
2
|
import { viraFormCssVars } from '../../styles/form-styles.js';
|
|
4
3
|
import { viraShadows } from '../../styles/shadows.js';
|
|
5
4
|
import { defineViraElement } from '../define-vira-element.js';
|
|
@@ -48,7 +47,7 @@ export const ViraPopUpMenu = defineViraElement()({
|
|
|
48
47
|
overflow-y: auto;
|
|
49
48
|
z-index: 99;
|
|
50
49
|
box-sizing: border-box;
|
|
51
|
-
border-radius: ${
|
|
50
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
52
51
|
border-top-left-radius: 0;
|
|
53
52
|
border-top-right-radius: 0;
|
|
54
53
|
background-color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
@@ -59,7 +58,7 @@ export const ViraPopUpMenu = defineViraElement()({
|
|
|
59
58
|
|
|
60
59
|
${hostClasses['vira-pop-up-menu-open-upwards'].selector} {
|
|
61
60
|
${viraShadows.menuShadowReversed}
|
|
62
|
-
border-radius: ${
|
|
61
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
63
62
|
border-bottom-left-radius: 0;
|
|
64
63
|
border-bottom-right-radius: 0;
|
|
65
64
|
}
|
|
@@ -69,7 +68,7 @@ export const ViraPopUpMenu = defineViraElement()({
|
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
${hostClasses['vira-pop-up-menu-rounded'].selector} {
|
|
72
|
-
border-radius: ${
|
|
71
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
73
72
|
}
|
|
74
73
|
`,
|
|
75
74
|
render() {
|
|
@@ -7,7 +7,10 @@ import { type ViraIconSvg } from '../icons/index.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare enum ViraButtonStyle {
|
|
9
9
|
Default = "vira-button-default",
|
|
10
|
-
Outline = "vira-button-outline"
|
|
10
|
+
Outline = "vira-button-outline",
|
|
11
|
+
Danger = "vira-button-danger",
|
|
12
|
+
DangerOutline = "vira-button-danger-outline",
|
|
13
|
+
Ghost = "vira-button-ghost"
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* A custom button with default styling.
|
|
@@ -28,4 +31,4 @@ export declare const ViraButton: import("element-vir").DeclarativeElementDefinit
|
|
|
28
31
|
* @default false
|
|
29
32
|
*/
|
|
30
33
|
expandToFitIcon: boolean;
|
|
31
|
-
}>, {}, {}, "vira-button-outline-style" | "vira-button-
|
|
34
|
+
}>, {}, {}, "vira-button-outline-style" | "vira-button-danger-style" | "vira-button-ghost-style" | "vira-button-disabled" | "vira-button-expand-to-fit-icon" | "vira-button-icon-only" | "vira-button-default-style", "vira-button-padding" | "vira-button-internal-foreground-color" | "vira-button-internal-background-color", readonly [], readonly []>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css, html, nothing } from 'element-vir';
|
|
2
|
-
import { viraBorders } from '../styles/border.js';
|
|
3
2
|
import { viraDisabledStyles } from '../styles/disabled.js';
|
|
4
3
|
import { viraAnimationDurations } from '../styles/durations.js';
|
|
5
|
-
import { createFocusStyles
|
|
4
|
+
import { createFocusStyles } from '../styles/focus.js';
|
|
5
|
+
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
6
6
|
import { noUserSelect } from '../styles/index.js';
|
|
7
7
|
import { noNativeFormStyles } from '../styles/native-styles.js';
|
|
8
8
|
import { defineViraElement } from './define-vira-element.js';
|
|
@@ -16,6 +16,9 @@ export var ViraButtonStyle;
|
|
|
16
16
|
(function (ViraButtonStyle) {
|
|
17
17
|
ViraButtonStyle["Default"] = "vira-button-default";
|
|
18
18
|
ViraButtonStyle["Outline"] = "vira-button-outline";
|
|
19
|
+
ViraButtonStyle["Danger"] = "vira-button-danger";
|
|
20
|
+
ViraButtonStyle["DangerOutline"] = "vira-button-danger-outline";
|
|
21
|
+
ViraButtonStyle["Ghost"] = "vira-button-ghost";
|
|
19
22
|
})(ViraButtonStyle || (ViraButtonStyle = {}));
|
|
20
23
|
/**
|
|
21
24
|
* A custom button with default styling.
|
|
@@ -27,17 +30,17 @@ export var ViraButtonStyle;
|
|
|
27
30
|
export const ViraButton = defineViraElement()({
|
|
28
31
|
tagName: 'vira-button',
|
|
29
32
|
hostClasses: {
|
|
30
|
-
'vira-button-outline-style': ({ inputs }) => inputs.buttonStyle === ViraButtonStyle.Outline
|
|
33
|
+
'vira-button-outline-style': ({ inputs }) => inputs.buttonStyle === ViraButtonStyle.Outline ||
|
|
34
|
+
inputs.buttonStyle === ViraButtonStyle.DangerOutline,
|
|
35
|
+
'vira-button-danger-style': ({ inputs }) => inputs.buttonStyle === ViraButtonStyle.Danger ||
|
|
36
|
+
inputs.buttonStyle === ViraButtonStyle.DangerOutline,
|
|
37
|
+
'vira-button-ghost-style': ({ inputs }) => inputs.buttonStyle === ViraButtonStyle.Ghost,
|
|
31
38
|
'vira-button-disabled': ({ inputs }) => !!inputs.disabled,
|
|
32
39
|
'vira-button-expand-to-fit-icon': ({ inputs }) => !!inputs.expandToFitIcon,
|
|
40
|
+
'vira-button-icon-only': ({ inputs }) => !!inputs.icon && !inputs.text,
|
|
41
|
+
'vira-button-default-style': ({ inputs }) => !inputs.buttonStyle || inputs.buttonStyle === ViraButtonStyle.Default,
|
|
33
42
|
},
|
|
34
43
|
cssVars: {
|
|
35
|
-
/** On the default button style this is the background color. */
|
|
36
|
-
'vira-button-primary-color': '#0a89ff',
|
|
37
|
-
'vira-button-primary-hover-color': '#59b1ff',
|
|
38
|
-
'vira-button-primary-active-color': '#007ff6',
|
|
39
|
-
/** On the default button style this is the text color. */
|
|
40
|
-
'vira-button-secondary-color': '#ffffff',
|
|
41
44
|
'vira-button-padding': '5px 10px',
|
|
42
45
|
'vira-button-internal-foreground-color': 'transparent',
|
|
43
46
|
'vira-button-internal-background-color': 'transparent',
|
|
@@ -51,28 +54,61 @@ export const ViraButton = defineViraElement()({
|
|
|
51
54
|
align-items: center;
|
|
52
55
|
box-sizing: border-box;
|
|
53
56
|
${noUserSelect};
|
|
54
|
-
${cssVars['vira-button-internal-background-color'].name}: ${
|
|
55
|
-
${cssVars['vira-button-internal-foreground-color'].name}: ${
|
|
56
|
-
${
|
|
57
|
+
${cssVars['vira-button-internal-background-color'].name}: ${viraFormCssVars['vira-form-accent-primary-color'].value};
|
|
58
|
+
${cssVars['vira-button-internal-foreground-color'].name}: ${viraFormCssVars['vira-form-background-color'].value};
|
|
59
|
+
${viraFormCssVars['vira-form-focus-outline-color'].name}: ${viraFormCssVars['vira-form-accent-primary-hover-color'].value}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
${hostClasses['vira-button-disabled'].selector} {
|
|
63
|
+
${viraDisabledStyles};
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
:host(:hover) button,
|
|
60
67
|
button:hover {
|
|
61
|
-
${cssVars['vira-button-internal-background-color'].name}: ${
|
|
68
|
+
${cssVars['vira-button-internal-background-color'].name}: ${viraFormCssVars['vira-form-accent-primary-hover-color'].value};
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
:host(:active) button,
|
|
65
72
|
button:active {
|
|
66
|
-
${cssVars['vira-button-internal-background-color'].name}: ${
|
|
73
|
+
${cssVars['vira-button-internal-background-color'].name}: ${viraFormCssVars['vira-form-accent-primary-active-color'].value};
|
|
67
74
|
}
|
|
68
75
|
|
|
69
|
-
${hostClasses['vira-button-
|
|
70
|
-
|
|
76
|
+
${hostClasses['vira-button-danger-style'].selector} {
|
|
77
|
+
& button {
|
|
78
|
+
${cssVars['vira-button-internal-background-color'].name}: ${viraFormCssVars['vira-form-error-color'].value};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:hover button,
|
|
82
|
+
& button:hover {
|
|
83
|
+
${cssVars['vira-button-internal-background-color'].name}: ${viraFormCssVars['vira-form-error-hover-color'].value};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:active button,
|
|
87
|
+
& button:active {
|
|
88
|
+
${cssVars['vira-button-internal-background-color'].name}: ${viraFormCssVars['vira-form-error-active-color'].value};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
${hostClasses['vira-button-ghost-style'].selector} {
|
|
93
|
+
& button {
|
|
94
|
+
${cssVars['vira-button-internal-background-color'].name}: transparent;
|
|
95
|
+
${cssVars['vira-button-internal-foreground-color'].name}: currentColor;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:hover button,
|
|
99
|
+
& button:hover {
|
|
100
|
+
${cssVars['vira-button-internal-background-color'].name}: ${viraFormCssVars['vira-form-filled-background-color'].value};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:active button,
|
|
104
|
+
& button:active {
|
|
105
|
+
${cssVars['vira-button-internal-background-color'].name}: ${viraFormCssVars['vira-form-filled-active-background-color'].value};
|
|
106
|
+
}
|
|
71
107
|
}
|
|
72
108
|
|
|
73
109
|
${hostClasses['vira-button-outline-style'].selector} button {
|
|
74
110
|
color: ${cssVars['vira-button-internal-background-color'].value};
|
|
75
|
-
background-color:
|
|
111
|
+
background-color: ${cssVars['vira-button-internal-foreground-color'].value};
|
|
76
112
|
border-color: currentColor;
|
|
77
113
|
}
|
|
78
114
|
|
|
@@ -87,7 +123,7 @@ export const ViraButton = defineViraElement()({
|
|
|
87
123
|
display: inline-flex;
|
|
88
124
|
justify-content: center;
|
|
89
125
|
align-items: center;
|
|
90
|
-
border-radius: ${
|
|
126
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
91
127
|
background-color: ${cssVars['vira-button-internal-background-color'].value};
|
|
92
128
|
color: ${cssVars['vira-button-internal-foreground-color'].value};
|
|
93
129
|
padding: ${cssVars['vira-button-padding'].value};
|
|
@@ -15,4 +15,4 @@ export declare enum ViraCardState {
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const ViraCard: import("element-vir").DeclarativeElementDefinition<"vira-card", {
|
|
17
17
|
cardState?: ViraCardState | undefined;
|
|
18
|
-
}, {}, {}, "vira-card-error" | "vira-card-success", "vira-card-border" | "vira-card-
|
|
18
|
+
}, {}, {}, "vira-card-error" | "vira-card-success", "vira-card-border" | "vira-card-padding", readonly [], readonly []>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { css, html } from 'element-vir';
|
|
2
|
+
import { CssVarSyntaxName } from 'lit-css-vars';
|
|
2
3
|
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
3
4
|
import { defineViraElement } from './define-vira-element.js';
|
|
4
5
|
/**
|
|
@@ -24,23 +25,31 @@ export const ViraCard = defineViraElement()({
|
|
|
24
25
|
'vira-card-success': ({ inputs }) => inputs.cardState === ViraCardState.Success,
|
|
25
26
|
},
|
|
26
27
|
cssVars: {
|
|
27
|
-
'vira-card-border':
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
'vira-card-border': {
|
|
29
|
+
default: css `1px solid ${viraFormCssVars['vira-form-border-color'].value}`,
|
|
30
|
+
initialValue: 'none',
|
|
31
|
+
},
|
|
32
|
+
'vira-card-padding': {
|
|
33
|
+
default: css `
|
|
34
|
+
${viraFormCssVars['vira-form-wrapper-radius'].value}
|
|
35
|
+
`,
|
|
36
|
+
initialValue: '16px',
|
|
37
|
+
syntax: CssVarSyntaxName.Length,
|
|
38
|
+
},
|
|
30
39
|
},
|
|
31
40
|
styles: ({ hostClasses, cssVars }) => css `
|
|
32
41
|
:host {
|
|
33
42
|
display: block;
|
|
34
43
|
border: ${cssVars['vira-card-border'].value};
|
|
35
|
-
border-radius: ${
|
|
44
|
+
border-radius: ${viraFormCssVars['vira-form-wrapper-radius'].value};
|
|
36
45
|
padding: ${cssVars['vira-card-padding'].value};
|
|
37
46
|
}
|
|
38
47
|
|
|
39
48
|
${hostClasses['vira-card-error'].selector} {
|
|
40
|
-
border-color: ${viraFormCssVars['vira-form-error-
|
|
49
|
+
border-color: ${viraFormCssVars['vira-form-error-color'].value};
|
|
41
50
|
}
|
|
42
51
|
${hostClasses['vira-card-success'].selector} {
|
|
43
|
-
border-color: ${viraFormCssVars['vira-form-success-
|
|
52
|
+
border-color: ${viraFormCssVars['vira-form-success-color'].value};
|
|
44
53
|
}
|
|
45
54
|
`,
|
|
46
55
|
render() {
|
|
@@ -12,16 +12,20 @@ export type ViraCheckboxInnerElements = 'label' | 'custom-checkbox' | 'text' | t
|
|
|
12
12
|
*
|
|
13
13
|
* @category Internal
|
|
14
14
|
*/
|
|
15
|
-
export type ViraCheckboxInputs =
|
|
15
|
+
export type ViraCheckboxInputs = {
|
|
16
|
+
value: boolean;
|
|
17
|
+
} & PartialWithUndefined<{
|
|
16
18
|
stylePassthrough: Partial<Record<ViraCheckboxInnerElements, CSSResult>>;
|
|
17
19
|
attributePassthrough: Partial<Record<ViraCheckboxInnerElements, AttributeValues>>;
|
|
18
20
|
disabled: boolean;
|
|
19
21
|
label: string;
|
|
20
22
|
hasError: boolean;
|
|
21
23
|
horizontal: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
/** The checkbox will be filled with a form selection color when it is checked. */
|
|
25
|
+
fillWhenChecked: boolean;
|
|
26
|
+
/** The checkbox will be filled with a form error color when it is unchecked. */
|
|
27
|
+
fillWhenUnchecked: boolean;
|
|
28
|
+
}>;
|
|
25
29
|
/**
|
|
26
30
|
* A custom checkbox.
|
|
27
31
|
*
|
|
@@ -31,4 +35,4 @@ export type ViraCheckboxInputs = PartialWithUndefined<{
|
|
|
31
35
|
*/
|
|
32
36
|
export declare const ViraCheckbox: import("element-vir").DeclarativeElementDefinition<"vira-checkbox", Readonly<ViraCheckboxInputs>, {}, {
|
|
33
37
|
valueChange: import("element-vir").DefineEvent<boolean>;
|
|
34
|
-
}, "vira-checkbox-horizontal", "vira-checkbox-", readonly [], readonly []>;
|
|
38
|
+
}, "vira-checkbox-horizontal" | "vira-checkbox-filled-checked" | "vira-checkbox-filled-unchecked", "vira-checkbox-", readonly [], readonly []>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { attributes, classMap, css, defineElementEvent, html, ifDefined, listen, listenToActivate, nothing, } from 'element-vir';
|
|
2
2
|
import { Check24Icon, viraIconCssVars } from '../icons/index.js';
|
|
3
|
-
import { viraBorders } from '../styles/border.js';
|
|
4
3
|
import { viraDisabledStyles } from '../styles/disabled.js';
|
|
5
4
|
import { createFocusStyles } from '../styles/focus.js';
|
|
6
5
|
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
@@ -17,6 +16,8 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
17
16
|
tagName: 'vira-checkbox',
|
|
18
17
|
hostClasses: {
|
|
19
18
|
'vira-checkbox-horizontal': ({ inputs }) => !!inputs.horizontal,
|
|
19
|
+
'vira-checkbox-filled-checked': ({ inputs }) => !!inputs.fillWhenChecked,
|
|
20
|
+
'vira-checkbox-filled-unchecked': ({ inputs }) => !!inputs.fillWhenUnchecked,
|
|
20
21
|
},
|
|
21
22
|
styles: ({ hostClasses }) => css `
|
|
22
23
|
:host {
|
|
@@ -33,6 +34,43 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
33
34
|
width: 100%;
|
|
34
35
|
height: 100%;
|
|
35
36
|
box-sizing: border-box;
|
|
37
|
+
${viraIconCssVars['vira-icon-stroke-width'].name}: 3px;
|
|
38
|
+
opacity: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
${hostClasses['vira-checkbox-filled-checked'].selector} {
|
|
42
|
+
& .custom-checkbox.checked {
|
|
43
|
+
color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
44
|
+
background-color: ${viraFormCssVars['vira-form-accent-primary-color'].value};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
label {
|
|
48
|
+
&:hover .custom-checkbox.checked {
|
|
49
|
+
background-color: ${viraFormCssVars['vira-form-accent-primary-hover-color']
|
|
50
|
+
.value};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:active .custom-checkbox.checked {
|
|
54
|
+
background-color: ${viraFormCssVars['vira-form-accent-primary-active-color']
|
|
55
|
+
.value};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
${hostClasses['vira-checkbox-filled-unchecked'].selector} {
|
|
60
|
+
& .custom-checkbox:not(.checked) {
|
|
61
|
+
color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
62
|
+
background-color: ${viraFormCssVars['vira-form-error-color'].value};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
label {
|
|
66
|
+
&:hover .custom-checkbox:not(.checked) {
|
|
67
|
+
background-color: ${viraFormCssVars['vira-form-error-hover-color'].value};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&:active .custom-checkbox:not(.checked) {
|
|
71
|
+
background-color: ${viraFormCssVars['vira-form-error-active-color'].value};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
36
74
|
}
|
|
37
75
|
|
|
38
76
|
label {
|
|
@@ -51,14 +89,11 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
51
89
|
}
|
|
52
90
|
|
|
53
91
|
&:hover .custom-checkbox {
|
|
54
|
-
background-color: ${viraFormCssVars['vira-form-selection-hover-
|
|
55
|
-
|
|
92
|
+
background-color: ${viraFormCssVars['vira-form-selection-hover-color'].value};
|
|
93
|
+
}
|
|
94
|
+
&:active .custom-checkbox {
|
|
95
|
+
background-color: ${viraFormCssVars['vira-form-selection-active-color'].value};
|
|
56
96
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
${ViraIcon} {
|
|
60
|
-
${viraIconCssVars['vira-icon-stroke-width'].name}: 2px;
|
|
61
|
-
opacity: 0;
|
|
62
97
|
}
|
|
63
98
|
|
|
64
99
|
/* The visible custom box */
|
|
@@ -66,7 +101,7 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
66
101
|
flex-shrink: 0;
|
|
67
102
|
border: 1px solid ${viraFormCssVars['vira-form-border-color'].value};
|
|
68
103
|
color: ${viraFormCssVars['vira-form-foreground-color'].value};
|
|
69
|
-
border-radius: ${
|
|
104
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
70
105
|
display: inline-block;
|
|
71
106
|
position: relative;
|
|
72
107
|
cursor: pointer;
|
|
@@ -80,12 +115,7 @@ export const ViraCheckbox = defineViraElement()({
|
|
|
80
115
|
}
|
|
81
116
|
|
|
82
117
|
&.error {
|
|
83
|
-
border-color: ${viraFormCssVars['vira-form-error-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&:active {
|
|
87
|
-
background-color: ${viraFormCssVars['vira-form-selection-active-background-color']
|
|
88
|
-
.value};
|
|
118
|
+
border-color: ${viraFormCssVars['vira-form-error-color'].value};
|
|
89
119
|
}
|
|
90
120
|
|
|
91
121
|
&.disabled {
|
|
@@ -2,7 +2,6 @@ import { check } from '@augment-vir/assert';
|
|
|
2
2
|
import { filterMap } from '@augment-vir/common';
|
|
3
3
|
import { classMap, css, defineElementEvent, html, ifDefined, listen, nothing, testId, } from 'element-vir';
|
|
4
4
|
import { ChevronUp24Icon } from '../icons/index.js';
|
|
5
|
-
import { viraBorders } from '../styles/border.js';
|
|
6
5
|
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
7
6
|
import { noUserSelect, viraAnimationDurations } from '../styles/index.js';
|
|
8
7
|
import { defineViraElement } from './define-vira-element.js';
|
|
@@ -87,7 +86,7 @@ export const ViraDropdown = defineViraElement()({
|
|
|
87
86
|
align-items: center;
|
|
88
87
|
padding: 3px;
|
|
89
88
|
padding-left: 10px;
|
|
90
|
-
border-radius: ${
|
|
89
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
91
90
|
background-color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
92
91
|
color: ${viraFormCssVars['vira-form-foreground-color'].value};
|
|
93
92
|
}
|
|
@@ -14,7 +14,7 @@ export const ViraError = defineViraElement()({
|
|
|
14
14
|
},
|
|
15
15
|
styles: ({ cssVars }) => css `
|
|
16
16
|
:host {
|
|
17
|
-
color: ${viraFormCssVars['vira-form-error-
|
|
17
|
+
color: ${viraFormCssVars['vira-form-error-color'].value};
|
|
18
18
|
font-weight: ${cssVars['vira-error-font-weight'].value};
|
|
19
19
|
}
|
|
20
20
|
`,
|
|
@@ -59,4 +59,4 @@ export declare const ViraInput: import("element-vir").DeclarativeElementDefiniti
|
|
|
59
59
|
* that was blocked out of programmatic "value" property assignments.
|
|
60
60
|
*/
|
|
61
61
|
inputBlocked: import("element-vir").DefineEvent<string>;
|
|
62
|
-
}, "vira-input-disabled" | "vira-input-fit-text" | "vira-input-clear-button-shown" | "vira-input-error", "vira-input-
|
|
62
|
+
}, "vira-input-disabled" | "vira-input-fit-text" | "vira-input-clear-button-shown" | "vira-input-error", "vira-input-padding-horizontal" | "vira-input-padding-vertical", readonly [], readonly []>;
|
|
@@ -6,7 +6,7 @@ import { CloseX24Icon } from '../icons/icon-svgs/close-x-24.icon.js';
|
|
|
6
6
|
import { EyeClosed24Icon, EyeOpen24Icon } from '../icons/index.js';
|
|
7
7
|
import { createFocusStyles } from '../styles/focus.js';
|
|
8
8
|
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
9
|
-
import { noUserSelect, viraAnimationDurations,
|
|
9
|
+
import { noUserSelect, viraAnimationDurations, viraDisabledStyles } from '../styles/index.js';
|
|
10
10
|
import { noNativeFormStyles } from '../styles/native-styles.js';
|
|
11
11
|
import { defineViraElement } from './define-vira-element.js';
|
|
12
12
|
import { filterTextInputValue, textInputListener, } from './shared-text-input-logic.js';
|
|
@@ -34,13 +34,6 @@ export var ViraInputType;
|
|
|
34
34
|
export const ViraInput = defineViraElement()({
|
|
35
35
|
tagName: 'vira-input',
|
|
36
36
|
cssVars: {
|
|
37
|
-
'vira-input-action-button-color': '#aaaaaa',
|
|
38
|
-
'vira-input-clear-button-hover-color': '#ff0000',
|
|
39
|
-
'vira-input-clear-button-active-color': '#b30000',
|
|
40
|
-
// eslint-disable-next-line sonarjs/no-hardcoded-passwords
|
|
41
|
-
'vira-input-show-password-button-hover-color': '#0a89ff',
|
|
42
|
-
// eslint-disable-next-line sonarjs/no-hardcoded-passwords
|
|
43
|
-
'vira-input-show-password-button-active-color': '#0261ba',
|
|
44
37
|
'vira-input-padding-horizontal': '10px',
|
|
45
38
|
'vira-input-padding-vertical': '6px',
|
|
46
39
|
},
|
|
@@ -127,7 +120,7 @@ export const ViraInput = defineViraElement()({
|
|
|
127
120
|
left: 0;
|
|
128
121
|
width: 100%;
|
|
129
122
|
height: 100%;
|
|
130
|
-
border-radius: ${
|
|
123
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
131
124
|
z-index: 0;
|
|
132
125
|
pointer-events: none;
|
|
133
126
|
}
|
|
@@ -147,7 +140,7 @@ export const ViraInput = defineViraElement()({
|
|
|
147
140
|
align-items: center;
|
|
148
141
|
position: relative;
|
|
149
142
|
padding: 0 ${cssVars['vira-input-padding-horizontal'].value};
|
|
150
|
-
border-radius: ${
|
|
143
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
151
144
|
background-color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
152
145
|
/*
|
|
153
146
|
Border colors are actually applied via the .wrapper-border class. However, we must
|
|
@@ -217,28 +210,28 @@ export const ViraInput = defineViraElement()({
|
|
|
217
210
|
|
|
218
211
|
.clear-x-button,
|
|
219
212
|
.show-password-button {
|
|
220
|
-
color: ${
|
|
213
|
+
color: ${viraFormCssVars['vira-form-placeholder-color'].value};
|
|
221
214
|
}
|
|
222
215
|
|
|
223
216
|
.clear-x-button:hover {
|
|
224
|
-
color: ${
|
|
217
|
+
color: ${viraFormCssVars['vira-form-error-color'].value};
|
|
225
218
|
}
|
|
226
219
|
|
|
227
220
|
.clear-x-button:active {
|
|
228
|
-
color: ${
|
|
221
|
+
color: ${viraFormCssVars['vira-form-error-active-color'].value};
|
|
229
222
|
}
|
|
230
223
|
|
|
231
224
|
.show-password-button:hover {
|
|
232
|
-
color: ${
|
|
225
|
+
color: ${viraFormCssVars['vira-form-accent-primary-color'].value};
|
|
233
226
|
}
|
|
234
227
|
|
|
235
228
|
.show-password-button:active {
|
|
236
|
-
color: ${
|
|
229
|
+
color: ${viraFormCssVars['vira-form-accent-primary-active-color'].value};
|
|
237
230
|
}
|
|
238
231
|
|
|
239
232
|
${hostClasses['vira-input-error'].selector} {
|
|
240
233
|
& .wrapper-border {
|
|
241
|
-
border-color: ${viraFormCssVars['vira-form-error-
|
|
234
|
+
border-color: ${viraFormCssVars['vira-form-error-color'].value};
|
|
242
235
|
}
|
|
243
236
|
}
|
|
244
237
|
|
|
@@ -70,4 +70,4 @@ export declare const ViraLink: import("element-vir").DeclarativeElementDefinitio
|
|
|
70
70
|
attributePassthrough: Readonly<PartialWithUndefined<{
|
|
71
71
|
a: AttributeValues;
|
|
72
72
|
}>>;
|
|
73
|
-
}>, {}, {}, "vira-link-", "vira-link-
|
|
73
|
+
}>, {}, {}, "vira-link-", "vira-link-", readonly [], readonly []>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { attributes, css, html, ifDefined, listen, } from 'element-vir';
|
|
2
|
+
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
2
3
|
import { defineViraElement } from './define-vira-element.js';
|
|
3
4
|
/**
|
|
4
5
|
* A hyperlink wrapper element that can be configured to emit route change events rather than just
|
|
@@ -10,10 +11,7 @@ import { defineViraElement } from './define-vira-element.js';
|
|
|
10
11
|
*/
|
|
11
12
|
export const ViraLink = defineViraElement()({
|
|
12
13
|
tagName: 'vira-link',
|
|
13
|
-
|
|
14
|
-
'vira-link-hover-color': 'currentColor',
|
|
15
|
-
},
|
|
16
|
-
styles: ({ cssVars }) => css `
|
|
14
|
+
styles: css `
|
|
17
15
|
:host {
|
|
18
16
|
display: inline;
|
|
19
17
|
text-decoration: underline;
|
|
@@ -30,10 +28,13 @@ export const ViraLink = defineViraElement()({
|
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
:host(:hover) a,
|
|
33
|
-
a:hover
|
|
31
|
+
a:hover {
|
|
32
|
+
color: ${viraFormCssVars['vira-form-accent-primary-color'].value};
|
|
33
|
+
}
|
|
34
|
+
|
|
34
35
|
:host(:active) a,
|
|
35
36
|
a:active {
|
|
36
|
-
color: ${
|
|
37
|
+
color: ${viraFormCssVars['vira-form-accent-primary-active-color'].value};
|
|
37
38
|
}
|
|
38
39
|
`,
|
|
39
40
|
render({ inputs }) {
|
|
@@ -36,4 +36,4 @@ export declare const ViraModal: import("element-vir").DeclarativeElementDefiniti
|
|
|
36
36
|
cleanup: undefined | (() => void);
|
|
37
37
|
}, {
|
|
38
38
|
modalClose: import("element-vir").DefineEvent<void>;
|
|
39
|
-
}, "vira-modal-phone-size", "vira-modal-backdrop-
|
|
39
|
+
}, "vira-modal-phone-size", "vira-modal-backdrop-filter", readonly ["modalTitle"], readonly []>;
|
|
@@ -2,6 +2,7 @@ import { assertWrap } from '@augment-vir/assert';
|
|
|
2
2
|
import { css, defineElementEvent, html, listen, nothing, onDomCreated } from 'element-vir';
|
|
3
3
|
import { listenToGlobal } from 'typed-event-target';
|
|
4
4
|
import { X24Icon } from '../icons/icon-svgs/x-24.icon.js';
|
|
5
|
+
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
5
6
|
import { noNativeFormStyles, noNativeSpacing } from '../styles/native-styles.js';
|
|
6
7
|
import { viraShadows } from '../styles/shadows.js';
|
|
7
8
|
import { defineViraElement } from './define-vira-element.js';
|
|
@@ -39,11 +40,7 @@ export const ViraModal = defineViraElement()({
|
|
|
39
40
|
},
|
|
40
41
|
slotNames: ['modalTitle'],
|
|
41
42
|
cssVars: {
|
|
42
|
-
'vira-modal-backdrop-color': 'rgba(0, 0, 0, 0.35)',
|
|
43
43
|
'vira-modal-backdrop-filter': 'blur(3px)',
|
|
44
|
-
'vira-modal-subtitle-color': '#7E7E7E',
|
|
45
|
-
'vira-modal-close-button-hover-radius': '8px',
|
|
46
|
-
'vira-modal-close-button-hover-background-color': '#E4E4E4',
|
|
47
44
|
},
|
|
48
45
|
styles: ({ hostClasses, cssVars }) => css `
|
|
49
46
|
:host {
|
|
@@ -72,7 +69,7 @@ export const ViraModal = defineViraElement()({
|
|
|
72
69
|
display: flex;
|
|
73
70
|
}
|
|
74
71
|
&::backdrop {
|
|
75
|
-
background: ${
|
|
72
|
+
background: ${viraFormCssVars['vira-form-modal-backdrop-color'].value};
|
|
76
73
|
backdrop-filter: ${cssVars['vira-modal-backdrop-filter'].value};
|
|
77
74
|
}
|
|
78
75
|
|
|
@@ -100,7 +97,7 @@ export const ViraModal = defineViraElement()({
|
|
|
100
97
|
|
|
101
98
|
& sub {
|
|
102
99
|
font-size: 16px;
|
|
103
|
-
color: ${
|
|
100
|
+
color: ${viraFormCssVars['vira-form-secondary-body-foreground'].value};
|
|
104
101
|
}
|
|
105
102
|
}
|
|
106
103
|
|
|
@@ -108,10 +105,11 @@ export const ViraModal = defineViraElement()({
|
|
|
108
105
|
${noNativeFormStyles};
|
|
109
106
|
cursor: pointer;
|
|
110
107
|
padding: 4px;
|
|
111
|
-
border-radius: ${
|
|
108
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
112
109
|
|
|
113
110
|
&:hover {
|
|
114
|
-
background-color: ${
|
|
111
|
+
background-color: ${viraFormCssVars['vira-form-selection-hover-color']
|
|
112
|
+
.value};
|
|
115
113
|
}
|
|
116
114
|
|
|
117
115
|
& ${ViraIcon} {
|
|
@@ -171,7 +169,7 @@ export const ViraModal = defineViraElement()({
|
|
|
171
169
|
${listen('close', () => {
|
|
172
170
|
close();
|
|
173
171
|
})}
|
|
174
|
-
${listen('
|
|
172
|
+
${listen('mousedown', (event) => {
|
|
175
173
|
if (state.contentElement &&
|
|
176
174
|
!event.composedPath().includes(state.contentElement) &&
|
|
177
175
|
!inputs.blockLightDismissal) {
|
|
@@ -15,4 +15,4 @@ export declare const ViraProgress: import("element-vir").DeclarativeElementDefin
|
|
|
15
15
|
min: number;
|
|
16
16
|
/** @default 100 */
|
|
17
17
|
max: number;
|
|
18
|
-
}>>, {}, {}, "vira-progress-", "vira-progress-border-radius"
|
|
18
|
+
}>>, {}, {}, "vira-progress-", "vira-progress-border-radius", readonly [], readonly []>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { clamp } from '@augment-vir/common';
|
|
2
2
|
import { applyAttributes } from 'device-navigation';
|
|
3
3
|
import { css, html } from 'element-vir';
|
|
4
|
+
import { viraFormCssVars } from '../styles/form-styles.js';
|
|
4
5
|
import { defineViraElement } from './define-vira-element.js';
|
|
5
6
|
/**
|
|
6
7
|
* A [`<progress>`](https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/progress)
|
|
@@ -19,8 +20,6 @@ export const ViraProgress = defineViraElement()({
|
|
|
19
20
|
* dimension which creates a perfect pill border radius.
|
|
20
21
|
*/
|
|
21
22
|
'vira-progress-border-radius': '99999999px',
|
|
22
|
-
'vira-progress-background-color': '#eee',
|
|
23
|
-
'vira-progress-foreground-color': 'dodgerblue',
|
|
24
23
|
},
|
|
25
24
|
styles: ({ cssVars }) => css `
|
|
26
25
|
:host {
|
|
@@ -31,7 +30,7 @@ export const ViraProgress = defineViraElement()({
|
|
|
31
30
|
display: inline-flex;
|
|
32
31
|
align-items: center;
|
|
33
32
|
border-radius: ${cssVars['vira-progress-border-radius'].value};
|
|
34
|
-
color: ${
|
|
33
|
+
color: ${viraFormCssVars['vira-form-accent-primary-color'].value};
|
|
35
34
|
overflow: hidden;
|
|
36
35
|
}
|
|
37
36
|
|
|
@@ -41,7 +40,7 @@ export const ViraProgress = defineViraElement()({
|
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
.background-bar {
|
|
44
|
-
background-color: ${
|
|
43
|
+
background-color: ${viraFormCssVars['vira-form-filled-background-color'].value};
|
|
45
44
|
height: 100%;
|
|
46
45
|
flex-grow: 1;
|
|
47
46
|
}
|